LZ4_decompress_safe:
 2452|    444|{
 2453|    444|    return LZ4_decompress_generic(source, dest, compressedSize, maxDecompressedSize,
 2454|    444|                                  decode_full_block, noDict,
 2455|       |                                  (BYTE*)dest, NULL, 0);
 2456|    444|}
LZ4_decompress_safe_forceExtDict:
 2526|    334|{
 2527|    334|    DEBUGLOG(5, "LZ4_decompress_safe_forceExtDict");
  ------------------
  |  |  289|    334|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2528|    334|    return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize,
 2529|    334|                                  decode_full_block, usingExtDict,
 2530|    334|                                  (BYTE*)dest, (const BYTE*)dictStart, dictSize);
 2531|    334|}
LZ4_decompress_safe_usingDict:
 2720|    334|{
 2721|    334|    if (dictSize==0)
  ------------------
  |  Branch (2721:9): [True: 0, False: 334]
  ------------------
 2722|      0|        return LZ4_decompress_safe(source, dest, compressedSize, maxOutputSize);
 2723|    334|    if (dictStart+dictSize == dest) {
  ------------------
  |  Branch (2723:9): [True: 0, False: 334]
  ------------------
 2724|      0|        if (dictSize >= 64 KB - 1) {
  ------------------
  |  |  251|      0|#define KB *(1 <<10)
  ------------------
  |  Branch (2724:13): [True: 0, False: 0]
  ------------------
 2725|      0|            return LZ4_decompress_safe_withPrefix64k(source, dest, compressedSize, maxOutputSize);
 2726|      0|        }
 2727|      0|        assert(dictSize >= 0);
  ------------------
  |  |  273|      0|#    define assert(condition) ((void)0)
  ------------------
 2728|      0|        return LZ4_decompress_safe_withSmallPrefix(source, dest, compressedSize, maxOutputSize, (size_t)dictSize);
 2729|      0|    }
 2730|    334|    assert(dictSize >= 0);
  ------------------
  |  |  273|    334|#    define assert(condition) ((void)0)
  ------------------
 2731|    334|    return LZ4_decompress_safe_forceExtDict(source, dest, compressedSize, maxOutputSize, dictStart, (size_t)dictSize);
 2732|    334|}
lz4.c:LZ4_wildCopy8:
  466|  8.34k|{
  467|  8.34k|    BYTE* d = (BYTE*)dstPtr;
  468|  8.34k|    const BYTE* s = (const BYTE*)srcPtr;
  469|  8.34k|    BYTE* const e = (BYTE*)dstEnd;
  470|       |
  471|  1.16M|    do { LZ4_memcpy(d,s,8); d+=8; s+=8; } while (d<e);
  ------------------
  |  |  349|  1.16M|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (471:50): [True: 1.15M, False: 8.34k]
  ------------------
  472|  8.34k|}
lz4.c:LZ4_isLittleEndian:
  364|  78.0k|{
  365|  78.0k|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental */
  366|  78.0k|    return one.c[0];
  367|  78.0k|}
lz4.c:LZ4_read16:
  393|  78.0k|static U16 LZ4_read16(const void* ptr) { return ((const LZ4_unalign16*)ptr)->u16; }
lz4.c:LZ4_write32:
  398|  7.34k|static void LZ4_write32(void* memPtr, U32 value) { ((LZ4_unalign32*)memPtr)->u32 = value; }
lz4.c:LZ4_decompress_generic:
 2035|    778|{
 2036|    778|    if ((src == NULL) || (outputSize < 0)) { return -1; }
  ------------------
  |  Branch (2036:9): [True: 0, False: 778]
  |  Branch (2036:26): [True: 0, False: 778]
  ------------------
 2037|       |
 2038|    778|    {   const BYTE* ip = (const BYTE*) src;
 2039|    778|        const BYTE* const iend = ip + srcSize;
 2040|       |
 2041|    778|        BYTE* op = (BYTE*) dst;
 2042|    778|        BYTE* const oend = op + outputSize;
 2043|    778|        BYTE* cpy;
 2044|       |
 2045|    778|        const BYTE* const dictEnd = (dictStart == NULL) ? NULL : dictStart + dictSize;
  ------------------
  |  Branch (2045:37): [True: 444, False: 334]
  ------------------
 2046|       |
 2047|    778|        const int checkOffset = (dictSize < (int)(64 KB));
  ------------------
  |  |  251|    778|#define KB *(1 <<10)
  ------------------
 2048|       |
 2049|       |
 2050|       |        /* Set up the "end" pointers for the shortcut. */
 2051|    778|        const BYTE* const shortiend = iend - 14 /*maxLL*/ - 2 /*offset*/;
 2052|    778|        const BYTE* const shortoend = oend - 14 /*maxLL*/ - 18 /*maxML*/;
 2053|       |
 2054|    778|        const BYTE* match;
 2055|    778|        size_t offset;
 2056|    778|        unsigned token;
 2057|    778|        size_t length;
 2058|       |
 2059|       |
 2060|    778|        DEBUGLOG(5, "LZ4_decompress_generic (srcSize:%i, dstSize:%i)", srcSize, outputSize);
  ------------------
  |  |  289|    778|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2061|       |
 2062|       |        /* Special cases */
 2063|    778|        assert(lowPrefix <= op);
  ------------------
  |  |  273|    778|#    define assert(condition) ((void)0)
  ------------------
 2064|    778|        if (unlikely(outputSize==0)) {
  ------------------
  |  |  180|    778|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    778|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 778]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2065|       |            /* Empty output buffer */
 2066|      0|            if (partialDecoding) return 0;
  ------------------
  |  Branch (2066:17): [True: 0, False: 0]
  ------------------
 2067|      0|            return ((srcSize==1) && (*ip==0)) ? 0 : -1;
  ------------------
  |  Branch (2067:21): [True: 0, False: 0]
  |  Branch (2067:37): [True: 0, False: 0]
  ------------------
 2068|      0|        }
 2069|    778|        if (unlikely(srcSize==0)) { return -1; }
  ------------------
  |  |  180|    778|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    778|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 778]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2070|       |
 2071|       |    /* LZ4_FAST_DEC_LOOP:
 2072|       |     * designed for modern OoO performance cpus,
 2073|       |     * where copying reliably 32-bytes is preferable to an unpredictable branch.
 2074|       |     * note : fast loop may show a regression for some client arm chips. */
 2075|    778|#if LZ4_FAST_DEC_LOOP
 2076|    778|        if ((oend - op) < FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|    778|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2076:13): [True: 10, False: 768]
  ------------------
 2077|     10|            DEBUGLOG(6, "move to safe decode loop");
  ------------------
  |  |  289|     10|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2078|     10|            goto safe_decode;
 2079|     10|        }
 2080|       |
 2081|       |        /* Fast loop : decode sequences as long as output < oend-FASTLOOP_SAFE_DISTANCE */
 2082|    768|        DEBUGLOG(6, "using fast decode loop");
  ------------------
  |  |  289|    768|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2083|  77.5k|        while (1) {
  ------------------
  |  Branch (2083:16): [True: 77.5k, Folded]
  ------------------
 2084|       |            /* Main fastloop assertion: We can always wildcopy FASTLOOP_SAFE_DISTANCE */
 2085|  77.5k|            assert(oend - op >= FASTLOOP_SAFE_DISTANCE);
  ------------------
  |  |  273|  77.5k|#    define assert(condition) ((void)0)
  ------------------
 2086|  77.5k|            assert(ip < iend);
  ------------------
  |  |  273|  77.5k|#    define assert(condition) ((void)0)
  ------------------
 2087|  77.5k|            token = *ip++;
 2088|  77.5k|            length = token >> ML_BITS;  /* literal length */
  ------------------
  |  |  260|  77.5k|#define ML_BITS  4
  ------------------
 2089|  77.5k|            DEBUGLOG(7, "blockPos%6u: litLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)length);
  ------------------
  |  |  289|  77.5k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2090|       |
 2091|       |            /* decode literal length */
 2092|  77.5k|            if (length == RUN_MASK) {
  ------------------
  |  |  263|  77.5k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|  77.5k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|  77.5k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2092:17): [True: 2.47k, False: 75.0k]
  ------------------
 2093|  2.47k|                size_t const addl = read_variable_length(&ip, iend-RUN_MASK, 1);
  ------------------
  |  |  263|  2.47k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|  2.47k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|  2.47k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2094|  2.47k|                if (addl == rvl_error) {
  ------------------
  |  Branch (2094:21): [True: 10, False: 2.46k]
  ------------------
 2095|     10|                    DEBUGLOG(6, "error reading long literal length");
  ------------------
  |  |  289|     10|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2096|     10|                    goto _output_error;
 2097|     10|                }
 2098|  2.46k|                length += addl;
 2099|  2.46k|                if (unlikely((uptrval)(op)+length<(uptrval)(op))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  2.46k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  2.46k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 2.46k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2100|  2.46k|                if (unlikely((uptrval)(ip)+length<(uptrval)(ip))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  2.46k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  2.46k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 2.46k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2101|       |
 2102|       |                /* copy literals */
 2103|  2.46k|                LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH);
  ------------------
  |  |  277|  2.46k|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
 2104|  2.46k|                if ((op+length>oend-32) || (ip+length>iend-32)) { goto safe_literal_copy; }
  ------------------
  |  Branch (2104:21): [True: 23, False: 2.44k]
  |  Branch (2104:44): [True: 346, False: 2.10k]
  ------------------
 2105|  2.10k|                LZ4_wildCopy32(op, ip, op+length);
 2106|  2.10k|                ip += length; op += length;
 2107|  75.0k|            } else if (ip <= iend-(16 + 1/*max lit + offset + nextToken*/)) {
  ------------------
  |  Branch (2107:24): [True: 74.9k, False: 47]
  ------------------
 2108|       |                /* We don't need to check oend, since we check it once for each loop below */
 2109|  74.9k|                DEBUGLOG(7, "copy %u bytes in a 16-bytes stripe", (unsigned)length);
  ------------------
  |  |  289|  74.9k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2110|       |                /* Literals can only be <= 14, but hope compilers optimize better when copy by a register size */
 2111|  74.9k|                LZ4_memcpy(op, ip, 16);
  ------------------
  |  |  349|  74.9k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2112|  74.9k|                ip += length; op += length;
 2113|  74.9k|            } else {
 2114|     47|                goto safe_literal_copy;
 2115|     47|            }
 2116|       |
 2117|       |            /* get offset */
 2118|  77.0k|            offset = LZ4_readLE16(ip); ip+=2;
 2119|  77.0k|            DEBUGLOG(6, "blockPos%6u: offset = %u", (unsigned)(op-(BYTE*)dst), (unsigned)offset);
  ------------------
  |  |  289|  77.0k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2120|  77.0k|            match = op - offset;
 2121|  77.0k|            assert(match <= op);  /* overflow check */
  ------------------
  |  |  273|  77.0k|#    define assert(condition) ((void)0)
  ------------------
 2122|       |
 2123|       |            /* get matchlength */
 2124|  77.0k|            length = token & ML_MASK;
  ------------------
  |  |  261|  77.0k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|  77.0k|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2125|  77.0k|            DEBUGLOG(7, "  match length token = %u (len==%u)", (unsigned)length, (unsigned)length+MINMATCH);
  ------------------
  |  |  289|  77.0k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2126|       |
 2127|  77.0k|            if (length == ML_MASK) {
  ------------------
  |  |  261|  77.0k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|  77.0k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2127:17): [True: 49.7k, False: 27.3k]
  ------------------
 2128|  49.7k|                size_t const addl = read_variable_length(&ip, iend - LASTLITERALS + 1, 0);
  ------------------
  |  |  245|  49.7k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2129|  49.7k|                if (addl == rvl_error) {
  ------------------
  |  Branch (2129:21): [True: 6, False: 49.7k]
  ------------------
 2130|      6|                    DEBUGLOG(5, "error reading long match length");
  ------------------
  |  |  289|      6|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2131|      6|                    goto _output_error;
 2132|      6|                }
 2133|  49.7k|                length += addl;
 2134|  49.7k|                length += MINMATCH;
  ------------------
  |  |  242|  49.7k|#define MINMATCH 4
  ------------------
 2135|  49.7k|                DEBUGLOG(7, "  long match length == %u", (unsigned)length);
  ------------------
  |  |  289|  49.7k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2136|  49.7k|                if (unlikely((uptrval)(op)+length<(uptrval)op)) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  49.7k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  49.7k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 49.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2137|  49.7k|                if (op + length >= oend - FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|  49.7k|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2137:21): [True: 219, False: 49.5k]
  ------------------
 2138|    219|                    goto safe_match_copy;
 2139|    219|                }
 2140|  49.7k|            } else {
 2141|  27.3k|                length += MINMATCH;
  ------------------
  |  |  242|  27.3k|#define MINMATCH 4
  ------------------
 2142|  27.3k|                if (op + length >= oend - FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|  27.3k|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2142:21): [True: 26, False: 27.2k]
  ------------------
 2143|     26|                    DEBUGLOG(7, "moving to safe_match_copy (ml==%u)", (unsigned)length);
  ------------------
  |  |  289|     26|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2144|     26|                    goto safe_match_copy;
 2145|     26|                }
 2146|       |
 2147|       |                /* Fastpath check: skip LZ4_wildCopy32 when true */
 2148|  27.2k|                if ((dict == withPrefix64k) || (match >= lowPrefix)) {
  ------------------
  |  Branch (2148:21): [True: 0, False: 27.2k]
  |  Branch (2148:48): [True: 26.6k, False: 595]
  ------------------
 2149|  26.6k|                    if (offset >= 8) {
  ------------------
  |  Branch (2149:25): [True: 17.7k, False: 8.89k]
  ------------------
 2150|  17.7k|                        assert(match >= lowPrefix);
  ------------------
  |  |  273|  17.7k|#    define assert(condition) ((void)0)
  ------------------
 2151|  17.7k|                        assert(match <= op);
  ------------------
  |  |  273|  17.7k|#    define assert(condition) ((void)0)
  ------------------
 2152|  17.7k|                        assert(op + 18 <= oend);
  ------------------
  |  |  273|  17.7k|#    define assert(condition) ((void)0)
  ------------------
 2153|       |
 2154|  17.7k|                        LZ4_memcpy(op, match, 8);
  ------------------
  |  |  349|  17.7k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2155|  17.7k|                        LZ4_memcpy(op+8, match+8, 8);
  ------------------
  |  |  349|  17.7k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2156|  17.7k|                        LZ4_memcpy(op+16, match+16, 2);
  ------------------
  |  |  349|  17.7k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2157|  17.7k|                        op += length;
 2158|  17.7k|                        continue;
 2159|  17.7k|            }   }   }
 2160|       |
 2161|  59.0k|            if ( checkOffset && (unlikely(match + dictSize < lowPrefix)) ) {
  ------------------
  |  |  180|  59.0k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  59.0k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  ------------------
  ------------------
  |  Branch (2161:18): [True: 59.0k, False: 0]
  |  Branch (2161:33): [True: 91, False: 58.9k]
  ------------------
 2162|     91|                DEBUGLOG(5, "Error : pos=%zi, offset=%zi => outside buffers", op-lowPrefix, op-match);
  ------------------
  |  |  289|     91|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2163|     91|                goto _output_error;
 2164|     91|            }
 2165|       |            /* match starting within external dictionary */
 2166|  58.9k|            if ((dict==usingExtDict) && (match < lowPrefix)) {
  ------------------
  |  Branch (2166:17): [True: 18.8k, False: 40.1k]
  |  Branch (2166:41): [True: 805, False: 18.0k]
  ------------------
 2167|    805|                assert(dictEnd != NULL);
  ------------------
  |  |  273|    805|#    define assert(condition) ((void)0)
  ------------------
 2168|    805|                if (unlikely(op+length > oend-LASTLITERALS)) {
  ------------------
  |  |  180|    805|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    805|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 805]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2169|      0|                    if (partialDecoding) {
  ------------------
  |  Branch (2169:25): [True: 0, False: 0]
  ------------------
 2170|      0|                        DEBUGLOG(7, "partialDecoding: dictionary match, close to dstEnd");
  ------------------
  |  |  289|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2171|      0|                        length = MIN(length, (size_t)(oend-op));
  ------------------
  |  | 1845|      0|#define MIN(a,b)    ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (1845:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2172|      0|                    } else {
 2173|      0|                        DEBUGLOG(6, "end-of-block condition violated")
  ------------------
  |  |  289|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2174|      0|                        goto _output_error;
 2175|      0|                }   }
 2176|       |
 2177|    805|                if (length <= (size_t)(lowPrefix-match)) {
  ------------------
  |  Branch (2177:21): [True: 696, False: 109]
  ------------------
 2178|       |                    /* match fits entirely within external dictionary : just copy */
 2179|    696|                    LZ4_memmove(op, dictEnd - (lowPrefix-match), length);
  ------------------
  |  |  357|    696|#    define LZ4_memmove __builtin_memmove
  ------------------
 2180|    696|                    op += length;
 2181|    696|                } else {
 2182|       |                    /* match stretches into both external dictionary and current block */
 2183|    109|                    size_t const copySize = (size_t)(lowPrefix - match);
 2184|    109|                    size_t const restSize = length - copySize;
 2185|    109|                    LZ4_memcpy(op, dictEnd - copySize, copySize);
  ------------------
  |  |  349|    109|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2186|    109|                    op += copySize;
 2187|    109|                    if (restSize > (size_t)(op - lowPrefix)) {  /* overlap copy */
  ------------------
  |  Branch (2187:25): [True: 76, False: 33]
  ------------------
 2188|     76|                        BYTE* const endOfMatch = op + restSize;
 2189|     76|                        const BYTE* copyFrom = lowPrefix;
 2190|  1.08M|                        while (op < endOfMatch) { *op++ = *copyFrom++; }
  ------------------
  |  Branch (2190:32): [True: 1.08M, False: 76]
  ------------------
 2191|     76|                    } else {
 2192|     33|                        LZ4_memcpy(op, lowPrefix, restSize);
  ------------------
  |  |  349|     33|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2193|     33|                        op += restSize;
 2194|     33|                }   }
 2195|    805|                continue;
 2196|    805|            }
 2197|       |
 2198|       |            /* copy match within block */
 2199|  58.1k|            cpy = op + length;
 2200|       |
 2201|  58.1k|            assert((op <= oend) && (oend-op >= 32));
  ------------------
  |  |  273|  58.1k|#    define assert(condition) ((void)0)
  ------------------
 2202|  58.1k|            if (unlikely(offset<16)) {
  ------------------
  |  |  180|  58.1k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  58.1k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 41.6k, False: 16.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2203|  41.6k|                LZ4_memcpy_using_offset(op, match, cpy, offset);
 2204|  41.6k|            } else {
 2205|  16.4k|                LZ4_wildCopy32(op, match, cpy);
 2206|  16.4k|            }
 2207|       |
 2208|  58.1k|            op = cpy;   /* wildcopy correction */
 2209|  58.1k|        }
 2210|     10|    safe_decode:
 2211|     10|#endif
 2212|       |
 2213|       |        /* Main Loop : decode remaining sequences where output < FASTLOOP_SAFE_DISTANCE */
 2214|     10|        DEBUGLOG(6, "using safe decode loop");
  ------------------
  |  |  289|     10|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2215|  1.02k|        while (1) {
  ------------------
  |  Branch (2215:16): [True: 1.02k, Folded]
  ------------------
 2216|  1.02k|            assert(ip < iend);
  ------------------
  |  |  273|  1.02k|#    define assert(condition) ((void)0)
  ------------------
 2217|  1.02k|            token = *ip++;
 2218|  1.02k|            length = token >> ML_BITS;  /* literal length */
  ------------------
  |  |  260|  1.02k|#define ML_BITS  4
  ------------------
 2219|  1.02k|            DEBUGLOG(7, "blockPos%6u: litLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)length);
  ------------------
  |  |  289|  1.02k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2220|       |
 2221|       |            /* A two-stage shortcut for the most common case:
 2222|       |             * 1) If the literal length is 0..14, and there is enough space,
 2223|       |             * enter the shortcut and copy 16 bytes on behalf of the literals
 2224|       |             * (in the fast mode, only 8 bytes can be safely copied this way).
 2225|       |             * 2) Further if the match length is 4..18, copy 18 bytes in a similar
 2226|       |             * manner; but we ensure that there's enough space in the output for
 2227|       |             * those 18 bytes earlier, upon entering the shortcut (in other words,
 2228|       |             * there is a combined check for both stages).
 2229|       |             */
 2230|  1.02k|            if ( (length != RUN_MASK)
  ------------------
  |  |  263|  1.02k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|  1.02k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|  1.02k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2230:18): [True: 840, False: 182]
  ------------------
 2231|       |                /* strictly "less than" on input, to re-enter the loop with at least one byte */
 2232|    840|              && likely((ip < shortiend) & (op <= shortoend)) ) {
  ------------------
  |  |  177|    840|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|    840|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 392, False: 448]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2233|       |                /* Copy the literals */
 2234|    392|                LZ4_memcpy(op, ip, 16);
  ------------------
  |  |  349|    392|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2235|    392|                op += length; ip += length;
 2236|       |
 2237|       |                /* The second stage: prepare for match copying, decode full info.
 2238|       |                 * If it doesn't work out, the info won't be wasted. */
 2239|    392|                length = token & ML_MASK; /* match length */
  ------------------
  |  |  261|    392|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    392|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2240|    392|                DEBUGLOG(7, "blockPos%6u: matchLength token = %u (len=%u)", (unsigned)(op-(BYTE*)dst), (unsigned)length, (unsigned)length + 4);
  ------------------
  |  |  289|    392|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2241|    392|                offset = LZ4_readLE16(ip); ip += 2;
 2242|    392|                match = op - offset;
 2243|    392|                assert(match <= op); /* check overflow */
  ------------------
  |  |  273|    392|#    define assert(condition) ((void)0)
  ------------------
 2244|       |
 2245|       |                /* Do not deal with overlapping matches. */
 2246|    392|                if ( (length != ML_MASK)
  ------------------
  |  |  261|    392|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    392|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2246:22): [True: 306, False: 86]
  ------------------
 2247|    306|                  && (offset >= 8)
  ------------------
  |  Branch (2247:22): [True: 189, False: 117]
  ------------------
 2248|    189|                  && (dict==withPrefix64k || match >= lowPrefix) ) {
  ------------------
  |  Branch (2248:23): [True: 0, False: 189]
  |  Branch (2248:46): [True: 141, False: 48]
  ------------------
 2249|       |                    /* Copy the match. */
 2250|    141|                    LZ4_memcpy(op + 0, match + 0, 8);
  ------------------
  |  |  349|    141|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2251|    141|                    LZ4_memcpy(op + 8, match + 8, 8);
  ------------------
  |  |  349|    141|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2252|    141|                    LZ4_memcpy(op +16, match +16, 2);
  ------------------
  |  |  349|    141|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2253|    141|                    op += length + MINMATCH;
  ------------------
  |  |  242|    141|#define MINMATCH 4
  ------------------
 2254|       |                    /* Both stages worked, load the next token. */
 2255|    141|                    continue;
 2256|    141|                }
 2257|       |
 2258|       |                /* The second stage didn't work out, but the info is ready.
 2259|       |                 * Propel it right to the point of match copying. */
 2260|    251|                goto _copy_match;
 2261|    392|            }
 2262|       |
 2263|       |            /* decode literal length */
 2264|    630|            if (length == RUN_MASK) {
  ------------------
  |  |  263|    630|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|    630|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|    630|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2264:17): [True: 182, False: 448]
  ------------------
 2265|    182|                size_t const addl = read_variable_length(&ip, iend-RUN_MASK, 1);
  ------------------
  |  |  263|    182|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|    182|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|    182|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2266|    182|                if (addl == rvl_error) { goto _output_error; }
  ------------------
  |  Branch (2266:21): [True: 32, False: 150]
  ------------------
 2267|    150|                length += addl;
 2268|    150|                if (unlikely((uptrval)(op)+length<(uptrval)(op))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|    150|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    150|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 150]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2269|    150|                if (unlikely((uptrval)(ip)+length<(uptrval)(ip))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|    150|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    150|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 150]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2270|    150|            }
 2271|       |
 2272|    598|#if LZ4_FAST_DEC_LOOP
 2273|  1.01k|        safe_literal_copy:
 2274|  1.01k|#endif
 2275|       |            /* copy literals */
 2276|  1.01k|            cpy = op+length;
 2277|       |
 2278|  1.01k|            LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH);
  ------------------
  |  |  277|  1.01k|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
 2279|  1.01k|            if ((cpy>oend-MFLIMIT) || (ip+length>iend-(2+1+LASTLITERALS))) {
  ------------------
  |  |  246|  1.01k|#define MFLIMIT       12   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
                          if ((cpy>oend-MFLIMIT) || (ip+length>iend-(2+1+LASTLITERALS))) {
  ------------------
  |  |  245|    784|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (2279:17): [True: 230, False: 784]
  |  Branch (2279:39): [True: 243, False: 541]
  ------------------
 2280|       |                /* We've either hit the input parsing restriction or the output parsing restriction.
 2281|       |                 * In the normal scenario, decoding a full block, it must be the last sequence,
 2282|       |                 * otherwise it's an error (invalid input or dimensions).
 2283|       |                 * In partialDecoding scenario, it's necessary to ensure there is no buffer overflow.
 2284|       |                 */
 2285|    473|                if (partialDecoding) {
  ------------------
  |  Branch (2285:21): [True: 0, False: 473]
  ------------------
 2286|       |                    /* Since we are partial decoding we may be in this block because of the output parsing
 2287|       |                     * restriction, which is not valid since the output buffer is allowed to be undersized.
 2288|       |                     */
 2289|      0|                    DEBUGLOG(7, "partialDecoding: copying literals, close to input or output end")
  ------------------
  |  |  289|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2290|      0|                    DEBUGLOG(7, "partialDecoding: literal length = %u", (unsigned)length);
  ------------------
  |  |  289|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2291|      0|                    DEBUGLOG(7, "partialDecoding: remaining space in dstBuffer : %i", (int)(oend - op));
  ------------------
  |  |  289|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2292|      0|                    DEBUGLOG(7, "partialDecoding: remaining space in srcBuffer : %i", (int)(iend - ip));
  ------------------
  |  |  289|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2293|       |                    /* Finishing in the middle of a literals segment,
 2294|       |                     * due to lack of input.
 2295|       |                     */
 2296|      0|                    if (ip+length > iend) {
  ------------------
  |  Branch (2296:25): [True: 0, False: 0]
  ------------------
 2297|      0|                        length = (size_t)(iend-ip);
 2298|      0|                        cpy = op + length;
 2299|      0|                    }
 2300|       |                    /* Finishing in the middle of a literals segment,
 2301|       |                     * due to lack of output space.
 2302|       |                     */
 2303|      0|                    if (cpy > oend) {
  ------------------
  |  Branch (2303:25): [True: 0, False: 0]
  ------------------
 2304|      0|                        cpy = oend;
 2305|      0|                        assert(op<=oend);
  ------------------
  |  |  273|      0|#    define assert(condition) ((void)0)
  ------------------
 2306|      0|                        length = (size_t)(oend-op);
 2307|      0|                    }
 2308|    473|                } else {
 2309|       |                     /* We must be on the last sequence (or invalid) because of the parsing limitations
 2310|       |                      * so check that we exactly consume the input and don't overrun the output buffer.
 2311|       |                      */
 2312|    473|                    if ((ip+length != iend) || (cpy > oend)) {
  ------------------
  |  Branch (2312:25): [True: 340, False: 133]
  |  Branch (2312:48): [True: 2, False: 131]
  ------------------
 2313|    342|                        DEBUGLOG(5, "should have been last run of literals")
  ------------------
  |  |  289|    342|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2314|    342|                        DEBUGLOG(5, "ip(%p) + length(%i) = %p != iend (%p)", ip, (int)length, ip+length, iend);
  ------------------
  |  |  289|    342|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2315|    342|                        DEBUGLOG(5, "or cpy(%p) > (oend-MFLIMIT)(%p)", cpy, oend-MFLIMIT);
  ------------------
  |  |  289|    342|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2316|    342|                        DEBUGLOG(5, "after writing %u bytes / %i bytes available", (unsigned)(op-(BYTE*)dst), outputSize);
  ------------------
  |  |  289|    342|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2317|    342|                        goto _output_error;
 2318|    342|                    }
 2319|    473|                }
 2320|    131|                LZ4_memmove(op, ip, length);  /* supports overlapping memory regions, for in-place decompression scenarios */
  ------------------
  |  |  357|    131|#    define LZ4_memmove __builtin_memmove
  ------------------
 2321|    131|                ip += length;
 2322|    131|                op += length;
 2323|       |                /* Necessarily EOF when !partialDecoding.
 2324|       |                 * When partialDecoding, it is EOF if we've either
 2325|       |                 * filled the output buffer or
 2326|       |                 * can't proceed with reading an offset for following match.
 2327|       |                 */
 2328|    131|                if (!partialDecoding || (cpy == oend) || (ip >= (iend-2))) {
  ------------------
  |  Branch (2328:21): [True: 131, False: 0]
  |  Branch (2328:41): [True: 0, False: 0]
  |  Branch (2328:58): [True: 0, False: 0]
  ------------------
 2329|    131|                    break;
 2330|    131|                }
 2331|    541|            } else {
 2332|    541|                LZ4_wildCopy8(op, ip, cpy);   /* can overwrite up to 8 bytes beyond cpy */
 2333|    541|                ip += length; op = cpy;
 2334|    541|            }
 2335|       |
 2336|       |            /* get offset */
 2337|    541|            offset = LZ4_readLE16(ip); ip+=2;
 2338|    541|            match = op - offset;
 2339|       |
 2340|       |            /* get matchlength */
 2341|    541|            length = token & ML_MASK;
  ------------------
  |  |  261|    541|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    541|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2342|    541|            DEBUGLOG(7, "blockPos%6u: matchLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)length);
  ------------------
  |  |  289|    541|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2343|       |
 2344|    792|    _copy_match:
 2345|    792|            if (length == ML_MASK) {
  ------------------
  |  |  261|    792|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    792|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2345:17): [True: 426, False: 366]
  ------------------
 2346|    426|                size_t const addl = read_variable_length(&ip, iend - LASTLITERALS + 1, 0);
  ------------------
  |  |  245|    426|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2347|    426|                if (addl == rvl_error) { goto _output_error; }
  ------------------
  |  Branch (2347:21): [True: 9, False: 417]
  ------------------
 2348|    417|                length += addl;
 2349|    417|                if (unlikely((uptrval)(op)+length<(uptrval)op)) goto _output_error;   /* overflow detection */
  ------------------
  |  |  180|    417|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    417|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 417]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2350|    417|            }
 2351|    783|            length += MINMATCH;
  ------------------
  |  |  242|    783|#define MINMATCH 4
  ------------------
 2352|       |
 2353|    783|#if LZ4_FAST_DEC_LOOP
 2354|  1.02k|        safe_match_copy:
 2355|  1.02k|#endif
 2356|  1.02k|            if ((checkOffset) && (unlikely(match + dictSize < lowPrefix))) goto _output_error;   /* Error : offset outside buffers */
  ------------------
  |  |  180|  1.02k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.02k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  ------------------
  ------------------
  |  Branch (2356:17): [True: 1.02k, False: 0]
  |  Branch (2356:34): [True: 127, False: 901]
  ------------------
 2357|       |            /* match starting within external dictionary */
 2358|    901|            if ((dict==usingExtDict) && (match < lowPrefix)) {
  ------------------
  |  Branch (2358:17): [True: 432, False: 469]
  |  Branch (2358:41): [True: 61, False: 371]
  ------------------
 2359|     61|                assert(dictEnd != NULL);
  ------------------
  |  |  273|     61|#    define assert(condition) ((void)0)
  ------------------
 2360|     61|                if (unlikely(op+length > oend-LASTLITERALS)) {
  ------------------
  |  |  180|     61|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|     61|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 1, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2361|      1|                    if (partialDecoding) length = MIN(length, (size_t)(oend-op));
  ------------------
  |  | 1845|      0|#define MIN(a,b)    ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (1845:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2361:25): [True: 0, False: 1]
  ------------------
 2362|      1|                    else goto _output_error;   /* doesn't respect parsing restriction */
 2363|      1|                }
 2364|       |
 2365|     60|                if (length <= (size_t)(lowPrefix-match)) {
  ------------------
  |  Branch (2365:21): [True: 19, False: 41]
  ------------------
 2366|       |                    /* match fits entirely within external dictionary : just copy */
 2367|     19|                    LZ4_memmove(op, dictEnd - (lowPrefix-match), length);
  ------------------
  |  |  357|     19|#    define LZ4_memmove __builtin_memmove
  ------------------
 2368|     19|                    op += length;
 2369|     41|                } else {
 2370|       |                    /* match stretches into both external dictionary and current block */
 2371|     41|                    size_t const copySize = (size_t)(lowPrefix - match);
 2372|     41|                    size_t const restSize = length - copySize;
 2373|     41|                    LZ4_memcpy(op, dictEnd - copySize, copySize);
  ------------------
  |  |  349|     41|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2374|     41|                    op += copySize;
 2375|     41|                    if (restSize > (size_t)(op - lowPrefix)) {  /* overlap copy */
  ------------------
  |  Branch (2375:25): [True: 34, False: 7]
  ------------------
 2376|     34|                        BYTE* const endOfMatch = op + restSize;
 2377|     34|                        const BYTE* copyFrom = lowPrefix;
 2378|  54.2k|                        while (op < endOfMatch) *op++ = *copyFrom++;
  ------------------
  |  Branch (2378:32): [True: 54.1k, False: 34]
  ------------------
 2379|     34|                    } else {
 2380|      7|                        LZ4_memcpy(op, lowPrefix, restSize);
  ------------------
  |  |  349|      7|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2381|      7|                        op += restSize;
 2382|      7|                }   }
 2383|     60|                continue;
 2384|     61|            }
 2385|    840|            assert(match >= lowPrefix);
  ------------------
  |  |  273|    840|#    define assert(condition) ((void)0)
  ------------------
 2386|       |
 2387|       |            /* copy match within block */
 2388|    840|            cpy = op + length;
 2389|       |
 2390|       |            /* partialDecoding : may end anywhere within the block */
 2391|    840|            assert(op<=oend);
  ------------------
  |  |  273|    840|#    define assert(condition) ((void)0)
  ------------------
 2392|    840|            if (partialDecoding && (cpy > oend-MATCH_SAFEGUARD_DISTANCE)) {
  ------------------
  |  |  247|      0|#define MATCH_SAFEGUARD_DISTANCE  ((2*WILDCOPYLENGTH) - MINMATCH)   /* ensure it's possible to write 2 x wildcopyLength without overflowing output buffer */
  |  |  ------------------
  |  |  |  |  244|      0|#define WILDCOPYLENGTH 8
  |  |  ------------------
  |  |               #define MATCH_SAFEGUARD_DISTANCE  ((2*WILDCOPYLENGTH) - MINMATCH)   /* ensure it's possible to write 2 x wildcopyLength without overflowing output buffer */
  |  |  ------------------
  |  |  |  |  242|      0|#define MINMATCH 4
  |  |  ------------------
  ------------------
  |  Branch (2392:17): [True: 0, False: 840]
  |  Branch (2392:36): [True: 0, False: 0]
  ------------------
 2393|      0|                size_t const mlen = MIN(length, (size_t)(oend-op));
  ------------------
  |  | 1845|      0|#define MIN(a,b)    ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (1845:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2394|      0|                const BYTE* const matchEnd = match + mlen;
 2395|      0|                BYTE* const copyEnd = op + mlen;
 2396|      0|                if (matchEnd > op) {   /* overlap copy */
  ------------------
  |  Branch (2396:21): [True: 0, False: 0]
  ------------------
 2397|      0|                    while (op < copyEnd) { *op++ = *match++; }
  ------------------
  |  Branch (2397:28): [True: 0, False: 0]
  ------------------
 2398|      0|                } else {
 2399|      0|                    LZ4_memcpy(op, match, mlen);
  ------------------
  |  |  349|      0|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2400|      0|                }
 2401|      0|                op = copyEnd;
 2402|      0|                if (op == oend) { break; }
  ------------------
  |  Branch (2402:21): [True: 0, False: 0]
  ------------------
 2403|      0|                continue;
 2404|      0|            }
 2405|       |
 2406|    840|            if (unlikely(offset<8)) {
  ------------------
  |  |  180|    840|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    840|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 480, False: 360]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2407|    480|                LZ4_write32(op, 0);   /* silence msan warning when offset==0 */
 2408|    480|                op[0] = match[0];
 2409|    480|                op[1] = match[1];
 2410|    480|                op[2] = match[2];
 2411|    480|                op[3] = match[3];
 2412|    480|                match += inc32table[offset];
 2413|    480|                LZ4_memcpy(op+4, match, 4);
  ------------------
  |  |  349|    480|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2414|    480|                match -= dec64table[offset];
 2415|    480|            } else {
 2416|    360|                LZ4_memcpy(op, match, 8);
  ------------------
  |  |  349|    360|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2417|    360|                match += 8;
 2418|    360|            }
 2419|    840|            op += 8;
 2420|       |
 2421|    840|            if (unlikely(cpy > oend-MATCH_SAFEGUARD_DISTANCE)) {
  ------------------
  |  |  180|    840|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    840|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 214, False: 626]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2422|    214|                BYTE* const oCopyLimit = oend - (WILDCOPYLENGTH-1);
  ------------------
  |  |  244|    214|#define WILDCOPYLENGTH 8
  ------------------
 2423|    214|                if (cpy > oend-LASTLITERALS) { goto _output_error; } /* Error : last LASTLITERALS bytes must be literals (uncompressed) */
  ------------------
  |  |  245|    214|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (2423:21): [True: 29, False: 185]
  ------------------
 2424|    185|                if (op < oCopyLimit) {
  ------------------
  |  Branch (2424:21): [True: 177, False: 8]
  ------------------
 2425|    177|                    LZ4_wildCopy8(op, match, oCopyLimit);
 2426|    177|                    match += oCopyLimit - op;
 2427|    177|                    op = oCopyLimit;
 2428|    177|                }
 2429|    430|                while (op < cpy) { *op++ = *match++; }
  ------------------
  |  Branch (2429:24): [True: 245, False: 185]
  ------------------
 2430|    626|            } else {
 2431|    626|                LZ4_memcpy(op, match, 8);
  ------------------
  |  |  349|    626|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2432|    626|                if (length > 16) { LZ4_wildCopy8(op+8, match+8, cpy); }
  ------------------
  |  Branch (2432:21): [True: 363, False: 263]
  ------------------
 2433|    626|            }
 2434|    811|            op = cpy;   /* wildcopy correction */
 2435|    811|        }
 2436|       |
 2437|       |        /* end of decoding */
 2438|    131|        DEBUGLOG(5, "decoded %i bytes", (int) (((char*)op)-dst));
  ------------------
  |  |  289|    131|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2439|    131|        return (int) (((char*)op)-dst);     /* Nb of output bytes decoded */
 2440|       |
 2441|       |        /* Overflow error detected */
 2442|    647|    _output_error:
 2443|    647|        return (int) (-(((const char*)ip)-src))-1;
 2444|     10|    }
 2445|     10|}
lz4.c:read_variable_length:
 1981|  52.8k|{
 1982|  52.8k|    Rvl_t s, length = 0;
 1983|  52.8k|    assert(ip != NULL);
  ------------------
  |  |  273|  52.8k|#    define assert(condition) ((void)0)
  ------------------
 1984|  52.8k|    assert(*ip !=  NULL);
  ------------------
  |  |  273|  52.8k|#    define assert(condition) ((void)0)
  ------------------
 1985|  52.8k|    assert(ilimit != NULL);
  ------------------
  |  |  273|  52.8k|#    define assert(condition) ((void)0)
  ------------------
 1986|  52.8k|    if (initial_check && unlikely((*ip) >= ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  2.66k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  2.66k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 32, False: 2.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1986:9): [True: 2.66k, False: 50.2k]
  ------------------
 1987|     32|        return rvl_error;
 1988|     32|    }
 1989|  52.8k|    s = **ip;
 1990|  52.8k|    (*ip)++;
 1991|  52.8k|    length += s;
 1992|  52.8k|    if (unlikely((*ip) > ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  52.8k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  52.8k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 4, False: 52.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1993|      4|        return rvl_error;
 1994|      4|    }
 1995|       |    /* accumulator overflow detection (32-bit mode only) */
 1996|  52.8k|    if ((sizeof(length) < 8) && unlikely(length > ((Rvl_t)(-1)/2)) ) {
  ------------------
  |  |  180|      0|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|      0|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1996:9): [Folded, False: 52.8k]
  ------------------
 1997|      0|        return rvl_error;
 1998|      0|    }
 1999|  52.8k|    if (likely(s != 255)) return length;
  ------------------
  |  |  177|  52.8k|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|  52.8k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 50.9k, False: 1.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2000|   102k|    do {
 2001|   102k|        s = **ip;
 2002|   102k|        (*ip)++;
 2003|   102k|        length += s;
 2004|   102k|        if (unlikely((*ip) > ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|   102k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|   102k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 21, False: 102k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2005|     21|            return rvl_error;
 2006|     21|        }
 2007|       |        /* accumulator overflow detection (32-bit mode only) */
 2008|   102k|        if ((sizeof(length) < 8) && unlikely(length > ((Rvl_t)(-1)/2)) ) {
  ------------------
  |  |  180|      0|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|      0|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2008:13): [Folded, False: 102k]
  ------------------
 2009|      0|            return rvl_error;
 2010|      0|        }
 2011|   102k|    } while (s == 255);
  ------------------
  |  Branch (2011:14): [True: 100k, False: 1.85k]
  ------------------
 2012|       |
 2013|  1.85k|    return length;
 2014|  1.88k|}
lz4.c:LZ4_wildCopy32:
  523|  18.5k|{
  524|  18.5k|    BYTE* d = (BYTE*)dstPtr;
  525|  18.5k|    const BYTE* s = (const BYTE*)srcPtr;
  526|  18.5k|    BYTE* const e = (BYTE*)dstEnd;
  527|       |
  528|   293k|    do { LZ4_memcpy(d,s,16); LZ4_memcpy(d+16,s+16,16); d+=32; s+=32; } while (d<e);
  ------------------
  |  |  349|   293k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
                  do { LZ4_memcpy(d,s,16); LZ4_memcpy(d+16,s+16,16); d+=32; s+=32; } while (d<e);
  ------------------
  |  |  349|   293k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (528:79): [True: 274k, False: 18.5k]
  ------------------
  529|  18.5k|}
lz4.c:LZ4_readLE16:
  431|  78.0k|{
  432|  78.0k|    if (LZ4_isLittleEndian()) {
  ------------------
  |  Branch (432:9): [True: 78.0k, False: 0]
  ------------------
  433|  78.0k|        return LZ4_read16(memPtr);
  434|  78.0k|    } else {
  435|      0|        const BYTE* p = (const BYTE*)memPtr;
  436|      0|        return (U16)((U16)p[0] | (p[1]<<8));
  437|      0|    }
  438|  78.0k|}
lz4.c:LZ4_memcpy_using_offset:
  536|  41.6k|{
  537|  41.6k|    BYTE v[8];
  538|       |
  539|  41.6k|    assert(dstEnd >= dstPtr + MINMATCH);
  ------------------
  |  |  273|  41.6k|#    define assert(condition) ((void)0)
  ------------------
  540|       |
  541|  41.6k|    switch(offset) {
  542|  33.5k|    case 1:
  ------------------
  |  Branch (542:5): [True: 33.5k, False: 8.14k]
  ------------------
  543|  33.5k|        MEM_INIT(v, *srcPtr, 8);
  ------------------
  |  |  236|  33.5k|#define MEM_INIT(p,v,s)   LZ4_memset((p),(v),(s))
  |  |  ------------------
  |  |  |  |  234|  33.5k|#  define LZ4_memset(p,v,s) memset((p),(v),(s))
  |  |  ------------------
  ------------------
  544|  33.5k|        break;
  545|    341|    case 2:
  ------------------
  |  Branch (545:5): [True: 341, False: 41.3k]
  ------------------
  546|    341|        LZ4_memcpy(v, srcPtr, 2);
  ------------------
  |  |  349|    341|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  547|    341|        LZ4_memcpy(&v[2], srcPtr, 2);
  ------------------
  |  |  349|    341|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  548|       |#if defined(_MSC_VER) && (_MSC_VER <= 1937) /* MSVC 2022 ver 17.7 or earlier */
  549|       |#  pragma warning(push)
  550|       |#  pragma warning(disable : 6385) /* warning C6385: Reading invalid data from 'v'. */
  551|       |#endif
  552|    341|        LZ4_memcpy(&v[4], v, 4);
  ------------------
  |  |  349|    341|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  553|       |#if defined(_MSC_VER) && (_MSC_VER <= 1937) /* MSVC 2022 ver 17.7 or earlier */
  554|       |#  pragma warning(pop)
  555|       |#endif
  556|    341|        break;
  557|    545|    case 4:
  ------------------
  |  Branch (557:5): [True: 545, False: 41.1k]
  ------------------
  558|    545|        LZ4_memcpy(v, srcPtr, 4);
  ------------------
  |  |  349|    545|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  559|    545|        LZ4_memcpy(&v[4], srcPtr, 4);
  ------------------
  |  |  349|    545|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  560|    545|        break;
  561|  7.26k|    default:
  ------------------
  |  Branch (561:5): [True: 7.26k, False: 34.4k]
  ------------------
  562|  7.26k|        LZ4_memcpy_using_offset_base(dstPtr, srcPtr, dstEnd, offset);
  563|  7.26k|        return;
  564|  41.6k|    }
  565|       |
  566|  34.4k|    LZ4_memcpy(dstPtr, v, 8);
  ------------------
  |  |  349|  34.4k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  567|  34.4k|    dstPtr += 8;
  568|  1.28M|    while (dstPtr < dstEnd) {
  ------------------
  |  Branch (568:12): [True: 1.24M, False: 34.4k]
  ------------------
  569|  1.24M|        LZ4_memcpy(dstPtr, v, 8);
  ------------------
  |  |  349|  1.24M|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  570|  1.24M|        dstPtr += 8;
  571|  1.24M|    }
  572|  34.4k|}
lz4.c:LZ4_memcpy_using_offset_base:
  497|  7.26k|{
  498|  7.26k|    assert(srcPtr + offset == dstPtr);
  ------------------
  |  |  273|  7.26k|#    define assert(condition) ((void)0)
  ------------------
  499|  7.26k|    if (offset < 8) {
  ------------------
  |  Branch (499:9): [True: 6.86k, False: 402]
  ------------------
  500|  6.86k|        LZ4_write32(dstPtr, 0);   /* silence an msan warning when offset==0 */
  501|  6.86k|        dstPtr[0] = srcPtr[0];
  502|  6.86k|        dstPtr[1] = srcPtr[1];
  503|  6.86k|        dstPtr[2] = srcPtr[2];
  504|  6.86k|        dstPtr[3] = srcPtr[3];
  505|  6.86k|        srcPtr += inc32table[offset];
  506|  6.86k|        LZ4_memcpy(dstPtr+4, srcPtr, 4);
  ------------------
  |  |  349|  6.86k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  507|  6.86k|        srcPtr -= dec64table[offset];
  508|  6.86k|        dstPtr += 8;
  509|  6.86k|    } else {
  510|    402|        LZ4_memcpy(dstPtr, srcPtr, 8);
  ------------------
  |  |  349|    402|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  511|    402|        dstPtr += 8;
  512|    402|        srcPtr += 8;
  513|    402|    }
  514|       |
  515|  7.26k|    LZ4_wildCopy8(dstPtr, srcPtr, dstEnd);
  516|  7.26k|}

adler32_ssse3.c:adler32_len_16:
   29|     66|static inline uint32_t adler32_len_16(uint32_t adler, const uint8_t *buf, size_t len, uint32_t sum2) {
   30|    558|    while (len) {
  ------------------
  |  Branch (30:12): [True: 492, False: 66]
  ------------------
   31|    492|        --len;
   32|    492|        adler += *buf++;
   33|    492|        sum2 += adler;
   34|    492|    }
   35|     66|    adler %= BASE;
  ------------------
  |  |   11|     66|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   36|     66|    sum2 %= BASE;            /* only added so many BASE's */
  ------------------
  |  |   11|     66|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   37|       |    /* return recombined sums */
   38|     66|    return adler | (sum2 << 16);
   39|     66|}
adler32_sse42.c:adler32_copy_len_16:
   41|    116|static inline uint32_t adler32_copy_len_16(uint32_t adler, const uint8_t *buf, uint8_t *dst, size_t len, uint32_t sum2) {
   42|  1.28k|    while (len--) {
  ------------------
  |  Branch (42:12): [True: 1.16k, False: 116]
  ------------------
   43|  1.16k|        *dst = *buf++;
   44|  1.16k|        adler += *dst++;
   45|  1.16k|        sum2 += adler;
   46|  1.16k|    }
   47|    116|    adler %= BASE;
  ------------------
  |  |   11|    116|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   48|    116|    sum2 %= BASE;            /* only added so many BASE's */
  ------------------
  |  |   11|    116|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   49|       |    /* return recombined sums */
   50|    116|    return adler | (sum2 << 16);
   51|    116|}
adler32_avx2.c:adler32_copy_len_16:
   41|     67|static inline uint32_t adler32_copy_len_16(uint32_t adler, const uint8_t *buf, uint8_t *dst, size_t len, uint32_t sum2) {
   42|    625|    while (len--) {
  ------------------
  |  Branch (42:12): [True: 558, False: 67]
  ------------------
   43|    558|        *dst = *buf++;
   44|    558|        adler += *dst++;
   45|    558|        sum2 += adler;
   46|    558|    }
   47|     67|    adler %= BASE;
  ------------------
  |  |   11|     67|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   48|     67|    sum2 %= BASE;            /* only added so many BASE's */
  ------------------
  |  |   11|     67|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   49|       |    /* return recombined sums */
   50|     67|    return adler | (sum2 << 16);
   51|     67|}
adler32_avx2.c:adler32_len_16:
   29|     59|static inline uint32_t adler32_len_16(uint32_t adler, const uint8_t *buf, size_t len, uint32_t sum2) {
   30|    569|    while (len) {
  ------------------
  |  Branch (30:12): [True: 510, False: 59]
  ------------------
   31|    510|        --len;
   32|    510|        adler += *buf++;
   33|    510|        sum2 += adler;
   34|    510|    }
   35|     59|    adler %= BASE;
  ------------------
  |  |   11|     59|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   36|     59|    sum2 %= BASE;            /* only added so many BASE's */
  ------------------
  |  |   11|     59|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   37|       |    /* return recombined sums */
   38|     59|    return adler | (sum2 << 16);
   39|     59|}

adler32_avx2:
  172|    185|Z_INTERNAL uint32_t adler32_avx2(uint32_t adler, const uint8_t *src, size_t len) {
  173|       |    return adler32_fold_copy_impl(adler, NULL, src, len, 0);
  174|    185|}
adler32_fold_copy_avx2:
  176|    248|Z_INTERNAL uint32_t adler32_fold_copy_avx2(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len) {
  177|    248|    return adler32_fold_copy_impl(adler, dst, src, len, 1);
  178|    248|}
adler32_avx2.c:adler32_fold_copy_impl:
   21|    433|static inline uint32_t adler32_fold_copy_impl(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len, const int COPY) {
   22|    433|    if (src == NULL) return 1L;
  ------------------
  |  Branch (22:9): [True: 0, False: 433]
  ------------------
   23|    433|    if (len == 0) return adler;
  ------------------
  |  Branch (23:9): [True: 0, False: 433]
  ------------------
   24|       |
   25|    433|    uint32_t adler0, adler1;
   26|    433|    adler1 = (adler >> 16) & 0xffff;
   27|    433|    adler0 = adler & 0xffff;
   28|       |
   29|    734|rem_peel:
   30|    734|    if (len < 16) {
  ------------------
  |  Branch (30:9): [True: 126, False: 608]
  ------------------
   31|    126|        if (COPY) {
  ------------------
  |  Branch (31:13): [True: 67, False: 59]
  ------------------
   32|     67|            return adler32_copy_len_16(adler0, src, dst, len, adler1);
   33|     67|        } else {
   34|     59|            return adler32_len_16(adler0, src, len, adler1);
   35|     59|        }
   36|    608|    } else if (len < 32) {
  ------------------
  |  Branch (36:16): [True: 184, False: 424]
  ------------------
   37|    184|        if (COPY) {
  ------------------
  |  Branch (37:13): [True: 118, False: 66]
  ------------------
   38|    118|            return adler32_fold_copy_sse42(adler, dst, src, len);
   39|    118|        } else {
   40|     66|            return adler32_ssse3(adler, src, len);
   41|     66|        }
   42|    184|    }
   43|       |
   44|    424|    __m256i vs1, vs2, vs2_0;
   45|       |
   46|    424|    const __m256i dot2v = _mm256_setr_epi8(64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47,
   47|    424|                                           46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33);
   48|    424|    const __m256i dot2v_0 = _mm256_setr_epi8(32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15,
   49|    424|                                             14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
   50|    424|    const __m256i dot3v = _mm256_set1_epi16(1);
   51|    424|    const __m256i zero = _mm256_setzero_si256();
   52|       |
   53|  8.48k|    while (len >= 32) {
  ------------------
  |  Branch (53:12): [True: 8.06k, False: 424]
  ------------------
   54|  8.06k|        vs1 = _mm256_zextsi128_si256(_mm_cvtsi32_si128(adler0));
   55|  8.06k|        vs2 = _mm256_zextsi128_si256(_mm_cvtsi32_si128(adler1));
   56|  8.06k|        __m256i vs1_0 = vs1;
   57|  8.06k|        __m256i vs3 = _mm256_setzero_si256();
   58|  8.06k|        vs2_0 = vs3;
   59|       |
   60|  8.06k|        size_t k = MIN(len, NMAX);
  ------------------
  |  |  124|  8.06k|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 7.63k, False: 423]
  |  |  ------------------
  ------------------
   61|  8.06k|        k -= k % 32;
   62|  8.06k|        len -= k;
   63|       |
   64|   681k|        while (k >= 64) {
  ------------------
  |  Branch (64:16): [True: 673k, False: 8.06k]
  ------------------
   65|   673k|            __m256i vbuf = _mm256_loadu_si256((__m256i*)src);
   66|   673k|            __m256i vbuf_0 = _mm256_loadu_si256((__m256i*)(src + 32));
   67|   673k|            src += 64;
   68|   673k|            k -= 64;
   69|       |
   70|   673k|            __m256i vs1_sad = _mm256_sad_epu8(vbuf, zero);
   71|   673k|            __m256i vs1_sad2 = _mm256_sad_epu8(vbuf_0, zero);
   72|       |
   73|   673k|            if (COPY) {
  ------------------
  |  Branch (73:17): [True: 59.6k, False: 614k]
  ------------------
   74|  59.6k|                _mm256_storeu_si256((__m256i*)dst, vbuf);
   75|  59.6k|                _mm256_storeu_si256((__m256i*)(dst + 32), vbuf_0);
   76|  59.6k|                dst += 64;
   77|  59.6k|            }
   78|       |
   79|   673k|            vs1 = _mm256_add_epi32(vs1, vs1_sad);
   80|   673k|            vs3 = _mm256_add_epi32(vs3, vs1_0);
   81|   673k|            __m256i v_short_sum2 = _mm256_maddubs_epi16(vbuf, dot2v); // sum 32 uint8s to 16 shorts
   82|   673k|            __m256i v_short_sum2_0 = _mm256_maddubs_epi16(vbuf_0, dot2v_0); // sum 32 uint8s to 16 shorts
   83|   673k|            __m256i vsum2 = _mm256_madd_epi16(v_short_sum2, dot3v); // sum 16 shorts to 8 uint32s
   84|   673k|            __m256i vsum2_0 = _mm256_madd_epi16(v_short_sum2_0, dot3v); // sum 16 shorts to 8 uint32s
   85|   673k|            vs1 = _mm256_add_epi32(vs1_sad2, vs1);
   86|   673k|            vs2 = _mm256_add_epi32(vsum2, vs2);
   87|   673k|            vs2_0 = _mm256_add_epi32(vsum2_0, vs2_0);
   88|   673k|            vs1_0 = vs1;
   89|   673k|        }
   90|       |
   91|  8.06k|        vs2 = _mm256_add_epi32(vs2_0, vs2);
   92|  8.06k|        vs3 = _mm256_slli_epi32(vs3, 6);
   93|  8.06k|        vs2 = _mm256_add_epi32(vs3, vs2);
   94|  8.06k|        vs3 = _mm256_setzero_si256();
   95|       |
   96|  15.9k|        while (k >= 32) {
  ------------------
  |  Branch (96:16): [True: 7.84k, False: 8.06k]
  ------------------
   97|       |            /*
   98|       |               vs1 = adler + sum(c[i])
   99|       |               vs2 = sum2 + 32 vs1 + sum( (32-i+1) c[i] )
  100|       |            */
  101|  7.84k|            __m256i vbuf = _mm256_loadu_si256((__m256i*)src);
  102|  7.84k|            src += 32;
  103|  7.84k|            k -= 32;
  104|       |
  105|  7.84k|            __m256i vs1_sad = _mm256_sad_epu8(vbuf, zero); // Sum of abs diff, resulting in 2 x int32's
  106|       |
  107|  7.84k|            if (COPY) {
  ------------------
  |  Branch (107:17): [True: 702, False: 7.14k]
  ------------------
  108|    702|                _mm256_storeu_si256((__m256i*)dst, vbuf);
  109|    702|                dst += 32;
  110|    702|            }
  111|       | 
  112|  7.84k|            vs1 = _mm256_add_epi32(vs1, vs1_sad);
  113|  7.84k|            vs3 = _mm256_add_epi32(vs3, vs1_0);
  114|  7.84k|            __m256i v_short_sum2 = _mm256_maddubs_epi16(vbuf, dot2v_0); // sum 32 uint8s to 16 shorts
  115|  7.84k|            __m256i vsum2 = _mm256_madd_epi16(v_short_sum2, dot3v); // sum 16 shorts to 8 uint32s
  116|  7.84k|            vs2 = _mm256_add_epi32(vsum2, vs2);
  117|  7.84k|            vs1_0 = vs1;
  118|  7.84k|        }
  119|       |
  120|       |        /* Defer the multiplication with 32 to outside of the loop */
  121|  8.06k|        vs3 = _mm256_slli_epi32(vs3, 5);
  122|  8.06k|        vs2 = _mm256_add_epi32(vs2, vs3);
  123|       |
  124|       |        /* The compiler is generating the following sequence for this integer modulus
  125|       |         * when done the scalar way, in GPRs:
  126|       |
  127|       |         adler = (s1_unpack[0] % BASE) + (s1_unpack[1] % BASE) + (s1_unpack[2] % BASE) + (s1_unpack[3] % BASE) +
  128|       |                 (s1_unpack[4] % BASE) + (s1_unpack[5] % BASE) + (s1_unpack[6] % BASE) + (s1_unpack[7] % BASE);
  129|       |
  130|       |         mov    $0x80078071,%edi // move magic constant into 32 bit register %edi
  131|       |         ...
  132|       |         vmovd  %xmm1,%esi // move vector lane 0 to 32 bit register %esi
  133|       |         mov    %rsi,%rax  // zero-extend this value to 64 bit precision in %rax
  134|       |         imul   %rdi,%rsi // do a signed multiplication with magic constant and vector element
  135|       |         shr    $0x2f,%rsi // shift right by 47
  136|       |         imul   $0xfff1,%esi,%esi // do a signed multiplication with value truncated to 32 bits with 0xfff1
  137|       |         sub    %esi,%eax // subtract lower 32 bits of original vector value from modified one above
  138|       |         ...
  139|       |         // repeats for each element with vpextract instructions
  140|       |
  141|       |         This is tricky with AVX2 for a number of reasons:
  142|       |             1.) There's no 64 bit multiplication instruction, but there is a sequence to get there
  143|       |             2.) There's ways to extend vectors to 64 bit precision, but no simple way to truncate
  144|       |                 back down to 32 bit precision later (there is in AVX512)
  145|       |             3.) Full width integer multiplications aren't cheap
  146|       |
  147|       |         We can, however, do a relatively cheap sequence for horizontal sums.
  148|       |         Then, we simply do the integer modulus on the resulting 64 bit GPR, on a scalar value. It was
  149|       |         previously thought that casting to 64 bit precision was needed prior to the horizontal sum, but
  150|       |         that is simply not the case, as NMAX is defined as the maximum number of scalar sums that can be
  151|       |         performed on the maximum possible inputs before overflow
  152|       |         */
  153|       |
  154|       |
  155|       |         /* In AVX2-land, this trip through GPRs will probably be unavoidable, as there's no cheap and easy
  156|       |          * conversion from 64 bit integer to 32 bit (needed for the inexpensive modulus with a constant).
  157|       |          * This casting to 32 bit is cheap through GPRs (just register aliasing). See above for exactly
  158|       |          * what the compiler is doing to avoid integer divisions. */
  159|  8.06k|         adler0 = partial_hsum256(vs1) % BASE;
  ------------------
  |  |   11|  8.06k|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  160|  8.06k|         adler1 = hsum256(vs2) % BASE;
  ------------------
  |  |   11|  8.06k|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  161|  8.06k|    }
  162|       |
  163|    424|    adler = adler0 | (adler1 << 16);
  164|       |
  165|    424|    if (len) {
  ------------------
  |  Branch (165:9): [True: 301, False: 123]
  ------------------
  166|    301|        goto rem_peel;
  167|    301|    }
  168|       |
  169|    123|    return adler;
  170|    424|}

adler32_avx2.c:partial_hsum256:
   20|  8.06k|static inline uint32_t partial_hsum256(__m256i x) {
   21|       |    /* We need a permutation vector to extract every other integer. The
   22|       |     * rest are going to be zeros */
   23|  8.06k|    const __m256i perm_vec = _mm256_setr_epi32(0, 2, 4, 6, 1, 1, 1, 1);
   24|  8.06k|    __m256i non_zero = _mm256_permutevar8x32_epi32(x, perm_vec);
   25|  8.06k|    __m128i non_zero_sse = _mm256_castsi256_si128(non_zero);
   26|  8.06k|    __m128i sum2  = _mm_add_epi32(non_zero_sse,_mm_unpackhi_epi64(non_zero_sse, non_zero_sse));
   27|       |    __m128i sum3  = _mm_add_epi32(sum2, _mm_shuffle_epi32(sum2, 1));
   28|  8.06k|    return (uint32_t)_mm_cvtsi128_si32(sum3);
   29|  8.06k|}
adler32_avx2.c:hsum256:
   12|  8.06k|static inline uint32_t hsum256(__m256i x) {
   13|  8.06k|    __m128i sum1  = _mm_add_epi32(_mm256_extracti128_si256(x, 1),
   14|  8.06k|                                  _mm256_castsi256_si128(x));
   15|  8.06k|    __m128i sum2  = _mm_add_epi32(sum1, _mm_unpackhi_epi64(sum1, sum1));
   16|       |    __m128i sum3  = _mm_add_epi32(sum2, _mm_shuffle_epi32(sum2, 1));
   17|  8.06k|    return (uint32_t)_mm_cvtsi128_si32(sum3);
   18|  8.06k|}

adler32_fold_copy_sse42:
   16|    118|Z_INTERNAL uint32_t adler32_fold_copy_sse42(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len) {
   17|    118|    uint32_t adler0, adler1;
   18|    118|    adler1 = (adler >> 16) & 0xffff;
   19|    118|    adler0 = adler & 0xffff;
   20|       |
   21|    234|rem_peel:
   22|    234|    if (len < 16) {
  ------------------
  |  Branch (22:9): [True: 116, False: 118]
  ------------------
   23|    116|       return adler32_copy_len_16(adler0, src, dst, len, adler1);
   24|    116|    }
   25|       |
   26|    118|    __m128i vbuf, vbuf_0;
   27|    118|    __m128i vs1_0, vs3, vs1, vs2, vs2_0, v_sad_sum1, v_short_sum2, v_short_sum2_0,
   28|    118|            v_sad_sum2, vsum2, vsum2_0;
   29|    118|    __m128i zero = _mm_setzero_si128();
   30|    118|    const __m128i dot2v = _mm_setr_epi8(32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17);
   31|    118|    const __m128i dot2v_0 = _mm_setr_epi8(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
   32|    118|    const __m128i dot3v = _mm_set1_epi16(1);
   33|    118|    size_t k;
   34|       |
   35|    236|    while (len >= 16) {
  ------------------
  |  Branch (35:12): [True: 118, False: 118]
  ------------------
   36|       |
   37|    118|        k = MIN(len, NMAX);
  ------------------
  |  |  124|    118|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 0, False: 118]
  |  |  ------------------
  ------------------
   38|    118|        k -= k % 16;
   39|    118|        len -= k;
   40|       |
   41|    118|        vs1 = _mm_cvtsi32_si128(adler0);
   42|    118|        vs2 = _mm_cvtsi32_si128(adler1);
   43|       |
   44|    118|        vs3 = _mm_setzero_si128();
   45|    118|        vs2_0 = _mm_setzero_si128();
   46|    118|        vs1_0 = vs1;
   47|       |
   48|    118|        while (k >= 32) {
  ------------------
  |  Branch (48:16): [True: 0, False: 118]
  ------------------
   49|       |            /*
   50|       |               vs1 = adler + sum(c[i])
   51|       |               vs2 = sum2 + 16 vs1 + sum( (16-i+1) c[i] )
   52|       |            */
   53|      0|            vbuf = _mm_loadu_si128((__m128i*)src);
   54|      0|            vbuf_0 = _mm_loadu_si128((__m128i*)(src + 16));
   55|      0|            src += 32;
   56|      0|            k -= 32;
   57|       |
   58|      0|            v_sad_sum1 = _mm_sad_epu8(vbuf, zero);
   59|      0|            v_sad_sum2 = _mm_sad_epu8(vbuf_0, zero);
   60|      0|            _mm_storeu_si128((__m128i*)dst, vbuf);
   61|      0|            _mm_storeu_si128((__m128i*)(dst + 16), vbuf_0);
   62|      0|            dst += 32;
   63|       |
   64|      0|            v_short_sum2 = _mm_maddubs_epi16(vbuf, dot2v);
   65|      0|            v_short_sum2_0 = _mm_maddubs_epi16(vbuf_0, dot2v_0);
   66|       |
   67|      0|            vs1 = _mm_add_epi32(v_sad_sum1, vs1);
   68|      0|            vs3 = _mm_add_epi32(vs1_0, vs3);
   69|       |
   70|      0|            vsum2 = _mm_madd_epi16(v_short_sum2, dot3v);
   71|      0|            vsum2_0 = _mm_madd_epi16(v_short_sum2_0, dot3v);
   72|      0|            vs1 = _mm_add_epi32(v_sad_sum2, vs1);
   73|      0|            vs2 = _mm_add_epi32(vsum2, vs2);
   74|      0|            vs2_0 = _mm_add_epi32(vsum2_0, vs2_0);
   75|      0|            vs1_0 = vs1;
   76|      0|        }
   77|       |
   78|    118|        vs2 = _mm_add_epi32(vs2_0, vs2);
   79|    118|        vs3 = _mm_slli_epi32(vs3, 5);
   80|    118|        vs2 = _mm_add_epi32(vs3, vs2);
   81|    118|        vs3 = _mm_setzero_si128();
   82|       |
   83|    236|        while (k >= 16) {
  ------------------
  |  Branch (83:16): [True: 118, False: 118]
  ------------------
   84|       |            /*
   85|       |               vs1 = adler + sum(c[i])
   86|       |               vs2 = sum2 + 16 vs1 + sum( (16-i+1) c[i] )
   87|       |            */
   88|    118|            vbuf = _mm_loadu_si128((__m128i*)src);
   89|    118|            src += 16;
   90|    118|            k -= 16;
   91|       |
   92|    118|            v_sad_sum1 = _mm_sad_epu8(vbuf, zero);
   93|    118|            v_short_sum2 = _mm_maddubs_epi16(vbuf, dot2v_0);
   94|       |
   95|    118|            vs1 = _mm_add_epi32(v_sad_sum1, vs1);
   96|    118|            vs3 = _mm_add_epi32(vs1_0, vs3);
   97|    118|            vsum2 = _mm_madd_epi16(v_short_sum2, dot3v);
   98|    118|            vs2 = _mm_add_epi32(vsum2, vs2);
   99|    118|            vs1_0 = vs1;
  100|       |
  101|    118|            _mm_storeu_si128((__m128i*)dst, vbuf);
  102|    118|            dst += 16;
  103|    118|        }
  104|       |
  105|    118|        vs3 = _mm_slli_epi32(vs3, 4);
  106|    118|        vs2 = _mm_add_epi32(vs2, vs3);
  107|       |
  108|    118|        adler0 = partial_hsum(vs1) % BASE;
  ------------------
  |  |   11|    118|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  109|    118|        adler1 = hsum(vs2) % BASE;
  ------------------
  |  |   11|    118|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  110|    118|    }
  111|       |
  112|       |    /* If this is true, there's fewer than 16 elements remaining */
  113|    118|    if (len) {
  ------------------
  |  Branch (113:9): [True: 116, False: 2]
  ------------------
  114|    116|        goto rem_peel;
  115|    116|    }
  116|       |
  117|      2|    return adler0 | (adler1 << 16);
  118|    118|}

adler32_ssse3:
   17|     66|Z_INTERNAL uint32_t adler32_ssse3(uint32_t adler, const uint8_t *buf, size_t len) {
   18|     66|    uint32_t sum2;
   19|       |
   20|       |     /* split Adler-32 into component sums */
   21|     66|    sum2 = (adler >> 16) & 0xffff;
   22|     66|    adler &= 0xffff;
   23|       |
   24|       |    /* in case user likes doing a byte at a time, keep it fast */
   25|     66|    if (UNLIKELY(len == 1))
  ------------------
  |  |  214|     66|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 0, False: 66]
  |  |  ------------------
  ------------------
   26|      0|        return adler32_len_1(adler, buf, sum2);
   27|       |
   28|       |    /* initial Adler-32 value (deferred check for len == 1 speed) */
   29|     66|    if (UNLIKELY(buf == NULL))
  ------------------
  |  |  214|     66|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 0, False: 66]
  |  |  ------------------
  ------------------
   30|      0|        return 1L;
   31|       |
   32|       |    /* in case short lengths are provided, keep it somewhat fast */
   33|     66|    if (UNLIKELY(len < 16))
  ------------------
  |  |  214|     66|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 0, False: 66]
  |  |  ------------------
  ------------------
   34|      0|        return adler32_len_16(adler, buf, len, sum2);
   35|       |
   36|     66|    const __m128i dot2v = _mm_setr_epi8(32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17);
   37|     66|    const __m128i dot2v_0 = _mm_setr_epi8(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
   38|     66|    const __m128i dot3v = _mm_set1_epi16(1);
   39|     66|    const __m128i zero = _mm_setzero_si128();
   40|       |
   41|     66|    __m128i vbuf, vs1_0, vs3, vs1, vs2, vs2_0, v_sad_sum1, v_short_sum2, v_short_sum2_0,
   42|     66|            vbuf_0, v_sad_sum2, vsum2, vsum2_0;
   43|       |
   44|       |    /* If our buffer is unaligned (likely), make the determination whether
   45|       |     * or not there's enough of a buffer to consume to make the scalar, aligning
   46|       |     * additions worthwhile or if it's worth it to just eat the cost of an unaligned
   47|       |     * load. This is a pretty simple test, just test if 16 - the remainder + len is
   48|       |     * < 16 */
   49|     66|    size_t max_iters = NMAX;
  ------------------
  |  |   12|     66|#define NMAX 5552
  ------------------
   50|     66|    size_t rem = (uintptr_t)buf & 15;
   51|     66|    size_t align_offset = 16 - rem;
   52|     66|    size_t k = 0;
   53|     66|    if (rem) {
  ------------------
  |  Branch (53:9): [True: 0, False: 66]
  ------------------
   54|      0|        if (len < 16 + align_offset) {
  ------------------
  |  Branch (54:13): [True: 0, False: 0]
  ------------------
   55|       |            /* Let's eat the cost of this one unaligned load so that
   56|       |             * we don't completely skip over the vectorization. Doing
   57|       |             * 16 bytes at a time unaligned is better than 16 + <= 15
   58|       |             * sums */
   59|      0|            vbuf = _mm_loadu_si128((__m128i*)buf);
   60|      0|            len -= 16;
   61|      0|            buf += 16;
   62|      0|            vs1 = _mm_cvtsi32_si128(adler);
   63|      0|            vs2 = _mm_cvtsi32_si128(sum2);
   64|      0|            vs3 = _mm_setzero_si128();
   65|      0|            vs1_0 = vs1;
   66|      0|            goto unaligned_jmp;
   67|      0|        }
   68|       |
   69|      0|        for (size_t i = 0; i < align_offset; ++i) {
  ------------------
  |  Branch (69:28): [True: 0, False: 0]
  ------------------
   70|      0|            adler += *(buf++);
   71|      0|            sum2 += adler;
   72|      0|        }
   73|       |
   74|       |        /* lop off the max number of sums based on the scalar sums done
   75|       |         * above */
   76|      0|        len -= align_offset;
   77|      0|        max_iters -= align_offset;
   78|      0|    }
   79|       |
   80|       |
   81|    132|    while (len >= 16) {
  ------------------
  |  Branch (81:12): [True: 66, False: 66]
  ------------------
   82|     66|        vs1 = _mm_cvtsi32_si128(adler);
   83|     66|        vs2 = _mm_cvtsi32_si128(sum2);
   84|     66|        vs3 = _mm_setzero_si128();
   85|     66|        vs2_0 = _mm_setzero_si128();
   86|     66|        vs1_0 = vs1;
   87|       |
   88|     66|        k = (len < max_iters ? len : max_iters);
  ------------------
  |  Branch (88:14): [True: 66, False: 0]
  ------------------
   89|     66|        k -= k % 16;
   90|     66|        len -= k;
   91|       |
   92|     66|        while (k >= 32) {
  ------------------
  |  Branch (92:16): [True: 0, False: 66]
  ------------------
   93|       |            /*
   94|       |               vs1 = adler + sum(c[i])
   95|       |               vs2 = sum2 + 16 vs1 + sum( (16-i+1) c[i] )
   96|       |            */
   97|      0|            vbuf = _mm_load_si128((__m128i*)buf);
   98|      0|            vbuf_0 = _mm_load_si128((__m128i*)(buf + 16));
   99|      0|            buf += 32;
  100|      0|            k -= 32;
  101|       |
  102|      0|            v_sad_sum1 = _mm_sad_epu8(vbuf, zero);
  103|      0|            v_sad_sum2 = _mm_sad_epu8(vbuf_0, zero);
  104|      0|            vs1 = _mm_add_epi32(v_sad_sum1, vs1);
  105|      0|            vs3 = _mm_add_epi32(vs1_0, vs3);
  106|       |
  107|      0|            vs1 = _mm_add_epi32(v_sad_sum2, vs1);
  108|      0|            v_short_sum2 = _mm_maddubs_epi16(vbuf, dot2v);
  109|      0|            vsum2 = _mm_madd_epi16(v_short_sum2, dot3v);
  110|      0|            v_short_sum2_0 = _mm_maddubs_epi16(vbuf_0, dot2v_0);
  111|      0|            vs2 = _mm_add_epi32(vsum2, vs2);
  112|      0|            vsum2_0 = _mm_madd_epi16(v_short_sum2_0, dot3v);
  113|      0|            vs2_0 = _mm_add_epi32(vsum2_0, vs2_0);
  114|      0|            vs1_0 = vs1;
  115|      0|        }
  116|       |
  117|     66|        vs2 = _mm_add_epi32(vs2_0, vs2);
  118|     66|        vs3 = _mm_slli_epi32(vs3, 5);
  119|     66|        vs2 = _mm_add_epi32(vs3, vs2);
  120|     66|        vs3 = _mm_setzero_si128();
  121|       |
  122|    132|        while (k >= 16) {
  ------------------
  |  Branch (122:16): [True: 66, False: 66]
  ------------------
  123|       |            /*
  124|       |               vs1 = adler + sum(c[i])
  125|       |               vs2 = sum2 + 16 vs1 + sum( (16-i+1) c[i] )
  126|       |            */
  127|     66|            vbuf = _mm_load_si128((__m128i*)buf);
  128|     66|            buf += 16;
  129|     66|            k -= 16;
  130|       |
  131|     66|unaligned_jmp:
  132|     66|            v_sad_sum1 = _mm_sad_epu8(vbuf, zero);
  133|     66|            vs1 = _mm_add_epi32(v_sad_sum1, vs1);
  134|     66|            vs3 = _mm_add_epi32(vs1_0, vs3);
  135|     66|            v_short_sum2 = _mm_maddubs_epi16(vbuf, dot2v_0);
  136|     66|            vsum2 = _mm_madd_epi16(v_short_sum2, dot3v);
  137|     66|            vs2 = _mm_add_epi32(vsum2, vs2);
  138|     66|            vs1_0 = vs1;
  139|     66|        }
  140|       |
  141|     66|        vs3 = _mm_slli_epi32(vs3, 4);
  142|     66|        vs2 = _mm_add_epi32(vs2, vs3);
  143|       |
  144|       |        /* We don't actually need to do a full horizontal sum, since psadbw is actually doing
  145|       |         * a partial reduction sum implicitly and only summing to integers in vector positions
  146|       |         * 0 and 2. This saves us some contention on the shuffle port(s) */
  147|     66|        adler = partial_hsum(vs1) % BASE;
  ------------------
  |  |   11|     66|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  148|     66|        sum2 = hsum(vs2) % BASE;
  ------------------
  |  |   11|     66|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  149|     66|        max_iters = NMAX;
  ------------------
  |  |   12|     66|#define NMAX 5552
  ------------------
  150|     66|    }
  151|       |
  152|       |    /* Process tail (len < 16).  */
  153|     66|    return adler32_len_16(adler, buf, len, sum2);
  154|     66|}

adler32_ssse3.c:partial_hsum:
   14|     66|static inline uint32_t partial_hsum(__m128i x) {
   15|       |    __m128i second_int = _mm_srli_si128(x, 8);
   16|     66|    __m128i sum = _mm_add_epi32(x, second_int);
   17|     66|    return _mm_cvtsi128_si32(sum);
   18|     66|}
adler32_ssse3.c:hsum:
   20|     66|static inline uint32_t hsum(__m128i x) {
   21|     66|    __m128i sum1 = _mm_unpackhi_epi64(x, x);
   22|     66|    __m128i sum2 = _mm_add_epi32(x, sum1);
   23|       |    __m128i sum3 = _mm_shuffle_epi32(sum2, 0x01);
   24|     66|    __m128i sum4 = _mm_add_epi32(sum2, sum3);
   25|     66|    return _mm_cvtsi128_si32(sum4);
   26|     66|}
adler32_sse42.c:partial_hsum:
   14|    118|static inline uint32_t partial_hsum(__m128i x) {
   15|       |    __m128i second_int = _mm_srli_si128(x, 8);
   16|    118|    __m128i sum = _mm_add_epi32(x, second_int);
   17|    118|    return _mm_cvtsi128_si32(sum);
   18|    118|}
adler32_sse42.c:hsum:
   20|    118|static inline uint32_t hsum(__m128i x) {
   21|    118|    __m128i sum1 = _mm_unpackhi_epi64(x, x);
   22|    118|    __m128i sum2 = _mm_add_epi32(x, sum1);
   23|       |    __m128i sum3 = _mm_shuffle_epi32(sum2, 0x01);
   24|    118|    __m128i sum4 = _mm_add_epi32(sum2, sum3);
   25|    118|    return _mm_cvtsi128_si32(sum4);
   26|    118|}

chunkset_avx2.c:loadhalfchunk:
   91|     40|static inline void loadhalfchunk(uint8_t const *s, halfchunk_t *chunk) {
   92|     40|    *chunk = _mm_loadu_si128((__m128i *)s);
   93|     40|}
chunkset_avx2.c:GET_HALFCHUNK_MAG:
  105|  1.07k|static inline halfchunk_t GET_HALFCHUNK_MAG(uint8_t *buf, uint32_t *chunk_rem, uint32_t dist) {
  106|  1.07k|    lut_rem_pair lut_rem = perm_idx_lut[dist - 3];
  107|  1.07k|    __m128i perm_vec, ret_vec;
  108|  1.07k|    __msan_unpoison(buf + dist, 16 - dist);
  ------------------
  |  |  338|  1.07k|#  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  1.07k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |               #  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  1.07k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |  |  Branch (338:79): [Folded, False: 1.07k]
  |  |  ------------------
  ------------------
  109|  1.07k|    ret_vec = _mm_loadu_si128((__m128i*)buf);
  110|  1.07k|    *chunk_rem = half_rem_vals[dist - 3];
  111|       |
  112|  1.07k|    perm_vec = _mm_load_si128((__m128i*)(permute_table + lut_rem.idx));
  113|  1.07k|    ret_vec = _mm_shuffle_epi8(ret_vec, perm_vec);
  114|       |
  115|  1.07k|    return ret_vec;
  116|  1.07k|}
chunkset_avx2.c:storehalfchunk:
   95|    223|static inline void storehalfchunk(uint8_t *out, halfchunk_t *chunk) {
   96|    223|    _mm_storeu_si128((__m128i *)out, *chunk);
   97|    223|}
chunkset_avx2.c:halfchunk2whole:
   99|  1.07k|static inline chunk_t halfchunk2whole(halfchunk_t *chunk) {
  100|       |    /* We zero extend mostly to appease some memory sanitizers. These bytes are ultimately
  101|       |     * unlikely to be actually written or read from */
  102|  1.07k|    return _mm256_zextsi128_si256(*chunk);
  103|  1.07k|}
chunkset_avx2.c:chunkmemset_2:
   22|  2.18k|static inline void chunkmemset_2(uint8_t *from, chunk_t *chunk) {
   23|  2.18k|    *chunk = _mm256_set1_epi16(zng_memread_2(from));
   24|  2.18k|}
chunkset_avx2.c:chunkmemset_4:
   26|  1.74k|static inline void chunkmemset_4(uint8_t *from, chunk_t *chunk) {
   27|  1.74k|    *chunk = _mm256_set1_epi32(zng_memread_4(from));
   28|  1.74k|}
chunkset_avx2.c:chunkmemset_8:
   30|    334|static inline void chunkmemset_8(uint8_t *from, chunk_t *chunk) {
   31|    334|    *chunk = _mm256_set1_epi64x(zng_memread_8(from));
   32|    334|}
chunkset_avx2.c:chunkmemset_16:
   34|  1.00k|static inline void chunkmemset_16(uint8_t *from, chunk_t *chunk) {
   35|       |    /* See explanation in chunkset_avx512.c */
   36|       |#if defined(_MSC_VER) && _MSC_VER <= 1900
   37|       |    halfchunk_t half = _mm_loadu_si128((__m128i*)from);
   38|       |    *chunk = _mm256_inserti128_si256(_mm256_castsi128_si256(half), half, 1);
   39|       |#else
   40|  1.00k|    *chunk = _mm256_broadcastsi128_si256(_mm_loadu_si128((__m128i*)from));
   41|  1.00k|#endif
   42|  1.00k|}
chunkset_avx2.c:GET_CHUNK_MAG:
   52|  13.1k|static inline chunk_t GET_CHUNK_MAG(uint8_t *buf, uint32_t *chunk_rem, uint32_t dist) {
   53|  13.1k|    lut_rem_pair lut_rem = perm_idx_lut[dist - 3];
   54|  13.1k|    __m256i ret_vec;
   55|       |    /* While technically we only need to read 4 or 8 bytes into this vector register for a lot of cases, GCC is
   56|       |     * compiling this to a shared load for all branches, preferring the simpler code.  Given that the buf value isn't in
   57|       |     * GPRs to begin with the 256 bit load is _probably_ just as inexpensive */
   58|  13.1k|    *chunk_rem = lut_rem.remval;
   59|       |
   60|       |    /* See note in chunkset_ssse3.c for why this is ok */
   61|  13.1k|    __msan_unpoison(buf + dist, 32 - dist);
  ------------------
  |  |  338|  13.1k|#  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  13.1k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |               #  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  13.1k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |  |  Branch (338:79): [Folded, False: 13.1k]
  |  |  ------------------
  ------------------
   62|       |
   63|  13.1k|    if (dist < 16) {
  ------------------
  |  Branch (63:9): [True: 7.94k, False: 5.16k]
  ------------------
   64|       |        /* This simpler case still requires us to shuffle in 128 bit lanes, so we must apply a static offset after
   65|       |         * broadcasting the first vector register to both halves. This is _marginally_ faster than doing two separate
   66|       |         * shuffles and combining the halves later */
   67|  7.94k|        const __m256i permute_xform =
   68|  7.94k|            _mm256_setr_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   69|  7.94k|                             16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16);
   70|  7.94k|        __m256i perm_vec = _mm256_load_si256((__m256i*)(permute_table+lut_rem.idx));
   71|  7.94k|        __m128i ret_vec0 = _mm_loadu_si128((__m128i*)buf);
   72|  7.94k|        perm_vec = _mm256_add_epi8(perm_vec, permute_xform);
   73|  7.94k|        ret_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ret_vec0), ret_vec0, 1);
   74|  7.94k|        ret_vec = _mm256_shuffle_epi8(ret_vec, perm_vec);
   75|  7.94k|    }  else {
   76|  5.16k|        __m128i ret_vec0 = _mm_loadu_si128((__m128i*)buf);
   77|  5.16k|        __m128i ret_vec1 = _mm_loadu_si128((__m128i*)(buf + 16));
   78|       |        /* Take advantage of the fact that only the latter half of the 256 bit vector will actually differ */
   79|  5.16k|        __m128i perm_vec1 = _mm_load_si128((__m128i*)(permute_table + lut_rem.idx));
   80|  5.16k|        __m128i xlane_permutes = _mm_cmpgt_epi8(_mm_set1_epi8(16), perm_vec1);
   81|  5.16k|        __m128i xlane_res  = _mm_shuffle_epi8(ret_vec0, perm_vec1);
   82|       |        /* Since we can't wrap twice, we can simply keep the later half exactly how it is instead of having to _also_
   83|       |         * shuffle those values */
   84|  5.16k|        __m128i latter_half = _mm_blendv_epi8(ret_vec1, xlane_res, xlane_permutes);
   85|  5.16k|        ret_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ret_vec0), latter_half, 1);
   86|  5.16k|    }
   87|       |
   88|  13.1k|    return ret_vec;
   89|  13.1k|}
chunkset_avx2.c:storechunk:
   48|   325k|static inline void storechunk(uint8_t *out, chunk_t *chunk) {
   49|   325k|    _mm256_storeu_si256((__m256i *)out, *chunk);
   50|   325k|}
chunkset_avx2.c:loadchunk:
   44|   268k|static inline void loadchunk(uint8_t const *s, chunk_t *chunk) {
   45|   268k|    *chunk = _mm256_loadu_si256((__m256i *)s);
   46|   268k|}

x86_check_features:
   79|      1|void Z_INTERNAL x86_check_features(struct x86_cpu_features *features) {
   80|      1|    unsigned eax, ebx, ecx, edx;
   81|      1|    unsigned maxbasic;
   82|       |
   83|      1|    cpuid(0, &maxbasic, &ebx, &ecx, &edx);
   84|      1|    cpuid(1 /*CPU_PROCINFO_AND_FEATUREBITS*/, &eax, &ebx, &ecx, &edx);
   85|       |
   86|      1|    features->has_sse2 = edx & 0x4000000;
   87|      1|    features->has_ssse3 = ecx & 0x200;
   88|      1|    features->has_sse41 = ecx & 0x80000;
   89|      1|    features->has_sse42 = ecx & 0x100000;
   90|      1|    features->has_pclmulqdq = ecx & 0x2;
   91|       |
   92|      1|    if (ecx & 0x08000000) {
  ------------------
  |  Branch (92:9): [True: 1, False: 0]
  ------------------
   93|      1|        uint64_t xfeature = xgetbv(0);
   94|       |
   95|      1|        features->has_os_save_ymm = ((xfeature & 0x06) == 0x06);
   96|      1|        features->has_os_save_zmm = ((xfeature & 0xe6) == 0xe6);
   97|      1|    }
   98|       |
   99|      1|    if (maxbasic >= 7) {
  ------------------
  |  Branch (99:9): [True: 1, False: 0]
  ------------------
  100|       |        // Reference: https://software.intel.com/sites/default/files/article/405250/how-to-detect-new-instruction-support-in-the-4th-generation-intel-core-processor-family.pdf
  101|      1|        cpuidex(7, 0, &eax, &ebx, &ecx, &edx);
  102|       |
  103|       |        // check BMI2 bit
  104|      1|        features->has_bmi2 = ebx & 0x100;
  105|       |
  106|       |        // check AVX2 bit if the OS supports saving YMM registers
  107|      1|        if (features->has_os_save_ymm) {
  ------------------
  |  Branch (107:13): [True: 1, False: 0]
  ------------------
  108|      1|            features->has_avx2 = ebx & 0x20;
  109|      1|        }
  110|       |
  111|       |        // check AVX512 bits if the OS supports saving ZMM registers
  112|      1|        if (features->has_os_save_zmm) {
  ------------------
  |  Branch (112:13): [True: 0, False: 1]
  ------------------
  113|      0|            features->has_avx512f = ebx & 0x00010000;
  114|      0|            if (features->has_avx512f) {
  ------------------
  |  Branch (114:17): [True: 0, False: 0]
  ------------------
  115|       |                // According to the Intel Software Developer's Manual, AVX512F must be enabled too in order to enable
  116|       |                // AVX512(DQ,BW,VL).
  117|      0|                features->has_avx512dq = ebx & 0x00020000;
  118|      0|                features->has_avx512bw = ebx & 0x40000000;
  119|      0|                features->has_avx512vl = ebx & 0x80000000;
  120|      0|            }
  121|      0|            features->has_avx512_common = features->has_avx512f && features->has_avx512dq && features->has_avx512bw \
  ------------------
  |  Branch (121:43): [True: 0, False: 0]
  |  Branch (121:68): [True: 0, False: 0]
  |  Branch (121:94): [True: 0, False: 0]
  ------------------
  122|      0|              && features->has_avx512vl && features->has_bmi2;
  ------------------
  |  Branch (122:18): [True: 0, False: 0]
  |  Branch (122:44): [True: 0, False: 0]
  ------------------
  123|      0|            features->has_avx512vnni = ecx & 0x800;
  124|      0|            features->has_vpclmulqdq = ecx & 0x400;
  125|      0|        }
  126|      1|    }
  127|      1|}
x86_features.c:cpuid:
   30|      2|static inline void cpuid(int info, unsigned* eax, unsigned* ebx, unsigned* ecx, unsigned* edx) {
   31|       |#if defined(HAVE_CPUID_MS)
   32|       |    unsigned int registers[4];
   33|       |    __cpuid((int *)registers, info);
   34|       |
   35|       |    *eax = registers[0];
   36|       |    *ebx = registers[1];
   37|       |    *ecx = registers[2];
   38|       |    *edx = registers[3];
   39|       |#elif defined(HAVE_CPUID_GNU)
   40|       |    *eax = *ebx = *ecx = *edx = 0;
   41|      2|    __cpuid(info, *eax, *ebx, *ecx, *edx);
   42|       |#else
   43|       |    /* When using this fallback, the faster SSE/AVX code is disabled */
   44|       |    *eax = *ebx = *ecx = *edx = 0;
   45|       |#endif
   46|      2|}
x86_features.c:xgetbv:
   66|      1|static inline uint64_t xgetbv(unsigned int xcr) {
   67|      1|#if defined(_MSC_VER) || defined(X86_HAVE_XSAVE_INTRIN)
   68|      1|    return _xgetbv(xcr);
   69|       |#elif defined(__GNUC__)
   70|       |    uint32_t eax, edx;
   71|       |    __asm__ ( ".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c"(xcr));
   72|       |    return (uint64_t)(edx) << 32 | eax;
   73|       |#else
   74|       |    /* When using this fallback, some of the faster code is disabled */
   75|       |    return 0;
   76|       |#endif
   77|      1|}
x86_features.c:cpuidex:
   48|      1|static inline void cpuidex(int info, int subinfo, unsigned* eax, unsigned* ebx, unsigned* ecx, unsigned* edx) {
   49|       |#if defined(HAVE_CPUID_MS)
   50|       |    unsigned int registers[4];
   51|       |    __cpuidex((int *)registers, info, subinfo);
   52|       |
   53|       |    *eax = registers[0];
   54|       |    *ebx = registers[1];
   55|       |    *ecx = registers[2];
   56|       |    *edx = registers[3];
   57|       |#elif defined(HAVE_CPUID_GNU)
   58|       |    *eax = *ebx = *ecx = *edx = 0;
   59|      1|    __cpuid_count(info, subinfo, *eax, *ebx, *ecx, *edx);
   60|       |#else
   61|       |    /* When using this fallback, the faster SSE/AVX code is disabled */
   62|       |    *eax = *ebx = *ecx = *edx = 0;
   63|       |#endif
   64|      1|}

chunkmemset_safe_avx2:
  229|  2.74k|Z_INTERNAL uint8_t* CHUNKMEMSET_SAFE(uint8_t *out, uint8_t *from, unsigned len, unsigned left) {
  230|       |#if OPTIMAL_CMP < 32
  231|       |    static const uint32_t align_mask = 7;
  232|       |#elif OPTIMAL_CMP == 32
  233|       |    static const uint32_t align_mask = 3;
  234|       |#endif
  235|       |
  236|  2.74k|    len = MIN(len, left);
  ------------------
  |  |  124|  2.74k|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 0, False: 2.74k]
  |  |  ------------------
  ------------------
  237|       |
  238|       |#if OPTIMAL_CMP < 64
  239|       |    while (((uintptr_t)out & align_mask) && (len > 0)) {
  240|       |        *out++ = *from++;
  241|       |        --len;
  242|       |        --left;
  243|       |    }
  244|       |#endif
  245|       |
  246|  2.74k|#ifndef HAVE_MASKED_READWRITE
  247|  2.74k|    if (UNLIKELY(left < sizeof(chunk_t))) {
  ------------------
  |  |  214|  2.74k|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 76, False: 2.66k]
  |  |  ------------------
  ------------------
  248|    788|        while (len > 0) {
  ------------------
  |  Branch (248:16): [True: 712, False: 76]
  ------------------
  249|    712|            *out++ = *from++;
  250|    712|            --len;
  251|    712|        }
  252|       |
  253|     76|        return out;
  254|     76|    }
  255|  2.66k|#endif
  256|       |
  257|  2.66k|    if (len)
  ------------------
  |  Branch (257:9): [True: 2.66k, False: 0]
  ------------------
  258|  2.66k|        out = CHUNKMEMSET(out, from, len);
  ------------------
  |  |  121|  2.66k|#define CHUNKMEMSET      chunkmemset_avx2
  ------------------
  259|       |
  260|  2.66k|    return out;
  261|  2.74k|}
chunkset_avx2.c:chunkmemset_avx2:
  112|   178k|static inline uint8_t* CHUNKMEMSET(uint8_t *out, uint8_t *from, unsigned len) {
  113|       |    /* Debug performance related issues when len < sizeof(uint64_t):
  114|       |       Assert(len >= sizeof(uint64_t), "chunkmemset should be called on larger chunks"); */
  115|   178k|    Assert(from != out, "chunkmemset cannot have a distance 0");
  116|       |
  117|   178k|    chunk_t chunk_load;
  118|   178k|    uint32_t chunk_mod = 0;
  119|   178k|    uint32_t adv_amount;
  120|   178k|    int64_t sdist = out - from;
  121|   178k|    uint64_t dist = llabs(sdist);
  122|       |
  123|       |    /* We are supporting the case for when we are reading bytes from ahead in the buffer.
  124|       |     * We now have to handle this, though it wasn't _quite_ clear if this rare circumstance
  125|       |     * always needed to be handled here or if we're just now seeing it because we are
  126|       |     * dispatching to this function, more */
  127|   178k|    if (sdist < 0 && dist < len) {
  ------------------
  |  Branch (127:9): [True: 0, False: 178k]
  |  Branch (127:22): [True: 0, False: 0]
  ------------------
  128|       |#ifdef HAVE_MASKED_READWRITE
  129|       |        /* We can still handle this case if we can mitigate over writing _and_ we
  130|       |         * fit the entirety of the copy length with one load */
  131|       |        if (len <= sizeof(chunk_t)) {
  132|       |            /* Tempting to add a goto to the block below but hopefully most compilers
  133|       |             * collapse these identical code segments as one label to jump to */
  134|       |            return CHUNKCOPY(out, from, len);
  135|       |        }
  136|       |#endif
  137|       |        /* Here the memmove semantics match perfectly, as when this happens we are
  138|       |         * effectively sliding down the contents of memory by dist bytes */
  139|      0|        memmove(out, from, len);
  140|      0|        return out + len;
  141|      0|    }
  142|       |
  143|   178k|    if (dist == 1) {
  ------------------
  |  Branch (143:9): [True: 158k, False: 19.9k]
  ------------------
  144|   158k|        memset(out, *from, len);
  145|   158k|        return out + len;
  146|   158k|    } else if (dist >= sizeof(chunk_t)) {
  ------------------
  |  Branch (146:16): [True: 410, False: 19.4k]
  ------------------
  147|    410|        return CHUNKCOPY(out, from, len);
  ------------------
  |  |  119|    410|#define CHUNKCOPY        chunkcopy_avx2
  ------------------
  148|    410|    }
  149|       |
  150|       |    /* Only AVX2+ as there's 128 bit vectors and 256 bit. We allow for shorter vector
  151|       |     * lengths because they serve to allow more cases to fall into chunkcopy, as the
  152|       |     * distance of the shorter length is still deemed a safe distance. We rewrite this
  153|       |     * here rather than calling the ssse3 variant directly now because doing so required
  154|       |     * dispatching to another function and broke inlining for this function entirely. We
  155|       |     * also can merge an assert and some remainder peeling behavior into the same code blocks,
  156|       |     * making the code a little smaller.  */
  157|  19.4k|#ifdef HAVE_HALF_CHUNK
  158|  19.4k|    if (len <= sizeof(halfchunk_t)) {
  ------------------
  |  Branch (158:9): [True: 2.70k, False: 16.7k]
  ------------------
  159|  2.70k|        if (dist >= sizeof(halfchunk_t))
  ------------------
  |  Branch (159:13): [True: 40, False: 2.66k]
  ------------------
  160|     40|            return HALFCHUNKCOPY(out, from, len);
  161|       |
  162|  2.66k|        if ((dist % 2) != 0 || dist == 6) {
  ------------------
  |  Branch (162:13): [True: 836, False: 1.83k]
  |  Branch (162:32): [True: 236, False: 1.59k]
  ------------------
  163|  1.07k|            halfchunk_t halfchunk_load = GET_HALFCHUNK_MAG(from, &chunk_mod, (unsigned)dist);
  164|       |
  165|  1.07k|            if (len == sizeof(halfchunk_t)) {
  ------------------
  |  Branch (165:17): [True: 183, False: 889]
  ------------------
  166|    183|                storehalfchunk(out, &halfchunk_load);
  167|    183|                len -= sizeof(halfchunk_t);
  168|    183|                out += sizeof(halfchunk_t);
  169|    183|            }
  170|       |
  171|  1.07k|            chunk_load = halfchunk2whole(&halfchunk_load);
  172|  1.07k|            goto rem_bytes;
  173|  1.07k|        }
  174|  2.66k|    }
  175|  18.3k|#endif
  176|       |
  177|  18.3k|#ifdef HAVE_CHUNKMEMSET_2
  178|  18.3k|    if (dist == 2) {
  ------------------
  |  Branch (178:9): [True: 2.18k, False: 16.1k]
  ------------------
  179|  2.18k|        chunkmemset_2(from, &chunk_load);
  180|  2.18k|    } else
  181|  16.1k|#endif
  182|  16.1k|#ifdef HAVE_CHUNKMEMSET_4
  183|  16.1k|    if (dist == 4) {
  ------------------
  |  Branch (183:9): [True: 1.74k, False: 14.4k]
  ------------------
  184|  1.74k|        chunkmemset_4(from, &chunk_load);
  185|  1.74k|    } else
  186|  14.4k|#endif
  187|  14.4k|#ifdef HAVE_CHUNKMEMSET_8
  188|  14.4k|    if (dist == 8) {
  ------------------
  |  Branch (188:9): [True: 334, False: 14.1k]
  ------------------
  189|    334|        chunkmemset_8(from, &chunk_load);
  190|    334|    } else
  191|  14.1k|#endif
  192|  14.1k|#ifdef HAVE_CHUNKMEMSET_16
  193|  14.1k|    if (dist == 16) {
  ------------------
  |  Branch (193:9): [True: 1.00k, False: 13.1k]
  ------------------
  194|  1.00k|        chunkmemset_16(from, &chunk_load);
  195|  1.00k|    } else
  196|  13.1k|#endif
  197|  13.1k|    chunk_load = GET_CHUNK_MAG(from, &chunk_mod, (unsigned)dist);
  198|       |
  199|  18.3k|    adv_amount = sizeof(chunk_t) - chunk_mod;
  200|       |
  201|  42.5k|    while (len >= (2 * sizeof(chunk_t))) {
  ------------------
  |  Branch (201:12): [True: 24.1k, False: 18.3k]
  ------------------
  202|  24.1k|        storechunk(out, &chunk_load);
  203|  24.1k|        storechunk(out + adv_amount, &chunk_load);
  204|  24.1k|        out += 2 * adv_amount;
  205|  24.1k|        len -= 2 * adv_amount;
  206|  24.1k|    }
  207|       |
  208|       |    /* If we don't have a "dist" length that divides evenly into a vector
  209|       |     * register, we can write the whole vector register but we need only
  210|       |     * advance by the amount of the whole string that fits in our chunk_t.
  211|       |     * If we do divide evenly into the vector length, adv_amount = chunk_t size*/
  212|  27.0k|    while (len >= sizeof(chunk_t)) {
  ------------------
  |  Branch (212:12): [True: 8.70k, False: 18.3k]
  ------------------
  213|  8.70k|        storechunk(out, &chunk_load);
  214|  8.70k|        len -= adv_amount;
  215|  8.70k|        out += adv_amount;
  216|  8.70k|    }
  217|       |
  218|  18.3k|#ifdef HAVE_HALF_CHUNK
  219|  19.4k|rem_bytes:
  220|  19.4k|#endif
  221|  19.4k|    if (len) {
  ------------------
  |  Branch (221:9): [True: 19.2k, False: 251]
  ------------------
  222|  19.2k|        memcpy(out, &chunk_load, len);
  223|  19.2k|        out += len;
  224|  19.2k|    }
  225|       |
  226|  19.4k|    return out;
  227|  18.3k|}
chunkset_avx2.c:HALFCHUNKCOPY:
   91|     40|static inline uint8_t* HALFCHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
   92|     40|    halfchunk_t chunk;
   93|     40|    int32_t align = ((len - 1) % sizeof(halfchunk_t)) + 1;
   94|     40|    loadhalfchunk(from, &chunk);
   95|     40|    storehalfchunk(out, &chunk);
   96|     40|    out += align;
   97|     40|    from += align;
   98|     40|    len -= align;
   99|     40|    while (len > 0) {
  ------------------
  |  Branch (99:12): [True: 0, False: 40]
  ------------------
  100|      0|        loadhalfchunk(from, &chunk);
  101|      0|        storehalfchunk(out, &chunk);
  102|      0|        out += sizeof(halfchunk_t);
  103|      0|        from += sizeof(halfchunk_t);
  104|      0|        len -= sizeof(halfchunk_t);
  105|      0|    }
  106|     40|    return out;
  107|     40|}
chunkset_avx2.c:chunksize_avx2:
    9|   177k|static inline size_t CHUNKSIZE(void) {
   10|   177k|    return sizeof(chunk_t);
   11|   177k|}
chunkset_avx2.c:chunkcopy_avx2:
   24|  47.5k|static inline uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
   25|  47.5k|    Assert(len > 0, "chunkcopy should never have a length 0");
   26|  47.5k|    chunk_t chunk;
   27|  47.5k|    int32_t align = ((len - 1) % sizeof(chunk_t)) + 1;
   28|  47.5k|    loadchunk(from, &chunk);
   29|  47.5k|    storechunk(out, &chunk);
   30|  47.5k|    out += align;
   31|  47.5k|    from += align;
   32|  47.5k|    len -= align;
   33|   268k|    while (len > 0) {
  ------------------
  |  Branch (33:12): [True: 220k, False: 47.5k]
  ------------------
   34|   220k|        loadchunk(from, &chunk);
   35|   220k|        storechunk(out, &chunk);
   36|   220k|        out += sizeof(chunk_t);
   37|   220k|        from += sizeof(chunk_t);
   38|   220k|        len -= sizeof(chunk_t);
   39|   220k|    }
   40|  47.5k|    return out;
   41|  47.5k|}

cpu_check_features:
   10|      1|Z_INTERNAL void cpu_check_features(struct cpu_features *features) {
   11|      1|    memset(features, 0, sizeof(struct cpu_features));
   12|      1|#if defined(X86_FEATURES)
   13|      1|    x86_check_features(&features->x86);
   14|       |#elif defined(ARM_FEATURES)
   15|       |    arm_check_features(&features->arm);
   16|       |#elif defined(PPC_FEATURES) || defined(POWER_FEATURES)
   17|       |    power_check_features(&features->power);
   18|       |#elif defined(S390_FEATURES)
   19|       |    s390_check_features(&features->s390);
   20|       |#elif defined(RISCV_FEATURES)
   21|       |    riscv_check_features(&features->riscv);
   22|       |#elif defined(LOONGARCH_FEATURES)
   23|       |    loongarch_check_features(&features->loongarch);
   24|       |#endif
   25|      1|}

functable.c:force_init_stub:
  377|      1|static int force_init_stub(void) {
  378|      1|    return init_functable();
  379|      1|}
functable.c:init_functable:
   70|      1|static int init_functable(void) {
   71|      1|    struct functable_s ft;
   72|      1|    struct cpu_features cf;
   73|       |
   74|      1|    memset(&ft, 0, sizeof(struct functable_s));
   75|      1|    cpu_check_features(&cf);
   76|      1|    ft.force_init = &force_init_empty;
   77|       |
   78|       |    // Set up generic C code fallbacks
   79|      1|#ifndef WITH_ALL_FALLBACKS
   80|      1|#  if (defined(__x86_64__) || defined(_M_X64)) && defined(X86_SSE2)
   81|       |    // x86_64 always has SSE2, so we can use SSE2 functions as fallbacks where available.
   82|      1|    ft.adler32 = &adler32_c;
   83|      1|    ft.adler32_fold_copy = &adler32_fold_copy_c;
   84|      1|    ft.crc32 = &crc32_braid;
   85|      1|    ft.crc32_fold = &crc32_fold_c;
   86|      1|    ft.crc32_fold_copy = &crc32_fold_copy_c;
   87|      1|    ft.crc32_fold_final = &crc32_fold_final_c;
   88|      1|    ft.crc32_fold_reset = &crc32_fold_reset_c;
   89|       |#    ifndef HAVE_BUILTIN_CTZ
   90|       |    ft.longest_match = &longest_match_c;
   91|       |    ft.longest_match_slow = &longest_match_slow_c;
   92|       |    ft.compare256 = &compare256_c;
   93|       |#    endif
   94|      1|#  endif
   95|       |#else // WITH_ALL_FALLBACKS
   96|       |    ft.adler32 = &adler32_c;
   97|       |    ft.adler32_fold_copy = &adler32_fold_copy_c;
   98|       |    ft.chunkmemset_safe = &chunkmemset_safe_c;
   99|       |    ft.crc32 = &crc32_braid;
  100|       |    ft.crc32_fold = &crc32_fold_c;
  101|       |    ft.crc32_fold_copy = &crc32_fold_copy_c;
  102|       |    ft.crc32_fold_final = &crc32_fold_final_c;
  103|       |    ft.crc32_fold_reset = &crc32_fold_reset_c;
  104|       |    ft.inflate_fast = &inflate_fast_c;
  105|       |    ft.slide_hash = &slide_hash_c;
  106|       |    ft.longest_match = &longest_match_c;
  107|       |    ft.longest_match_slow = &longest_match_slow_c;
  108|       |    ft.compare256 = &compare256_c;
  109|       |#endif
  110|       |
  111|       |    // Select arch-optimized functions
  112|      1|#ifdef WITH_OPTIM
  113|       |
  114|       |    // Chorba generic C fallback
  115|      1|#ifndef WITHOUT_CHORBA
  116|      1|    ft.crc32 = &crc32_chorba;
  117|      1|#endif
  118|       |
  119|       |    // X86 - SSE2
  120|      1|#ifdef X86_SSE2
  121|       |#  if !defined(__x86_64__) && !defined(_M_X64)
  122|       |    if (cf.x86.has_sse2)
  123|       |#  endif
  124|      1|    {
  125|      1|        ft.chunkmemset_safe = &chunkmemset_safe_sse2;
  126|      1|#  if !defined(WITHOUT_CHORBA_SSE)
  127|      1|        ft.crc32 = &crc32_chorba_sse2;
  128|      1|#  endif
  129|      1|        ft.inflate_fast = &inflate_fast_sse2;
  130|      1|        ft.slide_hash = &slide_hash_sse2;
  131|      1|#  ifdef HAVE_BUILTIN_CTZ
  132|      1|        ft.compare256 = &compare256_sse2;
  133|      1|        ft.longest_match = &longest_match_sse2;
  134|      1|        ft.longest_match_slow = &longest_match_slow_sse2;
  135|      1|#  endif
  136|      1|    }
  137|      1|#endif
  138|       |    // X86 - SSSE3
  139|      1|#ifdef X86_SSSE3
  140|      1|    if (cf.x86.has_ssse3) {
  ------------------
  |  Branch (140:9): [True: 1, False: 0]
  ------------------
  141|      1|        ft.adler32 = &adler32_ssse3;
  142|      1|        ft.chunkmemset_safe = &chunkmemset_safe_ssse3;
  143|      1|        ft.inflate_fast = &inflate_fast_ssse3;
  144|      1|    }
  145|      1|#endif
  146|       |
  147|       |    // X86 - SSE4.1
  148|      1|#if defined(X86_SSE41) && !defined(WITHOUT_CHORBA_SSE)
  149|      1|    if (cf.x86.has_sse41) {
  ------------------
  |  Branch (149:9): [True: 1, False: 0]
  ------------------
  150|      1|        ft.crc32 = &crc32_chorba_sse41;
  151|      1|    }
  152|      1|#endif
  153|       |
  154|       |    // X86 - SSE4.2
  155|      1|#ifdef X86_SSE42
  156|      1|    if (cf.x86.has_sse42) {
  ------------------
  |  Branch (156:9): [True: 1, False: 0]
  ------------------
  157|      1|        ft.adler32_fold_copy = &adler32_fold_copy_sse42;
  158|      1|    }
  159|      1|#endif
  160|       |    // X86 - PCLMUL
  161|      1|#ifdef X86_PCLMULQDQ_CRC
  162|      1|    if (cf.x86.has_pclmulqdq) {
  ------------------
  |  Branch (162:9): [True: 1, False: 0]
  ------------------
  163|      1|        ft.crc32 = &crc32_pclmulqdq;
  164|      1|        ft.crc32_fold = &crc32_fold_pclmulqdq;
  165|      1|        ft.crc32_fold_copy = &crc32_fold_pclmulqdq_copy;
  166|      1|        ft.crc32_fold_final = &crc32_fold_pclmulqdq_final;
  167|      1|        ft.crc32_fold_reset = &crc32_fold_pclmulqdq_reset;
  168|      1|    }
  169|      1|#endif
  170|       |    // X86 - AVX
  171|      1|#ifdef X86_AVX2
  172|       |    /* BMI2 support is all but implicit with AVX2 but let's sanity check this just in case. Enabling BMI2 allows for
  173|       |     * flagless shifts, resulting in fewer flag stalls for the pipeline, and allows us to set destination registers
  174|       |     * for the shift results as an operand, eliminating several register-register moves when the original value needs
  175|       |     * to remain intact. They also allow for a count operand that isn't the CL register, avoiding contention there */
  176|      1|    if (cf.x86.has_avx2 && cf.x86.has_bmi2) {
  ------------------
  |  Branch (176:9): [True: 1, False: 0]
  |  Branch (176:28): [True: 1, False: 0]
  ------------------
  177|      1|        ft.adler32 = &adler32_avx2;
  178|      1|        ft.adler32_fold_copy = &adler32_fold_copy_avx2;
  179|      1|        ft.chunkmemset_safe = &chunkmemset_safe_avx2;
  180|      1|        ft.inflate_fast = &inflate_fast_avx2;
  181|      1|        ft.slide_hash = &slide_hash_avx2;
  182|      1|#  ifdef HAVE_BUILTIN_CTZ
  183|      1|        ft.compare256 = &compare256_avx2;
  184|      1|        ft.longest_match = &longest_match_avx2;
  185|      1|        ft.longest_match_slow = &longest_match_slow_avx2;
  186|      1|#  endif
  187|      1|    }
  188|      1|#endif
  189|       |    // X86 - AVX512 (F,DQ,BW,Vl)
  190|      1|#ifdef X86_AVX512
  191|      1|    if (cf.x86.has_avx512_common) {
  ------------------
  |  Branch (191:9): [True: 0, False: 1]
  ------------------
  192|      0|        ft.adler32 = &adler32_avx512;
  193|      0|        ft.adler32_fold_copy = &adler32_fold_copy_avx512;
  194|      0|        ft.chunkmemset_safe = &chunkmemset_safe_avx512;
  195|      0|        ft.inflate_fast = &inflate_fast_avx512;
  196|      0|#  ifdef HAVE_BUILTIN_CTZLL
  197|      0|        ft.compare256 = &compare256_avx512;
  198|      0|        ft.longest_match = &longest_match_avx512;
  199|      0|        ft.longest_match_slow = &longest_match_slow_avx512;
  200|      0|#  endif
  201|      0|    }
  202|      1|#endif
  203|      1|#ifdef X86_AVX512VNNI
  204|      1|    if (cf.x86.has_avx512vnni) {
  ------------------
  |  Branch (204:9): [True: 0, False: 1]
  ------------------
  205|      0|        ft.adler32 = &adler32_avx512_vnni;
  206|      0|        ft.adler32_fold_copy = &adler32_fold_copy_avx512_vnni;
  207|      0|    }
  208|      1|#endif
  209|       |    // X86 - VPCLMULQDQ
  210|      1|#ifdef X86_VPCLMULQDQ_CRC
  211|      1|    if (cf.x86.has_pclmulqdq && cf.x86.has_avx512_common && cf.x86.has_vpclmulqdq) {
  ------------------
  |  Branch (211:9): [True: 1, False: 0]
  |  Branch (211:33): [True: 0, False: 1]
  |  Branch (211:61): [True: 0, False: 0]
  ------------------
  212|      0|        ft.crc32 = &crc32_vpclmulqdq;
  213|      0|        ft.crc32_fold = &crc32_fold_vpclmulqdq;
  214|      0|        ft.crc32_fold_copy = &crc32_fold_vpclmulqdq_copy;
  215|      0|        ft.crc32_fold_final = &crc32_fold_vpclmulqdq_final;
  216|      0|        ft.crc32_fold_reset = &crc32_fold_vpclmulqdq_reset;
  217|      0|    }
  218|      1|#endif
  219|       |
  220|       |
  221|       |    // ARM - SIMD
  222|       |#ifdef ARM_SIMD
  223|       |#  ifndef ARM_NOCHECK_SIMD
  224|       |    if (cf.arm.has_simd)
  225|       |#  endif
  226|       |    {
  227|       |        ft.slide_hash = &slide_hash_armv6;
  228|       |    }
  229|       |#endif
  230|       |    // ARM - NEON
  231|       |#ifdef ARM_NEON
  232|       |#  ifndef ARM_NOCHECK_NEON
  233|       |    if (cf.arm.has_neon)
  234|       |#  endif
  235|       |    {
  236|       |        ft.adler32 = &adler32_neon;
  237|       |        ft.adler32_fold_copy = &adler32_fold_copy_neon;
  238|       |        ft.chunkmemset_safe = &chunkmemset_safe_neon;
  239|       |        ft.inflate_fast = &inflate_fast_neon;
  240|       |        ft.slide_hash = &slide_hash_neon;
  241|       |#  ifdef HAVE_BUILTIN_CTZLL
  242|       |        ft.compare256 = &compare256_neon;
  243|       |        ft.longest_match = &longest_match_neon;
  244|       |        ft.longest_match_slow = &longest_match_slow_neon;
  245|       |#  endif
  246|       |    }
  247|       |#endif
  248|       |    // ARM - CRC32
  249|       |#ifdef ARM_CRC32
  250|       |    if (cf.arm.has_crc32) {
  251|       |        ft.crc32 = &crc32_armv8;
  252|       |        ft.crc32_fold = &crc32_fold_armv8;
  253|       |        ft.crc32_fold_copy = &crc32_fold_copy_armv8;
  254|       |    }
  255|       |#endif
  256|       |
  257|       |
  258|       |    // Power - VMX
  259|       |#ifdef PPC_VMX
  260|       |    if (cf.power.has_altivec) {
  261|       |        ft.adler32 = &adler32_vmx;
  262|       |        ft.slide_hash = &slide_hash_vmx;
  263|       |    }
  264|       |#endif
  265|       |    // Power8 - VSX
  266|       |#ifdef POWER8_VSX
  267|       |    if (cf.power.has_arch_2_07) {
  268|       |        ft.adler32 = &adler32_power8;
  269|       |        ft.chunkmemset_safe = &chunkmemset_safe_power8;
  270|       |        ft.inflate_fast = &inflate_fast_power8;
  271|       |        ft.slide_hash = &slide_hash_power8;
  272|       |    }
  273|       |#endif
  274|       |#ifdef POWER8_VSX_CRC32
  275|       |    if (cf.power.has_arch_2_07)
  276|       |        ft.crc32 = &crc32_power8;
  277|       |#endif
  278|       |    // Power9
  279|       |#ifdef POWER9
  280|       |    if (cf.power.has_arch_3_00) {
  281|       |        ft.compare256 = &compare256_power9;
  282|       |        ft.longest_match = &longest_match_power9;
  283|       |        ft.longest_match_slow = &longest_match_slow_power9;
  284|       |    }
  285|       |#endif
  286|       |
  287|       |
  288|       |    // RISCV - RVV
  289|       |#ifdef RISCV_RVV
  290|       |    if (cf.riscv.has_rvv) {
  291|       |        ft.adler32 = &adler32_rvv;
  292|       |        ft.adler32_fold_copy = &adler32_fold_copy_rvv;
  293|       |        ft.chunkmemset_safe = &chunkmemset_safe_rvv;
  294|       |        ft.compare256 = &compare256_rvv;
  295|       |        ft.inflate_fast = &inflate_fast_rvv;
  296|       |        ft.longest_match = &longest_match_rvv;
  297|       |        ft.longest_match_slow = &longest_match_slow_rvv;
  298|       |        ft.slide_hash = &slide_hash_rvv;
  299|       |    }
  300|       |#endif
  301|       |
  302|       |    // RISCV - ZBC
  303|       |#ifdef RISCV_CRC32_ZBC
  304|       |    if (cf.riscv.has_zbc) {
  305|       |        ft.crc32 = &crc32_riscv64_zbc;
  306|       |    }
  307|       |#endif
  308|       |
  309|       |    // S390
  310|       |#ifdef S390_CRC32_VX
  311|       |    if (cf.s390.has_vx)
  312|       |        ft.crc32 = crc32_s390_vx;
  313|       |#endif
  314|       |
  315|       |    // LOONGARCH
  316|       |#ifdef LOONGARCH_CRC
  317|       |    if (cf.loongarch.has_crc) {
  318|       |        ft.crc32 = crc32_loongarch64;
  319|       |        ft.crc32_fold = &crc32_fold_loongarch64;
  320|       |        ft.crc32_fold_copy = &crc32_fold_copy_loongarch64;
  321|       |    }
  322|       |#endif
  323|       |#ifdef LOONGARCH_LSX
  324|       |    if (cf.loongarch.has_lsx) {
  325|       |        ft.adler32 = &adler32_lsx;
  326|       |        ft.adler32_fold_copy = &adler32_fold_copy_lsx;
  327|       |        ft.slide_hash = slide_hash_lsx;
  328|       |#  ifdef HAVE_BUILTIN_CTZ
  329|       |        ft.compare256 = &compare256_lsx;
  330|       |        ft.longest_match = &longest_match_lsx;
  331|       |        ft.longest_match_slow = &longest_match_slow_lsx;
  332|       |#  endif
  333|       |        ft.chunkmemset_safe = &chunkmemset_safe_lsx;
  334|       |        ft.inflate_fast = &inflate_fast_lsx;
  335|       |    }
  336|       |#endif
  337|       |#ifdef LOONGARCH_LASX
  338|       |    if (cf.loongarch.has_lasx) {
  339|       |        ft.adler32 = &adler32_lasx;
  340|       |        ft.adler32_fold_copy = &adler32_fold_copy_lasx;
  341|       |        ft.slide_hash = slide_hash_lasx;
  342|       |#  ifdef HAVE_BUILTIN_CTZ
  343|       |        ft.compare256 = &compare256_lasx;
  344|       |        ft.longest_match = &longest_match_lasx;
  345|       |        ft.longest_match_slow = &longest_match_slow_lasx;
  346|       |#  endif
  347|       |        ft.chunkmemset_safe = &chunkmemset_safe_lasx;
  348|       |        ft.inflate_fast = &inflate_fast_lasx;
  349|       |    }
  350|       |#endif
  351|       |
  352|      1|#endif // WITH_OPTIM
  353|       |
  354|       |    // Assign function pointers individually for atomic operation
  355|      1|    FUNCTABLE_ASSIGN(ft, force_init);
  ------------------
  |  |   20|      1|    __atomic_store(&(functable.FUNC_NAME), &(VAR.FUNC_NAME), __ATOMIC_SEQ_CST)
  ------------------
  356|      1|    FUNCTABLE_VERIFY_ASSIGN(ft, adler32);
  ------------------
  |  |   46|      1|    if (!VAR.FUNC_NAME) { \
  |  |  ------------------
  |  |  |  Branch (46:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   47|      0|        fprintf(stderr, "Zlib-ng functable failed initialization!\n"); \
  |  |   48|      0|        return 1; \
  |  |   49|      0|    } \
  |  |   50|      1|    FUNCTABLE_ASSIGN(VAR, FUNC_NAME);
  |  |  ------------------
  |  |  |  |   20|      1|    __atomic_store(&(functable.FUNC_NAME), &(VAR.FUNC_NAME), __ATOMIC_SEQ_CST)
  |  |  ------------------
  ------------------
  357|      1|    FUNCTABLE_VERIFY_ASSIGN(ft, adler32_fold_copy);
  ------------------
  |  |   46|      1|    if (!VAR.FUNC_NAME) { \
  |  |  ------------------
  |  |  |  Branch (46:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   47|      0|        fprintf(stderr, "Zlib-ng functable failed initialization!\n"); \
  |  |   48|      0|        return 1; \
  |  |   49|      0|    } \
  |  |   50|      1|    FUNCTABLE_ASSIGN(VAR, FUNC_NAME);
  |  |  ------------------
  |  |  |  |   20|      1|    __atomic_store(&(functable.FUNC_NAME), &(VAR.FUNC_NAME), __ATOMIC_SEQ_CST)
  |  |  ------------------
  ------------------
  358|      1|    FUNCTABLE_VERIFY_ASSIGN(ft, chunkmemset_safe);
  ------------------
  |  |   46|      1|    if (!VAR.FUNC_NAME) { \
  |  |  ------------------
  |  |  |  Branch (46:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   47|      0|        fprintf(stderr, "Zlib-ng functable failed initialization!\n"); \
  |  |   48|      0|        return 1; \
  |  |   49|      0|    } \
  |  |   50|      1|    FUNCTABLE_ASSIGN(VAR, FUNC_NAME);
  |  |  ------------------
  |  |  |  |   20|      1|    __atomic_store(&(functable.FUNC_NAME), &(VAR.FUNC_NAME), __ATOMIC_SEQ_CST)
  |  |  ------------------
  ------------------
  359|      1|    FUNCTABLE_VERIFY_ASSIGN(ft, compare256);
  ------------------
  |  |   46|      1|    if (!VAR.FUNC_NAME) { \
  |  |  ------------------
  |  |  |  Branch (46:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   47|      0|        fprintf(stderr, "Zlib-ng functable failed initialization!\n"); \
  |  |   48|      0|        return 1; \
  |  |   49|      0|    } \
  |  |   50|      1|    FUNCTABLE_ASSIGN(VAR, FUNC_NAME);
  |  |  ------------------
  |  |  |  |   20|      1|    __atomic_store(&(functable.FUNC_NAME), &(VAR.FUNC_NAME), __ATOMIC_SEQ_CST)
  |  |  ------------------
  ------------------
  360|      1|    FUNCTABLE_VERIFY_ASSIGN(ft, crc32);
  ------------------
  |  |   46|      1|    if (!VAR.FUNC_NAME) { \
  |  |  ------------------
  |  |  |  Branch (46:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   47|      0|        fprintf(stderr, "Zlib-ng functable failed initialization!\n"); \
  |  |   48|      0|        return 1; \
  |  |   49|      0|    } \
  |  |   50|      1|    FUNCTABLE_ASSIGN(VAR, FUNC_NAME);
  |  |  ------------------
  |  |  |  |   20|      1|    __atomic_store(&(functable.FUNC_NAME), &(VAR.FUNC_NAME), __ATOMIC_SEQ_CST)
  |  |  ------------------
  ------------------
  361|      1|    FUNCTABLE_VERIFY_ASSIGN(ft, crc32_fold);
  ------------------
  |  |   46|      1|    if (!VAR.FUNC_NAME) { \
  |  |  ------------------
  |  |  |  Branch (46:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   47|      0|        fprintf(stderr, "Zlib-ng functable failed initialization!\n"); \
  |  |   48|      0|        return 1; \
  |  |   49|      0|    } \
  |  |   50|      1|    FUNCTABLE_ASSIGN(VAR, FUNC_NAME);
  |  |  ------------------
  |  |  |  |   20|      1|    __atomic_store(&(functable.FUNC_NAME), &(VAR.FUNC_NAME), __ATOMIC_SEQ_CST)
  |  |  ------------------
  ------------------
  362|      1|    FUNCTABLE_VERIFY_ASSIGN(ft, crc32_fold_copy);
  ------------------
  |  |   46|      1|    if (!VAR.FUNC_NAME) { \
  |  |  ------------------
  |  |  |  Branch (46:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   47|      0|        fprintf(stderr, "Zlib-ng functable failed initialization!\n"); \
  |  |   48|      0|        return 1; \
  |  |   49|      0|    } \
  |  |   50|      1|    FUNCTABLE_ASSIGN(VAR, FUNC_NAME);
  |  |  ------------------
  |  |  |  |   20|      1|    __atomic_store(&(functable.FUNC_NAME), &(VAR.FUNC_NAME), __ATOMIC_SEQ_CST)
  |  |  ------------------
  ------------------
  363|      1|    FUNCTABLE_VERIFY_ASSIGN(ft, crc32_fold_final);
  ------------------
  |  |   46|      1|    if (!VAR.FUNC_NAME) { \
  |  |  ------------------
  |  |  |  Branch (46:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   47|      0|        fprintf(stderr, "Zlib-ng functable failed initialization!\n"); \
  |  |   48|      0|        return 1; \
  |  |   49|      0|    } \
  |  |   50|      1|    FUNCTABLE_ASSIGN(VAR, FUNC_NAME);
  |  |  ------------------
  |  |  |  |   20|      1|    __atomic_store(&(functable.FUNC_NAME), &(VAR.FUNC_NAME), __ATOMIC_SEQ_CST)
  |  |  ------------------
  ------------------
  364|      1|    FUNCTABLE_VERIFY_ASSIGN(ft, crc32_fold_reset);
  ------------------
  |  |   46|      1|    if (!VAR.FUNC_NAME) { \
  |  |  ------------------
  |  |  |  Branch (46:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   47|      0|        fprintf(stderr, "Zlib-ng functable failed initialization!\n"); \
  |  |   48|      0|        return 1; \
  |  |   49|      0|    } \
  |  |   50|      1|    FUNCTABLE_ASSIGN(VAR, FUNC_NAME);
  |  |  ------------------
  |  |  |  |   20|      1|    __atomic_store(&(functable.FUNC_NAME), &(VAR.FUNC_NAME), __ATOMIC_SEQ_CST)
  |  |  ------------------
  ------------------
  365|      1|    FUNCTABLE_VERIFY_ASSIGN(ft, inflate_fast);
  ------------------
  |  |   46|      1|    if (!VAR.FUNC_NAME) { \
  |  |  ------------------
  |  |  |  Branch (46:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   47|      0|        fprintf(stderr, "Zlib-ng functable failed initialization!\n"); \
  |  |   48|      0|        return 1; \
  |  |   49|      0|    } \
  |  |   50|      1|    FUNCTABLE_ASSIGN(VAR, FUNC_NAME);
  |  |  ------------------
  |  |  |  |   20|      1|    __atomic_store(&(functable.FUNC_NAME), &(VAR.FUNC_NAME), __ATOMIC_SEQ_CST)
  |  |  ------------------
  ------------------
  366|      1|    FUNCTABLE_VERIFY_ASSIGN(ft, longest_match);
  ------------------
  |  |   46|      1|    if (!VAR.FUNC_NAME) { \
  |  |  ------------------
  |  |  |  Branch (46:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   47|      0|        fprintf(stderr, "Zlib-ng functable failed initialization!\n"); \
  |  |   48|      0|        return 1; \
  |  |   49|      0|    } \
  |  |   50|      1|    FUNCTABLE_ASSIGN(VAR, FUNC_NAME);
  |  |  ------------------
  |  |  |  |   20|      1|    __atomic_store(&(functable.FUNC_NAME), &(VAR.FUNC_NAME), __ATOMIC_SEQ_CST)
  |  |  ------------------
  ------------------
  367|      1|    FUNCTABLE_VERIFY_ASSIGN(ft, longest_match_slow);
  ------------------
  |  |   46|      1|    if (!VAR.FUNC_NAME) { \
  |  |  ------------------
  |  |  |  Branch (46:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   47|      0|        fprintf(stderr, "Zlib-ng functable failed initialization!\n"); \
  |  |   48|      0|        return 1; \
  |  |   49|      0|    } \
  |  |   50|      1|    FUNCTABLE_ASSIGN(VAR, FUNC_NAME);
  |  |  ------------------
  |  |  |  |   20|      1|    __atomic_store(&(functable.FUNC_NAME), &(VAR.FUNC_NAME), __ATOMIC_SEQ_CST)
  |  |  ------------------
  ------------------
  368|      1|    FUNCTABLE_VERIFY_ASSIGN(ft, slide_hash);
  ------------------
  |  |   46|      1|    if (!VAR.FUNC_NAME) { \
  |  |  ------------------
  |  |  |  Branch (46:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   47|      0|        fprintf(stderr, "Zlib-ng functable failed initialization!\n"); \
  |  |   48|      0|        return 1; \
  |  |   49|      0|    } \
  |  |   50|      1|    FUNCTABLE_ASSIGN(VAR, FUNC_NAME);
  |  |  ------------------
  |  |  |  |   20|      1|    __atomic_store(&(functable.FUNC_NAME), &(VAR.FUNC_NAME), __ATOMIC_SEQ_CST)
  |  |  ------------------
  ------------------
  369|       |
  370|       |    // Memory barrier for weak memory order CPUs
  371|      1|    FUNCTABLE_BARRIER();
  ------------------
  |  |   21|      1|#  define FUNCTABLE_BARRIER() __atomic_thread_fence(__ATOMIC_SEQ_CST)
  ------------------
  372|       |
  373|      1|    return Z_OK;
  ------------------
  |  |  180|      1|#define Z_OK            0
  ------------------
  374|      1|}
functable.c:force_init_empty:
   63|    670|static int force_init_empty(void) {
   64|    670|    return 0;
   65|    670|}

inflate_fast_avx2:
   53|  3.53k|void Z_INTERNAL INFLATE_FAST(PREFIX3(stream) *strm, uint32_t start) {
   54|       |    /* start: inflate()'s starting value for strm->avail_out */
   55|  3.53k|    struct inflate_state *state;
   56|  3.53k|    z_const unsigned char *in;  /* local strm->next_in */
  ------------------
  |  |   23|  3.53k|#define z_const const
  ------------------
   57|  3.53k|    const unsigned char *last;  /* have enough input while in < last */
   58|  3.53k|    unsigned char *out;         /* local strm->next_out */
   59|  3.53k|    unsigned char *beg;         /* inflate()'s initial strm->next_out */
   60|  3.53k|    unsigned char *end;         /* while out < end, enough space available */
   61|  3.53k|    unsigned char *safe;        /* can use chunkcopy provided out < safe */
   62|  3.53k|    unsigned char *window;      /* allocated sliding window, if wsize != 0 */
   63|  3.53k|    unsigned wsize;             /* window size or zero if not using window */
   64|  3.53k|    unsigned whave;             /* valid bytes in the window */
   65|  3.53k|    unsigned wnext;             /* window write index */
   66|       |
   67|       |    /* hold is a local copy of strm->hold. By default, hold satisfies the same
   68|       |       invariants that strm->hold does, namely that (hold >> bits) == 0. This
   69|       |       invariant is kept by loading bits into hold one byte at a time, like:
   70|       |
   71|       |       hold |= next_byte_of_input << bits; in++; bits += 8;
   72|       |
   73|       |       If we need to ensure that bits >= 15 then this code snippet is simply
   74|       |       repeated. Over one iteration of the outermost do/while loop, this
   75|       |       happens up to six times (48 bits of input), as described in the NOTES
   76|       |       above.
   77|       |
   78|       |       However, on some little endian architectures, it can be significantly
   79|       |       faster to load 64 bits once instead of 8 bits six times:
   80|       |
   81|       |       if (bits <= 16) {
   82|       |         hold |= next_8_bytes_of_input << bits; in += 6; bits += 48;
   83|       |       }
   84|       |
   85|       |       Unlike the simpler one byte load, shifting the next_8_bytes_of_input
   86|       |       by bits will overflow and lose those high bits, up to 2 bytes' worth.
   87|       |       The conservative estimate is therefore that we have read only 6 bytes
   88|       |       (48 bits). Again, as per the NOTES above, 48 bits is sufficient for the
   89|       |       rest of the iteration, and we will not need to load another 8 bytes.
   90|       |
   91|       |       Inside this function, we no longer satisfy (hold >> bits) == 0, but
   92|       |       this is not problematic, even if that overflow does not land on an 8 bit
   93|       |       byte boundary. Those excess bits will eventually shift down lower as the
   94|       |       Huffman decoder consumes input, and when new input bits need to be loaded
   95|       |       into the bits variable, the same input bits will be or'ed over those
   96|       |       existing bits. A bitwise or is idempotent: (a | b | b) equals (a | b).
   97|       |       Note that we therefore write that load operation as "hold |= etc" and not
   98|       |       "hold += etc".
   99|       |
  100|       |       Outside that loop, at the end of the function, hold is bitwise and'ed
  101|       |       with (1<<bits)-1 to drop those excess bits so that, on function exit, we
  102|       |       keep the invariant that (state->hold >> state->bits) == 0.
  103|       |    */
  104|  3.53k|    unsigned bits;              /* local strm->bits */
  105|  3.53k|    uint64_t hold;              /* local strm->hold */
  106|  3.53k|    unsigned lmask;             /* mask for first level of length codes */
  107|  3.53k|    unsigned dmask;             /* mask for first level of distance codes */
  108|  3.53k|    code const *lcode;          /* local strm->lencode */
  109|  3.53k|    code const *dcode;          /* local strm->distcode */
  110|  3.53k|    const code *here;           /* retrieved table entry */
  111|  3.53k|    unsigned op;                /* code bits, operation, extra bits, or */
  112|       |                                /*  window position, window bytes to copy */
  113|  3.53k|    unsigned len;               /* match length, unused bytes */
  114|  3.53k|    unsigned char *from;        /* where to copy match from */
  115|  3.53k|    unsigned dist;              /* match distance */
  116|  3.53k|    unsigned extra_safe;        /* copy chunks safely in all cases */
  117|       |
  118|       |    /* copy state to local variables */
  119|  3.53k|    state = (struct inflate_state *)strm->state;
  120|  3.53k|    in = strm->next_in;
  121|  3.53k|    last = in + (strm->avail_in - (INFLATE_FAST_MIN_HAVE - 1));
  ------------------
  |  |  137|  3.53k|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
  122|  3.53k|    out = strm->next_out;
  123|  3.53k|    beg = out - (start - strm->avail_out);
  124|  3.53k|    end = out + (strm->avail_out - (INFLATE_FAST_MIN_LEFT - 1));
  ------------------
  |  |  138|  3.53k|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  125|  3.53k|    safe = out + strm->avail_out;
  126|  3.53k|    wsize = state->wsize;
  127|  3.53k|    whave = state->whave;
  128|  3.53k|    wnext = state->wnext;
  129|  3.53k|    window = state->window;
  130|  3.53k|    hold = state->hold;
  131|  3.53k|    bits = state->bits;
  132|  3.53k|    lcode = state->lencode;
  133|  3.53k|    dcode = state->distcode;
  134|  3.53k|    lmask = (1U << state->lenbits) - 1;
  135|  3.53k|    dmask = (1U << state->distbits) - 1;
  136|       |
  137|       |    /* Detect if out and window point to the same memory allocation. In this instance it is
  138|       |       necessary to use safe chunk copy functions to prevent overwriting the window. If the
  139|       |       window is overwritten then future matches with far distances will fail to copy correctly. */
  140|  3.53k|    extra_safe = (wsize != 0 && out >= window && out + INFLATE_FAST_MIN_LEFT <= window + state->wbufsize);
  ------------------
  |  |  138|      0|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  |  Branch (140:19): [True: 0, False: 3.53k]
  |  Branch (140:33): [True: 0, False: 0]
  |  Branch (140:50): [True: 0, False: 0]
  ------------------
  141|       |
  142|  3.53k|#define REFILL() do { \
  143|  3.53k|        hold |= load_64_bits(in, bits); \
  144|  3.53k|        in += 7; \
  145|  3.53k|        in -= ((bits >> 3) & 7); \
  146|  3.53k|        bits |= 56; \
  147|  3.53k|    } while (0)
  148|       |
  149|       |    /* decode literals and length/distances until end-of-block or not enough
  150|       |       input data or output space */
  151|   253k|    do {
  152|   253k|        REFILL();
  ------------------
  |  |  142|   253k|#define REFILL() do { \
  |  |  143|   253k|        hold |= load_64_bits(in, bits); \
  |  |  144|   253k|        in += 7; \
  |  |  145|   253k|        in -= ((bits >> 3) & 7); \
  |  |  146|   253k|        bits |= 56; \
  |  |  147|   253k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (147:14): [Folded, False: 253k]
  |  |  ------------------
  ------------------
  153|   253k|        here = lcode + (hold & lmask);
  154|   253k|        if (here->op == 0) {
  ------------------
  |  Branch (154:13): [True: 80.9k, False: 172k]
  ------------------
  155|  80.9k|            *out++ = (unsigned char)(here->val);
  156|  80.9k|            DROPBITS(here->bits);
  ------------------
  |  |  118|  80.9k|    do { \
  |  |  119|  80.9k|        hold >>= (n); \
  |  |  120|  80.9k|        bits -= (unsigned)(n); \
  |  |  121|  80.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 80.9k]
  |  |  ------------------
  ------------------
  157|  80.9k|            here = lcode + (hold & lmask);
  158|  80.9k|            if (here->op == 0) {
  ------------------
  |  Branch (158:17): [True: 35.3k, False: 45.5k]
  ------------------
  159|  35.3k|                *out++ = (unsigned char)(here->val);
  160|  35.3k|                DROPBITS(here->bits);
  ------------------
  |  |  118|  35.3k|    do { \
  |  |  119|  35.3k|        hold >>= (n); \
  |  |  120|  35.3k|        bits -= (unsigned)(n); \
  |  |  121|  35.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 35.3k]
  |  |  ------------------
  ------------------
  161|  35.3k|                here = lcode + (hold & lmask);
  162|  35.3k|            }
  163|  80.9k|        }
  164|   258k|      dolen:
  165|   258k|        DROPBITS(here->bits);
  ------------------
  |  |  118|   258k|    do { \
  |  |  119|   258k|        hold >>= (n); \
  |  |  120|   258k|        bits -= (unsigned)(n); \
  |  |  121|   258k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 258k]
  |  |  ------------------
  ------------------
  166|   258k|        op = here->op;
  167|   258k|        if (op == 0) {                          /* literal */
  ------------------
  |  Branch (167:13): [True: 28.9k, False: 229k]
  ------------------
  168|  28.9k|            Tracevv((stderr, here->val >= 0x20 && here->val < 0x7f ?
  169|  28.9k|                    "inflate:         literal '%c'\n" :
  170|  28.9k|                    "inflate:         literal 0x%02x\n", here->val));
  171|  28.9k|            *out++ = (unsigned char)(here->val);
  172|   229k|        } else if (op & 16) {                     /* length base */
  ------------------
  |  Branch (172:20): [True: 223k, False: 6.43k]
  ------------------
  173|   223k|            len = here->val;
  174|   223k|            op &= MAX_BITS;                       /* number of extra bits */
  ------------------
  |  |   39|   223k|#define MAX_BITS 15
  ------------------
  175|   223k|            len += BITS(op);
  ------------------
  |  |  114|   223k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  176|   223k|            DROPBITS(op);
  ------------------
  |  |  118|   223k|    do { \
  |  |  119|   223k|        hold >>= (n); \
  |  |  120|   223k|        bits -= (unsigned)(n); \
  |  |  121|   223k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 223k]
  |  |  ------------------
  ------------------
  177|   223k|            Tracevv((stderr, "inflate:         length %u\n", len));
  178|   223k|            here = dcode + (hold & dmask);
  179|   223k|            if (bits < MAX_BITS + MAX_DIST_EXTRA_BITS) {
  ------------------
  |  |   39|   223k|#define MAX_BITS 15
  ------------------
                          if (bits < MAX_BITS + MAX_DIST_EXTRA_BITS) {
  ------------------
  |  |   41|   223k|#define MAX_DIST_EXTRA_BITS 13
  ------------------
  |  Branch (179:17): [True: 194, False: 223k]
  ------------------
  180|    194|                REFILL();
  ------------------
  |  |  142|    194|#define REFILL() do { \
  |  |  143|    194|        hold |= load_64_bits(in, bits); \
  |  |  144|    194|        in += 7; \
  |  |  145|    194|        in -= ((bits >> 3) & 7); \
  |  |  146|    194|        bits |= 56; \
  |  |  147|    194|    } while (0)
  |  |  ------------------
  |  |  |  Branch (147:14): [Folded, False: 194]
  |  |  ------------------
  ------------------
  181|    194|            }
  182|   224k|          dodist:
  183|   224k|            DROPBITS(here->bits);
  ------------------
  |  |  118|   224k|    do { \
  |  |  119|   224k|        hold >>= (n); \
  |  |  120|   224k|        bits -= (unsigned)(n); \
  |  |  121|   224k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 224k]
  |  |  ------------------
  ------------------
  184|   224k|            op = here->op;
  185|   224k|            if (op & 16) {                      /* distance base */
  ------------------
  |  Branch (185:17): [True: 223k, False: 1.10k]
  ------------------
  186|   223k|                dist = here->val;
  187|   223k|                op &= MAX_BITS;                 /* number of extra bits */
  ------------------
  |  |   39|   223k|#define MAX_BITS 15
  ------------------
  188|   223k|                dist += BITS(op);
  ------------------
  |  |  114|   223k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  189|       |#ifdef INFLATE_STRICT
  190|       |                if (dist > state->dmax) {
  191|       |                    SET_BAD("invalid distance too far back");
  192|       |                    break;
  193|       |                }
  194|       |#endif
  195|   223k|                DROPBITS(op);
  ------------------
  |  |  118|   223k|    do { \
  |  |  119|   223k|        hold >>= (n); \
  |  |  120|   223k|        bits -= (unsigned)(n); \
  |  |  121|   223k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 223k]
  |  |  ------------------
  ------------------
  196|   223k|                Tracevv((stderr, "inflate:         distance %u\n", dist));
  197|   223k|                op = (unsigned)(out - beg);     /* max distance in output */
  198|   223k|                if (dist > op) {                /* see if copy from window */
  ------------------
  |  Branch (198:21): [True: 24, False: 223k]
  ------------------
  199|     24|                    op = dist - op;             /* distance back in window */
  200|     24|                    if (op > whave) {
  ------------------
  |  Branch (200:25): [True: 24, False: 0]
  ------------------
  201|       |#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
  202|       |                        if (state->sane) {
  203|       |                            SET_BAD("invalid distance too far back");
  204|       |                            break;
  205|       |                        }
  206|       |                        if (len <= op - whave) {
  207|       |                            do {
  208|       |                                *out++ = 0;
  209|       |                            } while (--len);
  210|       |                            continue;
  211|       |                        }
  212|       |                        len -= op - whave;
  213|       |                        do {
  214|       |                            *out++ = 0;
  215|       |                        } while (--op > whave);
  216|       |                        if (op == 0) {
  217|       |                            from = out - dist;
  218|       |                            do {
  219|       |                                *out++ = *from++;
  220|       |                            } while (--len);
  221|       |                            continue;
  222|       |                        }
  223|       |#else
  224|     24|                        SET_BAD("invalid distance too far back");
  ------------------
  |  |  132|     24|    do { \
  |  |  133|     24|        state->mode = BAD; \
  |  |  134|     24|        strm->msg = (char *)errmsg; \
  |  |  135|     24|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 24]
  |  |  ------------------
  ------------------
  225|     24|                        break;
  226|     24|#endif
  227|     24|                    }
  228|      0|                    from = window;
  229|      0|                    if (wnext == 0) {           /* very common case */
  ------------------
  |  Branch (229:25): [True: 0, False: 0]
  ------------------
  230|      0|                        from += wsize - op;
  231|      0|                    } else if (wnext >= op) {   /* contiguous in window */
  ------------------
  |  Branch (231:32): [True: 0, False: 0]
  ------------------
  232|      0|                        from += wnext - op;
  233|      0|                    } else {                    /* wrap around window */
  234|      0|                        op -= wnext;
  235|      0|                        from += wsize - op;
  236|      0|                        if (op < len) {         /* some from end of window */
  ------------------
  |  Branch (236:29): [True: 0, False: 0]
  ------------------
  237|      0|                            len -= op;
  238|      0|                            out = CHUNKCOPY_SAFE(out, from, op, safe);
  239|      0|                            from = window;      /* more from start of window */
  240|      0|                            op = wnext;
  241|       |                            /* This (rare) case can create a situation where
  242|       |                               the first chunkcopy below must be checked.
  243|       |                             */
  244|      0|                        }
  245|      0|                    }
  246|      0|                    if (op < len) {             /* still need some from output */
  ------------------
  |  Branch (246:25): [True: 0, False: 0]
  ------------------
  247|      0|                        len -= op;
  248|      0|                        if (!extra_safe) {
  ------------------
  |  Branch (248:29): [True: 0, False: 0]
  ------------------
  249|      0|                            out = CHUNKCOPY_SAFE(out, from, op, safe);
  250|      0|                            out = CHUNKUNROLL(out, &dist, &len);
  ------------------
  |  |  120|      0|#define CHUNKUNROLL      chunkunroll_avx2
  ------------------
  251|      0|                            out = CHUNKCOPY_SAFE(out, out - dist, len, safe);
  252|      0|                        } else {
  253|      0|                            out = chunkcopy_safe(out, from, op, safe);
  254|      0|                            out = chunkcopy_safe(out, out - dist, len, safe);
  255|      0|                        }
  256|      0|                    } else {
  257|      0|#ifndef HAVE_MASKED_READWRITE
  258|      0|                        if (extra_safe)
  ------------------
  |  Branch (258:29): [True: 0, False: 0]
  ------------------
  259|      0|                            out = chunkcopy_safe(out, from, len, safe);
  260|      0|                        else
  261|      0|#endif
  262|      0|                            out = CHUNKCOPY_SAFE(out, from, len, safe);
  263|      0|                    }
  264|      0|#ifndef HAVE_MASKED_READWRITE
  265|   223k|                } else if (extra_safe) {
  ------------------
  |  Branch (265:28): [True: 0, False: 223k]
  ------------------
  266|       |                    /* Whole reference is in range of current output. */
  267|      0|                        out = chunkcopy_safe(out, out - dist, len, safe);
  268|      0|#endif
  269|   223k|                } else {
  270|       |                    /* Whole reference is in range of current output.  No range checks are
  271|       |                       necessary because we start with room for at least 258 bytes of output,
  272|       |                       so unroll and roundoff operations can write beyond `out+len` so long
  273|       |                       as they stay within 258 bytes of `out`.
  274|       |                    */
  275|   223k|                    if (dist >= len || dist >= CHUNKSIZE())
  ------------------
  |  |  118|   177k|#define CHUNKSIZE        chunksize_avx2
  ------------------
  |  Branch (275:25): [True: 45.5k, False: 177k]
  |  Branch (275:40): [True: 1.60k, False: 176k]
  ------------------
  276|  47.1k|                        out = CHUNKCOPY(out, out - dist, len);
  ------------------
  |  |  119|  47.1k|#define CHUNKCOPY        chunkcopy_avx2
  ------------------
  277|   176k|                    else
  278|   176k|                        out = CHUNKMEMSET(out, out - dist, len);
  ------------------
  |  |  121|   176k|#define CHUNKMEMSET      chunkmemset_avx2
  ------------------
  279|   223k|                }
  280|   223k|            } else if ((op & 64) == 0) {          /* 2nd level distance code */
  ------------------
  |  Branch (280:24): [True: 1.09k, False: 3]
  ------------------
  281|  1.09k|                here = dcode + here->val + BITS(op);
  ------------------
  |  |  114|  1.09k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  282|  1.09k|                goto dodist;
  283|  1.09k|            } else {
  284|      3|                SET_BAD("invalid distance code");
  ------------------
  |  |  132|      3|    do { \
  |  |  133|      3|        state->mode = BAD; \
  |  |  134|      3|        strm->msg = (char *)errmsg; \
  |  |  135|      3|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 3]
  |  |  ------------------
  ------------------
  285|      3|                break;
  286|      3|            }
  287|   224k|        } else if ((op & 64) == 0) {              /* 2nd level length code */
  ------------------
  |  Branch (287:20): [True: 5.02k, False: 1.40k]
  ------------------
  288|  5.02k|            here = lcode + here->val + BITS(op);
  ------------------
  |  |  114|  5.02k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  289|  5.02k|            goto dolen;
  290|  5.02k|        } else if (op & 32) {                     /* end-of-block */
  ------------------
  |  Branch (290:20): [True: 1.40k, False: 1]
  ------------------
  291|  1.40k|            Tracevv((stderr, "inflate:         end of block\n"));
  292|  1.40k|            state->mode = TYPE;
  293|  1.40k|            break;
  294|  1.40k|        } else {
  295|      1|            SET_BAD("invalid literal/length code");
  ------------------
  |  |  132|      1|    do { \
  |  |  133|      1|        state->mode = BAD; \
  |  |  134|      1|        strm->msg = (char *)errmsg; \
  |  |  135|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
  296|      1|            break;
  297|      1|        }
  298|   258k|    } while (in < last && out < end);
  ------------------
  |  Branch (298:14): [True: 250k, False: 2.01k]
  |  Branch (298:27): [True: 250k, False: 85]
  ------------------
  299|       |
  300|       |    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
  301|  3.53k|    len = bits >> 3;
  302|  3.53k|    in -= len;
  303|  3.53k|    bits -= len << 3;
  304|  3.53k|    hold &= (UINT64_C(1) << bits) - 1;
  305|       |
  306|       |    /* update state and return */
  307|  3.53k|    strm->next_in = in;
  308|  3.53k|    strm->next_out = out;
  309|  3.53k|    strm->avail_in = (unsigned)(in < last ? (INFLATE_FAST_MIN_HAVE - 1) + (last - in)
  ------------------
  |  |  137|  3.30k|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
  |  Branch (309:33): [True: 3.30k, False: 234]
  ------------------
  310|  3.53k|                                          : (INFLATE_FAST_MIN_HAVE - 1) - (in - last));
  ------------------
  |  |  137|    234|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
  311|  3.53k|    strm->avail_out = (unsigned)(out < end ? (INFLATE_FAST_MIN_LEFT - 1) + (end - out)
  ------------------
  |  |  138|  3.44k|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  |  Branch (311:34): [True: 3.44k, False: 87]
  ------------------
  312|  3.53k|                                           : (INFLATE_FAST_MIN_LEFT - 1) - (out - end));
  ------------------
  |  |  138|     87|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  313|       |
  314|  3.53k|    Assert(bits <= 32, "Remaining bits greater than 32");
  315|  3.53k|    state->hold = (uint32_t)hold;
  316|  3.53k|    state->bits = bits;
  317|  3.53k|    return;
  318|  3.53k|}

zng_inflateResetKeep:
   61|    671|int32_t Z_EXPORT PREFIX(inflateResetKeep)(PREFIX3(stream) *strm) {
   62|    671|    struct inflate_state *state;
   63|       |
   64|    671|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (64:9): [True: 0, False: 671]
  ------------------
   65|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
   66|    671|    state = (struct inflate_state *)strm->state;
   67|    671|    strm->total_in = strm->total_out = state->total = 0;
   68|    671|    strm->msg = NULL;
   69|    671|    if (state->wrap)        /* to support ill-conceived Java test suite */
  ------------------
  |  Branch (69:9): [True: 671, False: 0]
  ------------------
   70|    671|        strm->adler = state->wrap & 1;
   71|    671|    state->mode = HEAD;
   72|    671|    state->check = ADLER32_INITIAL_VALUE;
  ------------------
  |  |   65|    671|#define ADLER32_INITIAL_VALUE 1 /* initial adler-32 hash value */
  ------------------
   73|    671|    state->last = 0;
   74|    671|    state->havedict = 0;
   75|    671|    state->flags = -1;
   76|    671|    state->head = NULL;
   77|    671|    state->hold = 0;
   78|    671|    state->bits = 0;
   79|    671|    state->lencode = state->distcode = state->next = state->codes;
   80|    671|    state->back = -1;
   81|       |#ifdef INFLATE_STRICT
   82|       |    state->dmax = 32768U;
   83|       |#endif
   84|       |#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
   85|       |    state->sane = 1;
   86|       |#endif
   87|    671|    INFLATE_RESET_KEEP_HOOK(strm);  /* hook for IBM Z DFLTCC */
  ------------------
  |  |   25|    671|#  define INFLATE_RESET_KEEP_HOOK(strm) do {} while (0)
  |  |  ------------------
  |  |  |  Branch (25:54): [Folded, False: 671]
  |  |  ------------------
  ------------------
   88|    671|    Tracev((stderr, "inflate: reset\n"));
   89|    671|    return Z_OK;
  ------------------
  |  |  180|    671|#define Z_OK            0
  ------------------
   90|    671|}
zng_inflateReset:
   92|    671|int32_t Z_EXPORT PREFIX(inflateReset)(PREFIX3(stream) *strm) {
   93|    671|    struct inflate_state *state;
   94|       |
   95|    671|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (95:9): [True: 0, False: 671]
  ------------------
   96|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
   97|    671|    state = (struct inflate_state *)strm->state;
   98|    671|    state->wsize = 0;
   99|    671|    state->whave = 0;
  100|    671|    state->wnext = 0;
  101|    671|    return PREFIX(inflateResetKeep)(strm);
  ------------------
  |  |   97|    671|#  define PREFIX(x) zng_ ## x
  ------------------
  102|    671|}
zng_inflateReset2:
  104|    671|int32_t Z_EXPORT PREFIX(inflateReset2)(PREFIX3(stream) *strm, int32_t windowBits) {
  105|    671|    int wrap;
  106|    671|    struct inflate_state *state;
  107|       |
  108|       |    /* get the state */
  109|    671|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (109:9): [True: 0, False: 671]
  ------------------
  110|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  111|    671|    state = (struct inflate_state *)strm->state;
  112|       |
  113|       |    /* extract wrap request from windowBits parameter */
  114|    671|    if (windowBits < 0) {
  ------------------
  |  Branch (114:9): [True: 0, False: 671]
  ------------------
  115|      0|        wrap = 0;
  116|      0|        if (windowBits < -MAX_WBITS)
  ------------------
  |  |   39|      0|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
  |  Branch (116:13): [True: 0, False: 0]
  ------------------
  117|      0|            return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  118|      0|        windowBits = -windowBits;
  119|    671|    } else {
  120|    671|        wrap = (windowBits >> 4) + 5;
  121|    671|#ifdef GUNZIP
  122|    671|        if (windowBits < 48)
  ------------------
  |  Branch (122:13): [True: 671, False: 0]
  ------------------
  123|    671|            windowBits &= MAX_WBITS;
  ------------------
  |  |   39|    671|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
  124|    671|#endif
  125|    671|    }
  126|       |
  127|       |    /* set number of window bits */
  128|    671|    if (windowBits && (windowBits < MIN_WBITS || windowBits > MAX_WBITS))
  ------------------
  |  |   36|  1.34k|#  define MIN_WBITS   8  /* 256 LZ77 window */
  ------------------
                  if (windowBits && (windowBits < MIN_WBITS || windowBits > MAX_WBITS))
  ------------------
  |  |   39|    671|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
  |  Branch (128:9): [True: 671, False: 0]
  |  Branch (128:24): [True: 0, False: 671]
  |  Branch (128:50): [True: 0, False: 671]
  ------------------
  129|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  130|       |
  131|       |    /* update state and reset the rest of it */
  132|    671|    state->wrap = wrap;
  133|    671|    state->wbits = (unsigned)windowBits;
  134|    671|    return PREFIX(inflateReset)(strm);
  ------------------
  |  |   97|    671|#  define PREFIX(x) zng_ ## x
  ------------------
  135|    671|}
alloc_inflate:
  152|    671|Z_INTERNAL inflate_allocs* alloc_inflate(PREFIX3(stream) *strm) {
  153|    671|    int curr_size = 0;
  154|       |
  155|       |    /* Define sizes */
  156|    671|    int window_size = INFLATE_ADJUST_WINDOW_SIZE((1 << MAX_WBITS) + 64); /* 64B padding for chunksize */
  ------------------
  |  |   23|    671|#  define INFLATE_ADJUST_WINDOW_SIZE(n) (n)
  ------------------
  157|    671|    int state_size = sizeof(inflate_state);
  158|    671|    int alloc_size = sizeof(inflate_allocs);
  159|       |
  160|       |    /* Calculate relative buffer positions and paddings */
  161|    671|    LOGSZP("window", window_size, PAD_WINDOW(curr_size), PADSZ(curr_size,WINDOW_PAD_SIZE));
  162|    671|    int window_pos = PAD_WINDOW(curr_size);
  ------------------
  |  |  465|    671|#  define PAD_WINDOW            PAD_64
  |  |  ------------------
  |  |  |  |  245|    671|#define PAD_64(bpos) ((bpos) + PADSZ((bpos),64))
  |  |  |  |  ------------------
  |  |  |  |  |  |  243|    671|#define PADSZ(bpos, pad) (((pad) - ((uintptr_t)(bpos) % (pad))) % (pad))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|    671|    curr_size = window_pos + window_size;
  164|       |
  165|    671|    LOGSZP("state", state_size, PAD_64(curr_size), PADSZ(curr_size,64));
  166|    671|    int state_pos = PAD_64(curr_size);
  ------------------
  |  |  245|    671|#define PAD_64(bpos) ((bpos) + PADSZ((bpos),64))
  |  |  ------------------
  |  |  |  |  243|    671|#define PADSZ(bpos, pad) (((pad) - ((uintptr_t)(bpos) % (pad))) % (pad))
  |  |  ------------------
  ------------------
  167|    671|    curr_size = state_pos + state_size;
  168|       |
  169|    671|    LOGSZP("alloc", alloc_size, PAD_16(curr_size), PADSZ(curr_size,16));
  170|    671|    int alloc_pos = PAD_16(curr_size);
  ------------------
  |  |  244|    671|#define PAD_16(bpos) ((bpos) + PADSZ((bpos),16))
  |  |  ------------------
  |  |  |  |  243|    671|#define PADSZ(bpos, pad) (((pad) - ((uintptr_t)(bpos) % (pad))) % (pad))
  |  |  ------------------
  ------------------
  171|    671|    curr_size = alloc_pos + alloc_size;
  172|       |
  173|       |    /* Add 64-1 or 4096-1 to allow window alignment, and round size of buffer up to multiple of 64 */
  174|    671|    int total_size = PAD_64(curr_size + (WINDOW_PAD_SIZE - 1));
  ------------------
  |  |  245|    671|#define PAD_64(bpos) ((bpos) + PADSZ((bpos),64))
  |  |  ------------------
  |  |  |  |  243|    671|#define PADSZ(bpos, pad) (((pad) - ((uintptr_t)(bpos) % (pad))) % (pad))
  |  |  ------------------
  ------------------
  175|       |
  176|       |    /* Allocate buffer, align to 64-byte cacheline, and zerofill the resulting buffer */
  177|    671|    char *original_buf = (char *)strm->zalloc(strm->opaque, 1, total_size);
  178|    671|    if (original_buf == NULL)
  ------------------
  |  Branch (178:9): [True: 0, False: 671]
  ------------------
  179|      0|        return NULL;
  180|       |
  181|    671|    char *buff = (char *)HINT_ALIGNED_WINDOW((char *)PAD_WINDOW(original_buf));
  ------------------
  |  |  467|    671|#  define HINT_ALIGNED_WINDOW   HINT_ALIGNED_64
  |  |  ------------------
  |  |  |  |  236|    671|#define HINT_ALIGNED_64(p) HINT_ALIGNED((p),64)
  |  |  |  |  ------------------
  |  |  |  |  |  |  231|    671|#  define HINT_ALIGNED(p,n) __builtin_assume_aligned((void *)(p),(n))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|    671|    LOGSZPL("Buffer alloc", total_size, PADSZ((uintptr_t)original_buf,WINDOW_PAD_SIZE), PADSZ(curr_size,WINDOW_PAD_SIZE));
  183|       |
  184|       |    /* Initialize alloc_bufs */
  185|    671|    inflate_allocs *alloc_bufs  = (struct inflate_allocs_s *)(buff + alloc_pos);
  186|    671|    alloc_bufs->buf_start = original_buf;
  187|    671|    alloc_bufs->zfree = strm->zfree;
  188|       |
  189|    671|    alloc_bufs->window =  (unsigned char *)HINT_ALIGNED_WINDOW((buff + window_pos));
  ------------------
  |  |  467|    671|#  define HINT_ALIGNED_WINDOW   HINT_ALIGNED_64
  |  |  ------------------
  |  |  |  |  236|    671|#define HINT_ALIGNED_64(p) HINT_ALIGNED((p),64)
  |  |  |  |  ------------------
  |  |  |  |  |  |  231|    671|#  define HINT_ALIGNED(p,n) __builtin_assume_aligned((void *)(p),(n))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  190|    671|    alloc_bufs->state = (inflate_state *)HINT_ALIGNED_64((buff + state_pos));
  ------------------
  |  |  236|    671|#define HINT_ALIGNED_64(p) HINT_ALIGNED((p),64)
  |  |  ------------------
  |  |  |  |  231|    671|#  define HINT_ALIGNED(p,n) __builtin_assume_aligned((void *)(p),(n))
  |  |  ------------------
  ------------------
  191|       |
  192|       |#ifdef Z_MEMORY_SANITIZER
  193|       |    /* This is _not_ to subvert the memory sanitizer but to instead unposion some
  194|       |       data we willingly and purposefully load uninitialized into vector registers
  195|       |       in order to safely read the last < chunksize bytes of the window. */
  196|       |    __msan_unpoison(alloc_bufs->window + window_size, 64);
  197|       |#endif
  198|       |
  199|    671|    return alloc_bufs;
  200|    671|}
free_inflate:
  205|    671|Z_INTERNAL void free_inflate(PREFIX3(stream) *strm) {
  206|    671|    struct inflate_state *state = (struct inflate_state *)strm->state;
  207|       |
  208|    671|    if (state->alloc_bufs != NULL) {
  ------------------
  |  Branch (208:9): [True: 671, False: 0]
  ------------------
  209|    671|        inflate_allocs *alloc_bufs = state->alloc_bufs;
  210|    671|        alloc_bufs->zfree(strm->opaque, alloc_bufs->buf_start);
  211|       |        strm->state = NULL;
  212|    671|    }
  213|    671|}
zng_inflateInit2:
  219|    671|int32_t ZNG_CONDEXPORT PREFIX(inflateInit2)(PREFIX3(stream) *strm, int32_t windowBits) {
  220|    671|    struct inflate_state *state;
  221|    671|    int32_t ret;
  222|       |
  223|       |    /* Initialize functable */
  224|    671|    FUNCTABLE_INIT;
  ------------------
  |  |   48|    671|#  define FUNCTABLE_INIT if (functable.force_init()) {return Z_VERSION_ERROR;}
  |  |  ------------------
  |  |  |  |  188|      0|#define Z_VERSION_ERROR (-6)
  |  |  ------------------
  |  |  |  Branch (48:30): [True: 0, False: 671]
  |  |  ------------------
  ------------------
  225|       |
  226|    671|    if (strm == NULL)
  ------------------
  |  Branch (226:9): [True: 0, False: 671]
  ------------------
  227|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  228|    671|    strm->msg = NULL;                   /* in case we return an error */
  229|    671|    if (strm->zalloc == NULL) {
  ------------------
  |  Branch (229:9): [True: 671, False: 0]
  ------------------
  230|    671|        strm->zalloc = PREFIX(zcalloc);
  ------------------
  |  |   97|    671|#  define PREFIX(x) zng_ ## x
  ------------------
  231|    671|        strm->opaque = NULL;
  232|    671|    }
  233|    671|    if (strm->zfree == NULL)
  ------------------
  |  Branch (233:9): [True: 671, False: 0]
  ------------------
  234|    671|        strm->zfree = PREFIX(zcfree);
  ------------------
  |  |   97|    671|#  define PREFIX(x) zng_ ## x
  ------------------
  235|       |
  236|    671|    inflate_allocs *alloc_bufs = alloc_inflate(strm);
  237|    671|    if (alloc_bufs == NULL)
  ------------------
  |  Branch (237:9): [True: 0, False: 671]
  ------------------
  238|      0|        return Z_MEM_ERROR;
  ------------------
  |  |  186|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  239|       |
  240|    671|    state = alloc_bufs->state;
  241|    671|    state->window = alloc_bufs->window;
  242|    671|    state->alloc_bufs = alloc_bufs;
  243|    671|    state->wbufsize = INFLATE_ADJUST_WINDOW_SIZE((1 << MAX_WBITS) + 64);
  ------------------
  |  |   23|    671|#  define INFLATE_ADJUST_WINDOW_SIZE(n) (n)
  ------------------
  244|    671|    Tracev((stderr, "inflate: allocated\n"));
  245|       |
  246|    671|    strm->state = (struct internal_state *)state;
  247|    671|    state->strm = strm;
  248|    671|    state->mode = HEAD;     /* to pass state test in inflateReset2() */
  249|    671|    ret = PREFIX(inflateReset2)(strm, windowBits);
  ------------------
  |  |   97|    671|#  define PREFIX(x) zng_ ## x
  ------------------
  250|    671|    if (ret != Z_OK) {
  ------------------
  |  |  180|    671|#define Z_OK            0
  ------------------
  |  Branch (250:9): [True: 0, False: 671]
  ------------------
  251|      0|        free_inflate(strm);
  252|      0|    }
  253|    671|    return ret;
  254|    671|}
zng_inflateInit:
  257|    671|int32_t Z_EXPORT PREFIX(inflateInit)(PREFIX3(stream) *strm) {
  258|    671|    return PREFIX(inflateInit2)(strm, DEF_WBITS);
  ------------------
  |  |   97|    671|#  define PREFIX(x) zng_ ## x
  ------------------
                  return PREFIX(inflateInit2)(strm, DEF_WBITS);
  ------------------
  |  |   35|    671|#  define DEF_WBITS MAX_WBITS
  |  |  ------------------
  |  |  |  |   39|    671|#  define MAX_WBITS   15 /* 32K LZ77 window */
  |  |  ------------------
  ------------------
  259|    671|}
zng_fixedtables:
  303|  1.67k|void Z_INTERNAL PREFIX(fixedtables)(struct inflate_state *state) {
  304|  1.67k|    state->lencode = lenfix;
  305|  1.67k|    state->lenbits = 9;
  306|  1.67k|    state->distcode = distfix;
  307|  1.67k|    state->distbits = 5;
  308|  1.67k|}
zng_inflate:
  475|    937|int32_t Z_EXPORT PREFIX(inflate)(PREFIX3(stream) *strm, int32_t flush) {
  476|    937|    struct inflate_state *state;
  477|    937|    const unsigned char *next;  /* next input */
  478|    937|    unsigned char *put;         /* next output */
  479|    937|    unsigned char *from;        /* where to copy match bytes from */
  480|    937|    unsigned have, left;        /* available input and output */
  481|    937|    uint64_t hold;              /* bit buffer */
  482|    937|    unsigned bits;              /* bits in bit buffer */
  483|    937|    uint32_t in, out;           /* save starting available input and output */
  484|    937|    unsigned copy;              /* number of stored or match bytes to copy */
  485|    937|    code here;                  /* current decoding table entry */
  486|    937|    code last;                  /* parent table entry */
  487|    937|    unsigned len;               /* length to copy for repeats, bits to drop */
  488|    937|    int32_t ret;                /* return code */
  489|    937|#ifdef GUNZIP
  490|    937|    unsigned char hbuf[4];      /* buffer for gzip header crc calculation */
  491|    937|#endif
  492|    937|    static const uint16_t order[19] = /* permutation of code lengths */
  493|    937|        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
  494|       |
  495|    937|    if (inflateStateCheck(strm) || strm->next_out == NULL ||
  ------------------
  |  Branch (495:9): [True: 0, False: 937]
  |  Branch (495:36): [True: 0, False: 937]
  ------------------
  496|    937|        (strm->next_in == NULL && strm->avail_in != 0))
  ------------------
  |  Branch (496:10): [True: 0, False: 937]
  |  Branch (496:35): [True: 0, False: 0]
  ------------------
  497|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  498|       |
  499|    937|    state = (struct inflate_state *)strm->state;
  500|    937|    if (state->mode == TYPE)      /* skip check */
  ------------------
  |  Branch (500:9): [True: 2, False: 935]
  ------------------
  501|      2|        state->mode = TYPEDO;
  502|    937|    LOAD();
  ------------------
  |  |   77|    937|    do { \
  |  |   78|    937|        put = strm->next_out; \
  |  |   79|    937|        left = strm->avail_out; \
  |  |   80|    937|        next = strm->next_in; \
  |  |   81|    937|        have = strm->avail_in; \
  |  |   82|    937|        hold = state->hold; \
  |  |   83|    937|        bits = state->bits; \
  |  |   84|    937|    } while (0)
  |  |  ------------------
  |  |  |  Branch (84:14): [Folded, False: 937]
  |  |  ------------------
  ------------------
  503|    937|    in = have;
  504|    937|    out = left;
  505|    937|    ret = Z_OK;
  ------------------
  |  |  180|    937|#define Z_OK            0
  ------------------
  506|    937|    for (;;)
  507|  15.6k|        switch (state->mode) {
  508|    682|        case HEAD:
  ------------------
  |  Branch (508:9): [True: 682, False: 14.9k]
  ------------------
  509|    682|            if (state->wrap == 0) {
  ------------------
  |  Branch (509:17): [True: 0, False: 682]
  ------------------
  510|      0|                state->mode = TYPEDO;
  511|      0|                break;
  512|      0|            }
  513|    682|            NEEDBITS(16);
  ------------------
  |  |  107|    682|    do { \
  |  |  108|  2.01k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 1.35k, False: 660]
  |  |  ------------------
  |  |  109|  1.35k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  1.35k|    do { \
  |  |  |  |  387|  1.35k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 22, False: 1.33k]
  |  |  |  |  ------------------
  |  |  |  |  388|  1.35k|        have--; \
  |  |  |  |  389|  1.33k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  1.33k|        bits += 8; \
  |  |  |  |  391|  1.33k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 1.33k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    682|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 660]
  |  |  ------------------
  ------------------
  514|    660|#ifdef GUNZIP
  515|    660|            if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */
  ------------------
  |  Branch (515:17): [True: 0, False: 660]
  |  Branch (515:38): [True: 0, False: 0]
  ------------------
  516|      0|                if (state->wbits == 0)
  ------------------
  |  Branch (516:21): [True: 0, False: 0]
  ------------------
  517|      0|                    state->wbits = MAX_WBITS;
  ------------------
  |  |   39|      0|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
  518|      0|                state->check = CRC32_INITIAL_VALUE;
  ------------------
  |  |   66|      0|#define CRC32_INITIAL_VALUE   0 /* initial crc-32 hash value */
  ------------------
  519|      0|                CRC2(state->check, hold);
  ------------------
  |  |   59|      0|    do { \
  |  |   60|      0|        hbuf[0] = (unsigned char)(word); \
  |  |   61|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |   62|      0|        check = PREFIX(crc32)(check, hbuf, 2); \
  |  |  ------------------
  |  |  |  |   97|      0|#  define PREFIX(x) zng_ ## x
  |  |  ------------------
  |  |   63|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (63:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  520|      0|                INITBITS();
  ------------------
  |  |   99|      0|    do { \
  |  |  100|      0|        hold = 0; \
  |  |  101|      0|        bits = 0; \
  |  |  102|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  521|      0|                state->mode = FLAGS;
  522|      0|                break;
  523|      0|            }
  524|    660|            if (state->head != NULL)
  ------------------
  |  Branch (524:17): [True: 0, False: 660]
  ------------------
  525|      0|                state->head->done = -1;
  526|    660|            if (!(state->wrap & 1) ||   /* check if zlib header allowed */
  ------------------
  |  Branch (526:17): [True: 0, False: 660]
  ------------------
  527|       |#else
  528|       |            if (
  529|       |#endif
  530|    660|                ((BITS(8) << 8) + (hold >> 8)) % 31) {
  ------------------
  |  |  114|    660|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  |  Branch (530:17): [True: 20, False: 640]
  ------------------
  531|     20|                SET_BAD("incorrect header check");
  ------------------
  |  |  132|     20|    do { \
  |  |  133|     20|        state->mode = BAD; \
  |  |  134|     20|        strm->msg = (char *)errmsg; \
  |  |  135|     20|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 20]
  |  |  ------------------
  ------------------
  532|     20|                break;
  533|     20|            }
  534|    640|            if (BITS(4) != Z_DEFLATED) {
  ------------------
  |  |  114|    640|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
                          if (BITS(4) != Z_DEFLATED) {
  ------------------
  |  |  212|    640|#define Z_DEFLATED   8
  ------------------
  |  Branch (534:17): [True: 2, False: 638]
  ------------------
  535|      2|                SET_BAD("unknown compression method");
  ------------------
  |  |  132|      2|    do { \
  |  |  133|      2|        state->mode = BAD; \
  |  |  134|      2|        strm->msg = (char *)errmsg; \
  |  |  135|      2|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
  536|      2|                break;
  537|      2|            }
  538|    638|            DROPBITS(4);
  ------------------
  |  |  118|    638|    do { \
  |  |  119|    638|        hold >>= (n); \
  |  |  120|    638|        bits -= (unsigned)(n); \
  |  |  121|    638|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 638]
  |  |  ------------------
  ------------------
  539|    638|            len = BITS(4) + 8;
  ------------------
  |  |  114|    638|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  540|    638|            if (state->wbits == 0)
  ------------------
  |  Branch (540:17): [True: 0, False: 638]
  ------------------
  541|      0|                state->wbits = len;
  542|    638|            if (len > MAX_WBITS || len > state->wbits) {
  ------------------
  |  |   39|  1.27k|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
  |  Branch (542:17): [True: 1, False: 637]
  |  Branch (542:36): [True: 0, False: 637]
  ------------------
  543|      1|                SET_BAD("invalid window size");
  ------------------
  |  |  132|      1|    do { \
  |  |  133|      1|        state->mode = BAD; \
  |  |  134|      1|        strm->msg = (char *)errmsg; \
  |  |  135|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
  544|      1|                break;
  545|      1|            }
  546|       |#ifdef INFLATE_STRICT
  547|       |            state->dmax = 1U << len;
  548|       |#endif
  549|    637|            state->flags = 0;               /* indicate zlib header */
  550|    637|            Tracev((stderr, "inflate:   zlib header ok\n"));
  551|    637|            strm->adler = state->check = ADLER32_INITIAL_VALUE;
  ------------------
  |  |   65|    637|#define ADLER32_INITIAL_VALUE 1 /* initial adler-32 hash value */
  ------------------
  552|    637|            state->mode = hold & 0x200 ? DICTID : TYPE;
  ------------------
  |  Branch (552:27): [True: 4, False: 633]
  ------------------
  553|    637|            INITBITS();
  ------------------
  |  |   99|    637|    do { \
  |  |  100|    637|        hold = 0; \
  |  |  101|    637|        bits = 0; \
  |  |  102|    637|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 637]
  |  |  ------------------
  ------------------
  554|    637|            break;
  555|      0|#ifdef GUNZIP
  556|       |
  557|      0|        case FLAGS:
  ------------------
  |  Branch (557:9): [True: 0, False: 15.6k]
  ------------------
  558|      0|            NEEDBITS(16);
  ------------------
  |  |  107|      0|    do { \
  |  |  108|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|      0|    do { \
  |  |  |  |  387|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  388|      0|        have--; \
  |  |  |  |  389|      0|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|      0|        bits += 8; \
  |  |  |  |  391|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  559|      0|            state->flags = (int)(hold);
  560|      0|            if ((state->flags & 0xff) != Z_DEFLATED) {
  ------------------
  |  |  212|      0|#define Z_DEFLATED   8
  ------------------
  |  Branch (560:17): [True: 0, False: 0]
  ------------------
  561|      0|                SET_BAD("unknown compression method");
  ------------------
  |  |  132|      0|    do { \
  |  |  133|      0|        state->mode = BAD; \
  |  |  134|      0|        strm->msg = (char *)errmsg; \
  |  |  135|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  562|      0|                break;
  563|      0|            }
  564|      0|            if (state->flags & 0xe000) {
  ------------------
  |  Branch (564:17): [True: 0, False: 0]
  ------------------
  565|      0|                SET_BAD("unknown header flags set");
  ------------------
  |  |  132|      0|    do { \
  |  |  133|      0|        state->mode = BAD; \
  |  |  134|      0|        strm->msg = (char *)errmsg; \
  |  |  135|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  566|      0|                break;
  567|      0|            }
  568|      0|            if (state->head != NULL)
  ------------------
  |  Branch (568:17): [True: 0, False: 0]
  ------------------
  569|      0|                state->head->text = (int)((hold >> 8) & 1);
  570|      0|            if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (570:17): [True: 0, False: 0]
  |  Branch (570:44): [True: 0, False: 0]
  ------------------
  571|      0|                CRC2(state->check, hold);
  ------------------
  |  |   59|      0|    do { \
  |  |   60|      0|        hbuf[0] = (unsigned char)(word); \
  |  |   61|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |   62|      0|        check = PREFIX(crc32)(check, hbuf, 2); \
  |  |  ------------------
  |  |  |  |   97|      0|#  define PREFIX(x) zng_ ## x
  |  |  ------------------
  |  |   63|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (63:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  572|      0|            INITBITS();
  ------------------
  |  |   99|      0|    do { \
  |  |  100|      0|        hold = 0; \
  |  |  101|      0|        bits = 0; \
  |  |  102|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  573|      0|            state->mode = TIME;
  574|      0|            Z_FALLTHROUGH;
  ------------------
  |  |   45|      0|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  575|       |
  576|      0|        case TIME:
  ------------------
  |  Branch (576:9): [True: 0, False: 15.6k]
  ------------------
  577|      0|            NEEDBITS(32);
  ------------------
  |  |  107|      0|    do { \
  |  |  108|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|      0|    do { \
  |  |  |  |  387|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  388|      0|        have--; \
  |  |  |  |  389|      0|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|      0|        bits += 8; \
  |  |  |  |  391|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  578|      0|            if (state->head != NULL)
  ------------------
  |  Branch (578:17): [True: 0, False: 0]
  ------------------
  579|      0|                state->head->time = (unsigned)(hold);
  580|      0|            if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (580:17): [True: 0, False: 0]
  |  Branch (580:44): [True: 0, False: 0]
  ------------------
  581|      0|                CRC4(state->check, hold);
  ------------------
  |  |   66|      0|    do { \
  |  |   67|      0|        hbuf[0] = (unsigned char)(word); \
  |  |   68|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |   69|      0|        hbuf[2] = (unsigned char)((word) >> 16); \
  |  |   70|      0|        hbuf[3] = (unsigned char)((word) >> 24); \
  |  |   71|      0|        check = PREFIX(crc32)(check, hbuf, 4); \
  |  |  ------------------
  |  |  |  |   97|      0|#  define PREFIX(x) zng_ ## x
  |  |  ------------------
  |  |   72|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (72:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  582|      0|            INITBITS();
  ------------------
  |  |   99|      0|    do { \
  |  |  100|      0|        hold = 0; \
  |  |  101|      0|        bits = 0; \
  |  |  102|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  583|      0|            state->mode = OS;
  584|      0|            Z_FALLTHROUGH;
  ------------------
  |  |   45|      0|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  585|       |
  586|      0|        case OS:
  ------------------
  |  Branch (586:9): [True: 0, False: 15.6k]
  ------------------
  587|      0|            NEEDBITS(16);
  ------------------
  |  |  107|      0|    do { \
  |  |  108|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|      0|    do { \
  |  |  |  |  387|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  388|      0|        have--; \
  |  |  |  |  389|      0|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|      0|        bits += 8; \
  |  |  |  |  391|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  588|      0|            if (state->head != NULL) {
  ------------------
  |  Branch (588:17): [True: 0, False: 0]
  ------------------
  589|      0|                state->head->xflags = (int)(hold & 0xff);
  590|      0|                state->head->os = (int)(hold >> 8);
  591|      0|            }
  592|      0|            if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (592:17): [True: 0, False: 0]
  |  Branch (592:44): [True: 0, False: 0]
  ------------------
  593|      0|                CRC2(state->check, hold);
  ------------------
  |  |   59|      0|    do { \
  |  |   60|      0|        hbuf[0] = (unsigned char)(word); \
  |  |   61|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |   62|      0|        check = PREFIX(crc32)(check, hbuf, 2); \
  |  |  ------------------
  |  |  |  |   97|      0|#  define PREFIX(x) zng_ ## x
  |  |  ------------------
  |  |   63|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (63:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  594|      0|            INITBITS();
  ------------------
  |  |   99|      0|    do { \
  |  |  100|      0|        hold = 0; \
  |  |  101|      0|        bits = 0; \
  |  |  102|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  595|      0|            state->mode = EXLEN;
  596|      0|            Z_FALLTHROUGH;
  ------------------
  |  |   45|      0|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  597|       |
  598|      0|        case EXLEN:
  ------------------
  |  Branch (598:9): [True: 0, False: 15.6k]
  ------------------
  599|      0|            if (state->flags & 0x0400) {
  ------------------
  |  Branch (599:17): [True: 0, False: 0]
  ------------------
  600|      0|                NEEDBITS(16);
  ------------------
  |  |  107|      0|    do { \
  |  |  108|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|      0|    do { \
  |  |  |  |  387|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  388|      0|        have--; \
  |  |  |  |  389|      0|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|      0|        bits += 8; \
  |  |  |  |  391|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  601|      0|                state->length = (uint16_t)hold;
  602|      0|                if (state->head != NULL)
  ------------------
  |  Branch (602:21): [True: 0, False: 0]
  ------------------
  603|      0|                    state->head->extra_len = (uint16_t)hold;
  604|      0|                if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (604:21): [True: 0, False: 0]
  |  Branch (604:48): [True: 0, False: 0]
  ------------------
  605|      0|                    CRC2(state->check, hold);
  ------------------
  |  |   59|      0|    do { \
  |  |   60|      0|        hbuf[0] = (unsigned char)(word); \
  |  |   61|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |   62|      0|        check = PREFIX(crc32)(check, hbuf, 2); \
  |  |  ------------------
  |  |  |  |   97|      0|#  define PREFIX(x) zng_ ## x
  |  |  ------------------
  |  |   63|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (63:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  606|      0|                INITBITS();
  ------------------
  |  |   99|      0|    do { \
  |  |  100|      0|        hold = 0; \
  |  |  101|      0|        bits = 0; \
  |  |  102|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  607|      0|            } else if (state->head != NULL) {
  ------------------
  |  Branch (607:24): [True: 0, False: 0]
  ------------------
  608|      0|                state->head->extra = NULL;
  609|      0|            }
  610|      0|            state->mode = EXTRA;
  611|      0|            Z_FALLTHROUGH;
  ------------------
  |  |   45|      0|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  612|       |
  613|      0|        case EXTRA:
  ------------------
  |  Branch (613:9): [True: 0, False: 15.6k]
  ------------------
  614|      0|            if (state->flags & 0x0400) {
  ------------------
  |  Branch (614:17): [True: 0, False: 0]
  ------------------
  615|      0|                copy = state->length;
  616|      0|                if (copy > have)
  ------------------
  |  Branch (616:21): [True: 0, False: 0]
  ------------------
  617|      0|                    copy = have;
  618|      0|                if (copy) {
  ------------------
  |  Branch (618:21): [True: 0, False: 0]
  ------------------
  619|      0|                    if (state->head != NULL && state->head->extra != NULL) {
  ------------------
  |  Branch (619:25): [True: 0, False: 0]
  |  Branch (619:48): [True: 0, False: 0]
  ------------------
  620|      0|                        len = state->head->extra_len - state->length;
  621|      0|                        if (len < state->head->extra_max) {
  ------------------
  |  Branch (621:29): [True: 0, False: 0]
  ------------------
  622|      0|                            memcpy(state->head->extra + len, next,
  623|      0|                                    len + copy > state->head->extra_max ?
  ------------------
  |  Branch (623:37): [True: 0, False: 0]
  ------------------
  624|      0|                                    state->head->extra_max - len : copy);
  625|      0|                        }
  626|      0|                    }
  627|      0|                    if ((state->flags & 0x0200) && (state->wrap & 4)) {
  ------------------
  |  Branch (627:25): [True: 0, False: 0]
  |  Branch (627:52): [True: 0, False: 0]
  ------------------
  628|      0|                        state->check = PREFIX(crc32)(state->check, next, copy);
  ------------------
  |  |   97|      0|#  define PREFIX(x) zng_ ## x
  ------------------
  629|      0|                    }
  630|      0|                    have -= copy;
  631|      0|                    next += copy;
  632|      0|                    state->length -= copy;
  633|      0|                }
  634|      0|                if (state->length)
  ------------------
  |  Branch (634:21): [True: 0, False: 0]
  ------------------
  635|      0|                    goto inf_leave;
  636|      0|            }
  637|      0|            state->length = 0;
  638|      0|            state->mode = NAME;
  639|      0|            Z_FALLTHROUGH;
  ------------------
  |  |   45|      0|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  640|       |
  641|      0|        case NAME:
  ------------------
  |  Branch (641:9): [True: 0, False: 15.6k]
  ------------------
  642|      0|            if (state->flags & 0x0800) {
  ------------------
  |  Branch (642:17): [True: 0, False: 0]
  ------------------
  643|      0|                if (have == 0) goto inf_leave;
  ------------------
  |  Branch (643:21): [True: 0, False: 0]
  ------------------
  644|      0|                copy = 0;
  645|      0|                do {
  646|      0|                    len = (unsigned)(next[copy++]);
  647|      0|                    if (state->head != NULL && state->head->name != NULL && state->length < state->head->name_max)
  ------------------
  |  Branch (647:25): [True: 0, False: 0]
  |  Branch (647:48): [True: 0, False: 0]
  |  Branch (647:77): [True: 0, False: 0]
  ------------------
  648|      0|                        state->head->name[state->length++] = (unsigned char)len;
  649|      0|                } while (len && copy < have);
  ------------------
  |  Branch (649:26): [True: 0, False: 0]
  |  Branch (649:33): [True: 0, False: 0]
  ------------------
  650|      0|                if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (650:21): [True: 0, False: 0]
  |  Branch (650:48): [True: 0, False: 0]
  ------------------
  651|      0|                    state->check = PREFIX(crc32)(state->check, next, copy);
  ------------------
  |  |   97|      0|#  define PREFIX(x) zng_ ## x
  ------------------
  652|      0|                have -= copy;
  653|      0|                next += copy;
  654|      0|                if (len)
  ------------------
  |  Branch (654:21): [True: 0, False: 0]
  ------------------
  655|      0|                    goto inf_leave;
  656|      0|            } else if (state->head != NULL) {
  ------------------
  |  Branch (656:24): [True: 0, False: 0]
  ------------------
  657|      0|                state->head->name = NULL;
  658|      0|            }
  659|      0|            state->length = 0;
  660|      0|            state->mode = COMMENT;
  661|      0|            Z_FALLTHROUGH;
  ------------------
  |  |   45|      0|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  662|       |
  663|      0|        case COMMENT:
  ------------------
  |  Branch (663:9): [True: 0, False: 15.6k]
  ------------------
  664|      0|            if (state->flags & 0x1000) {
  ------------------
  |  Branch (664:17): [True: 0, False: 0]
  ------------------
  665|      0|                if (have == 0) goto inf_leave;
  ------------------
  |  Branch (665:21): [True: 0, False: 0]
  ------------------
  666|      0|                copy = 0;
  667|      0|                do {
  668|      0|                    len = (unsigned)(next[copy++]);
  669|      0|                    if (state->head != NULL && state->head->comment != NULL
  ------------------
  |  Branch (669:25): [True: 0, False: 0]
  |  Branch (669:48): [True: 0, False: 0]
  ------------------
  670|      0|                        && state->length < state->head->comm_max)
  ------------------
  |  Branch (670:28): [True: 0, False: 0]
  ------------------
  671|      0|                        state->head->comment[state->length++] = (unsigned char)len;
  672|      0|                } while (len && copy < have);
  ------------------
  |  Branch (672:26): [True: 0, False: 0]
  |  Branch (672:33): [True: 0, False: 0]
  ------------------
  673|      0|                if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (673:21): [True: 0, False: 0]
  |  Branch (673:48): [True: 0, False: 0]
  ------------------
  674|      0|                    state->check = PREFIX(crc32)(state->check, next, copy);
  ------------------
  |  |   97|      0|#  define PREFIX(x) zng_ ## x
  ------------------
  675|      0|                have -= copy;
  676|      0|                next += copy;
  677|      0|                if (len)
  ------------------
  |  Branch (677:21): [True: 0, False: 0]
  ------------------
  678|      0|                    goto inf_leave;
  679|      0|            } else if (state->head != NULL) {
  ------------------
  |  Branch (679:24): [True: 0, False: 0]
  ------------------
  680|      0|                state->head->comment = NULL;
  681|      0|            }
  682|      0|            state->mode = HCRC;
  683|      0|            Z_FALLTHROUGH;
  ------------------
  |  |   45|      0|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  684|       |
  685|      0|        case HCRC:
  ------------------
  |  Branch (685:9): [True: 0, False: 15.6k]
  ------------------
  686|      0|            if (state->flags & 0x0200) {
  ------------------
  |  Branch (686:17): [True: 0, False: 0]
  ------------------
  687|      0|                NEEDBITS(16);
  ------------------
  |  |  107|      0|    do { \
  |  |  108|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|      0|    do { \
  |  |  |  |  387|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  388|      0|        have--; \
  |  |  |  |  389|      0|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|      0|        bits += 8; \
  |  |  |  |  391|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  688|      0|                if ((state->wrap & 4) && hold != (state->check & 0xffff)) {
  ------------------
  |  Branch (688:21): [True: 0, False: 0]
  |  Branch (688:42): [True: 0, False: 0]
  ------------------
  689|      0|                    SET_BAD("header crc mismatch");
  ------------------
  |  |  132|      0|    do { \
  |  |  133|      0|        state->mode = BAD; \
  |  |  134|      0|        strm->msg = (char *)errmsg; \
  |  |  135|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  690|      0|                    break;
  691|      0|                }
  692|      0|                INITBITS();
  ------------------
  |  |   99|      0|    do { \
  |  |  100|      0|        hold = 0; \
  |  |  101|      0|        bits = 0; \
  |  |  102|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  693|      0|            }
  694|      0|            if (state->head != NULL) {
  ------------------
  |  Branch (694:17): [True: 0, False: 0]
  ------------------
  695|      0|                state->head->hcrc = (int)((state->flags >> 9) & 1);
  696|      0|                state->head->done = 1;
  697|      0|            }
  698|       |            /* compute crc32 checksum if not in raw mode */
  699|      0|            if ((state->wrap & 4) && state->flags)
  ------------------
  |  Branch (699:17): [True: 0, False: 0]
  |  Branch (699:38): [True: 0, False: 0]
  ------------------
  700|      0|                strm->adler = state->check = FUNCTABLE_CALL(crc32_fold_reset)(&state->crc_fold);
  ------------------
  |  |   49|      0|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
  701|      0|            state->mode = TYPE;
  702|      0|            break;
  703|      0|#endif
  704|      7|        case DICTID:
  ------------------
  |  Branch (704:9): [True: 7, False: 15.6k]
  ------------------
  705|      7|            NEEDBITS(32);
  ------------------
  |  |  107|      7|    do { \
  |  |  108|     14|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 13, False: 1]
  |  |  ------------------
  |  |  109|     13|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|     13|    do { \
  |  |  |  |  387|     13|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 6, False: 7]
  |  |  |  |  ------------------
  |  |  |  |  388|     13|        have--; \
  |  |  |  |  389|      7|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|      7|        bits += 8; \
  |  |  |  |  391|      7|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      7|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
  706|      1|            strm->adler = state->check = ZSWAP32((unsigned)hold);
  ------------------
  |  |  170|      1|#  define ZSWAP32(q) __builtin_bswap32(q)
  ------------------
  707|      1|            INITBITS();
  ------------------
  |  |   99|      1|    do { \
  |  |  100|      1|        hold = 0; \
  |  |  101|      1|        bits = 0; \
  |  |  102|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
  708|      1|            state->mode = DICT;
  709|      1|            Z_FALLTHROUGH;
  ------------------
  |  |   45|      1|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  710|       |
  711|      1|        case DICT:
  ------------------
  |  Branch (711:9): [True: 0, False: 15.6k]
  ------------------
  712|      1|            if (state->havedict == 0) {
  ------------------
  |  Branch (712:17): [True: 1, False: 0]
  ------------------
  713|      1|                RESTORE();
  ------------------
  |  |   88|      1|    do { \
  |  |   89|      1|        strm->next_out = put; \
  |  |   90|      1|        strm->avail_out = left; \
  |  |   91|      1|        strm->next_in = (z_const unsigned char *)next; \
  |  |   92|      1|        strm->avail_in = have; \
  |  |   93|      1|        state->hold = hold; \
  |  |   94|      1|        state->bits = bits; \
  |  |   95|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (95:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
  714|      1|                return Z_NEED_DICT;
  ------------------
  |  |  182|      1|#define Z_NEED_DICT     2
  ------------------
  715|      1|            }
  716|      0|            strm->adler = state->check = ADLER32_INITIAL_VALUE;
  ------------------
  |  |   65|      0|#define ADLER32_INITIAL_VALUE 1 /* initial adler-32 hash value */
  ------------------
  717|      0|            state->mode = TYPE;
  718|      0|            Z_FALLTHROUGH;
  ------------------
  |  |   45|      0|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  719|       |
  720|  2.32k|        case TYPE:
  ------------------
  |  Branch (720:9): [True: 2.32k, False: 13.3k]
  ------------------
  721|  2.32k|            if (flush == Z_BLOCK || flush == Z_TREES)
  ------------------
  |  |  176|  4.64k|#define Z_BLOCK         5
  ------------------
                          if (flush == Z_BLOCK || flush == Z_TREES)
  ------------------
  |  |  177|  2.32k|#define Z_TREES         6
  ------------------
  |  Branch (721:17): [True: 0, False: 2.32k]
  |  Branch (721:37): [True: 0, False: 2.32k]
  ------------------
  722|      0|                goto inf_leave;
  723|  2.32k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  2.32k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  724|       |
  725|  2.32k|        case TYPEDO:
  ------------------
  |  Branch (725:9): [True: 2, False: 15.6k]
  ------------------
  726|       |            /* determine and dispatch block type */
  727|  2.32k|            INFLATE_TYPEDO_HOOK(strm, flush);  /* hook for IBM Z DFLTCC */
  ------------------
  |  |   29|  2.32k|#  define INFLATE_TYPEDO_HOOK(strm, flush) do {} while (0)
  |  |  ------------------
  |  |  |  Branch (29:57): [Folded, False: 2.32k]
  |  |  ------------------
  ------------------
  728|  2.32k|            if (state->last) {
  ------------------
  |  Branch (728:17): [True: 133, False: 2.18k]
  ------------------
  729|    133|                BYTEBITS();
  ------------------
  |  |  125|    133|    do { \
  |  |  126|    133|        hold >>= bits & 7; \
  |  |  127|    133|        bits -= bits & 7; \
  |  |  128|    133|    } while (0)
  |  |  ------------------
  |  |  |  Branch (128:14): [Folded, False: 133]
  |  |  ------------------
  ------------------
  730|    133|                state->mode = CHECK;
  731|    133|                break;
  732|    133|            }
  733|  2.18k|            NEEDBITS(3);
  ------------------
  |  |  107|  2.18k|    do { \
  |  |  108|  3.97k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 1.79k, False: 2.18k]
  |  |  ------------------
  |  |  109|  2.18k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  1.79k|    do { \
  |  |  |  |  387|  1.79k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 4, False: 1.78k]
  |  |  |  |  ------------------
  |  |  |  |  388|  1.79k|        have--; \
  |  |  |  |  389|  1.78k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  1.78k|        bits += 8; \
  |  |  |  |  391|  1.78k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 1.78k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  2.18k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 2.18k]
  |  |  ------------------
  ------------------
  734|  2.18k|            state->last = BITS(1);
  ------------------
  |  |  114|  2.18k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  735|  2.18k|            DROPBITS(1);
  ------------------
  |  |  118|  2.18k|    do { \
  |  |  119|  2.18k|        hold >>= (n); \
  |  |  120|  2.18k|        bits -= (unsigned)(n); \
  |  |  121|  2.18k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 2.18k]
  |  |  ------------------
  ------------------
  736|  2.18k|            switch (BITS(2)) {
  ------------------
  |  |  114|  2.18k|    (hold & ((1U << (unsigned)(n)) - 1))
  |  |  ------------------
  |  |  |  Branch (114:5): [True: 2.18k, False: 0]
  |  |  ------------------
  ------------------
  737|    189|            case 0:                             /* stored block */
  ------------------
  |  Branch (737:13): [True: 189, False: 1.99k]
  ------------------
  738|    189|                Tracev((stderr, "inflate:     stored block%s\n", state->last ? " (last)" : ""));
  739|    189|                state->mode = STORED;
  740|    189|                break;
  741|  1.67k|            case 1:                             /* fixed block */
  ------------------
  |  Branch (741:13): [True: 1.67k, False: 509]
  ------------------
  742|  1.67k|                PREFIX(fixedtables)(state);
  ------------------
  |  |   97|  1.67k|#  define PREFIX(x) zng_ ## x
  ------------------
  743|  1.67k|                Tracev((stderr, "inflate:     fixed codes block%s\n", state->last ? " (last)" : ""));
  744|  1.67k|                state->mode = LEN_;             /* decode codes */
  745|  1.67k|                if (flush == Z_TREES) {
  ------------------
  |  |  177|  1.67k|#define Z_TREES         6
  ------------------
  |  Branch (745:21): [True: 0, False: 1.67k]
  ------------------
  746|      0|                    DROPBITS(2);
  ------------------
  |  |  118|      0|    do { \
  |  |  119|      0|        hold >>= (n); \
  |  |  120|      0|        bits -= (unsigned)(n); \
  |  |  121|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  747|      0|                    goto inf_leave;
  748|      0|                }
  749|  1.67k|                break;
  750|  1.67k|            case 2:                             /* dynamic block */
  ------------------
  |  Branch (750:13): [True: 318, False: 1.86k]
  ------------------
  751|    318|                Tracev((stderr, "inflate:     dynamic codes block%s\n", state->last ? " (last)" : ""));
  752|    318|                state->mode = TABLE;
  753|    318|                break;
  754|      2|            case 3:
  ------------------
  |  Branch (754:13): [True: 2, False: 2.18k]
  ------------------
  755|      2|                SET_BAD("invalid block type");
  ------------------
  |  |  132|      2|    do { \
  |  |  133|      2|        state->mode = BAD; \
  |  |  134|      2|        strm->msg = (char *)errmsg; \
  |  |  135|      2|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
  756|  2.18k|            }
  757|  2.18k|            DROPBITS(2);
  ------------------
  |  |  118|  2.18k|    do { \
  |  |  119|  2.18k|        hold >>= (n); \
  |  |  120|  2.18k|        bits -= (unsigned)(n); \
  |  |  121|  2.18k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 2.18k]
  |  |  ------------------
  ------------------
  758|  2.18k|            break;
  759|       |
  760|    200|        case STORED:
  ------------------
  |  Branch (760:9): [True: 200, False: 15.4k]
  ------------------
  761|       |            /* get and verify stored block length */
  762|    200|            BYTEBITS();                         /* go to byte boundary */
  ------------------
  |  |  125|    200|    do { \
  |  |  126|    200|        hold >>= bits & 7; \
  |  |  127|    200|        bits -= bits & 7; \
  |  |  128|    200|    } while (0)
  |  |  ------------------
  |  |  |  Branch (128:14): [Folded, False: 200]
  |  |  ------------------
  ------------------
  763|    200|            NEEDBITS(32);
  ------------------
  |  |  107|    200|    do { \
  |  |  108|    931|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 753, False: 178]
  |  |  ------------------
  |  |  109|    753|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|    753|    do { \
  |  |  |  |  387|    753|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 22, False: 731]
  |  |  |  |  ------------------
  |  |  |  |  388|    753|        have--; \
  |  |  |  |  389|    731|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|    731|        bits += 8; \
  |  |  |  |  391|    731|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 731]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    200|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 178]
  |  |  ------------------
  ------------------
  764|    178|            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
  ------------------
  |  Branch (764:17): [True: 30, False: 148]
  ------------------
  765|     30|                SET_BAD("invalid stored block lengths");
  ------------------
  |  |  132|     30|    do { \
  |  |  133|     30|        state->mode = BAD; \
  |  |  134|     30|        strm->msg = (char *)errmsg; \
  |  |  135|     30|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 30]
  |  |  ------------------
  ------------------
  766|     30|                break;
  767|     30|            }
  768|    148|            state->length = (uint16_t)hold;
  769|    148|            Tracev((stderr, "inflate:       stored length %u\n", state->length));
  770|    148|            INITBITS();
  ------------------
  |  |   99|    148|    do { \
  |  |  100|    148|        hold = 0; \
  |  |  101|    148|        bits = 0; \
  |  |  102|    148|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 148]
  |  |  ------------------
  ------------------
  771|    148|            state->mode = COPY_;
  772|    148|            if (flush == Z_TREES)
  ------------------
  |  |  177|    148|#define Z_TREES         6
  ------------------
  |  Branch (772:17): [True: 0, False: 148]
  ------------------
  773|      0|                goto inf_leave;
  774|    148|            Z_FALLTHROUGH;
  ------------------
  |  |   45|    148|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  775|       |
  776|    148|        case COPY_:
  ------------------
  |  Branch (776:9): [True: 0, False: 15.6k]
  ------------------
  777|    148|            state->mode = COPY;
  778|    148|            Z_FALLTHROUGH;
  ------------------
  |  |   45|    148|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  779|       |
  780|    207|        case COPY:
  ------------------
  |  Branch (780:9): [True: 59, False: 15.6k]
  ------------------
  781|       |            /* copy stored block from input to output */
  782|    207|            copy = state->length;
  783|    207|            if (copy) {
  ------------------
  |  Branch (783:17): [True: 84, False: 123]
  ------------------
  784|     84|                copy = MIN(copy, have);
  ------------------
  |  |  124|     84|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 70, False: 14]
  |  |  ------------------
  ------------------
  785|     84|                copy = MIN(copy, left);
  ------------------
  |  |  124|     84|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 29, False: 55]
  |  |  ------------------
  ------------------
  786|     84|                if (copy == 0)
  ------------------
  |  Branch (786:21): [True: 50, False: 34]
  ------------------
  787|     50|                    goto inf_leave;
  788|     34|                memcpy(put, next, copy);
  789|     34|                have -= copy;
  790|     34|                next += copy;
  791|     34|                left -= copy;
  792|     34|                put += copy;
  793|     34|                state->length -= copy;
  794|     34|                break;
  795|     84|            }
  796|    123|            Tracev((stderr, "inflate:       stored end\n"));
  797|    123|            state->mode = TYPE;
  798|    123|            break;
  799|       |
  800|    321|        case TABLE:
  ------------------
  |  Branch (800:9): [True: 321, False: 15.3k]
  ------------------
  801|       |            /* get dynamic table entries descriptor */
  802|    321|            NEEDBITS(14);
  ------------------
  |  |  107|    321|    do { \
  |  |  108|    892|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 577, False: 315]
  |  |  ------------------
  |  |  109|    577|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|    577|    do { \
  |  |  |  |  387|    577|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 6, False: 571]
  |  |  |  |  ------------------
  |  |  |  |  388|    577|        have--; \
  |  |  |  |  389|    571|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|    571|        bits += 8; \
  |  |  |  |  391|    571|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 571]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    321|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 315]
  |  |  ------------------
  ------------------
  803|    315|            state->nlen = BITS(5) + 257;
  ------------------
  |  |  114|    315|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  804|    315|            DROPBITS(5);
  ------------------
  |  |  118|    315|    do { \
  |  |  119|    315|        hold >>= (n); \
  |  |  120|    315|        bits -= (unsigned)(n); \
  |  |  121|    315|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 315]
  |  |  ------------------
  ------------------
  805|    315|            state->ndist = BITS(5) + 1;
  ------------------
  |  |  114|    315|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  806|    315|            DROPBITS(5);
  ------------------
  |  |  118|    315|    do { \
  |  |  119|    315|        hold >>= (n); \
  |  |  120|    315|        bits -= (unsigned)(n); \
  |  |  121|    315|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 315]
  |  |  ------------------
  ------------------
  807|    315|            state->ncode = BITS(4) + 4;
  ------------------
  |  |  114|    315|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  808|    315|            DROPBITS(4);
  ------------------
  |  |  118|    315|    do { \
  |  |  119|    315|        hold >>= (n); \
  |  |  120|    315|        bits -= (unsigned)(n); \
  |  |  121|    315|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 315]
  |  |  ------------------
  ------------------
  809|    315|#ifndef PKZIP_BUG_WORKAROUND
  810|    315|            if (state->nlen > 286 || state->ndist > 30) {
  ------------------
  |  Branch (810:17): [True: 2, False: 313]
  |  Branch (810:38): [True: 3, False: 310]
  ------------------
  811|      5|                SET_BAD("too many length or distance symbols");
  ------------------
  |  |  132|      5|    do { \
  |  |  133|      5|        state->mode = BAD; \
  |  |  134|      5|        strm->msg = (char *)errmsg; \
  |  |  135|      5|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 5]
  |  |  ------------------
  ------------------
  812|      5|                break;
  813|      5|            }
  814|    310|#endif
  815|    310|            Tracev((stderr, "inflate:       table sizes ok\n"));
  816|    310|            state->have = 0;
  817|    310|            state->mode = LENLENS;
  818|    310|            Z_FALLTHROUGH;
  ------------------
  |  |   45|    310|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  819|       |
  820|    315|        case LENLENS:
  ------------------
  |  Branch (820:9): [True: 5, False: 15.6k]
  ------------------
  821|       |            /* get code length code lengths (not a typo) */
  822|  4.92k|            while (state->have < state->ncode) {
  ------------------
  |  Branch (822:20): [True: 4.62k, False: 305]
  ------------------
  823|  4.62k|                NEEDBITS(3);
  ------------------
  |  |  107|  4.62k|    do { \
  |  |  108|  6.23k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 1.62k, False: 4.61k]
  |  |  ------------------
  |  |  109|  4.62k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  1.62k|    do { \
  |  |  |  |  387|  1.62k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 10, False: 1.61k]
  |  |  |  |  ------------------
  |  |  |  |  388|  1.62k|        have--; \
  |  |  |  |  389|  1.61k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  1.61k|        bits += 8; \
  |  |  |  |  391|  1.61k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 1.61k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  4.62k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
  824|  4.61k|                state->lens[order[state->have++]] = (uint16_t)BITS(3);
  ------------------
  |  |  114|  4.61k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  825|  4.61k|                DROPBITS(3);
  ------------------
  |  |  118|  4.61k|    do { \
  |  |  119|  4.61k|        hold >>= (n); \
  |  |  120|  4.61k|        bits -= (unsigned)(n); \
  |  |  121|  4.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 4.61k]
  |  |  ------------------
  ------------------
  826|  4.61k|            }
  827|  1.49k|            while (state->have < 19)
  ------------------
  |  Branch (827:20): [True: 1.19k, False: 305]
  ------------------
  828|  1.19k|                state->lens[order[state->have++]] = 0;
  829|    305|            state->next = state->codes;
  830|    305|            state->lencode = (const code *)(state->next);
  831|    305|            state->lenbits = 7;
  832|    305|            ret = zng_inflate_table(CODES, state->lens, 19, &(state->next), &(state->lenbits), state->work);
  833|    305|            if (ret) {
  ------------------
  |  Branch (833:17): [True: 22, False: 283]
  ------------------
  834|     22|                SET_BAD("invalid code lengths set");
  ------------------
  |  |  132|     22|    do { \
  |  |  133|     22|        state->mode = BAD; \
  |  |  134|     22|        strm->msg = (char *)errmsg; \
  |  |  135|     22|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 22]
  |  |  ------------------
  ------------------
  835|     22|                break;
  836|     22|            }
  837|    283|            Tracev((stderr, "inflate:       code lengths ok\n"));
  838|    283|            state->have = 0;
  839|    283|            state->mode = CODELENS;
  840|    283|            Z_FALLTHROUGH;
  ------------------
  |  |   45|    283|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  841|       |
  842|    299|        case CODELENS:
  ------------------
  |  Branch (842:9): [True: 16, False: 15.6k]
  ------------------
  843|       |            /* get length and distance code code lengths */
  844|  46.8k|            while (state->have < state->nlen + state->ndist) {
  ------------------
  |  Branch (844:20): [True: 46.6k, False: 236]
  ------------------
  845|  60.0k|                for (;;) {
  846|  60.0k|                    here = state->lencode[BITS(state->lenbits)];
  ------------------
  |  |  114|  60.0k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  847|  60.0k|                    if (here.bits <= bits) break;
  ------------------
  |  Branch (847:25): [True: 46.6k, False: 13.4k]
  ------------------
  848|  13.4k|                    PULLBYTE();
  ------------------
  |  |  386|  13.4k|    do { \
  |  |  387|  13.4k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 16, False: 13.4k]
  |  |  ------------------
  |  |  388|  13.4k|        have--; \
  |  |  389|  13.4k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|  13.4k|        bits += 8; \
  |  |  391|  13.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 13.4k]
  |  |  ------------------
  ------------------
  849|  13.4k|                }
  850|  46.6k|                if (here.val < 16) {
  ------------------
  |  Branch (850:21): [True: 40.1k, False: 6.51k]
  ------------------
  851|  40.1k|                    DROPBITS(here.bits);
  ------------------
  |  |  118|  40.1k|    do { \
  |  |  119|  40.1k|        hold >>= (n); \
  |  |  120|  40.1k|        bits -= (unsigned)(n); \
  |  |  121|  40.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 40.1k]
  |  |  ------------------
  ------------------
  852|  40.1k|                    state->lens[state->have++] = here.val;
  853|  40.1k|                } else {
  854|  6.51k|                    if (here.val == 16) {
  ------------------
  |  Branch (854:25): [True: 5.19k, False: 1.32k]
  ------------------
  855|  5.19k|                        NEEDBITS(here.bits + 2);
  ------------------
  |  |  107|  5.19k|    do { \
  |  |  108|  6.54k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 1.35k, False: 5.19k]
  |  |  ------------------
  |  |  109|  5.19k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  1.35k|    do { \
  |  |  |  |  387|  1.35k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 4, False: 1.34k]
  |  |  |  |  ------------------
  |  |  |  |  388|  1.35k|        have--; \
  |  |  |  |  389|  1.34k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  1.34k|        bits += 8; \
  |  |  |  |  391|  1.34k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 1.34k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  5.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 5.19k]
  |  |  ------------------
  ------------------
  856|  5.19k|                        DROPBITS(here.bits);
  ------------------
  |  |  118|  5.19k|    do { \
  |  |  119|  5.19k|        hold >>= (n); \
  |  |  120|  5.19k|        bits -= (unsigned)(n); \
  |  |  121|  5.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 5.19k]
  |  |  ------------------
  ------------------
  857|  5.19k|                        if (state->have == 0) {
  ------------------
  |  Branch (857:29): [True: 1, False: 5.19k]
  ------------------
  858|      1|                            SET_BAD("invalid bit length repeat");
  ------------------
  |  |  132|      1|    do { \
  |  |  133|      1|        state->mode = BAD; \
  |  |  134|      1|        strm->msg = (char *)errmsg; \
  |  |  135|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
  859|      1|                            break;
  860|      1|                        }
  861|  5.19k|                        len = state->lens[state->have - 1];
  862|  5.19k|                        copy = 3 + BITS(2);
  ------------------
  |  |  114|  5.19k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  863|  5.19k|                        DROPBITS(2);
  ------------------
  |  |  118|  5.19k|    do { \
  |  |  119|  5.19k|        hold >>= (n); \
  |  |  120|  5.19k|        bits -= (unsigned)(n); \
  |  |  121|  5.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 5.19k]
  |  |  ------------------
  ------------------
  864|  5.19k|                    } else if (here.val == 17) {
  ------------------
  |  Branch (864:32): [True: 877, False: 444]
  ------------------
  865|    877|                        NEEDBITS(here.bits + 3);
  ------------------
  |  |  107|    877|    do { \
  |  |  108|  1.29k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 427, False: 871]
  |  |  ------------------
  |  |  109|    877|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|    427|    do { \
  |  |  |  |  387|    427|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 6, False: 421]
  |  |  |  |  ------------------
  |  |  |  |  388|    427|        have--; \
  |  |  |  |  389|    421|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|    421|        bits += 8; \
  |  |  |  |  391|    421|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 421]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    877|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 871]
  |  |  ------------------
  ------------------
  866|    871|                        DROPBITS(here.bits);
  ------------------
  |  |  118|    871|    do { \
  |  |  119|    871|        hold >>= (n); \
  |  |  120|    871|        bits -= (unsigned)(n); \
  |  |  121|    871|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 871]
  |  |  ------------------
  ------------------
  867|    871|                        len = 0;
  868|    871|                        copy = 3 + BITS(3);
  ------------------
  |  |  114|    871|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  869|    871|                        DROPBITS(3);
  ------------------
  |  |  118|    871|    do { \
  |  |  119|    871|        hold >>= (n); \
  |  |  120|    871|        bits -= (unsigned)(n); \
  |  |  121|    871|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 871]
  |  |  ------------------
  ------------------
  870|    871|                    } else {
  871|    444|                        NEEDBITS(here.bits + 7);
  ------------------
  |  |  107|    444|    do { \
  |  |  108|    729|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 291, False: 438]
  |  |  ------------------
  |  |  109|    444|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|    291|    do { \
  |  |  |  |  387|    291|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 6, False: 285]
  |  |  |  |  ------------------
  |  |  |  |  388|    291|        have--; \
  |  |  |  |  389|    285|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|    285|        bits += 8; \
  |  |  |  |  391|    285|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 285]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    444|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 438]
  |  |  ------------------
  ------------------
  872|    438|                        DROPBITS(here.bits);
  ------------------
  |  |  118|    438|    do { \
  |  |  119|    438|        hold >>= (n); \
  |  |  120|    438|        bits -= (unsigned)(n); \
  |  |  121|    438|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 438]
  |  |  ------------------
  ------------------
  873|    438|                        len = 0;
  874|    438|                        copy = 11 + BITS(7);
  ------------------
  |  |  114|    438|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  875|    438|                        DROPBITS(7);
  ------------------
  |  |  118|    438|    do { \
  |  |  119|    438|        hold >>= (n); \
  |  |  120|    438|        bits -= (unsigned)(n); \
  |  |  121|    438|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 438]
  |  |  ------------------
  ------------------
  876|    438|                    }
  877|  6.49k|                    if (state->have + copy > state->nlen + state->ndist) {
  ------------------
  |  Branch (877:25): [True: 30, False: 6.46k]
  ------------------
  878|     30|                        SET_BAD("invalid bit length repeat");
  ------------------
  |  |  132|     30|    do { \
  |  |  133|     30|        state->mode = BAD; \
  |  |  134|     30|        strm->msg = (char *)errmsg; \
  |  |  135|     30|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 30]
  |  |  ------------------
  ------------------
  879|     30|                        break;
  880|     30|                    }
  881|  48.7k|                    while (copy) {
  ------------------
  |  Branch (881:28): [True: 42.3k, False: 6.46k]
  ------------------
  882|  42.3k|                        --copy;
  883|  42.3k|                        state->lens[state->have++] = (uint16_t)len;
  884|  42.3k|                    }
  885|  6.46k|                }
  886|  46.6k|            }
  887|       |
  888|       |            /* handle error breaks in while */
  889|    267|            if (state->mode == BAD)
  ------------------
  |  Branch (889:17): [True: 31, False: 236]
  ------------------
  890|     31|                break;
  891|       |
  892|       |            /* check for end-of-block code (better have one) */
  893|    236|            if (state->lens[256] == 0) {
  ------------------
  |  Branch (893:17): [True: 4, False: 232]
  ------------------
  894|      4|                SET_BAD("invalid code -- missing end-of-block");
  ------------------
  |  |  132|      4|    do { \
  |  |  133|      4|        state->mode = BAD; \
  |  |  134|      4|        strm->msg = (char *)errmsg; \
  |  |  135|      4|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 4]
  |  |  ------------------
  ------------------
  895|      4|                break;
  896|      4|            }
  897|       |
  898|       |            /* build code tables -- note: do not change the lenbits or distbits
  899|       |               values here (10 and 9) without reading the comments in inftrees.h
  900|       |               concerning the ENOUGH constants, which depend on those values */
  901|    232|            state->next = state->codes;
  902|    232|            state->lencode = (const code *)(state->next);
  903|    232|            state->lenbits = 10;
  904|    232|            ret = zng_inflate_table(LENS, state->lens, state->nlen, &(state->next), &(state->lenbits), state->work);
  905|    232|            if (ret) {
  ------------------
  |  Branch (905:17): [True: 86, False: 146]
  ------------------
  906|     86|                SET_BAD("invalid literal/lengths set");
  ------------------
  |  |  132|     86|    do { \
  |  |  133|     86|        state->mode = BAD; \
  |  |  134|     86|        strm->msg = (char *)errmsg; \
  |  |  135|     86|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 86]
  |  |  ------------------
  ------------------
  907|     86|                break;
  908|     86|            }
  909|    146|            state->distcode = (const code *)(state->next);
  910|    146|            state->distbits = 9;
  911|    146|            ret = zng_inflate_table(DISTS, state->lens + state->nlen, state->ndist,
  912|    146|                            &(state->next), &(state->distbits), state->work);
  913|    146|            if (ret) {
  ------------------
  |  Branch (913:17): [True: 20, False: 126]
  ------------------
  914|     20|                SET_BAD("invalid distances set");
  ------------------
  |  |  132|     20|    do { \
  |  |  133|     20|        state->mode = BAD; \
  |  |  134|     20|        strm->msg = (char *)errmsg; \
  |  |  135|     20|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 20]
  |  |  ------------------
  ------------------
  915|     20|                break;
  916|     20|            }
  917|    126|            Tracev((stderr, "inflate:       codes ok\n"));
  918|    126|            state->mode = LEN_;
  919|    126|            if (flush == Z_TREES)
  ------------------
  |  |  177|    126|#define Z_TREES         6
  ------------------
  |  Branch (919:17): [True: 0, False: 126]
  ------------------
  920|      0|                goto inf_leave;
  921|    126|            Z_FALLTHROUGH;
  ------------------
  |  |   45|    126|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  922|       |
  923|  1.80k|        case LEN_:
  ------------------
  |  Branch (923:9): [True: 1.67k, False: 13.9k]
  ------------------
  924|  1.80k|            state->mode = LEN;
  925|  1.80k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  1.80k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  926|       |
  927|  9.09k|        case LEN:
  ------------------
  |  Branch (927:9): [True: 7.29k, False: 8.36k]
  ------------------
  928|       |            /* use inflate_fast() if we have enough input and output */
  929|  9.09k|            if (have >= INFLATE_FAST_MIN_HAVE && left >= INFLATE_FAST_MIN_LEFT) {
  ------------------
  |  |  137|  18.1k|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
                          if (have >= INFLATE_FAST_MIN_HAVE && left >= INFLATE_FAST_MIN_LEFT) {
  ------------------
  |  |  138|  5.63k|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  |  Branch (929:17): [True: 5.63k, False: 3.46k]
  |  Branch (929:50): [True: 3.53k, False: 2.09k]
  ------------------
  930|  3.53k|                RESTORE();
  ------------------
  |  |   88|  3.53k|    do { \
  |  |   89|  3.53k|        strm->next_out = put; \
  |  |   90|  3.53k|        strm->avail_out = left; \
  |  |   91|  3.53k|        strm->next_in = (z_const unsigned char *)next; \
  |  |   92|  3.53k|        strm->avail_in = have; \
  |  |   93|  3.53k|        state->hold = hold; \
  |  |   94|  3.53k|        state->bits = bits; \
  |  |   95|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (95:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
  931|  3.53k|                FUNCTABLE_CALL(inflate_fast)(strm, out);
  ------------------
  |  |   49|  3.53k|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
  932|  3.53k|                LOAD();
  ------------------
  |  |   77|  3.53k|    do { \
  |  |   78|  3.53k|        put = strm->next_out; \
  |  |   79|  3.53k|        left = strm->avail_out; \
  |  |   80|  3.53k|        next = strm->next_in; \
  |  |   81|  3.53k|        have = strm->avail_in; \
  |  |   82|  3.53k|        hold = state->hold; \
  |  |   83|  3.53k|        bits = state->bits; \
  |  |   84|  3.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (84:14): [Folded, False: 3.53k]
  |  |  ------------------
  ------------------
  933|  3.53k|                if (state->mode == TYPE)
  ------------------
  |  Branch (933:21): [True: 1.40k, False: 2.13k]
  ------------------
  934|  1.40k|                    state->back = -1;
  935|  3.53k|                break;
  936|  3.53k|            }
  937|  5.56k|            state->back = 0;
  938|       |
  939|       |            /* get a literal, length, or end-of-block code */
  940|  9.45k|            for (;;) {
  941|  9.45k|                here = state->lencode[BITS(state->lenbits)];
  ------------------
  |  |  114|  9.45k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  942|  9.45k|                if (here.bits <= bits)
  ------------------
  |  Branch (942:21): [True: 5.41k, False: 4.04k]
  ------------------
  943|  5.41k|                    break;
  944|  4.04k|                PULLBYTE();
  ------------------
  |  |  386|  4.04k|    do { \
  |  |  387|  4.04k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 146, False: 3.89k]
  |  |  ------------------
  |  |  388|  4.04k|        have--; \
  |  |  389|  3.89k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|  3.89k|        bits += 8; \
  |  |  391|  3.89k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 3.89k]
  |  |  ------------------
  ------------------
  945|  4.04k|            }
  946|  5.41k|            if (here.op && (here.op & 0xf0) == 0) {
  ------------------
  |  Branch (946:17): [True: 3.02k, False: 2.38k]
  |  Branch (946:28): [True: 126, False: 2.90k]
  ------------------
  947|    126|                last = here;
  948|    155|                for (;;) {
  949|    155|                    here = state->lencode[last.val + (BITS(last.bits + last.op) >> last.bits)];
  ------------------
  |  |  114|    155|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  950|    155|                    if ((unsigned)last.bits + (unsigned)here.bits <= bits)
  ------------------
  |  Branch (950:25): [True: 122, False: 33]
  ------------------
  951|    122|                        break;
  952|     33|                    PULLBYTE();
  ------------------
  |  |  386|     33|    do { \
  |  |  387|     33|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 4, False: 29]
  |  |  ------------------
  |  |  388|     33|        have--; \
  |  |  389|     29|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|     29|        bits += 8; \
  |  |  391|     29|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 29]
  |  |  ------------------
  ------------------
  953|     33|                }
  954|    122|                DROPBITS(last.bits);
  ------------------
  |  |  118|    122|    do { \
  |  |  119|    122|        hold >>= (n); \
  |  |  120|    122|        bits -= (unsigned)(n); \
  |  |  121|    122|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 122]
  |  |  ------------------
  ------------------
  955|    122|                state->back += last.bits;
  956|    122|            }
  957|  5.41k|            DROPBITS(here.bits);
  ------------------
  |  |  118|  5.41k|    do { \
  |  |  119|  5.41k|        hold >>= (n); \
  |  |  120|  5.41k|        bits -= (unsigned)(n); \
  |  |  121|  5.41k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 5.41k]
  |  |  ------------------
  ------------------
  958|  5.41k|            state->back += here.bits;
  959|  5.41k|            state->length = here.val;
  960|       |
  961|       |            /* process literal */
  962|  5.41k|            if ((int)(here.op) == 0) {
  ------------------
  |  Branch (962:17): [True: 2.42k, False: 2.98k]
  ------------------
  963|  2.42k|                Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
  964|  2.42k|                        "inflate:         literal '%c'\n" :
  965|  2.42k|                        "inflate:         literal 0x%02x\n", here.val));
  966|  2.42k|                state->mode = LIT;
  967|  2.42k|                break;
  968|  2.42k|            }
  969|       |
  970|       |            /* process end of block */
  971|  2.98k|            if (here.op & 32) {
  ------------------
  |  Branch (971:17): [True: 159, False: 2.82k]
  ------------------
  972|    159|                Tracevv((stderr, "inflate:         end of block\n"));
  973|    159|                state->back = -1;
  974|    159|                state->mode = TYPE;
  975|    159|                break;
  976|    159|            }
  977|       |
  978|       |            /* invalid code */
  979|  2.82k|            if (here.op & 64) {
  ------------------
  |  Branch (979:17): [True: 2, False: 2.82k]
  ------------------
  980|      2|                SET_BAD("invalid literal/length code");
  ------------------
  |  |  132|      2|    do { \
  |  |  133|      2|        state->mode = BAD; \
  |  |  134|      2|        strm->msg = (char *)errmsg; \
  |  |  135|      2|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
  981|      2|                break;
  982|      2|            }
  983|       |
  984|       |            /* length code */
  985|  2.82k|            state->extra = (here.op & MAX_BITS);
  ------------------
  |  |   39|  2.82k|#define MAX_BITS 15
  ------------------
  986|  2.82k|            state->mode = LENEXT;
  987|  2.82k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  2.82k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  988|       |
  989|  2.82k|        case LENEXT:
  ------------------
  |  Branch (989:9): [True: 8, False: 15.6k]
  ------------------
  990|       |            /* get extra bits, if any */
  991|  2.82k|            if (state->extra) {
  ------------------
  |  Branch (991:17): [True: 714, False: 2.11k]
  ------------------
  992|    714|                NEEDBITS(state->extra);
  ------------------
  |  |  107|    714|    do { \
  |  |  108|    972|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 274, False: 698]
  |  |  ------------------
  |  |  109|    714|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|    274|    do { \
  |  |  |  |  387|    274|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 16, False: 258]
  |  |  |  |  ------------------
  |  |  |  |  388|    274|        have--; \
  |  |  |  |  389|    258|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|    258|        bits += 8; \
  |  |  |  |  391|    258|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 258]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    714|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 698]
  |  |  ------------------
  ------------------
  993|    698|                state->length += BITS(state->extra);
  ------------------
  |  |  114|    698|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  994|    698|                DROPBITS(state->extra);
  ------------------
  |  |  118|    698|    do { \
  |  |  119|    698|        hold >>= (n); \
  |  |  120|    698|        bits -= (unsigned)(n); \
  |  |  121|    698|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 698]
  |  |  ------------------
  ------------------
  995|    698|                state->back += state->extra;
  996|    698|            }
  997|  2.81k|            Tracevv((stderr, "inflate:         length %u\n", state->length));
  998|  2.81k|            state->was = state->length;
  999|  2.81k|            state->mode = DIST;
 1000|  2.81k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  2.81k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1001|       |
 1002|  2.83k|        case DIST:
  ------------------
  |  Branch (1002:9): [True: 22, False: 15.6k]
  ------------------
 1003|       |            /* get distance code */
 1004|  3.67k|            for (;;) {
 1005|  3.67k|                here = state->distcode[BITS(state->distbits)];
  ------------------
  |  |  114|  3.67k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
 1006|  3.67k|                if (here.bits <= bits)
  ------------------
  |  Branch (1006:21): [True: 2.79k, False: 886]
  ------------------
 1007|  2.79k|                    break;
 1008|    886|                PULLBYTE();
  ------------------
  |  |  386|    886|    do { \
  |  |  387|    886|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 42, False: 844]
  |  |  ------------------
  |  |  388|    886|        have--; \
  |  |  389|    844|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|    844|        bits += 8; \
  |  |  391|    844|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 844]
  |  |  ------------------
  ------------------
 1009|    886|            }
 1010|  2.79k|            if ((here.op & 0xf0) == 0) {
  ------------------
  |  Branch (1010:17): [True: 29, False: 2.76k]
  ------------------
 1011|     29|                last = here;
 1012|     35|                for (;;) {
 1013|     35|                    here = state->distcode[last.val + (BITS(last.bits + last.op) >> last.bits)];
  ------------------
  |  |  114|     35|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
 1014|     35|                    if ((unsigned)last.bits + (unsigned)here.bits <= bits)
  ------------------
  |  Branch (1014:25): [True: 27, False: 8]
  ------------------
 1015|     27|                        break;
 1016|      8|                    PULLBYTE();
  ------------------
  |  |  386|      8|    do { \
  |  |  387|      8|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 2, False: 6]
  |  |  ------------------
  |  |  388|      8|        have--; \
  |  |  389|      6|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|      6|        bits += 8; \
  |  |  391|      6|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 6]
  |  |  ------------------
  ------------------
 1017|      8|                }
 1018|     27|                DROPBITS(last.bits);
  ------------------
  |  |  118|     27|    do { \
  |  |  119|     27|        hold >>= (n); \
  |  |  120|     27|        bits -= (unsigned)(n); \
  |  |  121|     27|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 27]
  |  |  ------------------
  ------------------
 1019|     27|                state->back += last.bits;
 1020|     27|            }
 1021|  2.79k|            DROPBITS(here.bits);
  ------------------
  |  |  118|  2.79k|    do { \
  |  |  119|  2.79k|        hold >>= (n); \
  |  |  120|  2.79k|        bits -= (unsigned)(n); \
  |  |  121|  2.79k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 2.79k]
  |  |  ------------------
  ------------------
 1022|  2.79k|            state->back += here.bits;
 1023|  2.79k|            if (here.op & 64) {
  ------------------
  |  Branch (1023:17): [True: 4, False: 2.78k]
  ------------------
 1024|      4|                SET_BAD("invalid distance code");
  ------------------
  |  |  132|      4|    do { \
  |  |  133|      4|        state->mode = BAD; \
  |  |  134|      4|        strm->msg = (char *)errmsg; \
  |  |  135|      4|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 4]
  |  |  ------------------
  ------------------
 1025|      4|                break;
 1026|      4|            }
 1027|  2.78k|            state->offset = here.val;
 1028|  2.78k|            state->extra = (here.op & MAX_BITS);
  ------------------
  |  |   39|  2.78k|#define MAX_BITS 15
  ------------------
 1029|  2.78k|            state->mode = DISTEXT;
 1030|  2.78k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  2.78k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1031|       |
 1032|  2.81k|        case DISTEXT:
  ------------------
  |  Branch (1032:9): [True: 23, False: 15.6k]
  ------------------
 1033|       |            /* get distance extra bits, if any */
 1034|  2.81k|            if (state->extra) {
  ------------------
  |  Branch (1034:17): [True: 811, False: 1.99k]
  ------------------
 1035|    811|                NEEDBITS(state->extra);
  ------------------
  |  |  107|    811|    do { \
  |  |  108|  1.40k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 640, False: 765]
  |  |  ------------------
  |  |  109|    811|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|    640|    do { \
  |  |  |  |  387|    640|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 46, False: 594]
  |  |  |  |  ------------------
  |  |  |  |  388|    640|        have--; \
  |  |  |  |  389|    594|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|    594|        bits += 8; \
  |  |  |  |  391|    594|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 594]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    811|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 765]
  |  |  ------------------
  ------------------
 1036|    765|                state->offset += BITS(state->extra);
  ------------------
  |  |  114|    765|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
 1037|    765|                DROPBITS(state->extra);
  ------------------
  |  |  118|    765|    do { \
  |  |  119|    765|        hold >>= (n); \
  |  |  120|    765|        bits -= (unsigned)(n); \
  |  |  121|    765|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 765]
  |  |  ------------------
  ------------------
 1038|    765|                state->back += state->extra;
 1039|    765|            }
 1040|       |#ifdef INFLATE_STRICT
 1041|       |            if (state->offset > state->dmax) {
 1042|       |                SET_BAD("invalid distance too far back");
 1043|       |                break;
 1044|       |            }
 1045|       |#endif
 1046|  2.76k|            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
 1047|  2.76k|            state->mode = MATCH;
 1048|  2.76k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  2.76k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1049|       |
 1050|  2.87k|        case MATCH:
  ------------------
  |  Branch (1050:9): [True: 109, False: 15.5k]
  ------------------
 1051|       |            /* copy match from window to output */
 1052|  2.87k|            if (left == 0)
  ------------------
  |  Branch (1052:17): [True: 110, False: 2.76k]
  ------------------
 1053|    110|                goto inf_leave;
 1054|  2.76k|            copy = out - left;
 1055|  2.76k|            if (state->offset > copy) {         /* copy from window */
  ------------------
  |  Branch (1055:17): [True: 19, False: 2.74k]
  ------------------
 1056|     19|                copy = state->offset - copy;
 1057|     19|                if (copy > state->whave) {
  ------------------
  |  Branch (1057:21): [True: 19, False: 0]
  ------------------
 1058|       |#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
 1059|       |                    if (state->sane) {
 1060|       |                        SET_BAD("invalid distance too far back");
 1061|       |                        break;
 1062|       |                    }
 1063|       |                    Trace((stderr, "inflate.c too far\n"));
 1064|       |                    copy -= state->whave;
 1065|       |                    copy = MIN(copy, state->length);
 1066|       |                    copy = MIN(copy, left);
 1067|       |                    left -= copy;
 1068|       |                    state->length -= copy;
 1069|       |                    do {
 1070|       |                        *put++ = 0;
 1071|       |                    } while (--copy);
 1072|       |                    if (state->length == 0)
 1073|       |                        state->mode = LEN;
 1074|       |#else
 1075|     19|                    SET_BAD("invalid distance too far back");
  ------------------
  |  |  132|     19|    do { \
  |  |  133|     19|        state->mode = BAD; \
  |  |  134|     19|        strm->msg = (char *)errmsg; \
  |  |  135|     19|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 19]
  |  |  ------------------
  ------------------
 1076|     19|#endif
 1077|     19|                    break;
 1078|     19|                }
 1079|      0|                if (copy > state->wnext) {
  ------------------
  |  Branch (1079:21): [True: 0, False: 0]
  ------------------
 1080|      0|                    copy -= state->wnext;
 1081|      0|                    from = state->window + (state->wsize - copy);
 1082|      0|                } else {
 1083|      0|                    from = state->window + (state->wnext - copy);
 1084|      0|                }
 1085|      0|                copy = MIN(copy, state->length);
  ------------------
  |  |  124|      0|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1086|      0|                copy = MIN(copy, left);
  ------------------
  |  |  124|      0|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1087|       |
 1088|      0|                put = chunkcopy_safe(put, from, copy, put + left);
 1089|  2.74k|            } else {
 1090|  2.74k|                copy = MIN(state->length, left);
  ------------------
  |  |  124|  2.74k|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 54, False: 2.69k]
  |  |  ------------------
  ------------------
 1091|       |
 1092|  2.74k|                put = FUNCTABLE_CALL(chunkmemset_safe)(put, put - state->offset, copy, left);
  ------------------
  |  |   49|  2.74k|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
 1093|  2.74k|            }
 1094|  2.74k|            left -= copy;
 1095|  2.74k|            state->length -= copy;
 1096|  2.74k|            if (state->length == 0)
  ------------------
  |  Branch (1096:17): [True: 2.69k, False: 54]
  ------------------
 1097|  2.69k|                state->mode = LEN;
 1098|  2.74k|            break;
 1099|       |
 1100|  2.43k|        case LIT:
  ------------------
  |  Branch (1100:9): [True: 2.43k, False: 13.2k]
  ------------------
 1101|  2.43k|            if (left == 0)
  ------------------
  |  Branch (1101:17): [True: 4, False: 2.42k]
  ------------------
 1102|      4|                goto inf_leave;
 1103|  2.42k|            *put++ = (unsigned char)(state->length);
 1104|  2.42k|            left--;
 1105|  2.42k|            state->mode = LEN;
 1106|  2.42k|            break;
 1107|       |
 1108|    138|        case CHECK:
  ------------------
  |  Branch (1108:9): [True: 138, False: 15.5k]
  ------------------
 1109|    138|            if (state->wrap) {
  ------------------
  |  Branch (1109:17): [True: 138, False: 0]
  ------------------
 1110|    138|                NEEDBITS(32);
  ------------------
  |  |  107|    138|    do { \
  |  |  108|    658|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 530, False: 128]
  |  |  ------------------
  |  |  109|    530|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|    530|    do { \
  |  |  |  |  387|    530|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 10, False: 520]
  |  |  |  |  ------------------
  |  |  |  |  388|    530|        have--; \
  |  |  |  |  389|    520|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|    520|        bits += 8; \
  |  |  |  |  391|    520|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 520]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    138|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 128]
  |  |  ------------------
  ------------------
 1111|    128|                out -= left;
 1112|    128|                strm->total_out += out;
 1113|    128|                state->total += out;
 1114|       |
 1115|       |                /* compute crc32 checksum if not in raw mode */
 1116|    128|                if (INFLATE_NEED_CHECKSUM(strm) && state->wrap & 4) {
  ------------------
  |  |   31|    256|#  define INFLATE_NEED_CHECKSUM(strm) 1
  |  |  ------------------
  |  |  |  Branch (31:39): [True: 128, Folded]
  |  |  ------------------
  ------------------
  |  Branch (1116:52): [True: 128, False: 0]
  ------------------
 1117|    128|                    if (out) {
  ------------------
  |  Branch (1117:25): [True: 126, False: 2]
  ------------------
 1118|    126|                        inf_chksum(strm, put - out, out);
 1119|    126|                    }
 1120|    128|#ifdef GUNZIP
 1121|    128|                    if (state->flags)
  ------------------
  |  Branch (1121:25): [True: 0, False: 128]
  ------------------
 1122|      0|                        strm->adler = state->check = FUNCTABLE_CALL(crc32_fold_final)(&state->crc_fold);
  ------------------
  |  |   49|      0|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
 1123|    128|#endif
 1124|    128|                }
 1125|    128|                out = left;
 1126|    128|                if ((state->wrap & 4) && (
  ------------------
  |  Branch (1126:21): [True: 128, False: 0]
  |  Branch (1126:42): [True: 73, False: 55]
  ------------------
 1127|    128|#ifdef GUNZIP
 1128|    128|                     state->flags ? hold :
  ------------------
  |  Branch (1128:22): [True: 0, False: 128]
  ------------------
 1129|    128|#endif
 1130|    128|                     ZSWAP32((unsigned)hold)) != state->check) {
  ------------------
  |  |  170|    128|#  define ZSWAP32(q) __builtin_bswap32(q)
  ------------------
 1131|     73|                    SET_BAD("incorrect data check");
  ------------------
  |  |  132|     73|    do { \
  |  |  133|     73|        state->mode = BAD; \
  |  |  134|     73|        strm->msg = (char *)errmsg; \
  |  |  135|     73|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 73]
  |  |  ------------------
  ------------------
 1132|     73|                    break;
 1133|     73|                }
 1134|     55|                INITBITS();
  ------------------
  |  |   99|     55|    do { \
  |  |  100|     55|        hold = 0; \
  |  |  101|     55|        bits = 0; \
  |  |  102|     55|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 55]
  |  |  ------------------
  ------------------
 1135|     55|                Tracev((stderr, "inflate:   check matches trailer\n"));
 1136|     55|            }
 1137|     55|#ifdef GUNZIP
 1138|     55|            state->mode = LENGTH;
 1139|     55|            Z_FALLTHROUGH;
  ------------------
  |  |   45|     55|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1140|       |
 1141|     55|        case LENGTH:
  ------------------
  |  Branch (1141:9): [True: 0, False: 15.6k]
  ------------------
 1142|     55|            if (state->wrap && state->flags) {
  ------------------
  |  Branch (1142:17): [True: 55, False: 0]
  |  Branch (1142:32): [True: 0, False: 55]
  ------------------
 1143|      0|                NEEDBITS(32);
  ------------------
  |  |  107|      0|    do { \
  |  |  108|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|      0|    do { \
  |  |  |  |  387|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  388|      0|        have--; \
  |  |  |  |  389|      0|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|      0|        bits += 8; \
  |  |  |  |  391|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1144|      0|                if ((state->wrap & 4) && hold != (state->total & 0xffffffff)) {
  ------------------
  |  Branch (1144:21): [True: 0, False: 0]
  |  Branch (1144:42): [True: 0, False: 0]
  ------------------
 1145|      0|                    SET_BAD("incorrect length check");
  ------------------
  |  |  132|      0|    do { \
  |  |  133|      0|        state->mode = BAD; \
  |  |  134|      0|        strm->msg = (char *)errmsg; \
  |  |  135|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1146|      0|                    break;
 1147|      0|                }
 1148|      0|                INITBITS();
  ------------------
  |  |   99|      0|    do { \
  |  |  100|      0|        hold = 0; \
  |  |  101|      0|        bits = 0; \
  |  |  102|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1149|      0|                Tracev((stderr, "inflate:   length matches trailer\n"));
 1150|      0|            }
 1151|     55|#endif
 1152|     55|            state->mode = DONE;
 1153|     55|            Z_FALLTHROUGH;
  ------------------
  |  |   45|     55|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1154|       |
 1155|     55|        case DONE:
  ------------------
  |  Branch (1155:9): [True: 0, False: 15.6k]
  ------------------
 1156|       |            /* inflate stream terminated properly */
 1157|     55|            ret = Z_STREAM_END;
  ------------------
  |  |  181|     55|#define Z_STREAM_END    1
  ------------------
 1158|     55|            goto inf_leave;
 1159|       |
 1160|    349|        case BAD:
  ------------------
  |  Branch (1160:9): [True: 349, False: 15.3k]
  ------------------
 1161|    349|            ret = Z_DATA_ERROR;
  ------------------
  |  |  185|    349|#define Z_DATA_ERROR   (-3)
  ------------------
 1162|    349|            goto inf_leave;
 1163|       |
 1164|      0|        case SYNC:
  ------------------
  |  Branch (1164:9): [True: 0, False: 15.6k]
  ------------------
 1165|       |
 1166|      0|        default:                 /* can't happen, but makes compilers happy */
  ------------------
  |  Branch (1166:9): [True: 0, False: 15.6k]
  ------------------
 1167|      0|            return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1168|  15.6k|        }
 1169|       |
 1170|       |    /*
 1171|       |       Return from inflate(), updating the total counts and the check value.
 1172|       |       If there was no progress during the inflate() call, return a buffer
 1173|       |       error.  Call updatewindow() to create and/or update the window state.
 1174|       |     */
 1175|    936|  inf_leave:
 1176|    936|    RESTORE();
  ------------------
  |  |   88|    936|    do { \
  |  |   89|    936|        strm->next_out = put; \
  |  |   90|    936|        strm->avail_out = left; \
  |  |   91|    936|        strm->next_in = (z_const unsigned char *)next; \
  |  |   92|    936|        strm->avail_in = have; \
  |  |   93|    936|        state->hold = hold; \
  |  |   94|    936|        state->bits = bits; \
  |  |   95|    936|    } while (0)
  |  |  ------------------
  |  |  |  Branch (95:14): [Folded, False: 936]
  |  |  ------------------
  ------------------
 1177|    936|    uint32_t check_bytes = out - strm->avail_out;
 1178|    936|    if (INFLATE_NEED_UPDATEWINDOW(strm) &&
  ------------------
  |  |   33|  1.87k|#  define INFLATE_NEED_UPDATEWINDOW(strm) 1
  |  |  ------------------
  |  |  |  Branch (33:43): [True: 936, Folded]
  |  |  ------------------
  ------------------
 1179|    936|            (state->wsize || (out != strm->avail_out && state->mode < BAD &&
  ------------------
  |  Branch (1179:14): [True: 248, False: 688]
  |  Branch (1179:31): [True: 448, False: 240]
  |  Branch (1179:57): [True: 248, False: 200]
  ------------------
 1180|    496|                 (state->mode < CHECK || flush != Z_FINISH)))) {
  ------------------
  |  |  175|      5|#define Z_FINISH        4
  ------------------
  |  Branch (1180:19): [True: 243, False: 5]
  |  Branch (1180:42): [True: 5, False: 0]
  ------------------
 1181|       |        /* update sliding window with respective checksum if not in "raw" mode */
 1182|    496|        updatewindow(strm, strm->next_out, check_bytes, state->wrap & 4);
 1183|    496|    }
 1184|    936|    in -= strm->avail_in;
 1185|    936|    out -= strm->avail_out;
 1186|    936|    strm->total_in += in;
 1187|    936|    strm->total_out += out;
 1188|    936|    state->total += out;
 1189|       |
 1190|    936|    strm->data_type = (int)state->bits + (state->last ? 64 : 0) +
  ------------------
  |  Branch (1190:43): [True: 381, False: 555]
  ------------------
 1191|    936|                      (state->mode == TYPE ? 128 : 0) + (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
  ------------------
  |  Branch (1191:24): [True: 2, False: 934]
  |  Branch (1191:58): [True: 0, False: 936]
  |  Branch (1191:81): [True: 0, False: 936]
  ------------------
 1192|    936|    if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) {
  ------------------
  |  |  175|    670|#define Z_FINISH        4
  ------------------
                  if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) {
  ------------------
  |  |  180|    266|#define Z_OK            0
  ------------------
  |  Branch (1192:11): [True: 266, False: 670]
  |  Branch (1192:22): [True: 266, False: 0]
  |  Branch (1192:35): [True: 0, False: 670]
  |  Branch (1192:57): [True: 266, False: 0]
  ------------------
 1193|       |        /* when no sliding window is used, hash the output bytes if no CHECK state */
 1194|    266|        if (INFLATE_NEED_CHECKSUM(strm) && !state->wsize && flush == Z_FINISH) {
  ------------------
  |  |   31|    532|#  define INFLATE_NEED_CHECKSUM(strm) 1
  |  |  ------------------
  |  |  |  Branch (31:39): [True: 266, Folded]
  |  |  ------------------
  ------------------
                      if (INFLATE_NEED_CHECKSUM(strm) && !state->wsize && flush == Z_FINISH) {
  ------------------
  |  |  175|     18|#define Z_FINISH        4
  ------------------
  |  Branch (1194:44): [True: 18, False: 248]
  |  Branch (1194:61): [True: 0, False: 18]
  ------------------
 1195|      0|            inf_chksum(strm, put - check_bytes, check_bytes);
 1196|      0|        }
 1197|    266|        ret = Z_BUF_ERROR;
  ------------------
  |  |  187|    266|#define Z_BUF_ERROR    (-5)
  ------------------
 1198|    266|    }
 1199|    936|    return ret;
 1200|    937|}
zng_inflateEnd:
 1202|    671|int32_t Z_EXPORT PREFIX(inflateEnd)(PREFIX3(stream) *strm) {
 1203|    671|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (1203:9): [True: 0, False: 671]
  ------------------
 1204|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1205|       |
 1206|       |    /* Free allocated buffers */
 1207|    671|    free_inflate(strm);
 1208|       |
 1209|    671|    Tracev((stderr, "inflate: end\n"));
 1210|    671|    return Z_OK;
  ------------------
  |  |  180|    671|#define Z_OK            0
  ------------------
 1211|    671|}
inflate.c:inflateStateCheck:
   51|  3.62k|static int inflateStateCheck(PREFIX3(stream) *strm) {
   52|  3.62k|    struct inflate_state *state;
   53|  3.62k|    if (strm == NULL || strm->zalloc == NULL || strm->zfree == NULL)
  ------------------
  |  Branch (53:9): [True: 0, False: 3.62k]
  |  Branch (53:25): [True: 0, False: 3.62k]
  |  Branch (53:49): [True: 0, False: 3.62k]
  ------------------
   54|      0|        return 1;
   55|  3.62k|    state = (struct inflate_state *)strm->state;
   56|  3.62k|    if (state == NULL || state->alloc_bufs == NULL || state->strm != strm || state->mode < HEAD || state->mode > SYNC)
  ------------------
  |  Branch (56:9): [True: 0, False: 3.62k]
  |  Branch (56:26): [True: 0, False: 3.62k]
  |  Branch (56:55): [True: 0, False: 3.62k]
  |  Branch (56:78): [True: 0, False: 3.62k]
  |  Branch (56:100): [True: 0, False: 3.62k]
  ------------------
   57|      0|        return 1;
   58|  3.62k|    return 0;
   59|  3.62k|}
inflate.c:inf_chksum:
   39|    185|static inline void inf_chksum(PREFIX3(stream) *strm, const uint8_t *src, uint32_t len) {
   40|    185|    struct inflate_state *state = (struct inflate_state*)strm->state;
   41|    185|#ifdef GUNZIP
   42|    185|    if (state->flags) {
  ------------------
  |  Branch (42:9): [True: 0, False: 185]
  ------------------
   43|      0|        FUNCTABLE_CALL(crc32_fold)(&state->crc_fold, src, len, 0);
  ------------------
  |  |   49|      0|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
   44|      0|    } else
   45|    185|#endif
   46|    185|    {
   47|    185|        strm->adler = state->check = FUNCTABLE_CALL(adler32)(state->check, src, len);
  ------------------
  |  |   49|    185|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
   48|    185|    }
   49|    185|}
inflate.c:updatewindow:
  324|    496|static void updatewindow(PREFIX3(stream) *strm, const uint8_t *end, uint32_t len, int32_t cksum) {
  325|    496|    struct inflate_state *state;
  326|    496|    uint32_t dist;
  327|       |
  328|    496|    state = (struct inflate_state *)strm->state;
  329|       |
  330|       |    /* if window not in use yet, initialize */
  331|    496|    if (state->wsize == 0)
  ------------------
  |  Branch (331:9): [True: 248, False: 248]
  ------------------
  332|    248|        state->wsize = 1U << state->wbits;
  333|       |
  334|       |    /* len state->wsize or less output bytes into the circular window */
  335|    496|    if (len >= state->wsize) {
  ------------------
  |  Branch (335:9): [True: 60, False: 436]
  ------------------
  336|       |        /* Only do this if the caller specifies to checksum bytes AND the platform requires
  337|       |         * it (s/390 being the primary exception to this) */
  338|     60|        if (INFLATE_NEED_CHECKSUM(strm) && cksum) {
  ------------------
  |  |   31|    120|#  define INFLATE_NEED_CHECKSUM(strm) 1
  |  |  ------------------
  |  |  |  Branch (31:39): [True: 60, Folded]
  |  |  ------------------
  ------------------
  |  Branch (338:44): [True: 60, False: 0]
  ------------------
  339|       |            /* We have to split the checksum over non-copied and copied bytes */
  340|     60|            if (len > state->wsize)
  ------------------
  |  Branch (340:17): [True: 59, False: 1]
  ------------------
  341|     59|                inf_chksum(strm, end - len, len - state->wsize);
  342|     60|            inf_chksum_cpy(strm, state->window, end - state->wsize, state->wsize);
  343|     60|        } else {
  344|      0|            memcpy(state->window, end - state->wsize, state->wsize);
  345|      0|        }
  346|       |
  347|     60|        state->wnext = 0;
  348|     60|        state->whave = state->wsize;
  349|    436|    } else {
  350|    436|        dist = state->wsize - state->wnext;
  351|       |        /* Only do this if the caller specifies to checksum bytes AND the platform requires
  352|       |         * We need to maintain the correct order here for the checksum */
  353|    436|        dist = MIN(dist, len);
  ------------------
  |  |  124|    436|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 436, False: 0]
  |  |  ------------------
  ------------------
  354|    436|        if (INFLATE_NEED_CHECKSUM(strm) && cksum) {
  ------------------
  |  |   31|    872|#  define INFLATE_NEED_CHECKSUM(strm) 1
  |  |  ------------------
  |  |  |  Branch (31:39): [True: 436, Folded]
  |  |  ------------------
  ------------------
  |  Branch (354:44): [True: 436, False: 0]
  ------------------
  355|    436|            inf_chksum_cpy(strm, state->window + state->wnext, end - len, dist);
  356|    436|        } else {
  357|      0|            memcpy(state->window + state->wnext, end - len, dist);
  358|      0|        }
  359|    436|        len -= dist;
  360|    436|        if (len) {
  ------------------
  |  Branch (360:13): [True: 0, False: 436]
  ------------------
  361|      0|            if (INFLATE_NEED_CHECKSUM(strm) && cksum) {
  ------------------
  |  |   31|      0|#  define INFLATE_NEED_CHECKSUM(strm) 1
  |  |  ------------------
  |  |  |  Branch (31:39): [True: 0, Folded]
  |  |  ------------------
  ------------------
  |  Branch (361:48): [True: 0, False: 0]
  ------------------
  362|      0|                inf_chksum_cpy(strm, state->window, end - len, len);
  363|      0|            } else {
  364|      0|                memcpy(state->window, end - len, len);
  365|      0|            }
  366|       |
  367|      0|            state->wnext = len;
  368|      0|            state->whave = state->wsize;
  369|    436|        } else {
  370|    436|            state->wnext += dist;
  371|    436|            if (state->wnext == state->wsize)
  ------------------
  |  Branch (371:17): [True: 0, False: 436]
  ------------------
  372|      0|                state->wnext = 0;
  373|    436|            if (state->whave < state->wsize)
  ------------------
  |  Branch (373:17): [True: 376, False: 60]
  ------------------
  374|    376|                state->whave += dist;
  375|    436|        }
  376|    436|    }
  377|    496|}
inflate.c:inf_chksum_cpy:
   26|    496|                           const uint8_t *src, uint32_t copy) {
   27|    496|    if (!copy) return;
  ------------------
  |  Branch (27:9): [True: 248, False: 248]
  ------------------
   28|    248|    struct inflate_state *state = (struct inflate_state*)strm->state;
   29|    248|#ifdef GUNZIP
   30|    248|    if (state->flags) {
  ------------------
  |  Branch (30:9): [True: 0, False: 248]
  ------------------
   31|      0|        FUNCTABLE_CALL(crc32_fold_copy)(&state->crc_fold, dst, src, copy);
  ------------------
  |  |   49|      0|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
   32|      0|    } else
   33|    248|#endif
   34|    248|    {
   35|    248|        strm->adler = state->check = FUNCTABLE_CALL(adler32_fold_copy)(state->check, dst, src, copy);
  ------------------
  |  |   49|    248|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
   36|    248|    }
   37|    248|}

chunkset_avx2.c:load_64_bits:
  141|   253k|static inline uint64_t load_64_bits(const unsigned char *in, unsigned bits) {
  142|   253k|    uint64_t chunk = zng_memread_8(in);
  143|       |
  144|   253k|#if BYTE_ORDER == LITTLE_ENDIAN
  145|   253k|    return chunk << bits;
  146|       |#else
  147|       |    return ZSWAP64(chunk) << bits;
  148|       |#endif
  149|   253k|}

zng_inflate_table:
   31|    683|                                code * *table, unsigned *bits, uint16_t *work) {
   32|    683|    unsigned len;               /* a code's length in bits */
   33|    683|    unsigned sym;               /* index of code symbols */
   34|    683|    unsigned min, max;          /* minimum and maximum code lengths */
   35|    683|    unsigned root;              /* number of index bits for root table */
   36|    683|    unsigned curr;              /* number of index bits for current table */
   37|    683|    unsigned drop;              /* code bits to drop for sub-table */
   38|    683|    int left;                   /* number of prefix codes available */
   39|    683|    unsigned used;              /* code entries in table used */
   40|    683|    unsigned huff;              /* Huffman code */
   41|    683|    unsigned incr;              /* for incrementing code, index */
   42|    683|    unsigned fill;              /* index for replicating entries */
   43|    683|    unsigned low;               /* low bits for current root entry */
   44|    683|    unsigned mask;              /* mask for low root bits */
   45|    683|    code here;                  /* table entry for duplication */
   46|    683|    code *next;                 /* next available space in table */
   47|    683|    const uint16_t *base;       /* base value table to use */
   48|    683|    const uint16_t *extra;      /* extra bits table to use */
   49|    683|    unsigned match;             /* use base and extra for symbol >= match */
   50|    683|    uint16_t count[MAX_BITS+1];  /* number of codes of each length */
   51|    683|    uint16_t offs[MAX_BITS+1];   /* offsets in table for each length */
   52|    683|    static const uint16_t lbase[31] = { /* Length codes 257..285 base */
   53|    683|        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
   54|    683|        35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
   55|    683|    static const uint16_t lext[31] = { /* Length codes 257..285 extra */
   56|    683|        16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
   57|    683|        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 203, 77};
   58|    683|    static const uint16_t dbase[32] = { /* Distance codes 0..29 base */
   59|    683|        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
   60|    683|        257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
   61|    683|        8193, 12289, 16385, 24577, 0, 0};
   62|    683|    static const uint16_t dext[32] = { /* Distance codes 0..29 extra */
   63|    683|        16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
   64|    683|        23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
   65|    683|        28, 28, 29, 29, 64, 64};
   66|       |
   67|       |    /*
   68|       |       Process a set of code lengths to create a canonical Huffman code.  The
   69|       |       code lengths are lens[0..codes-1].  Each length corresponds to the
   70|       |       symbols 0..codes-1.  The Huffman code is generated by first sorting the
   71|       |       symbols by length from short to long, and retaining the symbol order
   72|       |       for codes with equal lengths.  Then the code starts with all zero bits
   73|       |       for the first code of the shortest length, and the codes are integer
   74|       |       increments for the same length, and zeros are appended as the length
   75|       |       increases.  For the deflate format, these bits are stored backwards
   76|       |       from their more natural integer increment ordering, and so when the
   77|       |       decoding tables are built in the large loop below, the integer codes
   78|       |       are incremented backwards.
   79|       |
   80|       |       This routine assumes, but does not check, that all of the entries in
   81|       |       lens[] are in the range 0..MAXBITS.  The caller must assure this.
   82|       |       1..MAXBITS is interpreted as that code length.  zero means that that
   83|       |       symbol does not occur in this code.
   84|       |
   85|       |       The codes are sorted by computing a count of codes for each length,
   86|       |       creating from that a table of starting indices for each length in the
   87|       |       sorted table, and then entering the symbols in order in the sorted
   88|       |       table.  The sorted table is work[], with that space being provided by
   89|       |       the caller.
   90|       |
   91|       |       The length counts are used for other purposes as well, i.e. finding
   92|       |       the minimum and maximum length codes, determining if there are any
   93|       |       codes at all, checking for a valid set of lengths, and looking ahead
   94|       |       at length counts to determine sub-table sizes when building the
   95|       |       decoding tables.
   96|       |     */
   97|       |
   98|       |    /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
   99|  11.6k|    for (len = 0; len <= MAX_BITS; len++)
  ------------------
  |  |   39|  11.6k|#define MAX_BITS 15
  ------------------
  |  Branch (99:19): [True: 10.9k, False: 683]
  ------------------
  100|  10.9k|        count[len] = 0;
  101|  75.7k|    for (sym = 0; sym < codes; sym++)
  ------------------
  |  Branch (101:19): [True: 75.0k, False: 683]
  ------------------
  102|  75.0k|        count[lens[sym]]++;
  103|       |
  104|       |    /* bound code lengths, force root to be within code lengths */
  105|    683|    root = *bits;
  106|  5.26k|    for (max = MAX_BITS; max >= 1; max--)
  ------------------
  |  |   39|    683|#define MAX_BITS 15
  ------------------
  |  Branch (106:26): [True: 5.25k, False: 4]
  ------------------
  107|  5.25k|        if (count[max] != 0) break;
  ------------------
  |  Branch (107:13): [True: 679, False: 4.57k]
  ------------------
  108|    683|    root = MIN(root, max);
  ------------------
  |  |  124|    683|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 180, False: 503]
  |  |  ------------------
  ------------------
  109|    683|    if (UNLIKELY(max == 0)) {           /* no symbols to code at all */
  ------------------
  |  |  214|    683|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 4, False: 679]
  |  |  ------------------
  ------------------
  110|      4|        here.op = (unsigned char)64;    /* invalid code marker */
  111|      4|        here.bits = (unsigned char)1;
  112|      4|        here.val = (uint16_t)0;
  113|      4|        *(*table)++ = here;             /* make a table to force an error */
  114|      4|        *(*table)++ = here;
  115|      4|        *bits = 1;
  116|      4|        return 0;     /* no symbols, but wait for decoding to report error */
  117|      4|    }
  118|  1.13k|    for (min = 1; min < max; min++)
  ------------------
  |  Branch (118:19): [True: 1.10k, False: 27]
  ------------------
  119|  1.10k|        if (count[min] != 0) break;
  ------------------
  |  Branch (119:13): [True: 652, False: 451]
  ------------------
  120|    679|    root = MAX(root, min);
  ------------------
  |  |  126|    679|#define MAX(a, b) ((a) < (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (126:20): [True: 2, False: 677]
  |  |  ------------------
  ------------------
  121|       |
  122|       |    /* check for an over-subscribed or incomplete set of lengths */
  123|    679|    left = 1;
  124|  10.0k|    for (len = 1; len <= MAX_BITS; len++) {
  ------------------
  |  |   39|  10.0k|#define MAX_BITS 15
  ------------------
  |  Branch (124:19): [True: 9.41k, False: 585]
  ------------------
  125|  9.41k|        left <<= 1;
  126|  9.41k|        left -= count[len];
  127|  9.41k|        if (left < 0) return -1;        /* over-subscribed */
  ------------------
  |  Branch (127:13): [True: 94, False: 9.32k]
  ------------------
  128|  9.41k|    }
  129|    585|    if (left > 0 && (type == CODES || max != 1))
  ------------------
  |  Branch (129:9): [True: 35, False: 550]
  |  Branch (129:22): [True: 4, False: 31]
  |  Branch (129:39): [True: 30, False: 1]
  ------------------
  130|     34|        return -1;                      /* incomplete set */
  131|       |
  132|       |    /* generate offsets into symbol table for each length for sorting */
  133|    551|    offs[1] = 0;
  134|  8.26k|    for (len = 1; len < MAX_BITS; len++)
  ------------------
  |  |   39|  8.26k|#define MAX_BITS 15
  ------------------
  |  Branch (134:19): [True: 7.71k, False: 551]
  ------------------
  135|  7.71k|        offs[len + 1] = offs[len] + count[len];
  136|       |
  137|       |    /* sort symbols by length, by symbol order within each length */
  138|  51.2k|    for (sym = 0; sym < codes; sym++)
  ------------------
  |  Branch (138:19): [True: 50.6k, False: 551]
  ------------------
  139|  50.6k|        if (lens[sym] != 0) work[offs[lens[sym]]++] = (uint16_t)sym;
  ------------------
  |  Branch (139:13): [True: 43.4k, False: 7.21k]
  ------------------
  140|       |
  141|       |    /*
  142|       |       Create and fill in decoding tables.  In this loop, the table being
  143|       |       filled is at next and has curr index bits.  The code being used is huff
  144|       |       with length len.  That code is converted to an index by dropping drop
  145|       |       bits off of the bottom.  For codes where len is less than drop + curr,
  146|       |       those top drop + curr - len bits are incremented through all values to
  147|       |       fill the table with replicated entries.
  148|       |
  149|       |       root is the number of index bits for the root table.  When len exceeds
  150|       |       root, sub-tables are created pointed to by the root entry with an index
  151|       |       of the low root bits of huff.  This is saved in low to check for when a
  152|       |       new sub-table should be started.  drop is zero when the root table is
  153|       |       being filled, and drop is root when sub-tables are being filled.
  154|       |
  155|       |       When a new sub-table is needed, it is necessary to look ahead in the
  156|       |       code lengths to determine what size sub-table is needed.  The length
  157|       |       counts are used for this, and so count[] is decremented as codes are
  158|       |       entered in the tables.
  159|       |
  160|       |       used keeps track of how many table entries have been allocated from the
  161|       |       provided *table space.  It is checked for LENS and DIST tables against
  162|       |       the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
  163|       |       the initial root table size constants.  See the comments in inftrees.h
  164|       |       for more information.
  165|       |
  166|       |       sym increments through all symbols, and the loop terminates when
  167|       |       all codes of length max, i.e. all codes, have been processed.  This
  168|       |       routine permits incomplete codes, so another loop after this one fills
  169|       |       in the rest of the decoding tables with invalid code markers.
  170|       |     */
  171|       |
  172|       |    /* set up for code type */
  173|    551|    switch (type) {
  174|    279|    case CODES:
  ------------------
  |  Branch (174:5): [True: 279, False: 272]
  ------------------
  175|    279|        base = extra = work;    /* dummy value--not used */
  176|    279|        match = 20;
  177|    279|        break;
  178|    146|    case LENS:
  ------------------
  |  Branch (178:5): [True: 146, False: 405]
  ------------------
  179|    146|        base = lbase;
  180|    146|        extra = lext;
  181|    146|        match = 257;
  182|    146|        break;
  183|    126|    default:    /* DISTS */
  ------------------
  |  Branch (183:5): [True: 126, False: 425]
  ------------------
  184|    126|        base = dbase;
  185|    126|        extra = dext;
  186|    126|        match = 0;
  187|    551|    }
  188|       |
  189|       |    /* initialize state for loop */
  190|    551|    huff = 0;                   /* starting code */
  191|    551|    sym = 0;                    /* starting code symbol */
  192|    551|    len = min;                  /* starting code length */
  193|    551|    next = *table;              /* current table to fill in */
  194|    551|    curr = root;                /* current table index bits */
  195|    551|    drop = 0;                   /* current bits to drop from code for index */
  196|    551|    low = (unsigned)(-1);       /* trigger new sub-table when len > root */
  197|    551|    used = 1U << root;          /* use root table entries */
  198|    551|    mask = used - 1;            /* mask for comparing low */
  199|       |
  200|       |    /* check available table space */
  201|    551|    if ((type == LENS && used > ENOUGH_LENS) ||
  ------------------
  |  |   52|    146|#define ENOUGH_LENS 1332
  ------------------
  |  Branch (201:10): [True: 146, False: 405]
  |  Branch (201:26): [True: 0, False: 146]
  ------------------
  202|    551|        (type == DISTS && used > ENOUGH_DISTS))
  ------------------
  |  |   53|    126|#define ENOUGH_DISTS 592
  ------------------
  |  Branch (202:10): [True: 126, False: 425]
  |  Branch (202:27): [True: 0, False: 126]
  ------------------
  203|      0|        return 1;
  204|       |
  205|       |    /* process all codes and make table entries */
  206|  43.4k|    for (;;) {
  207|       |        /* create table entry */
  208|  43.4k|        here.bits = (unsigned char)(len - drop);
  209|  43.4k|        if (LIKELY(work[sym] >= match)) {
  ------------------
  |  |  213|  43.4k|#  define LIKELY(x)             __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (213:33): [True: 3.19k, False: 40.2k]
  |  |  ------------------
  ------------------
  210|  3.19k|            here.op = (unsigned char)(extra[work[sym] - match]);
  211|  3.19k|            here.val = base[work[sym] - match];
  212|  40.2k|        } else if (work[sym] + 1U < match) {
  ------------------
  |  Branch (212:20): [True: 40.1k, False: 146]
  ------------------
  213|  40.1k|            here.op = (unsigned char)0;
  214|  40.1k|            here.val = work[sym];
  215|  40.1k|        } else {
  216|    146|            here.op = (unsigned char)(32 + 64);         /* end of block */
  217|    146|            here.val = 0;
  218|    146|        }
  219|       |
  220|       |        /* replicate for those indices with low len bits equal to huff */
  221|  43.4k|        incr = 1U << (len - drop);
  222|  43.4k|        fill = 1U << curr;
  223|  43.4k|        min = fill;                 /* save offset to next table */
  224|   226k|        do {
  225|   226k|            fill -= incr;
  226|   226k|            next[(huff >> drop) + fill] = here;
  227|   226k|        } while (fill != 0);
  ------------------
  |  Branch (227:18): [True: 182k, False: 43.4k]
  ------------------
  228|       |
  229|       |        /* backwards increment the len-bit code huff */
  230|  43.4k|        incr = 1U << (len - 1);
  231|  86.3k|        while (huff & incr)
  ------------------
  |  Branch (231:16): [True: 42.9k, False: 43.4k]
  ------------------
  232|  42.9k|            incr >>= 1;
  233|  43.4k|        if (incr != 0) {
  ------------------
  |  Branch (233:13): [True: 42.9k, False: 550]
  ------------------
  234|  42.9k|            huff &= incr - 1;
  235|  42.9k|            huff += incr;
  236|  42.9k|        } else {
  237|    550|            huff = 0;
  238|    550|        }
  239|       |
  240|       |        /* go to next symbol, update count, len */
  241|  43.4k|        sym++;
  242|  43.4k|        if (--(count[len]) == 0) {
  ------------------
  |  Branch (242:13): [True: 3.03k, False: 40.4k]
  ------------------
  243|  3.03k|            if (len == max)
  ------------------
  |  Branch (243:17): [True: 551, False: 2.48k]
  ------------------
  244|    551|                break;
  245|  2.48k|            len = lens[work[sym]];
  246|  2.48k|        }
  247|       |
  248|       |        /* create new sub-table if needed */
  249|  42.9k|        if (len > root && (huff & mask) != low) {
  ------------------
  |  Branch (249:13): [True: 6.72k, False: 36.1k]
  |  Branch (249:27): [True: 3.20k, False: 3.52k]
  ------------------
  250|       |            /* if first time, transition to sub-tables */
  251|  3.20k|            if (drop == 0)
  ------------------
  |  Branch (251:17): [True: 146, False: 3.05k]
  ------------------
  252|    146|                drop = root;
  253|       |
  254|       |            /* increment past last table */
  255|  3.20k|            next += min;            /* here min is 1 << curr */
  256|       |
  257|       |            /* determine length of next table */
  258|  3.20k|            curr = len - drop;
  259|  3.20k|            left = (int)(1 << curr);
  260|  3.22k|            while (curr + drop < max) {
  ------------------
  |  Branch (260:20): [True: 48, False: 3.17k]
  ------------------
  261|     48|                left -= count[curr + drop];
  262|     48|                if (left <= 0)
  ------------------
  |  Branch (262:21): [True: 31, False: 17]
  ------------------
  263|     31|                    break;
  264|     17|                curr++;
  265|     17|                left <<= 1;
  266|     17|            }
  267|       |
  268|       |            /* check for enough space */
  269|  3.20k|            used += 1U << curr;
  270|  3.20k|            if ((type == LENS && used > ENOUGH_LENS) || (type == DISTS && used > ENOUGH_DISTS))
  ------------------
  |  |   52|  3.11k|#define ENOUGH_LENS 1332
  ------------------
                          if ((type == LENS && used > ENOUGH_LENS) || (type == DISTS && used > ENOUGH_DISTS))
  ------------------
  |  |   53|     86|#define ENOUGH_DISTS 592
  ------------------
  |  Branch (270:18): [True: 3.11k, False: 86]
  |  Branch (270:34): [True: 0, False: 3.11k]
  |  Branch (270:58): [True: 86, False: 3.11k]
  |  Branch (270:75): [True: 0, False: 86]
  ------------------
  271|      0|                return 1;
  272|       |
  273|       |            /* point entry in root table to sub-table */
  274|  3.20k|            low = huff & mask;
  275|  3.20k|            (*table)[low].op = (unsigned char)curr;
  276|  3.20k|            (*table)[low].bits = (unsigned char)root;
  277|  3.20k|            (*table)[low].val = (uint16_t)(next - *table);
  278|  3.20k|        }
  279|  42.9k|    }
  280|       |
  281|       |    /* fill in remaining table entry if code is incomplete (guaranteed to have
  282|       |       at most one remaining entry, since if the code is incomplete, the
  283|       |       maximum code length that was allowed to get this far is one bit) */
  284|    551|    if (UNLIKELY(huff != 0)) {
  ------------------
  |  |  214|    551|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 1, False: 550]
  |  |  ------------------
  ------------------
  285|      1|        here.op = (unsigned char)64;            /* invalid code marker */
  286|      1|        here.bits = (unsigned char)(len - drop);
  287|      1|        here.val = (uint16_t)0;
  288|      1|        next[huff] = here;
  289|      1|    }
  290|       |
  291|       |    /* set return parameters */
  292|    551|    *table += used;
  293|    551|    *bits = root;
  294|    551|    return 0;
  295|    551|}

zng_uncompress2:
   25|    671|z_int32_t Z_EXPORT PREFIX(uncompress2)(unsigned char *dest, z_uintmax_t *destLen, const unsigned char *source, z_uintmax_t *sourceLen) {
   26|    671|    PREFIX3(stream) stream;
  ------------------
  |  |   99|    671|#  define PREFIX3(x) zng_ ## x
  ------------------
   27|    671|    int err;
   28|    671|    const unsigned int max = (unsigned int)-1;
   29|    671|    z_uintmax_t len, left;
  ------------------
  |  |  109|    671|#  define z_uintmax_t size_t
  ------------------
   30|    671|    unsigned char buf[1];    /* for detection of incomplete stream when *destLen == 0 */
   31|       |
   32|    671|    len = *sourceLen;
   33|    671|    if (*destLen) {
  ------------------
  |  Branch (33:9): [True: 671, False: 0]
  ------------------
   34|    671|        left = *destLen;
   35|    671|        *destLen = 0;
   36|    671|    } else {
   37|      0|        left = 1;
   38|      0|        dest = buf;
   39|      0|    }
   40|       |
   41|    671|    stream.next_in = (z_const unsigned char *)source;
   42|    671|    stream.avail_in = 0;
   43|    671|    stream.zalloc = NULL;
   44|    671|    stream.zfree = NULL;
   45|    671|    stream.opaque = NULL;
   46|       |
   47|    671|    err = PREFIX(inflateInit)(&stream);
  ------------------
  |  |   97|    671|#  define PREFIX(x) zng_ ## x
  ------------------
   48|    671|    if (err != Z_OK) return err;
  ------------------
  |  |  180|    671|#define Z_OK            0
  ------------------
  |  Branch (48:9): [True: 0, False: 671]
  ------------------
   49|       |
   50|    671|    stream.next_out = dest;
   51|    671|    stream.avail_out = 0;
   52|       |
   53|    937|    do {
   54|    937|        if (stream.avail_out == 0) {
  ------------------
  |  Branch (54:13): [True: 738, False: 199]
  ------------------
   55|    738|            stream.avail_out = left > (unsigned long)max ? max : (unsigned int)left;
  ------------------
  |  Branch (55:32): [True: 0, False: 738]
  ------------------
   56|    738|            left -= stream.avail_out;
   57|    738|        }
   58|    937|        if (stream.avail_in == 0) {
  ------------------
  |  Branch (58:13): [True: 870, False: 67]
  ------------------
   59|    870|            stream.avail_in = len > (unsigned long)max ? max : (unsigned int)len;
  ------------------
  |  Branch (59:31): [True: 0, False: 870]
  ------------------
   60|    870|            len -= stream.avail_in;
   61|    870|        }
   62|    937|        err = PREFIX(inflate)(&stream, Z_NO_FLUSH);
  ------------------
  |  |   97|    937|#  define PREFIX(x) zng_ ## x
  ------------------
                      err = PREFIX(inflate)(&stream, Z_NO_FLUSH);
  ------------------
  |  |  171|    937|#define Z_NO_FLUSH      0
  ------------------
   63|    937|    } while (err == Z_OK);
  ------------------
  |  |  180|    937|#define Z_OK            0
  ------------------
  |  Branch (63:14): [True: 266, False: 671]
  ------------------
   64|       |
   65|    671|    *sourceLen -= len + stream.avail_in;
   66|    671|    if (dest != buf)
  ------------------
  |  Branch (66:9): [True: 671, False: 0]
  ------------------
   67|    671|        *destLen = (z_size_t)stream.total_out;
   68|      0|    else if (stream.total_out && err == Z_BUF_ERROR)
  ------------------
  |  |  187|      0|#define Z_BUF_ERROR    (-5)
  ------------------
  |  Branch (68:14): [True: 0, False: 0]
  |  Branch (68:34): [True: 0, False: 0]
  ------------------
   69|      0|        left = 1;
   70|       |
   71|    671|    PREFIX(inflateEnd)(&stream);
  ------------------
  |  |   97|    671|#  define PREFIX(x) zng_ ## x
  ------------------
   72|    671|    return err == Z_STREAM_END ? Z_OK :
  ------------------
  |  |  181|    671|#define Z_STREAM_END    1
  ------------------
                  return err == Z_STREAM_END ? Z_OK :
  ------------------
  |  |  180|     55|#define Z_OK            0
  ------------------
  |  Branch (72:12): [True: 55, False: 616]
  ------------------
   73|    671|           err == Z_NEED_DICT ? Z_DATA_ERROR  :
  ------------------
  |  |  182|    616|#define Z_NEED_DICT     2
  ------------------
                         err == Z_NEED_DICT ? Z_DATA_ERROR  :
  ------------------
  |  |  185|      1|#define Z_DATA_ERROR   (-3)
  ------------------
  |  Branch (73:12): [True: 1, False: 615]
  ------------------
   74|    616|           err == Z_BUF_ERROR && left + stream.avail_out ? Z_DATA_ERROR :
  ------------------
  |  |  187|  1.23k|#define Z_BUF_ERROR    (-5)
  ------------------
                         err == Z_BUF_ERROR && left + stream.avail_out ? Z_DATA_ERROR :
  ------------------
  |  |  185|    199|#define Z_DATA_ERROR   (-3)
  ------------------
  |  Branch (74:12): [True: 266, False: 349]
  |  Branch (74:34): [True: 199, False: 67]
  ------------------
   75|    615|           err;
   76|    671|}
zng_uncompress:
   78|    671|z_int32_t Z_EXPORT PREFIX(uncompress)(unsigned char *dest, z_uintmax_t *destLen, const unsigned char *source, z_uintmax_t sourceLen) {
   79|    671|    return PREFIX(uncompress2)(dest, destLen, source, &sourceLen);
  ------------------
  |  |   97|    671|#  define PREFIX(x) zng_ ## x
  ------------------
   80|    671|}

chunkset_avx2.c:zng_memread_2:
   12|  2.18k|static inline uint16_t zng_memread_2(const void *ptr) {
   13|  2.18k|#if defined(HAVE_MAY_ALIAS)
   14|  2.18k|    typedef struct { uint16_t val; } __attribute__ ((__packed__, __may_alias__)) unaligned_uint16_t;
   15|  2.18k|    return ((const unaligned_uint16_t *)ptr)->val;
   16|       |#else
   17|       |    uint16_t val;
   18|       |    memcpy(&val, ptr, sizeof(val));
   19|       |    return val;
   20|       |#endif
   21|  2.18k|}
chunkset_avx2.c:zng_memread_4:
   23|  1.74k|static inline uint32_t zng_memread_4(const void *ptr) {
   24|  1.74k|#if defined(HAVE_MAY_ALIAS)
   25|  1.74k|    typedef struct { uint32_t val; } __attribute__ ((__packed__, __may_alias__)) unaligned_uint32_t;
   26|  1.74k|    return ((const unaligned_uint32_t *)ptr)->val;
   27|       |#else
   28|       |    uint32_t val;
   29|       |    memcpy(&val, ptr, sizeof(val));
   30|       |    return val;
   31|       |#endif
   32|  1.74k|}
chunkset_avx2.c:zng_memread_8:
   34|   254k|static inline uint64_t zng_memread_8(const void *ptr) {
   35|   254k|#if defined(HAVE_MAY_ALIAS)
   36|   254k|    typedef struct { uint64_t val; } __attribute__ ((__packed__, __may_alias__)) unaligned_uint64_t;
   37|   254k|    return ((const unaligned_uint64_t *)ptr)->val;
   38|       |#else
   39|       |    uint64_t val;
   40|       |    memcpy(&val, ptr, sizeof(val));
   41|       |    return val;
   42|       |#endif
   43|   254k|}

zng_zcalloc:
  105|    671|void Z_INTERNAL *PREFIX(zcalloc)(void *opaque, unsigned items, unsigned size) {
  106|    671|    Z_UNUSED(opaque);
  ------------------
  |  |  128|    671|#define Z_UNUSED(var) (void)(var)
  ------------------
  107|    671|    return zng_alloc((size_t)items * (size_t)size);
  108|    671|}
zng_zcfree:
  110|    671|void Z_INTERNAL PREFIX(zcfree)(void *opaque, void *ptr) {
  111|    671|    Z_UNUSED(opaque);
  ------------------
  |  |  128|    671|#define Z_UNUSED(var) (void)(var)
  ------------------
  112|    671|    zng_free(ptr);
  113|    671|}

zutil.c:zng_alloc:
   12|    671|static inline void *zng_alloc(size_t size) {
   13|    671|    return (void *)malloc(size);
   14|    671|}
zutil.c:zng_free:
   16|    671|static inline void zng_free(void *ptr) {
   17|    671|    free(ptr);
   18|    671|}

zstd_ddict.c:ZSTD_customMalloc:
   27|  11.4k|{
   28|  11.4k|    if (customMem.customAlloc)
  ------------------
  |  Branch (28:9): [True: 0, False: 11.4k]
  ------------------
   29|      0|        return customMem.customAlloc(customMem.opaque, size);
   30|  11.4k|    return ZSTD_malloc(size);
  ------------------
  |  |   66|  11.4k|#define ZSTD_malloc(s) malloc(s)
  ------------------
   31|  11.4k|}
zstd_ddict.c:ZSTD_customFree:
   46|  11.4k|{
   47|  11.4k|    if (ptr!=NULL) {
  ------------------
  |  Branch (47:9): [True: 11.4k, False: 0]
  ------------------
   48|  11.4k|        if (customMem.customFree)
  ------------------
  |  Branch (48:13): [True: 0, False: 11.4k]
  ------------------
   49|      0|            customMem.customFree(customMem.opaque, ptr);
   50|  11.4k|        else
   51|  11.4k|            ZSTD_free(ptr);
  ------------------
  |  |   68|  11.4k|#define ZSTD_free(p) free((p))
  ------------------
   52|  11.4k|    }
   53|  11.4k|}
zstd_decompress.c:ZSTD_customFree:
   46|  13.4k|{
   47|  13.4k|    if (ptr!=NULL) {
  ------------------
  |  Branch (47:9): [True: 6.74k, False: 6.74k]
  ------------------
   48|  6.74k|        if (customMem.customFree)
  ------------------
  |  Branch (48:13): [True: 0, False: 6.74k]
  ------------------
   49|      0|            customMem.customFree(customMem.opaque, ptr);
   50|  6.74k|        else
   51|  6.74k|            ZSTD_free(ptr);
  ------------------
  |  |   68|  6.74k|#define ZSTD_free(p) free((p))
  ------------------
   52|  6.74k|    }
   53|  13.4k|}
zstd_decompress.c:ZSTD_customMalloc:
   27|  6.74k|{
   28|  6.74k|    if (customMem.customAlloc)
  ------------------
  |  Branch (28:9): [True: 0, False: 6.74k]
  ------------------
   29|      0|        return customMem.customAlloc(customMem.opaque, size);
   30|  6.74k|    return ZSTD_malloc(size);
  ------------------
  |  |   66|  6.74k|#define ZSTD_malloc(s) malloc(s)
  ------------------
   31|  6.74k|}

zstd_decompress_block.c:ZSTD_highbit32:
  175|   424k|{
  176|   424k|    assert(val != 0);
  ------------------
  |  |   70|   424k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|   424k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|   424k|}
zstd_decompress_block.c:ZSTD_countLeadingZeros32:
   70|   424k|{
   71|   424k|    assert(val != 0);
  ------------------
  |  |   70|   424k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   72|       |#if defined(_MSC_VER)
   73|       |#  if STATIC_BMI2
   74|       |    return (unsigned)_lzcnt_u32(val);
   75|       |#  else
   76|       |    if (val != 0) {
   77|       |        unsigned long r;
   78|       |        _BitScanReverse(&r, val);
   79|       |        return (unsigned)(31 - r);
   80|       |    } else {
   81|       |        __assume(0); /* Should not reach this code path */
   82|       |    }
   83|       |#  endif
   84|       |#elif defined(__GNUC__) && (__GNUC__ >= 4)
   85|       |    return (unsigned)__builtin_clz(val);
   86|       |#elif defined(__ICCARM__)
   87|       |    return (unsigned)__builtin_clz(val);
   88|       |#else
   89|       |    return ZSTD_countLeadingZeros32_fallback(val);
   90|       |#endif
   91|   424k|}
entropy_common.c:ZSTD_countTrailingZeros32:
   29|  5.90k|{
   30|  5.90k|    assert(val != 0);
  ------------------
  |  |   70|  5.90k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   31|       |#if defined(_MSC_VER)
   32|       |#  if STATIC_BMI2
   33|       |    return (unsigned)_tzcnt_u32(val);
   34|       |#  else
   35|       |    if (val != 0) {
   36|       |        unsigned long r;
   37|       |        _BitScanForward(&r, val);
   38|       |        return (unsigned)r;
   39|       |    } else {
   40|       |        __assume(0); /* Should not reach this code path */
   41|       |    }
   42|       |#  endif
   43|       |#elif defined(__GNUC__) && (__GNUC__ >= 4)
   44|       |    return (unsigned)__builtin_ctz(val);
   45|       |#elif defined(__ICCARM__)
   46|       |    return (unsigned)__builtin_ctz(val);
   47|       |#else
   48|       |    return ZSTD_countTrailingZeros32_fallback(val);
   49|       |#endif
   50|  5.90k|}
entropy_common.c:ZSTD_highbit32:
  175|  16.6k|{
  176|  16.6k|    assert(val != 0);
  ------------------
  |  |   70|  16.6k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  16.6k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  16.6k|}
entropy_common.c:ZSTD_countLeadingZeros32:
   70|  16.6k|{
   71|  16.6k|    assert(val != 0);
  ------------------
  |  |   70|  16.6k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   72|       |#if defined(_MSC_VER)
   73|       |#  if STATIC_BMI2
   74|       |    return (unsigned)_lzcnt_u32(val);
   75|       |#  else
   76|       |    if (val != 0) {
   77|       |        unsigned long r;
   78|       |        _BitScanReverse(&r, val);
   79|       |        return (unsigned)(31 - r);
   80|       |    } else {
   81|       |        __assume(0); /* Should not reach this code path */
   82|       |    }
   83|       |#  endif
   84|       |#elif defined(__GNUC__) && (__GNUC__ >= 4)
   85|       |    return (unsigned)__builtin_clz(val);
   86|       |#elif defined(__ICCARM__)
   87|       |    return (unsigned)__builtin_clz(val);
   88|       |#else
   89|       |    return ZSTD_countLeadingZeros32_fallback(val);
   90|       |#endif
   91|  16.6k|}
fse_decompress.c:ZSTD_highbit32:
  175|  50.4k|{
  176|  50.4k|    assert(val != 0);
  ------------------
  |  |   70|  50.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  50.4k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  50.4k|}
fse_decompress.c:ZSTD_countLeadingZeros32:
   70|  50.4k|{
   71|  50.4k|    assert(val != 0);
  ------------------
  |  |   70|  50.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   72|       |#if defined(_MSC_VER)
   73|       |#  if STATIC_BMI2
   74|       |    return (unsigned)_lzcnt_u32(val);
   75|       |#  else
   76|       |    if (val != 0) {
   77|       |        unsigned long r;
   78|       |        _BitScanReverse(&r, val);
   79|       |        return (unsigned)(31 - r);
   80|       |    } else {
   81|       |        __assume(0); /* Should not reach this code path */
   82|       |    }
   83|       |#  endif
   84|       |#elif defined(__GNUC__) && (__GNUC__ >= 4)
   85|       |    return (unsigned)__builtin_clz(val);
   86|       |#elif defined(__ICCARM__)
   87|       |    return (unsigned)__builtin_clz(val);
   88|       |#else
   89|       |    return ZSTD_countLeadingZeros32_fallback(val);
   90|       |#endif
   91|  50.4k|}
huf_decompress.c:ZSTD_highbit32:
  175|  1.32k|{
  176|  1.32k|    assert(val != 0);
  ------------------
  |  |   70|  1.32k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  1.32k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  1.32k|}
huf_decompress.c:ZSTD_countLeadingZeros32:
   70|  1.32k|{
   71|  1.32k|    assert(val != 0);
  ------------------
  |  |   70|  1.32k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   72|       |#if defined(_MSC_VER)
   73|       |#  if STATIC_BMI2
   74|       |    return (unsigned)_lzcnt_u32(val);
   75|       |#  else
   76|       |    if (val != 0) {
   77|       |        unsigned long r;
   78|       |        _BitScanReverse(&r, val);
   79|       |        return (unsigned)(31 - r);
   80|       |    } else {
   81|       |        __assume(0); /* Should not reach this code path */
   82|       |    }
   83|       |#  endif
   84|       |#elif defined(__GNUC__) && (__GNUC__ >= 4)
   85|       |    return (unsigned)__builtin_clz(val);
   86|       |#elif defined(__ICCARM__)
   87|       |    return (unsigned)__builtin_clz(val);
   88|       |#else
   89|       |    return ZSTD_countLeadingZeros32_fallback(val);
   90|       |#endif
   91|  1.32k|}
huf_decompress.c:ZSTD_countTrailingZeros64:
   94|    357|{
   95|    357|    assert(val != 0);
  ------------------
  |  |   70|    357|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   96|       |#if defined(_MSC_VER) && defined(_WIN64)
   97|       |#  if STATIC_BMI2
   98|       |    return (unsigned)_tzcnt_u64(val);
   99|       |#  else
  100|       |    if (val != 0) {
  101|       |        unsigned long r;
  102|       |        _BitScanForward64(&r, val);
  103|       |        return (unsigned)r;
  104|       |    } else {
  105|       |        __assume(0); /* Should not reach this code path */
  106|       |    }
  107|       |#  endif
  108|       |#elif defined(__GNUC__) && (__GNUC__ >= 4) && defined(__LP64__)
  109|       |    return (unsigned)__builtin_ctzll(val);
  110|       |#elif defined(__ICCARM__)
  111|       |    return (unsigned)__builtin_ctzll(val);
  112|       |#else
  113|       |    {
  114|       |        U32 mostSignificantWord = (U32)(val >> 32);
  115|       |        U32 leastSignificantWord = (U32)val;
  116|       |        if (leastSignificantWord == 0) {
  117|       |            return 32 + ZSTD_countTrailingZeros32(mostSignificantWord);
  118|       |        } else {
  119|       |            return ZSTD_countTrailingZeros32(leastSignificantWord);
  120|       |        }
  121|       |    }
  122|       |#endif
  123|    357|}

zstd_decompress_block.c:BIT_initDStream:
  255|  2.11k|{
  256|  2.11k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|      3|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
                  if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   49|      3|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      3|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      3|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (256:9): [True: 3, False: 2.11k]
  ------------------
  257|       |
  258|  2.11k|    bitD->start = (const char*)srcBuffer;
  259|  2.11k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  2.11k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 2.06k, False: 50]
  ------------------
  262|  2.06k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|  2.06k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|  2.06k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|  2.06k|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 1.93k, False: 129]
  ------------------
  266|  2.06k|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|    129|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    129|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    129|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:15): [True: 129, False: 1.93k]
  ------------------
  267|  2.06k|    } else {
  268|     50|        bitD->ptr   = bitD->start;
  269|     50|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|     50|        switch(srcSize)
  271|     50|        {
  272|      5|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 5, False: 45]
  ------------------
  273|      5|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|      5|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|     10|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 5, False: 45]
  ------------------
  276|     10|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     10|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|     15|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 5, False: 45]
  ------------------
  279|     15|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     15|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|     19|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 4, False: 46]
  ------------------
  282|     19|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     19|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|     29|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 10, False: 40]
  ------------------
  285|     29|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     29|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|     36|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 7, False: 43]
  ------------------
  288|     36|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     36|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|     50|        default: break;
  ------------------
  |  Branch (290:9): [True: 14, False: 36]
  ------------------
  291|     50|        }
  292|     50|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|     50|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 43, False: 7]
  ------------------
  294|     50|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|      7|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      7|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      7|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 7, False: 43]
  ------------------
  295|     50|        }
  296|     43|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|     43|    }
  298|       |
  299|  1.98k|    return srcSize;
  300|  2.11k|}
zstd_decompress_block.c:BIT_readBits:
  363|  6.91M|{
  364|  6.91M|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|  6.91M|    BIT_skipBits(bitD, nbBits);
  366|  6.91M|    return value;
  367|  6.91M|}
zstd_decompress_block.c:BIT_lookBits:
  331|  6.91M|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|  6.91M|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|  6.91M|    return BIT_getMiddleBits(bitD->bitContainer, (sizeof(bitD->bitContainer)*8) - bitD->bitsConsumed - nbBits, nbBits);
  337|       |#else
  338|       |    /* this code path is slower on my os-x laptop */
  339|       |    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  340|       |    return ((bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> 1) >> ((regMask-nbBits) & regMask);
  341|       |#endif
  342|  6.91M|}
zstd_decompress_block.c:BIT_getMiddleBits:
  308|  6.91M|{
  309|  6.91M|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|  6.91M|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|  6.91M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  312|       |    /* x86 transform & ((1 << nbBits) - 1) to bzhi instruction, it is better
  313|       |     * than accessing memory. When bmi2 instruction is not present, we consider
  314|       |     * such cpus old (pre-Haswell, 2013) and their performance is not of that
  315|       |     * importance.
  316|       |     */
  317|  6.91M|#if defined(__x86_64__) || defined(_M_X64)
  318|  6.91M|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|  6.91M|}
zstd_decompress_block.c:BIT_skipBits:
  354|  8.38M|{
  355|  8.38M|    bitD->bitsConsumed += nbBits;
  356|  8.38M|}
zstd_decompress_block.c:BIT_reloadDStream:
  413|  2.30M|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|  2.30M|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|  2.30M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 2.11M, False: 196k]
  |  |  ------------------
  ------------------
  416|  2.11M|        static const BitContainerType zeroFilled = 0;
  417|  2.11M|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|  2.11M|        return BIT_DStream_overflow;
  420|  2.11M|    }
  421|       |
  422|   196k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   196k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|   196k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 145k, False: 51.5k]
  ------------------
  425|   145k|        return BIT_reloadDStream_internal(bitD);
  426|   145k|    }
  427|  51.5k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 25.7k, False: 25.8k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  25.7k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 25.5k, False: 219]
  ------------------
  430|    219|        return BIT_DStream_completed;
  431|  25.7k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  25.8k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  25.8k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  25.8k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 795, False: 25.0k]
  ------------------
  436|    795|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    795|            result = BIT_DStream_endOfBuffer;
  438|    795|        }
  439|  25.8k|        bitD->ptr -= nbBytes;
  440|  25.8k|        bitD->bitsConsumed -= nbBytes*8;
  441|  25.8k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  25.8k|        return result;
  443|  51.5k|    }
  444|  51.5k|}
zstd_decompress_block.c:BIT_reloadDStream_internal:
  385|   145k|{
  386|   145k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|   145k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|   145k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|   145k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   145k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|   145k|    bitD->bitsConsumed &= 7;
  390|   145k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|   145k|    return BIT_DStream_unfinished;
  392|   145k|}
zstd_decompress_block.c:BIT_readBitsFast:
  372|  1.47M|{
  373|  1.47M|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  1.47M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  1.47M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  1.47M|    BIT_skipBits(bitD, nbBits);
  376|  1.47M|    return value;
  377|  1.47M|}
zstd_decompress_block.c:BIT_lookBitsFast:
  347|  1.47M|{
  348|  1.47M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  1.47M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  1.47M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  1.47M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  1.47M|}
zstd_decompress_block.c:BIT_endOfDStream:
  450|    421|{
  451|    421|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 387, False: 34]
  |  Branch (451:49): [True: 372, False: 15]
  ------------------
  452|    421|}
fse_decompress.c:BIT_initDStream:
  255|    924|{
  256|    924|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|      6|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
                  if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   49|      6|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      6|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      6|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (256:9): [True: 6, False: 918]
  ------------------
  257|       |
  258|    918|    bitD->start = (const char*)srcBuffer;
  259|    918|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|    918|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 774, False: 144]
  ------------------
  262|    774|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|    774|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|    774|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|    774|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 744, False: 30]
  ------------------
  266|    774|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|     30|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     30|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     30|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:15): [True: 30, False: 744]
  ------------------
  267|    774|    } else {
  268|    144|        bitD->ptr   = bitD->start;
  269|    144|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|    144|        switch(srcSize)
  271|    144|        {
  272|      9|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 9, False: 135]
  ------------------
  273|      9|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|      9|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|     18|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 9, False: 135]
  ------------------
  276|     18|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     18|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|     40|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 22, False: 122]
  ------------------
  279|     40|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     40|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|     64|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 24, False: 120]
  ------------------
  282|     64|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     64|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|    108|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 44, False: 100]
  ------------------
  285|    108|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    108|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|    137|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 29, False: 115]
  ------------------
  288|    137|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    137|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|    144|        default: break;
  ------------------
  |  Branch (290:9): [True: 7, False: 137]
  ------------------
  291|    144|        }
  292|    144|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|    144|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 138, False: 6]
  ------------------
  294|    144|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|      6|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      6|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      6|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 6, False: 138]
  ------------------
  295|    144|        }
  296|    138|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|    138|    }
  298|       |
  299|    882|    return srcSize;
  300|    918|}
fse_decompress.c:BIT_readBits:
  363|  88.0k|{
  364|  88.0k|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|  88.0k|    BIT_skipBits(bitD, nbBits);
  366|  88.0k|    return value;
  367|  88.0k|}
fse_decompress.c:BIT_lookBits:
  331|  88.0k|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|  88.0k|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|  88.0k|    return BIT_getMiddleBits(bitD->bitContainer, (sizeof(bitD->bitContainer)*8) - bitD->bitsConsumed - nbBits, nbBits);
  337|       |#else
  338|       |    /* this code path is slower on my os-x laptop */
  339|       |    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  340|       |    return ((bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> 1) >> ((regMask-nbBits) & regMask);
  341|       |#endif
  342|  88.0k|}
fse_decompress.c:BIT_getMiddleBits:
  308|  88.0k|{
  309|  88.0k|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|  88.0k|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|  88.0k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  312|       |    /* x86 transform & ((1 << nbBits) - 1) to bzhi instruction, it is better
  313|       |     * than accessing memory. When bmi2 instruction is not present, we consider
  314|       |     * such cpus old (pre-Haswell, 2013) and their performance is not of that
  315|       |     * importance.
  316|       |     */
  317|  88.0k|#if defined(__x86_64__) || defined(_M_X64)
  318|  88.0k|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|  88.0k|}
fse_decompress.c:BIT_skipBits:
  354|   105k|{
  355|   105k|    bitD->bitsConsumed += nbBits;
  356|   105k|}
fse_decompress.c:BIT_reloadDStream:
  413|  52.2k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|  52.2k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|  52.2k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 872, False: 51.3k]
  |  |  ------------------
  ------------------
  416|    872|        static const BitContainerType zeroFilled = 0;
  417|    872|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|    872|        return BIT_DStream_overflow;
  420|    872|    }
  421|       |
  422|  51.3k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  51.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|  51.3k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 12.6k, False: 38.6k]
  ------------------
  425|  12.6k|        return BIT_reloadDStream_internal(bitD);
  426|  12.6k|    }
  427|  38.6k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 30.7k, False: 7.86k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  30.7k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 30.0k, False: 732]
  ------------------
  430|    732|        return BIT_DStream_completed;
  431|  30.7k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  7.86k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  7.86k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  7.86k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 89, False: 7.77k]
  ------------------
  436|     89|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|     89|            result = BIT_DStream_endOfBuffer;
  438|     89|        }
  439|  7.86k|        bitD->ptr -= nbBytes;
  440|  7.86k|        bitD->bitsConsumed -= nbBytes*8;
  441|  7.86k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  7.86k|        return result;
  443|  38.6k|    }
  444|  38.6k|}
fse_decompress.c:BIT_reloadDStream_internal:
  385|  12.6k|{
  386|  12.6k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  12.6k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  12.6k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  12.6k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  12.6k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  12.6k|    bitD->bitsConsumed &= 7;
  390|  12.6k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  12.6k|    return BIT_DStream_unfinished;
  392|  12.6k|}
fse_decompress.c:BIT_readBitsFast:
  372|  17.8k|{
  373|  17.8k|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  17.8k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  17.8k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  17.8k|    BIT_skipBits(bitD, nbBits);
  376|  17.8k|    return value;
  377|  17.8k|}
fse_decompress.c:BIT_lookBitsFast:
  347|  17.8k|{
  348|  17.8k|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  17.8k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  17.8k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  17.8k|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  17.8k|}
huf_decompress.c:BIT_initDStream:
  255|  1.01k|{
  256|  1.01k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|      9|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
                  if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   49|      9|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      9|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      9|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (256:9): [True: 9, False: 1.00k]
  ------------------
  257|       |
  258|  1.00k|    bitD->start = (const char*)srcBuffer;
  259|  1.00k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  1.00k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 821, False: 185]
  ------------------
  262|    821|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|    821|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|    821|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|    821|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 807, False: 14]
  ------------------
  266|    821|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|     14|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     14|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     14|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:15): [True: 14, False: 807]
  ------------------
  267|    821|    } else {
  268|    185|        bitD->ptr   = bitD->start;
  269|    185|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|    185|        switch(srcSize)
  271|    185|        {
  272|      9|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 9, False: 176]
  ------------------
  273|      9|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|      9|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|     29|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 20, False: 165]
  ------------------
  276|     29|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     29|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|     54|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 25, False: 160]
  ------------------
  279|     54|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     54|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|     86|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 32, False: 153]
  ------------------
  282|     86|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     86|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|    111|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 25, False: 160]
  ------------------
  285|    111|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    111|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|    140|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 29, False: 156]
  ------------------
  288|    140|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    140|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|    185|        default: break;
  ------------------
  |  Branch (290:9): [True: 45, False: 140]
  ------------------
  291|    185|        }
  292|    185|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|    185|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 169, False: 16]
  ------------------
  294|    185|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|     16|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     16|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     16|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 16, False: 169]
  ------------------
  295|    185|        }
  296|    169|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|    169|    }
  298|       |
  299|    976|    return srcSize;
  300|  1.00k|}
huf_decompress.c:BIT_reloadDStream:
  413|  51.8k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|  51.8k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|  51.8k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 68, False: 51.7k]
  |  |  ------------------
  ------------------
  416|     68|        static const BitContainerType zeroFilled = 0;
  417|     68|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|     68|        return BIT_DStream_overflow;
  420|     68|    }
  421|       |
  422|  51.7k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  51.7k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|  51.7k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 48.1k, False: 3.60k]
  ------------------
  425|  48.1k|        return BIT_reloadDStream_internal(bitD);
  426|  48.1k|    }
  427|  3.60k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 835, False: 2.77k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|    835|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 823, False: 12]
  ------------------
  430|     12|        return BIT_DStream_completed;
  431|    835|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  2.77k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  2.77k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  2.77k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 420, False: 2.35k]
  ------------------
  436|    420|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    420|            result = BIT_DStream_endOfBuffer;
  438|    420|        }
  439|  2.77k|        bitD->ptr -= nbBytes;
  440|  2.77k|        bitD->bitsConsumed -= nbBytes*8;
  441|  2.77k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  2.77k|        return result;
  443|  3.60k|    }
  444|  3.60k|}
huf_decompress.c:BIT_reloadDStream_internal:
  385|  74.7k|{
  386|  74.7k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  74.7k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  74.7k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  74.7k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  74.7k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  74.7k|    bitD->bitsConsumed &= 7;
  390|  74.7k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  74.7k|    return BIT_DStream_unfinished;
  392|  74.7k|}
huf_decompress.c:BIT_lookBitsFast:
  347|  1.08M|{
  348|  1.08M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  1.08M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  1.08M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  1.08M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  1.08M|}
huf_decompress.c:BIT_skipBits:
  354|  1.08M|{
  355|  1.08M|    bitD->bitsConsumed += nbBits;
  356|  1.08M|}
huf_decompress.c:BIT_endOfDStream:
  450|    917|{
  451|    917|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 668, False: 249]
  |  Branch (451:49): [True: 14, False: 654]
  ------------------
  452|    917|}
huf_decompress.c:BIT_reloadDStreamFast:
  401|  26.9k|{
  402|  26.9k|    if (UNLIKELY(bitD->ptr < bitD->limitPtr))
  ------------------
  |  |  188|  26.9k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 281, False: 26.6k]
  |  |  ------------------
  ------------------
  403|    281|        return BIT_DStream_overflow;
  404|  26.6k|    return BIT_reloadDStream_internal(bitD);
  405|  26.9k|}

zstd_decompress_block.c:ZSTD_maybeNullPtrAdd:
  386|  4.07k|{
  387|  4.07k|    return add > 0 ? ptr + add : ptr;
  ------------------
  |  Branch (387:12): [True: 4.07k, False: 1]
  ------------------
  388|  4.07k|}
zstd_decompress_block.c:ZSTD_wrappedPtrSub:
  374|  1.00M|{
  375|  1.00M|    return ptr - sub;
  376|  1.00M|}
zstd_decompress_block.c:ZSTD_wrappedPtrAdd:
  361|  1.00M|{
  362|  1.00M|    return ptr + add;
  363|  1.00M|}
huf_decompress.c:ZSTD_maybeNullPtrAdd:
  386|    935|{
  387|    935|    return add > 0 ? ptr + add : ptr;
  ------------------
  |  Branch (387:12): [True: 934, False: 1]
  ------------------
  388|    935|}

zstd_decompress.c:ZSTD_cpuid:
   32|  6.74k|MEM_STATIC ZSTD_cpuid_t ZSTD_cpuid(void) {
   33|  6.74k|    U32 f1c = 0;
   34|  6.74k|    U32 f1d = 0;
   35|  6.74k|    U32 f7b = 0;
   36|  6.74k|    U32 f7c = 0;
   37|       |#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86))
   38|       |#if !defined(_M_X64) || !defined(__clang__) || __clang_major__ >= 16
   39|       |    int reg[4];
   40|       |    __cpuid((int*)reg, 0);
   41|       |    {
   42|       |        int const n = reg[0];
   43|       |        if (n >= 1) {
   44|       |            __cpuid((int*)reg, 1);
   45|       |            f1c = (U32)reg[2];
   46|       |            f1d = (U32)reg[3];
   47|       |        }
   48|       |        if (n >= 7) {
   49|       |            __cpuidex((int*)reg, 7, 0);
   50|       |            f7b = (U32)reg[1];
   51|       |            f7c = (U32)reg[2];
   52|       |        }
   53|       |    }
   54|       |#else
   55|       |    /* Clang compiler has a bug (fixed in https://reviews.llvm.org/D101338) in
   56|       |     * which the `__cpuid` intrinsic does not save and restore `rbx` as it needs
   57|       |     * to due to being a reserved register. So in that case, do the `cpuid`
   58|       |     * ourselves. Clang supports inline assembly anyway.
   59|       |     */
   60|       |    U32 n;
   61|       |    __asm__(
   62|       |        "pushq %%rbx\n\t"
   63|       |        "cpuid\n\t"
   64|       |        "popq %%rbx\n\t"
   65|       |        : "=a"(n)
   66|       |        : "a"(0)
   67|       |        : "rcx", "rdx");
   68|       |    if (n >= 1) {
   69|       |      U32 f1a;
   70|       |      __asm__(
   71|       |          "pushq %%rbx\n\t"
   72|       |          "cpuid\n\t"
   73|       |          "popq %%rbx\n\t"
   74|       |          : "=a"(f1a), "=c"(f1c), "=d"(f1d)
   75|       |          : "a"(1)
   76|       |          :);
   77|       |    }
   78|       |    if (n >= 7) {
   79|       |      __asm__(
   80|       |          "pushq %%rbx\n\t"
   81|       |          "cpuid\n\t"
   82|       |          "movq %%rbx, %%rax\n\t"
   83|       |          "popq %%rbx"
   84|       |          : "=a"(f7b), "=c"(f7c)
   85|       |          : "a"(7), "c"(0)
   86|       |          : "rdx");
   87|       |    }
   88|       |#endif
   89|       |#elif defined(__i386__) && defined(__PIC__) && !defined(__clang__) && defined(__GNUC__)
   90|       |    /* The following block like the normal cpuid branch below, but gcc
   91|       |     * reserves ebx for use of its pic register so we must specially
   92|       |     * handle the save and restore to avoid clobbering the register
   93|       |     */
   94|       |    U32 n;
   95|       |    __asm__(
   96|       |        "pushl %%ebx\n\t"
   97|       |        "cpuid\n\t"
   98|       |        "popl %%ebx\n\t"
   99|       |        : "=a"(n)
  100|       |        : "a"(0)
  101|       |        : "ecx", "edx");
  102|       |    if (n >= 1) {
  103|       |      U32 f1a;
  104|       |      __asm__(
  105|       |          "pushl %%ebx\n\t"
  106|       |          "cpuid\n\t"
  107|       |          "popl %%ebx\n\t"
  108|       |          : "=a"(f1a), "=c"(f1c), "=d"(f1d)
  109|       |          : "a"(1));
  110|       |    }
  111|       |    if (n >= 7) {
  112|       |      __asm__(
  113|       |          "pushl %%ebx\n\t"
  114|       |          "cpuid\n\t"
  115|       |          "movl %%ebx, %%eax\n\t"
  116|       |          "popl %%ebx"
  117|       |          : "=a"(f7b), "=c"(f7c)
  118|       |          : "a"(7), "c"(0)
  119|       |          : "edx");
  120|       |    }
  121|       |#elif defined(__x86_64__) || defined(_M_X64) || defined(__i386__)
  122|       |    U32 n;
  123|  6.74k|    __asm__("cpuid" : "=a"(n) : "a"(0) : "ebx", "ecx", "edx");
  124|  6.74k|    if (n >= 1) {
  ------------------
  |  Branch (124:9): [True: 6.74k, False: 0]
  ------------------
  125|  6.74k|      U32 f1a;
  126|  6.74k|      __asm__("cpuid" : "=a"(f1a), "=c"(f1c), "=d"(f1d) : "a"(1) : "ebx");
  127|  6.74k|    }
  128|  6.74k|    if (n >= 7) {
  ------------------
  |  Branch (128:9): [True: 6.74k, False: 0]
  ------------------
  129|  6.74k|      U32 f7a;
  130|  6.74k|      __asm__("cpuid"
  131|  6.74k|              : "=a"(f7a), "=b"(f7b), "=c"(f7c)
  132|  6.74k|              : "a"(7), "c"(0)
  133|  6.74k|              : "edx");
  134|  6.74k|    }
  135|  6.74k|#endif
  136|  6.74k|    {
  137|  6.74k|        ZSTD_cpuid_t cpuid;
  138|  6.74k|        cpuid.f1c = f1c;
  139|  6.74k|        cpuid.f1d = f1d;
  140|  6.74k|        cpuid.f7b = f7b;
  141|  6.74k|        cpuid.f7c = f7c;
  142|  6.74k|        return cpuid;
  143|  6.74k|    }
  144|  6.74k|}
zstd_decompress.c:ZSTD_cpuid_bmi1:
  147|  6.74k|  MEM_STATIC int ZSTD_cpuid_##name(ZSTD_cpuid_t const cpuid) {                 \
  148|  6.74k|    return ((cpuid.r) & (1U << bit)) != 0;                                     \
  149|  6.74k|  }
zstd_decompress.c:ZSTD_cpuid_bmi2:
  147|  6.74k|  MEM_STATIC int ZSTD_cpuid_##name(ZSTD_cpuid_t const cpuid) {                 \
  148|  6.74k|    return ((cpuid.r) & (1U << bit)) != 0;                                     \
  149|  6.74k|  }

FSE_isError:
   31|  1.30k|unsigned FSE_isError(size_t code) { return ERR_isError(code); }
FSE_readNCount_bmi2:
  209|  4.36k|{
  210|  4.36k|#if DYNAMIC_BMI2
  211|  4.36k|    if (bmi2) {
  ------------------
  |  Branch (211:9): [True: 645, False: 3.71k]
  ------------------
  212|    645|        return FSE_readNCount_body_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  213|    645|    }
  214|  3.71k|#endif
  215|  3.71k|    (void)bmi2;
  216|  3.71k|    return FSE_readNCount_body_default(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  217|  4.36k|}
FSE_readNCount:
  222|  3.34k|{
  223|  3.34k|    return FSE_readNCount_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize, /* bmi2 */ 0);
  224|  3.34k|}
HUF_readStats_wksp:
  332|  1.07k|{
  333|  1.07k|#if DYNAMIC_BMI2
  334|  1.07k|    if (flags & HUF_flags_bmi2) {
  ------------------
  |  Branch (334:9): [True: 680, False: 394]
  ------------------
  335|    680|        return HUF_readStats_body_bmi2(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize);
  336|    680|    }
  337|    394|#endif
  338|    394|    (void)flags;
  339|    394|    return HUF_readStats_body_default(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize);
  340|  1.07k|}
entropy_common.c:FSE_readNCount_body_bmi2:
  201|    645|{
  202|    645|    return FSE_readNCount_body(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  203|    645|}
entropy_common.c:FSE_readNCount_body:
   44|  4.36k|{
   45|  4.36k|    const BYTE* const istart = (const BYTE*) headerBuffer;
   46|  4.36k|    const BYTE* const iend = istart + hbSize;
   47|  4.36k|    const BYTE* ip = istart;
   48|  4.36k|    int nbBits;
   49|  4.36k|    int remaining;
   50|  4.36k|    int threshold;
   51|  4.36k|    U32 bitStream;
   52|  4.36k|    int bitCount;
   53|  4.36k|    unsigned charnum = 0;
   54|  4.36k|    unsigned const maxSV1 = *maxSVPtr + 1;
   55|  4.36k|    int previous0 = 0;
   56|       |
   57|  4.36k|    if (hbSize < 8) {
  ------------------
  |  Branch (57:9): [True: 287, False: 4.07k]
  ------------------
   58|       |        /* This function only works when hbSize >= 8 */
   59|    287|        char buffer[8] = {0};
   60|    287|        ZSTD_memcpy(buffer, headerBuffer, hbSize);
  ------------------
  |  |   44|    287|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
   61|    287|        {   size_t const countSize = FSE_readNCount(normalizedCounter, maxSVPtr, tableLogPtr,
   62|    287|                                                    buffer, sizeof(buffer));
   63|    287|            if (FSE_isError(countSize)) return countSize;
  ------------------
  |  Branch (63:17): [True: 58, False: 229]
  ------------------
   64|    229|            if (countSize > hbSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|     54|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     54|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     54|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (64:17): [True: 54, False: 175]
  ------------------
   65|    175|            return countSize;
   66|    229|    }   }
   67|  4.07k|    assert(hbSize >= 8);
  ------------------
  |  |   70|  4.07k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   68|       |
   69|       |    /* init */
   70|  4.07k|    ZSTD_memset(normalizedCounter, 0, (*maxSVPtr+1) * sizeof(normalizedCounter[0]));   /* all symbols not present in NCount have a frequency of 0 */
  ------------------
  |  |   46|  4.07k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
   71|  4.07k|    bitStream = MEM_readLE32(ip);
   72|  4.07k|    nbBits = (bitStream & 0xF) + FSE_MIN_TABLELOG;   /* extract tableLog */
  ------------------
  |  |  616|  4.07k|#define FSE_MIN_TABLELOG 5
  ------------------
   73|  4.07k|    if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |  618|  4.07k|#define FSE_TABLELOG_ABSOLUTE_MAX 15
  ------------------
                  if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|     44|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     44|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     44|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (73:9): [True: 44, False: 4.03k]
  ------------------
   74|  4.03k|    bitStream >>= 4;
   75|  4.03k|    bitCount = 4;
   76|  4.03k|    *tableLogPtr = nbBits;
   77|  4.03k|    remaining = (1<<nbBits)+1;
   78|  4.03k|    threshold = 1<<nbBits;
   79|  4.03k|    nbBits++;
   80|       |
   81|  49.4k|    for (;;) {
   82|  49.4k|        if (previous0) {
  ------------------
  |  Branch (82:13): [True: 5.60k, False: 43.8k]
  ------------------
   83|       |            /* Count the number of repeats. Each time the
   84|       |             * 2-bit repeat code is 0b11 there is another
   85|       |             * repeat.
   86|       |             * Avoid UB by setting the high bit to 1.
   87|       |             */
   88|  5.60k|            int repeats = ZSTD_countTrailingZeros32(~bitStream | 0x80000000) >> 1;
   89|  5.90k|            while (repeats >= 12) {
  ------------------
  |  Branch (89:20): [True: 294, False: 5.60k]
  ------------------
   90|    294|                charnum += 3 * 12;
   91|    294|                if (LIKELY(ip <= iend-7)) {
  ------------------
  |  |  187|    294|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 251, False: 43]
  |  |  ------------------
  ------------------
   92|    251|                    ip += 3;
   93|    251|                } else {
   94|     43|                    bitCount -= (int)(8 * (iend - 7 - ip));
   95|     43|                    bitCount &= 31;
   96|     43|                    ip = iend - 4;
   97|     43|                }
   98|    294|                bitStream = MEM_readLE32(ip) >> bitCount;
   99|    294|                repeats = ZSTD_countTrailingZeros32(~bitStream | 0x80000000) >> 1;
  100|    294|            }
  101|  5.60k|            charnum += 3 * repeats;
  102|  5.60k|            bitStream >>= 2 * repeats;
  103|  5.60k|            bitCount += 2 * repeats;
  104|       |
  105|       |            /* Add the final repeat which isn't 0b11. */
  106|  5.60k|            assert((bitStream & 3) < 3);
  ------------------
  |  |   70|  5.60k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  107|  5.60k|            charnum += bitStream & 3;
  108|  5.60k|            bitCount += 2;
  109|       |
  110|       |            /* This is an error, but break and return an error
  111|       |             * at the end, because returning out of a loop makes
  112|       |             * it harder for the compiler to optimize.
  113|       |             */
  114|  5.60k|            if (charnum >= maxSV1) break;
  ------------------
  |  Branch (114:17): [True: 19, False: 5.58k]
  ------------------
  115|       |
  116|       |            /* We don't need to set the normalized count to 0
  117|       |             * because we already memset the whole buffer to 0.
  118|       |             */
  119|       |
  120|  5.58k|            if (LIKELY(ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  |  187|  11.1k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 4.01k, False: 1.57k]
  |  |  ------------------
  ------------------
  |  Branch (120:41): [True: 584, False: 991]
  ------------------
  121|  4.59k|                assert((bitCount >> 3) <= 3); /* For first condition to work */
  ------------------
  |  |   70|  4.59k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  122|  4.59k|                ip += bitCount>>3;
  123|  4.59k|                bitCount &= 7;
  124|  4.59k|            } else {
  125|    991|                bitCount -= (int)(8 * (iend - 4 - ip));
  126|    991|                bitCount &= 31;
  127|    991|                ip = iend - 4;
  128|    991|            }
  129|  5.58k|            bitStream = MEM_readLE32(ip) >> bitCount;
  130|  5.58k|        }
  131|  49.4k|        {
  132|  49.4k|            int const max = (2*threshold-1) - remaining;
  133|  49.4k|            int count;
  134|       |
  135|  49.4k|            if ((bitStream & (threshold-1)) < (U32)max) {
  ------------------
  |  Branch (135:17): [True: 35.3k, False: 14.1k]
  ------------------
  136|  35.3k|                count = bitStream & (threshold-1);
  137|  35.3k|                bitCount += nbBits-1;
  138|  35.3k|            } else {
  139|  14.1k|                count = bitStream & (2*threshold-1);
  140|  14.1k|                if (count >= threshold) count -= max;
  ------------------
  |  Branch (140:21): [True: 5.44k, False: 8.68k]
  ------------------
  141|  14.1k|                bitCount += nbBits;
  142|  14.1k|            }
  143|       |
  144|  49.4k|            count--;   /* extra accuracy */
  145|       |            /* When it matters (small blocks), this is a
  146|       |             * predictable branch, because we don't use -1.
  147|       |             */
  148|  49.4k|            if (count >= 0) {
  ------------------
  |  Branch (148:17): [True: 27.0k, False: 22.4k]
  ------------------
  149|  27.0k|                remaining -= count;
  150|  27.0k|            } else {
  151|  22.4k|                assert(count == -1);
  ------------------
  |  |   70|  22.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  152|  22.4k|                remaining += count;
  153|  22.4k|            }
  154|  49.4k|            normalizedCounter[charnum++] = (short)count;
  155|  49.4k|            previous0 = !count;
  156|       |
  157|  49.4k|            assert(threshold > 1);
  ------------------
  |  |   70|  49.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  158|  49.4k|            if (remaining < threshold) {
  ------------------
  |  Branch (158:17): [True: 18.1k, False: 31.3k]
  ------------------
  159|       |                /* This branch can be folded into the
  160|       |                 * threshold update condition because we
  161|       |                 * know that threshold > 1.
  162|       |                 */
  163|  18.1k|                if (remaining <= 1) break;
  ------------------
  |  Branch (163:21): [True: 3.95k, False: 14.1k]
  ------------------
  164|  14.1k|                nbBits = ZSTD_highbit32(remaining) + 1;
  165|  14.1k|                threshold = 1 << (nbBits - 1);
  166|  14.1k|            }
  167|  45.5k|            if (charnum >= maxSV1) break;
  ------------------
  |  Branch (167:17): [True: 54, False: 45.4k]
  ------------------
  168|       |
  169|  45.4k|            if (LIKELY(ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  |  187|  90.9k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 35.2k, False: 10.1k]
  |  |  ------------------
  ------------------
  |  Branch (169:41): [True: 1.52k, False: 8.65k]
  ------------------
  170|  36.8k|                ip += bitCount>>3;
  171|  36.8k|                bitCount &= 7;
  172|  36.8k|            } else {
  173|  8.65k|                bitCount -= (int)(8 * (iend - 4 - ip));
  174|  8.65k|                bitCount &= 31;
  175|  8.65k|                ip = iend - 4;
  176|  8.65k|            }
  177|  45.4k|            bitStream = MEM_readLE32(ip) >> bitCount;
  178|  45.4k|    }   }
  179|  4.03k|    if (remaining != 1) return ERROR(corruption_detected);
  ------------------
  |  |   49|     73|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     73|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     73|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (179:9): [True: 73, False: 3.95k]
  ------------------
  180|       |    /* Only possible when there are too many zeros. */
  181|  3.95k|    if (charnum > maxSV1) return ERROR(maxSymbolValue_tooSmall);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (181:9): [True: 0, False: 3.95k]
  ------------------
  182|  3.95k|    if (bitCount > 32) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (182:9): [True: 0, False: 3.95k]
  ------------------
  183|  3.95k|    *maxSVPtr = charnum-1;
  184|       |
  185|  3.95k|    ip += (bitCount+7)>>3;
  186|  3.95k|    return ip-istart;
  187|  3.95k|}
entropy_common.c:FSE_readNCount_body_default:
  193|  3.71k|{
  194|  3.71k|    return FSE_readNCount_body(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  195|  3.71k|}
entropy_common.c:HUF_readStats_body_bmi2:
  322|    680|{
  323|    680|    return HUF_readStats_body(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize, 1);
  324|    680|}
entropy_common.c:HUF_readStats_body:
  248|  1.07k|{
  249|  1.07k|    U32 weightTotal;
  250|  1.07k|    const BYTE* ip = (const BYTE*) src;
  251|  1.07k|    size_t iSize;
  252|  1.07k|    size_t oSize;
  253|       |
  254|  1.07k|    if (!srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      8|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      8|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      8|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (254:9): [True: 8, False: 1.06k]
  ------------------
  255|  1.06k|    iSize = ip[0];
  256|       |    /* ZSTD_memset(huffWeight, 0, hwSize);   *//* is not necessary, even though some analyzer complain ... */
  257|       |
  258|  1.06k|    if (iSize >= 128) {  /* special header */
  ------------------
  |  Branch (258:9): [True: 41, False: 1.02k]
  ------------------
  259|     41|        oSize = iSize - 127;
  260|     41|        iSize = ((oSize+1)/2);
  261|     41|        if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     12|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     12|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     12|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (261:13): [True: 12, False: 29]
  ------------------
  262|     29|        if (oSize >= hwSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (262:13): [True: 0, False: 29]
  ------------------
  263|     29|        ip += 1;
  264|     29|        {   U32 n;
  265|    500|            for (n=0; n<oSize; n+=2) {
  ------------------
  |  Branch (265:23): [True: 471, False: 29]
  ------------------
  266|    471|                huffWeight[n]   = ip[n/2] >> 4;
  267|    471|                huffWeight[n+1] = ip[n/2] & 15;
  268|    471|    }   }   }
  269|  1.02k|    else  {   /* header compressed with FSE (normal case) */
  270|  1.02k|        if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      8|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      8|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      8|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (270:13): [True: 8, False: 1.01k]
  ------------------
  271|       |        /* max (hwSize-1) values decoded, as last one is implied */
  272|  1.01k|        oSize = FSE_decompress_wksp_bmi2(huffWeight, hwSize-1, ip+1, iSize, 6, workSpace, wkspSize, bmi2);
  273|  1.01k|        if (FSE_isError(oSize)) return oSize;
  ------------------
  |  Branch (273:13): [True: 161, False: 856]
  ------------------
  274|  1.01k|    }
  275|       |
  276|       |    /* collect weight stats */
  277|    885|    ZSTD_memset(rankStats, 0, (HUF_TABLELOG_MAX + 1) * sizeof(U32));
  ------------------
  |  |   46|    885|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  278|    885|    weightTotal = 0;
  279|  99.3k|    {   U32 n; for (n=0; n<oSize; n++) {
  ------------------
  |  Branch (279:26): [True: 98.5k, False: 843]
  ------------------
  280|  98.5k|            if (huffWeight[n] > HUF_TABLELOG_MAX) return ERROR(corruption_detected);
  ------------------
  |  |   37|  98.5k|#define HUF_TABLELOG_MAX      12      /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */
  ------------------
                          if (huffWeight[n] > HUF_TABLELOG_MAX) return ERROR(corruption_detected);
  ------------------
  |  |   49|     42|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     42|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     42|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (280:17): [True: 42, False: 98.4k]
  ------------------
  281|  98.4k|            rankStats[huffWeight[n]]++;
  282|  98.4k|            weightTotal += (1 << huffWeight[n]) >> 1;
  283|  98.4k|    }   }
  284|    843|    if (weightTotal == 0) return ERROR(corruption_detected);
  ------------------
  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (284:9): [True: 4, False: 839]
  ------------------
  285|       |
  286|       |    /* get last non-null symbol weight (implied, total must be 2^n) */
  287|    839|    {   U32 const tableLog = ZSTD_highbit32(weightTotal) + 1;
  288|    839|        if (tableLog > HUF_TABLELOG_MAX) return ERROR(corruption_detected);
  ------------------
  |  |   37|    839|#define HUF_TABLELOG_MAX      12      /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */
  ------------------
                      if (tableLog > HUF_TABLELOG_MAX) return ERROR(corruption_detected);
  ------------------
  |  |   49|      5|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      5|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      5|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (288:13): [True: 5, False: 834]
  ------------------
  289|    834|        *tableLogPtr = tableLog;
  290|       |        /* determine last weight */
  291|    834|        {   U32 const total = 1 << tableLog;
  292|    834|            U32 const rest = total - weightTotal;
  293|    834|            U32 const verif = 1 << ZSTD_highbit32(rest);
  294|    834|            U32 const lastWeight = ZSTD_highbit32(rest) + 1;
  295|    834|            if (verif != rest) return ERROR(corruption_detected);    /* last value must be a clean power of 2 */
  ------------------
  |  |   49|     60|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     60|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     60|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (295:17): [True: 60, False: 774]
  ------------------
  296|    774|            huffWeight[oSize] = (BYTE)lastWeight;
  297|    774|            rankStats[lastWeight]++;
  298|    774|    }   }
  299|       |
  300|       |    /* check tree construction validity */
  301|    774|    if ((rankStats[1] < 2) || (rankStats[1] & 1)) return ERROR(corruption_detected);   /* by construction : at least 2 elts of rank 1, must be even */
  ------------------
  |  |   49|      7|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      7|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      7|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (301:9): [True: 7, False: 767]
  |  Branch (301:31): [True: 0, False: 767]
  ------------------
  302|       |
  303|       |    /* results */
  304|    767|    *nbSymbolsPtr = (U32)(oSize+1);
  305|    767|    return iSize+1;
  306|    774|}
entropy_common.c:HUF_readStats_body_default:
  313|    394|{
  314|    394|    return HUF_readStats_body(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize, 0);
  315|    394|}

zstd_common.c:ERR_isError:
   52|  10.5k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  10.5k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  10.5k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  10.5k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_common.c:ERR_getErrorCode:
   54|  3.74k|ERR_STATIC ERR_enum ERR_getErrorCode(size_t code) { if (!ERR_isError(code)) return (ERR_enum)0; return (ERR_enum) (0-code); }
  ------------------
  |  Branch (54:57): [True: 207, False: 3.53k]
  ------------------
zstd_ddict.c:ERR_isError:
   52|  11.8k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  11.8k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  11.8k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  11.8k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress.c:ERR_isError:
   52|  45.6k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  45.6k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  45.6k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  45.6k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress_block.c:ERR_isError:
   52|  2.31M|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  2.31M|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  2.31M|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.31M|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v05.c:ERR_isError:
   52|  48.5k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  48.5k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  48.5k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  48.5k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v06.c:ERR_isError:
   52|  37.9k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  37.9k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  37.9k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  37.9k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v07.c:ERR_isError:
   52|  94.5k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  94.5k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  94.5k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  94.5k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
entropy_common.c:ERR_isError:
   52|  1.30k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  1.30k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  1.30k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.30k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
fse_decompress.c:ERR_isError:
   52|  2.86k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  2.86k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  2.86k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.86k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
huf_decompress.c:ERR_isError:
   52|  3.60k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  3.60k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  3.60k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  3.60k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------

fse_decompress.c:FSE_initDState:
  518|  1.76k|{
  519|  1.76k|    const void* ptr = dt;
  520|  1.76k|    const FSE_DTableHeader* const DTableH = (const FSE_DTableHeader*)ptr;
  521|  1.76k|    DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);
  522|  1.76k|    BIT_reloadDStream(bitD);
  523|  1.76k|    DStatePtr->table = dt + 1;
  524|  1.76k|}
fse_decompress.c:FSE_decodeSymbolFast:
  554|  17.8k|{
  555|  17.8k|    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
  556|  17.8k|    U32 const nbBits = DInfo.nbBits;
  557|  17.8k|    BYTE const symbol = DInfo.symbol;
  558|  17.8k|    size_t const lowBits = BIT_readBitsFast(bitD, nbBits);
  559|       |
  560|  17.8k|    DStatePtr->state = DInfo.newState + lowBits;
  561|  17.8k|    return symbol;
  562|  17.8k|}
fse_decompress.c:FSE_decodeSymbol:
  541|  86.3k|{
  542|  86.3k|    FSE_decode_t const DInfo = ((const FSE_decode_t*)(DStatePtr->table))[DStatePtr->state];
  543|  86.3k|    U32 const nbBits = DInfo.nbBits;
  544|  86.3k|    BYTE const symbol = DInfo.symbol;
  545|  86.3k|    size_t const lowBits = BIT_readBits(bitD, nbBits);
  546|       |
  547|  86.3k|    DStatePtr->state = DInfo.newState + lowBits;
  548|  86.3k|    return symbol;
  549|  86.3k|}

FSE_decompress_wksp_bmi2:
  305|  1.01k|{
  306|  1.01k|#if DYNAMIC_BMI2
  307|  1.01k|    if (bmi2) {
  ------------------
  |  Branch (307:9): [True: 645, False: 372]
  ------------------
  308|    645|        return FSE_decompress_wksp_body_bmi2(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize);
  309|    645|    }
  310|    372|#endif
  311|    372|    (void)bmi2;
  312|    372|    return FSE_decompress_wksp_body_default(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize);
  313|  1.01k|}
fse_decompress.c:FSE_buildDTable_internal:
   59|    924|{
   60|    924|    void* const tdPtr = dt+1;   /* because *dt is unsigned, 32-bits aligned on 32-bits */
   61|    924|    FSE_DECODE_TYPE* const tableDecode = (FSE_DECODE_TYPE*) (tdPtr);
  ------------------
  |  |  603|    924|#define FSE_DECODE_TYPE FSE_decode_t
  ------------------
   62|    924|    U16* symbolNext = (U16*)workSpace;
   63|    924|    BYTE* spread = (BYTE*)(symbolNext + maxSymbolValue + 1);
   64|       |
   65|    924|    U32 const maxSV1 = maxSymbolValue + 1;
   66|    924|    U32 const tableSize = 1 << tableLog;
   67|    924|    U32 highThreshold = tableSize-1;
   68|       |
   69|       |    /* Sanity Checks */
   70|    924|    if (FSE_BUILD_DTABLE_WKSP_SIZE(tableLog, maxSymbolValue) > wkspSize) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  |  267|    924|#define FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) (sizeof(short) * (maxSymbolValue + 1) + (1ULL << maxTableLog) + 8)
  ------------------
                  if (FSE_BUILD_DTABLE_WKSP_SIZE(tableLog, maxSymbolValue) > wkspSize) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (70:9): [True: 0, False: 924]
  ------------------
   71|    924|    if (maxSymbolValue > FSE_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  |  595|    924|#  define FSE_MAX_SYMBOL_VALUE 255
  ------------------
                  if (maxSymbolValue > FSE_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (71:9): [True: 0, False: 924]
  ------------------
   72|    924|    if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  |  612|    924|#define FSE_MAX_TABLELOG  (FSE_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  582|    924|#  define FSE_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
                  if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (72:9): [True: 0, False: 924]
  ------------------
   73|       |
   74|       |    /* Init, lay down lowprob symbols */
   75|    924|    {   FSE_DTableHeader DTableH;
   76|    924|        DTableH.tableLog = (U16)tableLog;
   77|    924|        DTableH.fastMode = 1;
   78|    924|        {   S16 const largeLimit= (S16)(1 << (tableLog-1));
   79|    924|            U32 s;
   80|  9.63k|            for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (80:23): [True: 8.71k, False: 924]
  ------------------
   81|  8.71k|                if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (81:21): [True: 2.39k, False: 6.31k]
  ------------------
   82|  2.39k|                    tableDecode[highThreshold--].symbol = (FSE_FUNCTION_TYPE)s;
   83|  2.39k|                    symbolNext[s] = 1;
   84|  6.31k|                } else {
   85|  6.31k|                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
  ------------------
  |  Branch (85:25): [True: 648, False: 5.67k]
  ------------------
   86|  6.31k|                    symbolNext[s] = (U16)normalizedCounter[s];
   87|  6.31k|        }   }   }
   88|    924|        ZSTD_memcpy(dt, &DTableH, sizeof(DTableH));
  ------------------
  |  |   44|    924|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
   89|    924|    }
   90|       |
   91|       |    /* Spread symbols */
   92|    924|    if (highThreshold == tableSize - 1) {
  ------------------
  |  Branch (92:9): [True: 194, False: 730]
  ------------------
   93|    194|        size_t const tableMask = tableSize-1;
   94|    194|        size_t const step = FSE_TABLESTEP(tableSize);
  ------------------
  |  |  623|    194|#define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3)
  ------------------
   95|       |        /* First lay down the symbols in order.
   96|       |         * We use a uint64_t to lay down 8 bytes at a time. This reduces branch
   97|       |         * misses since small blocks generally have small table logs, so nearly
   98|       |         * all symbols have counts <= 8. We ensure we have 8 bytes at the end of
   99|       |         * our buffer to handle the over-write.
  100|       |         */
  101|    194|        {   U64 const add = 0x0101010101010101ull;
  102|    194|            size_t pos = 0;
  103|    194|            U64 sv = 0;
  104|    194|            U32 s;
  105|  1.22k|            for (s=0; s<maxSV1; ++s, sv += add) {
  ------------------
  |  Branch (105:23): [True: 1.03k, False: 194]
  ------------------
  106|  1.03k|                int i;
  107|  1.03k|                int const n = normalizedCounter[s];
  108|  1.03k|                MEM_write64(spread + pos, sv);
  109|  1.95k|                for (i = 8; i < n; i += 8) {
  ------------------
  |  Branch (109:29): [True: 925, False: 1.03k]
  ------------------
  110|    925|                    MEM_write64(spread + pos + i, sv);
  111|    925|                }
  112|  1.03k|                pos += (size_t)n;
  113|  1.03k|        }   }
  114|       |        /* Now we spread those positions across the table.
  115|       |         * The benefit of doing it in two stages is that we avoid the
  116|       |         * variable size inner loop, which caused lots of branch misses.
  117|       |         * Now we can run through all the positions without any branch misses.
  118|       |         * We unroll the loop twice, since that is what empirically worked best.
  119|       |         */
  120|    194|        {
  121|    194|            size_t position = 0;
  122|    194|            size_t s;
  123|    194|            size_t const unroll = 2;
  124|    194|            assert(tableSize % unroll == 0); /* FSE_MIN_TABLELOG is 5 */
  ------------------
  |  |   70|    194|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  125|  5.26k|            for (s = 0; s < (size_t)tableSize; s += unroll) {
  ------------------
  |  Branch (125:25): [True: 5.07k, False: 194]
  ------------------
  126|  5.07k|                size_t u;
  127|  15.2k|                for (u = 0; u < unroll; ++u) {
  ------------------
  |  Branch (127:29): [True: 10.1k, False: 5.07k]
  ------------------
  128|  10.1k|                    size_t const uPosition = (position + (u * step)) & tableMask;
  129|  10.1k|                    tableDecode[uPosition].symbol = spread[s + u];
  130|  10.1k|                }
  131|  5.07k|                position = (position + (unroll * step)) & tableMask;
  132|  5.07k|            }
  133|    194|            assert(position == 0);
  ------------------
  |  |   70|    194|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  134|    194|        }
  135|    730|    } else {
  136|    730|        U32 const tableMask = tableSize-1;
  137|    730|        U32 const step = FSE_TABLESTEP(tableSize);
  ------------------
  |  |  623|    730|#define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3)
  ------------------
  138|    730|        U32 s, position = 0;
  139|  8.40k|        for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (139:19): [True: 7.67k, False: 730]
  ------------------
  140|  7.67k|            int i;
  141|  44.7k|            for (i=0; i<normalizedCounter[s]; i++) {
  ------------------
  |  Branch (141:23): [True: 37.0k, False: 7.67k]
  ------------------
  142|  37.0k|                tableDecode[position].symbol = (FSE_FUNCTION_TYPE)s;
  143|  37.0k|                position = (position + step) & tableMask;
  144|  39.3k|                while (position > highThreshold) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  Branch (144:24): [True: 2.32k, False: 37.0k]
  ------------------
  145|  37.0k|        }   }
  146|    730|        if (position!=0) return ERROR(GENERIC);   /* position must reach all cells once, otherwise normalizedCounter is incorrect */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (146:13): [True: 0, False: 730]
  ------------------
  147|    730|    }
  148|       |
  149|       |    /* Build Decoding table */
  150|    924|    {   U32 u;
  151|  50.4k|        for (u=0; u<tableSize; u++) {
  ------------------
  |  Branch (151:19): [True: 49.5k, False: 924]
  ------------------
  152|  49.5k|            FSE_FUNCTION_TYPE const symbol = (FSE_FUNCTION_TYPE)(tableDecode[u].symbol);
  ------------------
  |  |  601|  49.5k|#define FSE_FUNCTION_TYPE BYTE
  ------------------
  153|  49.5k|            U32 const nextState = symbolNext[symbol]++;
  154|  49.5k|            tableDecode[u].nbBits = (BYTE) (tableLog - ZSTD_highbit32(nextState) );
  155|  49.5k|            tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
  156|  49.5k|    }   }
  157|       |
  158|    924|    return 0;
  159|    924|}
fse_decompress.c:FSE_decompress_wksp_body_bmi2:
  299|    645|{
  300|    645|    return FSE_decompress_wksp_body(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize, 1);
  301|    645|}
fse_decompress.c:FSE_decompress_wksp_body:
  248|  1.01k|{
  249|  1.01k|    const BYTE* const istart = (const BYTE*)cSrc;
  250|  1.01k|    const BYTE* ip = istart;
  251|  1.01k|    unsigned tableLog;
  252|  1.01k|    unsigned maxSymbolValue = FSE_MAX_SYMBOL_VALUE;
  ------------------
  |  |  595|  1.01k|#  define FSE_MAX_SYMBOL_VALUE 255
  ------------------
  253|  1.01k|    FSE_DecompressWksp* const wksp = (FSE_DecompressWksp*)workSpace;
  254|  1.01k|    size_t const dtablePos = sizeof(FSE_DecompressWksp) / sizeof(FSE_DTable);
  255|  1.01k|    FSE_DTable* const dtable = (FSE_DTable*)workSpace + dtablePos;
  256|       |
  257|  1.01k|    FSE_STATIC_ASSERT((FSE_MAX_SYMBOL_VALUE + 1) % 2 == 0);
  ------------------
  |  |   33|  1.01k|#define FSE_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)   /* use only *after* variable declarations */
  |  |  ------------------
  |  |  |  |   39|  1.01k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
  258|  1.01k|    if (wkspSize < sizeof(*wksp)) return ERROR(GENERIC);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (258:9): [True: 0, False: 1.01k]
  ------------------
  259|       |
  260|       |    /* correct offset to dtable depends on this property */
  261|  1.01k|    FSE_STATIC_ASSERT(sizeof(FSE_DecompressWksp) % sizeof(FSE_DTable) == 0);
  ------------------
  |  |   33|  1.01k|#define FSE_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)   /* use only *after* variable declarations */
  |  |  ------------------
  |  |  |  |   39|  1.01k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
  262|       |
  263|       |    /* normal FSE decoding mode */
  264|  1.01k|    {   size_t const NCountLength =
  265|  1.01k|            FSE_readNCount_bmi2(wksp->ncount, &maxSymbolValue, &tableLog, istart, cSrcSize, bmi2);
  266|  1.01k|        if (FSE_isError(NCountLength)) return NCountLength;
  ------------------
  |  |   32|  1.01k|#define FSE_isError ERR_isError
  ------------------
  |  Branch (266:13): [True: 43, False: 974]
  ------------------
  267|    974|        if (tableLog > maxLog) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|     33|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     33|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     33|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (267:13): [True: 33, False: 941]
  ------------------
  268|    941|        assert(NCountLength <= cSrcSize);
  ------------------
  |  |   70|    941|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  269|    941|        ip += NCountLength;
  270|    941|        cSrcSize -= NCountLength;
  271|    941|    }
  272|       |
  273|    941|    if (FSE_DECOMPRESS_WKSP_SIZE(tableLog, maxSymbolValue) > wkspSize) return ERROR(tableLog_tooLarge);
  ------------------
  |  |  273|    941|#define FSE_DECOMPRESS_WKSP_SIZE(maxTableLog, maxSymbolValue) (FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(unsigned))
  |  |  ------------------
  |  |  |  |  272|    941|#define FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) (FSE_DTABLE_SIZE_U32(maxTableLog) + 1 + FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) + (FSE_MAX_SYMBOL_VALUE + 1) / 2 + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  241|    941|#define FSE_DTABLE_SIZE_U32(maxTableLog)                   (1 + (1<<(maxTableLog)))
  |  |  |  |  ------------------
  |  |  |  |               #define FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) (FSE_DTABLE_SIZE_U32(maxTableLog) + 1 + FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) + (FSE_MAX_SYMBOL_VALUE + 1) / 2 + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  268|    941|#define FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) ((FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) + sizeof(unsigned) - 1) / sizeof(unsigned))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  267|    941|#define FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) (sizeof(short) * (maxSymbolValue + 1) + (1ULL << maxTableLog) + 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) (FSE_DTABLE_SIZE_U32(maxTableLog) + 1 + FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) + (FSE_MAX_SYMBOL_VALUE + 1) / 2 + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  595|    941|#  define FSE_MAX_SYMBOL_VALUE 255
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (FSE_DECOMPRESS_WKSP_SIZE(tableLog, maxSymbolValue) > wkspSize) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|     17|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     17|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     17|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (273:9): [True: 17, False: 924]
  ------------------
  274|    924|    assert(sizeof(*wksp) + FSE_DTABLE_SIZE(tableLog) <= wkspSize);
  ------------------
  |  |   70|    924|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  275|    924|    workSpace = (BYTE*)workSpace + sizeof(*wksp) + FSE_DTABLE_SIZE(tableLog);
  ------------------
  |  |  245|    924|#define FSE_DTABLE_SIZE(maxTableLog)                   (FSE_DTABLE_SIZE_U32(maxTableLog) * sizeof(FSE_DTable))
  |  |  ------------------
  |  |  |  |  241|    924|#define FSE_DTABLE_SIZE_U32(maxTableLog)                   (1 + (1<<(maxTableLog)))
  |  |  ------------------
  ------------------
  276|    924|    wkspSize -= sizeof(*wksp) + FSE_DTABLE_SIZE(tableLog);
  ------------------
  |  |  245|    924|#define FSE_DTABLE_SIZE(maxTableLog)                   (FSE_DTABLE_SIZE_U32(maxTableLog) * sizeof(FSE_DTable))
  |  |  ------------------
  |  |  |  |  241|    924|#define FSE_DTABLE_SIZE_U32(maxTableLog)                   (1 + (1<<(maxTableLog)))
  |  |  ------------------
  ------------------
  277|       |
  278|    924|    CHECK_F( FSE_buildDTable_internal(dtable, wksp->ncount, maxSymbolValue, tableLog, workSpace, wkspSize) );
  ------------------
  |  |   63|    924|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    924|    size_t const e = f;     \
  |  |  |  |   59|    924|    do {                    \
  |  |  |  |   60|    924|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 0, False: 924]
  |  |  |  |  ------------------
  |  |  |  |   61|    924|            return e;       \
  |  |  |  |   62|    924|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 924]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 924]
  |  |  ------------------
  ------------------
  279|       |
  280|    924|    {
  281|    924|        const void* ptr = dtable;
  282|    924|        const FSE_DTableHeader* DTableH = (const FSE_DTableHeader*)ptr;
  283|    924|        const U32 fastMode = DTableH->fastMode;
  284|       |
  285|       |        /* select fast mode (static) */
  286|    924|        if (fastMode) return FSE_decompress_usingDTable_generic(dst, dstCapacity, ip, cSrcSize, dtable, 1);
  ------------------
  |  Branch (286:13): [True: 277, False: 647]
  ------------------
  287|    647|        return FSE_decompress_usingDTable_generic(dst, dstCapacity, ip, cSrcSize, dtable, 0);
  288|    924|    }
  289|    924|}
fse_decompress.c:FSE_decompress_usingDTable_generic:
  177|    924|{
  178|    924|    BYTE* const ostart = (BYTE*) dst;
  179|    924|    BYTE* op = ostart;
  180|    924|    BYTE* const omax = op + maxDstSize;
  181|    924|    BYTE* const olimit = omax-3;
  182|       |
  183|    924|    BIT_DStream_t bitD;
  184|    924|    FSE_DState_t state1;
  185|    924|    FSE_DState_t state2;
  186|       |
  187|       |    /* Init */
  188|    924|    CHECK_F(BIT_initDStream(&bitD, cSrc, cSrcSize));
  ------------------
  |  |   63|    924|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    924|    size_t const e = f;     \
  |  |  |  |   59|    924|    do {                    \
  |  |  |  |   60|    924|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 42, False: 882]
  |  |  |  |  ------------------
  |  |  |  |   61|    924|            return e;       \
  |  |  |  |   62|    924|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 882]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 882]
  |  |  ------------------
  ------------------
  189|       |
  190|    882|    FSE_initDState(&state1, &bitD, dt);
  191|    882|    FSE_initDState(&state2, &bitD, dt);
  192|       |
  193|    882|    RETURN_ERROR_IF(BIT_reloadDStream(&bitD)==BIT_DStream_overflow, corruption_detected, "");
  ------------------
  |  |  114|    882|    do {                                                                       \
  |  |  115|    882|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 7, False: 875]
  |  |  ------------------
  |  |  116|      7|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      7|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      7|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      7|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      7|    do {                                           \
  |  |  |  |   99|      7|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      7|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      7|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      7|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      7|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      7|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      7|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      7|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      7|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      7|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      7|        }                                                                      \
  |  |  123|    882|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 875]
  |  |  ------------------
  ------------------
  194|       |
  195|    875|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  196|       |
  197|       |    /* 4 symbols per loop */
  198|  19.0k|    for ( ; (BIT_reloadDStream(&bitD)==BIT_DStream_unfinished) & (op<olimit) ; op+=4) {
  ------------------
  |  Branch (198:13): [True: 18.2k, False: 875]
  ------------------
  199|  18.2k|        op[0] = FSE_GETSYMBOL(&state1);
  ------------------
  |  |  195|  18.2k|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (195:33): [True: 3.01k, False: 15.1k]
  |  |  ------------------
  ------------------
  200|       |
  201|  18.2k|        if (FSE_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  |  612|  18.2k|#define FSE_MAX_TABLELOG  (FSE_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  582|  18.2k|#  define FSE_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (201:13): [Folded, False: 18.2k]
  ------------------
  202|      0|            BIT_reloadDStream(&bitD);
  203|       |
  204|  18.2k|        op[1] = FSE_GETSYMBOL(&state2);
  ------------------
  |  |  195|  18.2k|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (195:33): [True: 3.01k, False: 15.1k]
  |  |  ------------------
  ------------------
  205|       |
  206|  18.2k|        if (FSE_MAX_TABLELOG*4+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  |  612|  18.2k|#define FSE_MAX_TABLELOG  (FSE_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  582|  18.2k|#  define FSE_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (206:13): [Folded, False: 18.2k]
  ------------------
  207|      0|            { if (BIT_reloadDStream(&bitD) > BIT_DStream_unfinished) { op+=2; break; } }
  ------------------
  |  Branch (207:19): [True: 0, False: 0]
  ------------------
  208|       |
  209|  18.2k|        op[2] = FSE_GETSYMBOL(&state1);
  ------------------
  |  |  195|  18.2k|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (195:33): [True: 3.01k, False: 15.1k]
  |  |  ------------------
  ------------------
  210|       |
  211|  18.2k|        if (FSE_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  |  612|  18.2k|#define FSE_MAX_TABLELOG  (FSE_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  582|  18.2k|#  define FSE_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (211:13): [Folded, False: 18.2k]
  ------------------
  212|      0|            BIT_reloadDStream(&bitD);
  213|       |
  214|  18.2k|        op[3] = FSE_GETSYMBOL(&state2);
  ------------------
  |  |  195|  18.2k|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (195:33): [True: 3.01k, False: 15.1k]
  |  |  ------------------
  ------------------
  215|  18.2k|    }
  216|       |
  217|       |    /* tail */
  218|       |    /* note : BIT_reloadDStream(&bitD) >= FSE_DStream_partiallyFilled; Ends at exactly BIT_DStream_completed */
  219|  15.4k|    while (1) {
  ------------------
  |  Branch (219:12): [True: 15.4k, Folded]
  ------------------
  220|  15.4k|        if (op>(omax-2)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|     19|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     19|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     19|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (220:13): [True: 19, False: 15.4k]
  ------------------
  221|  15.4k|        *op++ = FSE_GETSYMBOL(&state1);
  ------------------
  |  |  195|  15.4k|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (195:33): [True: 2.83k, False: 12.6k]
  |  |  ------------------
  ------------------
  222|  15.4k|        if (BIT_reloadDStream(&bitD)==BIT_DStream_overflow) {
  ------------------
  |  Branch (222:13): [True: 459, False: 15.0k]
  ------------------
  223|    459|            *op++ = FSE_GETSYMBOL(&state2);
  ------------------
  |  |  195|    459|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (195:33): [True: 120, False: 339]
  |  |  ------------------
  ------------------
  224|    459|            break;
  225|    459|        }
  226|       |
  227|  15.0k|        if (op>(omax-2)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (227:13): [True: 0, False: 15.0k]
  ------------------
  228|  15.0k|        *op++ = FSE_GETSYMBOL(&state2);
  ------------------
  |  |  195|  15.0k|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (195:33): [True: 2.71k, False: 12.2k]
  |  |  ------------------
  ------------------
  229|  15.0k|        if (BIT_reloadDStream(&bitD)==BIT_DStream_overflow) {
  ------------------
  |  Branch (229:13): [True: 397, False: 14.6k]
  ------------------
  230|    397|            *op++ = FSE_GETSYMBOL(&state1);
  ------------------
  |  |  195|    397|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (195:33): [True: 111, False: 286]
  |  |  ------------------
  ------------------
  231|    397|            break;
  232|    397|    }   }
  233|       |
  234|    856|    assert(op >= ostart);
  ------------------
  |  |   70|    856|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  235|    856|    return (size_t)(op-ostart);
  236|    875|}
fse_decompress.c:FSE_decompress_wksp_body_default:
  293|    372|{
  294|    372|    return FSE_decompress_wksp_body(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize, 0);
  295|    372|}

zstd_ddict.c:MEM_readLE32:
  322|  5.01k|{
  323|  5.01k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 5.01k, False: 0]
  ------------------
  324|  5.01k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  5.01k|}
zstd_ddict.c:MEM_isLittleEndian:
  141|  5.01k|{
  142|  5.01k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  5.01k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|  5.01k|}
zstd_ddict.c:MEM_read32:
  183|  5.01k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE32:
  322|  28.3k|{
  323|  28.3k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 28.3k, False: 0]
  ------------------
  324|  28.3k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  28.3k|}
zstd_decompress.c:MEM_isLittleEndian:
  141|  29.5k|{
  142|  29.5k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  29.5k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|  29.5k|}
zstd_decompress.c:MEM_read32:
  183|  28.3k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE16:
  290|    564|{
  291|    564|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 564, False: 0]
  ------------------
  292|    564|        return MEM_read16(memPtr);
  293|      0|    else {
  294|      0|        const BYTE* p = (const BYTE*)memPtr;
  295|      0|        return (U16)(p[0] + (p[1]<<8));
  296|      0|    }
  297|    564|}
zstd_decompress.c:MEM_read16:
  182|    564|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress.c:MEM_readLE64:
  338|    599|{
  339|    599|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 599, False: 0]
  ------------------
  340|    599|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|    599|}
zstd_decompress.c:MEM_read64:
  184|    599|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_decompress_block.c:MEM_readLE24:
  311|  6.63k|{
  312|  6.63k|    return (U32)MEM_readLE16(memPtr) + ((U32)(((const BYTE*)memPtr)[2]) << 16);
  313|  6.63k|}
zstd_decompress_block.c:MEM_readLE32:
  322|    718|{
  323|    718|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 718, False: 0]
  ------------------
  324|    718|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|    718|}
zstd_decompress_block.c:MEM_isLittleEndian:
  141|   180k|{
  142|   180k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   180k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|   180k|}
zstd_decompress_block.c:MEM_read32:
  183|    718|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress_block.c:MEM_write64:
  189|  24.0k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
zstd_decompress_block.c:MEM_readLE16:
  290|  6.79k|{
  291|  6.79k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 6.79k, False: 0]
  ------------------
  292|  6.79k|        return MEM_read16(memPtr);
  293|      0|    else {
  294|      0|        const BYTE* p = (const BYTE*)memPtr;
  295|      0|        return (U16)(p[0] + (p[1]<<8));
  296|      0|    }
  297|  6.79k|}
zstd_decompress_block.c:MEM_read16:
  182|  6.79k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress_block.c:MEM_32bits:
  137|  10.5M|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_decompress_block.c:MEM_64bits:
  138|  2.30M|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_decompress_block.c:MEM_readLEST:
  354|   172k|{
  355|   172k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 172k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|   172k|    else
  358|   172k|        return (size_t)MEM_readLE64(memPtr);
  359|   172k|}
zstd_decompress_block.c:MEM_readLE64:
  338|   172k|{
  339|   172k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 172k, False: 0]
  ------------------
  340|   172k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|   172k|}
zstd_decompress_block.c:MEM_read64:
  184|   172k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_v05.c:MEM_readLE32:
  322|  29.7k|{
  323|  29.7k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 29.7k, False: 0]
  ------------------
  324|  29.7k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  29.7k|}
zstd_v05.c:MEM_isLittleEndian:
  141|   224k|{
  142|   224k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   224k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|   224k|}
zstd_v05.c:MEM_read32:
  183|  29.7k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_v05.c:MEM_readLEST:
  354|  41.3k|{
  355|  41.3k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 41.3k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  41.3k|    else
  358|  41.3k|        return (size_t)MEM_readLE64(memPtr);
  359|  41.3k|}
zstd_v05.c:MEM_32bits:
  137|  96.3k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_v05.c:MEM_readLE64:
  338|  41.3k|{
  339|  41.3k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 41.3k, False: 0]
  ------------------
  340|  41.3k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  41.3k|}
zstd_v05.c:MEM_read64:
  184|  41.3k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_v05.c:MEM_readLE16:
  290|    665|{
  291|    665|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 665, False: 0]
  ------------------
  292|    665|        return MEM_read16(memPtr);
  293|      0|    else {
  294|      0|        const BYTE* p = (const BYTE*)memPtr;
  295|      0|        return (U16)(p[0] + (p[1]<<8));
  296|      0|    }
  297|    665|}
zstd_v05.c:MEM_read16:
  182|    665|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_v05.c:MEM_64bits:
  138|  26.4k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_v05.c:MEM_writeLE16:
  300|   152k|{
  301|   152k|    if (MEM_isLittleEndian()) {
  ------------------
  |  Branch (301:9): [True: 152k, False: 0]
  ------------------
  302|   152k|        MEM_write16(memPtr, val);
  303|   152k|    } else {
  304|      0|        BYTE* p = (BYTE*)memPtr;
  305|      0|        p[0] = (BYTE)val;
  306|      0|        p[1] = (BYTE)(val>>8);
  307|      0|    }
  308|   152k|}
zstd_v05.c:MEM_write16:
  187|   152k|MEM_STATIC void MEM_write16(void* memPtr, U16 value) { *(unalign16*)memPtr = value; }
entropy_common.c:MEM_readLE32:
  322|  55.4k|{
  323|  55.4k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 55.4k, False: 0]
  ------------------
  324|  55.4k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  55.4k|}
entropy_common.c:MEM_isLittleEndian:
  141|  55.4k|{
  142|  55.4k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  55.4k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|  55.4k|}
entropy_common.c:MEM_read32:
  183|  55.4k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
fse_decompress.c:MEM_write64:
  189|  1.95k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
fse_decompress.c:MEM_readLEST:
  354|  21.3k|{
  355|  21.3k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 21.3k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  21.3k|    else
  358|  21.3k|        return (size_t)MEM_readLE64(memPtr);
  359|  21.3k|}
fse_decompress.c:MEM_32bits:
  137|  21.3k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
fse_decompress.c:MEM_isLittleEndian:
  141|  21.3k|{
  142|  21.3k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  21.3k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|  21.3k|}
fse_decompress.c:MEM_readLE64:
  338|  21.3k|{
  339|  21.3k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 21.3k, False: 0]
  ------------------
  340|  21.3k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  21.3k|}
fse_decompress.c:MEM_read64:
  184|  21.3k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_isLittleEndian:
  141|   260k|{
  142|   260k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   260k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|   260k|}
huf_decompress.c:MEM_write64:
  189|   171k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
huf_decompress.c:MEM_readLEST:
  354|  79.1k|{
  355|  79.1k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 79.1k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  79.1k|    else
  358|  79.1k|        return (size_t)MEM_readLE64(memPtr);
  359|  79.1k|}
huf_decompress.c:MEM_32bits:
  137|  80.1k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
huf_decompress.c:MEM_readLE64:
  338|  79.1k|{
  339|  79.1k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 79.1k, False: 0]
  ------------------
  340|  79.1k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  79.1k|}
huf_decompress.c:MEM_read64:
  184|  79.1k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_64bits:
  138|   182k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
huf_decompress.c:MEM_readLE16:
  290|  1.67k|{
  291|  1.67k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 1.67k, False: 0]
  ------------------
  292|  1.67k|        return MEM_read16(memPtr);
  293|      0|    else {
  294|      0|        const BYTE* p = (const BYTE*)memPtr;
  295|      0|        return (U16)(p[0] + (p[1]<<8));
  296|      0|    }
  297|  1.67k|}
huf_decompress.c:MEM_read16:
  182|  1.67k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }

ZSTD_XXH64_reset:
 3561|    850|{
 3562|    850|    XXH_ASSERT(statePtr != NULL);
  ------------------
  |  | 2430|    850|#    define XXH_ASSERT(c)   XXH_ASSUME(c)
  |  |  ------------------
  |  |  |  | 2707|    850|#  define XXH_ASSUME(c) __builtin_assume(c)
  |  |  ------------------
  ------------------
 3563|    850|    memset(statePtr, 0, sizeof(*statePtr));
 3564|    850|    statePtr->v[0] = seed + XXH_PRIME64_1 + XXH_PRIME64_2;
  ------------------
  |  | 3361|    850|#define XXH_PRIME64_1  0x9E3779B185EBCA87ULL  /*!< 0b1001111000110111011110011011000110000101111010111100101010000111 */
  ------------------
                  statePtr->v[0] = seed + XXH_PRIME64_1 + XXH_PRIME64_2;
  ------------------
  |  | 3362|    850|#define XXH_PRIME64_2  0xC2B2AE3D27D4EB4FULL  /*!< 0b1100001010110010101011100011110100100111110101001110101101001111 */
  ------------------
 3565|    850|    statePtr->v[1] = seed + XXH_PRIME64_2;
  ------------------
  |  | 3362|    850|#define XXH_PRIME64_2  0xC2B2AE3D27D4EB4FULL  /*!< 0b1100001010110010101011100011110100100111110101001110101101001111 */
  ------------------
 3566|    850|    statePtr->v[2] = seed + 0;
 3567|    850|    statePtr->v[3] = seed - XXH_PRIME64_1;
  ------------------
  |  | 3361|    850|#define XXH_PRIME64_1  0x9E3779B185EBCA87ULL  /*!< 0b1001111000110111011110011011000110000101111010111100101010000111 */
  ------------------
 3568|    850|    return XXH_OK;
 3569|    850|}
ZSTD_XXH64_update:
 3574|  1.08k|{
 3575|  1.08k|    if (input==NULL) {
  ------------------
  |  Branch (3575:9): [True: 0, False: 1.08k]
  ------------------
 3576|      0|        XXH_ASSERT(len == 0);
  ------------------
  |  | 2430|      0|#    define XXH_ASSERT(c)   XXH_ASSUME(c)
  |  |  ------------------
  |  |  |  | 2707|      0|#  define XXH_ASSUME(c) __builtin_assume(c)
  |  |  ------------------
  ------------------
 3577|      0|        return XXH_OK;
 3578|      0|    }
 3579|       |
 3580|  1.08k|    {   const xxh_u8* p = (const xxh_u8*)input;
 3581|  1.08k|        const xxh_u8* const bEnd = p + len;
 3582|       |
 3583|  1.08k|        state->total_len += len;
 3584|       |
 3585|  1.08k|        if (state->memsize + len < 32) {  /* fill in tmp buffer */
  ------------------
  |  Branch (3585:13): [True: 672, False: 415]
  ------------------
 3586|    672|            XXH_memcpy(((xxh_u8*)state->mem64) + state->memsize, input, len);
 3587|    672|            state->memsize += (xxh_u32)len;
 3588|    672|            return XXH_OK;
 3589|    672|        }
 3590|       |
 3591|    415|        if (state->memsize) {   /* tmp buffer is full */
  ------------------
  |  Branch (3591:13): [True: 193, False: 222]
  ------------------
 3592|    193|            XXH_memcpy(((xxh_u8*)state->mem64) + state->memsize, input, 32-state->memsize);
 3593|    193|            state->v[0] = XXH64_round(state->v[0], XXH_readLE64(state->mem64+0));
 3594|    193|            state->v[1] = XXH64_round(state->v[1], XXH_readLE64(state->mem64+1));
 3595|    193|            state->v[2] = XXH64_round(state->v[2], XXH_readLE64(state->mem64+2));
 3596|    193|            state->v[3] = XXH64_round(state->v[3], XXH_readLE64(state->mem64+3));
 3597|    193|            p += 32 - state->memsize;
 3598|    193|            state->memsize = 0;
 3599|    193|        }
 3600|       |
 3601|    415|        if (p+32 <= bEnd) {
  ------------------
  |  Branch (3601:13): [True: 374, False: 41]
  ------------------
 3602|    374|            const xxh_u8* const limit = bEnd - 32;
 3603|       |
 3604|  1.82M|            do {
 3605|  1.82M|                state->v[0] = XXH64_round(state->v[0], XXH_readLE64(p)); p+=8;
 3606|  1.82M|                state->v[1] = XXH64_round(state->v[1], XXH_readLE64(p)); p+=8;
 3607|  1.82M|                state->v[2] = XXH64_round(state->v[2], XXH_readLE64(p)); p+=8;
 3608|  1.82M|                state->v[3] = XXH64_round(state->v[3], XXH_readLE64(p)); p+=8;
 3609|  1.82M|            } while (p<=limit);
  ------------------
  |  Branch (3609:22): [True: 1.82M, False: 374]
  ------------------
 3610|       |
 3611|    374|        }
 3612|       |
 3613|    415|        if (p < bEnd) {
  ------------------
  |  Branch (3613:13): [True: 345, False: 70]
  ------------------
 3614|    345|            XXH_memcpy(state->mem64, p, (size_t)(bEnd-p));
 3615|    345|            state->memsize = (unsigned)(bEnd-p);
 3616|    345|        }
 3617|    415|    }
 3618|       |
 3619|      0|    return XXH_OK;
 3620|  1.08k|}
ZSTD_XXH64_digest:
 3625|     34|{
 3626|     34|    xxh_u64 h64;
 3627|       |
 3628|     34|    if (state->total_len >= 32) {
  ------------------
  |  Branch (3628:9): [True: 31, False: 3]
  ------------------
 3629|     31|        h64 = XXH_rotl64(state->v[0], 1) + XXH_rotl64(state->v[1], 7) + XXH_rotl64(state->v[2], 12) + XXH_rotl64(state->v[3], 18);
  ------------------
  |  | 2728|     31|#  define XXH_rotl64 __builtin_rotateleft64
  ------------------
                      h64 = XXH_rotl64(state->v[0], 1) + XXH_rotl64(state->v[1], 7) + XXH_rotl64(state->v[2], 12) + XXH_rotl64(state->v[3], 18);
  ------------------
  |  | 2728|     31|#  define XXH_rotl64 __builtin_rotateleft64
  ------------------
                      h64 = XXH_rotl64(state->v[0], 1) + XXH_rotl64(state->v[1], 7) + XXH_rotl64(state->v[2], 12) + XXH_rotl64(state->v[3], 18);
  ------------------
  |  | 2728|     31|#  define XXH_rotl64 __builtin_rotateleft64
  ------------------
                      h64 = XXH_rotl64(state->v[0], 1) + XXH_rotl64(state->v[1], 7) + XXH_rotl64(state->v[2], 12) + XXH_rotl64(state->v[3], 18);
  ------------------
  |  | 2728|     31|#  define XXH_rotl64 __builtin_rotateleft64
  ------------------
 3630|     31|        h64 = XXH64_mergeRound(h64, state->v[0]);
 3631|     31|        h64 = XXH64_mergeRound(h64, state->v[1]);
 3632|     31|        h64 = XXH64_mergeRound(h64, state->v[2]);
 3633|     31|        h64 = XXH64_mergeRound(h64, state->v[3]);
 3634|     31|    } else {
 3635|      3|        h64  = state->v[2] /*seed*/ + XXH_PRIME64_5;
  ------------------
  |  | 3365|      3|#define XXH_PRIME64_5  0x27D4EB2F165667C5ULL  /*!< 0b0010011111010100111010110010111100010110010101100110011111000101 */
  ------------------
 3636|      3|    }
 3637|       |
 3638|     34|    h64 += (xxh_u64) state->total_len;
 3639|       |
 3640|     34|    return XXH64_finalize(h64, (const xxh_u8*)state->mem64, (size_t)state->total_len, XXH_aligned);
 3641|     34|}
xxhash.c:XXH_readLE32_align:
 2813|     13|{
 2814|     13|    if (align==XXH_unaligned) {
  ------------------
  |  Branch (2814:9): [True: 0, False: 13]
  ------------------
 2815|      0|        return XXH_readLE32(ptr);
 2816|     13|    } else {
 2817|     13|        return XXH_CPU_LITTLE_ENDIAN ? *(const xxh_u32*)ptr : XXH_swap32(*(const xxh_u32*)ptr);
  ------------------
  |  | 2629|     13|#    define XXH_CPU_LITTLE_ENDIAN 1
  |  |  ------------------
  |  |  |  Branch (2629:35): [True: 13, Folded]
  |  |  ------------------
  ------------------
 2818|     13|    }
 2819|     13|}
xxhash.c:XXH_memcpy:
 2359|  1.21k|{
 2360|  1.21k|    return memcpy(dest,src,size);
 2361|  1.21k|}
xxhash.c:XXH_readLE64_align:
 3343|     37|{
 3344|     37|    if (align==XXH_unaligned)
  ------------------
  |  Branch (3344:9): [True: 0, False: 37]
  ------------------
 3345|      0|        return XXH_readLE64(ptr);
 3346|     37|    else
 3347|     37|        return XXH_CPU_LITTLE_ENDIAN ? *(const xxh_u64*)ptr : XXH_swap64(*(const xxh_u64*)ptr);
  ------------------
  |  | 2629|     37|#    define XXH_CPU_LITTLE_ENDIAN 1
  |  |  ------------------
  |  |  |  Branch (2629:35): [True: 37, Folded]
  |  |  ------------------
  ------------------
 3348|     37|}
xxhash.c:XXH64_round:
 3377|  7.30M|{
 3378|  7.30M|    acc += input * XXH_PRIME64_2;
  ------------------
  |  | 3362|  7.30M|#define XXH_PRIME64_2  0xC2B2AE3D27D4EB4FULL  /*!< 0b1100001010110010101011100011110100100111110101001110101101001111 */
  ------------------
 3379|  7.30M|    acc  = XXH_rotl64(acc, 31);
  ------------------
  |  | 2728|  7.30M|#  define XXH_rotl64 __builtin_rotateleft64
  ------------------
 3380|  7.30M|    acc *= XXH_PRIME64_1;
  ------------------
  |  | 3361|  7.30M|#define XXH_PRIME64_1  0x9E3779B185EBCA87ULL  /*!< 0b1001111000110111011110011011000110000101111010111100101010000111 */
  ------------------
 3381|       |#if (defined(__AVX512F__)) && !defined(XXH_ENABLE_AUTOVECTORIZE)
 3382|       |    /*
 3383|       |     * DISABLE AUTOVECTORIZATION:
 3384|       |     * A compiler fence is used to prevent GCC and Clang from
 3385|       |     * autovectorizing the XXH64 loop (pragmas and attributes don't work for some
 3386|       |     * reason) without globally disabling AVX512.
 3387|       |     *
 3388|       |     * Autovectorization of XXH64 tends to be detrimental,
 3389|       |     * though the exact outcome may change depending on exact cpu and compiler version.
 3390|       |     * For information, it has been reported as detrimental for Skylake-X,
 3391|       |     * but possibly beneficial for Zen4.
 3392|       |     *
 3393|       |     * The default is to disable auto-vectorization,
 3394|       |     * but you can select to enable it instead using `XXH_ENABLE_AUTOVECTORIZE` build variable.
 3395|       |     */
 3396|       |    XXH_COMPILER_GUARD(acc);
 3397|       |#endif
 3398|  7.30M|    return acc;
 3399|  7.30M|}
xxhash.c:XXH_readLE64:
 3331|  7.30M|{
 3332|  7.30M|    return XXH_CPU_LITTLE_ENDIAN ? XXH_read64(ptr) : XXH_swap64(XXH_read64(ptr));
  ------------------
  |  | 2629|  7.30M|#    define XXH_CPU_LITTLE_ENDIAN 1
  |  |  ------------------
  |  |  |  Branch (2629:35): [True: 7.30M, Folded]
  |  |  ------------------
  ------------------
 3333|  7.30M|}
xxhash.c:XXH_read64:
 3261|  7.30M|{
 3262|  7.30M|    typedef __attribute__((aligned(1))) xxh_u64 xxh_unalign64;
 3263|  7.30M|    return *((const xxh_unalign64*)ptr);
 3264|  7.30M|}
xxhash.c:XXH64_mergeRound:
 3402|    124|{
 3403|    124|    val  = XXH64_round(0, val);
 3404|    124|    acc ^= val;
 3405|    124|    acc  = acc * XXH_PRIME64_1 + XXH_PRIME64_4;
  ------------------
  |  | 3361|    124|#define XXH_PRIME64_1  0x9E3779B185EBCA87ULL  /*!< 0b1001111000110111011110011011000110000101111010111100101010000111 */
  ------------------
                  acc  = acc * XXH_PRIME64_1 + XXH_PRIME64_4;
  ------------------
  |  | 3364|    124|#define XXH_PRIME64_4  0x85EBCA77C2B2AE63ULL  /*!< 0b1000010111101011110010100111011111000010101100101010111001100011 */
  ------------------
 3406|    124|    return acc;
 3407|    124|}
xxhash.c:XXH64_finalize:
 3440|     34|{
 3441|     34|    if (ptr==NULL) XXH_ASSERT(len == 0);
  ------------------
  |  | 2430|      0|#    define XXH_ASSERT(c)   XXH_ASSUME(c)
  |  |  ------------------
  |  |  |  | 2707|      0|#  define XXH_ASSUME(c) __builtin_assume(c)
  |  |  ------------------
  ------------------
  |  Branch (3441:9): [True: 0, False: 34]
  ------------------
 3442|     34|    len &= 31;
 3443|     71|    while (len >= 8) {
  ------------------
  |  Branch (3443:12): [True: 37, False: 34]
  ------------------
 3444|     37|        xxh_u64 const k1 = XXH64_round(0, XXH_get64bits(ptr));
  ------------------
  |  | 3421|     37|#define XXH_get64bits(p) XXH_readLE64_align(p, align)
  ------------------
 3445|     37|        ptr += 8;
 3446|     37|        hash ^= k1;
 3447|     37|        hash  = XXH_rotl64(hash,27) * XXH_PRIME64_1 + XXH_PRIME64_4;
  ------------------
  |  | 2728|     37|#  define XXH_rotl64 __builtin_rotateleft64
  ------------------
                      hash  = XXH_rotl64(hash,27) * XXH_PRIME64_1 + XXH_PRIME64_4;
  ------------------
  |  | 3361|     37|#define XXH_PRIME64_1  0x9E3779B185EBCA87ULL  /*!< 0b1001111000110111011110011011000110000101111010111100101010000111 */
  ------------------
                      hash  = XXH_rotl64(hash,27) * XXH_PRIME64_1 + XXH_PRIME64_4;
  ------------------
  |  | 3364|     37|#define XXH_PRIME64_4  0x85EBCA77C2B2AE63ULL  /*!< 0b1000010111101011110010100111011111000010101100101010111001100011 */
  ------------------
 3448|     37|        len -= 8;
 3449|     37|    }
 3450|     34|    if (len >= 4) {
  ------------------
  |  Branch (3450:9): [True: 13, False: 21]
  ------------------
 3451|     13|        hash ^= (xxh_u64)(XXH_get32bits(ptr)) * XXH_PRIME64_1;
  ------------------
  |  | 2933|     13|#define XXH_get32bits(p) XXH_readLE32_align(p, align)
  ------------------
                      hash ^= (xxh_u64)(XXH_get32bits(ptr)) * XXH_PRIME64_1;
  ------------------
  |  | 3361|     13|#define XXH_PRIME64_1  0x9E3779B185EBCA87ULL  /*!< 0b1001111000110111011110011011000110000101111010111100101010000111 */
  ------------------
 3452|     13|        ptr += 4;
 3453|     13|        hash = XXH_rotl64(hash, 23) * XXH_PRIME64_2 + XXH_PRIME64_3;
  ------------------
  |  | 2728|     13|#  define XXH_rotl64 __builtin_rotateleft64
  ------------------
                      hash = XXH_rotl64(hash, 23) * XXH_PRIME64_2 + XXH_PRIME64_3;
  ------------------
  |  | 3362|     13|#define XXH_PRIME64_2  0xC2B2AE3D27D4EB4FULL  /*!< 0b1100001010110010101011100011110100100111110101001110101101001111 */
  ------------------
                      hash = XXH_rotl64(hash, 23) * XXH_PRIME64_2 + XXH_PRIME64_3;
  ------------------
  |  | 3363|     13|#define XXH_PRIME64_3  0x165667B19E3779F9ULL  /*!< 0b0001011001010110011001111011000110011110001101110111100111111001 */
  ------------------
 3454|     13|        len -= 4;
 3455|     13|    }
 3456|     72|    while (len > 0) {
  ------------------
  |  Branch (3456:12): [True: 38, False: 34]
  ------------------
 3457|     38|        hash ^= (*ptr++) * XXH_PRIME64_5;
  ------------------
  |  | 3365|     38|#define XXH_PRIME64_5  0x27D4EB2F165667C5ULL  /*!< 0b0010011111010100111010110010111100010110010101100110011111000101 */
  ------------------
 3458|     38|        hash = XXH_rotl64(hash, 11) * XXH_PRIME64_1;
  ------------------
  |  | 2728|     38|#  define XXH_rotl64 __builtin_rotateleft64
  ------------------
                      hash = XXH_rotl64(hash, 11) * XXH_PRIME64_1;
  ------------------
  |  | 3361|     38|#define XXH_PRIME64_1  0x9E3779B185EBCA87ULL  /*!< 0b1001111000110111011110011011000110000101111010111100101010000111 */
  ------------------
 3459|     38|        --len;
 3460|     38|    }
 3461|     34|    return  XXH64_avalanche(hash);
 3462|     34|}
xxhash.c:XXH64_avalanche:
 3411|     34|{
 3412|     34|    hash ^= hash >> 33;
 3413|     34|    hash *= XXH_PRIME64_2;
  ------------------
  |  | 3362|     34|#define XXH_PRIME64_2  0xC2B2AE3D27D4EB4FULL  /*!< 0b1100001010110010101011100011110100100111110101001110101101001111 */
  ------------------
 3414|     34|    hash ^= hash >> 29;
 3415|     34|    hash *= XXH_PRIME64_3;
  ------------------
  |  | 3363|     34|#define XXH_PRIME64_3  0x165667B19E3779F9ULL  /*!< 0b0001011001010110011001111011000110011110001101110111100111111001 */
  ------------------
 3416|     34|    hash ^= hash >> 32;
 3417|     34|    return hash;
 3418|     34|}

ZSTD_isError:
   36|  6.79k|unsigned ZSTD_isError(size_t code) { return ERR_isError(code); }
ZSTD_getErrorCode:
   44|  3.74k|ZSTD_ErrorCode ZSTD_getErrorCode(size_t code) { return ERR_getErrorCode(code); }

zstd_decompress.c:ZSTD_cpuSupportsBmi2:
  319|  6.74k|{
  320|  6.74k|    ZSTD_cpuid_t cpuid = ZSTD_cpuid();
  321|  6.74k|    return ZSTD_cpuid_bmi1(cpuid) && ZSTD_cpuid_bmi2(cpuid);
  ------------------
  |  Branch (321:12): [True: 6.74k, False: 0]
  |  Branch (321:38): [True: 6.74k, False: 0]
  ------------------
  322|  6.74k|}
zstd_decompress_block.c:ZSTD_wildcopy:
  217|   948k|{
  218|   948k|    ptrdiff_t diff = (BYTE*)dst - (const BYTE*)src;
  219|   948k|    const BYTE* ip = (const BYTE*)src;
  220|   948k|    BYTE* op = (BYTE*)dst;
  221|   948k|    BYTE* const oend = op + length;
  222|       |
  223|   948k|    if (ovtype == ZSTD_overlap_src_before_dst && diff < WILDCOPY_VECLEN) {
  ------------------
  |  |  200|   225k|#define WILDCOPY_VECLEN 16
  ------------------
  |  Branch (223:9): [True: 225k, False: 723k]
  |  Branch (223:50): [True: 225k, False: 222]
  ------------------
  224|       |        /* Handle short offset copies. */
  225|  7.33M|        do {
  226|  7.33M|            COPY8(op, ip);
  ------------------
  |  |  177|  7.33M|#define COPY8(d,s) do { ZSTD_copy8(d,s); d+=8; s+=8; } while (0)
  |  |  ------------------
  |  |  |  Branch (177:63): [Folded, False: 7.33M]
  |  |  ------------------
  ------------------
  227|  7.33M|        } while (op < oend);
  ------------------
  |  Branch (227:18): [True: 7.11M, False: 225k]
  ------------------
  228|   723k|    } else {
  229|   723k|        assert(diff >= WILDCOPY_VECLEN || diff <= -WILDCOPY_VECLEN);
  ------------------
  |  |   70|   723k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  230|       |        /* Separate out the first COPY16() call because the copy length is
  231|       |         * almost certain to be short, so the branches have different
  232|       |         * probabilities. Since it is almost certain to be short, only do
  233|       |         * one COPY16() in the first call. Then, do two calls per loop since
  234|       |         * at that point it is more likely to have a high trip count.
  235|       |         */
  236|   723k|        ZSTD_copy16(op, ip);
  237|   723k|        if (16 >= length) return;
  ------------------
  |  Branch (237:13): [True: 592k, False: 130k]
  ------------------
  238|   130k|        op += 16;
  239|   130k|        ip += 16;
  240|  3.04M|        do {
  241|  3.04M|            COPY16(op, ip);
  ------------------
  |  |  197|  3.04M|#define COPY16(d,s) do { ZSTD_copy16(d,s); d+=16; s+=16; } while (0)
  |  |  ------------------
  |  |  |  Branch (197:67): [Folded, False: 3.04M]
  |  |  ------------------
  ------------------
  242|  3.04M|            COPY16(op, ip);
  ------------------
  |  |  197|  3.04M|#define COPY16(d,s) do { ZSTD_copy16(d,s); d+=16; s+=16; } while (0)
  |  |  ------------------
  |  |  |  Branch (197:67): [Folded, False: 3.04M]
  |  |  ------------------
  ------------------
  243|  3.04M|        }
  244|  3.04M|        while (op < oend);
  ------------------
  |  Branch (244:16): [True: 2.91M, False: 130k]
  ------------------
  245|   130k|    }
  246|   948k|}
zstd_decompress_block.c:ZSTD_copy8:
  170|  7.63M|static void ZSTD_copy8(void* dst, const void* src) {
  171|       |#if defined(ZSTD_ARCH_ARM_NEON)
  172|       |    vst1_u8((uint8_t*)dst, vld1_u8((const uint8_t*)src));
  173|       |#else
  174|  7.63M|    ZSTD_memcpy(dst, src, 8);
  ------------------
  |  |   44|  7.63M|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  175|  7.63M|#endif
  176|  7.63M|}
zstd_decompress_block.c:ZSTD_copy16:
  183|  8.82M|static void ZSTD_copy16(void* dst, const void* src) {
  184|       |#if defined(ZSTD_ARCH_ARM_NEON)
  185|       |    vst1q_u8((uint8_t*)dst, vld1q_u8((const uint8_t*)src));
  186|       |#elif defined(ZSTD_ARCH_X86_SSE2)
  187|       |    _mm_storeu_si128((__m128i*)dst, _mm_loadu_si128((const __m128i*)src));
  188|       |#elif defined(__clang__)
  189|       |    ZSTD_memmove(dst, src, 16);
  190|       |#else
  191|       |    /* ZSTD_memmove is not inlined properly by gcc */
  192|       |    BYTE copy16_buf[16];
  193|       |    ZSTD_memcpy(copy16_buf, src, 16);
  194|       |    ZSTD_memcpy(dst, copy16_buf, 16);
  195|       |#endif
  196|  8.82M|}

HUF_readDTableX1_wksp:
  386|    432|{
  387|    432|    U32 tableLog = 0;
  388|    432|    U32 nbSymbols = 0;
  389|    432|    size_t iSize;
  390|    432|    void* const dtPtr = DTable + 1;
  391|    432|    HUF_DEltX1* const dt = (HUF_DEltX1*)dtPtr;
  392|    432|    HUF_ReadDTableX1_Workspace* wksp = (HUF_ReadDTableX1_Workspace*)workSpace;
  393|       |
  394|    432|    DEBUG_STATIC_ASSERT(HUF_DECOMPRESS_WORKSPACE_SIZE >= sizeof(*wksp));
  ------------------
  |  |   39|    432|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  395|    432|    if (sizeof(*wksp) > wkspSize) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (395:9): [True: 0, False: 432]
  ------------------
  396|       |
  397|    432|    DEBUG_STATIC_ASSERT(sizeof(DTableDesc) == sizeof(HUF_DTable));
  ------------------
  |  |   39|    432|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  398|       |    /* ZSTD_memset(huffWeight, 0, sizeof(huffWeight)); */   /* is not necessary, even though some analyzer complain ... */
  399|       |
  400|    432|    iSize = HUF_readStats_wksp(wksp->huffWeight, HUF_SYMBOLVALUE_MAX + 1, wksp->rankVal, &nbSymbols, &tableLog, src, srcSize, wksp->statsWksp, sizeof(wksp->statsWksp), flags);
  ------------------
  |  |   39|    432|#define HUF_SYMBOLVALUE_MAX  255
  ------------------
  401|    432|    if (HUF_isError(iSize)) return iSize;
  ------------------
  |  |   78|    432|#define HUF_isError ERR_isError
  ------------------
  |  Branch (401:9): [True: 156, False: 276]
  ------------------
  402|       |
  403|       |
  404|       |    /* Table header */
  405|    276|    {   DTableDesc dtd = HUF_getDTableDesc(DTable);
  406|    276|        U32 const maxTableLog = dtd.maxTableLog + 1;
  407|    276|        U32 const targetTableLog = MIN(maxTableLog, HUF_DECODER_FAST_TABLELOG);
  ------------------
  |  |   54|    276|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 0, False: 276]
  |  |  ------------------
  ------------------
  408|    276|        tableLog = HUF_rescaleStats(wksp->huffWeight, wksp->rankVal, nbSymbols, tableLog, targetTableLog);
  409|    276|        if (tableLog > (U32)(dtd.maxTableLog+1)) return ERROR(tableLog_tooLarge);   /* DTable too small, Huffman tree cannot fit in */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (409:13): [True: 0, False: 276]
  ------------------
  410|    276|        dtd.tableType = 0;
  411|    276|        dtd.tableLog = (BYTE)tableLog;
  412|    276|        ZSTD_memcpy(DTable, &dtd, sizeof(dtd));
  ------------------
  |  |   44|    276|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  413|    276|    }
  414|       |
  415|       |    /* Compute symbols and rankStart given rankVal:
  416|       |     *
  417|       |     * rankVal already contains the number of values of each weight.
  418|       |     *
  419|       |     * symbols contains the symbols ordered by weight. First are the rankVal[0]
  420|       |     * weight 0 symbols, followed by the rankVal[1] weight 1 symbols, and so on.
  421|       |     * symbols[0] is filled (but unused) to avoid a branch.
  422|       |     *
  423|       |     * rankStart contains the offset where each rank belongs in the DTable.
  424|       |     * rankStart[0] is not filled because there are no entries in the table for
  425|       |     * weight 0.
  426|       |     */
  427|      0|    {   int n;
  428|    276|        U32 nextRankStart = 0;
  429|    276|        int const unroll = 4;
  430|    276|        int const nLimit = (int)nbSymbols - unroll + 1;
  431|  3.65k|        for (n=0; n<(int)tableLog+1; n++) {
  ------------------
  |  Branch (431:19): [True: 3.38k, False: 276]
  ------------------
  432|  3.38k|            U32 const curr = nextRankStart;
  433|  3.38k|            nextRankStart += wksp->rankVal[n];
  434|  3.38k|            wksp->rankStart[n] = curr;
  435|  3.38k|        }
  436|  7.65k|        for (n=0; n < nLimit; n += unroll) {
  ------------------
  |  Branch (436:19): [True: 7.38k, False: 276]
  ------------------
  437|  7.38k|            int u;
  438|  36.9k|            for (u=0; u < unroll; ++u) {
  ------------------
  |  Branch (438:23): [True: 29.5k, False: 7.38k]
  ------------------
  439|  29.5k|                size_t const w = wksp->huffWeight[n+u];
  440|  29.5k|                wksp->symbols[wksp->rankStart[w]++] = (BYTE)(n+u);
  441|  29.5k|            }
  442|  7.38k|        }
  443|    691|        for (; n < (int)nbSymbols; ++n) {
  ------------------
  |  Branch (443:16): [True: 415, False: 276]
  ------------------
  444|    415|            size_t const w = wksp->huffWeight[n];
  445|    415|            wksp->symbols[wksp->rankStart[w]++] = (BYTE)n;
  446|    415|        }
  447|    276|    }
  448|       |
  449|       |    /* fill DTable
  450|       |     * We fill all entries of each weight in order.
  451|       |     * That way length is a constant for each iteration of the outer loop.
  452|       |     * We can switch based on the length to a different inner loop which is
  453|       |     * optimized for that particular case.
  454|       |     */
  455|    276|    {   U32 w;
  456|    276|        int symbol = wksp->rankVal[0];
  457|    276|        int rankStart = 0;
  458|  3.38k|        for (w=1; w<tableLog+1; ++w) {
  ------------------
  |  Branch (458:19): [True: 3.10k, False: 276]
  ------------------
  459|  3.10k|            int const symbolCount = wksp->rankVal[w];
  460|  3.10k|            int const length = (1 << w) >> 1;
  461|  3.10k|            int uStart = rankStart;
  462|  3.10k|            BYTE const nbBits = (BYTE)(tableLog + 1 - w);
  463|  3.10k|            int s;
  464|  3.10k|            int u;
  465|  3.10k|            switch (length) {
  466|    276|            case 1:
  ------------------
  |  Branch (466:13): [True: 276, False: 2.82k]
  ------------------
  467|  9.18k|                for (s=0; s<symbolCount; ++s) {
  ------------------
  |  Branch (467:27): [True: 8.90k, False: 276]
  ------------------
  468|  8.90k|                    HUF_DEltX1 D;
  469|  8.90k|                    D.byte = wksp->symbols[symbol + s];
  470|  8.90k|                    D.nbBits = nbBits;
  471|  8.90k|                    dt[uStart] = D;
  472|  8.90k|                    uStart += 1;
  473|  8.90k|                }
  474|    276|                break;
  475|    276|            case 2:
  ------------------
  |  Branch (475:13): [True: 276, False: 2.82k]
  ------------------
  476|  5.86k|                for (s=0; s<symbolCount; ++s) {
  ------------------
  |  Branch (476:27): [True: 5.58k, False: 276]
  ------------------
  477|  5.58k|                    HUF_DEltX1 D;
  478|  5.58k|                    D.byte = wksp->symbols[symbol + s];
  479|  5.58k|                    D.nbBits = nbBits;
  480|  5.58k|                    dt[uStart+0] = D;
  481|  5.58k|                    dt[uStart+1] = D;
  482|  5.58k|                    uStart += 2;
  483|  5.58k|                }
  484|    276|                break;
  485|    276|            case 4:
  ------------------
  |  Branch (485:13): [True: 276, False: 2.82k]
  ------------------
  486|  1.26k|                for (s=0; s<symbolCount; ++s) {
  ------------------
  |  Branch (486:27): [True: 987, False: 276]
  ------------------
  487|    987|                    U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits);
  488|    987|                    MEM_write64(dt + uStart, D4);
  489|    987|                    uStart += 4;
  490|    987|                }
  491|    276|                break;
  492|    276|            case 8:
  ------------------
  |  Branch (492:13): [True: 276, False: 2.82k]
  ------------------
  493|  1.55k|                for (s=0; s<symbolCount; ++s) {
  ------------------
  |  Branch (493:27): [True: 1.27k, False: 276]
  ------------------
  494|  1.27k|                    U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits);
  495|  1.27k|                    MEM_write64(dt + uStart, D4);
  496|  1.27k|                    MEM_write64(dt + uStart + 4, D4);
  497|  1.27k|                    uStart += 8;
  498|  1.27k|                }
  499|    276|                break;
  500|  2.00k|            default:
  ------------------
  |  Branch (500:13): [True: 2.00k, False: 1.10k]
  ------------------
  501|  8.09k|                for (s=0; s<symbolCount; ++s) {
  ------------------
  |  Branch (501:27): [True: 6.09k, False: 2.00k]
  ------------------
  502|  6.09k|                    U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits);
  503|  47.9k|                    for (u=0; u < length; u += 16) {
  ------------------
  |  Branch (503:31): [True: 41.8k, False: 6.09k]
  ------------------
  504|  41.8k|                        MEM_write64(dt + uStart + u + 0, D4);
  505|  41.8k|                        MEM_write64(dt + uStart + u + 4, D4);
  506|  41.8k|                        MEM_write64(dt + uStart + u + 8, D4);
  507|  41.8k|                        MEM_write64(dt + uStart + u + 12, D4);
  508|  41.8k|                    }
  509|  6.09k|                    assert(u == length);
  ------------------
  |  |   70|  6.09k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  510|  6.09k|                    uStart += length;
  511|  6.09k|                }
  512|  2.00k|                break;
  513|  3.10k|            }
  514|  3.10k|            symbol += symbolCount;
  515|  3.10k|            rankStart += symbolCount * length;
  516|  3.10k|        }
  517|    276|    }
  518|    276|    return iSize;
  519|    276|}
HUF_readDTableX2_wksp:
 1182|    642|{
 1183|    642|    U32 tableLog, maxW, nbSymbols;
 1184|    642|    DTableDesc dtd = HUF_getDTableDesc(DTable);
 1185|    642|    U32 maxTableLog = dtd.maxTableLog;
 1186|    642|    size_t iSize;
 1187|    642|    void* dtPtr = DTable+1;   /* force compiler to avoid strict-aliasing */
 1188|    642|    HUF_DEltX2* const dt = (HUF_DEltX2*)dtPtr;
 1189|    642|    U32 *rankStart;
 1190|       |
 1191|    642|    HUF_ReadDTableX2_Workspace* const wksp = (HUF_ReadDTableX2_Workspace*)workSpace;
 1192|       |
 1193|    642|    if (sizeof(*wksp) > wkspSize) return ERROR(GENERIC);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1193:9): [True: 0, False: 642]
  ------------------
 1194|       |
 1195|    642|    rankStart = wksp->rankStart0 + 1;
 1196|    642|    ZSTD_memset(wksp->rankStats, 0, sizeof(wksp->rankStats));
  ------------------
  |  |   46|    642|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
 1197|    642|    ZSTD_memset(wksp->rankStart0, 0, sizeof(wksp->rankStart0));
  ------------------
  |  |   46|    642|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
 1198|       |
 1199|    642|    DEBUG_STATIC_ASSERT(sizeof(HUF_DEltX2) == sizeof(HUF_DTable));   /* if compiler fails here, assertion is wrong */
  ------------------
  |  |   39|    642|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
 1200|    642|    if (maxTableLog > HUF_TABLELOG_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   37|    642|#define HUF_TABLELOG_MAX      12      /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */
  ------------------
                  if (maxTableLog > HUF_TABLELOG_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1200:9): [True: 0, False: 642]
  ------------------
 1201|       |    /* ZSTD_memset(weightList, 0, sizeof(weightList)); */  /* is not necessary, even though some analyzer complain ... */
 1202|       |
 1203|    642|    iSize = HUF_readStats_wksp(wksp->weightList, HUF_SYMBOLVALUE_MAX + 1, wksp->rankStats, &nbSymbols, &tableLog, src, srcSize, wksp->calleeWksp, sizeof(wksp->calleeWksp), flags);
  ------------------
  |  |   39|    642|#define HUF_SYMBOLVALUE_MAX  255
  ------------------
 1204|    642|    if (HUF_isError(iSize)) return iSize;
  ------------------
  |  |   78|    642|#define HUF_isError ERR_isError
  ------------------
  |  Branch (1204:9): [True: 151, False: 491]
  ------------------
 1205|       |
 1206|       |    /* check result */
 1207|    491|    if (tableLog > maxTableLog) return ERROR(tableLog_tooLarge);   /* DTable can't fit code depth */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1207:9): [True: 0, False: 491]
  ------------------
 1208|    491|    if (tableLog <= HUF_DECODER_FAST_TABLELOG && maxTableLog > HUF_DECODER_FAST_TABLELOG) maxTableLog = HUF_DECODER_FAST_TABLELOG;
  ------------------
  |  |   31|    982|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
                  if (tableLog <= HUF_DECODER_FAST_TABLELOG && maxTableLog > HUF_DECODER_FAST_TABLELOG) maxTableLog = HUF_DECODER_FAST_TABLELOG;
  ------------------
  |  |   31|    401|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
                  if (tableLog <= HUF_DECODER_FAST_TABLELOG && maxTableLog > HUF_DECODER_FAST_TABLELOG) maxTableLog = HUF_DECODER_FAST_TABLELOG;
  ------------------
  |  |   31|    401|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
  |  Branch (1208:9): [True: 401, False: 90]
  |  Branch (1208:50): [True: 401, False: 0]
  ------------------
 1209|       |
 1210|       |    /* find maxWeight */
 1211|  1.07k|    for (maxW = tableLog; wksp->rankStats[maxW]==0; maxW--) {}  /* necessarily finds a solution before 0 */
  ------------------
  |  Branch (1211:27): [True: 584, False: 491]
  ------------------
 1212|       |
 1213|       |    /* Get start index of each weight */
 1214|    491|    {   U32 w, nextRankStart = 0;
 1215|  4.07k|        for (w=1; w<maxW+1; w++) {
  ------------------
  |  Branch (1215:19): [True: 3.58k, False: 491]
  ------------------
 1216|  3.58k|            U32 curr = nextRankStart;
 1217|  3.58k|            nextRankStart += wksp->rankStats[w];
 1218|  3.58k|            rankStart[w] = curr;
 1219|  3.58k|        }
 1220|    491|        rankStart[0] = nextRankStart;   /* put all 0w symbols at the end of sorted list*/
 1221|    491|        rankStart[maxW+1] = nextRankStart;
 1222|    491|    }
 1223|       |
 1224|       |    /* sort symbols by weight */
 1225|    491|    {   U32 s;
 1226|  64.8k|        for (s=0; s<nbSymbols; s++) {
  ------------------
  |  Branch (1226:19): [True: 64.3k, False: 491]
  ------------------
 1227|  64.3k|            U32 const w = wksp->weightList[s];
 1228|  64.3k|            U32 const r = rankStart[w]++;
 1229|  64.3k|            wksp->sortedSymbol[r].symbol = (BYTE)s;
 1230|  64.3k|        }
 1231|    491|        rankStart[0] = 0;   /* forget 0w symbols; this is beginning of weight(1) */
 1232|    491|    }
 1233|       |
 1234|       |    /* Build rankVal */
 1235|    491|    {   U32* const rankVal0 = wksp->rankVal[0];
 1236|    491|        {   int const rescale = (maxTableLog-tableLog) - 1;   /* tableLog <= maxTableLog */
 1237|    491|            U32 nextRankVal = 0;
 1238|    491|            U32 w;
 1239|  4.07k|            for (w=1; w<maxW+1; w++) {
  ------------------
  |  Branch (1239:23): [True: 3.58k, False: 491]
  ------------------
 1240|  3.58k|                U32 curr = nextRankVal;
 1241|  3.58k|                nextRankVal += wksp->rankStats[w] << (w+rescale);
 1242|  3.58k|                rankVal0[w] = curr;
 1243|  3.58k|        }   }
 1244|    491|        {   U32 const minBits = tableLog+1 - maxW;
 1245|    491|            U32 consumed;
 1246|  4.33k|            for (consumed = minBits; consumed < maxTableLog - minBits + 1; consumed++) {
  ------------------
  |  Branch (1246:38): [True: 3.83k, False: 491]
  ------------------
 1247|  3.83k|                U32* const rankValPtr = wksp->rankVal[consumed];
 1248|  3.83k|                U32 w;
 1249|  35.4k|                for (w = 1; w < maxW+1; w++) {
  ------------------
  |  Branch (1249:29): [True: 31.6k, False: 3.83k]
  ------------------
 1250|  31.6k|                    rankValPtr[w] = rankVal0[w] >> consumed;
 1251|  31.6k|    }   }   }   }
 1252|       |
 1253|    491|    HUF_fillDTableX2(dt, maxTableLog,
 1254|    491|                   wksp->sortedSymbol,
 1255|    491|                   wksp->rankStart0, wksp->rankVal, maxW,
 1256|    491|                   tableLog+1);
 1257|       |
 1258|    491|    dtd.tableLog = (BYTE)maxTableLog;
 1259|    491|    dtd.tableType = 1;
 1260|    491|    ZSTD_memcpy(DTable, &dtd, sizeof(dtd));
  ------------------
  |  |   44|    491|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1261|    491|    return iSize;
 1262|    491|}
HUF_selectDecoder:
 1822|    610|{
 1823|    610|    assert(dstSize > 0);
  ------------------
  |  |   70|    610|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1824|    610|    assert(dstSize <= 128*1024);
  ------------------
  |  |   70|    610|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1825|       |#if defined(HUF_FORCE_DECOMPRESS_X1)
 1826|       |    (void)dstSize;
 1827|       |    (void)cSrcSize;
 1828|       |    return 0;
 1829|       |#elif defined(HUF_FORCE_DECOMPRESS_X2)
 1830|       |    (void)dstSize;
 1831|       |    (void)cSrcSize;
 1832|       |    return 1;
 1833|       |#else
 1834|       |    /* decoder timing evaluation */
 1835|    610|    {   U32 const Q = (cSrcSize >= dstSize) ? 15 : (U32)(cSrcSize * 16 / dstSize);   /* Q < 16 */
  ------------------
  |  Branch (1835:23): [True: 29, False: 581]
  ------------------
 1836|    610|        U32 const D256 = (U32)(dstSize >> 8);
 1837|    610|        U32 const DTime0 = algoTime[Q][0].tableTime + (algoTime[Q][0].decode256Time * D256);
 1838|    610|        U32 DTime1 = algoTime[Q][1].tableTime + (algoTime[Q][1].decode256Time * D256);
 1839|    610|        DTime1 += DTime1 >> 5;  /* small advantage to algorithm using less memory, to reduce cache eviction */
 1840|    610|        return DTime1 < DTime0;
 1841|    610|    }
 1842|    610|#endif
 1843|    610|}
HUF_decompress1X1_DCtx_wksp:
 1895|     70|{
 1896|     70|    const BYTE* ip = (const BYTE*) cSrc;
 1897|       |
 1898|     70|    size_t const hSize = HUF_readDTableX1_wksp(dctx, cSrc, cSrcSize, workSpace, wkspSize, flags);
 1899|     70|    if (HUF_isError(hSize)) return hSize;
  ------------------
  |  |   78|     70|#define HUF_isError ERR_isError
  ------------------
  |  Branch (1899:9): [True: 28, False: 42]
  ------------------
 1900|     42|    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1900:9): [True: 1, False: 41]
  ------------------
 1901|     41|    ip += hSize; cSrcSize -= hSize;
 1902|       |
 1903|     41|    return HUF_decompress1X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, flags);
 1904|     42|}
HUF_decompress4X_hufOnly_wksp:
 1925|    617|{
 1926|       |    /* validation checks */
 1927|    617|    if (dstSize == 0) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1927:9): [True: 0, False: 617]
  ------------------
 1928|    617|    if (cSrcSize == 0) return ERROR(corruption_detected);
  ------------------
  |  |   49|      7|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      7|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      7|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1928:9): [True: 7, False: 610]
  ------------------
 1929|       |
 1930|    610|    {   U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);
 1931|       |#if defined(HUF_FORCE_DECOMPRESS_X1)
 1932|       |        (void)algoNb;
 1933|       |        assert(algoNb == 0);
 1934|       |        return HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags);
 1935|       |#elif defined(HUF_FORCE_DECOMPRESS_X2)
 1936|       |        (void)algoNb;
 1937|       |        assert(algoNb == 1);
 1938|       |        return HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags);
 1939|       |#else
 1940|    610|        return algoNb ? HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags) :
  ------------------
  |  Branch (1940:16): [True: 248, False: 362]
  ------------------
 1941|    610|                        HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags);
 1942|    617|#endif
 1943|    617|    }
 1944|    617|}
huf_decompress.c:HUF_getDTableDesc:
  144|  1.68k|{
  145|  1.68k|    DTableDesc dtd;
  146|  1.68k|    ZSTD_memcpy(&dtd, table, sizeof(dtd));
  ------------------
  |  |   44|  1.68k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  147|  1.68k|    return dtd;
  148|  1.68k|}
huf_decompress.c:HUF_rescaleStats:
  353|    276|{
  354|    276|    if (tableLog > targetTableLog)
  ------------------
  |  Branch (354:9): [True: 68, False: 208]
  ------------------
  355|     68|        return tableLog;
  356|    208|    if (tableLog < targetTableLog) {
  ------------------
  |  Branch (356:9): [True: 166, False: 42]
  ------------------
  357|    166|        U32 const scale = targetTableLog - tableLog;
  358|    166|        U32 s;
  359|       |        /* Increase the weight for all non-zero probability symbols by scale. */
  360|  13.8k|        for (s = 0; s < nbSymbols; ++s) {
  ------------------
  |  Branch (360:21): [True: 13.6k, False: 166]
  ------------------
  361|  13.6k|            huffWeight[s] += (BYTE)((huffWeight[s] == 0) ? 0 : scale);
  ------------------
  |  Branch (361:37): [True: 4.73k, False: 8.94k]
  ------------------
  362|  13.6k|        }
  363|       |        /* Update rankVal to reflect the new weights.
  364|       |         * All weights except 0 get moved to weight + scale.
  365|       |         * Weights [1, scale] are empty.
  366|       |         */
  367|  1.20k|        for (s = targetTableLog; s > scale; --s) {
  ------------------
  |  Branch (367:34): [True: 1.04k, False: 166]
  ------------------
  368|  1.04k|            rankVal[s] = rankVal[s - scale];
  369|  1.04k|        }
  370|    952|        for (s = scale; s > 0; --s) {
  ------------------
  |  Branch (370:25): [True: 786, False: 166]
  ------------------
  371|    786|            rankVal[s] = 0;
  372|    786|        }
  373|    166|    }
  374|    208|    return targetTableLog;
  375|    276|}
huf_decompress.c:HUF_DEltX1_set4:
  335|  8.36k|static U64 HUF_DEltX1_set4(BYTE symbol, BYTE nbBits) {
  336|  8.36k|    U64 D4;
  337|  8.36k|    if (MEM_isLittleEndian()) {
  ------------------
  |  Branch (337:9): [True: 8.36k, False: 0]
  ------------------
  338|  8.36k|        D4 = (U64)((symbol << 8) + nbBits);
  339|  8.36k|    } else {
  340|      0|        D4 = (U64)(symbol + (nbBits << 8));
  341|      0|    }
  342|  8.36k|    assert(D4 < (1U << 16));
  ------------------
  |  |   70|  8.36k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  343|  8.36k|    D4 *= 0x0001000100010001ULL;
  344|  8.36k|    return D4;
  345|  8.36k|}
huf_decompress.c:HUF_fillDTableX2:
 1128|    491|{
 1129|    491|    U32* const rankVal = rankValOrigin[0];
 1130|    491|    const int scaleLog = nbBitsBaseline - targetLog;   /* note : targetLog >= srcLog, hence scaleLog <= 1 */
 1131|    491|    const U32 minBits  = nbBitsBaseline - maxWeight;
 1132|    491|    int w;
 1133|    491|    int const wEnd = (int)maxWeight + 1;
 1134|       |
 1135|       |    /* Fill DTable in order of weight. */
 1136|  4.07k|    for (w = 1; w < wEnd; ++w) {
  ------------------
  |  Branch (1136:17): [True: 3.58k, False: 491]
  ------------------
 1137|  3.58k|        int const begin = (int)rankStart[w];
 1138|  3.58k|        int const end = (int)rankStart[w+1];
 1139|  3.58k|        U32 const nbBits = nbBitsBaseline - w;
 1140|       |
 1141|  3.58k|        if (targetLog-nbBits >= minBits) {
  ------------------
  |  Branch (1141:13): [True: 3.20k, False: 378]
  ------------------
 1142|       |            /* Enough room for a second symbol. */
 1143|  3.20k|            int start = rankVal[w];
 1144|  3.20k|            U32 const length = 1U << ((targetLog - nbBits) & 0x1F /* quiet static-analyzer */);
 1145|  3.20k|            int minWeight = nbBits + scaleLog;
 1146|  3.20k|            int s;
 1147|  3.20k|            if (minWeight < 1) minWeight = 1;
  ------------------
  |  Branch (1147:17): [True: 490, False: 2.71k]
  ------------------
 1148|       |            /* Fill the DTable for every symbol of weight w.
 1149|       |             * These symbols get at least 1 second symbol.
 1150|       |             */
 1151|  22.4k|            for (s = begin; s != end; ++s) {
  ------------------
  |  Branch (1151:29): [True: 19.2k, False: 3.20k]
  ------------------
 1152|  19.2k|                HUF_fillDTableX2Level2(
 1153|  19.2k|                    DTable + start, targetLog, nbBits,
 1154|  19.2k|                    rankValOrigin[nbBits], minWeight, wEnd,
 1155|  19.2k|                    sortedList, rankStart,
 1156|  19.2k|                    nbBitsBaseline, sortedList[s].symbol);
 1157|  19.2k|                start += length;
 1158|  19.2k|            }
 1159|  3.20k|        } else {
 1160|       |            /* Only a single symbol. */
 1161|    378|            HUF_fillDTableX2ForWeight(
 1162|    378|                DTable + rankVal[w],
 1163|    378|                sortedList + begin, sortedList + end,
 1164|    378|                nbBits, targetLog,
 1165|    378|                /* baseSeq */ 0, /* level */ 1);
 1166|    378|        }
 1167|  3.58k|    }
 1168|    491|}
huf_decompress.c:HUF_fillDTableX2Level2:
 1073|  19.2k|{
 1074|       |    /* Fill skipped values (all positions up to rankVal[minWeight]).
 1075|       |     * These are positions only get a single symbol because the combined weight
 1076|       |     * is too large.
 1077|       |     */
 1078|  19.2k|    if (minWeight>1) {
  ------------------
  |  Branch (1078:9): [True: 17.5k, False: 1.66k]
  ------------------
 1079|  17.5k|        U32 const length = 1U << ((targetLog - consumedBits) & 0x1F /* quiet static-analyzer */);
 1080|  17.5k|        U64 const DEltX2 = HUF_buildDEltX2U64(baseSeq, consumedBits, /* baseSeq */ 0, /* level */ 1);
 1081|  17.5k|        int const skipSize = rankVal[minWeight];
 1082|  17.5k|        assert(length > 1);
  ------------------
  |  |   70|  17.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1083|  17.5k|        assert((U32)skipSize < length);
  ------------------
  |  |   70|  17.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1084|  17.5k|        switch (length) {
 1085|  4.32k|        case 2:
  ------------------
  |  Branch (1085:9): [True: 4.32k, False: 13.2k]
  ------------------
 1086|  4.32k|            assert(skipSize == 1);
  ------------------
  |  |   70|  4.32k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1087|  4.32k|            ZSTD_memcpy(DTable, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  4.32k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1088|  4.32k|            break;
 1089|    944|        case 4:
  ------------------
  |  Branch (1089:9): [True: 944, False: 16.6k]
  ------------------
 1090|    944|            assert(skipSize <= 4);
  ------------------
  |  |   70|    944|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1091|    944|            ZSTD_memcpy(DTable + 0, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|    944|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1092|    944|            ZSTD_memcpy(DTable + 2, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|    944|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1093|    944|            break;
 1094|  12.3k|        default:
  ------------------
  |  Branch (1094:9): [True: 12.3k, False: 5.27k]
  ------------------
 1095|  12.3k|            {
 1096|  12.3k|                int i;
 1097|  36.2k|                for (i = 0; i < skipSize; i += 8) {
  ------------------
  |  Branch (1097:29): [True: 23.8k, False: 12.3k]
  ------------------
 1098|  23.8k|                    ZSTD_memcpy(DTable + i + 0, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  23.8k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1099|  23.8k|                    ZSTD_memcpy(DTable + i + 2, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  23.8k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1100|  23.8k|                    ZSTD_memcpy(DTable + i + 4, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  23.8k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1101|  23.8k|                    ZSTD_memcpy(DTable + i + 6, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  23.8k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1102|  23.8k|                }
 1103|  12.3k|            }
 1104|  17.5k|        }
 1105|  17.5k|    }
 1106|       |
 1107|       |    /* Fill each of the second level symbols by weight. */
 1108|  19.2k|    {
 1109|  19.2k|        int w;
 1110|  74.1k|        for (w = minWeight; w < maxWeight1; ++w) {
  ------------------
  |  Branch (1110:29): [True: 54.9k, False: 19.2k]
  ------------------
 1111|  54.9k|            int const begin = rankStart[w];
 1112|  54.9k|            int const end = rankStart[w+1];
 1113|  54.9k|            U32 const nbBits = nbBitsBaseline - w;
 1114|  54.9k|            U32 const totalBits = nbBits + consumedBits;
 1115|  54.9k|            HUF_fillDTableX2ForWeight(
 1116|  54.9k|                DTable + rankVal[w],
 1117|  54.9k|                sortedSymbols + begin, sortedSymbols + end,
 1118|  54.9k|                totalBits, targetLog,
 1119|  54.9k|                baseSeq, /* level */ 2);
 1120|  54.9k|        }
 1121|  19.2k|    }
 1122|  19.2k|}
huf_decompress.c:HUF_buildDEltX2U64:
  993|  70.0k|{
  994|  70.0k|    U32 DElt = HUF_buildDEltX2U32(symbol, nbBits, baseSeq, level);
  995|  70.0k|    return (U64)DElt + ((U64)DElt << 32);
  996|  70.0k|}
huf_decompress.c:HUF_buildDEltX2U32:
  962|   171k|{
  963|   171k|    U32 seq;
  964|   171k|    DEBUG_STATIC_ASSERT(offsetof(HUF_DEltX2, sequence) == 0);
  ------------------
  |  |   39|   171k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  965|   171k|    DEBUG_STATIC_ASSERT(offsetof(HUF_DEltX2, nbBits) == 2);
  ------------------
  |  |   39|   171k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  966|   171k|    DEBUG_STATIC_ASSERT(offsetof(HUF_DEltX2, length) == 3);
  ------------------
  |  |   39|   171k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  967|   171k|    DEBUG_STATIC_ASSERT(sizeof(HUF_DEltX2) == sizeof(U32));
  ------------------
  |  |   39|   171k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  968|   171k|    if (MEM_isLittleEndian()) {
  ------------------
  |  Branch (968:9): [True: 171k, False: 0]
  ------------------
  969|   171k|        seq = level == 1 ? symbol : (baseSeq + (symbol << 8));
  ------------------
  |  Branch (969:15): [True: 39.4k, False: 131k]
  ------------------
  970|   171k|        return seq + (nbBits << 16) + ((U32)level << 24);
  971|   171k|    } else {
  972|      0|        seq = level == 1 ? (symbol << 8) : ((baseSeq << 8) + symbol);
  ------------------
  |  Branch (972:15): [True: 0, False: 0]
  ------------------
  973|      0|        return (seq << 16) + (nbBits << 8) + (U32)level;
  974|      0|    }
  975|   171k|}
huf_decompress.c:HUF_fillDTableX2ForWeight:
 1015|  55.3k|{
 1016|  55.3k|    U32 const length = 1U << ((tableLog - nbBits) & 0x1F /* quiet static-analyzer */);
 1017|  55.3k|    const sortedSymbol_t* ptr;
 1018|  55.3k|    assert(level >= 1 && level <= 2);
  ------------------
  |  |   70|  55.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1019|  55.3k|    switch (length) {
 1020|  18.1k|    case 1:
  ------------------
  |  Branch (1020:5): [True: 18.1k, False: 37.1k]
  ------------------
 1021|  77.1k|        for (ptr = begin; ptr != end; ++ptr) {
  ------------------
  |  Branch (1021:27): [True: 58.9k, False: 18.1k]
  ------------------
 1022|  58.9k|            HUF_DEltX2 const DElt = HUF_buildDEltX2(ptr->symbol, nbBits, baseSeq, level);
 1023|  58.9k|            *DTableRank++ = DElt;
 1024|  58.9k|        }
 1025|  18.1k|        break;
 1026|  12.2k|    case 2:
  ------------------
  |  Branch (1026:5): [True: 12.2k, False: 43.0k]
  ------------------
 1027|  54.2k|        for (ptr = begin; ptr != end; ++ptr) {
  ------------------
  |  Branch (1027:27): [True: 42.0k, False: 12.2k]
  ------------------
 1028|  42.0k|            HUF_DEltX2 const DElt = HUF_buildDEltX2(ptr->symbol, nbBits, baseSeq, level);
 1029|  42.0k|            DTableRank[0] = DElt;
 1030|  42.0k|            DTableRank[1] = DElt;
 1031|  42.0k|            DTableRank += 2;
 1032|  42.0k|        }
 1033|  12.2k|        break;
 1034|  9.78k|    case 4:
  ------------------
  |  Branch (1034:5): [True: 9.78k, False: 45.5k]
  ------------------
 1035|  33.2k|        for (ptr = begin; ptr != end; ++ptr) {
  ------------------
  |  Branch (1035:27): [True: 23.4k, False: 9.78k]
  ------------------
 1036|  23.4k|            U64 const DEltX2 = HUF_buildDEltX2U64(ptr->symbol, nbBits, baseSeq, level);
 1037|  23.4k|            ZSTD_memcpy(DTableRank + 0, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  23.4k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1038|  23.4k|            ZSTD_memcpy(DTableRank + 2, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  23.4k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1039|  23.4k|            DTableRank += 4;
 1040|  23.4k|        }
 1041|  9.78k|        break;
 1042|  7.43k|    case 8:
  ------------------
  |  Branch (1042:5): [True: 7.43k, False: 47.8k]
  ------------------
 1043|  24.3k|        for (ptr = begin; ptr != end; ++ptr) {
  ------------------
  |  Branch (1043:27): [True: 16.9k, False: 7.43k]
  ------------------
 1044|  16.9k|            U64 const DEltX2 = HUF_buildDEltX2U64(ptr->symbol, nbBits, baseSeq, level);
 1045|  16.9k|            ZSTD_memcpy(DTableRank + 0, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  16.9k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1046|  16.9k|            ZSTD_memcpy(DTableRank + 2, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  16.9k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1047|  16.9k|            ZSTD_memcpy(DTableRank + 4, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  16.9k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1048|  16.9k|            ZSTD_memcpy(DTableRank + 6, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  16.9k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1049|  16.9k|            DTableRank += 8;
 1050|  16.9k|        }
 1051|  7.43k|        break;
 1052|  7.68k|    default:
  ------------------
  |  Branch (1052:5): [True: 7.68k, False: 47.6k]
  ------------------
 1053|  19.7k|        for (ptr = begin; ptr != end; ++ptr) {
  ------------------
  |  Branch (1053:27): [True: 12.0k, False: 7.68k]
  ------------------
 1054|  12.0k|            U64 const DEltX2 = HUF_buildDEltX2U64(ptr->symbol, nbBits, baseSeq, level);
 1055|  12.0k|            HUF_DEltX2* const DTableRankEnd = DTableRank + length;
 1056|  93.9k|            for (; DTableRank != DTableRankEnd; DTableRank += 8) {
  ------------------
  |  Branch (1056:20): [True: 81.8k, False: 12.0k]
  ------------------
 1057|  81.8k|                ZSTD_memcpy(DTableRank + 0, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  81.8k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1058|  81.8k|                ZSTD_memcpy(DTableRank + 2, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  81.8k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1059|  81.8k|                ZSTD_memcpy(DTableRank + 4, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  81.8k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1060|  81.8k|                ZSTD_memcpy(DTableRank + 6, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  81.8k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1061|  81.8k|            }
 1062|  12.0k|        }
 1063|  7.68k|        break;
 1064|  55.3k|    }
 1065|  55.3k|}
huf_decompress.c:HUF_buildDEltX2:
  981|   101k|{
  982|   101k|    HUF_DEltX2 DElt;
  983|   101k|    U32 const val = HUF_buildDEltX2U32(symbol, nbBits, baseSeq, level);
  984|   101k|    DEBUG_STATIC_ASSERT(sizeof(DElt) == sizeof(val));
  ------------------
  |  |   39|   101k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  985|   101k|    ZSTD_memcpy(&DElt, &val, sizeof(val));
  ------------------
  |  |   44|   101k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  986|   101k|    return DElt;
  987|   101k|}
huf_decompress.c:HUF_decodeStreamX2:
 1310|    713|{
 1311|    713|    BYTE* const pStart = p;
 1312|       |
 1313|       |    /* up to 8 symbols at a time */
 1314|    713|    if ((size_t)(pEnd - p) >= sizeof(bitDPtr->bitContainer)) {
  ------------------
  |  Branch (1314:9): [True: 660, False: 53]
  ------------------
 1315|    660|        if (dtLog <= 11 && MEM_64bits()) {
  ------------------
  |  Branch (1315:13): [True: 402, False: 258]
  |  Branch (1315:28): [True: 402, False: 0]
  ------------------
 1316|       |            /* up to 10 symbols at a time */
 1317|  15.7k|            while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-9)) {
  ------------------
  |  Branch (1317:20): [True: 15.3k, False: 402]
  ------------------
 1318|  15.3k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1293|  15.3k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 15.3k]
  |  |  ------------------
  ------------------
 1319|  15.3k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1293|  15.3k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 15.3k]
  |  |  ------------------
  ------------------
 1320|  15.3k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1293|  15.3k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 15.3k]
  |  |  ------------------
  ------------------
 1321|  15.3k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1293|  15.3k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 15.3k]
  |  |  ------------------
  ------------------
 1322|  15.3k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1293|  15.3k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 15.3k]
  |  |  ------------------
  ------------------
 1323|  15.3k|            }
 1324|    402|        } else {
 1325|       |            /* up to 8 symbols at a time */
 1326|  6.15k|            while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-(sizeof(bitDPtr->bitContainer)-1))) {
  ------------------
  |  Branch (1326:20): [True: 5.89k, False: 258]
  ------------------
 1327|  5.89k|                HUF_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1302|  5.89k|    do {                                                           \
  |  | 1303|  5.89k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 5.89k, False: 0]
  |  |  ------------------
  |  | 1304|  5.89k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  5.89k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 5.89k]
  |  |  ------------------
  ------------------
 1328|  5.89k|                HUF_DECODE_SYMBOLX2_1(p, bitDPtr);
  ------------------
  |  | 1296|  5.89k|    do {                                                           \
  |  | 1297|  5.89k|        if (MEM_64bits() || (HUF_TABLELOG_MAX<=12))                \
  |  |  ------------------
  |  |  |  |   37|      0|#define HUF_TABLELOG_MAX      12      /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */
  |  |  ------------------
  |  |  |  Branch (1297:13): [True: 5.89k, False: 0]
  |  |  |  Branch (1297:29): [True: 0, Folded]
  |  |  ------------------
  |  | 1298|  5.89k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1299|  5.89k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1299:14): [Folded, False: 5.89k]
  |  |  ------------------
  ------------------
 1329|  5.89k|                HUF_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1302|  5.89k|    do {                                                           \
  |  | 1303|  5.89k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 5.89k, False: 0]
  |  |  ------------------
  |  | 1304|  5.89k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  5.89k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 5.89k]
  |  |  ------------------
  ------------------
 1330|  5.89k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1293|  5.89k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 5.89k]
  |  |  ------------------
  ------------------
 1331|  5.89k|            }
 1332|    258|        }
 1333|    660|    } else {
 1334|     53|        BIT_reloadDStream(bitDPtr);
 1335|     53|    }
 1336|       |
 1337|       |    /* closer to end : up to 2 symbols at a time */
 1338|    713|    if ((size_t)(pEnd - p) >= 2) {
  ------------------
  |  Branch (1338:9): [True: 666, False: 47]
  ------------------
 1339|  1.33k|        while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p <= pEnd-2))
  ------------------
  |  Branch (1339:16): [True: 671, False: 666]
  ------------------
 1340|    671|            HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1293|    671|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 671]
  |  |  ------------------
  ------------------
 1341|       |
 1342|   172k|        while (p <= pEnd-2)
  ------------------
  |  Branch (1342:16): [True: 171k, False: 666]
  ------------------
 1343|   171k|            HUF_DECODE_SYMBOLX2_0(p, bitDPtr);   /* no need to reload : reached the end of DStream */
  ------------------
  |  | 1293|   171k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 171k]
  |  |  ------------------
  ------------------
 1344|    666|    }
 1345|       |
 1346|    713|    if (p < pEnd)
  ------------------
  |  Branch (1346:9): [True: 475, False: 238]
  ------------------
 1347|    475|        p += HUF_decodeLastSymbolX2(p, bitDPtr, dt, dtLog);
 1348|       |
 1349|    713|    return p-pStart;
 1350|    713|}
huf_decompress.c:HUF_decodeSymbolX2:
 1267|   320k|{
 1268|   320k|    size_t const val = BIT_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */
 1269|   320k|    ZSTD_memcpy(op, &dt[val].sequence, 2);
  ------------------
  |  |   44|   320k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1270|   320k|    BIT_skipBits(DStream, dt[val].nbBits);
 1271|   320k|    return dt[val].length;
 1272|   320k|}
huf_decompress.c:HUF_decodeLastSymbolX2:
 1276|    475|{
 1277|    475|    size_t const val = BIT_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */
 1278|    475|    ZSTD_memcpy(op, &dt[val].sequence, 1);
  ------------------
  |  |   44|    475|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1279|    475|    if (dt[val].length==1) {
  ------------------
  |  Branch (1279:9): [True: 231, False: 244]
  ------------------
 1280|    231|        BIT_skipBits(DStream, dt[val].nbBits);
 1281|    244|    } else {
 1282|    244|        if (DStream->bitsConsumed < (sizeof(DStream->bitContainer)*8)) {
  ------------------
  |  Branch (1282:13): [True: 139, False: 105]
  ------------------
 1283|    139|            BIT_skipBits(DStream, dt[val].nbBits);
 1284|    139|            if (DStream->bitsConsumed > (sizeof(DStream->bitContainer)*8))
  ------------------
  |  Branch (1284:17): [True: 6, False: 133]
  ------------------
 1285|       |                /* ugly hack; works only because it's the last symbol. Note : can't easily extract nbBits from just this symbol */
 1286|      6|                DStream->bitsConsumed = (sizeof(DStream->bitContainer)*8);
 1287|    139|        }
 1288|    244|    }
 1289|    475|    return 1;
 1290|    475|}
huf_decompress.c:HUF_decompress1X1_usingDTable_internal:
  118|     41|    {                                                                       \
  119|     41|        if (flags & HUF_flags_bmi2) {                                       \
  ------------------
  |  Branch (119:13): [True: 41, False: 0]
  ------------------
  120|     41|            return fn##_bmi2(dst, dstSize, cSrc, cSrcSize, DTable);         \
  121|     41|        }                                                                   \
  122|     41|        return fn##_default(dst, dstSize, cSrc, cSrcSize, DTable);          \
  123|     41|    }
huf_decompress.c:HUF_decompress1X1_usingDTable_internal_bmi2:
  112|     41|    {                                                                       \
  113|     41|        return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable);             \
  114|     41|    }                                                                       \
huf_decompress.c:HUF_decompress1X1_usingDTable_internal_body:
  579|     41|{
  580|     41|    BYTE* op = (BYTE*)dst;
  581|     41|    BYTE* const oend = ZSTD_maybeNullPtrAdd(op, dstSize);
  582|     41|    const void* dtPtr = DTable + 1;
  583|     41|    const HUF_DEltX1* const dt = (const HUF_DEltX1*)dtPtr;
  584|     41|    BIT_DStream_t bitD;
  585|     41|    DTableDesc const dtd = HUF_getDTableDesc(DTable);
  586|     41|    U32 const dtLog = dtd.tableLog;
  587|       |
  588|     41|    CHECK_F( BIT_initDStream(&bitD, cSrc, cSrcSize) );
  ------------------
  |  |   63|     41|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|     41|    size_t const e = f;     \
  |  |  |  |   59|     41|    do {                    \
  |  |  |  |   60|     41|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 4, False: 37]
  |  |  |  |  ------------------
  |  |  |  |   61|     41|            return e;       \
  |  |  |  |   62|     41|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 37]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 37]
  |  |  ------------------
  ------------------
  589|       |
  590|     37|    HUF_decodeStreamX1(op, &bitD, oend, dt, dtLog);
  591|       |
  592|     37|    if (!BIT_endOfDStream(&bitD)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     36|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     36|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     36|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (592:9): [True: 36, False: 1]
  ------------------
  593|       |
  594|      1|    return dstSize;
  595|     37|}
huf_decompress.c:HUF_decodeStreamX1:
  547|    561|{
  548|    561|    BYTE* const pStart = p;
  549|       |
  550|       |    /* up to 4 symbols at a time */
  551|    561|    if ((pEnd - p) > 3) {
  ------------------
  |  Branch (551:9): [True: 471, False: 90]
  ------------------
  552|  28.4k|        while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-3)) {
  ------------------
  |  Branch (552:16): [True: 27.9k, False: 471]
  ------------------
  553|  27.9k|            HUF_DECODE_SYMBOLX1_2(p, bitDPtr);
  ------------------
  |  |  540|  27.9k|    do {                                            \
  |  |  541|  27.9k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 27.9k, False: 0]
  |  |  ------------------
  |  |  542|  27.9k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  27.9k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 27.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  27.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 27.9k]
  |  |  ------------------
  ------------------
  554|  27.9k|            HUF_DECODE_SYMBOLX1_1(p, bitDPtr);
  ------------------
  |  |  534|  27.9k|    do {                                            \
  |  |  535|  27.9k|        if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \
  |  |  ------------------
  |  |  |  |   37|      0|#define HUF_TABLELOG_MAX      12      /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */
  |  |  ------------------
  |  |  |  Branch (535:13): [True: 27.9k, False: 0]
  |  |  |  Branch (535:29): [True: 0, Folded]
  |  |  ------------------
  |  |  536|  27.9k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  27.9k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 27.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  537|  27.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (537:14): [Folded, False: 27.9k]
  |  |  ------------------
  ------------------
  555|  27.9k|            HUF_DECODE_SYMBOLX1_2(p, bitDPtr);
  ------------------
  |  |  540|  27.9k|    do {                                            \
  |  |  541|  27.9k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 27.9k, False: 0]
  |  |  ------------------
  |  |  542|  27.9k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  27.9k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 27.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  27.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 27.9k]
  |  |  ------------------
  ------------------
  556|  27.9k|            HUF_DECODE_SYMBOLX1_0(p, bitDPtr);
  ------------------
  |  |  531|  27.9k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (531:71): [Folded, False: 27.9k]
  |  |  ------------------
  ------------------
  557|  27.9k|        }
  558|    471|    } else {
  559|     90|        BIT_reloadDStream(bitDPtr);
  560|     90|    }
  561|       |
  562|       |    /* [0-3] symbols remaining */
  563|    561|    if (MEM_32bits())
  ------------------
  |  Branch (563:9): [True: 0, False: 561]
  ------------------
  564|      0|        while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd))
  ------------------
  |  Branch (564:16): [True: 0, False: 0]
  ------------------
  565|      0|            HUF_DECODE_SYMBOLX1_0(p, bitDPtr);
  ------------------
  |  |  531|      0|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (531:71): [Folded, False: 0]
  |  |  ------------------
  ------------------
  566|       |
  567|       |    /* no more data to retrieve from bitstream, no need to reload */
  568|   591k|    while (p < pEnd)
  ------------------
  |  Branch (568:12): [True: 590k, False: 561]
  ------------------
  569|   590k|        HUF_DECODE_SYMBOLX1_0(p, bitDPtr);
  ------------------
  |  |  531|   590k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (531:71): [Folded, False: 590k]
  |  |  ------------------
  ------------------
  570|       |
  571|    561|    return (size_t)(pEnd-pStart);
  572|    561|}
huf_decompress.c:HUF_decodeSymbolX1:
  523|   762k|{
  524|   762k|    size_t const val = BIT_lookBitsFast(Dstream, dtLog); /* note : dtLog >= 1 */
  525|   762k|    BYTE const c = dt[val].byte;
  526|   762k|    BIT_skipBits(Dstream, dt[val].nbBits);
  527|   762k|    return c;
  528|   762k|}
huf_decompress.c:HUF_decompress4X2_usingDTable_internal:
 1721|    227|{
 1722|    227|    HUF_DecompressUsingDTableFn fallbackFn = HUF_decompress4X2_usingDTable_internal_default;
 1723|    227|    HUF_DecompressFastLoopFn loopFn = HUF_decompress4X2_usingDTable_internal_fast_c_loop;
 1724|       |
 1725|    227|#if DYNAMIC_BMI2
 1726|    227|    if (flags & HUF_flags_bmi2) {
  ------------------
  |  Branch (1726:9): [True: 227, False: 0]
  ------------------
 1727|    227|        fallbackFn = HUF_decompress4X2_usingDTable_internal_bmi2;
 1728|    227|# if ZSTD_ENABLE_ASM_X86_64_BMI2
 1729|    227|        if (!(flags & HUF_flags_disableAsm)) {
  ------------------
  |  Branch (1729:13): [True: 227, False: 0]
  ------------------
 1730|    227|            loopFn = HUF_decompress4X2_usingDTable_internal_fast_asm_loop;
 1731|    227|        }
 1732|    227|# endif
 1733|    227|    } else {
 1734|      0|        return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable);
 1735|      0|    }
 1736|    227|#endif
 1737|       |
 1738|       |#if ZSTD_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__)
 1739|       |    if (!(flags & HUF_flags_disableAsm)) {
 1740|       |        loopFn = HUF_decompress4X2_usingDTable_internal_fast_asm_loop;
 1741|       |    }
 1742|       |#endif
 1743|       |
 1744|    227|    if (HUF_ENABLE_FAST_DECODE && !(flags & HUF_flags_disableFast)) {
  ------------------
  |  |   40|    454|# define HUF_ENABLE_FAST_DECODE 1
  |  |  ------------------
  |  |  |  Branch (40:33): [True: 227, Folded]
  |  |  ------------------
  ------------------
  |  Branch (1744:35): [True: 227, False: 0]
  ------------------
 1745|    227|        size_t const ret = HUF_decompress4X2_usingDTable_internal_fast(dst, dstSize, cSrc, cSrcSize, DTable, loopFn);
 1746|    227|        if (ret != 0)
  ------------------
  |  Branch (1746:13): [True: 72, False: 155]
  ------------------
 1747|     72|            return ret;
 1748|    227|    }
 1749|    155|    return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable);
 1750|    227|}
huf_decompress.c:HUF_decompress4X2_usingDTable_internal_body:
 1388|    155|{
 1389|    155|    if (cSrcSize < 10) return ERROR(corruption_detected);   /* strict minimum : jump table + 1 byte per stream */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1389:9): [True: 0, False: 155]
  ------------------
 1390|    155|    if (dstSize < 6) return ERROR(corruption_detected);         /* stream 4-split doesn't work */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1390:9): [True: 0, False: 155]
  ------------------
 1391|       |
 1392|    155|    {   const BYTE* const istart = (const BYTE*) cSrc;
 1393|    155|        BYTE* const ostart = (BYTE*) dst;
 1394|    155|        BYTE* const oend = ostart + dstSize;
 1395|    155|        BYTE* const olimit = oend - (sizeof(size_t)-1);
 1396|    155|        const void* const dtPtr = DTable+1;
 1397|    155|        const HUF_DEltX2* const dt = (const HUF_DEltX2*)dtPtr;
 1398|       |
 1399|       |        /* Init */
 1400|    155|        BIT_DStream_t bitD1;
 1401|    155|        BIT_DStream_t bitD2;
 1402|    155|        BIT_DStream_t bitD3;
 1403|    155|        BIT_DStream_t bitD4;
 1404|    155|        size_t const length1 = MEM_readLE16(istart);
 1405|    155|        size_t const length2 = MEM_readLE16(istart+2);
 1406|    155|        size_t const length3 = MEM_readLE16(istart+4);
 1407|    155|        size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);
 1408|    155|        const BYTE* const istart1 = istart + 6;  /* jumpTable */
 1409|    155|        const BYTE* const istart2 = istart1 + length1;
 1410|    155|        const BYTE* const istart3 = istart2 + length2;
 1411|    155|        const BYTE* const istart4 = istart3 + length3;
 1412|    155|        size_t const segmentSize = (dstSize+3) / 4;
 1413|    155|        BYTE* const opStart2 = ostart + segmentSize;
 1414|    155|        BYTE* const opStart3 = opStart2 + segmentSize;
 1415|    155|        BYTE* const opStart4 = opStart3 + segmentSize;
 1416|    155|        BYTE* op1 = ostart;
 1417|    155|        BYTE* op2 = opStart2;
 1418|    155|        BYTE* op3 = opStart3;
 1419|    155|        BYTE* op4 = opStart4;
 1420|    155|        U32 endSignal = 1;
 1421|    155|        DTableDesc const dtd = HUF_getDTableDesc(DTable);
 1422|    155|        U32 const dtLog = dtd.tableLog;
 1423|       |
 1424|    155|        if (length4 > cSrcSize) return ERROR(corruption_detected);  /* overflow */
  ------------------
  |  |   49|      7|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      7|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      7|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1424:13): [True: 7, False: 148]
  ------------------
 1425|    148|        if (opStart4 > oend) return ERROR(corruption_detected);     /* overflow */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1425:13): [True: 0, False: 148]
  ------------------
 1426|    148|        assert(dstSize >= 6 /* validated above */);
  ------------------
  |  |   70|    148|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1427|    148|        CHECK_F( BIT_initDStream(&bitD1, istart1, length1) );
  ------------------
  |  |   63|    148|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    148|    size_t const e = f;     \
  |  |  |  |   59|    148|    do {                    \
  |  |  |  |   60|    148|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 4, False: 144]
  |  |  |  |  ------------------
  |  |  |  |   61|    148|            return e;       \
  |  |  |  |   62|    148|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 144]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 144]
  |  |  ------------------
  ------------------
 1428|    144|        CHECK_F( BIT_initDStream(&bitD2, istart2, length2) );
  ------------------
  |  |   63|    144|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    144|    size_t const e = f;     \
  |  |  |  |   59|    144|    do {                    \
  |  |  |  |   60|    144|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 7, False: 137]
  |  |  |  |  ------------------
  |  |  |  |   61|    144|            return e;       \
  |  |  |  |   62|    144|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 137]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 137]
  |  |  ------------------
  ------------------
 1429|    137|        CHECK_F( BIT_initDStream(&bitD3, istart3, length3) );
  ------------------
  |  |   63|    137|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    137|    size_t const e = f;     \
  |  |  |  |   59|    137|    do {                    \
  |  |  |  |   60|    137|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 2, False: 135]
  |  |  |  |  ------------------
  |  |  |  |   61|    137|            return e;       \
  |  |  |  |   62|    137|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 135]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 135]
  |  |  ------------------
  ------------------
 1430|    135|        CHECK_F( BIT_initDStream(&bitD4, istart4, length4) );
  ------------------
  |  |   63|    135|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    135|    size_t const e = f;     \
  |  |  |  |   59|    135|    do {                    \
  |  |  |  |   60|    135|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 1, False: 134]
  |  |  |  |  ------------------
  |  |  |  |   61|    135|            return e;       \
  |  |  |  |   62|    135|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 134]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 134]
  |  |  ------------------
  ------------------
 1431|       |
 1432|       |        /* 16-32 symbols per loop (4-8 symbols per stream) */
 1433|    134|        if ((size_t)(oend - op4) >= sizeof(size_t)) {
  ------------------
  |  Branch (1433:13): [True: 134, False: 0]
  ------------------
 1434|  3.13k|            for ( ; (endSignal) & (op4 < olimit); ) {
  ------------------
  |  Branch (1434:21): [True: 2.99k, False: 134]
  ------------------
 1435|  2.99k|#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
 1436|  2.99k|                HUF_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 1302|  2.99k|    do {                                                           \
  |  | 1303|  2.99k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 2.99k, False: 0]
  |  |  ------------------
  |  | 1304|  2.99k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  2.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1437|  2.99k|                HUF_DECODE_SYMBOLX2_1(op1, &bitD1);
  ------------------
  |  | 1296|  2.99k|    do {                                                           \
  |  | 1297|  2.99k|        if (MEM_64bits() || (HUF_TABLELOG_MAX<=12))                \
  |  |  ------------------
  |  |  |  |   37|      0|#define HUF_TABLELOG_MAX      12      /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */
  |  |  ------------------
  |  |  |  Branch (1297:13): [True: 2.99k, False: 0]
  |  |  |  Branch (1297:29): [True: 0, Folded]
  |  |  ------------------
  |  | 1298|  2.99k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1299|  2.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1299:14): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1438|  2.99k|                HUF_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 1302|  2.99k|    do {                                                           \
  |  | 1303|  2.99k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 2.99k, False: 0]
  |  |  ------------------
  |  | 1304|  2.99k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  2.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1439|  2.99k|                HUF_DECODE_SYMBOLX2_0(op1, &bitD1);
  ------------------
  |  | 1293|  2.99k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1440|  2.99k|                HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 1302|  2.99k|    do {                                                           \
  |  | 1303|  2.99k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 2.99k, False: 0]
  |  |  ------------------
  |  | 1304|  2.99k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  2.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1441|  2.99k|                HUF_DECODE_SYMBOLX2_1(op2, &bitD2);
  ------------------
  |  | 1296|  2.99k|    do {                                                           \
  |  | 1297|  2.99k|        if (MEM_64bits() || (HUF_TABLELOG_MAX<=12))                \
  |  |  ------------------
  |  |  |  |   37|      0|#define HUF_TABLELOG_MAX      12      /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */
  |  |  ------------------
  |  |  |  Branch (1297:13): [True: 2.99k, False: 0]
  |  |  |  Branch (1297:29): [True: 0, Folded]
  |  |  ------------------
  |  | 1298|  2.99k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1299|  2.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1299:14): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1442|  2.99k|                HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 1302|  2.99k|    do {                                                           \
  |  | 1303|  2.99k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 2.99k, False: 0]
  |  |  ------------------
  |  | 1304|  2.99k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  2.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1443|  2.99k|                HUF_DECODE_SYMBOLX2_0(op2, &bitD2);
  ------------------
  |  | 1293|  2.99k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1444|  2.99k|                endSignal &= BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished;
 1445|  2.99k|                endSignal &= BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished;
 1446|  2.99k|                HUF_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 1302|  2.99k|    do {                                                           \
  |  | 1303|  2.99k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 2.99k, False: 0]
  |  |  ------------------
  |  | 1304|  2.99k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  2.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1447|  2.99k|                HUF_DECODE_SYMBOLX2_1(op3, &bitD3);
  ------------------
  |  | 1296|  2.99k|    do {                                                           \
  |  | 1297|  2.99k|        if (MEM_64bits() || (HUF_TABLELOG_MAX<=12))                \
  |  |  ------------------
  |  |  |  |   37|      0|#define HUF_TABLELOG_MAX      12      /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */
  |  |  ------------------
  |  |  |  Branch (1297:13): [True: 2.99k, False: 0]
  |  |  |  Branch (1297:29): [True: 0, Folded]
  |  |  ------------------
  |  | 1298|  2.99k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1299|  2.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1299:14): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1448|  2.99k|                HUF_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 1302|  2.99k|    do {                                                           \
  |  | 1303|  2.99k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 2.99k, False: 0]
  |  |  ------------------
  |  | 1304|  2.99k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  2.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1449|  2.99k|                HUF_DECODE_SYMBOLX2_0(op3, &bitD3);
  ------------------
  |  | 1293|  2.99k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1450|  2.99k|                HUF_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 1302|  2.99k|    do {                                                           \
  |  | 1303|  2.99k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 2.99k, False: 0]
  |  |  ------------------
  |  | 1304|  2.99k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  2.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1451|  2.99k|                HUF_DECODE_SYMBOLX2_1(op4, &bitD4);
  ------------------
  |  | 1296|  2.99k|    do {                                                           \
  |  | 1297|  2.99k|        if (MEM_64bits() || (HUF_TABLELOG_MAX<=12))                \
  |  |  ------------------
  |  |  |  |   37|      0|#define HUF_TABLELOG_MAX      12      /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */
  |  |  ------------------
  |  |  |  Branch (1297:13): [True: 2.99k, False: 0]
  |  |  |  Branch (1297:29): [True: 0, Folded]
  |  |  ------------------
  |  | 1298|  2.99k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1299|  2.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1299:14): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1452|  2.99k|                HUF_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 1302|  2.99k|    do {                                                           \
  |  | 1303|  2.99k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 2.99k, False: 0]
  |  |  ------------------
  |  | 1304|  2.99k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  2.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1453|  2.99k|                HUF_DECODE_SYMBOLX2_0(op4, &bitD4);
  ------------------
  |  | 1293|  2.99k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1454|  2.99k|                endSignal &= BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished;
 1455|  2.99k|                endSignal &= BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished;
 1456|       |#else
 1457|       |                HUF_DECODE_SYMBOLX2_2(op1, &bitD1);
 1458|       |                HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
 1459|       |                HUF_DECODE_SYMBOLX2_2(op3, &bitD3);
 1460|       |                HUF_DECODE_SYMBOLX2_2(op4, &bitD4);
 1461|       |                HUF_DECODE_SYMBOLX2_1(op1, &bitD1);
 1462|       |                HUF_DECODE_SYMBOLX2_1(op2, &bitD2);
 1463|       |                HUF_DECODE_SYMBOLX2_1(op3, &bitD3);
 1464|       |                HUF_DECODE_SYMBOLX2_1(op4, &bitD4);
 1465|       |                HUF_DECODE_SYMBOLX2_2(op1, &bitD1);
 1466|       |                HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
 1467|       |                HUF_DECODE_SYMBOLX2_2(op3, &bitD3);
 1468|       |                HUF_DECODE_SYMBOLX2_2(op4, &bitD4);
 1469|       |                HUF_DECODE_SYMBOLX2_0(op1, &bitD1);
 1470|       |                HUF_DECODE_SYMBOLX2_0(op2, &bitD2);
 1471|       |                HUF_DECODE_SYMBOLX2_0(op3, &bitD3);
 1472|       |                HUF_DECODE_SYMBOLX2_0(op4, &bitD4);
 1473|       |                endSignal = (U32)LIKELY((U32)
 1474|       |                            (BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished)
 1475|       |                        & (BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished)
 1476|       |                        & (BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished)
 1477|       |                        & (BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished));
 1478|       |#endif
 1479|  2.99k|            }
 1480|    134|        }
 1481|       |
 1482|       |        /* check corruption */
 1483|    134|        if (op1 > opStart2) return ERROR(corruption_detected);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1483:13): [True: 1, False: 133]
  ------------------
 1484|    133|        if (op2 > opStart3) return ERROR(corruption_detected);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1484:13): [True: 1, False: 132]
  ------------------
 1485|    132|        if (op3 > opStart4) return ERROR(corruption_detected);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1485:13): [True: 1, False: 131]
  ------------------
 1486|       |        /* note : op4 already verified within main loop */
 1487|       |
 1488|       |        /* finish bitStreams one by one */
 1489|    131|        HUF_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog);
 1490|    131|        HUF_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog);
 1491|    131|        HUF_decodeStreamX2(op3, &bitD3, opStart4, dt, dtLog);
 1492|    131|        HUF_decodeStreamX2(op4, &bitD4, oend,     dt, dtLog);
 1493|       |
 1494|       |        /* check */
 1495|    131|        { U32 const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4);
 1496|    131|          if (!endCheck) return ERROR(corruption_detected); }
  ------------------
  |  |   49|    131|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    131|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    131|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1496:15): [True: 131, False: 0]
  ------------------
 1497|       |
 1498|       |        /* decoded size */
 1499|      0|        return dstSize;
 1500|    131|    }
 1501|    131|}
huf_decompress.c:HUF_decompress4X2_usingDTable_internal_bmi2:
 1506|    155|                    size_t cSrcSize, HUF_DTable const* DTable) {
 1507|    155|    return HUF_decompress4X2_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable);
 1508|    155|}
huf_decompress.c:HUF_decompress4X2_usingDTable_internal_fast:
 1671|    227|    HUF_DecompressFastLoopFn loopFn) {
 1672|    227|    void const* dt = DTable + 1;
 1673|    227|    const BYTE* const ilowest = (const BYTE*)cSrc;
 1674|    227|    BYTE* const oend = ZSTD_maybeNullPtrAdd((BYTE*)dst, dstSize);
 1675|    227|    HUF_DecompressFastArgs args;
 1676|    227|    {
 1677|    227|        size_t const ret = HUF_DecompressFastArgs_init(&args, dst, dstSize, cSrc, cSrcSize, DTable);
 1678|    227|        FORWARD_IF_ERROR(ret, "Failed to init asm args");
  ------------------
  |  |  146|    227|    do {                                                                           \
  |  |  147|    227|        size_t const err_code = (err);                                             \
  |  |  148|    227|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 16, False: 211]
  |  |  ------------------
  |  |  149|     16|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|     16|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     16|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|     16|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|     16|    do {                                           \
  |  |  |  |   99|     16|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 16]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     16|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|     16|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|     16|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|     16|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|     16|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|     16|            return err_code;                                                       \
  |  |  155|     16|        }                                                                          \
  |  |  156|    227|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 211]
  |  |  ------------------
  ------------------
 1679|    211|        if (ret == 0)
  ------------------
  |  Branch (1679:13): [True: 155, False: 56]
  ------------------
 1680|    155|            return 0;
 1681|    211|    }
 1682|       |
 1683|     56|    assert(args.ip[0] >= args.ilowest);
  ------------------
  |  |   70|     56|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1684|     56|    loopFn(&args);
 1685|       |
 1686|       |    /* note : op4 already verified within main loop */
 1687|     56|    assert(args.ip[0] >= ilowest);
  ------------------
  |  |   70|     56|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1688|     56|    assert(args.ip[1] >= ilowest);
  ------------------
  |  |   70|     56|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1689|     56|    assert(args.ip[2] >= ilowest);
  ------------------
  |  |   70|     56|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1690|     56|    assert(args.ip[3] >= ilowest);
  ------------------
  |  |   70|     56|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1691|     56|    assert(args.op[3] <= oend);
  ------------------
  |  |   70|     56|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1692|       |
 1693|     56|    assert(ilowest == args.ilowest);
  ------------------
  |  |   70|     56|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1694|     56|    assert(ilowest + 6 == args.iend[0]);
  ------------------
  |  |   70|     56|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1695|     56|    (void)ilowest;
 1696|       |
 1697|       |    /* finish bitStreams one by one */
 1698|     56|    {
 1699|     56|        size_t const segmentSize = (dstSize+3) / 4;
 1700|     56|        BYTE* segmentEnd = (BYTE*)dst;
 1701|     56|        int i;
 1702|    245|        for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (1702:21): [True: 207, False: 38]
  ------------------
 1703|    207|            BIT_DStream_t bit;
 1704|    207|            if (segmentSize <= (size_t)(oend - segmentEnd))
  ------------------
  |  Branch (1704:17): [True: 194, False: 13]
  ------------------
 1705|    194|                segmentEnd += segmentSize;
 1706|     13|            else
 1707|     13|                segmentEnd = oend;
 1708|    207|            FORWARD_IF_ERROR(HUF_initRemainingDStream(&bit, &args, i, segmentEnd), "corruption");
  ------------------
  |  |  146|    207|    do {                                                                           \
  |  |  147|    207|        size_t const err_code = (err);                                             \
  |  |  148|    207|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 18, False: 189]
  |  |  ------------------
  |  |  149|     18|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|     18|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     18|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|     18|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|     18|    do {                                           \
  |  |  |  |   99|     18|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 18]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     18|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|     18|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|     18|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|     18|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|     18|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|     18|            return err_code;                                                       \
  |  |  155|     18|        }                                                                          \
  |  |  156|    207|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 189]
  |  |  ------------------
  ------------------
 1709|    189|            args.op[i] += HUF_decodeStreamX2(args.op[i], &bit, segmentEnd, (HUF_DEltX2 const*)dt, HUF_DECODER_FAST_TABLELOG);
  ------------------
  |  |   31|    189|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
 1710|    189|            if (args.op[i] != segmentEnd)
  ------------------
  |  Branch (1710:17): [True: 0, False: 189]
  ------------------
 1711|      0|                return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1712|    189|        }
 1713|     56|    }
 1714|       |
 1715|       |    /* decoded size */
 1716|     38|    return dstSize;
 1717|     56|}
huf_decompress.c:HUF_DecompressFastArgs_init:
  192|    447|{
  193|    447|    void const* dt = DTable + 1;
  194|    447|    U32 const dtLog = HUF_getDTableDesc(DTable).tableLog;
  195|       |
  196|    447|    const BYTE* const istart = (const BYTE*)src;
  197|       |
  198|    447|    BYTE* const oend = ZSTD_maybeNullPtrAdd((BYTE*)dst, dstSize);
  199|       |
  200|       |    /* The fast decoding loop assumes 64-bit little-endian.
  201|       |     * This condition is false on x32.
  202|       |     */
  203|    447|    if (!MEM_isLittleEndian() || MEM_32bits())
  ------------------
  |  Branch (203:9): [True: 0, False: 447]
  |  Branch (203:34): [True: 0, False: 447]
  ------------------
  204|      0|        return 0;
  205|       |
  206|       |    /* Avoid nullptr addition */
  207|    447|    if (dstSize == 0)
  ------------------
  |  Branch (207:9): [True: 0, False: 447]
  ------------------
  208|      0|        return 0;
  209|    447|    assert(dst != NULL);
  ------------------
  |  |   70|    447|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  210|       |
  211|       |    /* strict minimum : jump table + 1 byte per stream */
  212|    447|    if (srcSize < 10)
  ------------------
  |  Branch (212:9): [True: 16, False: 431]
  ------------------
  213|     16|        return ERROR(corruption_detected);
  ------------------
  |  |   49|     16|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     16|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     16|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|       |
  215|       |    /* Must have at least 8 bytes per stream because we don't handle initializing smaller bit containers.
  216|       |     * If table log is not correct at this point, fallback to the old decoder.
  217|       |     * On small inputs we don't have enough data to trigger the fast loop, so use the old decoder.
  218|       |     */
  219|    431|    if (dtLog != HUF_DECODER_FAST_TABLELOG)
  ------------------
  |  |   31|    431|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
  |  Branch (219:9): [True: 154, False: 277]
  ------------------
  220|    154|        return 0;
  221|       |
  222|       |    /* Read the jump table. */
  223|    277|    {
  224|    277|        size_t const length1 = MEM_readLE16(istart);
  225|    277|        size_t const length2 = MEM_readLE16(istart+2);
  226|    277|        size_t const length3 = MEM_readLE16(istart+4);
  227|    277|        size_t const length4 = srcSize - (length1 + length2 + length3 + 6);
  228|    277|        args->iend[0] = istart + 6;  /* jumpTable */
  229|    277|        args->iend[1] = args->iend[0] + length1;
  230|    277|        args->iend[2] = args->iend[1] + length2;
  231|    277|        args->iend[3] = args->iend[2] + length3;
  232|       |
  233|       |        /* HUF_initFastDStream() requires this, and this small of an input
  234|       |         * won't benefit from the ASM loop anyways.
  235|       |         */
  236|    277|        if (length1 < 8 || length2 < 8 || length3 < 8 || length4 < 8)
  ------------------
  |  Branch (236:13): [True: 33, False: 244]
  |  Branch (236:28): [True: 56, False: 188]
  |  Branch (236:43): [True: 35, False: 153]
  |  Branch (236:58): [True: 3, False: 150]
  ------------------
  237|    127|            return 0;
  238|    150|        if (length4 > srcSize) return ERROR(corruption_detected);   /* overflow */
  ------------------
  |  |   49|     44|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     44|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     44|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (238:13): [True: 44, False: 106]
  ------------------
  239|    150|    }
  240|       |    /* ip[] contains the position that is currently loaded into bits[]. */
  241|    106|    args->ip[0] = args->iend[1] - sizeof(U64);
  242|    106|    args->ip[1] = args->iend[2] - sizeof(U64);
  243|    106|    args->ip[2] = args->iend[3] - sizeof(U64);
  244|    106|    args->ip[3] = (BYTE const*)src + srcSize - sizeof(U64);
  245|       |
  246|       |    /* op[] contains the output pointers. */
  247|    106|    args->op[0] = (BYTE*)dst;
  248|    106|    args->op[1] = args->op[0] + (dstSize+3)/4;
  249|    106|    args->op[2] = args->op[1] + (dstSize+3)/4;
  250|    106|    args->op[3] = args->op[2] + (dstSize+3)/4;
  251|       |
  252|       |    /* No point to call the ASM loop for tiny outputs. */
  253|    106|    if (args->op[3] >= oend)
  ------------------
  |  Branch (253:9): [True: 1, False: 105]
  ------------------
  254|      1|        return 0;
  255|       |
  256|       |    /* bits[] is the bit container.
  257|       |        * It is read from the MSB down to the LSB.
  258|       |        * It is shifted left as it is read, and zeros are
  259|       |        * shifted in. After the lowest valid bit a 1 is
  260|       |        * set, so that CountTrailingZeros(bits[]) can be used
  261|       |        * to count how many bits we've consumed.
  262|       |        */
  263|    105|    args->bits[0] = HUF_initFastDStream(args->ip[0]);
  264|    105|    args->bits[1] = HUF_initFastDStream(args->ip[1]);
  265|    105|    args->bits[2] = HUF_initFastDStream(args->ip[2]);
  266|    105|    args->bits[3] = HUF_initFastDStream(args->ip[3]);
  267|       |
  268|       |    /* The decoders must be sure to never read beyond ilowest.
  269|       |     * This is lower than iend[0], but allowing decoders to read
  270|       |     * down to ilowest can allow an extra iteration or two in the
  271|       |     * fast loop.
  272|       |     */
  273|    105|    args->ilowest = istart;
  274|       |
  275|    105|    args->oend = oend;
  276|    105|    args->dt = dt;
  277|       |
  278|    105|    return 1;
  279|    106|}
huf_decompress.c:HUF_initFastDStream:
  150|    420|static size_t HUF_initFastDStream(BYTE const* ip) {
  151|    420|    BYTE const lastByte = ip[7];
  152|    420|    size_t const bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (152:33): [True: 349, False: 71]
  ------------------
  153|    420|    size_t const value = MEM_readLEST(ip) | 1;
  154|    420|    assert(bitsConsumed <= 8);
  ------------------
  |  |   70|    420|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  155|    420|    assert(sizeof(size_t) == 8);
  ------------------
  |  |   70|    420|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  156|    420|    return value << bitsConsumed;
  157|    420|}
huf_decompress.c:HUF_initRemainingDStream:
  282|    387|{
  283|       |    /* Validate that we haven't overwritten. */
  284|    387|    if (args->op[stream] > segmentEnd)
  ------------------
  |  Branch (284:9): [True: 0, False: 387]
  ------------------
  285|      0|        return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  286|       |    /* Validate that we haven't read beyond iend[].
  287|       |        * Note that ip[] may be < iend[] because the MSB is
  288|       |        * the next bit to read, and we may have consumed 100%
  289|       |        * of the stream, so down to iend[i] - 8 is valid.
  290|       |        */
  291|    387|    if (args->ip[stream] < args->iend[stream] - 8)
  ------------------
  |  Branch (291:9): [True: 30, False: 357]
  ------------------
  292|     30|        return ERROR(corruption_detected);
  ------------------
  |  |   49|     30|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     30|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     30|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  293|       |
  294|       |    /* Construct the BIT_DStream_t. */
  295|    357|    assert(sizeof(size_t) == 8);
  ------------------
  |  |   70|    357|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  296|    357|    bit->bitContainer = MEM_readLEST(args->ip[stream]);
  297|    357|    bit->bitsConsumed = ZSTD_countTrailingZeros64(args->bits[stream]);
  298|    357|    bit->start = (const char*)args->ilowest;
  299|    357|    bit->limitPtr = bit->start + sizeof(size_t);
  300|    357|    bit->ptr = (const char*)args->ip[stream];
  301|       |
  302|    357|    return 0;
  303|    387|}
huf_decompress.c:HUF_decompress4X1_usingDTable_internal:
  899|    220|{
  900|    220|    HUF_DecompressUsingDTableFn fallbackFn = HUF_decompress4X1_usingDTable_internal_default;
  901|    220|    HUF_DecompressFastLoopFn loopFn = HUF_decompress4X1_usingDTable_internal_fast_c_loop;
  902|       |
  903|    220|#if DYNAMIC_BMI2
  904|    220|    if (flags & HUF_flags_bmi2) {
  ------------------
  |  Branch (904:9): [True: 220, False: 0]
  ------------------
  905|    220|        fallbackFn = HUF_decompress4X1_usingDTable_internal_bmi2;
  906|    220|# if ZSTD_ENABLE_ASM_X86_64_BMI2
  907|    220|        if (!(flags & HUF_flags_disableAsm)) {
  ------------------
  |  Branch (907:13): [True: 220, False: 0]
  ------------------
  908|    220|            loopFn = HUF_decompress4X1_usingDTable_internal_fast_asm_loop;
  909|    220|        }
  910|    220|# endif
  911|    220|    } else {
  912|      0|        return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable);
  913|      0|    }
  914|    220|#endif
  915|       |
  916|       |#if ZSTD_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__)
  917|       |    if (!(flags & HUF_flags_disableAsm)) {
  918|       |        loopFn = HUF_decompress4X1_usingDTable_internal_fast_asm_loop;
  919|       |    }
  920|       |#endif
  921|       |
  922|    220|    if (HUF_ENABLE_FAST_DECODE && !(flags & HUF_flags_disableFast)) {
  ------------------
  |  |   40|    440|# define HUF_ENABLE_FAST_DECODE 1
  |  |  ------------------
  |  |  |  Branch (40:33): [True: 220, Folded]
  |  |  ------------------
  ------------------
  |  Branch (922:35): [True: 220, False: 0]
  ------------------
  923|    220|        size_t const ret = HUF_decompress4X1_usingDTable_internal_fast(dst, dstSize, cSrc, cSrcSize, DTable, loopFn);
  924|    220|        if (ret != 0)
  ------------------
  |  Branch (924:13): [True: 93, False: 127]
  ------------------
  925|     93|            return ret;
  926|    220|    }
  927|    127|    return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable);
  928|    220|}
huf_decompress.c:HUF_decompress4X1_usingDTable_internal_body:
  606|    127|{
  607|       |    /* Check */
  608|    127|    if (cSrcSize < 10) return ERROR(corruption_detected);  /* strict minimum : jump table + 1 byte per stream */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (608:9): [True: 0, False: 127]
  ------------------
  609|    127|    if (dstSize < 6) return ERROR(corruption_detected);         /* stream 4-split doesn't work */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (609:9): [True: 0, False: 127]
  ------------------
  610|       |
  611|    127|    {   const BYTE* const istart = (const BYTE*) cSrc;
  612|    127|        BYTE* const ostart = (BYTE*) dst;
  613|    127|        BYTE* const oend = ostart + dstSize;
  614|    127|        BYTE* const olimit = oend - 3;
  615|    127|        const void* const dtPtr = DTable + 1;
  616|    127|        const HUF_DEltX1* const dt = (const HUF_DEltX1*)dtPtr;
  617|       |
  618|       |        /* Init */
  619|    127|        BIT_DStream_t bitD1;
  620|    127|        BIT_DStream_t bitD2;
  621|    127|        BIT_DStream_t bitD3;
  622|    127|        BIT_DStream_t bitD4;
  623|    127|        size_t const length1 = MEM_readLE16(istart);
  624|    127|        size_t const length2 = MEM_readLE16(istart+2);
  625|    127|        size_t const length3 = MEM_readLE16(istart+4);
  626|    127|        size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);
  627|    127|        const BYTE* const istart1 = istart + 6;  /* jumpTable */
  628|    127|        const BYTE* const istart2 = istart1 + length1;
  629|    127|        const BYTE* const istart3 = istart2 + length2;
  630|    127|        const BYTE* const istart4 = istart3 + length3;
  631|    127|        const size_t segmentSize = (dstSize+3) / 4;
  632|    127|        BYTE* const opStart2 = ostart + segmentSize;
  633|    127|        BYTE* const opStart3 = opStart2 + segmentSize;
  634|    127|        BYTE* const opStart4 = opStart3 + segmentSize;
  635|    127|        BYTE* op1 = ostart;
  636|    127|        BYTE* op2 = opStart2;
  637|    127|        BYTE* op3 = opStart3;
  638|    127|        BYTE* op4 = opStart4;
  639|    127|        DTableDesc const dtd = HUF_getDTableDesc(DTable);
  640|    127|        U32 const dtLog = dtd.tableLog;
  641|    127|        U32 endSignal = 1;
  642|       |
  643|    127|        if (length4 > cSrcSize) return ERROR(corruption_detected);   /* overflow */
  ------------------
  |  |   49|     17|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     17|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     17|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (643:13): [True: 17, False: 110]
  ------------------
  644|    110|        if (opStart4 > oend) return ERROR(corruption_detected);      /* overflow */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (644:13): [True: 0, False: 110]
  ------------------
  645|    110|        assert(dstSize >= 6); /* validated above */
  ------------------
  |  |   70|    110|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  646|    110|        CHECK_F( BIT_initDStream(&bitD1, istart1, length1) );
  ------------------
  |  |   63|    110|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    110|    size_t const e = f;     \
  |  |  |  |   59|    110|    do {                    \
  |  |  |  |   60|    110|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 6, False: 104]
  |  |  |  |  ------------------
  |  |  |  |   61|    110|            return e;       \
  |  |  |  |   62|    110|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 104]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 104]
  |  |  ------------------
  ------------------
  647|    104|        CHECK_F( BIT_initDStream(&bitD2, istart2, length2) );
  ------------------
  |  |   63|    104|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    104|    size_t const e = f;     \
  |  |  |  |   59|    104|    do {                    \
  |  |  |  |   60|    104|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 3, False: 101]
  |  |  |  |  ------------------
  |  |  |  |   61|    104|            return e;       \
  |  |  |  |   62|    104|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 101]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 101]
  |  |  ------------------
  ------------------
  648|    101|        CHECK_F( BIT_initDStream(&bitD3, istart3, length3) );
  ------------------
  |  |   63|    101|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    101|    size_t const e = f;     \
  |  |  |  |   59|    101|    do {                    \
  |  |  |  |   60|    101|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 6, False: 95]
  |  |  |  |  ------------------
  |  |  |  |   61|    101|            return e;       \
  |  |  |  |   62|    101|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 95]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 95]
  |  |  ------------------
  ------------------
  649|     95|        CHECK_F( BIT_initDStream(&bitD4, istart4, length4) );
  ------------------
  |  |   63|     95|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|     95|    size_t const e = f;     \
  |  |  |  |   59|     95|    do {                    \
  |  |  |  |   60|     95|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 6, False: 89]
  |  |  |  |  ------------------
  |  |  |  |   61|     95|            return e;       \
  |  |  |  |   62|     95|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 89]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 89]
  |  |  ------------------
  ------------------
  650|       |
  651|       |        /* up to 16 symbols per loop (4 symbols per stream) in 64-bit mode */
  652|     89|        if ((size_t)(oend - op4) >= sizeof(size_t)) {
  ------------------
  |  Branch (652:13): [True: 82, False: 7]
  ------------------
  653|  3.81k|            for ( ; (endSignal) & (op4 < olimit) ; ) {
  ------------------
  |  Branch (653:21): [True: 3.73k, False: 82]
  ------------------
  654|  3.73k|                HUF_DECODE_SYMBOLX1_2(op1, &bitD1);
  ------------------
  |  |  540|  3.73k|    do {                                            \
  |  |  541|  3.73k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 3.73k, False: 0]
  |  |  ------------------
  |  |  542|  3.73k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  3.73k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 3.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  3.73k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 3.73k]
  |  |  ------------------
  ------------------
  655|  3.73k|                HUF_DECODE_SYMBOLX1_2(op2, &bitD2);
  ------------------
  |  |  540|  3.73k|    do {                                            \
  |  |  541|  3.73k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 3.73k, False: 0]
  |  |  ------------------
  |  |  542|  3.73k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  3.73k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 3.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  3.73k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 3.73k]
  |  |  ------------------
  ------------------
  656|  3.73k|                HUF_DECODE_SYMBOLX1_2(op3, &bitD3);
  ------------------
  |  |  540|  3.73k|    do {                                            \
  |  |  541|  3.73k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 3.73k, False: 0]
  |  |  ------------------
  |  |  542|  3.73k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  3.73k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 3.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  3.73k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 3.73k]
  |  |  ------------------
  ------------------
  657|  3.73k|                HUF_DECODE_SYMBOLX1_2(op4, &bitD4);
  ------------------
  |  |  540|  3.73k|    do {                                            \
  |  |  541|  3.73k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 3.73k, False: 0]
  |  |  ------------------
  |  |  542|  3.73k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  3.73k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 3.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  3.73k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 3.73k]
  |  |  ------------------
  ------------------
  658|  3.73k|                HUF_DECODE_SYMBOLX1_1(op1, &bitD1);
  ------------------
  |  |  534|  3.73k|    do {                                            \
  |  |  535|  3.73k|        if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \
  |  |  ------------------
  |  |  |  |   37|      0|#define HUF_TABLELOG_MAX      12      /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */
  |  |  ------------------
  |  |  |  Branch (535:13): [True: 3.73k, False: 0]
  |  |  |  Branch (535:29): [True: 0, Folded]
  |  |  ------------------
  |  |  536|  3.73k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  3.73k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 3.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  537|  3.73k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (537:14): [Folded, False: 3.73k]
  |  |  ------------------
  ------------------
  659|  3.73k|                HUF_DECODE_SYMBOLX1_1(op2, &bitD2);
  ------------------
  |  |  534|  3.73k|    do {                                            \
  |  |  535|  3.73k|        if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \
  |  |  ------------------
  |  |  |  |   37|      0|#define HUF_TABLELOG_MAX      12      /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */
  |  |  ------------------
  |  |  |  Branch (535:13): [True: 3.73k, False: 0]
  |  |  |  Branch (535:29): [True: 0, Folded]
  |  |  ------------------
  |  |  536|  3.73k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  3.73k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 3.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  537|  3.73k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (537:14): [Folded, False: 3.73k]
  |  |  ------------------
  ------------------
  660|  3.73k|                HUF_DECODE_SYMBOLX1_1(op3, &bitD3);
  ------------------
  |  |  534|  3.73k|    do {                                            \
  |  |  535|  3.73k|        if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \
  |  |  ------------------
  |  |  |  |   37|      0|#define HUF_TABLELOG_MAX      12      /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */
  |  |  ------------------
  |  |  |  Branch (535:13): [True: 3.73k, False: 0]
  |  |  |  Branch (535:29): [True: 0, Folded]
  |  |  ------------------
  |  |  536|  3.73k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  3.73k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 3.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  537|  3.73k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (537:14): [Folded, False: 3.73k]
  |  |  ------------------
  ------------------
  661|  3.73k|                HUF_DECODE_SYMBOLX1_1(op4, &bitD4);
  ------------------
  |  |  534|  3.73k|    do {                                            \
  |  |  535|  3.73k|        if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \
  |  |  ------------------
  |  |  |  |   37|      0|#define HUF_TABLELOG_MAX      12      /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */
  |  |  ------------------
  |  |  |  Branch (535:13): [True: 3.73k, False: 0]
  |  |  |  Branch (535:29): [True: 0, Folded]
  |  |  ------------------
  |  |  536|  3.73k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  3.73k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 3.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  537|  3.73k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (537:14): [Folded, False: 3.73k]
  |  |  ------------------
  ------------------
  662|  3.73k|                HUF_DECODE_SYMBOLX1_2(op1, &bitD1);
  ------------------
  |  |  540|  3.73k|    do {                                            \
  |  |  541|  3.73k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 3.73k, False: 0]
  |  |  ------------------
  |  |  542|  3.73k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  3.73k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 3.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  3.73k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 3.73k]
  |  |  ------------------
  ------------------
  663|  3.73k|                HUF_DECODE_SYMBOLX1_2(op2, &bitD2);
  ------------------
  |  |  540|  3.73k|    do {                                            \
  |  |  541|  3.73k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 3.73k, False: 0]
  |  |  ------------------
  |  |  542|  3.73k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  3.73k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 3.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  3.73k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 3.73k]
  |  |  ------------------
  ------------------
  664|  3.73k|                HUF_DECODE_SYMBOLX1_2(op3, &bitD3);
  ------------------
  |  |  540|  3.73k|    do {                                            \
  |  |  541|  3.73k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 3.73k, False: 0]
  |  |  ------------------
  |  |  542|  3.73k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  3.73k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 3.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  3.73k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 3.73k]
  |  |  ------------------
  ------------------
  665|  3.73k|                HUF_DECODE_SYMBOLX1_2(op4, &bitD4);
  ------------------
  |  |  540|  3.73k|    do {                                            \
  |  |  541|  3.73k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 3.73k, False: 0]
  |  |  ------------------
  |  |  542|  3.73k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  3.73k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 3.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  3.73k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 3.73k]
  |  |  ------------------
  ------------------
  666|  3.73k|                HUF_DECODE_SYMBOLX1_0(op1, &bitD1);
  ------------------
  |  |  531|  3.73k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (531:71): [Folded, False: 3.73k]
  |  |  ------------------
  ------------------
  667|  3.73k|                HUF_DECODE_SYMBOLX1_0(op2, &bitD2);
  ------------------
  |  |  531|  3.73k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (531:71): [Folded, False: 3.73k]
  |  |  ------------------
  ------------------
  668|  3.73k|                HUF_DECODE_SYMBOLX1_0(op3, &bitD3);
  ------------------
  |  |  531|  3.73k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (531:71): [Folded, False: 3.73k]
  |  |  ------------------
  ------------------
  669|  3.73k|                HUF_DECODE_SYMBOLX1_0(op4, &bitD4);
  ------------------
  |  |  531|  3.73k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (531:71): [Folded, False: 3.73k]
  |  |  ------------------
  ------------------
  670|  3.73k|                endSignal &= BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished;
  671|  3.73k|                endSignal &= BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished;
  672|  3.73k|                endSignal &= BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished;
  673|  3.73k|                endSignal &= BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished;
  674|  3.73k|            }
  675|     82|        }
  676|       |
  677|       |        /* check corruption */
  678|       |        /* note : should not be necessary : op# advance in lock step, and we control op4.
  679|       |         *        but curiously, binary generated by gcc 7.2 & 7.3 with -mbmi2 runs faster when >=1 test is present */
  680|     89|        if (op1 > opStart2) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (680:13): [True: 0, False: 89]
  ------------------
  681|     89|        if (op2 > opStart3) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (681:13): [True: 0, False: 89]
  ------------------
  682|     89|        if (op3 > opStart4) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (682:13): [True: 0, False: 89]
  ------------------
  683|       |        /* note : op4 supposed already verified within main loop */
  684|       |
  685|       |        /* finish bitStreams one by one */
  686|     89|        HUF_decodeStreamX1(op1, &bitD1, opStart2, dt, dtLog);
  687|     89|        HUF_decodeStreamX1(op2, &bitD2, opStart3, dt, dtLog);
  688|     89|        HUF_decodeStreamX1(op3, &bitD3, opStart4, dt, dtLog);
  689|     89|        HUF_decodeStreamX1(op4, &bitD4, oend,     dt, dtLog);
  690|       |
  691|       |        /* check */
  692|     89|        { U32 const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4);
  693|     89|          if (!endCheck) return ERROR(corruption_detected); }
  ------------------
  |  |   49|     89|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     89|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     89|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (693:15): [True: 89, False: 0]
  ------------------
  694|       |
  695|       |        /* decoded size */
  696|      0|        return dstSize;
  697|     89|    }
  698|     89|}
huf_decompress.c:HUF_decompress4X1_usingDTable_internal_bmi2:
  703|    127|                    size_t cSrcSize, HUF_DTable const* DTable) {
  704|    127|    return HUF_decompress4X1_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable);
  705|    127|}
huf_decompress.c:HUF_decompress4X1_usingDTable_internal_fast:
  845|    220|{
  846|    220|    void const* dt = DTable + 1;
  847|    220|    BYTE const* const ilowest = (BYTE const*)cSrc;
  848|    220|    BYTE* const oend = ZSTD_maybeNullPtrAdd((BYTE*)dst, dstSize);
  849|    220|    HUF_DecompressFastArgs args;
  850|    220|    {   size_t const ret = HUF_DecompressFastArgs_init(&args, dst, dstSize, cSrc, cSrcSize, DTable);
  851|    220|        FORWARD_IF_ERROR(ret, "Failed to init fast loop args");
  ------------------
  |  |  146|    220|    do {                                                                           \
  |  |  147|    220|        size_t const err_code = (err);                                             \
  |  |  148|    220|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 44, False: 176]
  |  |  ------------------
  |  |  149|     44|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|     44|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 44]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     44|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|     44|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|     44|    do {                                           \
  |  |  |  |   99|     44|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 44]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     44|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 44]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|     44|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|     44|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 44]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|     44|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|     44|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 44]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|     44|            return err_code;                                                       \
  |  |  155|     44|        }                                                                          \
  |  |  156|    220|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 176]
  |  |  ------------------
  ------------------
  852|    176|        if (ret == 0)
  ------------------
  |  Branch (852:13): [True: 127, False: 49]
  ------------------
  853|    127|            return 0;
  854|    176|    }
  855|       |
  856|     49|    assert(args.ip[0] >= args.ilowest);
  ------------------
  |  |   70|     49|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  857|     49|    loopFn(&args);
  858|       |
  859|       |    /* Our loop guarantees that ip[] >= ilowest and that we haven't
  860|       |    * overwritten any op[].
  861|       |    */
  862|     49|    assert(args.ip[0] >= ilowest);
  ------------------
  |  |   70|     49|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  863|     49|    assert(args.ip[0] >= ilowest);
  ------------------
  |  |   70|     49|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  864|     49|    assert(args.ip[1] >= ilowest);
  ------------------
  |  |   70|     49|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  865|     49|    assert(args.ip[2] >= ilowest);
  ------------------
  |  |   70|     49|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  866|     49|    assert(args.ip[3] >= ilowest);
  ------------------
  |  |   70|     49|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  867|     49|    assert(args.op[3] <= oend);
  ------------------
  |  |   70|     49|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  868|       |
  869|     49|    assert(ilowest == args.ilowest);
  ------------------
  |  |   70|     49|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  870|     49|    assert(ilowest + 6 == args.iend[0]);
  ------------------
  |  |   70|     49|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  871|     49|    (void)ilowest;
  872|       |
  873|       |    /* finish bit streams one by one. */
  874|     49|    {   size_t const segmentSize = (dstSize+3) / 4;
  875|     49|        BYTE* segmentEnd = (BYTE*)dst;
  876|     49|        int i;
  877|    217|        for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (877:21): [True: 180, False: 37]
  ------------------
  878|    180|            BIT_DStream_t bit;
  879|    180|            if (segmentSize <= (size_t)(oend - segmentEnd))
  ------------------
  |  Branch (879:17): [True: 161, False: 19]
  ------------------
  880|    161|                segmentEnd += segmentSize;
  881|     19|            else
  882|     19|                segmentEnd = oend;
  883|    180|            FORWARD_IF_ERROR(HUF_initRemainingDStream(&bit, &args, i, segmentEnd), "corruption");
  ------------------
  |  |  146|    180|    do {                                                                           \
  |  |  147|    180|        size_t const err_code = (err);                                             \
  |  |  148|    180|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 12, False: 168]
  |  |  ------------------
  |  |  149|     12|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|     12|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     12|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|     12|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|     12|    do {                                           \
  |  |  |  |   99|     12|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 12]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     12|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|     12|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|     12|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|     12|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|     12|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|     12|            return err_code;                                                       \
  |  |  155|     12|        }                                                                          \
  |  |  156|    180|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 168]
  |  |  ------------------
  ------------------
  884|       |            /* Decompress and validate that we've produced exactly the expected length. */
  885|    168|            args.op[i] += HUF_decodeStreamX1(args.op[i], &bit, segmentEnd, (HUF_DEltX1 const*)dt, HUF_DECODER_FAST_TABLELOG);
  ------------------
  |  |   31|    168|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
  886|    168|            if (args.op[i] != segmentEnd) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (886:17): [True: 0, False: 168]
  ------------------
  887|    168|        }
  888|     49|    }
  889|       |
  890|       |    /* decoded size */
  891|     37|    assert(dstSize != 0);
  ------------------
  |  |   70|     37|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  892|     37|    return dstSize;
  893|     49|}
huf_decompress.c:HUF_decompress4X2_DCtx_wksp:
 1772|    248|{
 1773|    248|    const BYTE* ip = (const BYTE*) cSrc;
 1774|       |
 1775|    248|    size_t hSize = HUF_readDTableX2_wksp(dctx, cSrc, cSrcSize,
 1776|    248|                                         workSpace, wkspSize, flags);
 1777|    248|    if (HUF_isError(hSize)) return hSize;
  ------------------
  |  |   78|    248|#define HUF_isError ERR_isError
  ------------------
  |  Branch (1777:9): [True: 21, False: 227]
  ------------------
 1778|    227|    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1778:9): [True: 0, False: 227]
  ------------------
 1779|    227|    ip += hSize; cSrcSize -= hSize;
 1780|       |
 1781|    227|    return HUF_decompress4X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, flags);
 1782|    227|}
huf_decompress.c:HUF_decompress4X1_DCtx_wksp:
  933|    362|{
  934|    362|    const BYTE* ip = (const BYTE*) cSrc;
  935|       |
  936|    362|    size_t const hSize = HUF_readDTableX1_wksp(dctx, cSrc, cSrcSize, workSpace, wkspSize, flags);
  937|    362|    if (HUF_isError(hSize)) return hSize;
  ------------------
  |  |   78|    362|#define HUF_isError ERR_isError
  ------------------
  |  Branch (937:9): [True: 128, False: 234]
  ------------------
  938|    234|    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     14|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     14|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     14|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (938:9): [True: 14, False: 220]
  ------------------
  939|    220|    ip += hSize; cSrcSize -= hSize;
  940|       |
  941|    220|    return HUF_decompress4X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, flags);
  942|    234|}

ZSTD_DDict_dictContent:
   47|  3.80k|{
   48|  3.80k|    assert(ddict != NULL);
  ------------------
  |  |   70|  3.80k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   49|  3.80k|    return ddict->dictContent;
   50|  3.80k|}
ZSTD_DDict_dictSize:
   53|  3.80k|{
   54|  3.80k|    assert(ddict != NULL);
  ------------------
  |  |   70|  3.80k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   55|  3.80k|    return ddict->dictSize;
   56|  3.80k|}
ZSTD_copyDDictParameters:
   59|  1.62k|{
   60|  1.62k|    DEBUGLOG(4, "ZSTD_copyDDictParameters");
  ------------------
  |  |  104|  1.62k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
   61|  1.62k|    assert(dctx != NULL);
  ------------------
  |  |   70|  1.62k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   62|  1.62k|    assert(ddict != NULL);
  ------------------
  |  |   70|  1.62k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   63|  1.62k|    dctx->dictID = ddict->dictID;
   64|  1.62k|    dctx->prefixStart = ddict->dictContent;
   65|  1.62k|    dctx->virtualStart = ddict->dictContent;
   66|  1.62k|    dctx->dictEnd = (const BYTE*)ddict->dictContent + ddict->dictSize;
   67|  1.62k|    dctx->previousDstEnd = dctx->dictEnd;
   68|  1.62k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   69|  1.62k|    dctx->dictContentBeginForFuzzing = dctx->prefixStart;
   70|  1.62k|    dctx->dictContentEndForFuzzing = dctx->previousDstEnd;
   71|  1.62k|#endif
   72|  1.62k|    if (ddict->entropyPresent) {
  ------------------
  |  Branch (72:9): [True: 2, False: 1.62k]
  ------------------
   73|      2|        dctx->litEntropy = 1;
   74|      2|        dctx->fseEntropy = 1;
   75|      2|        dctx->LLTptr = ddict->entropy.LLTable;
   76|      2|        dctx->MLTptr = ddict->entropy.MLTable;
   77|      2|        dctx->OFTptr = ddict->entropy.OFTable;
   78|      2|        dctx->HUFptr = ddict->entropy.hufTable;
   79|      2|        dctx->entropy.rep[0] = ddict->entropy.rep[0];
   80|      2|        dctx->entropy.rep[1] = ddict->entropy.rep[1];
   81|      2|        dctx->entropy.rep[2] = ddict->entropy.rep[2];
   82|  1.62k|    } else {
   83|  1.62k|        dctx->litEntropy = 0;
   84|  1.62k|        dctx->fseEntropy = 0;
   85|  1.62k|    }
   86|  1.62k|}
ZSTD_createDDict_advanced:
  149|  5.70k|{
  150|  5.70k|    if ((!customMem.customAlloc) ^ (!customMem.customFree)) return NULL;
  ------------------
  |  Branch (150:9): [True: 0, False: 5.70k]
  ------------------
  151|       |
  152|  5.70k|    {   ZSTD_DDict* const ddict = (ZSTD_DDict*) ZSTD_customMalloc(sizeof(ZSTD_DDict), customMem);
  153|  5.70k|        if (ddict == NULL) return NULL;
  ------------------
  |  Branch (153:13): [True: 0, False: 5.70k]
  ------------------
  154|  5.70k|        ddict->cMem = customMem;
  155|  5.70k|        {   size_t const initResult = ZSTD_initDDict_internal(ddict,
  156|  5.70k|                                            dict, dictSize,
  157|  5.70k|                                            dictLoadMethod, dictContentType);
  158|  5.70k|            if (ZSTD_isError(initResult)) {
  ------------------
  |  |   44|  5.70k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (158:17): [True: 393, False: 5.31k]
  ------------------
  159|    393|                ZSTD_freeDDict(ddict);
  160|    393|                return NULL;
  161|    393|        }   }
  162|  5.31k|        return ddict;
  163|  5.70k|    }
  164|  5.70k|}
ZSTD_createDDict:
  171|  5.70k|{
  172|  5.70k|    ZSTD_customMem const allocator = { NULL, NULL, NULL };
  173|  5.70k|    return ZSTD_createDDict_advanced(dict, dictSize, ZSTD_dlm_byCopy, ZSTD_dct_auto, allocator);
  174|  5.70k|}
ZSTD_freeDDict:
  213|  17.0k|{
  214|  17.0k|    if (ddict==NULL) return 0;   /* support free on NULL */
  ------------------
  |  Branch (214:9): [True: 11.3k, False: 5.70k]
  ------------------
  215|  5.70k|    {   ZSTD_customMem const cMem = ddict->cMem;
  216|  5.70k|        ZSTD_customFree(ddict->dictBuffer, cMem);
  217|  5.70k|        ZSTD_customFree(ddict, cMem);
  218|  5.70k|        return 0;
  219|  17.0k|    }
  220|  17.0k|}
zstd_ddict.c:ZSTD_initDDict_internal:
  124|  5.70k|{
  125|  5.70k|    if ((dictLoadMethod == ZSTD_dlm_byRef) || (!dict) || (!dictSize)) {
  ------------------
  |  Branch (125:9): [True: 0, False: 5.70k]
  |  Branch (125:47): [True: 0, False: 5.70k]
  |  Branch (125:58): [True: 0, False: 5.70k]
  ------------------
  126|      0|        ddict->dictBuffer = NULL;
  127|      0|        ddict->dictContent = dict;
  128|      0|        if (!dict) dictSize = 0;
  ------------------
  |  Branch (128:13): [True: 0, False: 0]
  ------------------
  129|  5.70k|    } else {
  130|  5.70k|        void* const internalBuffer = ZSTD_customMalloc(dictSize, ddict->cMem);
  131|  5.70k|        ddict->dictBuffer = internalBuffer;
  132|  5.70k|        ddict->dictContent = internalBuffer;
  133|  5.70k|        if (!internalBuffer) return ERROR(memory_allocation);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (133:13): [True: 0, False: 5.70k]
  ------------------
  134|  5.70k|        ZSTD_memcpy(internalBuffer, dict, dictSize);
  ------------------
  |  |   44|  5.70k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  135|  5.70k|    }
  136|  5.70k|    ddict->dictSize = dictSize;
  137|  5.70k|    ddict->entropy.hufTable[0] = (HUF_DTable)((ZSTD_HUFFDTABLE_CAPACITY_LOG)*0x1000001);  /* cover both little and big endian */
  ------------------
  |  |   78|  5.70k|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
  138|       |
  139|       |    /* parse dictionary content */
  140|  5.70k|    FORWARD_IF_ERROR( ZSTD_loadEntropy_intoDDict(ddict, dictContentType) , "");
  ------------------
  |  |  146|  5.70k|    do {                                                                           \
  |  |  147|  5.70k|        size_t const err_code = (err);                                             \
  |  |  148|  5.70k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 393, False: 5.31k]
  |  |  ------------------
  |  |  149|    393|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|    393|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 393]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|    393|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|    393|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|    393|    do {                                           \
  |  |  |  |   99|    393|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 393]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    393|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 393]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|    393|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|    393|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 393]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|    393|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|    393|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 393]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|    393|            return err_code;                                                       \
  |  |  155|    393|        }                                                                          \
  |  |  156|  5.70k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 5.31k]
  |  |  ------------------
  ------------------
  141|       |
  142|  5.31k|    return 0;
  143|  5.70k|}
zstd_ddict.c:ZSTD_loadEntropy_intoDDict:
   92|  5.70k|{
   93|  5.70k|    ddict->dictID = 0;
   94|  5.70k|    ddict->entropyPresent = 0;
   95|  5.70k|    if (dictContentType == ZSTD_dct_rawContent) return 0;
  ------------------
  |  Branch (95:9): [True: 0, False: 5.70k]
  ------------------
   96|       |
   97|  5.70k|    if (ddict->dictSize < 8) {
  ------------------
  |  Branch (97:9): [True: 1.08k, False: 4.62k]
  ------------------
   98|  1.08k|        if (dictContentType == ZSTD_dct_fullDict)
  ------------------
  |  Branch (98:13): [True: 0, False: 1.08k]
  ------------------
   99|      0|            return ERROR(dictionary_corrupted);   /* only accept specified dictionaries */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  100|  1.08k|        return 0;   /* pure content mode */
  101|  1.08k|    }
  102|  4.62k|    {   U32 const magic = MEM_readLE32(ddict->dictContent);
  103|  4.62k|        if (magic != ZSTD_MAGIC_DICTIONARY) {
  ------------------
  |  |  143|  4.62k|#define ZSTD_MAGIC_DICTIONARY       0xEC30A437    /* valid since v0.7.0 */
  ------------------
  |  Branch (103:13): [True: 4.22k, False: 395]
  ------------------
  104|  4.22k|            if (dictContentType == ZSTD_dct_fullDict)
  ------------------
  |  Branch (104:17): [True: 0, False: 4.22k]
  ------------------
  105|      0|                return ERROR(dictionary_corrupted);   /* only accept specified dictionaries */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  106|  4.22k|            return 0;   /* pure content mode */
  107|  4.22k|        }
  108|  4.62k|    }
  109|    395|    ddict->dictID = MEM_readLE32((const char*)ddict->dictContent + ZSTD_FRAMEIDSIZE);
  ------------------
  |  |   82|    395|#define ZSTD_FRAMEIDSIZE 4   /* magic number size */
  ------------------
  110|       |
  111|       |    /* load entropy tables */
  112|    395|    RETURN_ERROR_IF(ZSTD_isError(ZSTD_loadDEntropy(
  ------------------
  |  |  114|    395|    do {                                                                       \
  |  |  115|    395|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 393, False: 2]
  |  |  ------------------
  |  |  116|    393|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    393|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 393]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    393|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    393|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    393|    do {                                           \
  |  |  |  |   99|    393|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 393]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    393|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 393]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    393|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    393|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 393]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    393|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    393|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 393]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    393|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    393|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    393|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    393|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    393|        }                                                                      \
  |  |  123|    395|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
  113|    395|            &ddict->entropy, ddict->dictContent, ddict->dictSize)),
  114|    395|        dictionary_corrupted, "");
  115|      2|    ddict->entropyPresent = 1;
  116|      2|    return 0;
  117|    395|}

ZSTD_createDCtx:
  311|  6.74k|{
  312|  6.74k|    DEBUGLOG(3, "ZSTD_createDCtx");
  ------------------
  |  |  104|  6.74k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 6.74k]
  |  |  ------------------
  ------------------
  313|  6.74k|    return ZSTD_createDCtx_internal(ZSTD_defaultCMem);
  314|  6.74k|}
ZSTD_freeDCtx:
  325|  6.74k|{
  326|  6.74k|    if (dctx==NULL) return 0;   /* support free on NULL */
  ------------------
  |  Branch (326:9): [True: 0, False: 6.74k]
  ------------------
  327|  6.74k|    RETURN_ERROR_IF(dctx->staticSize, memory_allocation, "not compatible with static DCtx");
  ------------------
  |  |  114|  6.74k|    do {                                                                       \
  |  |  115|  6.74k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 6.74k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  6.74k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 6.74k]
  |  |  ------------------
  ------------------
  328|  6.74k|    {   ZSTD_customMem const cMem = dctx->customMem;
  329|  6.74k|        ZSTD_clearDict(dctx);
  330|  6.74k|        ZSTD_customFree(dctx->inBuff, cMem);
  331|  6.74k|        dctx->inBuff = NULL;
  332|  6.74k|#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)
  333|  6.74k|        if (dctx->legacyContext)
  ------------------
  |  Branch (333:13): [True: 0, False: 6.74k]
  ------------------
  334|      0|            ZSTD_freeLegacyStreamContext(dctx->legacyContext, dctx->previousLegacyVersion);
  335|  6.74k|#endif
  336|  6.74k|        if (dctx->ddictSet) {
  ------------------
  |  Branch (336:13): [True: 0, False: 6.74k]
  ------------------
  337|      0|            ZSTD_freeDDictHashSet(dctx->ddictSet, cMem);
  338|       |            dctx->ddictSet = NULL;
  339|      0|        }
  340|  6.74k|        ZSTD_customFree(dctx, cMem);
  341|  6.74k|        return 0;
  342|  6.74k|    }
  343|  6.74k|}
ZSTD_getFrameHeader_advanced:
  448|  3.69k|{
  449|  3.69k|    const BYTE* ip = (const BYTE*)src;
  450|  3.69k|    size_t const minInputSize = ZSTD_startingInputLength(format);
  451|       |
  452|  3.69k|    DEBUGLOG(5, "ZSTD_getFrameHeader_advanced: minInputSize = %zu, srcSize = %zu", minInputSize, srcSize);
  ------------------
  |  |  104|  3.69k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 3.69k]
  |  |  ------------------
  ------------------
  453|       |
  454|  3.69k|    if (srcSize > 0) {
  ------------------
  |  Branch (454:9): [True: 3.69k, False: 0]
  ------------------
  455|       |        /* note : technically could be considered an assert(), since it's an invalid entry */
  456|  3.69k|        RETURN_ERROR_IF(src==NULL, GENERIC, "invalid parameter : src==NULL, but srcSize>0");
  ------------------
  |  |  114|  3.69k|    do {                                                                       \
  |  |  115|  3.69k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 3.69k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  3.69k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.69k]
  |  |  ------------------
  ------------------
  457|  3.69k|    }
  458|  3.69k|    if (srcSize < minInputSize) {
  ------------------
  |  Branch (458:9): [True: 0, False: 3.69k]
  ------------------
  459|      0|        if (srcSize > 0 && format != ZSTD_f_zstd1_magicless) {
  ------------------
  |  Branch (459:13): [True: 0, False: 0]
  |  Branch (459:28): [True: 0, False: 0]
  ------------------
  460|       |            /* when receiving less than @minInputSize bytes,
  461|       |             * control these bytes at least correspond to a supported magic number
  462|       |             * in order to error out early if they don't.
  463|       |            **/
  464|      0|            size_t const toCopy = MIN(4, srcSize);
  ------------------
  |  |   54|      0|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  465|      0|            unsigned char hbuf[4]; MEM_writeLE32(hbuf, ZSTD_MAGICNUMBER);
  ------------------
  |  |  142|      0|#define ZSTD_MAGICNUMBER            0xFD2FB528    /* valid since v0.8.0 */
  ------------------
  466|      0|            assert(src != NULL);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  467|      0|            ZSTD_memcpy(hbuf, src, toCopy);
  ------------------
  |  |   44|      0|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  468|      0|            if ( MEM_readLE32(hbuf) != ZSTD_MAGICNUMBER ) {
  ------------------
  |  |  142|      0|#define ZSTD_MAGICNUMBER            0xFD2FB528    /* valid since v0.8.0 */
  ------------------
  |  Branch (468:18): [True: 0, False: 0]
  ------------------
  469|       |                /* not a zstd frame : let's check if it's a skippable frame */
  470|      0|                MEM_writeLE32(hbuf, ZSTD_MAGIC_SKIPPABLE_START);
  ------------------
  |  |  144|      0|#define ZSTD_MAGIC_SKIPPABLE_START  0x184D2A50    /* all 16 values, from 0x184D2A50 to 0x184D2A5F, signal the beginning of a skippable frame */
  ------------------
  471|      0|                ZSTD_memcpy(hbuf, src, toCopy);
  ------------------
  |  |   44|      0|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  472|      0|                if ((MEM_readLE32(hbuf) & ZSTD_MAGIC_SKIPPABLE_MASK) != ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  145|      0|#define ZSTD_MAGIC_SKIPPABLE_MASK   0xFFFFFFF0
  ------------------
                              if ((MEM_readLE32(hbuf) & ZSTD_MAGIC_SKIPPABLE_MASK) != ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  144|      0|#define ZSTD_MAGIC_SKIPPABLE_START  0x184D2A50    /* all 16 values, from 0x184D2A50 to 0x184D2A5F, signal the beginning of a skippable frame */
  ------------------
  |  Branch (472:21): [True: 0, False: 0]
  ------------------
  473|      0|                    RETURN_ERROR(prefix_unknown,
  ------------------
  |  |  131|      0|    do {                                                                     \
  |  |  132|      0|        RAWLOG(3, "%s:%d: ERROR!: unconditional check failed, returning %s", \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  133|      0|              __FILE__, __LINE__, ERR_QUOTE(ERROR(err)));                    \
  |  |  134|      0|        _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                               \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  135|      0|        RAWLOG(3, ": " __VA_ARGS__);                                         \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  136|      0|        RAWLOG(3, "\n");                                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  137|      0|        return ERROR(err);                                                   \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  138|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (138:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  474|      0|                                "first bytes don't correspond to any supported magic number");
  475|      0|        }   }   }
  476|      0|        return minInputSize;
  477|      0|    }
  478|       |
  479|  3.69k|    ZSTD_memset(zfhPtr, 0, sizeof(*zfhPtr));   /* not strictly necessary, but static analyzers may not understand that zfhPtr will be read only if return value is zero, since they are 2 different signals */
  ------------------
  |  |   46|  3.69k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  480|  3.69k|    if ( (format != ZSTD_f_zstd1_magicless)
  ------------------
  |  Branch (480:10): [True: 3.69k, False: 0]
  ------------------
  481|  3.69k|      && (MEM_readLE32(src) != ZSTD_MAGICNUMBER) ) {
  ------------------
  |  |  142|  3.69k|#define ZSTD_MAGICNUMBER            0xFD2FB528    /* valid since v0.8.0 */
  ------------------
  |  Branch (481:10): [True: 502, False: 3.19k]
  ------------------
  482|    502|        if ((MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  145|    502|#define ZSTD_MAGIC_SKIPPABLE_MASK   0xFFFFFFF0
  ------------------
                      if ((MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  144|    502|#define ZSTD_MAGIC_SKIPPABLE_START  0x184D2A50    /* all 16 values, from 0x184D2A50 to 0x184D2A5F, signal the beginning of a skippable frame */
  ------------------
  |  Branch (482:13): [True: 0, False: 502]
  ------------------
  483|       |            /* skippable frame */
  484|      0|            if (srcSize < ZSTD_SKIPPABLEHEADERSIZE)
  ------------------
  |  | 1260|      0|#define ZSTD_SKIPPABLEHEADERSIZE    8
  ------------------
  |  Branch (484:17): [True: 0, False: 0]
  ------------------
  485|      0|                return ZSTD_SKIPPABLEHEADERSIZE; /* magic number + frame length */
  ------------------
  |  | 1260|      0|#define ZSTD_SKIPPABLEHEADERSIZE    8
  ------------------
  486|      0|            ZSTD_memset(zfhPtr, 0, sizeof(*zfhPtr));
  ------------------
  |  |   46|      0|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  487|      0|            zfhPtr->frameType = ZSTD_skippableFrame;
  488|      0|            zfhPtr->dictID = MEM_readLE32(src) - ZSTD_MAGIC_SKIPPABLE_START;
  ------------------
  |  |  144|      0|#define ZSTD_MAGIC_SKIPPABLE_START  0x184D2A50    /* all 16 values, from 0x184D2A50 to 0x184D2A5F, signal the beginning of a skippable frame */
  ------------------
  489|      0|            zfhPtr->headerSize = ZSTD_SKIPPABLEHEADERSIZE;
  ------------------
  |  | 1260|      0|#define ZSTD_SKIPPABLEHEADERSIZE    8
  ------------------
  490|      0|            zfhPtr->frameContentSize = MEM_readLE32((const char *)src + ZSTD_FRAMEIDSIZE);
  ------------------
  |  |   82|      0|#define ZSTD_FRAMEIDSIZE 4   /* magic number size */
  ------------------
  491|      0|            return 0;
  492|      0|        }
  493|    502|        RETURN_ERROR(prefix_unknown, "");
  ------------------
  |  |  131|    502|    do {                                                                     \
  |  |  132|    502|        RAWLOG(3, "%s:%d: ERROR!: unconditional check failed, returning %s", \
  |  |  ------------------
  |  |  |  |  103|    502|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 502]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  133|    502|              __FILE__, __LINE__, ERR_QUOTE(ERROR(err)));                    \
  |  |  134|    502|        _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                               \
  |  |  ------------------
  |  |  |  |   98|    502|    do {                                           \
  |  |  |  |   99|    502|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 502]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    502|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 502]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  135|    502|        RAWLOG(3, ": " __VA_ARGS__);                                         \
  |  |  ------------------
  |  |  |  |  103|    502|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 502]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  136|    502|        RAWLOG(3, "\n");                                                     \
  |  |  ------------------
  |  |  |  |  103|    502|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 502]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  137|    502|        return ERROR(err);                                                   \
  |  |  ------------------
  |  |  |  |   49|    502|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    502|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    502|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  138|    502|    } while(0)
  |  |  ------------------
  |  |  |  Branch (138:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  494|    502|    }
  495|       |
  496|       |    /* ensure there is enough `srcSize` to fully read/decode frame header */
  497|  3.19k|    {   size_t const fhsize = ZSTD_frameHeaderSize_internal(src, srcSize, format);
  498|  3.19k|        if (srcSize < fhsize) return fhsize;
  ------------------
  |  Branch (498:13): [True: 0, False: 3.19k]
  ------------------
  499|  3.19k|        zfhPtr->headerSize = (U32)fhsize;
  500|  3.19k|    }
  501|       |
  502|      0|    {   BYTE const fhdByte = ip[minInputSize-1];
  503|  3.19k|        size_t pos = minInputSize;
  504|  3.19k|        U32 const dictIDSizeCode = fhdByte&3;
  505|  3.19k|        U32 const checksumFlag = (fhdByte>>2)&1;
  506|  3.19k|        U32 const singleSegment = (fhdByte>>5)&1;
  507|  3.19k|        U32 const fcsID = fhdByte>>6;
  508|  3.19k|        U64 windowSize = 0;
  509|  3.19k|        U32 dictID = 0;
  510|  3.19k|        U64 frameContentSize = ZSTD_CONTENTSIZE_UNKNOWN;
  ------------------
  |  |  203|  3.19k|#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
  ------------------
  511|  3.19k|        RETURN_ERROR_IF((fhdByte & 0x08) != 0, frameParameter_unsupported,
  ------------------
  |  |  114|  3.19k|    do {                                                                       \
  |  |  115|  3.19k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 3.19k]
  |  |  ------------------
  |  |  116|      2|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      2|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      2|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      2|    do {                                           \
  |  |  |  |   99|      2|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      2|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      2|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      2|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      2|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      2|        }                                                                      \
  |  |  123|  3.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.19k]
  |  |  ------------------
  ------------------
  512|  3.19k|                        "reserved bits, must be zero");
  513|       |
  514|  3.19k|        if (!singleSegment) {
  ------------------
  |  Branch (514:13): [True: 2.44k, False: 748]
  ------------------
  515|  2.44k|            BYTE const wlByte = ip[pos++];
  516|  2.44k|            U32 const windowLog = (wlByte >> 3) + ZSTD_WINDOWLOG_ABSOLUTEMIN;
  ------------------
  |  |   78|  2.44k|#define ZSTD_WINDOWLOG_ABSOLUTEMIN 10
  ------------------
  517|  2.44k|            RETURN_ERROR_IF(windowLog > ZSTD_WINDOWLOG_MAX, frameParameter_windowTooLarge, "");
  ------------------
  |  |  114|  2.44k|    do {                                                                       \
  |  |  115|  7.34k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [Folded, False: 2.44k]
  |  |  |  Branch (115:13): [True: 1, False: 2.44k]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|  2.44k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.44k]
  |  |  ------------------
  ------------------
  518|  2.44k|            windowSize = (1ULL << windowLog);
  519|  2.44k|            windowSize += (windowSize >> 3) * (wlByte&7);
  520|  2.44k|        }
  521|  3.19k|        switch(dictIDSizeCode)
  522|  3.19k|        {
  523|      0|            default:
  ------------------
  |  Branch (523:13): [True: 0, False: 3.19k]
  ------------------
  524|      0|                assert(0);  /* impossible */
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  525|      0|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|      0|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  526|    156|            case 0 : break;
  ------------------
  |  Branch (526:13): [True: 156, False: 3.03k]
  ------------------
  527|  2.44k|            case 1 : dictID = ip[pos]; pos++; break;
  ------------------
  |  Branch (527:13): [True: 2.44k, False: 745]
  ------------------
  528|    512|            case 2 : dictID = MEM_readLE16(ip+pos); pos+=2; break;
  ------------------
  |  Branch (528:13): [True: 512, False: 2.68k]
  ------------------
  529|     77|            case 3 : dictID = MEM_readLE32(ip+pos); pos+=4; break;
  ------------------
  |  Branch (529:13): [True: 77, False: 3.11k]
  ------------------
  530|  3.19k|        }
  531|  3.19k|        switch(fcsID)
  532|  3.19k|        {
  533|      0|            default:
  ------------------
  |  Branch (533:13): [True: 0, False: 3.19k]
  ------------------
  534|      0|                assert(0);  /* impossible */
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  535|      0|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|      0|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  536|  2.44k|            case 0 : if (singleSegment) frameContentSize = ip[pos]; break;
  ------------------
  |  Branch (536:13): [True: 2.44k, False: 752]
  |  Branch (536:26): [True: 21, False: 2.42k]
  ------------------
  537|     52|            case 1 : frameContentSize = MEM_readLE16(ip+pos)+256; break;
  ------------------
  |  Branch (537:13): [True: 52, False: 3.14k]
  ------------------
  538|    101|            case 2 : frameContentSize = MEM_readLE32(ip+pos); break;
  ------------------
  |  Branch (538:13): [True: 101, False: 3.09k]
  ------------------
  539|    599|            case 3 : frameContentSize = MEM_readLE64(ip+pos); break;
  ------------------
  |  Branch (539:13): [True: 599, False: 2.59k]
  ------------------
  540|  3.19k|        }
  541|  3.19k|        if (singleSegment) windowSize = frameContentSize;
  ------------------
  |  Branch (541:13): [True: 748, False: 2.44k]
  ------------------
  542|       |
  543|  3.19k|        zfhPtr->frameType = ZSTD_frame;
  544|  3.19k|        zfhPtr->frameContentSize = frameContentSize;
  545|  3.19k|        zfhPtr->windowSize = windowSize;
  546|  3.19k|        zfhPtr->blockSizeMax = (unsigned) MIN(windowSize, ZSTD_BLOCKSIZE_MAX);
  ------------------
  |  |   54|  3.19k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 276, False: 2.91k]
  |  |  ------------------
  ------------------
  547|  3.19k|        zfhPtr->dictID = dictID;
  548|  3.19k|        zfhPtr->checksumFlag = checksumFlag;
  549|  3.19k|    }
  550|      0|    return 0;
  551|  3.19k|}
ZSTD_getFrameContentSize:
  570|  1.57k|{
  571|  1.57k|#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)
  572|  1.57k|    if (ZSTD_isLegacy(src, srcSize)) {
  ------------------
  |  Branch (572:9): [True: 1.57k, False: 0]
  ------------------
  573|  1.57k|        unsigned long long const ret = ZSTD_getDecompressedSize_legacy(src, srcSize);
  574|  1.57k|        return ret == 0 ? ZSTD_CONTENTSIZE_UNKNOWN : ret;
  ------------------
  |  |  203|  1.37k|#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
  ------------------
  |  Branch (574:16): [True: 1.37k, False: 202]
  ------------------
  575|  1.57k|    }
  576|      0|#endif
  577|      0|    {   ZSTD_FrameHeader zfh;
  578|      0|        if (ZSTD_getFrameHeader(&zfh, src, srcSize) != 0)
  ------------------
  |  Branch (578:13): [True: 0, False: 0]
  ------------------
  579|      0|            return ZSTD_CONTENTSIZE_ERROR;
  ------------------
  |  |  204|      0|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
  580|      0|        if (zfh.frameType == ZSTD_skippableFrame) {
  ------------------
  |  Branch (580:13): [True: 0, False: 0]
  ------------------
  581|      0|            return 0;
  582|      0|        } else {
  583|      0|            return zfh.frameContentSize;
  584|      0|    }   }
  585|      0|}
ZSTD_decompressDCtx:
 1198|  4.61k|{
 1199|  4.61k|    return ZSTD_decompress_usingDDict(dctx, dst, dstCapacity, src, srcSize, ZSTD_getDDict(dctx));
 1200|  4.61k|}
ZSTD_loadDEntropy:
 1454|    395|{
 1455|    395|    const BYTE* dictPtr = (const BYTE*)dict;
 1456|    395|    const BYTE* const dictEnd = dictPtr + dictSize;
 1457|       |
 1458|    395|    RETURN_ERROR_IF(dictSize <= 8, dictionary_corrupted, "dict is too small");
  ------------------
  |  |  114|    395|    do {                                                                       \
  |  |  115|    395|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 394]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|    395|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 394]
  |  |  ------------------
  ------------------
 1459|    394|    assert(MEM_readLE32(dict) == ZSTD_MAGIC_DICTIONARY);   /* dict must be valid */
  ------------------
  |  |   70|    394|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1460|    394|    dictPtr += 8;   /* skip header = magic + dictID */
 1461|       |
 1462|    394|    ZSTD_STATIC_ASSERT(offsetof(ZSTD_entropyDTables_t, OFTable) == offsetof(ZSTD_entropyDTables_t, LLTable) + sizeof(entropy->LLTable));
  ------------------
  |  |   43|    394|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|    394|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1463|    394|    ZSTD_STATIC_ASSERT(offsetof(ZSTD_entropyDTables_t, MLTable) == offsetof(ZSTD_entropyDTables_t, OFTable) + sizeof(entropy->OFTable));
  ------------------
  |  |   43|    394|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|    394|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1464|    394|    ZSTD_STATIC_ASSERT(sizeof(entropy->LLTable) + sizeof(entropy->OFTable) + sizeof(entropy->MLTable) >= HUF_DECOMPRESS_WORKSPACE_SIZE);
  ------------------
  |  |   43|    394|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|    394|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1465|    394|    {   void* const workspace = &entropy->LLTable;   /* use fse tables as temporary workspace; implies fse tables are grouped together */
 1466|    394|        size_t const workspaceSize = sizeof(entropy->LLTable) + sizeof(entropy->OFTable) + sizeof(entropy->MLTable);
 1467|       |#ifdef HUF_FORCE_DECOMPRESS_X1
 1468|       |        /* in minimal huffman, we always use X1 variants */
 1469|       |        size_t const hSize = HUF_readDTableX1_wksp(entropy->hufTable,
 1470|       |                                                dictPtr, dictEnd - dictPtr,
 1471|       |                                                workspace, workspaceSize, /* flags */ 0);
 1472|       |#else
 1473|    394|        size_t const hSize = HUF_readDTableX2_wksp(entropy->hufTable,
 1474|    394|                                                dictPtr, (size_t)(dictEnd - dictPtr),
 1475|    394|                                                workspace, workspaceSize, /* flags */ 0);
 1476|    394|#endif
 1477|    394|        RETURN_ERROR_IF(HUF_isError(hSize), dictionary_corrupted, "");
  ------------------
  |  |  114|    394|    do {                                                                       \
  |  |  115|    394|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 130, False: 264]
  |  |  ------------------
  |  |  116|    130|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    130|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 130]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    130|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    130|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    130|    do {                                           \
  |  |  |  |   99|    130|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 130]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    130|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 130]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    130|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    130|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 130]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    130|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    130|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 130]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    130|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    130|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    130|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    130|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    130|        }                                                                      \
  |  |  123|    394|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 264]
  |  |  ------------------
  ------------------
 1478|    264|        dictPtr += hSize;
 1479|    264|    }
 1480|       |
 1481|      0|    {   short offcodeNCount[MaxOff+1];
 1482|    264|        unsigned offcodeMaxValue = MaxOff, offcodeLog;
  ------------------
  |  |  106|    264|#define MaxOff  31
  ------------------
 1483|    264|        size_t const offcodeHeaderSize = FSE_readNCount(offcodeNCount, &offcodeMaxValue, &offcodeLog, dictPtr, (size_t)(dictEnd-dictPtr));
 1484|    264|        RETURN_ERROR_IF(FSE_isError(offcodeHeaderSize), dictionary_corrupted, "");
  ------------------
  |  |  114|    264|    do {                                                                       \
  |  |  115|    264|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 40, False: 224]
  |  |  ------------------
  |  |  116|     40|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     40|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 40]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     40|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     40|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     40|    do {                                           \
  |  |  |  |   99|     40|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 40]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     40|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 40]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     40|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     40|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 40]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     40|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     40|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 40]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     40|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     40|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     40|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     40|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     40|        }                                                                      \
  |  |  123|    264|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 224]
  |  |  ------------------
  ------------------
 1485|    224|        RETURN_ERROR_IF(offcodeMaxValue > MaxOff, dictionary_corrupted, "");
  ------------------
  |  |  114|    224|    do {                                                                       \
  |  |  115|    224|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 224]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|    224|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 224]
  |  |  ------------------
  ------------------
 1486|    224|        RETURN_ERROR_IF(offcodeLog > OffFSELog, dictionary_corrupted, "");
  ------------------
  |  |  114|    224|    do {                                                                       \
  |  |  115|    224|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 13, False: 211]
  |  |  ------------------
  |  |  116|     13|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     13|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 13]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     13|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     13|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     13|    do {                                           \
  |  |  |  |   99|     13|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 13]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     13|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 13]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     13|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     13|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 13]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     13|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     13|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 13]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     13|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     13|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     13|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     13|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     13|        }                                                                      \
  |  |  123|    224|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 211]
  |  |  ------------------
  ------------------
 1487|    211|        ZSTD_buildFSETable( entropy->OFTable,
 1488|    211|                            offcodeNCount, offcodeMaxValue,
 1489|    211|                            OF_base, OF_bits,
 1490|    211|                            offcodeLog,
 1491|    211|                            entropy->workspace, sizeof(entropy->workspace),
 1492|    211|                            /* bmi2 */0);
 1493|    211|        dictPtr += offcodeHeaderSize;
 1494|    211|    }
 1495|       |
 1496|      0|    {   short matchlengthNCount[MaxML+1];
 1497|    211|        unsigned matchlengthMaxValue = MaxML, matchlengthLog;
  ------------------
  |  |  103|    211|#define MaxML   52
  ------------------
 1498|    211|        size_t const matchlengthHeaderSize = FSE_readNCount(matchlengthNCount, &matchlengthMaxValue, &matchlengthLog, dictPtr, (size_t)(dictEnd-dictPtr));
 1499|    211|        RETURN_ERROR_IF(FSE_isError(matchlengthHeaderSize), dictionary_corrupted, "");
  ------------------
  |  |  114|    211|    do {                                                                       \
  |  |  115|    211|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 33, False: 178]
  |  |  ------------------
  |  |  116|     33|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     33|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 33]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     33|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     33|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     33|    do {                                           \
  |  |  |  |   99|     33|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 33]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     33|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 33]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     33|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     33|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 33]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     33|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     33|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 33]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     33|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     33|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     33|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     33|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     33|        }                                                                      \
  |  |  123|    211|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 178]
  |  |  ------------------
  ------------------
 1500|    178|        RETURN_ERROR_IF(matchlengthMaxValue > MaxML, dictionary_corrupted, "");
  ------------------
  |  |  114|    178|    do {                                                                       \
  |  |  115|    178|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 178]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|    178|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 178]
  |  |  ------------------
  ------------------
 1501|    178|        RETURN_ERROR_IF(matchlengthLog > MLFSELog, dictionary_corrupted, "");
  ------------------
  |  |  114|    178|    do {                                                                       \
  |  |  115|    178|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 11, False: 167]
  |  |  ------------------
  |  |  116|     11|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     11|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     11|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     11|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     11|    do {                                           \
  |  |  |  |   99|     11|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     11|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     11|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     11|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     11|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     11|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     11|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     11|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     11|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     11|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     11|        }                                                                      \
  |  |  123|    178|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 167]
  |  |  ------------------
  ------------------
 1502|    167|        ZSTD_buildFSETable( entropy->MLTable,
 1503|    167|                            matchlengthNCount, matchlengthMaxValue,
 1504|    167|                            ML_base, ML_bits,
 1505|    167|                            matchlengthLog,
 1506|    167|                            entropy->workspace, sizeof(entropy->workspace),
 1507|    167|                            /* bmi2 */ 0);
 1508|    167|        dictPtr += matchlengthHeaderSize;
 1509|    167|    }
 1510|       |
 1511|      0|    {   short litlengthNCount[MaxLL+1];
 1512|    167|        unsigned litlengthMaxValue = MaxLL, litlengthLog;
  ------------------
  |  |  104|    167|#define MaxLL   35
  ------------------
 1513|    167|        size_t const litlengthHeaderSize = FSE_readNCount(litlengthNCount, &litlengthMaxValue, &litlengthLog, dictPtr, (size_t)(dictEnd-dictPtr));
 1514|    167|        RETURN_ERROR_IF(FSE_isError(litlengthHeaderSize), dictionary_corrupted, "");
  ------------------
  |  |  114|    167|    do {                                                                       \
  |  |  115|    167|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 36, False: 131]
  |  |  ------------------
  |  |  116|     36|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     36|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 36]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     36|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     36|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     36|    do {                                           \
  |  |  |  |   99|     36|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 36]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     36|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 36]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     36|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     36|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 36]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     36|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     36|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 36]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     36|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     36|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     36|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     36|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     36|        }                                                                      \
  |  |  123|    167|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 131]
  |  |  ------------------
  ------------------
 1515|    131|        RETURN_ERROR_IF(litlengthMaxValue > MaxLL, dictionary_corrupted, "");
  ------------------
  |  |  114|    131|    do {                                                                       \
  |  |  115|    131|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 131]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|    131|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 131]
  |  |  ------------------
  ------------------
 1516|    131|        RETURN_ERROR_IF(litlengthLog > LLFSELog, dictionary_corrupted, "");
  ------------------
  |  |  114|    131|    do {                                                                       \
  |  |  115|    131|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4, False: 127]
  |  |  ------------------
  |  |  116|      4|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      4|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      4|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      4|    do {                                           \
  |  |  |  |   99|      4|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      4|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      4|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      4|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      4|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      4|        }                                                                      \
  |  |  123|    131|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 127]
  |  |  ------------------
  ------------------
 1517|    127|        ZSTD_buildFSETable( entropy->LLTable,
 1518|    127|                            litlengthNCount, litlengthMaxValue,
 1519|    127|                            LL_base, LL_bits,
 1520|    127|                            litlengthLog,
 1521|    127|                            entropy->workspace, sizeof(entropy->workspace),
 1522|    127|                            /* bmi2 */ 0);
 1523|    127|        dictPtr += litlengthHeaderSize;
 1524|    127|    }
 1525|       |
 1526|    127|    RETURN_ERROR_IF(dictPtr+12 > dictEnd, dictionary_corrupted, "");
  ------------------
  |  |  114|    127|    do {                                                                       \
  |  |  115|    127|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 35, False: 92]
  |  |  ------------------
  |  |  116|     35|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     35|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     35|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     35|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     35|    do {                                           \
  |  |  |  |   99|     35|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 35]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     35|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     35|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     35|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     35|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     35|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     35|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     35|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     35|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     35|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     35|        }                                                                      \
  |  |  123|    127|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 92]
  |  |  ------------------
  ------------------
 1527|     92|    {   int i;
 1528|     92|        size_t const dictContentSize = (size_t)(dictEnd - (dictPtr+12));
 1529|    159|        for (i=0; i<3; i++) {
  ------------------
  |  Branch (1529:19): [True: 157, False: 2]
  ------------------
 1530|    157|            U32 const rep = MEM_readLE32(dictPtr); dictPtr += 4;
 1531|    157|            RETURN_ERROR_IF(rep==0 || rep > dictContentSize,
  ------------------
  |  |  114|    157|    do {                                                                       \
  |  |  115|    468|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 154]
  |  |  |  Branch (115:13): [True: 87, False: 67]
  |  |  ------------------
  |  |  116|     90|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     90|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 90]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     90|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     90|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     90|    do {                                           \
  |  |  |  |   99|     90|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 90]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     90|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 90]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     90|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     90|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 90]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     90|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     90|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 90]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     90|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     90|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     90|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     90|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     90|        }                                                                      \
  |  |  123|    157|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 67]
  |  |  ------------------
  ------------------
 1532|    157|                            dictionary_corrupted, "");
 1533|     67|            entropy->rep[i] = rep;
 1534|     67|    }   }
 1535|       |
 1536|      2|    return (size_t)(dictPtr - (const BYTE*)dict);
 1537|     92|}
ZSTD_decompressBegin:
 1561|  3.74k|{
 1562|  3.74k|    assert(dctx != NULL);
  ------------------
  |  |   70|  3.74k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1563|  3.74k|#if ZSTD_TRACE
 1564|  3.74k|    dctx->traceCtx = (ZSTD_trace_decompress_begin != NULL) ? ZSTD_trace_decompress_begin(dctx) : 0;
  ------------------
  |  Branch (1564:22): [True: 0, False: 3.74k]
  ------------------
 1565|  3.74k|#endif
 1566|  3.74k|    dctx->expected = ZSTD_startingInputLength(dctx->format);  /* dctx->format must be properly set */
 1567|  3.74k|    dctx->stage = ZSTDds_getFrameHeaderSize;
 1568|  3.74k|    dctx->processedCSize = 0;
 1569|  3.74k|    dctx->decodedSize = 0;
 1570|  3.74k|    dctx->previousDstEnd = NULL;
 1571|  3.74k|    dctx->prefixStart = NULL;
 1572|  3.74k|    dctx->virtualStart = NULL;
 1573|  3.74k|    dctx->dictEnd = NULL;
 1574|  3.74k|    dctx->entropy.hufTable[0] = (HUF_DTable)((ZSTD_HUFFDTABLE_CAPACITY_LOG)*0x1000001);  /* cover both little and big endian */
  ------------------
  |  |   78|  3.74k|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
 1575|  3.74k|    dctx->litEntropy = dctx->fseEntropy = 0;
 1576|  3.74k|    dctx->dictID = 0;
 1577|  3.74k|    dctx->bType = bt_reserved;
 1578|  3.74k|    dctx->isFrameDecompression = 1;
 1579|  3.74k|    ZSTD_STATIC_ASSERT(sizeof(dctx->entropy.rep) == sizeof(repStartValue));
  ------------------
  |  |   43|  3.74k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  3.74k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1580|  3.74k|    ZSTD_memcpy(dctx->entropy.rep, repStartValue, sizeof(repStartValue));  /* initial repcodes */
  ------------------
  |  |   44|  3.74k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1581|  3.74k|    dctx->LLTptr = dctx->entropy.LLTable;
 1582|  3.74k|    dctx->MLTptr = dctx->entropy.MLTable;
 1583|  3.74k|    dctx->OFTptr = dctx->entropy.OFTable;
 1584|  3.74k|    dctx->HUFptr = dctx->entropy.hufTable;
 1585|  3.74k|    return 0;
 1586|  3.74k|}
ZSTD_decompressBegin_usingDict:
 1589|  2.11k|{
 1590|  2.11k|    FORWARD_IF_ERROR( ZSTD_decompressBegin(dctx) , "");
  ------------------
  |  |  146|  2.11k|    do {                                                                           \
  |  |  147|  2.11k|        size_t const err_code = (err);                                             \
  |  |  148|  2.11k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 0, False: 2.11k]
  |  |  ------------------
  |  |  149|      0|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|      0|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|      0|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|      0|            return err_code;                                                       \
  |  |  155|      0|        }                                                                          \
  |  |  156|  2.11k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 2.11k]
  |  |  ------------------
  ------------------
 1591|  2.11k|    if (dict && dictSize)
  ------------------
  |  Branch (1591:9): [True: 0, False: 2.11k]
  |  Branch (1591:17): [True: 0, False: 0]
  ------------------
 1592|      0|        RETURN_ERROR_IF(
  ------------------
  |  |  114|      0|    do {                                                                       \
  |  |  115|      0|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1593|  2.11k|            ZSTD_isError(ZSTD_decompress_insertDictionary(dctx, dict, dictSize)),
 1594|  2.11k|            dictionary_corrupted, "");
 1595|  2.11k|    return 0;
 1596|  2.11k|}
ZSTD_decompressBegin_usingDDict:
 1602|  1.62k|{
 1603|  1.62k|    DEBUGLOG(4, "ZSTD_decompressBegin_usingDDict");
  ------------------
  |  |  104|  1.62k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1604|  1.62k|    assert(dctx != NULL);
  ------------------
  |  |   70|  1.62k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1605|  1.62k|    if (ddict) {
  ------------------
  |  Branch (1605:9): [True: 1.62k, False: 0]
  ------------------
 1606|  1.62k|        const char* const dictStart = (const char*)ZSTD_DDict_dictContent(ddict);
 1607|  1.62k|        size_t const dictSize = ZSTD_DDict_dictSize(ddict);
 1608|  1.62k|        const void* const dictEnd = dictStart + dictSize;
 1609|  1.62k|        dctx->ddictIsCold = (dctx->dictEnd != dictEnd);
 1610|  1.62k|        DEBUGLOG(4, "DDict is %s",
  ------------------
  |  |  104|  1.62k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1611|  1.62k|                    dctx->ddictIsCold ? "~cold~" : "hot!");
 1612|  1.62k|    }
 1613|  1.62k|    FORWARD_IF_ERROR( ZSTD_decompressBegin(dctx) , "");
  ------------------
  |  |  146|  1.62k|    do {                                                                           \
  |  |  147|  1.62k|        size_t const err_code = (err);                                             \
  |  |  148|  1.62k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 0, False: 1.62k]
  |  |  ------------------
  |  |  149|      0|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|      0|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|      0|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|      0|            return err_code;                                                       \
  |  |  155|      0|        }                                                                          \
  |  |  156|  1.62k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1614|  1.62k|    if (ddict) {   /* NULL ddict is equivalent to no dictionary */
  ------------------
  |  Branch (1614:9): [True: 1.62k, False: 0]
  ------------------
 1615|  1.62k|        ZSTD_copyDDictParameters(dctx, ddict);
 1616|  1.62k|    }
 1617|  1.62k|    return 0;
 1618|  1.62k|}
ZSTD_decompress_usingDDict:
 1660|  6.79k|{
 1661|       |    /* pass content and size in case legacy frames are encountered */
 1662|  6.79k|    return ZSTD_decompressMultiFrame(dctx, dst, dstCapacity, src, srcSize,
 1663|       |                                     NULL, 0,
 1664|  6.79k|                                     ddict);
 1665|  6.79k|}
zstd_decompress.c:ZSTD_initDCtx_internal:
  253|  6.74k|{
  254|  6.74k|    dctx->staticSize  = 0;
  255|  6.74k|    dctx->ddict       = NULL;
  256|  6.74k|    dctx->ddictLocal  = NULL;
  257|  6.74k|    dctx->dictEnd     = NULL;
  258|  6.74k|    dctx->ddictIsCold = 0;
  259|  6.74k|    dctx->dictUses = ZSTD_dont_use;
  260|  6.74k|    dctx->inBuff      = NULL;
  261|  6.74k|    dctx->inBuffSize  = 0;
  262|  6.74k|    dctx->outBuffSize = 0;
  263|  6.74k|    dctx->streamStage = zdss_init;
  264|  6.74k|#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)
  265|  6.74k|    dctx->legacyContext = NULL;
  266|  6.74k|    dctx->previousLegacyVersion = 0;
  267|  6.74k|#endif
  268|  6.74k|    dctx->noForwardProgress = 0;
  269|  6.74k|    dctx->oversizedDuration = 0;
  270|  6.74k|    dctx->isFrameDecompression = 1;
  271|  6.74k|#if DYNAMIC_BMI2
  272|  6.74k|    dctx->bmi2 = ZSTD_cpuSupportsBmi2();
  273|  6.74k|#endif
  274|  6.74k|    dctx->ddictSet = NULL;
  275|  6.74k|    ZSTD_DCtx_resetParameters(dctx);
  276|  6.74k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  277|       |    dctx->dictContentEndForFuzzing = NULL;
  278|  6.74k|#endif
  279|  6.74k|}
zstd_decompress.c:ZSTD_createDCtx_internal:
  294|  6.74k|static ZSTD_DCtx* ZSTD_createDCtx_internal(ZSTD_customMem customMem) {
  295|  6.74k|    if ((!customMem.customAlloc) ^ (!customMem.customFree)) return NULL;
  ------------------
  |  Branch (295:9): [True: 0, False: 6.74k]
  ------------------
  296|       |
  297|  6.74k|    {   ZSTD_DCtx* const dctx = (ZSTD_DCtx*)ZSTD_customMalloc(sizeof(*dctx), customMem);
  298|  6.74k|        if (!dctx) return NULL;
  ------------------
  |  Branch (298:13): [True: 0, False: 6.74k]
  ------------------
  299|  6.74k|        dctx->customMem = customMem;
  300|  6.74k|        ZSTD_initDCtx_internal(dctx);
  301|  6.74k|        return dctx;
  302|  6.74k|    }
  303|  6.74k|}
zstd_decompress.c:ZSTD_clearDict:
  317|  11.3k|{
  318|  11.3k|    ZSTD_freeDDict(dctx->ddictLocal);
  319|  11.3k|    dctx->ddictLocal = NULL;
  320|       |    dctx->ddict = NULL;
  321|  11.3k|    dctx->dictUses = ZSTD_dont_use;
  322|  11.3k|}
zstd_decompress.c:ZSTD_frameHeaderSize_internal:
  417|  6.90k|{
  418|  6.90k|    size_t const minInputSize = ZSTD_startingInputLength(format);
  419|  6.90k|    RETURN_ERROR_IF(srcSize < minInputSize, srcSize_wrong, "");
  ------------------
  |  |  114|  6.90k|    do {                                                                       \
  |  |  115|  6.90k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 6.90k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  6.90k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 6.90k]
  |  |  ------------------
  ------------------
  420|       |
  421|  6.90k|    {   BYTE const fhd = ((const BYTE*)src)[minInputSize-1];
  422|  6.90k|        U32 const dictID= fhd & 3;
  423|  6.90k|        U32 const singleSegment = (fhd >> 5) & 1;
  424|  6.90k|        U32 const fcsId = fhd >> 6;
  425|  6.90k|        return minInputSize + !singleSegment
  426|  6.90k|             + ZSTD_did_fieldSize[dictID] + ZSTD_fcs_fieldSize[fcsId]
  427|  6.90k|             + (singleSegment && !fcsId);
  ------------------
  |  Branch (427:17): [True: 1.64k, False: 5.26k]
  |  Branch (427:34): [True: 96, False: 1.54k]
  ------------------
  428|  6.90k|    }
  429|  6.90k|}
zstd_decompress.c:ZSTD_startingInputLength:
  233|  22.7k|{
  234|  22.7k|    size_t const startingInputLength = ZSTD_FRAMEHEADERSIZE_PREFIX(format);
  ------------------
  |  | 1257|  22.7k|#define ZSTD_FRAMEHEADERSIZE_PREFIX(format) ((format) == ZSTD_f_zstd1 ? 5 : 1)   /* minimum input size required to query frame header size */
  |  |  ------------------
  |  |  |  Branch (1257:46): [True: 22.7k, False: 0]
  |  |  ------------------
  ------------------
  235|       |    /* only supports formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless */
  236|  22.7k|    assert( (format == ZSTD_f_zstd1) || (format == ZSTD_f_zstd1_magicless) );
  ------------------
  |  |   70|  22.7k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  237|  22.7k|    return startingInputLength;
  238|  22.7k|}
zstd_decompress.c:readSkippableFrameSize:
  588|     43|{
  589|     43|    size_t const skippableHeaderSize = ZSTD_SKIPPABLEHEADERSIZE;
  ------------------
  |  | 1260|     43|#define ZSTD_SKIPPABLEHEADERSIZE    8
  ------------------
  590|     43|    U32 sizeU32;
  591|       |
  592|     43|    RETURN_ERROR_IF(srcSize < ZSTD_SKIPPABLEHEADERSIZE, srcSize_wrong, "");
  ------------------
  |  |  114|     43|    do {                                                                       \
  |  |  115|     43|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 42]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|     43|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 42]
  |  |  ------------------
  ------------------
  593|       |
  594|     42|    sizeU32 = MEM_readLE32((BYTE const*)src + ZSTD_FRAMEIDSIZE);
  ------------------
  |  |   82|     42|#define ZSTD_FRAMEIDSIZE 4   /* magic number size */
  ------------------
  595|     42|    RETURN_ERROR_IF((U32)(sizeU32 + ZSTD_SKIPPABLEHEADERSIZE) < sizeU32,
  ------------------
  |  |  114|     42|    do {                                                                       \
  |  |  115|     42|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 41]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 41]
  |  |  ------------------
  ------------------
  596|     42|                    frameParameter_unsupported, "");
  597|     41|    {   size_t const skippableSize = skippableHeaderSize + sizeU32;
  598|     41|        RETURN_ERROR_IF(skippableSize > srcSize, srcSize_wrong, "");
  ------------------
  |  |  114|     41|    do {                                                                       \
  |  |  115|     41|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 39, False: 2]
  |  |  ------------------
  |  |  116|     39|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     39|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 39]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     39|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     39|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     39|    do {                                           \
  |  |  |  |   99|     39|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 39]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     39|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 39]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     39|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     39|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 39]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     39|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     39|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 39]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     39|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     39|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     39|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     39|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     39|        }                                                                      \
  |  |  123|     41|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
  599|      2|        return skippableSize;
  600|     41|    }
  601|     41|}
zstd_decompress.c:ZSTD_decompressMultiFrame:
 1075|  6.79k|{
 1076|  6.79k|    void* const dststart = dst;
 1077|  6.79k|    int moreThan1Frame = 0;
 1078|       |
 1079|  6.79k|    DEBUGLOG(5, "ZSTD_decompressMultiFrame");
  ------------------
  |  |  104|  6.79k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 6.79k]
  |  |  ------------------
  ------------------
 1080|  6.79k|    assert(dict==NULL || ddict==NULL);  /* either dict or ddict set, not both */
  ------------------
  |  |   70|  6.79k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1081|       |
 1082|  6.79k|    if (ddict) {
  ------------------
  |  Branch (1082:9): [True: 2.17k, False: 4.61k]
  ------------------
 1083|  2.17k|        dict = ZSTD_DDict_dictContent(ddict);
 1084|  2.17k|        dictSize = ZSTD_DDict_dictSize(ddict);
 1085|  2.17k|    }
 1086|       |
 1087|  8.38k|    while (srcSize >= ZSTD_startingInputLength(dctx->format)) {
  ------------------
  |  Branch (1087:12): [True: 8.16k, False: 214]
  ------------------
 1088|       |
 1089|  8.16k|#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)
 1090|  8.16k|        if (dctx->format == ZSTD_f_zstd1 && ZSTD_isLegacy(src, srcSize)) {
  ------------------
  |  Branch (1090:13): [True: 8.16k, False: 0]
  |  Branch (1090:45): [True: 4.37k, False: 3.78k]
  ------------------
 1091|  4.37k|            size_t decodedSize;
 1092|  4.37k|            size_t const frameSize = ZSTD_findFrameCompressedSizeLegacy(src, srcSize);
 1093|  4.37k|            if (ZSTD_isError(frameSize)) return frameSize;
  ------------------
  |  |   44|  4.37k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1093:17): [True: 124, False: 4.25k]
  ------------------
 1094|  4.25k|            RETURN_ERROR_IF(dctx->staticSize, memory_allocation,
  ------------------
  |  |  114|  4.25k|    do {                                                                       \
  |  |  115|  4.25k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 4.25k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  4.25k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.25k]
  |  |  ------------------
  ------------------
 1095|  4.25k|                "legacy support is not compatible with static dctx");
 1096|       |
 1097|  4.25k|            decodedSize = ZSTD_decompressLegacy(dst, dstCapacity, src, frameSize, dict, dictSize);
 1098|  4.25k|            if (ZSTD_isError(decodedSize)) return decodedSize;
  ------------------
  |  |   44|  4.25k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1098:17): [True: 2.68k, False: 1.57k]
  ------------------
 1099|       |
 1100|  1.57k|            {
 1101|  1.57k|                unsigned long long const expectedSize = ZSTD_getFrameContentSize(src, srcSize);
 1102|  1.57k|                RETURN_ERROR_IF(expectedSize == ZSTD_CONTENTSIZE_ERROR, corruption_detected, "Corrupted frame header!");
  ------------------
  |  |  114|  1.57k|    do {                                                                       \
  |  |  115|  1.57k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 1.57k]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|  1.57k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.57k]
  |  |  ------------------
  ------------------
 1103|  1.57k|                if (expectedSize != ZSTD_CONTENTSIZE_UNKNOWN) {
  ------------------
  |  |  203|  1.57k|#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
  ------------------
  |  Branch (1103:21): [True: 201, False: 1.37k]
  ------------------
 1104|    201|                    RETURN_ERROR_IF(expectedSize != decodedSize, corruption_detected,
  ------------------
  |  |  114|    201|    do {                                                                       \
  |  |  115|    201|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 199, False: 2]
  |  |  ------------------
  |  |  116|    199|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    199|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 199]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    199|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    199|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    199|    do {                                           \
  |  |  |  |   99|    199|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 199]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    199|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 199]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    199|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    199|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 199]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    199|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    199|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 199]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    199|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    199|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    199|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    199|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    199|        }                                                                      \
  |  |  123|    201|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
 1105|    201|                        "Frame header size does not match decoded size!");
 1106|    201|                }
 1107|  1.57k|            }
 1108|       |
 1109|  1.37k|            assert(decodedSize <= dstCapacity);
  ------------------
  |  |   70|  1.37k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1110|  1.37k|            dst = (BYTE*)dst + decodedSize;
 1111|  1.37k|            dstCapacity -= decodedSize;
 1112|       |
 1113|  1.37k|            src = (const BYTE*)src + frameSize;
 1114|  1.37k|            srcSize -= frameSize;
 1115|       |
 1116|  1.37k|            continue;
 1117|  1.57k|        }
 1118|  3.78k|#endif
 1119|       |
 1120|  3.78k|        if (dctx->format == ZSTD_f_zstd1 && srcSize >= 4) {
  ------------------
  |  Branch (1120:13): [True: 3.78k, False: 0]
  |  Branch (1120:45): [True: 3.78k, False: 0]
  ------------------
 1121|  3.78k|            U32 const magicNumber = MEM_readLE32(src);
 1122|  3.78k|            DEBUGLOG(5, "reading magic number %08X", (unsigned)magicNumber);
  ------------------
  |  |  104|  3.78k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 3.78k]
  |  |  ------------------
  ------------------
 1123|  3.78k|            if ((magicNumber & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  145|  3.78k|#define ZSTD_MAGIC_SKIPPABLE_MASK   0xFFFFFFF0
  ------------------
                          if ((magicNumber & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  144|  3.78k|#define ZSTD_MAGIC_SKIPPABLE_START  0x184D2A50    /* all 16 values, from 0x184D2A50 to 0x184D2A5F, signal the beginning of a skippable frame */
  ------------------
  |  Branch (1123:17): [True: 43, False: 3.74k]
  ------------------
 1124|       |                /* skippable frame detected : skip it */
 1125|     43|                size_t const skippableSize = readSkippableFrameSize(src, srcSize);
 1126|     43|                FORWARD_IF_ERROR(skippableSize, "invalid skippable frame");
  ------------------
  |  |  146|     43|    do {                                                                           \
  |  |  147|     43|        size_t const err_code = (err);                                             \
  |  |  148|     43|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 41, False: 2]
  |  |  ------------------
  |  |  149|     41|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|     41|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 41]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     41|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|     41|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|     41|    do {                                           \
  |  |  |  |   99|     41|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 41]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     41|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 41]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|     41|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|     41|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 41]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|     41|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|     41|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 41]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|     41|            return err_code;                                                       \
  |  |  155|     41|        }                                                                          \
  |  |  156|     43|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 2]
  |  |  ------------------
  ------------------
 1127|      2|                assert(skippableSize <= srcSize);
  ------------------
  |  |   70|      2|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1128|       |
 1129|      2|                src = (const BYTE *)src + skippableSize;
 1130|      2|                srcSize -= skippableSize;
 1131|      2|                continue; /* check next frame */
 1132|     43|        }   }
 1133|       |
 1134|  3.74k|        if (ddict) {
  ------------------
  |  Branch (1134:13): [True: 1.62k, False: 2.11k]
  ------------------
 1135|       |            /* we were called from ZSTD_decompress_usingDDict */
 1136|  1.62k|            FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDDict(dctx, ddict), "");
  ------------------
  |  |  146|  1.62k|    do {                                                                           \
  |  |  147|  1.62k|        size_t const err_code = (err);                                             \
  |  |  148|  1.62k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 0, False: 1.62k]
  |  |  ------------------
  |  |  149|      0|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|      0|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|      0|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|      0|            return err_code;                                                       \
  |  |  155|      0|        }                                                                          \
  |  |  156|  1.62k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1137|  2.11k|        } else {
 1138|       |            /* this will initialize correctly with no dict if dict == NULL, so
 1139|       |             * use this in all cases but ddict */
 1140|  2.11k|            FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDict(dctx, dict, dictSize), "");
  ------------------
  |  |  146|  2.11k|    do {                                                                           \
  |  |  147|  2.11k|        size_t const err_code = (err);                                             \
  |  |  148|  2.11k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 0, False: 2.11k]
  |  |  ------------------
  |  |  149|      0|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|      0|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|      0|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|      0|            return err_code;                                                       \
  |  |  155|      0|        }                                                                          \
  |  |  156|  2.11k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 2.11k]
  |  |  ------------------
  ------------------
 1141|  2.11k|        }
 1142|  3.74k|        ZSTD_checkContinuity(dctx, dst, dstCapacity);
 1143|       |
 1144|  3.74k|        {   const size_t res = ZSTD_decompressFrame(dctx, dst, dstCapacity,
 1145|  3.74k|                                                    &src, &srcSize);
 1146|  3.74k|            RETURN_ERROR_IF(
  ------------------
  |  |  114|  3.74k|    do {                                                                       \
  |  |  115|  7.99k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 502, False: 3.24k]
  |  |  |  Branch (115:13): [True: 27, False: 475]
  |  |  ------------------
  |  |  116|     27|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     27|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 27]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     27|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     27|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     27|    do {                                           \
  |  |  |  |   99|     27|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 27]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     27|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 27]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     27|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     27|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 27]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     27|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     27|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 27]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     27|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     27|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     27|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     27|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     27|        }                                                                      \
  |  |  123|  3.74k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.71k]
  |  |  ------------------
  ------------------
 1147|  3.74k|                (ZSTD_getErrorCode(res) == ZSTD_error_prefix_unknown)
 1148|  3.74k|             && (moreThan1Frame==1),
 1149|  3.74k|                srcSize_wrong,
 1150|  3.74k|                "At least one frame successfully completed, "
 1151|  3.74k|                "but following bytes are garbage: "
 1152|  3.74k|                "it's more likely to be a srcSize error, "
 1153|  3.74k|                "specifying more input bytes than size of frame(s). "
 1154|  3.74k|                "Note: one could be unlucky, it might be a corruption error instead, "
 1155|  3.74k|                "happening right at the place where we expect zstd magic bytes. "
 1156|  3.74k|                "But this is _much_ less likely than a srcSize field error.");
 1157|  3.71k|            if (ZSTD_isError(res)) return res;
  ------------------
  |  |   44|  3.71k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1157:17): [True: 3.51k, False: 207]
  ------------------
 1158|    207|            assert(res <= dstCapacity);
  ------------------
  |  |   70|    207|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1159|    207|            if (res != 0)
  ------------------
  |  Branch (1159:17): [True: 205, False: 2]
  ------------------
 1160|    205|                dst = (BYTE*)dst + res;
 1161|    207|            dstCapacity -= res;
 1162|    207|        }
 1163|      0|        moreThan1Frame = 1;
 1164|    207|    }  /* while (srcSize >= ZSTD_frameHeaderSize_prefix) */
 1165|       |
 1166|    214|    RETURN_ERROR_IF(srcSize, srcSize_wrong, "input not entirely consumed");
  ------------------
  |  |  114|    214|    do {                                                                       \
  |  |  115|    214|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 111, False: 103]
  |  |  ------------------
  |  |  116|    111|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    111|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 111]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    111|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    111|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    111|    do {                                           \
  |  |  |  |   99|    111|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 111]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    111|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 111]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    111|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    111|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 111]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    111|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    111|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 111]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    111|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    111|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    111|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    111|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    111|        }                                                                      \
  |  |  123|    214|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 103]
  |  |  ------------------
  ------------------
 1167|       |
 1168|    103|    return (size_t)((BYTE*)dst - (BYTE*)dststart);
 1169|    214|}
zstd_decompress.c:ZSTD_decompressFrame:
  956|  3.74k|{
  957|  3.74k|    const BYTE* const istart = (const BYTE*)(*srcPtr);
  958|  3.74k|    const BYTE* ip = istart;
  959|  3.74k|    BYTE* const ostart = (BYTE*)dst;
  960|  3.74k|    BYTE* const oend = dstCapacity != 0 ? ostart + dstCapacity : ostart;
  ------------------
  |  Branch (960:24): [True: 3.74k, False: 1]
  ------------------
  961|  3.74k|    BYTE* op = ostart;
  962|  3.74k|    size_t remainingSrcSize = *srcSizePtr;
  963|       |
  964|  3.74k|    DEBUGLOG(4, "ZSTD_decompressFrame (srcSize:%i)", (int)*srcSizePtr);
  ------------------
  |  |  104|  3.74k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  965|       |
  966|       |    /* check */
  967|  3.74k|    RETURN_ERROR_IF(
  ------------------
  |  |  114|  3.74k|    do {                                                                       \
  |  |  115|  11.2k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3.74k, False: 0]
  |  |  |  Branch (115:13): [True: 33, False: 3.71k]
  |  |  ------------------
  |  |  116|     33|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     33|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 33]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     33|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     33|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     33|    do {                                           \
  |  |  |  |   99|     33|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 33]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     33|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 33]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     33|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     33|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 33]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     33|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     33|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 33]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     33|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     33|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     33|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     33|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     33|        }                                                                      \
  |  |  123|  3.74k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.71k]
  |  |  ------------------
  ------------------
  968|  3.74k|        remainingSrcSize < ZSTD_FRAMEHEADERSIZE_MIN(dctx->format)+ZSTD_blockHeaderSize,
  969|  3.74k|        srcSize_wrong, "");
  970|       |
  971|       |    /* Frame Header */
  972|  3.71k|    {   size_t const frameHeaderSize = ZSTD_frameHeaderSize_internal(
  973|  3.71k|                ip, ZSTD_FRAMEHEADERSIZE_PREFIX(dctx->format), dctx->format);
  ------------------
  |  | 1257|  3.71k|#define ZSTD_FRAMEHEADERSIZE_PREFIX(format) ((format) == ZSTD_f_zstd1 ? 5 : 1)   /* minimum input size required to query frame header size */
  |  |  ------------------
  |  |  |  Branch (1257:46): [True: 3.71k, False: 0]
  |  |  ------------------
  ------------------
  974|  3.71k|        if (ZSTD_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  |   44|  3.71k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (974:13): [True: 0, False: 3.71k]
  ------------------
  975|  3.71k|        RETURN_ERROR_IF(remainingSrcSize < frameHeaderSize+ZSTD_blockHeaderSize,
  ------------------
  |  |  114|  3.71k|    do {                                                                       \
  |  |  115|  3.71k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 13, False: 3.69k]
  |  |  ------------------
  |  |  116|     13|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     13|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 13]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     13|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     13|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     13|    do {                                           \
  |  |  |  |   99|     13|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 13]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     13|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 13]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     13|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     13|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 13]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     13|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     13|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 13]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     13|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     13|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     13|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     13|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     13|        }                                                                      \
  |  |  123|  3.71k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.69k]
  |  |  ------------------
  ------------------
  976|  3.71k|                        srcSize_wrong, "");
  977|  3.69k|        FORWARD_IF_ERROR( ZSTD_decodeFrameHeader(dctx, ip, frameHeaderSize) , "");
  ------------------
  |  |  146|  3.69k|    do {                                                                           \
  |  |  147|  3.69k|        size_t const err_code = (err);                                             \
  |  |  148|  3.69k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 505, False: 3.19k]
  |  |  ------------------
  |  |  149|    505|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|    505|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 505]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|    505|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|    505|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|    505|    do {                                           \
  |  |  |  |   99|    505|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 505]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    505|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 505]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|    505|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|    505|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 505]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|    505|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|    505|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 505]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|    505|            return err_code;                                                       \
  |  |  155|    505|        }                                                                          \
  |  |  156|  3.69k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 3.19k]
  |  |  ------------------
  ------------------
  978|  3.19k|        ip += frameHeaderSize; remainingSrcSize -= frameHeaderSize;
  979|  3.19k|    }
  980|       |
  981|       |    /* Shrink the blockSizeMax if enabled */
  982|  3.19k|    if (dctx->maxBlockSizeParam != 0)
  ------------------
  |  Branch (982:9): [True: 0, False: 3.19k]
  ------------------
  983|      0|        dctx->fParams.blockSizeMax = MIN(dctx->fParams.blockSizeMax, (unsigned)dctx->maxBlockSizeParam);
  ------------------
  |  |   54|      0|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  984|       |
  985|       |    /* Loop on each block */
  986|  4.68k|    while (1) {
  ------------------
  |  Branch (986:12): [True: 4.68k, Folded]
  ------------------
  987|  4.68k|        BYTE* oBlockEnd = oend;
  988|  4.68k|        size_t decodedSize;
  989|  4.68k|        blockProperties_t blockProperties;
  990|  4.68k|        size_t const cBlockSize = ZSTD_getcBlockSize(ip, remainingSrcSize, &blockProperties);
  991|  4.68k|        if (ZSTD_isError(cBlockSize)) return cBlockSize;
  ------------------
  |  |   44|  4.68k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (991:13): [True: 28, False: 4.65k]
  ------------------
  992|       |
  993|  4.65k|        ip += ZSTD_blockHeaderSize;
  994|  4.65k|        remainingSrcSize -= ZSTD_blockHeaderSize;
  995|  4.65k|        RETURN_ERROR_IF(cBlockSize > remainingSrcSize, srcSize_wrong, "");
  ------------------
  |  |  114|  4.65k|    do {                                                                       \
  |  |  115|  4.65k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 69, False: 4.59k]
  |  |  ------------------
  |  |  116|     69|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     69|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 69]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     69|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     69|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     69|    do {                                           \
  |  |  |  |   99|     69|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 69]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     69|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 69]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     69|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     69|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 69]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     69|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     69|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 69]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     69|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     69|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     69|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     69|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     69|        }                                                                      \
  |  |  123|  4.65k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.59k]
  |  |  ------------------
  ------------------
  996|       |
  997|  4.59k|        if (ip >= op && ip < oBlockEnd) {
  ------------------
  |  Branch (997:13): [True: 2, False: 4.58k]
  |  Branch (997:25): [True: 0, False: 2]
  ------------------
  998|       |            /* We are decompressing in-place. Limit the output pointer so that we
  999|       |             * don't overwrite the block that we are currently reading. This will
 1000|       |             * fail decompression if the input & output pointers aren't spaced
 1001|       |             * far enough apart.
 1002|       |             *
 1003|       |             * This is important to set, even when the pointers are far enough
 1004|       |             * apart, because ZSTD_decompressBlock_internal() can decide to store
 1005|       |             * literals in the output buffer, after the block it is decompressing.
 1006|       |             * Since we don't want anything to overwrite our input, we have to tell
 1007|       |             * ZSTD_decompressBlock_internal to never write past ip.
 1008|       |             *
 1009|       |             * See ZSTD_allocateLiteralsBuffer() for reference.
 1010|       |             */
 1011|      0|            oBlockEnd = op + (ip - op);
 1012|      0|        }
 1013|       |
 1014|  4.59k|        switch(blockProperties.blockType)
 1015|  4.59k|        {
 1016|  2.98k|        case bt_compressed:
  ------------------
  |  Branch (1016:9): [True: 2.98k, False: 1.60k]
  ------------------
 1017|  2.98k|            assert(dctx->isFrameDecompression == 1);
  ------------------
  |  |   70|  2.98k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1018|  2.98k|            decodedSize = ZSTD_decompressBlock_internal(dctx, op, (size_t)(oBlockEnd-op), ip, cBlockSize, not_streaming);
 1019|  2.98k|            break;
 1020|  1.21k|        case bt_raw :
  ------------------
  |  Branch (1020:9): [True: 1.21k, False: 3.37k]
  ------------------
 1021|       |            /* Use oend instead of oBlockEnd because this function is safe to overlap. It uses memmove. */
 1022|  1.21k|            decodedSize = ZSTD_copyRawBlock(op, (size_t)(oend-op), ip, cBlockSize);
 1023|  1.21k|            break;
 1024|    395|        case bt_rle :
  ------------------
  |  Branch (1024:9): [True: 395, False: 4.19k]
  ------------------
 1025|    395|            decodedSize = ZSTD_setRleBlock(op, (size_t)(oBlockEnd-op), *ip, blockProperties.origSize);
 1026|    395|            break;
 1027|      0|        case bt_reserved :
  ------------------
  |  Branch (1027:9): [True: 0, False: 4.59k]
  ------------------
 1028|      0|        default:
  ------------------
  |  Branch (1028:9): [True: 0, False: 4.59k]
  ------------------
 1029|      0|            RETURN_ERROR(corruption_detected, "invalid block type");
  ------------------
  |  |  131|      0|    do {                                                                     \
  |  |  132|      0|        RAWLOG(3, "%s:%d: ERROR!: unconditional check failed, returning %s", \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  133|      0|              __FILE__, __LINE__, ERR_QUOTE(ERROR(err)));                    \
  |  |  134|      0|        _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                               \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  135|      0|        RAWLOG(3, ": " __VA_ARGS__);                                         \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  136|      0|        RAWLOG(3, "\n");                                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  137|      0|        return ERROR(err);                                                   \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  138|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (138:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1030|  4.59k|        }
 1031|  4.59k|        FORWARD_IF_ERROR(decodedSize, "Block decompression failure");
  ------------------
  |  |  146|  4.59k|    do {                                                                           \
  |  |  147|  4.59k|        size_t const err_code = (err);                                             \
  |  |  148|  4.59k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 2.70k, False: 1.88k]
  |  |  ------------------
  |  |  149|  2.70k|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|  2.70k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2.70k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  2.70k|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|  2.70k|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|  2.70k|    do {                                           \
  |  |  |  |   99|  2.70k|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 2.70k]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|  2.70k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 2.70k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|  2.70k|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|  2.70k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2.70k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  2.70k|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|  2.70k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2.70k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|  2.70k|            return err_code;                                                       \
  |  |  155|  2.70k|        }                                                                          \
  |  |  156|  4.59k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 1.88k]
  |  |  ------------------
  ------------------
 1032|  1.88k|        DEBUGLOG(5, "Decompressed block of dSize = %u", (unsigned)decodedSize);
  ------------------
  |  |  104|  1.88k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 1.88k]
  |  |  ------------------
  ------------------
 1033|  1.88k|        if (dctx->validateChecksum) {
  ------------------
  |  Branch (1033:13): [True: 1.01k, False: 863]
  ------------------
 1034|  1.01k|            XXH64_update(&dctx->xxhState, op, decodedSize);
  ------------------
  |  |  460|  1.01k|#  define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update)
  |  |  ------------------
  |  |  |  |  443|  1.01k|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|  1.01k|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1035|  1.01k|        }
 1036|  1.88k|        if (decodedSize) /* support dst = NULL,0 */ {
  ------------------
  |  Branch (1036:13): [True: 933, False: 948]
  ------------------
 1037|    933|            op += decodedSize;
 1038|    933|        }
 1039|  1.88k|        assert(ip != NULL);
  ------------------
  |  |   70|  1.88k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1040|  1.88k|        ip += cBlockSize;
 1041|  1.88k|        remainingSrcSize -= cBlockSize;
 1042|  1.88k|        if (blockProperties.lastBlock) break;
  ------------------
  |  Branch (1042:13): [True: 388, False: 1.49k]
  ------------------
 1043|  1.88k|    }
 1044|       |
 1045|    388|    if (dctx->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN) {
  ------------------
  |  |  203|    388|#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
  ------------------
  |  Branch (1045:9): [True: 226, False: 162]
  ------------------
 1046|    226|        RETURN_ERROR_IF((U64)(op-ostart) != dctx->fParams.frameContentSize,
  ------------------
  |  |  114|    226|    do {                                                                       \
  |  |  115|    226|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 146, False: 80]
  |  |  ------------------
  |  |  116|    146|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    146|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 146]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    146|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    146|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    146|    do {                                           \
  |  |  |  |   99|    146|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 146]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    146|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 146]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    146|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    146|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 146]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    146|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    146|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 146]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    146|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    146|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    146|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    146|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    146|        }                                                                      \
  |  |  123|    226|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 80]
  |  |  ------------------
  ------------------
 1047|    226|                        corruption_detected, "");
 1048|    226|    }
 1049|    242|    if (dctx->fParams.checksumFlag) { /* Frame content checksum verification */
  ------------------
  |  Branch (1049:9): [True: 35, False: 207]
  ------------------
 1050|     35|        RETURN_ERROR_IF(remainingSrcSize<4, checksum_wrong, "");
  ------------------
  |  |  114|     35|    do {                                                                       \
  |  |  115|     35|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 34]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|     35|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 34]
  |  |  ------------------
  ------------------
 1051|     34|        if (!dctx->forceIgnoreChecksum) {
  ------------------
  |  Branch (1051:13): [True: 34, False: 0]
  ------------------
 1052|     34|            U32 const checkCalc = (U32)XXH64_digest(&dctx->xxhState);
  ------------------
  |  |  461|     34|#  define XXH64_digest XXH_NAME2(XXH_NAMESPACE, XXH64_digest)
  |  |  ------------------
  |  |  |  |  443|     34|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|     34|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1053|     34|            U32 checkRead;
 1054|     34|            checkRead = MEM_readLE32(ip);
 1055|     34|            RETURN_ERROR_IF(checkRead != checkCalc, checksum_wrong, "");
  ------------------
  |  |  114|     34|    do {                                                                       \
  |  |  115|     34|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 34, False: 0]
  |  |  ------------------
  |  |  116|     34|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     34|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 34]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     34|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     34|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     34|    do {                                           \
  |  |  |  |   99|     34|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 34]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     34|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 34]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     34|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     34|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 34]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     34|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     34|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 34]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     34|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     34|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     34|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     34|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     34|        }                                                                      \
  |  |  123|     34|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1056|     34|        }
 1057|      0|        ip += 4;
 1058|      0|        remainingSrcSize -= 4;
 1059|      0|    }
 1060|    207|    ZSTD_DCtx_trace_end(dctx, (U64)(op-ostart), (U64)(ip-istart), /* streaming */ 0);
 1061|       |    /* Allow caller to get size read */
 1062|    207|    DEBUGLOG(4, "ZSTD_decompressFrame: decompressed frame of size %i, consuming %i bytes of input", (int)(op-ostart), (int)(ip - (const BYTE*)*srcPtr));
  ------------------
  |  |  104|    207|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 207]
  |  |  ------------------
  ------------------
 1063|    207|    *srcPtr = ip;
 1064|    207|    *srcSizePtr = remainingSrcSize;
 1065|    207|    return (size_t)(op-ostart);
 1066|    242|}
zstd_decompress.c:ZSTD_getDDict:
 1181|  4.61k|{
 1182|  4.61k|    switch (dctx->dictUses) {
 1183|      0|    default:
  ------------------
  |  Branch (1183:5): [True: 0, False: 4.61k]
  ------------------
 1184|      0|        assert(0 /* Impossible */);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1185|      0|        ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|      0|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
 1186|  4.61k|    case ZSTD_dont_use:
  ------------------
  |  Branch (1186:5): [True: 4.61k, False: 0]
  ------------------
 1187|  4.61k|        ZSTD_clearDict(dctx);
 1188|  4.61k|        return NULL;
 1189|      0|    case ZSTD_use_indefinitely:
  ------------------
  |  Branch (1189:5): [True: 0, False: 4.61k]
  ------------------
 1190|      0|        return dctx->ddict;
 1191|      0|    case ZSTD_use_once:
  ------------------
  |  Branch (1191:5): [True: 0, False: 4.61k]
  ------------------
 1192|      0|        dctx->dictUses = ZSTD_dont_use;
 1193|      0|        return dctx->ddict;
 1194|  4.61k|    }
 1195|  4.61k|}
zstd_decompress.c:ZSTD_decodeFrameHeader:
  703|  3.69k|{
  704|  3.69k|    size_t const result = ZSTD_getFrameHeader_advanced(&(dctx->fParams), src, headerSize, dctx->format);
  705|  3.69k|    if (ZSTD_isError(result)) return result;    /* invalid header */
  ------------------
  |  |   44|  3.69k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (705:9): [True: 505, False: 3.19k]
  ------------------
  706|  3.19k|    RETURN_ERROR_IF(result>0, srcSize_wrong, "headerSize too small");
  ------------------
  |  |  114|  3.19k|    do {                                                                       \
  |  |  115|  3.19k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 3.19k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  3.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.19k]
  |  |  ------------------
  ------------------
  707|       |
  708|       |    /* Reference DDict requested by frame if dctx references multiple ddicts */
  709|  3.19k|    if (dctx->refMultipleDDicts == ZSTD_rmd_refMultipleDDicts && dctx->ddictSet) {
  ------------------
  |  Branch (709:9): [True: 0, False: 3.19k]
  |  Branch (709:66): [True: 0, False: 0]
  ------------------
  710|      0|        ZSTD_DCtx_selectFrameDDict(dctx);
  711|      0|    }
  712|       |
  713|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  714|       |    /* Skip the dictID check in fuzzing mode, because it makes the search
  715|       |     * harder.
  716|       |     */
  717|       |    RETURN_ERROR_IF(dctx->fParams.dictID && (dctx->dictID != dctx->fParams.dictID),
  718|       |                    dictionary_wrong, "");
  719|       |#endif
  720|  3.19k|    dctx->validateChecksum = (dctx->fParams.checksumFlag && !dctx->forceIgnoreChecksum) ? 1 : 0;
  ------------------
  |  Branch (720:31): [True: 763, False: 2.43k]
  |  Branch (720:61): [True: 763, False: 0]
  ------------------
  721|  3.19k|    if (dctx->validateChecksum) XXH64_reset(&dctx->xxhState, 0);
  ------------------
  |  |  459|    763|#  define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset)
  |  |  ------------------
  |  |  |  |  443|    763|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|    763|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (721:9): [True: 763, False: 2.43k]
  ------------------
  722|  3.19k|    dctx->processedCSize += headerSize;
  723|  3.19k|    return 0;
  724|  3.19k|}
zstd_decompress.c:ZSTD_copyRawBlock:
  898|  1.21k|{
  899|  1.21k|    DEBUGLOG(5, "ZSTD_copyRawBlock");
  ------------------
  |  |  104|  1.21k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 1.21k]
  |  |  ------------------
  ------------------
  900|  1.21k|    RETURN_ERROR_IF(srcSize > dstCapacity, dstSize_tooSmall, "");
  ------------------
  |  |  114|  1.21k|    do {                                                                       \
  |  |  115|  1.21k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4, False: 1.20k]
  |  |  ------------------
  |  |  116|      4|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      4|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      4|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      4|    do {                                           \
  |  |  |  |   99|      4|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      4|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      4|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      4|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      4|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      4|        }                                                                      \
  |  |  123|  1.21k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.20k]
  |  |  ------------------
  ------------------
  901|  1.20k|    if (dst == NULL) {
  ------------------
  |  Branch (901:9): [True: 0, False: 1.20k]
  ------------------
  902|      0|        if (srcSize == 0) return 0;
  ------------------
  |  Branch (902:13): [True: 0, False: 0]
  ------------------
  903|      0|        RETURN_ERROR(dstBuffer_null, "");
  ------------------
  |  |  131|      0|    do {                                                                     \
  |  |  132|      0|        RAWLOG(3, "%s:%d: ERROR!: unconditional check failed, returning %s", \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  133|      0|              __FILE__, __LINE__, ERR_QUOTE(ERROR(err)));                    \
  |  |  134|      0|        _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                               \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  135|      0|        RAWLOG(3, ": " __VA_ARGS__);                                         \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  136|      0|        RAWLOG(3, "\n");                                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  137|      0|        return ERROR(err);                                                   \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  138|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (138:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  904|      0|    }
  905|  1.20k|    ZSTD_memmove(dst, src, srcSize);
  ------------------
  |  |   45|  1.20k|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  906|  1.20k|    return srcSize;
  907|  1.20k|}
zstd_decompress.c:ZSTD_setRleBlock:
  912|    395|{
  913|    395|    RETURN_ERROR_IF(regenSize > dstCapacity, dstSize_tooSmall, "");
  ------------------
  |  |  114|    395|    do {                                                                       \
  |  |  115|    395|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4, False: 391]
  |  |  ------------------
  |  |  116|      4|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      4|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      4|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      4|    do {                                           \
  |  |  |  |   99|      4|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      4|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      4|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      4|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      4|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      4|        }                                                                      \
  |  |  123|    395|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 391]
  |  |  ------------------
  ------------------
  914|    391|    if (dst == NULL) {
  ------------------
  |  Branch (914:9): [True: 0, False: 391]
  ------------------
  915|      0|        if (regenSize == 0) return 0;
  ------------------
  |  Branch (915:13): [True: 0, False: 0]
  ------------------
  916|      0|        RETURN_ERROR(dstBuffer_null, "");
  ------------------
  |  |  131|      0|    do {                                                                     \
  |  |  132|      0|        RAWLOG(3, "%s:%d: ERROR!: unconditional check failed, returning %s", \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  133|      0|              __FILE__, __LINE__, ERR_QUOTE(ERROR(err)));                    \
  |  |  134|      0|        _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                               \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  135|      0|        RAWLOG(3, ": " __VA_ARGS__);                                         \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  136|      0|        RAWLOG(3, "\n");                                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  137|      0|        return ERROR(err);                                                   \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  138|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (138:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  917|      0|    }
  918|    391|    ZSTD_memset(dst, b, regenSize);
  ------------------
  |  |   46|    391|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  919|    391|    return regenSize;
  920|    391|}
zstd_decompress.c:ZSTD_DCtx_trace_end:
  923|    207|{
  924|    207|#if ZSTD_TRACE
  925|    207|    if (dctx->traceCtx && ZSTD_trace_decompress_end != NULL) {
  ------------------
  |  Branch (925:9): [True: 0, False: 207]
  |  Branch (925:27): [True: 0, False: 0]
  ------------------
  926|      0|        ZSTD_Trace trace;
  927|      0|        ZSTD_memset(&trace, 0, sizeof(trace));
  ------------------
  |  |   46|      0|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  928|      0|        trace.version = ZSTD_VERSION_NUMBER;
  ------------------
  |  |  115|      0|#define ZSTD_VERSION_NUMBER  (ZSTD_VERSION_MAJOR *100*100 + ZSTD_VERSION_MINOR *100 + ZSTD_VERSION_RELEASE)
  |  |  ------------------
  |  |  |  |  112|      0|#define ZSTD_VERSION_MAJOR    1
  |  |  ------------------
  |  |               #define ZSTD_VERSION_NUMBER  (ZSTD_VERSION_MAJOR *100*100 + ZSTD_VERSION_MINOR *100 + ZSTD_VERSION_RELEASE)
  |  |  ------------------
  |  |  |  |  113|      0|#define ZSTD_VERSION_MINOR    5
  |  |  ------------------
  |  |               #define ZSTD_VERSION_NUMBER  (ZSTD_VERSION_MAJOR *100*100 + ZSTD_VERSION_MINOR *100 + ZSTD_VERSION_RELEASE)
  |  |  ------------------
  |  |  |  |  114|      0|#define ZSTD_VERSION_RELEASE  7
  |  |  ------------------
  ------------------
  929|      0|        trace.streaming = streaming;
  930|      0|        if (dctx->ddict) {
  ------------------
  |  Branch (930:13): [True: 0, False: 0]
  ------------------
  931|      0|            trace.dictionaryID = ZSTD_getDictID_fromDDict(dctx->ddict);
  932|      0|            trace.dictionarySize = ZSTD_DDict_dictSize(dctx->ddict);
  933|      0|            trace.dictionaryIsCold = dctx->ddictIsCold;
  934|      0|        }
  935|      0|        trace.uncompressedSize = (size_t)uncompressedSize;
  936|      0|        trace.compressedSize = (size_t)compressedSize;
  937|      0|        trace.dctx = dctx;
  938|      0|        ZSTD_trace_decompress_end(dctx->traceCtx, &trace);
  939|      0|    }
  940|       |#else
  941|       |    (void)dctx;
  942|       |    (void)uncompressedSize;
  943|       |    (void)compressedSize;
  944|       |    (void)streaming;
  945|       |#endif
  946|    207|}
zstd_decompress.c:ZSTD_DCtx_resetParameters:
  241|  6.74k|{
  242|  6.74k|    assert(dctx->streamStage == zdss_init);
  ------------------
  |  |   70|  6.74k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  243|  6.74k|    dctx->format = ZSTD_f_zstd1;
  244|  6.74k|    dctx->maxWindowSize = ZSTD_MAXWINDOWSIZE_DEFAULT;
  ------------------
  |  |   40|  6.74k|#  define ZSTD_MAXWINDOWSIZE_DEFAULT (((U32)1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT) + 1)
  |  |  ------------------
  |  |  |  | 1287|  6.74k|#define ZSTD_WINDOWLOG_LIMIT_DEFAULT 27   /* by default, the streaming decoder will refuse any frame
  |  |  ------------------
  ------------------
  245|  6.74k|    dctx->outBufferMode = ZSTD_bm_buffered;
  246|  6.74k|    dctx->forceIgnoreChecksum = ZSTD_d_validateChecksum;
  247|  6.74k|    dctx->refMultipleDDicts = ZSTD_rmd_refSingleDDict;
  248|  6.74k|    dctx->disableHufAsm = 0;
  249|  6.74k|    dctx->maxBlockSizeParam = 0;
  250|  6.74k|}

ZSTD_getcBlockSize:
   65|  4.68k|{
   66|  4.68k|    RETURN_ERROR_IF(srcSize < ZSTD_blockHeaderSize, srcSize_wrong, "");
  ------------------
  |  |  114|  4.68k|    do {                                                                       \
  |  |  115|  4.68k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4, False: 4.68k]
  |  |  ------------------
  |  |  116|      4|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      4|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      4|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      4|    do {                                           \
  |  |  |  |   99|      4|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      4|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      4|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      4|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      4|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      4|        }                                                                      \
  |  |  123|  4.68k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.68k]
  |  |  ------------------
  ------------------
   67|       |
   68|  4.68k|    {   U32 const cBlockHeader = MEM_readLE24(src);
   69|  4.68k|        U32 const cSize = cBlockHeader >> 3;
   70|  4.68k|        bpPtr->lastBlock = cBlockHeader & 1;
   71|  4.68k|        bpPtr->blockType = (blockType_e)((cBlockHeader >> 1) & 3);
   72|  4.68k|        bpPtr->origSize = cSize;   /* only useful for RLE */
   73|  4.68k|        if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (73:13): [True: 395, False: 4.28k]
  ------------------
   74|  4.28k|        RETURN_ERROR_IF(bpPtr->blockType == bt_reserved, corruption_detected, "");
  ------------------
  |  |  114|  4.28k|    do {                                                                       \
  |  |  115|  4.28k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 24, False: 4.26k]
  |  |  ------------------
  |  |  116|     24|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     24|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 24]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     24|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     24|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     24|    do {                                           \
  |  |  |  |   99|     24|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 24]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     24|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 24]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     24|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     24|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 24]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     24|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     24|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 24]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     24|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     24|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     24|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     24|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     24|        }                                                                      \
  |  |  123|  4.28k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.26k]
  |  |  ------------------
  ------------------
   75|  4.26k|        return cSize;
   76|  4.28k|    }
   77|  4.28k|}
ZSTD_buildFSETable:
  630|  2.89k|{
  631|  2.89k|#if DYNAMIC_BMI2
  632|  2.89k|    if (bmi2) {
  ------------------
  |  Branch (632:9): [True: 2.38k, False: 505]
  ------------------
  633|  2.38k|        ZSTD_buildFSETable_body_bmi2(dt, normalizedCounter, maxSymbolValue,
  634|  2.38k|                baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  635|  2.38k|        return;
  636|  2.38k|    }
  637|    505|#endif
  638|    505|    (void)bmi2;
  639|    505|    ZSTD_buildFSETable_body_default(dt, normalizedCounter, maxSymbolValue,
  640|    505|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  641|    505|}
ZSTD_decodeSeqHeaders:
  697|  2.26k|{
  698|  2.26k|    const BYTE* const istart = (const BYTE*)src;
  699|  2.26k|    const BYTE* const iend = istart + srcSize;
  700|  2.26k|    const BYTE* ip = istart;
  701|  2.26k|    int nbSeq;
  702|  2.26k|    DEBUGLOG(5, "ZSTD_decodeSeqHeaders");
  ------------------
  |  |  104|  2.26k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.26k]
  |  |  ------------------
  ------------------
  703|       |
  704|       |    /* check */
  705|  2.26k|    RETURN_ERROR_IF(srcSize < MIN_SEQUENCES_SIZE, srcSize_wrong, "");
  ------------------
  |  |  114|  2.26k|    do {                                                                       \
  |  |  115|  2.26k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 2.26k]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|  2.26k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.26k]
  |  |  ------------------
  ------------------
  706|       |
  707|       |    /* SeqHead */
  708|  2.26k|    nbSeq = *ip++;
  709|  2.26k|    if (nbSeq > 0x7F) {
  ------------------
  |  Branch (709:9): [True: 1.76k, False: 501]
  ------------------
  710|  1.76k|        if (nbSeq == 0xFF) {
  ------------------
  |  Branch (710:13): [True: 35, False: 1.72k]
  ------------------
  711|     35|            RETURN_ERROR_IF(ip+2 > iend, srcSize_wrong, "");
  ------------------
  |  |  114|     35|    do {                                                                       \
  |  |  115|     35|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 33]
  |  |  ------------------
  |  |  116|      2|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      2|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      2|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      2|    do {                                           \
  |  |  |  |   99|      2|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      2|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      2|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      2|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      2|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      2|        }                                                                      \
  |  |  123|     35|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 33]
  |  |  ------------------
  ------------------
  712|     33|            nbSeq = MEM_readLE16(ip) + LONGNBSEQ;
  ------------------
  |  |   96|     33|#define LONGNBSEQ 0x7F00
  ------------------
  713|     33|            ip+=2;
  714|  1.72k|        } else {
  715|  1.72k|            RETURN_ERROR_IF(ip >= iend, srcSize_wrong, "");
  ------------------
  |  |  114|  1.72k|    do {                                                                       \
  |  |  115|  1.72k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 1.72k]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|  1.72k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.72k]
  |  |  ------------------
  ------------------
  716|  1.72k|            nbSeq = ((nbSeq-0x80)<<8) + *ip++;
  717|  1.72k|        }
  718|  1.76k|    }
  719|  2.25k|    *nbSeqPtr = nbSeq;
  720|       |
  721|  2.25k|    if (nbSeq == 0) {
  ------------------
  |  Branch (721:9): [True: 68, False: 2.19k]
  ------------------
  722|       |        /* No sequence : section ends immediately */
  723|     68|        RETURN_ERROR_IF(ip != iend, corruption_detected,
  ------------------
  |  |  114|     68|    do {                                                                       \
  |  |  115|     68|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 13, False: 55]
  |  |  ------------------
  |  |  116|     13|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     13|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 13]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     13|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     13|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     13|    do {                                           \
  |  |  |  |   99|     13|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 13]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     13|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 13]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     13|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     13|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 13]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     13|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     13|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 13]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     13|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     13|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     13|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     13|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     13|        }                                                                      \
  |  |  123|     68|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 55]
  |  |  ------------------
  ------------------
  724|     68|            "extraneous data present in the Sequences section");
  725|     55|        return (size_t)(ip - istart);
  726|     68|    }
  727|       |
  728|       |    /* FSE table descriptors */
  729|  2.19k|    RETURN_ERROR_IF(ip+1 > iend, srcSize_wrong, ""); /* minimum possible size: 1 byte for symbol encoding types */
  ------------------
  |  |  114|  2.19k|    do {                                                                       \
  |  |  115|  2.19k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 2.18k]
  |  |  ------------------
  |  |  116|      2|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      2|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      2|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      2|    do {                                           \
  |  |  |  |   99|      2|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      2|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      2|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      2|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      2|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      2|        }                                                                      \
  |  |  123|  2.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.18k]
  |  |  ------------------
  ------------------
  730|  2.18k|    RETURN_ERROR_IF(*ip & 3, corruption_detected, ""); /* The last field, Reserved, must be all-zeroes. */
  ------------------
  |  |  114|  2.18k|    do {                                                                       \
  |  |  115|  2.18k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 24, False: 2.16k]
  |  |  ------------------
  |  |  116|     24|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     24|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 24]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     24|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     24|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     24|    do {                                           \
  |  |  |  |   99|     24|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 24]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     24|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 24]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     24|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     24|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 24]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     24|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     24|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 24]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     24|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     24|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     24|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     24|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     24|        }                                                                      \
  |  |  123|  2.18k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.16k]
  |  |  ------------------
  ------------------
  731|  2.16k|    {   SymbolEncodingType_e const LLtype = (SymbolEncodingType_e)(*ip >> 6);
  732|  2.16k|        SymbolEncodingType_e const OFtype = (SymbolEncodingType_e)((*ip >> 4) & 3);
  733|  2.16k|        SymbolEncodingType_e const MLtype = (SymbolEncodingType_e)((*ip >> 2) & 3);
  734|  2.16k|        ip++;
  735|       |
  736|       |        /* Build DTables */
  737|  2.16k|        {   size_t const llhSize = ZSTD_buildSeqTable(dctx->entropy.LLTable, &dctx->LLTptr,
  738|  2.16k|                                                      LLtype, MaxLL, LLFSELog,
  ------------------
  |  |  104|  2.16k|#define MaxLL   35
  ------------------
                                                                    LLtype, MaxLL, LLFSELog,
  ------------------
  |  |  109|  2.16k|#define LLFSELog    9
  ------------------
  739|  2.16k|                                                      ip, iend-ip,
  740|  2.16k|                                                      LL_base, LL_bits,
  741|  2.16k|                                                      LL_defaultDTable, dctx->fseEntropy,
  742|  2.16k|                                                      dctx->ddictIsCold, nbSeq,
  743|  2.16k|                                                      dctx->workspace, sizeof(dctx->workspace),
  744|  2.16k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  745|  2.16k|            RETURN_ERROR_IF(ZSTD_isError(llhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  2.16k|    do {                                                                       \
  |  |  115|  2.16k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 10, False: 2.15k]
  |  |  ------------------
  |  |  116|     10|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     10|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     10|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     10|    do {                                           \
  |  |  |  |   99|     10|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     10|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     10|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     10|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     10|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     10|        }                                                                      \
  |  |  123|  2.16k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.15k]
  |  |  ------------------
  ------------------
  746|  2.15k|            ip += llhSize;
  747|  2.15k|        }
  748|       |
  749|      0|        {   size_t const ofhSize = ZSTD_buildSeqTable(dctx->entropy.OFTable, &dctx->OFTptr,
  750|  2.15k|                                                      OFtype, MaxOff, OffFSELog,
  ------------------
  |  |  106|  2.15k|#define MaxOff  31
  ------------------
                                                                    OFtype, MaxOff, OffFSELog,
  ------------------
  |  |  110|  2.15k|#define OffFSELog   8
  ------------------
  751|  2.15k|                                                      ip, iend-ip,
  752|  2.15k|                                                      OF_base, OF_bits,
  753|  2.15k|                                                      OF_defaultDTable, dctx->fseEntropy,
  754|  2.15k|                                                      dctx->ddictIsCold, nbSeq,
  755|  2.15k|                                                      dctx->workspace, sizeof(dctx->workspace),
  756|  2.15k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  757|  2.15k|            RETURN_ERROR_IF(ZSTD_isError(ofhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  2.15k|    do {                                                                       \
  |  |  115|  2.15k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 22, False: 2.13k]
  |  |  ------------------
  |  |  116|     22|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     22|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     22|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     22|    do {                                           \
  |  |  |  |   99|     22|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     22|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     22|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     22|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     22|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     22|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     22|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     22|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     22|        }                                                                      \
  |  |  123|  2.15k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.13k]
  |  |  ------------------
  ------------------
  758|  2.13k|            ip += ofhSize;
  759|  2.13k|        }
  760|       |
  761|      0|        {   size_t const mlhSize = ZSTD_buildSeqTable(dctx->entropy.MLTable, &dctx->MLTptr,
  762|  2.13k|                                                      MLtype, MaxML, MLFSELog,
  ------------------
  |  |  103|  2.13k|#define MaxML   52
  ------------------
                                                                    MLtype, MaxML, MLFSELog,
  ------------------
  |  |  108|  2.13k|#define MLFSELog    9
  ------------------
  763|  2.13k|                                                      ip, iend-ip,
  764|  2.13k|                                                      ML_base, ML_bits,
  765|  2.13k|                                                      ML_defaultDTable, dctx->fseEntropy,
  766|  2.13k|                                                      dctx->ddictIsCold, nbSeq,
  767|  2.13k|                                                      dctx->workspace, sizeof(dctx->workspace),
  768|  2.13k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  769|  2.13k|            RETURN_ERROR_IF(ZSTD_isError(mlhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  2.13k|    do {                                                                       \
  |  |  115|  2.13k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 12, False: 2.12k]
  |  |  ------------------
  |  |  116|     12|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     12|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     12|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     12|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     12|    do {                                           \
  |  |  |  |   99|     12|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 12]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     12|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     12|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     12|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     12|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     12|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     12|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     12|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     12|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     12|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     12|        }                                                                      \
  |  |  123|  2.13k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.12k]
  |  |  ------------------
  ------------------
  770|  2.12k|            ip += mlhSize;
  771|  2.12k|        }
  772|  2.12k|    }
  773|       |
  774|      0|    return ip-istart;
  775|  2.13k|}
ZSTD_decompressBlock_internal:
 2069|  2.98k|{   /* blockType == blockCompressed */
 2070|  2.98k|    const BYTE* ip = (const BYTE*)src;
 2071|  2.98k|    DEBUGLOG(5, "ZSTD_decompressBlock_internal (cSize : %u)", (unsigned)srcSize);
  ------------------
  |  |  104|  2.98k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.98k]
  |  |  ------------------
  ------------------
 2072|       |
 2073|       |    /* Note : the wording of the specification
 2074|       |     * allows compressed block to be sized exactly ZSTD_blockSizeMax(dctx).
 2075|       |     * This generally does not happen, as it makes little sense,
 2076|       |     * since an uncompressed block would feature same size and have no decompression cost.
 2077|       |     * Also, note that decoder from reference libzstd before < v1.5.4
 2078|       |     * would consider this edge case as an error.
 2079|       |     * As a consequence, avoid generating compressed blocks of size ZSTD_blockSizeMax(dctx)
 2080|       |     * for broader compatibility with the deployed ecosystem of zstd decoders */
 2081|  2.98k|    RETURN_ERROR_IF(srcSize > ZSTD_blockSizeMax(dctx), srcSize_wrong, "");
  ------------------
  |  |  114|  2.98k|    do {                                                                       \
  |  |  115|  2.98k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 2.98k]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|  2.98k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.98k]
  |  |  ------------------
  ------------------
 2082|       |
 2083|       |    /* Decode literals section */
 2084|  2.98k|    {   size_t const litCSize = ZSTD_decodeLiteralsBlock(dctx, src, srcSize, dst, dstCapacity, streaming);
 2085|  2.98k|        DEBUGLOG(5, "ZSTD_decodeLiteralsBlock : cSize=%u, nbLiterals=%zu", (U32)litCSize, dctx->litSize);
  ------------------
  |  |  104|  2.98k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.98k]
  |  |  ------------------
  ------------------
 2086|  2.98k|        if (ZSTD_isError(litCSize)) return litCSize;
  ------------------
  |  |   44|  2.98k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (2086:13): [True: 720, False: 2.26k]
  ------------------
 2087|  2.26k|        ip += litCSize;
 2088|  2.26k|        srcSize -= litCSize;
 2089|  2.26k|    }
 2090|       |
 2091|       |    /* Build Decoding Tables */
 2092|      0|    {
 2093|       |        /* Compute the maximum block size, which must also work when !frame and fParams are unset.
 2094|       |         * Additionally, take the min with dstCapacity to ensure that the totalHistorySize fits in a size_t.
 2095|       |         */
 2096|  2.26k|        size_t const blockSizeMax = MIN(dstCapacity, ZSTD_blockSizeMax(dctx));
  ------------------
  |  |   54|  2.26k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 186, False: 2.07k]
  |  |  ------------------
  ------------------
 2097|  2.26k|        size_t const totalHistorySize = ZSTD_totalHistorySize(ZSTD_maybeNullPtrAdd((BYTE*)dst, blockSizeMax), (BYTE const*)dctx->virtualStart);
 2098|       |        /* isLongOffset must be true if there are long offsets.
 2099|       |         * Offsets are long if they are larger than ZSTD_maxShortOffset().
 2100|       |         * We don't expect that to be the case in 64-bit mode.
 2101|       |         *
 2102|       |         * We check here to see if our history is large enough to allow long offsets.
 2103|       |         * If it isn't, then we can't possible have (valid) long offsets. If the offset
 2104|       |         * is invalid, then it is okay to read it incorrectly.
 2105|       |         *
 2106|       |         * If isLongOffsets is true, then we will later check our decoding table to see
 2107|       |         * if it is even possible to generate long offsets.
 2108|       |         */
 2109|  2.26k|        ZSTD_longOffset_e isLongOffset = (ZSTD_longOffset_e)(MEM_32bits() && (totalHistorySize > ZSTD_maxShortOffset()));
  ------------------
  |  Branch (2109:62): [True: 0, False: 2.26k]
  |  Branch (2109:78): [True: 0, False: 0]
  ------------------
 2110|       |        /* These macros control at build-time which decompressor implementation
 2111|       |         * we use. If neither is defined, we do some inspection and dispatch at
 2112|       |         * runtime.
 2113|       |         */
 2114|  2.26k|#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \
 2115|  2.26k|    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)
 2116|  2.26k|        int usePrefetchDecoder = dctx->ddictIsCold;
 2117|       |#else
 2118|       |        /* Set to 1 to avoid computing offset info if we don't need to.
 2119|       |         * Otherwise this value is ignored.
 2120|       |         */
 2121|       |        int usePrefetchDecoder = 1;
 2122|       |#endif
 2123|  2.26k|        int nbSeq;
 2124|  2.26k|        size_t const seqHSize = ZSTD_decodeSeqHeaders(dctx, &nbSeq, ip, srcSize);
 2125|  2.26k|        if (ZSTD_isError(seqHSize)) return seqHSize;
  ------------------
  |  |   44|  2.26k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (2125:13): [True: 87, False: 2.17k]
  ------------------
 2126|  2.17k|        ip += seqHSize;
 2127|  2.17k|        srcSize -= seqHSize;
 2128|       |
 2129|  2.17k|        RETURN_ERROR_IF((dst == NULL || dstCapacity == 0) && nbSeq > 0, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  2.17k|    do {                                                                       \
  |  |  115|  8.70k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 2.17k]
  |  |  |  Branch (115:13): [True: 1, False: 2.17k]
  |  |  |  Branch (115:13): [True: 1, False: 0]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|  2.17k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.17k]
  |  |  ------------------
  ------------------
 2130|  2.17k|        RETURN_ERROR_IF(MEM_64bits() && sizeof(size_t) == sizeof(void*) && (size_t)(-1) - (size_t)dst < (size_t)(1 << 20), dstSize_tooSmall,
  ------------------
  |  |  114|  2.17k|    do {                                                                       \
  |  |  115|  10.8k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2.17k, False: 0]
  |  |  |  Branch (115:13): [True: 0, Folded]
  |  |  |  Branch (115:13): [True: 0, False: 2.17k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  2.17k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.17k]
  |  |  ------------------
  ------------------
 2131|  2.17k|                "invalid dst");
 2132|       |
 2133|       |        /* If we could potentially have long offsets, or we might want to use the prefetch decoder,
 2134|       |         * compute information about the share of long offsets, and the maximum nbAdditionalBits.
 2135|       |         * NOTE: could probably use a larger nbSeq limit
 2136|       |         */
 2137|  2.17k|        if (isLongOffset || (!usePrefetchDecoder && (totalHistorySize > (1u << 24)) && (nbSeq > 8))) {
  ------------------
  |  Branch (2137:13): [True: 0, False: 2.17k]
  |  Branch (2137:30): [True: 1.11k, False: 1.05k]
  |  Branch (2137:53): [True: 0, False: 1.11k]
  |  Branch (2137:88): [True: 0, False: 0]
  ------------------
 2138|      0|            ZSTD_OffsetInfo const info = ZSTD_getOffsetInfo(dctx->OFTptr, nbSeq);
 2139|      0|            if (isLongOffset && info.maxNbAdditionalBits <= STREAM_ACCUMULATOR_MIN) {
  ------------------
  |  |   45|      0|#define STREAM_ACCUMULATOR_MIN    ((U32)(MEM_32bits() ? STREAM_ACCUMULATOR_MIN_32 : STREAM_ACCUMULATOR_MIN_64))
  |  |  ------------------
  |  |  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  |  |  ------------------
  |  |               #define STREAM_ACCUMULATOR_MIN    ((U32)(MEM_32bits() ? STREAM_ACCUMULATOR_MIN_32 : STREAM_ACCUMULATOR_MIN_64))
  |  |  ------------------
  |  |  |  |   44|      0|#define STREAM_ACCUMULATOR_MIN_64  57
  |  |  ------------------
  |  |  |  Branch (45:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2139:17): [True: 0, False: 0]
  |  Branch (2139:33): [True: 0, False: 0]
  ------------------
 2140|       |                /* If isLongOffset, but the maximum number of additional bits that we see in our table is small
 2141|       |                 * enough, then we know it is impossible to have too long an offset in this block, so we can
 2142|       |                 * use the regular offset decoder.
 2143|       |                 */
 2144|      0|                isLongOffset = ZSTD_lo_isRegularOffset;
 2145|      0|            }
 2146|      0|            if (!usePrefetchDecoder) {
  ------------------
  |  Branch (2146:17): [True: 0, False: 0]
  ------------------
 2147|      0|                U32 const minShare = MEM_64bits() ? 7 : 20; /* heuristic values, correspond to 2.73% and 7.81% */
  ------------------
  |  Branch (2147:38): [True: 0, False: 0]
  ------------------
 2148|      0|                usePrefetchDecoder = (info.longOffsetShare >= minShare);
 2149|      0|            }
 2150|      0|        }
 2151|       |
 2152|  2.17k|        dctx->ddictIsCold = 0;
 2153|       |
 2154|  2.17k|#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \
 2155|  2.17k|    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)
 2156|  2.17k|        if (usePrefetchDecoder) {
  ------------------
  |  Branch (2156:13): [True: 1.05k, False: 1.11k]
  ------------------
 2157|       |#else
 2158|       |        (void)usePrefetchDecoder;
 2159|       |        {
 2160|       |#endif
 2161|  1.05k|#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT
 2162|  1.05k|            return ZSTD_decompressSequencesLong(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2163|  1.05k|#endif
 2164|  1.05k|        }
 2165|       |
 2166|  1.11k|#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG
 2167|       |        /* else */
 2168|  1.11k|        if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (2168:13): [True: 585, False: 534]
  ------------------
 2169|    585|            return ZSTD_decompressSequencesSplitLitBuffer(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2170|    534|        else
 2171|    534|            return ZSTD_decompressSequences(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2172|  1.11k|#endif
 2173|  1.11k|    }
 2174|  1.11k|}
ZSTD_checkContinuity:
 2179|  3.74k|{
 2180|  3.74k|    if (dst != dctx->previousDstEnd && dstSize > 0) {   /* not contiguous */
  ------------------
  |  Branch (2180:9): [True: 3.74k, False: 0]
  |  Branch (2180:40): [True: 3.74k, False: 1]
  ------------------
 2181|  3.74k|        dctx->dictEnd = dctx->previousDstEnd;
 2182|  3.74k|        dctx->virtualStart = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->prefixStart));
 2183|  3.74k|        dctx->prefixStart = dst;
 2184|  3.74k|        dctx->previousDstEnd = dst;
 2185|  3.74k|    }
 2186|  3.74k|}
zstd_decompress_block.c:ZSTD_decodeLiteralsBlock:
  137|  2.98k|{
  138|  2.98k|    DEBUGLOG(5, "ZSTD_decodeLiteralsBlock");
  ------------------
  |  |  104|  2.98k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.98k]
  |  |  ------------------
  ------------------
  139|  2.98k|    RETURN_ERROR_IF(srcSize < MIN_CBLOCK_SIZE, corruption_detected, "");
  ------------------
  |  |  114|  2.98k|    do {                                                                       \
  |  |  115|  2.98k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 2.98k]
  |  |  ------------------
  |  |  116|      2|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      2|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      2|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      2|    do {                                           \
  |  |  |  |   99|      2|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      2|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      2|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      2|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      2|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      2|        }                                                                      \
  |  |  123|  2.98k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.98k]
  |  |  ------------------
  ------------------
  140|       |
  141|  2.98k|    {   const BYTE* const istart = (const BYTE*) src;
  142|  2.98k|        SymbolEncodingType_e const litEncType = (SymbolEncodingType_e)(istart[0] & 3);
  143|  2.98k|        size_t const blockSizeMax = ZSTD_blockSizeMax(dctx);
  144|       |
  145|  2.98k|        switch(litEncType)
  146|  2.98k|        {
  147|      1|        case set_repeat:
  ------------------
  |  Branch (147:9): [True: 1, False: 2.97k]
  ------------------
  148|      1|            DEBUGLOG(5, "set_repeat flag : re-using stats from previous compressed literals block");
  ------------------
  |  |  104|      1|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 1]
  |  |  ------------------
  ------------------
  149|      1|            RETURN_ERROR_IF(dctx->litEntropy==0, dictionary_corrupted, "");
  ------------------
  |  |  114|      1|    do {                                                                       \
  |  |  115|      1|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 0]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  150|      0|            ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|      0|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  151|       |
  152|    720|        case set_compressed:
  ------------------
  |  Branch (152:9): [True: 720, False: 2.26k]
  ------------------
  153|    720|            RETURN_ERROR_IF(srcSize < 5, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need up to 5 for case 3");
  ------------------
  |  |  114|    720|    do {                                                                       \
  |  |  115|    720|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 718]
  |  |  ------------------
  |  |  116|      2|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      2|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      2|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      2|    do {                                           \
  |  |  |  |   99|      2|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      2|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      2|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      2|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      2|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      2|        }                                                                      \
  |  |  123|    720|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 718]
  |  |  ------------------
  ------------------
  154|    718|            {   size_t lhSize, litSize, litCSize;
  155|    718|                U32 singleStream=0;
  156|    718|                U32 const lhlCode = (istart[0] >> 2) & 3;
  157|    718|                U32 const lhc = MEM_readLE32(istart);
  158|    718|                size_t hufSuccess;
  159|    718|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|    718|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 467, False: 251]
  |  |  ------------------
  ------------------
  160|    718|                int const flags = 0
  161|    718|                    | (ZSTD_DCtx_get_bmi2(dctx) ? HUF_flags_bmi2 : 0)
  ------------------
  |  Branch (161:24): [True: 718, False: 0]
  ------------------
  162|    718|                    | (dctx->disableHufAsm ? HUF_flags_disableAsm : 0);
  ------------------
  |  Branch (162:24): [True: 0, False: 718]
  ------------------
  163|    718|                switch(lhlCode)
  164|    718|                {
  165|     86|                case 0: case 1: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (165:17): [True: 72, False: 646]
  |  Branch (165:25): [True: 14, False: 704]
  |  Branch (165:33): [True: 0, False: 718]
  ------------------
  166|       |                    /* 2 - 2 - 10 - 10 */
  167|     86|                    singleStream = !lhlCode;
  168|     86|                    lhSize = 3;
  169|     86|                    litSize  = (lhc >> 4) & 0x3FF;
  170|     86|                    litCSize = (lhc >> 14) & 0x3FF;
  171|     86|                    break;
  172|    474|                case 2:
  ------------------
  |  Branch (172:17): [True: 474, False: 244]
  ------------------
  173|       |                    /* 2 - 2 - 14 - 14 */
  174|    474|                    lhSize = 4;
  175|    474|                    litSize  = (lhc >> 4) & 0x3FFF;
  176|    474|                    litCSize = lhc >> 18;
  177|    474|                    break;
  178|    158|                case 3:
  ------------------
  |  Branch (178:17): [True: 158, False: 560]
  ------------------
  179|       |                    /* 2 - 2 - 18 - 18 */
  180|    158|                    lhSize = 5;
  181|    158|                    litSize  = (lhc >> 4) & 0x3FFFF;
  182|    158|                    litCSize = (lhc >> 22) + ((size_t)istart[4] << 10);
  183|    158|                    break;
  184|    718|                }
  185|    718|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|    718|    do {                                                                       \
  |  |  115|  2.14k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 709, False: 9]
  |  |  |  Branch (115:13): [True: 0, False: 709]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|    718|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 718]
  |  |  ------------------
  ------------------
  186|    718|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|    718|    do {                                                                       \
  |  |  115|    718|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4, False: 714]
  |  |  ------------------
  |  |  116|      4|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      4|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      4|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      4|    do {                                           \
  |  |  |  |   99|      4|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      4|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      4|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      4|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      4|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      4|        }                                                                      \
  |  |  123|    718|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 714]
  |  |  ------------------
  ------------------
  187|    714|                if (!singleStream)
  ------------------
  |  Branch (187:21): [True: 642, False: 72]
  ------------------
  188|    642|                    RETURN_ERROR_IF(litSize < MIN_LITERALS_FOR_4_STREAMS, literals_headerWrong,
  ------------------
  |  |  114|    642|    do {                                                                       \
  |  |  115|    642|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 640]
  |  |  ------------------
  |  |  116|      2|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      2|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      2|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      2|    do {                                           \
  |  |  |  |   99|      2|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      2|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      2|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      2|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      2|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      2|        }                                                                      \
  |  |  123|    642|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 640]
  |  |  ------------------
  ------------------
  189|    714|                        "Not enough literals (%zu) for the 4-streams mode (min %u)",
  190|    714|                        litSize, MIN_LITERALS_FOR_4_STREAMS);
  191|    712|                RETURN_ERROR_IF(litCSize + lhSize > srcSize, corruption_detected, "");
  ------------------
  |  |  114|    712|    do {                                                                       \
  |  |  115|    712|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 22, False: 690]
  |  |  ------------------
  |  |  116|     22|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     22|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     22|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     22|    do {                                           \
  |  |  |  |   99|     22|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     22|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     22|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     22|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     22|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     22|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     22|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     22|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     22|        }                                                                      \
  |  |  123|    712|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 690]
  |  |  ------------------
  ------------------
  192|    690|                RETURN_ERROR_IF(expectedWriteSize < litSize , dstSize_tooSmall, "");
  ------------------
  |  |  114|    690|    do {                                                                       \
  |  |  115|    690|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 687]
  |  |  ------------------
  |  |  116|      3|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      3|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      3|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      3|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      3|    do {                                           \
  |  |  |  |   99|      3|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      3|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      3|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      3|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      3|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      3|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      3|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      3|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      3|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      3|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      3|        }                                                                      \
  |  |  123|    690|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 687]
  |  |  ------------------
  ------------------
  193|    687|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 0);
  194|       |
  195|       |                /* prefetch huffman table if cold */
  196|    687|                if (dctx->ddictIsCold && (litSize > 768 /* heuristic */)) {
  ------------------
  |  Branch (196:21): [True: 55, False: 632]
  |  Branch (196:42): [True: 40, False: 15]
  ------------------
  197|     40|                    PREFETCH_AREA(dctx->HUFptr, sizeof(dctx->entropy.hufTable));
  ------------------
  |  |  159|     40|    do {                                                 \
  |  |  160|     40|        const char* const _ptr = (const char*)(p);       \
  |  |  161|     40|        size_t const _size = (size_t)(s);                \
  |  |  162|     40|        size_t _pos;                                     \
  |  |  163|  10.3k|        for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \
  |  |  ------------------
  |  |  |  |  156|  10.2k|#define CACHELINE_SIZE 64
  |  |  ------------------
  |  |  |  Branch (163:22): [True: 10.2k, False: 40]
  |  |  ------------------
  |  |  164|  10.2k|            PREFETCH_L2(_ptr + _pos);                    \
  |  |  ------------------
  |  |  |  |  146|  10.2k|#    define PREFETCH_L2(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */)
  |  |  ------------------
  |  |  165|  10.2k|        }                                                \
  |  |  166|     40|    } while (0)
  |  |  ------------------
  |  |  |  Branch (166:14): [Folded, False: 40]
  |  |  ------------------
  ------------------
  198|     40|                }
  199|       |
  200|    687|                if (litEncType==set_repeat) {
  ------------------
  |  Branch (200:21): [True: 0, False: 687]
  ------------------
  201|      0|                    if (singleStream) {
  ------------------
  |  Branch (201:25): [True: 0, False: 0]
  ------------------
  202|      0|                        hufSuccess = HUF_decompress1X_usingDTable(
  203|      0|                            dctx->litBuffer, litSize, istart+lhSize, litCSize,
  204|      0|                            dctx->HUFptr, flags);
  205|      0|                    } else {
  206|      0|                        assert(litSize >= MIN_LITERALS_FOR_4_STREAMS);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  207|      0|                        hufSuccess = HUF_decompress4X_usingDTable(
  208|      0|                            dctx->litBuffer, litSize, istart+lhSize, litCSize,
  209|      0|                            dctx->HUFptr, flags);
  210|      0|                    }
  211|    687|                } else {
  212|    687|                    if (singleStream) {
  ------------------
  |  Branch (212:25): [True: 70, False: 617]
  ------------------
  213|       |#if defined(HUF_FORCE_DECOMPRESS_X2)
  214|       |                        hufSuccess = HUF_decompress1X_DCtx_wksp(
  215|       |                            dctx->entropy.hufTable, dctx->litBuffer, litSize,
  216|       |                            istart+lhSize, litCSize, dctx->workspace,
  217|       |                            sizeof(dctx->workspace), flags);
  218|       |#else
  219|     70|                        hufSuccess = HUF_decompress1X1_DCtx_wksp(
  220|     70|                            dctx->entropy.hufTable, dctx->litBuffer, litSize,
  221|     70|                            istart+lhSize, litCSize, dctx->workspace,
  222|     70|                            sizeof(dctx->workspace), flags);
  223|     70|#endif
  224|    617|                    } else {
  225|    617|                        hufSuccess = HUF_decompress4X_hufOnly_wksp(
  226|    617|                            dctx->entropy.hufTable, dctx->litBuffer, litSize,
  227|    617|                            istart+lhSize, litCSize, dctx->workspace,
  228|    617|                            sizeof(dctx->workspace), flags);
  229|    617|                    }
  230|    687|                }
  231|    687|                if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (231:21): [True: 14, False: 673]
  ------------------
  232|     14|                {
  233|     14|                    assert(litSize > ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   70|     14|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  234|     14|                    ZSTD_memcpy(dctx->litExtraBuffer, dctx->litBufferEnd - ZSTD_LITBUFFEREXTRASIZE, ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   44|     84|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  |  |  ------------------
  |  |  |  Branch (44:51): [True: 0, Folded]
  |  |  |  Branch (44:51): [True: 14, Folded]
  |  |  |  Branch (44:51): [Folded, False: 14]
  |  |  |  Branch (44:55): [True: 0, Folded]
  |  |  |  Branch (44:55): [True: 14, Folded]
  |  |  |  Branch (44:55): [Folded, False: 14]
  |  |  ------------------
  ------------------
  235|     14|                    ZSTD_memmove(dctx->litBuffer + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH, dctx->litBuffer, litSize - ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   45|     84|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  |  |  ------------------
  |  |  |  Branch (45:49): [True: 0, Folded]
  |  |  |  Branch (45:49): [True: 14, Folded]
  |  |  |  Branch (45:49): [Folded, False: 14]
  |  |  |  Branch (45:57): [True: 0, Folded]
  |  |  |  Branch (45:57): [True: 14, Folded]
  |  |  |  Branch (45:57): [Folded, False: 14]
  |  |  ------------------
  ------------------
  236|     14|                    dctx->litBuffer += ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  118|     14|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|     14|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|     28|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 14]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 14, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  dctx->litBuffer += ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|     14|#define WILDCOPY_OVERLENGTH 32
  ------------------
  237|     14|                    dctx->litBufferEnd -= WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|     14|#define WILDCOPY_OVERLENGTH 32
  ------------------
  238|     14|                    assert(dctx->litBufferEnd <= (BYTE*)dst + blockSizeMax);
  ------------------
  |  |   70|     14|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  239|     14|                }
  240|       |
  241|    687|                RETURN_ERROR_IF(HUF_isError(hufSuccess), corruption_detected, "");
  ------------------
  |  |  114|    687|    do {                                                                       \
  |  |  115|    687|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 611, False: 76]
  |  |  ------------------
  |  |  116|    611|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    611|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 611]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    611|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    611|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    611|    do {                                           \
  |  |  |  |   99|    611|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 611]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    611|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 611]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    611|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    611|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 611]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    611|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    611|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 611]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    611|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    611|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    611|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    611|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    611|        }                                                                      \
  |  |  123|    687|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 76]
  |  |  ------------------
  ------------------
  242|       |
  243|     76|                dctx->litPtr = dctx->litBuffer;
  244|     76|                dctx->litSize = litSize;
  245|     76|                dctx->litEntropy = 1;
  246|     76|                if (litEncType==set_compressed) dctx->HUFptr = dctx->entropy.hufTable;
  ------------------
  |  Branch (246:21): [True: 76, False: 0]
  ------------------
  247|     76|                return litCSize + lhSize;
  248|    687|            }
  249|       |
  250|    313|        case set_basic:
  ------------------
  |  Branch (250:9): [True: 313, False: 2.66k]
  ------------------
  251|    313|            {   size_t litSize, lhSize;
  252|    313|                U32 const lhlCode = ((istart[0]) >> 2) & 3;
  253|    313|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|    313|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 212, False: 101]
  |  |  ------------------
  ------------------
  254|    313|                switch(lhlCode)
  255|    313|                {
  256|    168|                case 0: case 2: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (256:17): [True: 150, False: 163]
  |  Branch (256:25): [True: 18, False: 295]
  |  Branch (256:33): [True: 0, False: 313]
  ------------------
  257|    168|                    lhSize = 1;
  258|    168|                    litSize = istart[0] >> 3;
  259|    168|                    break;
  260|    105|                case 1:
  ------------------
  |  Branch (260:17): [True: 105, False: 208]
  ------------------
  261|    105|                    lhSize = 2;
  262|    105|                    litSize = MEM_readLE16(istart) >> 4;
  263|    105|                    break;
  264|     40|                case 3:
  ------------------
  |  Branch (264:17): [True: 40, False: 273]
  ------------------
  265|     40|                    lhSize = 3;
  266|     40|                    RETURN_ERROR_IF(srcSize<3, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize = 3");
  ------------------
  |  |  114|     40|    do {                                                                       \
  |  |  115|     40|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 39]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|     40|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 39]
  |  |  ------------------
  ------------------
  267|     39|                    litSize = MEM_readLE24(istart) >> 4;
  268|     39|                    break;
  269|    313|                }
  270|       |
  271|    312|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|    312|    do {                                                                       \
  |  |  115|    861|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 237, False: 75]
  |  |  |  Branch (115:13): [True: 0, False: 237]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|    312|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 312]
  |  |  ------------------
  ------------------
  272|    312|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|    312|    do {                                                                       \
  |  |  115|    312|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 18, False: 294]
  |  |  ------------------
  |  |  116|     18|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     18|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     18|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     18|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     18|    do {                                           \
  |  |  |  |   99|     18|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 18]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     18|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     18|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     18|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     18|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     18|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     18|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     18|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     18|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     18|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     18|        }                                                                      \
  |  |  123|    312|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 294]
  |  |  ------------------
  ------------------
  273|    294|                RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, "");
  ------------------
  |  |  114|    294|    do {                                                                       \
  |  |  115|    294|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 293]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|    294|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 293]
  |  |  ------------------
  ------------------
  274|    293|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1);
  275|    293|                if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */
  ------------------
  |  |  199|    293|#define WILDCOPY_OVERLENGTH 32
  ------------------
  |  Branch (275:21): [True: 153, False: 140]
  ------------------
  276|    153|                    RETURN_ERROR_IF(litSize+lhSize > srcSize, corruption_detected, "");
  ------------------
  |  |  114|    153|    do {                                                                       \
  |  |  115|    153|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 31, False: 122]
  |  |  ------------------
  |  |  116|     31|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     31|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 31]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     31|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     31|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     31|    do {                                           \
  |  |  |  |   99|     31|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 31]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     31|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 31]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     31|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     31|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 31]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     31|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     31|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 31]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     31|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     31|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     31|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     31|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     31|        }                                                                      \
  |  |  123|    153|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 122]
  |  |  ------------------
  ------------------
  277|    122|                    if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (277:25): [True: 0, False: 122]
  ------------------
  278|      0|                    {
  279|      0|                        ZSTD_memcpy(dctx->litBuffer, istart + lhSize, litSize - ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   44|      0|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  |  |  ------------------
  |  |  |  Branch (44:55): [True: 0, Folded]
  |  |  |  Branch (44:55): [True: 0, Folded]
  |  |  |  Branch (44:55): [Folded, False: 0]
  |  |  ------------------
  ------------------
  280|      0|                        ZSTD_memcpy(dctx->litExtraBuffer, istart + lhSize + litSize - ZSTD_LITBUFFEREXTRASIZE, ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   44|      0|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  |  |  ------------------
  |  |  |  Branch (44:51): [True: 0, Folded]
  |  |  |  Branch (44:51): [True: 0, Folded]
  |  |  |  Branch (44:51): [Folded, False: 0]
  |  |  |  Branch (44:55): [True: 0, Folded]
  |  |  |  Branch (44:55): [True: 0, Folded]
  |  |  |  Branch (44:55): [Folded, False: 0]
  |  |  ------------------
  ------------------
  281|      0|                    }
  282|    122|                    else
  283|    122|                    {
  284|    122|                        ZSTD_memcpy(dctx->litBuffer, istart + lhSize, litSize);
  ------------------
  |  |   44|    122|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  285|    122|                    }
  286|    122|                    dctx->litPtr = dctx->litBuffer;
  287|    122|                    dctx->litSize = litSize;
  288|    122|                    return lhSize+litSize;
  289|    153|                }
  290|       |                /* direct reference into compressed stream */
  291|    140|                dctx->litPtr = istart+lhSize;
  292|    140|                dctx->litSize = litSize;
  293|    140|                dctx->litBufferEnd = dctx->litPtr + litSize;
  294|    140|                dctx->litBufferLocation = ZSTD_not_in_dst;
  295|    140|                return lhSize+litSize;
  296|    293|            }
  297|       |
  298|  1.94k|        case set_rle:
  ------------------
  |  Branch (298:9): [True: 1.94k, False: 1.03k]
  ------------------
  299|  1.94k|            {   U32 const lhlCode = ((istart[0]) >> 2) & 3;
  300|  1.94k|                size_t litSize, lhSize;
  301|  1.94k|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|  1.94k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 1.88k, False: 58]
  |  |  ------------------
  ------------------
  302|  1.94k|                switch(lhlCode)
  303|  1.94k|                {
  304|     10|                case 0: case 2: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (304:17): [True: 7, False: 1.93k]
  |  Branch (304:25): [True: 3, False: 1.94k]
  |  Branch (304:33): [True: 0, False: 1.94k]
  ------------------
  305|     10|                    lhSize = 1;
  306|     10|                    litSize = istart[0] >> 3;
  307|     10|                    break;
  308|     26|                case 1:
  ------------------
  |  Branch (308:17): [True: 26, False: 1.92k]
  ------------------
  309|     26|                    lhSize = 2;
  310|     26|                    RETURN_ERROR_IF(srcSize<3, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize+1 = 3");
  ------------------
  |  |  114|     26|    do {                                                                       \
  |  |  115|     26|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 23]
  |  |  ------------------
  |  |  116|      3|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      3|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      3|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      3|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      3|    do {                                           \
  |  |  |  |   99|      3|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      3|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      3|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      3|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      3|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      3|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      3|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      3|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      3|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      3|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      3|        }                                                                      \
  |  |  123|     26|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 23]
  |  |  ------------------
  ------------------
  311|     23|                    litSize = MEM_readLE16(istart) >> 4;
  312|     23|                    break;
  313|  1.91k|                case 3:
  ------------------
  |  Branch (313:17): [True: 1.91k, False: 36]
  ------------------
  314|  1.91k|                    lhSize = 3;
  315|  1.91k|                    RETURN_ERROR_IF(srcSize<4, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize+1 = 4");
  ------------------
  |  |  114|  1.91k|    do {                                                                       \
  |  |  115|  1.91k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 1.90k]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|  1.91k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.90k]
  |  |  ------------------
  ------------------
  316|  1.90k|                    litSize = MEM_readLE24(istart) >> 4;
  317|  1.90k|                    break;
  318|  1.94k|                }
  319|  1.94k|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  1.94k|    do {                                                                       \
  |  |  115|  5.82k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1.93k, False: 3]
  |  |  |  Branch (115:13): [True: 0, False: 1.93k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  1.94k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.94k]
  |  |  ------------------
  ------------------
  320|  1.94k|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|  1.94k|    do {                                                                       \
  |  |  115|  1.94k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 17, False: 1.92k]
  |  |  ------------------
  |  |  116|     17|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     17|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     17|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     17|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     17|    do {                                           \
  |  |  |  |   99|     17|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 17]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     17|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     17|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     17|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     17|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     17|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     17|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     17|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     17|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     17|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     17|        }                                                                      \
  |  |  123|  1.94k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.92k]
  |  |  ------------------
  ------------------
  321|  1.92k|                RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, "");
  ------------------
  |  |  114|  1.92k|    do {                                                                       \
  |  |  115|  1.92k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 1.92k]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|  1.92k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.92k]
  |  |  ------------------
  ------------------
  322|  1.92k|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1);
  323|  1.92k|                if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (323:21): [True: 1.55k, False: 372]
  ------------------
  324|  1.55k|                {
  325|  1.55k|                    ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize - ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   46|  9.31k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  |  |  ------------------
  |  |  |  Branch (46:55): [True: 0, Folded]
  |  |  |  Branch (46:55): [True: 1.55k, Folded]
  |  |  |  Branch (46:55): [Folded, False: 1.55k]
  |  |  ------------------
  ------------------
  326|  1.55k|                    ZSTD_memset(dctx->litExtraBuffer, istart[lhSize], ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   46|  9.31k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  |  |  ------------------
  |  |  |  Branch (46:55): [True: 0, Folded]
  |  |  |  Branch (46:55): [True: 1.55k, Folded]
  |  |  |  Branch (46:55): [Folded, False: 1.55k]
  |  |  ------------------
  ------------------
  327|  1.55k|                }
  328|    372|                else
  329|    372|                {
  330|    372|                    ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize);
  ------------------
  |  |   46|    372|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  331|    372|                }
  332|  1.92k|                dctx->litPtr = dctx->litBuffer;
  333|  1.92k|                dctx->litSize = litSize;
  334|  1.92k|                return lhSize+1;
  335|  1.92k|            }
  336|      0|        default:
  ------------------
  |  Branch (336:9): [True: 0, False: 2.98k]
  ------------------
  337|      0|            RETURN_ERROR(corruption_detected, "impossible");
  ------------------
  |  |  131|      0|    do {                                                                     \
  |  |  132|      0|        RAWLOG(3, "%s:%d: ERROR!: unconditional check failed, returning %s", \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  133|      0|              __FILE__, __LINE__, ERR_QUOTE(ERROR(err)));                    \
  |  |  134|      0|        _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                               \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  135|      0|        RAWLOG(3, ": " __VA_ARGS__);                                         \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  136|      0|        RAWLOG(3, "\n");                                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  137|      0|        return ERROR(err);                                                   \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  138|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (138:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  338|  2.98k|        }
  339|  2.98k|    }
  340|  2.98k|}
zstd_decompress_block.c:ZSTD_allocateLiteralsBuffer:
   82|  2.90k|{
   83|  2.90k|    size_t const blockSizeMax = ZSTD_blockSizeMax(dctx);
   84|  2.90k|    assert(litSize <= blockSizeMax);
  ------------------
  |  |   70|  2.90k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   85|  2.90k|    assert(dctx->isFrameDecompression || streaming == not_streaming);
  ------------------
  |  |   70|  2.90k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   86|  2.90k|    assert(expectedWriteSize <= blockSizeMax);
  ------------------
  |  |   70|  2.90k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   87|  2.90k|    if (streaming == not_streaming && dstCapacity > blockSizeMax + WILDCOPY_OVERLENGTH + litSize + WILDCOPY_OVERLENGTH) {
  ------------------
  |  |  199|  2.90k|#define WILDCOPY_OVERLENGTH 32
  ------------------
                  if (streaming == not_streaming && dstCapacity > blockSizeMax + WILDCOPY_OVERLENGTH + litSize + WILDCOPY_OVERLENGTH) {
  ------------------
  |  |  199|  2.90k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  |  Branch (87:9): [True: 2.90k, False: 0]
  |  Branch (87:39): [True: 910, False: 1.99k]
  ------------------
   88|       |        /* If we aren't streaming, we can just put the literals after the output
   89|       |         * of the current block. We don't need to worry about overwriting the
   90|       |         * extDict of our window, because it doesn't exist.
   91|       |         * So if we have space after the end of the block, just put it there.
   92|       |         */
   93|    910|        dctx->litBuffer = (BYTE*)dst + blockSizeMax + WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|    910|#define WILDCOPY_OVERLENGTH 32
  ------------------
   94|    910|        dctx->litBufferEnd = dctx->litBuffer + litSize;
   95|    910|        dctx->litBufferLocation = ZSTD_in_dst;
   96|  1.99k|    } else if (litSize <= ZSTD_LITBUFFEREXTRASIZE) {
  ------------------
  |  |  118|  1.99k|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|  1.99k|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  3.98k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 1.99k]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 1.99k, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (96:16): [True: 419, False: 1.57k]
  ------------------
   97|       |        /* Literals fit entirely within the extra buffer, put them there to avoid
   98|       |         * having to split the literals.
   99|       |         */
  100|    419|        dctx->litBuffer = dctx->litExtraBuffer;
  101|    419|        dctx->litBufferEnd = dctx->litBuffer + litSize;
  102|    419|        dctx->litBufferLocation = ZSTD_not_in_dst;
  103|  1.57k|    } else {
  104|  1.57k|        assert(blockSizeMax > ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   70|  1.57k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  105|       |        /* Literals must be split between the output block and the extra lit
  106|       |         * buffer. We fill the extra lit buffer with the tail of the literals,
  107|       |         * and put the rest of the literals at the end of the block, with
  108|       |         * WILDCOPY_OVERLENGTH of buffer room to allow for overreads.
  109|       |         * This MUST not write more than our maxBlockSize beyond dst, because in
  110|       |         * streaming mode, that could overwrite part of our extDict window.
  111|       |         */
  112|  1.57k|        if (splitImmediately) {
  ------------------
  |  Branch (112:13): [True: 1.56k, False: 14]
  ------------------
  113|       |            /* won't fit in litExtraBuffer, so it will be split between end of dst and extra buffer */
  114|  1.56k|            dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  118|  1.56k|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|  1.56k|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  3.12k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 1.56k]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 1.56k, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|  1.56k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  115|  1.56k|            dctx->litBufferEnd = dctx->litBuffer + litSize - ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|  1.56k|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|  1.56k|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  3.12k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 1.56k]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 1.56k, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|  1.56k|        } else {
  117|       |            /* initially this will be stored entirely in dst during huffman decoding, it will partially be shifted to litExtraBuffer after */
  118|     14|            dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize;
  119|     14|            dctx->litBufferEnd = (BYTE*)dst + expectedWriteSize;
  120|     14|        }
  121|  1.57k|        dctx->litBufferLocation = ZSTD_split;
  122|  1.57k|        assert(dctx->litBufferEnd <= (BYTE*)dst + expectedWriteSize);
  ------------------
  |  |   70|  1.57k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  123|  1.57k|    }
  124|  2.90k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body_bmi2:
  620|  2.38k|{
  621|  2.38k|    ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,
  622|  2.38k|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  623|  2.38k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body:
  489|  2.89k|{
  490|  2.89k|    ZSTD_seqSymbol* const tableDecode = dt+1;
  491|  2.89k|    U32 const maxSV1 = maxSymbolValue + 1;
  492|  2.89k|    U32 const tableSize = 1 << tableLog;
  493|       |
  494|  2.89k|    U16* symbolNext = (U16*)wksp;
  495|  2.89k|    BYTE* spread = (BYTE*)(symbolNext + MaxSeq + 1);
  ------------------
  |  |  107|  2.89k|#define MaxSeq MAX(MaxLL, MaxML)   /* Assumption : MaxOff < MaxLL,MaxML */
  |  |  ------------------
  |  |  |  |   55|  2.89k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (55:19): [Folded, False: 2.89k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  496|  2.89k|    U32 highThreshold = tableSize - 1;
  497|       |
  498|       |
  499|       |    /* Sanity Checks */
  500|  2.89k|    assert(maxSymbolValue <= MaxSeq);
  ------------------
  |  |   70|  2.89k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  501|  2.89k|    assert(tableLog <= MaxFSELog);
  ------------------
  |  |   70|  2.89k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  502|  2.89k|    assert(wkspSize >= ZSTD_BUILD_FSE_TABLE_WKSP_SIZE);
  ------------------
  |  |   70|  2.89k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  503|  2.89k|    (void)wkspSize;
  504|       |    /* Init, lay down lowprob symbols */
  505|  2.89k|    {   ZSTD_seqSymbol_header DTableH;
  506|  2.89k|        DTableH.tableLog = tableLog;
  507|  2.89k|        DTableH.fastMode = 1;
  508|  2.89k|        {   S16 const largeLimit= (S16)(1 << (tableLog-1));
  509|  2.89k|            U32 s;
  510|  45.7k|            for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (510:23): [True: 42.8k, False: 2.89k]
  ------------------
  511|  42.8k|                if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (511:21): [True: 13.0k, False: 29.8k]
  ------------------
  512|  13.0k|                    tableDecode[highThreshold--].baseValue = s;
  513|  13.0k|                    symbolNext[s] = 1;
  514|  29.8k|                } else {
  515|  29.8k|                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
  ------------------
  |  Branch (515:25): [True: 1.69k, False: 28.1k]
  ------------------
  516|  29.8k|                    assert(normalizedCounter[s]>=0);
  ------------------
  |  |   70|  29.8k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  517|  29.8k|                    symbolNext[s] = (U16)normalizedCounter[s];
  518|  29.8k|        }   }   }
  519|  2.89k|        ZSTD_memcpy(dt, &DTableH, sizeof(DTableH));
  ------------------
  |  |   44|  2.89k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  520|  2.89k|    }
  521|       |
  522|       |    /* Spread symbols */
  523|  2.89k|    assert(tableSize <= 512);
  ------------------
  |  |   70|  2.89k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  524|       |    /* Specialized symbol spreading for the case when there are
  525|       |     * no low probability (-1 count) symbols. When compressing
  526|       |     * small blocks we avoid low probability symbols to hit this
  527|       |     * case, since header decoding speed matters more.
  528|       |     */
  529|  2.89k|    if (highThreshold == tableSize - 1) {
  ------------------
  |  Branch (529:9): [True: 751, False: 2.14k]
  ------------------
  530|    751|        size_t const tableMask = tableSize-1;
  531|    751|        size_t const step = FSE_TABLESTEP(tableSize);
  ------------------
  |  |  623|    751|#define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3)
  ------------------
  532|       |        /* First lay down the symbols in order.
  533|       |         * We use a uint64_t to lay down 8 bytes at a time. This reduces branch
  534|       |         * misses since small blocks generally have small table logs, so nearly
  535|       |         * all symbols have counts <= 8. We ensure we have 8 bytes at the end of
  536|       |         * our buffer to handle the over-write.
  537|       |         */
  538|    751|        {
  539|    751|            U64 const add = 0x0101010101010101ull;
  540|    751|            size_t pos = 0;
  541|    751|            U64 sv = 0;
  542|    751|            U32 s;
  543|  12.3k|            for (s=0; s<maxSV1; ++s, sv += add) {
  ------------------
  |  Branch (543:23): [True: 11.5k, False: 751]
  ------------------
  544|  11.5k|                int i;
  545|  11.5k|                int const n = normalizedCounter[s];
  546|  11.5k|                MEM_write64(spread + pos, sv);
  547|  24.0k|                for (i = 8; i < n; i += 8) {
  ------------------
  |  Branch (547:29): [True: 12.4k, False: 11.5k]
  ------------------
  548|  12.4k|                    MEM_write64(spread + pos + i, sv);
  549|  12.4k|                }
  550|  11.5k|                assert(n>=0);
  ------------------
  |  |   70|  11.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  551|  11.5k|                pos += (size_t)n;
  552|  11.5k|            }
  553|    751|        }
  554|       |        /* Now we spread those positions across the table.
  555|       |         * The benefit of doing it in two stages is that we avoid the
  556|       |         * variable size inner loop, which caused lots of branch misses.
  557|       |         * Now we can run through all the positions without any branch misses.
  558|       |         * We unroll the loop twice, since that is what empirically worked best.
  559|       |         */
  560|    751|        {
  561|    751|            size_t position = 0;
  562|    751|            size_t s;
  563|    751|            size_t const unroll = 2;
  564|    751|            assert(tableSize % unroll == 0); /* FSE_MIN_TABLELOG is 5 */
  ------------------
  |  |   70|    751|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  565|  57.4k|            for (s = 0; s < (size_t)tableSize; s += unroll) {
  ------------------
  |  Branch (565:25): [True: 56.6k, False: 751]
  ------------------
  566|  56.6k|                size_t u;
  567|   169k|                for (u = 0; u < unroll; ++u) {
  ------------------
  |  Branch (567:29): [True: 113k, False: 56.6k]
  ------------------
  568|   113k|                    size_t const uPosition = (position + (u * step)) & tableMask;
  569|   113k|                    tableDecode[uPosition].baseValue = spread[s + u];
  570|   113k|                }
  571|  56.6k|                position = (position + (unroll * step)) & tableMask;
  572|  56.6k|            }
  573|    751|            assert(position == 0);
  ------------------
  |  |   70|    751|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  574|    751|        }
  575|  2.14k|    } else {
  576|  2.14k|        U32 const tableMask = tableSize-1;
  577|  2.14k|        U32 const step = FSE_TABLESTEP(tableSize);
  ------------------
  |  |  623|  2.14k|#define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3)
  ------------------
  578|  2.14k|        U32 s, position = 0;
  579|  33.4k|        for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (579:19): [True: 31.3k, False: 2.14k]
  ------------------
  580|  31.3k|            int i;
  581|  31.3k|            int const n = normalizedCounter[s];
  582|   327k|            for (i=0; i<n; i++) {
  ------------------
  |  Branch (582:23): [True: 296k, False: 31.3k]
  ------------------
  583|   296k|                tableDecode[position].baseValue = s;
  584|   296k|                position = (position + step) & tableMask;
  585|   309k|                while (UNLIKELY(position > highThreshold)) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  |  188|   309k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 12.8k, False: 296k]
  |  |  ------------------
  ------------------
  586|   296k|        }   }
  587|  2.14k|        assert(position == 0); /* position must reach all cells once, otherwise normalizedCounter is incorrect */
  ------------------
  |  |   70|  2.14k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  588|  2.14k|    }
  589|       |
  590|       |    /* Build Decoding table */
  591|  2.89k|    {
  592|  2.89k|        U32 u;
  593|   425k|        for (u=0; u<tableSize; u++) {
  ------------------
  |  Branch (593:19): [True: 422k, False: 2.89k]
  ------------------
  594|   422k|            U32 const symbol = tableDecode[u].baseValue;
  595|   422k|            U32 const nextState = symbolNext[symbol]++;
  596|   422k|            tableDecode[u].nbBits = (BYTE) (tableLog - ZSTD_highbit32(nextState) );
  597|   422k|            tableDecode[u].nextState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
  598|   422k|            assert(nbAdditionalBits[symbol] < 255);
  ------------------
  |  |   70|   422k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  599|   422k|            tableDecode[u].nbAdditionalBits = nbAdditionalBits[symbol];
  600|   422k|            tableDecode[u].baseValue = baseValue[symbol];
  601|   422k|        }
  602|  2.89k|    }
  603|  2.89k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body_default:
  610|    505|{
  611|    505|    ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,
  612|    505|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  613|    505|}
zstd_decompress_block.c:ZSTD_buildSeqTable:
  654|  6.45k|{
  655|  6.45k|    switch(type)
  656|  6.45k|    {
  657|    202|    case set_rle :
  ------------------
  |  Branch (657:5): [True: 202, False: 6.24k]
  ------------------
  658|    202|        RETURN_ERROR_IF(!srcSize, srcSize_wrong, "");
  ------------------
  |  |  114|    202|    do {                                                                       \
  |  |  115|    202|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 199]
  |  |  ------------------
  |  |  116|      3|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      3|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      3|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      3|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      3|    do {                                           \
  |  |  |  |   99|      3|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      3|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      3|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      3|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      3|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      3|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      3|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      3|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      3|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      3|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      3|        }                                                                      \
  |  |  123|    202|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 199]
  |  |  ------------------
  ------------------
  659|    199|        RETURN_ERROR_IF((*(const BYTE*)src) > max, corruption_detected, "");
  ------------------
  |  |  114|    199|    do {                                                                       \
  |  |  115|    199|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 7, False: 192]
  |  |  ------------------
  |  |  116|      7|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      7|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      7|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      7|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      7|    do {                                           \
  |  |  |  |   99|      7|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      7|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      7|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      7|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      7|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      7|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      7|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      7|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      7|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      7|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      7|        }                                                                      \
  |  |  123|    199|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 192]
  |  |  ------------------
  ------------------
  660|    192|        {   U32 const symbol = *(const BYTE*)src;
  661|    192|            U32 const baseline = baseValue[symbol];
  662|    192|            U8 const nbBits = nbAdditionalBits[symbol];
  663|    192|            ZSTD_buildSeqTable_rle(DTableSpace, baseline, nbBits);
  664|    192|        }
  665|    192|        *DTablePtr = DTableSpace;
  666|    192|        return 1;
  667|  3.78k|    case set_basic :
  ------------------
  |  Branch (667:5): [True: 3.78k, False: 2.66k]
  ------------------
  668|  3.78k|        *DTablePtr = defaultTable;
  669|  3.78k|        return 0;
  670|     50|    case set_repeat:
  ------------------
  |  Branch (670:5): [True: 50, False: 6.40k]
  ------------------
  671|     50|        RETURN_ERROR_IF(!flagRepeatTable, corruption_detected, "");
  ------------------
  |  |  114|     50|    do {                                                                       \
  |  |  115|     50|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 6, False: 44]
  |  |  ------------------
  |  |  116|      6|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      6|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      6|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      6|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      6|    do {                                           \
  |  |  |  |   99|      6|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      6|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      6|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      6|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      6|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      6|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      6|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      6|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      6|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      6|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      6|        }                                                                      \
  |  |  123|     50|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 44]
  |  |  ------------------
  ------------------
  672|       |        /* prefetch FSE table if used */
  673|     44|        if (ddictIsCold && (nbSeq > 24 /* heuristic */)) {
  ------------------
  |  Branch (673:13): [True: 0, False: 44]
  |  Branch (673:28): [True: 0, False: 0]
  ------------------
  674|      0|            const void* const pStart = *DTablePtr;
  675|      0|            size_t const pSize = sizeof(ZSTD_seqSymbol) * (SEQSYMBOL_TABLE_SIZE(maxLog));
  ------------------
  |  |   74|      0| #define SEQSYMBOL_TABLE_SIZE(log)   (1 + (1 << (log)))
  ------------------
  676|      0|            PREFETCH_AREA(pStart, pSize);
  ------------------
  |  |  159|      0|    do {                                                 \
  |  |  160|      0|        const char* const _ptr = (const char*)(p);       \
  |  |  161|      0|        size_t const _size = (size_t)(s);                \
  |  |  162|      0|        size_t _pos;                                     \
  |  |  163|      0|        for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \
  |  |  ------------------
  |  |  |  |  156|      0|#define CACHELINE_SIZE 64
  |  |  ------------------
  |  |  |  Branch (163:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  164|      0|            PREFETCH_L2(_ptr + _pos);                    \
  |  |  ------------------
  |  |  |  |  146|      0|#    define PREFETCH_L2(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */)
  |  |  ------------------
  |  |  165|      0|        }                                                \
  |  |  166|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (166:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  677|      0|        }
  678|     44|        return 0;
  679|  2.41k|    case set_compressed :
  ------------------
  |  Branch (679:5): [True: 2.41k, False: 4.03k]
  ------------------
  680|  2.41k|        {   unsigned tableLog;
  681|  2.41k|            S16 norm[MaxSeq+1];
  682|  2.41k|            size_t const headerSize = FSE_readNCount(norm, &max, &tableLog, src, srcSize);
  683|  2.41k|            RETURN_ERROR_IF(FSE_isError(headerSize), corruption_detected, "");
  ------------------
  |  |  114|  2.41k|    do {                                                                       \
  |  |  115|  2.41k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 19, False: 2.39k]
  |  |  ------------------
  |  |  116|     19|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     19|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 19]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     19|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     19|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     19|    do {                                           \
  |  |  |  |   99|     19|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 19]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     19|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 19]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     19|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     19|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 19]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     19|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     19|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 19]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     19|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     19|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     19|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     19|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     19|        }                                                                      \
  |  |  123|  2.41k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.39k]
  |  |  ------------------
  ------------------
  684|  2.39k|            RETURN_ERROR_IF(tableLog > maxLog, corruption_detected, "");
  ------------------
  |  |  114|  2.39k|    do {                                                                       \
  |  |  115|  2.39k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 9, False: 2.38k]
  |  |  ------------------
  |  |  116|      9|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      9|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      9|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      9|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      9|    do {                                           \
  |  |  |  |   99|      9|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 9]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      9|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      9|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      9|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      9|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      9|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      9|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      9|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      9|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      9|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      9|        }                                                                      \
  |  |  123|  2.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.38k]
  |  |  ------------------
  ------------------
  685|  2.38k|            ZSTD_buildFSETable(DTableSpace, norm, max, baseValue, nbAdditionalBits, tableLog, wksp, wkspSize, bmi2);
  686|  2.38k|            *DTablePtr = DTableSpace;
  687|  2.38k|            return headerSize;
  688|  2.39k|        }
  689|      0|    default :
  ------------------
  |  Branch (689:5): [True: 0, False: 6.45k]
  ------------------
  690|      0|        assert(0);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  691|      0|        RETURN_ERROR(GENERIC, "impossible");
  ------------------
  |  |  131|      0|    do {                                                                     \
  |  |  132|      0|        RAWLOG(3, "%s:%d: ERROR!: unconditional check failed, returning %s", \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  133|      0|              __FILE__, __LINE__, ERR_QUOTE(ERROR(err)));                    \
  |  |  134|      0|        _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                               \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  135|      0|        RAWLOG(3, ": " __VA_ARGS__);                                         \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  136|      0|        RAWLOG(3, "\n");                                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  137|      0|        return ERROR(err);                                                   \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  138|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (138:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  692|  6.45k|    }
  693|  6.45k|}
zstd_decompress_block.c:ZSTD_buildSeqTable_rle:
  464|    192|{
  465|    192|    void* ptr = dt;
  466|    192|    ZSTD_seqSymbol_header* const DTableH = (ZSTD_seqSymbol_header*)ptr;
  467|    192|    ZSTD_seqSymbol* const cell = dt + 1;
  468|       |
  469|    192|    DTableH->tableLog = 0;
  470|    192|    DTableH->fastMode = 0;
  471|       |
  472|    192|    cell->nbBits = 0;
  473|    192|    cell->nextState = 0;
  474|    192|    assert(nbAddBits < 255);
  ------------------
  |  |   70|    192|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  475|    192|    cell->nbAdditionalBits = nbAddBits;
  476|    192|    cell->baseValue = baseValue;
  477|    192|}
zstd_decompress_block.c:ZSTD_blockSizeMax:
   55|  13.2k|{
   56|  13.2k|    size_t const blockSizeMax = dctx->isFrameDecompression ? dctx->fParams.blockSizeMax : ZSTD_BLOCKSIZE_MAX;
  ------------------
  |  |  148|  13.2k|#define ZSTD_BLOCKSIZE_MAX     (1<<ZSTD_BLOCKSIZELOG_MAX)
  |  |  ------------------
  |  |  |  |  147|      0|#define ZSTD_BLOCKSIZELOG_MAX  17
  |  |  ------------------
  ------------------
  |  Branch (56:33): [True: 13.2k, False: 0]
  ------------------
   57|  13.2k|    assert(blockSizeMax <= ZSTD_BLOCKSIZE_MAX);
  ------------------
  |  |   70|  13.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   58|  13.2k|    return blockSizeMax;
   59|  13.2k|}
zstd_decompress_block.c:ZSTD_totalHistorySize:
 1997|  2.26k|{
 1998|  2.26k|    return (size_t)(op - virtualStart);
 1999|  2.26k|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong:
 1979|  1.05k|{
 1980|  1.05k|    DEBUGLOG(5, "ZSTD_decompressSequencesLong");
  ------------------
  |  |  104|  1.05k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 1.05k]
  |  |  ------------------
  ------------------
 1981|  1.05k|#if DYNAMIC_BMI2
 1982|  1.05k|    if (ZSTD_DCtx_get_bmi2(dctx)) {
  ------------------
  |  Branch (1982:9): [True: 1.05k, False: 0]
  ------------------
 1983|  1.05k|        return ZSTD_decompressSequencesLong_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1984|  1.05k|    }
 1985|      0|#endif
 1986|      0|  return ZSTD_decompressSequencesLong_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1987|  1.05k|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong_bmi2:
 1931|  1.05k|{
 1932|  1.05k|    return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1933|  1.05k|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong_body:
 1738|  1.05k|{
 1739|  1.05k|    const BYTE* ip = (const BYTE*)seqStart;
 1740|  1.05k|    const BYTE* const iend = ip + seqSize;
 1741|  1.05k|    BYTE* const ostart = (BYTE*)dst;
 1742|  1.05k|    BYTE* const oend = dctx->litBufferLocation == ZSTD_in_dst ? dctx->litBuffer : ZSTD_maybeNullPtrAdd(ostart, maxDstSize);
  ------------------
  |  Branch (1742:24): [True: 66, False: 989]
  ------------------
 1743|  1.05k|    BYTE* op = ostart;
 1744|  1.05k|    const BYTE* litPtr = dctx->litPtr;
 1745|  1.05k|    const BYTE* litBufferEnd = dctx->litBufferEnd;
 1746|  1.05k|    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);
 1747|  1.05k|    const BYTE* const dictStart = (const BYTE*) (dctx->virtualStart);
 1748|  1.05k|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 1749|       |
 1750|       |    /* Regen sequences */
 1751|  1.05k|    if (nbSeq) {
  ------------------
  |  Branch (1751:9): [True: 1.05k, False: 1]
  ------------------
 1752|  1.05k|#define STORED_SEQS 8
 1753|  1.05k|#define STORED_SEQS_MASK (STORED_SEQS-1)
 1754|  1.05k|#define ADVANCED_SEQS STORED_SEQS
 1755|  1.05k|        seq_t sequences[STORED_SEQS];
 1756|  1.05k|        int const seqAdvance = MIN(nbSeq, ADVANCED_SEQS);
  ------------------
  |  |   54|  1.05k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 13, False: 1.04k]
  |  |  ------------------
  ------------------
 1757|  1.05k|        seqState_t seqState;
 1758|  1.05k|        int seqNb;
 1759|  1.05k|        size_t prefetchPos = (size_t)(op-prefixStart); /* track position relative to prefixStart */
 1760|       |
 1761|  1.05k|        dctx->fseEntropy = 1;
 1762|  4.21k|        { int i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  4.21k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1762:28): [True: 3.16k, False: 1.05k]
  ------------------
 1763|  1.05k|        assert(dst != NULL);
  ------------------
  |  |   70|  1.05k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1764|  1.05k|        assert(iend >= ip);
  ------------------
  |  |   70|  1.05k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1765|  1.05k|        RETURN_ERROR_IF(
  ------------------
  |  |  114|  1.05k|    do {                                                                       \
  |  |  115|  1.05k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 51, False: 1.00k]
  |  |  ------------------
  |  |  116|     51|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     51|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 51]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     51|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     51|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     51|    do {                                           \
  |  |  |  |   99|     51|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 51]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     51|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 51]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     51|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     51|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 51]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     51|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     51|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 51]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     51|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     51|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     51|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     51|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     51|        }                                                                      \
  |  |  123|  1.05k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.00k]
  |  |  ------------------
  ------------------
 1766|  1.05k|            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)),
 1767|  1.05k|            corruption_detected, "");
 1768|  1.00k|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1769|  1.00k|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1770|  1.00k|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1771|       |
 1772|       |        /* prepare in advance */
 1773|  8.97k|        for (seqNb=0; seqNb<seqAdvance; seqNb++) {
  ------------------
  |  Branch (1773:23): [True: 7.96k, False: 1.00k]
  ------------------
 1774|  7.96k|            seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1);
 1775|  7.96k|            prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1776|  7.96k|            sequences[seqNb] = sequence;
 1777|  7.96k|        }
 1778|       |
 1779|       |        /* decompress without stomping litBuffer */
 1780|  1.00M|        for (; seqNb < nbSeq; seqNb++) {
  ------------------
  |  Branch (1780:16): [True: 1.00M, False: 257]
  ------------------
 1781|  1.00M|            seq_t sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1);
 1782|       |
 1783|  1.00M|            if (dctx->litBufferLocation == ZSTD_split && litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength > dctx->litBufferEnd) {
  ------------------
  |  | 1754|   581k|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|   581k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                          if (dctx->litBufferLocation == ZSTD_split && litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength > dctx->litBufferEnd) {
  ------------------
  |  | 1753|   581k|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|   581k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
  |  Branch (1783:17): [True: 581k, False: 421k]
  |  Branch (1783:58): [True: 445, False: 580k]
  ------------------
 1784|       |                /* lit buffer is reaching split point, empty out the first buffer and transition to litExtraBuffer */
 1785|    445|                const size_t leftoverLit = dctx->litBufferEnd - litPtr;
 1786|    445|                if (leftoverLit)
  ------------------
  |  Branch (1786:21): [True: 439, False: 6]
  ------------------
 1787|    439|                {
 1788|    439|                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer");
  ------------------
  |  |  114|    439|    do {                                                                       \
  |  |  115|    439|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 16, False: 423]
  |  |  ------------------
  |  |  116|     16|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     16|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     16|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     16|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     16|    do {                                           \
  |  |  |  |   99|     16|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 16]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     16|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     16|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     16|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     16|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     16|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     16|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     16|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     16|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     16|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     16|        }                                                                      \
  |  |  123|    439|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 423]
  |  |  ------------------
  ------------------
 1789|    423|                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);
 1790|    423|                    sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength -= leftoverLit;
  ------------------
  |  | 1754|    423|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|    423|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength -= leftoverLit;
  ------------------
  |  | 1753|    423|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    423|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1791|    423|                    op += leftoverLit;
 1792|    423|                }
 1793|    429|                litPtr = dctx->litExtraBuffer;
 1794|    429|                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    429|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    429|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|    858|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 429]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 429, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1795|    429|                dctx->litBufferLocation = ZSTD_not_in_dst;
 1796|    429|                {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1754|    429|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|    429|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                              {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1753|    429|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    429|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1797|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1798|       |                    assert(!ZSTD_isError(oneSeqSize));
 1799|       |                    ZSTD_assertValidSequence(dctx, op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], prefixStart, dictStart);
 1800|       |#endif
 1801|    429|                    if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|    429|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1801:25): [True: 65, False: 364]
  ------------------
 1802|       |
 1803|    364|                    prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1804|    364|                    sequences[seqNb & STORED_SEQS_MASK] = sequence;
  ------------------
  |  | 1753|    364|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    364|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1805|    364|                    op += oneSeqSize;
 1806|    364|            }   }
 1807|  1.00M|            else
 1808|  1.00M|            {
 1809|       |                /* lit buffer is either wholly contained in first or second split, or not split at all*/
 1810|  1.00M|                size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ?
  ------------------
  |  Branch (1810:43): [True: 580k, False: 421k]
  ------------------
 1811|   580k|                    ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY_OVERLENGTH, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  | 1754|   580k|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|   580k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY_OVERLENGTH, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  | 1753|   580k|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|   580k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY_OVERLENGTH, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  |  199|   580k|#define WILDCOPY_OVERLENGTH 32
  ------------------
                                  ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY_OVERLENGTH, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  | 1754|   580k|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|   580k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY_OVERLENGTH, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  | 1753|   580k|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|   580k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1812|  1.00M|                    ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1754|   421k|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|   421k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1753|   421k|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|   421k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1813|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1814|       |                assert(!ZSTD_isError(oneSeqSize));
 1815|       |                ZSTD_assertValidSequence(dctx, op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], prefixStart, dictStart);
 1816|       |#endif
 1817|  1.00M|                if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|  1.00M|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1817:21): [True: 665, False: 1.00M]
  ------------------
 1818|       |
 1819|  1.00M|                prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1820|  1.00M|                sequences[seqNb & STORED_SEQS_MASK] = sequence;
  ------------------
  |  | 1753|  1.00M|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|  1.00M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1821|  1.00M|                op += oneSeqSize;
 1822|  1.00M|            }
 1823|  1.00M|        }
 1824|    257|        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, "");
  ------------------
  |  |  114|    257|    do {                                                                       \
  |  |  115|    257|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 29, False: 228]
  |  |  ------------------
  |  |  116|     29|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     29|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 29]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     29|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     29|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     29|    do {                                           \
  |  |  |  |   99|     29|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 29]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     29|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 29]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     29|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     29|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 29]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     29|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     29|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 29]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     29|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     29|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     29|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     29|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     29|        }                                                                      \
  |  |  123|    257|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 228]
  |  |  ------------------
  ------------------
 1825|       |
 1826|       |        /* finish queue */
 1827|    228|        seqNb -= seqAdvance;
 1828|  1.68k|        for ( ; seqNb<nbSeq ; seqNb++) {
  ------------------
  |  Branch (1828:17): [True: 1.56k, False: 121]
  ------------------
 1829|  1.56k|            seq_t *sequence = &(sequences[seqNb&STORED_SEQS_MASK]);
  ------------------
  |  | 1753|  1.56k|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|  1.56k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1830|  1.56k|            if (dctx->litBufferLocation == ZSTD_split && litPtr + sequence->litLength > dctx->litBufferEnd) {
  ------------------
  |  Branch (1830:17): [True: 779, False: 781]
  |  Branch (1830:58): [True: 106, False: 673]
  ------------------
 1831|    106|                const size_t leftoverLit = dctx->litBufferEnd - litPtr;
 1832|    106|                if (leftoverLit) {
  ------------------
  |  Branch (1832:21): [True: 104, False: 2]
  ------------------
 1833|    104|                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer");
  ------------------
  |  |  114|    104|    do {                                                                       \
  |  |  115|    104|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 103]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|    104|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 103]
  |  |  ------------------
  ------------------
 1834|    103|                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);
 1835|    103|                    sequence->litLength -= leftoverLit;
 1836|    103|                    op += leftoverLit;
 1837|    103|                }
 1838|    105|                litPtr = dctx->litExtraBuffer;
 1839|    105|                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    105|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    105|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|    210|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 105]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 105, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1840|    105|                dctx->litBufferLocation = ZSTD_not_in_dst;
 1841|    105|                {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
 1842|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1843|       |                    assert(!ZSTD_isError(oneSeqSize));
 1844|       |                    ZSTD_assertValidSequence(dctx, op, oend, sequences[seqNb&STORED_SEQS_MASK], prefixStart, dictStart);
 1845|       |#endif
 1846|    105|                    if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|    105|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1846:25): [True: 15, False: 90]
  ------------------
 1847|     90|                    op += oneSeqSize;
 1848|     90|                }
 1849|     90|            }
 1850|  1.45k|            else
 1851|  1.45k|            {
 1852|  1.45k|                size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ?
  ------------------
  |  Branch (1852:43): [True: 673, False: 781]
  ------------------
 1853|    673|                    ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence->litLength - WILDCOPY_OVERLENGTH, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  |  199|    673|#define WILDCOPY_OVERLENGTH 32
  ------------------
 1854|  1.45k|                    ZSTD_execSequence(op, oend, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
 1855|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1856|       |                assert(!ZSTD_isError(oneSeqSize));
 1857|       |                ZSTD_assertValidSequence(dctx, op, oend, sequences[seqNb&STORED_SEQS_MASK], prefixStart, dictStart);
 1858|       |#endif
 1859|  1.45k|                if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|  1.45k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1859:21): [True: 91, False: 1.36k]
  ------------------
 1860|  1.36k|                op += oneSeqSize;
 1861|  1.36k|            }
 1862|  1.56k|        }
 1863|       |
 1864|       |        /* save reps for next block */
 1865|    484|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  |   64|    484|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1865:28): [True: 363, False: 121]
  ------------------
 1866|    121|    }
 1867|       |
 1868|       |    /* last literal segment */
 1869|    122|    if (dctx->litBufferLocation == ZSTD_split) { /* first deplete literal buffer in dst, then copy litExtraBuffer */
  ------------------
  |  Branch (1869:9): [True: 32, False: 90]
  ------------------
 1870|     32|        size_t const lastLLSize = litBufferEnd - litPtr;
 1871|     32|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend - op), dstSize_tooSmall, "");
  ------------------
  |  |  114|     32|    do {                                                                       \
  |  |  115|     32|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 5, False: 27]
  |  |  ------------------
  |  |  116|      5|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      5|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      5|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      5|    do {                                           \
  |  |  |  |   99|      5|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      5|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      5|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      5|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      5|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      5|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      5|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      5|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      5|        }                                                                      \
  |  |  123|     32|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 27]
  |  |  ------------------
  ------------------
 1872|     27|        if (op != NULL) {
  ------------------
  |  Branch (1872:13): [True: 27, False: 0]
  ------------------
 1873|     27|            ZSTD_memmove(op, litPtr, lastLLSize);
  ------------------
  |  |   45|     27|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1874|     27|            op += lastLLSize;
 1875|     27|        }
 1876|     27|        litPtr = dctx->litExtraBuffer;
 1877|     27|        litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|     27|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|     27|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|     54|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 27]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 27, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1878|     27|    }
 1879|    117|    {   size_t const lastLLSize = litBufferEnd - litPtr;
 1880|    117|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, "");
  ------------------
  |  |  114|    117|    do {                                                                       \
  |  |  115|    117|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 14, False: 103]
  |  |  ------------------
  |  |  116|     14|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     14|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 14]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     14|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     14|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     14|    do {                                           \
  |  |  |  |   99|     14|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 14]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     14|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 14]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     14|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     14|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 14]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     14|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     14|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 14]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     14|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     14|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     14|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     14|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     14|        }                                                                      \
  |  |  123|    117|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 103]
  |  |  ------------------
  ------------------
 1881|    103|        if (op != NULL) {
  ------------------
  |  Branch (1881:13): [True: 103, False: 0]
  ------------------
 1882|    103|            ZSTD_memmove(op, litPtr, lastLLSize);
  ------------------
  |  |   45|    103|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1883|    103|            op += lastLLSize;
 1884|    103|        }
 1885|    103|    }
 1886|       |
 1887|      0|    return (size_t)(op - ostart);
 1888|    117|}
zstd_decompress_block.c:ZSTD_initFseState:
 1193|  5.94k|{
 1194|  5.94k|    const void* ptr = dt;
 1195|  5.94k|    const ZSTD_seqSymbol_header* const DTableH = (const ZSTD_seqSymbol_header*)ptr;
 1196|  5.94k|    DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);
 1197|  5.94k|    DEBUGLOG(6, "ZSTD_initFseState : val=%u using %u bits",
  ------------------
  |  |  104|  5.94k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 5.94k]
  |  |  ------------------
  ------------------
 1198|  5.94k|                (U32)DStatePtr->state, DTableH->tableLog);
 1199|  5.94k|    BIT_reloadDStream(bitD);
 1200|  5.94k|    DStatePtr->table = dt + 1;
 1201|  5.94k|}
zstd_decompress_block.c:ZSTD_decodeSequence:
 1230|  2.30M|{
 1231|  2.30M|    seq_t seq;
 1232|       |    /*
 1233|       |     * ZSTD_seqSymbol is a 64 bits wide structure.
 1234|       |     * It can be loaded in one operation
 1235|       |     * and its fields extracted by simply shifting or bit-extracting on aarch64.
 1236|       |     * GCC doesn't recognize this and generates more unnecessary ldr/ldrb/ldrh
 1237|       |     * operations that cause performance drop. This can be avoided by using this
 1238|       |     * ZSTD_memcpy hack.
 1239|       |     */
 1240|       |#if defined(__aarch64__) && (defined(__GNUC__) && !defined(__clang__))
 1241|       |    ZSTD_seqSymbol llDInfoS, mlDInfoS, ofDInfoS;
 1242|       |    ZSTD_seqSymbol* const llDInfo = &llDInfoS;
 1243|       |    ZSTD_seqSymbol* const mlDInfo = &mlDInfoS;
 1244|       |    ZSTD_seqSymbol* const ofDInfo = &ofDInfoS;
 1245|       |    ZSTD_memcpy(llDInfo, seqState->stateLL.table + seqState->stateLL.state, sizeof(ZSTD_seqSymbol));
 1246|       |    ZSTD_memcpy(mlDInfo, seqState->stateML.table + seqState->stateML.state, sizeof(ZSTD_seqSymbol));
 1247|       |    ZSTD_memcpy(ofDInfo, seqState->stateOffb.table + seqState->stateOffb.state, sizeof(ZSTD_seqSymbol));
 1248|       |#else
 1249|  2.30M|    const ZSTD_seqSymbol* const llDInfo = seqState->stateLL.table + seqState->stateLL.state;
 1250|  2.30M|    const ZSTD_seqSymbol* const mlDInfo = seqState->stateML.table + seqState->stateML.state;
 1251|  2.30M|    const ZSTD_seqSymbol* const ofDInfo = seqState->stateOffb.table + seqState->stateOffb.state;
 1252|  2.30M|#endif
 1253|  2.30M|    seq.matchLength = mlDInfo->baseValue;
 1254|  2.30M|    seq.litLength = llDInfo->baseValue;
 1255|  2.30M|    {   U32 const ofBase = ofDInfo->baseValue;
 1256|  2.30M|        BYTE const llBits = llDInfo->nbAdditionalBits;
 1257|  2.30M|        BYTE const mlBits = mlDInfo->nbAdditionalBits;
 1258|  2.30M|        BYTE const ofBits = ofDInfo->nbAdditionalBits;
 1259|  2.30M|        BYTE const totalBits = llBits+mlBits+ofBits;
 1260|       |
 1261|  2.30M|        U16 const llNext = llDInfo->nextState;
 1262|  2.30M|        U16 const mlNext = mlDInfo->nextState;
 1263|  2.30M|        U16 const ofNext = ofDInfo->nextState;
 1264|  2.30M|        U32 const llnbBits = llDInfo->nbBits;
 1265|  2.30M|        U32 const mlnbBits = mlDInfo->nbBits;
 1266|  2.30M|        U32 const ofnbBits = ofDInfo->nbBits;
 1267|       |
 1268|  2.30M|        assert(llBits <= MaxLLBits);
  ------------------
  |  |   70|  2.30M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1269|  2.30M|        assert(mlBits <= MaxMLBits);
  ------------------
  |  |   70|  2.30M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1270|  2.30M|        assert(ofBits <= MaxOff);
  ------------------
  |  |   70|  2.30M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1271|       |        /*
 1272|       |         * As gcc has better branch and block analyzers, sometimes it is only
 1273|       |         * valuable to mark likeliness for clang, it gives around 3-4% of
 1274|       |         * performance.
 1275|       |         */
 1276|       |
 1277|       |        /* sequence */
 1278|  2.30M|        {   size_t offset;
 1279|  2.30M|            if (ofBits > 1) {
  ------------------
  |  Branch (1279:17): [True: 735k, False: 1.56M]
  ------------------
 1280|   735k|                ZSTD_STATIC_ASSERT(ZSTD_lo_isLongOffset == 1);
  ------------------
  |  |   43|   735k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|   735k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1281|   735k|                ZSTD_STATIC_ASSERT(LONG_OFFSETS_MAX_EXTRA_BITS_32 == 5);
  ------------------
  |  |   43|   735k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|   735k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1282|   735k|                ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 > LONG_OFFSETS_MAX_EXTRA_BITS_32);
  ------------------
  |  |   43|   735k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|   735k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1283|   735k|                ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 - LONG_OFFSETS_MAX_EXTRA_BITS_32 >= MaxMLBits);
  ------------------
  |  |   43|   735k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|   735k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1284|   735k|                if (MEM_32bits() && longOffsets && (ofBits >= STREAM_ACCUMULATOR_MIN_32)) {
  ------------------
  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  ------------------
  |  Branch (1284:21): [True: 0, False: 735k]
  |  Branch (1284:37): [True: 0, False: 0]
  |  Branch (1284:52): [True: 0, False: 0]
  ------------------
 1285|       |                    /* Always read extra bits, this keeps the logic simple,
 1286|       |                     * avoids branches, and avoids accidentally reading 0 bits.
 1287|       |                     */
 1288|      0|                    U32 const extraBits = LONG_OFFSETS_MAX_EXTRA_BITS_32;
  ------------------
  |  | 1216|      0|    (ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32       \
  |  |  ------------------
  |  |  |  | 1263|      0|#define ZSTD_WINDOWLOG_MAX_32    30
  |  |  ------------------
  |  |                   (ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32       \
  |  |  ------------------
  |  |  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  |  |  ------------------
  |  |  |  Branch (1216:6): [True: 0, Folded]
  |  |  ------------------
  |  | 1217|      0|        ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32  \
  |  |  ------------------
  |  |  |  | 1263|      0|#define ZSTD_WINDOWLOG_MAX_32    30
  |  |  ------------------
  |  |                       ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32  \
  |  |  ------------------
  |  |  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  |  |  ------------------
  |  | 1218|      0|        : 0)
  ------------------
 1289|      0|                    offset = ofBase + (BIT_readBitsFast(&seqState->DStream, ofBits - extraBits) << extraBits);
 1290|      0|                    BIT_reloadDStream(&seqState->DStream);
 1291|      0|                    offset += BIT_readBitsFast(&seqState->DStream, extraBits);
 1292|   735k|                } else {
 1293|   735k|                    offset = ofBase + BIT_readBitsFast(&seqState->DStream, ofBits/*>0*/);   /* <=  (ZSTD_WINDOWLOG_MAX-1) bits */
 1294|   735k|                    if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);
  ------------------
  |  Branch (1294:25): [True: 0, False: 735k]
  ------------------
 1295|   735k|                }
 1296|   735k|                seqState->prevOffset[2] = seqState->prevOffset[1];
 1297|   735k|                seqState->prevOffset[1] = seqState->prevOffset[0];
 1298|   735k|                seqState->prevOffset[0] = offset;
 1299|  1.56M|            } else {
 1300|  1.56M|                U32 const ll0 = (llDInfo->baseValue == 0);
 1301|  1.56M|                if (LIKELY((ofBits == 0))) {
  ------------------
  |  |  187|  1.56M|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 1.24M, False: 323k]
  |  |  ------------------
  ------------------
 1302|  1.24M|                    offset = seqState->prevOffset[ll0];
 1303|  1.24M|                    seqState->prevOffset[1] = seqState->prevOffset[!ll0];
 1304|  1.24M|                    seqState->prevOffset[0] = offset;
 1305|  1.24M|                } else {
 1306|   323k|                    offset = ofBase + ll0 + BIT_readBitsFast(&seqState->DStream, 1);
 1307|   323k|                    {   size_t temp = (offset==3) ? seqState->prevOffset[0] - 1 : seqState->prevOffset[offset];
  ------------------
  |  Branch (1307:39): [True: 14.5k, False: 309k]
  ------------------
 1308|   323k|                        temp -= !temp; /* 0 is not valid: input corrupted => force offset to -1 => corruption detected at execSequence */
 1309|   323k|                        if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1];
  ------------------
  |  Branch (1309:29): [True: 189k, False: 134k]
  ------------------
 1310|   323k|                        seqState->prevOffset[1] = seqState->prevOffset[0];
 1311|   323k|                        seqState->prevOffset[0] = offset = temp;
 1312|   323k|            }   }   }
 1313|  2.30M|            seq.offset = offset;
 1314|  2.30M|        }
 1315|       |
 1316|  2.30M|        if (mlBits > 0)
  ------------------
  |  Branch (1316:13): [True: 122k, False: 2.18M]
  ------------------
 1317|   122k|            seq.matchLength += BIT_readBitsFast(&seqState->DStream, mlBits/*>0*/);
 1318|       |
 1319|  2.30M|        if (MEM_32bits() && (mlBits+llBits >= STREAM_ACCUMULATOR_MIN_32-LONG_OFFSETS_MAX_EXTRA_BITS_32))
  ------------------
  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  ------------------
                      if (MEM_32bits() && (mlBits+llBits >= STREAM_ACCUMULATOR_MIN_32-LONG_OFFSETS_MAX_EXTRA_BITS_32))
  ------------------
  |  | 1216|      0|    (ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32       \
  |  |  ------------------
  |  |  |  | 1263|      0|#define ZSTD_WINDOWLOG_MAX_32    30
  |  |  ------------------
  |  |                   (ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32       \
  |  |  ------------------
  |  |  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  |  |  ------------------
  |  |  |  Branch (1216:6): [True: 0, Folded]
  |  |  ------------------
  |  | 1217|      0|        ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32  \
  |  |  ------------------
  |  |  |  | 1263|      0|#define ZSTD_WINDOWLOG_MAX_32    30
  |  |  ------------------
  |  |                       ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32  \
  |  |  ------------------
  |  |  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  |  |  ------------------
  |  | 1218|      0|        : 0)
  ------------------
  |  Branch (1319:13): [True: 0, False: 2.30M]
  |  Branch (1319:29): [True: 0, False: 0]
  ------------------
 1320|      0|            BIT_reloadDStream(&seqState->DStream);
 1321|  2.30M|        if (MEM_64bits() && UNLIKELY(totalBits >= STREAM_ACCUMULATOR_MIN_64-(LLFSELog+MLFSELog+OffFSELog)))
  ------------------
  |  |  188|  2.30M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 1.10k, False: 2.30M]
  |  |  ------------------
  ------------------
  |  Branch (1321:13): [True: 2.30M, False: 0]
  ------------------
 1322|  1.10k|            BIT_reloadDStream(&seqState->DStream);
 1323|       |        /* Ensure there are enough bits to read the rest of data in 64-bit mode. */
 1324|  2.30M|        ZSTD_STATIC_ASSERT(16+LLFSELog+MLFSELog+OffFSELog < STREAM_ACCUMULATOR_MIN_64);
  ------------------
  |  |   43|  2.30M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  2.30M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1325|       |
 1326|  2.30M|        if (llBits > 0)
  ------------------
  |  Branch (1326:13): [True: 289k, False: 2.01M]
  ------------------
 1327|   289k|            seq.litLength += BIT_readBitsFast(&seqState->DStream, llBits/*>0*/);
 1328|       |
 1329|  2.30M|        if (MEM_32bits())
  ------------------
  |  Branch (1329:13): [True: 0, False: 2.30M]
  ------------------
 1330|      0|            BIT_reloadDStream(&seqState->DStream);
 1331|       |
 1332|  2.30M|        DEBUGLOG(6, "seq: litL=%u, matchL=%u, offset=%u",
  ------------------
  |  |  104|  2.30M|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.30M]
  |  |  ------------------
  ------------------
 1333|  2.30M|                    (U32)seq.litLength, (U32)seq.matchLength, (U32)seq.offset);
 1334|       |
 1335|  2.30M|        if (!isLastSeq) {
  ------------------
  |  Branch (1335:13): [True: 2.30M, False: 429]
  ------------------
 1336|       |            /* don't update FSE state for last Sequence */
 1337|  2.30M|            ZSTD_updateFseStateWithDInfo(&seqState->stateLL, &seqState->DStream, llNext, llnbBits);    /* <=  9 bits */
 1338|  2.30M|            ZSTD_updateFseStateWithDInfo(&seqState->stateML, &seqState->DStream, mlNext, mlnbBits);    /* <=  9 bits */
 1339|  2.30M|            if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);    /* <= 18 bits */
  ------------------
  |  Branch (1339:17): [True: 0, False: 2.30M]
  ------------------
 1340|  2.30M|            ZSTD_updateFseStateWithDInfo(&seqState->stateOffb, &seqState->DStream, ofNext, ofnbBits);  /* <=  8 bits */
 1341|  2.30M|            BIT_reloadDStream(&seqState->DStream);
 1342|  2.30M|        }
 1343|  2.30M|    }
 1344|       |
 1345|  2.30M|    return seq;
 1346|  2.30M|}
zstd_decompress_block.c:ZSTD_updateFseStateWithDInfo:
 1205|  6.90M|{
 1206|  6.90M|    size_t const lowBits = BIT_readBits(bitD, nbBits);
 1207|  6.90M|    DStatePtr->state = nextState + lowBits;
 1208|  6.90M|}
zstd_decompress_block.c:ZSTD_prefetchMatch:
 1717|  1.00M|{
 1718|  1.00M|    prefetchPos += sequence.litLength;
 1719|  1.00M|    {   const BYTE* const matchBase = (sequence.offset > prefetchPos) ? dictEnd : prefixStart;
  ------------------
  |  Branch (1719:39): [True: 2.33k, False: 1.00M]
  ------------------
 1720|       |        /* note : this operation can overflow when seq.offset is really too large, which can only happen when input is corrupted.
 1721|       |         * No consequence though : memory address is only used for prefetching, not for dereferencing */
 1722|  1.00M|        const BYTE* const match = ZSTD_wrappedPtrSub(ZSTD_wrappedPtrAdd(matchBase, prefetchPos), sequence.offset);
 1723|  1.00M|        PREFETCH_L1(match); PREFETCH_L1(match+CACHELINE_SIZE);   /* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */
  ------------------
  |  |  145|  1.00M|#    define PREFETCH_L1(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */)
  ------------------
                      PREFETCH_L1(match); PREFETCH_L1(match+CACHELINE_SIZE);   /* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */
  ------------------
  |  |  145|  1.00M|#    define PREFETCH_L1(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */)
  ------------------
 1724|  1.00M|    }
 1725|  1.00M|    return prefetchPos + sequence.matchLength;
 1726|  1.00M|}
zstd_decompress_block.c:ZSTD_safecopyDstBeforeSrc:
  877|   283k|static void ZSTD_safecopyDstBeforeSrc(BYTE* op, const BYTE* ip, ptrdiff_t length) {
  878|   283k|    ptrdiff_t const diff = op - ip;
  879|   283k|    BYTE* const oend = op + length;
  880|       |
  881|   283k|    if (length < 8 || diff > -8) {
  ------------------
  |  Branch (881:9): [True: 237k, False: 46.1k]
  |  Branch (881:23): [True: 45.0k, False: 1.07k]
  ------------------
  882|       |        /* Handle short lengths, close overlaps, and dst not before src. */
  883|  6.19M|        while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (883:16): [True: 5.90M, False: 282k]
  ------------------
  884|   282k|        return;
  885|   282k|    }
  886|       |
  887|  1.07k|    if (op <= oend - WILDCOPY_OVERLENGTH && diff < -WILDCOPY_VECLEN) {
  ------------------
  |  |  199|  2.14k|#define WILDCOPY_OVERLENGTH 32
  ------------------
                  if (op <= oend - WILDCOPY_OVERLENGTH && diff < -WILDCOPY_VECLEN) {
  ------------------
  |  |  200|    766|#define WILDCOPY_VECLEN 16
  ------------------
  |  Branch (887:9): [True: 766, False: 306]
  |  Branch (887:45): [True: 703, False: 63]
  ------------------
  888|    703|        ZSTD_wildcopy(op, ip, oend - WILDCOPY_OVERLENGTH - op, ZSTD_no_overlap);
  ------------------
  |  |  199|    703|#define WILDCOPY_OVERLENGTH 32
  ------------------
  889|    703|        ip += oend - WILDCOPY_OVERLENGTH - op;
  ------------------
  |  |  199|    703|#define WILDCOPY_OVERLENGTH 32
  ------------------
  890|    703|        op += oend - WILDCOPY_OVERLENGTH - op;
  ------------------
  |  |  199|    703|#define WILDCOPY_OVERLENGTH 32
  ------------------
  891|    703|    }
  892|       |
  893|       |    /* Handle the leftovers. */
  894|   429k|    while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (894:12): [True: 428k, False: 1.07k]
  ------------------
  895|  1.07k|}
zstd_decompress_block.c:ZSTD_execSequence:
 1005|  1.18M|{
 1006|  1.18M|    BYTE* const oLitEnd = op + sequence.litLength;
 1007|  1.18M|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 1008|  1.18M|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 1009|  1.18M|    BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;   /* risk : address space underflow on oend=NULL */
  ------------------
  |  |  199|  1.18M|#define WILDCOPY_OVERLENGTH 32
  ------------------
 1010|  1.18M|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 1011|  1.18M|    const BYTE* match = oLitEnd - sequence.offset;
 1012|       |
 1013|  1.18M|    assert(op != NULL /* Precondition */);
  ------------------
  |  |   70|  1.18M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1014|  1.18M|    assert(oend_w < oend /* No underflow */);
  ------------------
  |  |   70|  1.18M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1015|       |
 1016|       |#if defined(__aarch64__)
 1017|       |    /* prefetch sequence starting from match that will be used for copy later */
 1018|       |    PREFETCH_L1(match);
 1019|       |#endif
 1020|       |    /* Handle edge cases in a slow path:
 1021|       |     *   - Read beyond end of literals
 1022|       |     *   - Match end is within WILDCOPY_OVERLIMIT of oend
 1023|       |     *   - 32-bit mode and the match length overflows
 1024|       |     */
 1025|  1.18M|    if (UNLIKELY(
  ------------------
  |  |  188|  5.90M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 1.43k, False: 1.17M]
  |  |  |  Branch (188:40): [True: 230, False: 1.18M]
  |  |  |  Branch (188:40): [True: 1.20k, False: 1.17M]
  |  |  |  Branch (188:40): [True: 0, False: 1.17M]
  |  |  |  Branch (188:40): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1026|  1.18M|        iLitEnd > litLimit ||
 1027|  1.18M|        oMatchEnd > oend_w ||
 1028|  1.18M|        (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH)))
 1029|  1.43k|        return ZSTD_execSequenceEnd(op, oend, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd);
 1030|       |
 1031|       |    /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */
 1032|  1.17M|    assert(op <= oLitEnd /* No overflow */);
  ------------------
  |  |   70|  1.17M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1033|  1.17M|    assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */);
  ------------------
  |  |   70|  1.17M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1034|  1.17M|    assert(oMatchEnd <= oend /* No underflow */);
  ------------------
  |  |   70|  1.17M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1035|  1.17M|    assert(iLitEnd <= litLimit /* Literal length is in bounds */);
  ------------------
  |  |   70|  1.17M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1036|  1.17M|    assert(oLitEnd <= oend_w /* Can wildcopy literals */);
  ------------------
  |  |   70|  1.17M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1037|  1.17M|    assert(oMatchEnd <= oend_w /* Can wildcopy matches */);
  ------------------
  |  |   70|  1.17M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1038|       |
 1039|       |    /* Copy Literals:
 1040|       |     * Split out litLength <= 16 since it is nearly always true. +1.6% on gcc-9.
 1041|       |     * We likely don't need the full 32-byte wildcopy.
 1042|       |     */
 1043|  1.17M|    assert(WILDCOPY_OVERLENGTH >= 16);
  ------------------
  |  |   70|  1.17M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1044|  1.17M|    ZSTD_copy16(op, (*litPtr));
 1045|  1.17M|    if (UNLIKELY(sequence.litLength > 16)) {
  ------------------
  |  |  188|  1.17M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 74.3k, False: 1.10M]
  |  |  ------------------
  ------------------
 1046|  74.3k|        ZSTD_wildcopy(op + 16, (*litPtr) + 16, sequence.litLength - 16, ZSTD_no_overlap);
 1047|  74.3k|    }
 1048|  1.17M|    op = oLitEnd;
 1049|  1.17M|    *litPtr = iLitEnd;   /* update for next sequence */
 1050|       |
 1051|       |    /* Copy Match */
 1052|  1.17M|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (1052:9): [True: 781, False: 1.17M]
  ------------------
 1053|       |        /* offset beyond prefix -> go into extDict */
 1054|    781|        RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected, "");
  ------------------
  |  |  114|    781|    do {                                                                       \
  |  |  115|    781|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 426, False: 355]
  |  |  ------------------
  |  |  116|    426|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    426|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 426]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    426|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    426|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    426|    do {                                           \
  |  |  |  |   99|    426|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 426]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    426|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 426]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    426|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    426|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 426]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    426|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    426|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 426]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    426|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    426|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    426|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    426|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    426|        }                                                                      \
  |  |  123|    781|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 355]
  |  |  ------------------
  ------------------
 1055|    355|        match = dictEnd + (match - prefixStart);
 1056|    355|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (1056:13): [True: 311, False: 44]
  ------------------
 1057|    311|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|    311|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1058|    311|            return sequenceLength;
 1059|    311|        }
 1060|       |        /* span extDict & currentPrefixSegment */
 1061|     44|        {   size_t const length1 = dictEnd - match;
 1062|     44|        ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|     44|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1063|     44|        op = oLitEnd + length1;
 1064|     44|        sequence.matchLength -= length1;
 1065|     44|        match = prefixStart;
 1066|     44|        }
 1067|     44|    }
 1068|       |    /* Match within prefix of 1 or more bytes */
 1069|  1.17M|    assert(op <= oMatchEnd);
  ------------------
  |  |   70|  1.17M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1070|  1.17M|    assert(oMatchEnd <= oend_w);
  ------------------
  |  |   70|  1.17M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1071|  1.17M|    assert(match >= prefixStart);
  ------------------
  |  |   70|  1.17M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1072|  1.17M|    assert(sequence.matchLength >= 1);
  ------------------
  |  |   70|  1.17M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1073|       |
 1074|       |    /* Nearly all offsets are >= WILDCOPY_VECLEN bytes, which means we can use wildcopy
 1075|       |     * without overlap checking.
 1076|       |     */
 1077|  1.17M|    if (LIKELY(sequence.offset >= WILDCOPY_VECLEN)) {
  ------------------
  |  |  187|  1.17M|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 412k, False: 766k]
  |  |  ------------------
  ------------------
 1078|       |        /* We bet on a full wildcopy for matches, since we expect matches to be
 1079|       |         * longer than literals (in general). In silesia, ~10% of matches are longer
 1080|       |         * than 16 bytes.
 1081|       |         */
 1082|   412k|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength, ZSTD_no_overlap);
 1083|   412k|        return sequenceLength;
 1084|   412k|    }
 1085|   766k|    assert(sequence.offset < WILDCOPY_VECLEN);
  ------------------
  |  |   70|   766k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1086|       |
 1087|       |    /* Copy 8 bytes and spread the offset to be >= 8. */
 1088|   766k|    ZSTD_overlapCopy8(&op, &match, sequence.offset);
 1089|       |
 1090|       |    /* If the match length is > 8 bytes, then continue with the wildcopy. */
 1091|   766k|    if (sequence.matchLength > 8) {
  ------------------
  |  Branch (1091:9): [True: 133k, False: 632k]
  ------------------
 1092|   133k|        assert(op < oMatchEnd);
  ------------------
  |  |   70|   133k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1093|   133k|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength - 8, ZSTD_overlap_src_before_dst);
 1094|   133k|    }
 1095|   766k|    return sequenceLength;
 1096|  1.17M|}
zstd_decompress_block.c:ZSTD_execSequenceEnd:
  911|  1.43k|{
  912|  1.43k|    BYTE* const oLitEnd = op + sequence.litLength;
  913|  1.43k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
  914|  1.43k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
  915|  1.43k|    const BYTE* match = oLitEnd - sequence.offset;
  916|  1.43k|    BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|  1.43k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  917|       |
  918|       |    /* bounds checks : careful of address space overflow in 32-bit mode */
  919|  1.43k|    RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, "last match must fit within dstBuffer");
  ------------------
  |  |  114|  1.43k|    do {                                                                       \
  |  |  115|  1.43k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 552, False: 887]
  |  |  ------------------
  |  |  116|    552|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    552|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 552]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    552|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    552|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    552|    do {                                           \
  |  |  |  |   99|    552|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 552]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    552|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 552]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    552|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    552|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 552]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    552|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    552|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 552]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    552|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    552|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    552|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    552|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    552|        }                                                                      \
  |  |  123|  1.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 887]
  |  |  ------------------
  ------------------
  920|    887|    RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, "try to read beyond literal buffer");
  ------------------
  |  |  114|    887|    do {                                                                       \
  |  |  115|    887|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 156, False: 731]
  |  |  ------------------
  |  |  116|    156|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    156|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 156]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    156|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    156|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    156|    do {                                           \
  |  |  |  |   99|    156|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 156]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    156|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 156]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    156|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    156|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 156]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    156|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    156|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 156]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    156|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    156|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    156|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    156|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    156|        }                                                                      \
  |  |  123|    887|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 731]
  |  |  ------------------
  ------------------
  921|    731|    assert(op < op + sequenceLength);
  ------------------
  |  |   70|    731|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  922|    731|    assert(oLitEnd < op + sequenceLength);
  ------------------
  |  |   70|    731|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  923|       |
  924|       |    /* copy literals */
  925|    731|    ZSTD_safecopy(op, oend_w, *litPtr, sequence.litLength, ZSTD_no_overlap);
  926|    731|    op = oLitEnd;
  927|    731|    *litPtr = iLitEnd;
  928|       |
  929|       |    /* copy Match */
  930|    731|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (930:9): [True: 66, False: 665]
  ------------------
  931|       |        /* offset beyond prefix */
  932|     66|        RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, "");
  ------------------
  |  |  114|     66|    do {                                                                       \
  |  |  115|     66|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 52, False: 14]
  |  |  ------------------
  |  |  116|     52|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     52|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 52]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     52|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     52|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     52|    do {                                           \
  |  |  |  |   99|     52|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 52]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     52|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 52]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     52|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     52|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 52]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     52|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     52|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 52]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     52|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     52|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     52|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     52|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     52|        }                                                                      \
  |  |  123|     66|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 14]
  |  |  ------------------
  ------------------
  933|     14|        match = dictEnd - (prefixStart - match);
  934|     14|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (934:13): [True: 12, False: 2]
  ------------------
  935|     12|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|     12|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  936|     12|            return sequenceLength;
  937|     12|        }
  938|       |        /* span extDict & currentPrefixSegment */
  939|      2|        {   size_t const length1 = dictEnd - match;
  940|      2|        ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|      2|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  941|      2|        op = oLitEnd + length1;
  942|      2|        sequence.matchLength -= length1;
  943|      2|        match = prefixStart;
  944|      2|        }
  945|      2|    }
  946|    667|    ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst);
  947|    667|    return sequenceLength;
  948|    731|}
zstd_decompress_block.c:ZSTD_safecopy:
  837|   284k|static void ZSTD_safecopy(BYTE* op, const BYTE* const oend_w, BYTE const* ip, ptrdiff_t length, ZSTD_overlap_e ovtype) {
  838|   284k|    ptrdiff_t const diff = op - ip;
  839|   284k|    BYTE* const oend = op + length;
  840|       |
  841|   284k|    assert((ovtype == ZSTD_no_overlap && (diff <= -8 || diff >= 8 || op >= oend_w)) ||
  ------------------
  |  |   70|   284k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  842|   284k|           (ovtype == ZSTD_overlap_src_before_dst && diff >= 0));
  843|       |
  844|   284k|    if (length < 8) {
  ------------------
  |  Branch (844:9): [True: 211k, False: 72.4k]
  ------------------
  845|       |        /* Handle short lengths. */
  846|   956k|        while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (846:16): [True: 744k, False: 211k]
  ------------------
  847|   211k|        return;
  848|   211k|    }
  849|  72.4k|    if (ovtype == ZSTD_overlap_src_before_dst) {
  ------------------
  |  Branch (849:9): [True: 72.2k, False: 197]
  ------------------
  850|       |        /* Copy 8 bytes and ensure the offset >= 8 when there can be overlap. */
  851|  72.2k|        assert(length >= 8);
  ------------------
  |  |   70|  72.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  852|  72.2k|        ZSTD_overlapCopy8(&op, &ip, diff);
  853|  72.2k|        length -= 8;
  854|  72.2k|        assert(op - ip >= 8);
  ------------------
  |  |   70|  72.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  855|  72.2k|        assert(op <= oend);
  ------------------
  |  |   70|  72.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  856|  72.2k|    }
  857|       |
  858|  72.4k|    if (oend <= oend_w) {
  ------------------
  |  Branch (858:9): [True: 59, False: 72.3k]
  ------------------
  859|       |        /* No risk of overwrite. */
  860|     59|        ZSTD_wildcopy(op, ip, length, ovtype);
  861|     59|        return;
  862|     59|    }
  863|  72.3k|    if (op <= oend_w) {
  ------------------
  |  Branch (863:9): [True: 615, False: 71.7k]
  ------------------
  864|       |        /* Wildcopy until we get close to the end. */
  865|    615|        assert(oend > oend_w);
  ------------------
  |  |   70|    615|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  866|    615|        ZSTD_wildcopy(op, ip, oend_w - op, ovtype);
  867|    615|        ip += oend_w - op;
  868|    615|        op += oend_w - op;
  869|    615|    }
  870|       |    /* Handle the leftovers. */
  871|  14.2M|    while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (871:12): [True: 14.1M, False: 72.3k]
  ------------------
  872|  72.3k|}
zstd_decompress_block.c:ZSTD_overlapCopy8:
  804|  1.49M|HINT_INLINE void ZSTD_overlapCopy8(BYTE** op, BYTE const** ip, size_t offset) {
  805|  1.49M|    assert(*ip <= *op);
  ------------------
  |  |   70|  1.49M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  806|  1.49M|    if (offset < 8) {
  ------------------
  |  Branch (806:9): [True: 1.19M, False: 293k]
  ------------------
  807|       |        /* close range match, overlap */
  808|  1.19M|        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
  809|  1.19M|        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
  810|  1.19M|        int const sub2 = dec64table[offset];
  811|  1.19M|        (*op)[0] = (*ip)[0];
  812|  1.19M|        (*op)[1] = (*ip)[1];
  813|  1.19M|        (*op)[2] = (*ip)[2];
  814|  1.19M|        (*op)[3] = (*ip)[3];
  815|  1.19M|        *ip += dec32table[offset];
  816|  1.19M|        ZSTD_copy4(*op+4, *ip);
  817|  1.19M|        *ip -= sub2;
  818|  1.19M|    } else {
  819|   293k|        ZSTD_copy8(*op, *ip);
  820|   293k|    }
  821|  1.49M|    *ip += 8;
  822|  1.49M|    *op += 8;
  823|  1.49M|    assert(*op - *ip >= 8);
  ------------------
  |  |   70|  1.49M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  824|  1.49M|}
zstd_decompress_block.c:ZSTD_copy4:
   47|  1.19M|static void ZSTD_copy4(void* dst, const void* src) { ZSTD_memcpy(dst, src, 4); }
  ------------------
  |  |   44|  1.19M|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
zstd_decompress_block.c:ZSTD_execSequenceSplitLitBuffer:
 1104|  1.11M|{
 1105|  1.11M|    BYTE* const oLitEnd = op + sequence.litLength;
 1106|  1.11M|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 1107|  1.11M|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 1108|  1.11M|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 1109|  1.11M|    const BYTE* match = oLitEnd - sequence.offset;
 1110|       |
 1111|  1.11M|    assert(op != NULL /* Precondition */);
  ------------------
  |  |   70|  1.11M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1112|  1.11M|    assert(oend_w < oend /* No underflow */);
  ------------------
  |  |   70|  1.11M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1113|       |    /* Handle edge cases in a slow path:
 1114|       |     *   - Read beyond end of literals
 1115|       |     *   - Match end is within WILDCOPY_OVERLIMIT of oend
 1116|       |     *   - 32-bit mode and the match length overflows
 1117|       |     */
 1118|  1.11M|    if (UNLIKELY(
  ------------------
  |  |  188|  5.01M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 282k, False: 832k]
  |  |  |  Branch (188:40): [True: 0, False: 1.11M]
  |  |  |  Branch (188:40): [True: 282k, False: 832k]
  |  |  |  Branch (188:40): [True: 0, False: 832k]
  |  |  |  Branch (188:40): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1119|  1.11M|            iLitEnd > litLimit ||
 1120|  1.11M|            oMatchEnd > oend_w ||
 1121|  1.11M|            (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH)))
 1122|   282k|        return ZSTD_execSequenceEndSplitLitBuffer(op, oend, oend_w, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd);
 1123|       |
 1124|       |    /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */
 1125|   832k|    assert(op <= oLitEnd /* No overflow */);
  ------------------
  |  |   70|   832k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1126|   832k|    assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */);
  ------------------
  |  |   70|   832k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1127|   832k|    assert(oMatchEnd <= oend /* No underflow */);
  ------------------
  |  |   70|   832k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1128|   832k|    assert(iLitEnd <= litLimit /* Literal length is in bounds */);
  ------------------
  |  |   70|   832k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1129|   832k|    assert(oLitEnd <= oend_w /* Can wildcopy literals */);
  ------------------
  |  |   70|   832k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1130|   832k|    assert(oMatchEnd <= oend_w /* Can wildcopy matches */);
  ------------------
  |  |   70|   832k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1131|       |
 1132|       |    /* Copy Literals:
 1133|       |     * Split out litLength <= 16 since it is nearly always true. +1.6% on gcc-9.
 1134|       |     * We likely don't need the full 32-byte wildcopy.
 1135|       |     */
 1136|   832k|    assert(WILDCOPY_OVERLENGTH >= 16);
  ------------------
  |  |   70|   832k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1137|   832k|    ZSTD_copy16(op, (*litPtr));
 1138|   832k|    if (UNLIKELY(sequence.litLength > 16)) {
  ------------------
  |  |  188|   832k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 55.8k, False: 776k]
  |  |  ------------------
  ------------------
 1139|  55.8k|        ZSTD_wildcopy(op+16, (*litPtr)+16, sequence.litLength-16, ZSTD_no_overlap);
 1140|  55.8k|    }
 1141|   832k|    op = oLitEnd;
 1142|   832k|    *litPtr = iLitEnd;   /* update for next sequence */
 1143|       |
 1144|       |    /* Copy Match */
 1145|   832k|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (1145:9): [True: 519, False: 832k]
  ------------------
 1146|       |        /* offset beyond prefix -> go into extDict */
 1147|    519|        RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected, "");
  ------------------
  |  |  114|    519|    do {                                                                       \
  |  |  115|    519|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 238, False: 281]
  |  |  ------------------
  |  |  116|    238|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    238|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 238]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    238|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    238|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    238|    do {                                           \
  |  |  |  |   99|    238|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 238]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    238|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 238]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    238|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    238|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 238]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    238|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    238|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 238]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    238|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    238|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    238|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    238|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    238|        }                                                                      \
  |  |  123|    519|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 281]
  |  |  ------------------
  ------------------
 1148|    281|        match = dictEnd + (match - prefixStart);
 1149|    281|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (1149:13): [True: 184, False: 97]
  ------------------
 1150|    184|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|    184|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1151|    184|            return sequenceLength;
 1152|    184|        }
 1153|       |        /* span extDict & currentPrefixSegment */
 1154|     97|        {   size_t const length1 = dictEnd - match;
 1155|     97|            ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|     97|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1156|     97|            op = oLitEnd + length1;
 1157|     97|            sequence.matchLength -= length1;
 1158|     97|            match = prefixStart;
 1159|     97|    }   }
 1160|       |    /* Match within prefix of 1 or more bytes */
 1161|   832k|    assert(op <= oMatchEnd);
  ------------------
  |  |   70|   832k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1162|   832k|    assert(oMatchEnd <= oend_w);
  ------------------
  |  |   70|   832k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1163|   832k|    assert(match >= prefixStart);
  ------------------
  |  |   70|   832k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1164|   832k|    assert(sequence.matchLength >= 1);
  ------------------
  |  |   70|   832k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1165|       |
 1166|       |    /* Nearly all offsets are >= WILDCOPY_VECLEN bytes, which means we can use wildcopy
 1167|       |     * without overlap checking.
 1168|       |     */
 1169|   832k|    if (LIKELY(sequence.offset >= WILDCOPY_VECLEN)) {
  ------------------
  |  |  187|   832k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 180k, False: 651k]
  |  |  ------------------
  ------------------
 1170|       |        /* We bet on a full wildcopy for matches, since we expect matches to be
 1171|       |         * longer than literals (in general). In silesia, ~10% of matches are longer
 1172|       |         * than 16 bytes.
 1173|       |         */
 1174|   180k|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength, ZSTD_no_overlap);
 1175|   180k|        return sequenceLength;
 1176|   180k|    }
 1177|   651k|    assert(sequence.offset < WILDCOPY_VECLEN);
  ------------------
  |  |   70|   651k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1178|       |
 1179|       |    /* Copy 8 bytes and spread the offset to be >= 8. */
 1180|   651k|    ZSTD_overlapCopy8(&op, &match, sequence.offset);
 1181|       |
 1182|       |    /* If the match length is > 8 bytes, then continue with the wildcopy. */
 1183|   651k|    if (sequence.matchLength > 8) {
  ------------------
  |  Branch (1183:9): [True: 91.0k, False: 560k]
  ------------------
 1184|  91.0k|        assert(op < oMatchEnd);
  ------------------
  |  |   70|  91.0k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1185|  91.0k|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8, ZSTD_overlap_src_before_dst);
 1186|  91.0k|    }
 1187|   651k|    return sequenceLength;
 1188|   832k|}
zstd_decompress_block.c:ZSTD_execSequenceEndSplitLitBuffer:
  959|   282k|{
  960|   282k|    BYTE* const oLitEnd = op + sequence.litLength;
  961|   282k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
  962|   282k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
  963|   282k|    const BYTE* match = oLitEnd - sequence.offset;
  964|       |
  965|       |
  966|       |    /* bounds checks : careful of address space overflow in 32-bit mode */
  967|   282k|    RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, "last match must fit within dstBuffer");
  ------------------
  |  |  114|   282k|    do {                                                                       \
  |  |  115|   282k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 105, False: 282k]
  |  |  ------------------
  |  |  116|    105|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    105|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 105]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    105|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    105|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    105|    do {                                           \
  |  |  |  |   99|    105|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 105]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    105|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 105]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    105|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    105|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 105]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    105|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    105|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 105]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    105|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    105|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    105|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    105|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    105|        }                                                                      \
  |  |  123|   282k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 282k]
  |  |  ------------------
  ------------------
  968|   282k|    RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, "try to read beyond literal buffer");
  ------------------
  |  |  114|   282k|    do {                                                                       \
  |  |  115|   282k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 282k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|   282k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 282k]
  |  |  ------------------
  ------------------
  969|   282k|    assert(op < op + sequenceLength);
  ------------------
  |  |   70|   282k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  970|   282k|    assert(oLitEnd < op + sequenceLength);
  ------------------
  |  |   70|   282k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  971|       |
  972|       |    /* copy literals */
  973|   282k|    RETURN_ERROR_IF(op > *litPtr && op < *litPtr + sequence.litLength, dstSize_tooSmall, "output should not catch up to and overwrite literal buffer");
  ------------------
  |  |  114|   282k|    do {                                                                       \
  |  |  115|   847k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 281k, False: 816]
  |  |  |  Branch (115:13): [True: 43, False: 281k]
  |  |  ------------------
  |  |  116|     43|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     43|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 43]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     43|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     43|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     43|    do {                                           \
  |  |  |  |   99|     43|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 43]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     43|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 43]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     43|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     43|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 43]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     43|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     43|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 43]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     43|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     43|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     43|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     43|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     43|        }                                                                      \
  |  |  123|   282k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 282k]
  |  |  ------------------
  ------------------
  974|   282k|    ZSTD_safecopyDstBeforeSrc(op, *litPtr, sequence.litLength);
  975|   282k|    op = oLitEnd;
  976|   282k|    *litPtr = iLitEnd;
  977|       |
  978|       |    /* copy Match */
  979|   282k|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (979:9): [True: 107, False: 282k]
  ------------------
  980|       |        /* offset beyond prefix */
  981|    107|        RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, "");
  ------------------
  |  |  114|    107|    do {                                                                       \
  |  |  115|    107|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 67, False: 40]
  |  |  ------------------
  |  |  116|     67|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     67|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 67]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     67|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     67|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     67|    do {                                           \
  |  |  |  |   99|     67|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 67]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     67|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 67]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     67|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     67|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 67]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     67|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     67|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 67]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     67|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     67|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     67|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     67|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     67|        }                                                                      \
  |  |  123|    107|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 40]
  |  |  ------------------
  ------------------
  982|     40|        match = dictEnd - (prefixStart - match);
  983|     40|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (983:13): [True: 25, False: 15]
  ------------------
  984|     25|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|     25|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  985|     25|            return sequenceLength;
  986|     25|        }
  987|       |        /* span extDict & currentPrefixSegment */
  988|     15|        {   size_t const length1 = dictEnd - match;
  989|     15|        ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|     15|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  990|     15|        op = oLitEnd + length1;
  991|     15|        sequence.matchLength -= length1;
  992|     15|        match = prefixStart;
  993|     15|        }
  994|     15|    }
  995|   282k|    ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst);
  996|   282k|    return sequenceLength;
  997|   282k|}
zstd_decompress_block.c:ZSTD_decompressSequencesSplitLitBuffer:
 1956|    585|{
 1957|    585|    DEBUGLOG(5, "ZSTD_decompressSequencesSplitLitBuffer");
  ------------------
  |  |  104|    585|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 585]
  |  |  ------------------
  ------------------
 1958|    585|#if DYNAMIC_BMI2
 1959|    585|    if (ZSTD_DCtx_get_bmi2(dctx)) {
  ------------------
  |  Branch (1959:9): [True: 585, False: 0]
  ------------------
 1960|    585|        return ZSTD_decompressSequencesSplitLitBuffer_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1961|    585|    }
 1962|      0|#endif
 1963|      0|    return ZSTD_decompressSequencesSplitLitBuffer_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1964|    585|}
zstd_decompress_block.c:ZSTD_decompressSequencesSplitLitBuffer_bmi2:
 1920|    585|{
 1921|    585|    return ZSTD_decompressSequences_bodySplitLitBuffer(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1922|    585|}
zstd_decompress_block.c:ZSTD_decompressSequences_bodySplitLitBuffer:
 1407|    585|{
 1408|    585|    const BYTE* ip = (const BYTE*)seqStart;
 1409|    585|    const BYTE* const iend = ip + seqSize;
 1410|    585|    BYTE* const ostart = (BYTE*)dst;
 1411|    585|    BYTE* const oend = ZSTD_maybeNullPtrAdd(ostart, maxDstSize);
 1412|    585|    BYTE* op = ostart;
 1413|    585|    const BYTE* litPtr = dctx->litPtr;
 1414|    585|    const BYTE* litBufferEnd = dctx->litBufferEnd;
 1415|    585|    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);
 1416|    585|    const BYTE* const vBase = (const BYTE*) (dctx->virtualStart);
 1417|    585|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 1418|    585|    DEBUGLOG(5, "ZSTD_decompressSequences_bodySplitLitBuffer (%i seqs)", nbSeq);
  ------------------
  |  |  104|    585|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 585]
  |  |  ------------------
  ------------------
 1419|       |
 1420|       |    /* Literals are split between internal buffer & output buffer */
 1421|    585|    if (nbSeq) {
  ------------------
  |  Branch (1421:9): [True: 584, False: 1]
  ------------------
 1422|    584|        seqState_t seqState;
 1423|    584|        dctx->fseEntropy = 1;
 1424|  2.33k|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  2.33k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1424:28): [True: 1.75k, False: 584]
  ------------------
 1425|    584|        RETURN_ERROR_IF(
  ------------------
  |  |  114|    584|    do {                                                                       \
  |  |  115|    584|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 30, False: 554]
  |  |  ------------------
  |  |  116|     30|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     30|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 30]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     30|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     30|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     30|    do {                                           \
  |  |  |  |   99|     30|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 30]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     30|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 30]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     30|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     30|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 30]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     30|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     30|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 30]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     30|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     30|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     30|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     30|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     30|        }                                                                      \
  |  |  123|    584|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 554]
  |  |  ------------------
  ------------------
 1426|    584|            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)),
 1427|    584|            corruption_detected, "");
 1428|    554|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1429|    554|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1430|    554|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1431|    554|        assert(dst != NULL);
  ------------------
  |  |   70|    554|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1432|       |
 1433|    554|        ZSTD_STATIC_ASSERT(
  ------------------
  |  |   43|    554|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|    554|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1434|    554|                BIT_DStream_unfinished < BIT_DStream_completed &&
 1435|    554|                BIT_DStream_endOfBuffer < BIT_DStream_completed &&
 1436|    554|                BIT_DStream_completed < BIT_DStream_overflow);
 1437|       |
 1438|       |        /* decompress without overrunning litPtr begins */
 1439|    554|        {   seq_t sequence = {0,0,0};  /* some static analyzer believe that @sequence is not initialized (it necessarily is, since for(;;) loop as at least one iteration) */
 1440|       |            /* Align the decompression loop to 32 + 16 bytes.
 1441|       |                *
 1442|       |                * zstd compiled with gcc-9 on an Intel i9-9900k shows 10% decompression
 1443|       |                * speed swings based on the alignment of the decompression loop. This
 1444|       |                * performance swing is caused by parts of the decompression loop falling
 1445|       |                * out of the DSB. The entire decompression loop should fit in the DSB,
 1446|       |                * when it can't we get much worse performance. You can measure if you've
 1447|       |                * hit the good case or the bad case with this perf command for some
 1448|       |                * compressed file test.zst:
 1449|       |                *
 1450|       |                *   perf stat -e cycles -e instructions -e idq.all_dsb_cycles_any_uops \
 1451|       |                *             -e idq.all_mite_cycles_any_uops -- ./zstd -tq test.zst
 1452|       |                *
 1453|       |                * If you see most cycles served out of the MITE you've hit the bad case.
 1454|       |                * If you see most cycles served out of the DSB you've hit the good case.
 1455|       |                * If it is pretty even then you may be in an okay case.
 1456|       |                *
 1457|       |                * This issue has been reproduced on the following CPUs:
 1458|       |                *   - Kabylake: Macbook Pro (15-inch, 2019) 2.4 GHz Intel Core i9
 1459|       |                *               Use Instruments->Counters to get DSB/MITE cycles.
 1460|       |                *               I never got performance swings, but I was able to
 1461|       |                *               go from the good case of mostly DSB to half of the
 1462|       |                *               cycles served from MITE.
 1463|       |                *   - Coffeelake: Intel i9-9900k
 1464|       |                *   - Coffeelake: Intel i7-9700k
 1465|       |                *
 1466|       |                * I haven't been able to reproduce the instability or DSB misses on any
 1467|       |                * of the following CPUS:
 1468|       |                *   - Haswell
 1469|       |                *   - Broadwell: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GH
 1470|       |                *   - Skylake
 1471|       |                *
 1472|       |                * Alignment is done for each of the three major decompression loops:
 1473|       |                *   - ZSTD_decompressSequences_bodySplitLitBuffer - presplit section of the literal buffer
 1474|       |                *   - ZSTD_decompressSequences_bodySplitLitBuffer - postsplit section of the literal buffer
 1475|       |                *   - ZSTD_decompressSequences_body
 1476|       |                * Alignment choices are made to minimize large swings on bad cases and influence on performance
 1477|       |                * from changes external to this code, rather than to overoptimize on the current commit.
 1478|       |                *
 1479|       |                * If you are seeing performance stability this script can help test.
 1480|       |                * It tests on 4 commits in zstd where I saw performance change.
 1481|       |                *
 1482|       |                *   https://gist.github.com/terrelln/9889fc06a423fd5ca6e99351564473f4
 1483|       |                */
 1484|    554|#if defined(__GNUC__) && defined(__x86_64__)
 1485|    554|            __asm__(".p2align 6");
 1486|       |#  if __GNUC__ >= 7
 1487|       |	    /* good for gcc-7, gcc-9, and gcc-11 */
 1488|       |            __asm__("nop");
 1489|       |            __asm__(".p2align 5");
 1490|       |            __asm__("nop");
 1491|       |            __asm__(".p2align 4");
 1492|       |#    if __GNUC__ == 8 || __GNUC__ == 10
 1493|       |	    /* good for gcc-8 and gcc-10 */
 1494|       |            __asm__("nop");
 1495|       |            __asm__(".p2align 3");
 1496|       |#    endif
 1497|       |#  endif
 1498|    554|#endif
 1499|       |
 1500|       |            /* Handle the initial state where litBuffer is currently split between dst and litExtraBuffer */
 1501|   534k|            for ( ; nbSeq; nbSeq--) {
  ------------------
  |  Branch (1501:21): [True: 534k, False: 13]
  ------------------
 1502|   534k|                sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1503|   534k|                if (litPtr + sequence.litLength > dctx->litBufferEnd) break;
  ------------------
  |  Branch (1503:21): [True: 391, False: 534k]
  ------------------
 1504|   534k|                {   size_t const oneSeqSize = ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence.litLength - WILDCOPY_OVERLENGTH, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd);
  ------------------
  |  |  199|   534k|#define WILDCOPY_OVERLENGTH 32
  ------------------
 1505|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1506|       |                    assert(!ZSTD_isError(oneSeqSize));
 1507|       |                    ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase);
 1508|       |#endif
 1509|   534k|                    if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|   534k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 150, False: 534k]
  |  |  ------------------
  ------------------
 1510|    150|                        return oneSeqSize;
 1511|   534k|                    DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|   534k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 534k]
  |  |  ------------------
  ------------------
 1512|   534k|                    op += oneSeqSize;
 1513|   534k|            }   }
 1514|    404|            DEBUGLOG(6, "reached: (litPtr + sequence.litLength > dctx->litBufferEnd)");
  ------------------
  |  |  104|    404|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 404]
  |  |  ------------------
  ------------------
 1515|       |
 1516|       |            /* If there are more sequences, they will need to read literals from litExtraBuffer; copy over the remainder from dst and update litPtr and litEnd */
 1517|    404|            if (nbSeq > 0) {
  ------------------
  |  Branch (1517:17): [True: 391, False: 13]
  ------------------
 1518|    391|                const size_t leftoverLit = dctx->litBufferEnd - litPtr;
 1519|    391|                DEBUGLOG(6, "There are %i sequences left, and %zu/%zu literals left in buffer", nbSeq, leftoverLit, sequence.litLength);
  ------------------
  |  |  104|    391|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 391]
  |  |  ------------------
  ------------------
 1520|    391|                if (leftoverLit) {
  ------------------
  |  Branch (1520:21): [True: 385, False: 6]
  ------------------
 1521|    385|                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer");
  ------------------
  |  |  114|    385|    do {                                                                       \
  |  |  115|    385|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 10, False: 375]
  |  |  ------------------
  |  |  116|     10|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     10|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     10|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     10|    do {                                           \
  |  |  |  |   99|     10|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     10|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     10|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     10|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     10|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     10|        }                                                                      \
  |  |  123|    385|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 375]
  |  |  ------------------
  ------------------
 1522|    375|                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);
 1523|    375|                    sequence.litLength -= leftoverLit;
 1524|    375|                    op += leftoverLit;
 1525|    375|                }
 1526|    381|                litPtr = dctx->litExtraBuffer;
 1527|    381|                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    381|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    381|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|    762|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 381]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 381, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1528|    381|                dctx->litBufferLocation = ZSTD_not_in_dst;
 1529|    381|                {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd);
 1530|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1531|       |                    assert(!ZSTD_isError(oneSeqSize));
 1532|       |                    ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase);
 1533|       |#endif
 1534|    381|                    if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|    381|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 55, False: 326]
  |  |  ------------------
  ------------------
 1535|     55|                        return oneSeqSize;
 1536|    326|                    DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|    326|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 326]
  |  |  ------------------
  ------------------
 1537|    326|                    op += oneSeqSize;
 1538|    326|                }
 1539|      0|                nbSeq--;
 1540|    326|            }
 1541|    404|        }
 1542|       |
 1543|    339|        if (nbSeq > 0) {
  ------------------
  |  Branch (1543:13): [True: 325, False: 14]
  ------------------
 1544|       |            /* there is remaining lit from extra buffer */
 1545|       |
 1546|    325|#if defined(__GNUC__) && defined(__x86_64__)
 1547|    325|            __asm__(".p2align 6");
 1548|    325|            __asm__("nop");
 1549|    325|#  if __GNUC__ != 7
 1550|       |            /* worse for gcc-7 better for gcc-8, gcc-9, and gcc-10 and clang */
 1551|    325|            __asm__(".p2align 4");
 1552|    325|            __asm__("nop");
 1553|    325|            __asm__(".p2align 3");
 1554|       |#  elif __GNUC__ >= 11
 1555|       |            __asm__(".p2align 3");
 1556|       |#  else
 1557|       |            __asm__(".p2align 5");
 1558|       |            __asm__("nop");
 1559|       |            __asm__(".p2align 3");
 1560|       |#  endif
 1561|    325|#endif
 1562|       |
 1563|   423k|            for ( ; nbSeq ; nbSeq--) {
  ------------------
  |  Branch (1563:21): [True: 423k, False: 12]
  ------------------
 1564|   423k|                seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1565|   423k|                size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd);
 1566|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1567|       |                assert(!ZSTD_isError(oneSeqSize));
 1568|       |                ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase);
 1569|       |#endif
 1570|   423k|                if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|   423k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 313, False: 423k]
  |  |  ------------------
  ------------------
 1571|    313|                    return oneSeqSize;
 1572|   423k|                DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|   423k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 423k]
  |  |  ------------------
  ------------------
 1573|   423k|                op += oneSeqSize;
 1574|   423k|            }
 1575|    325|        }
 1576|       |
 1577|       |        /* check if reached exact end */
 1578|     26|        DEBUGLOG(5, "ZSTD_decompressSequences_bodySplitLitBuffer: after decode loop, remaining nbSeq : %i", nbSeq);
  ------------------
  |  |  104|     26|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 26]
  |  |  ------------------
  ------------------
 1579|     26|        RETURN_ERROR_IF(nbSeq, corruption_detected, "");
  ------------------
  |  |  114|     26|    do {                                                                       \
  |  |  115|     26|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 26]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|     26|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 26]
  |  |  ------------------
  ------------------
 1580|     26|        DEBUGLOG(5, "bitStream : start=%p, ptr=%p, bitsConsumed=%u", seqState.DStream.start, seqState.DStream.ptr, seqState.DStream.bitsConsumed);
  ------------------
  |  |  104|     26|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 26]
  |  |  ------------------
  ------------------
 1581|     26|        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, "");
  ------------------
  |  |  114|     26|    do {                                                                       \
  |  |  115|     26|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 10, False: 16]
  |  |  ------------------
  |  |  116|     10|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     10|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     10|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     10|    do {                                           \
  |  |  |  |   99|     10|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     10|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     10|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     10|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     10|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     10|        }                                                                      \
  |  |  123|     26|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 16]
  |  |  ------------------
  ------------------
 1582|       |        /* save reps for next block */
 1583|     64|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  |   64|     64|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1583:28): [True: 48, False: 16]
  ------------------
 1584|     16|    }
 1585|       |
 1586|       |    /* last literal segment */
 1587|     17|    if (dctx->litBufferLocation == ZSTD_split) {
  ------------------
  |  Branch (1587:9): [True: 12, False: 5]
  ------------------
 1588|       |        /* split hasn't been reached yet, first get dst then copy litExtraBuffer */
 1589|     12|        size_t const lastLLSize = (size_t)(litBufferEnd - litPtr);
 1590|     12|        DEBUGLOG(6, "copy last literals from segment : %u", (U32)lastLLSize);
  ------------------
  |  |  104|     12|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 12]
  |  |  ------------------
  ------------------
 1591|     12|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend - op), dstSize_tooSmall, "");
  ------------------
  |  |  114|     12|    do {                                                                       \
  |  |  115|     12|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4, False: 8]
  |  |  ------------------
  |  |  116|      4|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      4|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      4|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      4|    do {                                           \
  |  |  |  |   99|      4|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      4|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      4|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      4|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      4|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      4|        }                                                                      \
  |  |  123|     12|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 8]
  |  |  ------------------
  ------------------
 1592|      8|        if (op != NULL) {
  ------------------
  |  Branch (1592:13): [True: 8, False: 0]
  ------------------
 1593|      8|            ZSTD_memmove(op, litPtr, lastLLSize);
  ------------------
  |  |   45|      8|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1594|      8|            op += lastLLSize;
 1595|      8|        }
 1596|      8|        litPtr = dctx->litExtraBuffer;
 1597|      8|        litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|      8|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|      8|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|     16|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 8]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 8, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1598|      8|        dctx->litBufferLocation = ZSTD_not_in_dst;
 1599|      8|    }
 1600|       |    /* copy last literals from internal buffer */
 1601|     13|    {   size_t const lastLLSize = (size_t)(litBufferEnd - litPtr);
 1602|     13|        DEBUGLOG(6, "copy last literals from internal buffer : %u", (U32)lastLLSize);
  ------------------
  |  |  104|     13|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 13]
  |  |  ------------------
  ------------------
 1603|     13|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, "");
  ------------------
  |  |  114|     13|    do {                                                                       \
  |  |  115|     13|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 8, False: 5]
  |  |  ------------------
  |  |  116|      8|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      8|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      8|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      8|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      8|    do {                                           \
  |  |  |  |   99|      8|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 8]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      8|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      8|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      8|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      8|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      8|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      8|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      8|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      8|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      8|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      8|        }                                                                      \
  |  |  123|     13|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5]
  |  |  ------------------
  ------------------
 1604|      5|        if (op != NULL) {
  ------------------
  |  Branch (1604:13): [True: 5, False: 0]
  ------------------
 1605|      5|            ZSTD_memcpy(op, litPtr, lastLLSize);
  ------------------
  |  |   44|      5|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1606|      5|            op += lastLLSize;
 1607|      5|    }   }
 1608|       |
 1609|      5|    DEBUGLOG(6, "decoded block of size %u bytes", (U32)(op - ostart));
  ------------------
  |  |  104|      5|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 5]
  |  |  ------------------
  ------------------
 1610|      5|    return (size_t)(op - ostart);
 1611|     13|}
zstd_decompress_block.c:ZSTD_decompressSequences:
 1943|    534|{
 1944|    534|    DEBUGLOG(5, "ZSTD_decompressSequences");
  ------------------
  |  |  104|    534|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 534]
  |  |  ------------------
  ------------------
 1945|    534|#if DYNAMIC_BMI2
 1946|    534|    if (ZSTD_DCtx_get_bmi2(dctx)) {
  ------------------
  |  Branch (1946:9): [True: 534, False: 0]
  ------------------
 1947|    534|        return ZSTD_decompressSequences_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1948|    534|    }
 1949|      0|#endif
 1950|      0|    return ZSTD_decompressSequences_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1951|    534|}
zstd_decompress_block.c:ZSTD_decompressSequences_bmi2:
 1911|    534|{
 1912|    534|    return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1913|    534|}
zstd_decompress_block.c:ZSTD_decompressSequences_body:
 1619|    534|{
 1620|    534|    const BYTE* ip = (const BYTE*)seqStart;
 1621|    534|    const BYTE* const iend = ip + seqSize;
 1622|    534|    BYTE* const ostart = (BYTE*)dst;
 1623|    534|    BYTE* const oend = dctx->litBufferLocation == ZSTD_not_in_dst ? ZSTD_maybeNullPtrAdd(ostart, maxDstSize) : dctx->litBuffer;
  ------------------
  |  Branch (1623:24): [True: 238, False: 296]
  ------------------
 1624|    534|    BYTE* op = ostart;
 1625|    534|    const BYTE* litPtr = dctx->litPtr;
 1626|    534|    const BYTE* const litEnd = litPtr + dctx->litSize;
 1627|    534|    const BYTE* const prefixStart = (const BYTE*)(dctx->prefixStart);
 1628|    534|    const BYTE* const vBase = (const BYTE*)(dctx->virtualStart);
 1629|    534|    const BYTE* const dictEnd = (const BYTE*)(dctx->dictEnd);
 1630|    534|    DEBUGLOG(5, "ZSTD_decompressSequences_body: nbSeq = %d", nbSeq);
  ------------------
  |  |  104|    534|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 534]
  |  |  ------------------
  ------------------
 1631|       |
 1632|       |    /* Regen sequences */
 1633|    534|    if (nbSeq) {
  ------------------
  |  Branch (1633:9): [True: 481, False: 53]
  ------------------
 1634|    481|        seqState_t seqState;
 1635|    481|        dctx->fseEntropy = 1;
 1636|  1.92k|        { U32 i; for (i = 0; i < ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  1.92k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1636:30): [True: 1.44k, False: 481]
  ------------------
 1637|    481|        RETURN_ERROR_IF(
  ------------------
  |  |  114|    481|    do {                                                                       \
  |  |  115|    481|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 58, False: 423]
  |  |  ------------------
  |  |  116|     58|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     58|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 58]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     58|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     58|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     58|    do {                                           \
  |  |  |  |   99|     58|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 58]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     58|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 58]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     58|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     58|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 58]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     58|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     58|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 58]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     58|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     58|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     58|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     58|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     58|        }                                                                      \
  |  |  123|    481|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 423]
  |  |  ------------------
  ------------------
 1638|    481|            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend - ip)),
 1639|    481|            corruption_detected, "");
 1640|    423|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1641|    423|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1642|    423|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1643|    423|        assert(dst != NULL);
  ------------------
  |  |   70|    423|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1644|       |
 1645|    423|#if defined(__GNUC__) && defined(__x86_64__)
 1646|    423|            __asm__(".p2align 6");
 1647|    423|            __asm__("nop");
 1648|       |#  if __GNUC__ >= 7
 1649|       |            __asm__(".p2align 5");
 1650|       |            __asm__("nop");
 1651|       |            __asm__(".p2align 3");
 1652|       |#  else
 1653|    423|            __asm__(".p2align 4");
 1654|    423|            __asm__("nop");
 1655|    423|            __asm__(".p2align 3");
 1656|    423|#  endif
 1657|    423|#endif
 1658|       |
 1659|   333k|        for ( ; nbSeq ; nbSeq--) {
  ------------------
  |  Branch (1659:17): [True: 333k, False: 138]
  ------------------
 1660|   333k|            seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1661|   333k|            size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litEnd, prefixStart, vBase, dictEnd);
 1662|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1663|       |            assert(!ZSTD_isError(oneSeqSize));
 1664|       |            ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase);
 1665|       |#endif
 1666|   333k|            if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|   333k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 285, False: 333k]
  |  |  ------------------
  ------------------
 1667|    285|                return oneSeqSize;
 1668|   333k|            DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|   333k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 333k]
  |  |  ------------------
  ------------------
 1669|   333k|            op += oneSeqSize;
 1670|   333k|        }
 1671|       |
 1672|       |        /* check if reached exact end */
 1673|    138|        assert(nbSeq == 0);
  ------------------
  |  |   70|    138|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1674|    138|        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, "");
  ------------------
  |  |  114|    138|    do {                                                                       \
  |  |  115|    138|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 10, False: 128]
  |  |  ------------------
  |  |  116|     10|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     10|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     10|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     10|    do {                                           \
  |  |  |  |   99|     10|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     10|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     10|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     10|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     10|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     10|        }                                                                      \
  |  |  123|    138|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 128]
  |  |  ------------------
  ------------------
 1675|       |        /* save reps for next block */
 1676|    512|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  |   64|    512|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1676:28): [True: 384, False: 128]
  ------------------
 1677|    128|    }
 1678|       |
 1679|       |    /* last literal segment */
 1680|    181|    {   size_t const lastLLSize = (size_t)(litEnd - litPtr);
 1681|    181|        DEBUGLOG(6, "copy last literals : %u", (U32)lastLLSize);
  ------------------
  |  |  104|    181|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 181]
  |  |  ------------------
  ------------------
 1682|    181|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, "");
  ------------------
  |  |  114|    181|    do {                                                                       \
  |  |  115|    181|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 7, False: 174]
  |  |  ------------------
  |  |  116|      7|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      7|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      7|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      7|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      7|    do {                                           \
  |  |  |  |   99|      7|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      7|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      7|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      7|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      7|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      7|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      7|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      7|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      7|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      7|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      7|        }                                                                      \
  |  |  123|    181|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 174]
  |  |  ------------------
  ------------------
 1683|    174|        if (op != NULL) {
  ------------------
  |  Branch (1683:13): [True: 174, False: 0]
  ------------------
 1684|    174|            ZSTD_memcpy(op, litPtr, lastLLSize);
  ------------------
  |  |   44|    174|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1685|    174|            op += lastLLSize;
 1686|    174|    }   }
 1687|       |
 1688|    174|    DEBUGLOG(6, "decoded block of size %u bytes", (U32)(op - ostart));
  ------------------
  |  |  104|    174|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 174]
  |  |  ------------------
  ------------------
 1689|    174|    return (size_t)(op - ostart);
 1690|    181|}

zstd_decompress_block.c:ZSTD_DCtx_get_bmi2:
  213|  9.34k|MEM_STATIC int ZSTD_DCtx_get_bmi2(const struct ZSTD_DCtx_s *dctx) {
  214|  9.34k|#if DYNAMIC_BMI2
  215|  9.34k|    return dctx->bmi2;
  216|       |#else
  217|       |    (void)dctx;
  218|       |    return 0;
  219|       |#endif
  220|  9.34k|}

zstd_decompress.c:ZSTD_isLegacy:
   57|  19.9k|{
   58|  19.9k|    U32 magicNumberLE;
   59|  19.9k|    if (srcSize<4) return 0;
  ------------------
  |  Branch (59:9): [True: 0, False: 19.9k]
  ------------------
   60|  19.9k|    magicNumberLE = MEM_readLE32(src);
   61|  19.9k|    switch(magicNumberLE)
   62|  19.9k|    {
   63|       |#if (ZSTD_LEGACY_SUPPORT <= 1)
   64|       |        case ZSTDv01_magicNumberLE:return 1;
   65|       |#endif
   66|       |#if (ZSTD_LEGACY_SUPPORT <= 2)
   67|       |        case ZSTDv02_magicNumber : return 2;
   68|       |#endif
   69|       |#if (ZSTD_LEGACY_SUPPORT <= 3)
   70|       |        case ZSTDv03_magicNumber : return 3;
   71|       |#endif
   72|       |#if (ZSTD_LEGACY_SUPPORT <= 4)
   73|       |        case ZSTDv04_magicNumber : return 4;
   74|       |#endif
   75|      0|#if (ZSTD_LEGACY_SUPPORT <= 5)
   76|  6.02k|        case ZSTDv05_MAGICNUMBER : return 5;
  ------------------
  |  |  153|  6.02k|#define ZSTDv05_MAGICNUMBER 0xFD2FB525   /* v0.5 */
  ------------------
  |  Branch (76:9): [True: 6.02k, False: 13.9k]
  ------------------
   77|      0|#endif
   78|      0|#if (ZSTD_LEGACY_SUPPORT <= 6)
   79|  6.77k|        case ZSTDv06_MAGICNUMBER : return 6;
  ------------------
  |  |  164|  6.77k|#define ZSTDv06_MAGICNUMBER 0xFD2FB526   /* v0.6 */
  ------------------
  |  Branch (79:9): [True: 6.77k, False: 13.1k]
  ------------------
   80|      0|#endif
   81|      0|#if (ZSTD_LEGACY_SUPPORT <= 7)
   82|  3.35k|        case ZSTDv07_MAGICNUMBER : return 7;
  ------------------
  |  |  180|  3.35k|#define ZSTDv07_MAGICNUMBER            0xFD2FB527   /* v0.7 */
  ------------------
  |  Branch (82:9): [True: 3.35k, False: 16.5k]
  ------------------
   83|      0|#endif
   84|  3.78k|        default : return 0;
  ------------------
  |  Branch (84:9): [True: 3.78k, False: 16.1k]
  ------------------
   85|  19.9k|    }
   86|  19.9k|}
zstd_decompress.c:ZSTD_getDecompressedSize_legacy:
   90|  1.57k|{
   91|  1.57k|    U32 const version = ZSTD_isLegacy(src, srcSize);
   92|  1.57k|    if (version < 5) return 0;  /* no decompressed size in frame header, or not a legacy format */
  ------------------
  |  Branch (92:9): [True: 0, False: 1.57k]
  ------------------
   93|  1.57k|#if (ZSTD_LEGACY_SUPPORT <= 5)
   94|  1.57k|    if (version==5) {
  ------------------
  |  Branch (94:9): [True: 730, False: 843]
  ------------------
   95|    730|        ZSTDv05_parameters fParams;
   96|    730|        size_t const frResult = ZSTDv05_getFrameParams(&fParams, src, srcSize);
   97|    730|        if (frResult != 0) return 0;
  ------------------
  |  Branch (97:13): [True: 0, False: 730]
  ------------------
   98|    730|        return fParams.srcSize;
   99|    730|    }
  100|    843|#endif
  101|    843|#if (ZSTD_LEGACY_SUPPORT <= 6)
  102|    843|    if (version==6) {
  ------------------
  |  Branch (102:9): [True: 707, False: 136]
  ------------------
  103|    707|        ZSTDv06_frameParams fParams;
  104|    707|        size_t const frResult = ZSTDv06_getFrameParams(&fParams, src, srcSize);
  105|    707|        if (frResult != 0) return 0;
  ------------------
  |  Branch (105:13): [True: 0, False: 707]
  ------------------
  106|    707|        return fParams.frameContentSize;
  107|    707|    }
  108|    136|#endif
  109|    136|#if (ZSTD_LEGACY_SUPPORT <= 7)
  110|    136|    if (version==7) {
  ------------------
  |  Branch (110:9): [True: 136, False: 0]
  ------------------
  111|    136|        ZSTDv07_frameParams fParams;
  112|    136|        size_t const frResult = ZSTDv07_getFrameParams(&fParams, src, srcSize);
  113|    136|        if (frResult != 0) return 0;
  ------------------
  |  Branch (113:13): [True: 0, False: 136]
  ------------------
  114|    136|        return fParams.frameContentSize;
  115|    136|    }
  116|      0|#endif
  117|      0|    return 0;   /* should not be possible */
  118|    136|}
zstd_decompress.c:ZSTD_findFrameSizeInfoLegacy:
  196|  4.37k|{
  197|  4.37k|    ZSTD_frameSizeInfo frameSizeInfo;
  198|  4.37k|    U32 const version = ZSTD_isLegacy(src, srcSize);
  199|  4.37k|    switch(version)
  200|  4.37k|    {
  201|       |#if (ZSTD_LEGACY_SUPPORT <= 1)
  202|       |        case 1 :
  203|       |            ZSTDv01_findFrameSizeInfoLegacy(src, srcSize,
  204|       |                &frameSizeInfo.compressedSize,
  205|       |                &frameSizeInfo.decompressedBound);
  206|       |            break;
  207|       |#endif
  208|       |#if (ZSTD_LEGACY_SUPPORT <= 2)
  209|       |        case 2 :
  210|       |            ZSTDv02_findFrameSizeInfoLegacy(src, srcSize,
  211|       |                &frameSizeInfo.compressedSize,
  212|       |                &frameSizeInfo.decompressedBound);
  213|       |            break;
  214|       |#endif
  215|       |#if (ZSTD_LEGACY_SUPPORT <= 3)
  216|       |        case 3 :
  217|       |            ZSTDv03_findFrameSizeInfoLegacy(src, srcSize,
  218|       |                &frameSizeInfo.compressedSize,
  219|       |                &frameSizeInfo.decompressedBound);
  220|       |            break;
  221|       |#endif
  222|       |#if (ZSTD_LEGACY_SUPPORT <= 4)
  223|       |        case 4 :
  224|       |            ZSTDv04_findFrameSizeInfoLegacy(src, srcSize,
  225|       |                &frameSizeInfo.compressedSize,
  226|       |                &frameSizeInfo.decompressedBound);
  227|       |            break;
  228|       |#endif
  229|      0|#if (ZSTD_LEGACY_SUPPORT <= 5)
  230|  1.54k|        case 5 :
  ------------------
  |  Branch (230:9): [True: 1.54k, False: 2.83k]
  ------------------
  231|  1.54k|            ZSTDv05_findFrameSizeInfoLegacy(src, srcSize,
  232|  1.54k|                &frameSizeInfo.compressedSize,
  233|  1.54k|                &frameSizeInfo.decompressedBound);
  234|  1.54k|            break;
  235|      0|#endif
  236|      0|#if (ZSTD_LEGACY_SUPPORT <= 6)
  237|  1.80k|        case 6 :
  ------------------
  |  Branch (237:9): [True: 1.80k, False: 2.57k]
  ------------------
  238|  1.80k|            ZSTDv06_findFrameSizeInfoLegacy(src, srcSize,
  239|  1.80k|                &frameSizeInfo.compressedSize,
  240|  1.80k|                &frameSizeInfo.decompressedBound);
  241|  1.80k|            break;
  242|      0|#endif
  243|      0|#if (ZSTD_LEGACY_SUPPORT <= 7)
  244|  1.03k|        case 7 :
  ------------------
  |  Branch (244:9): [True: 1.03k, False: 3.34k]
  ------------------
  245|  1.03k|            ZSTDv07_findFrameSizeInfoLegacy(src, srcSize,
  246|  1.03k|                &frameSizeInfo.compressedSize,
  247|  1.03k|                &frameSizeInfo.decompressedBound);
  248|  1.03k|            break;
  249|      0|#endif
  250|      0|        default :
  ------------------
  |  Branch (250:9): [True: 0, False: 4.37k]
  ------------------
  251|      0|            frameSizeInfo.compressedSize = ERROR(prefix_unknown);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|      0|            frameSizeInfo.decompressedBound = ZSTD_CONTENTSIZE_ERROR;
  ------------------
  |  |  204|      0|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
  253|      0|            break;
  254|  4.37k|    }
  255|  4.37k|    if (!ZSTD_isError(frameSizeInfo.compressedSize) && frameSizeInfo.compressedSize > srcSize) {
  ------------------
  |  |   44|  4.37k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (255:9): [True: 4.25k, False: 124]
  |  Branch (255:56): [True: 0, False: 4.25k]
  ------------------
  256|      0|        frameSizeInfo.compressedSize = ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  257|      0|        frameSizeInfo.decompressedBound = ZSTD_CONTENTSIZE_ERROR;
  ------------------
  |  |  204|      0|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
  258|      0|    }
  259|       |    /* In all cases, decompressedBound == nbBlocks * ZSTD_BLOCKSIZE_MAX.
  260|       |     * So we can compute nbBlocks without having to change every function.
  261|       |     */
  262|  4.37k|    if (frameSizeInfo.decompressedBound != ZSTD_CONTENTSIZE_ERROR) {
  ------------------
  |  |  204|  4.37k|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
  |  Branch (262:9): [True: 4.25k, False: 124]
  ------------------
  263|  4.25k|        assert((frameSizeInfo.decompressedBound & (ZSTD_BLOCKSIZE_MAX - 1)) == 0);
  ------------------
  |  |   70|  4.25k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  264|  4.25k|        frameSizeInfo.nbBlocks = (size_t)(frameSizeInfo.decompressedBound / ZSTD_BLOCKSIZE_MAX);
  ------------------
  |  |  148|  4.25k|#define ZSTD_BLOCKSIZE_MAX     (1<<ZSTD_BLOCKSIZELOG_MAX)
  |  |  ------------------
  |  |  |  |  147|  4.25k|#define ZSTD_BLOCKSIZELOG_MAX  17
  |  |  ------------------
  ------------------
  265|  4.25k|    }
  266|  4.37k|    return frameSizeInfo;
  267|  4.37k|}
zstd_decompress.c:ZSTD_findFrameCompressedSizeLegacy:
  270|  4.37k|{
  271|  4.37k|    ZSTD_frameSizeInfo frameSizeInfo = ZSTD_findFrameSizeInfoLegacy(src, srcSize);
  272|  4.37k|    return frameSizeInfo.compressedSize;
  273|  4.37k|}
zstd_decompress.c:ZSTD_decompressLegacy:
  125|  4.25k|{
  126|  4.25k|    U32 const version = ZSTD_isLegacy(src, compressedSize);
  127|  4.25k|    char x;
  128|       |    /* Avoid passing NULL to legacy decoding. */
  129|  4.25k|    if (dst == NULL) {
  ------------------
  |  Branch (129:9): [True: 0, False: 4.25k]
  ------------------
  130|      0|        assert(dstCapacity == 0);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  131|      0|        dst = &x;
  132|      0|    }
  133|  4.25k|    if (src == NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 4.25k]
  ------------------
  134|      0|        assert(compressedSize == 0);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  135|      0|        src = &x;
  136|      0|    }
  137|  4.25k|    if (dict == NULL) {
  ------------------
  |  Branch (137:9): [True: 2.54k, False: 1.71k]
  ------------------
  138|  2.54k|        assert(dictSize == 0);
  ------------------
  |  |   70|  2.54k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  139|  2.54k|        dict = &x;
  140|  2.54k|    }
  141|  4.25k|    (void)dst; (void)dstCapacity; (void)dict; (void)dictSize;  /* unused when ZSTD_LEGACY_SUPPORT >= 8 */
  142|  4.25k|    switch(version)
  143|  4.25k|    {
  144|       |#if (ZSTD_LEGACY_SUPPORT <= 1)
  145|       |        case 1 :
  146|       |            return ZSTDv01_decompress(dst, dstCapacity, src, compressedSize);
  147|       |#endif
  148|       |#if (ZSTD_LEGACY_SUPPORT <= 2)
  149|       |        case 2 :
  150|       |            return ZSTDv02_decompress(dst, dstCapacity, src, compressedSize);
  151|       |#endif
  152|       |#if (ZSTD_LEGACY_SUPPORT <= 3)
  153|       |        case 3 :
  154|       |            return ZSTDv03_decompress(dst, dstCapacity, src, compressedSize);
  155|       |#endif
  156|       |#if (ZSTD_LEGACY_SUPPORT <= 4)
  157|       |        case 4 :
  158|       |            return ZSTDv04_decompress(dst, dstCapacity, src, compressedSize);
  159|       |#endif
  160|      0|#if (ZSTD_LEGACY_SUPPORT <= 5)
  161|  1.48k|        case 5 :
  ------------------
  |  Branch (161:9): [True: 1.48k, False: 2.77k]
  ------------------
  162|  1.48k|            {   size_t result;
  163|  1.48k|                ZSTDv05_DCtx* const zd = ZSTDv05_createDCtx();
  164|  1.48k|                if (zd==NULL) return ERROR(memory_allocation);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (164:21): [True: 0, False: 1.48k]
  ------------------
  165|  1.48k|                result = ZSTDv05_decompress_usingDict(zd, dst, dstCapacity, src, compressedSize, dict, dictSize);
  166|  1.48k|                ZSTDv05_freeDCtx(zd);
  167|  1.48k|                return result;
  168|  1.48k|            }
  169|      0|#endif
  170|      0|#if (ZSTD_LEGACY_SUPPORT <= 6)
  171|  1.75k|        case 6 :
  ------------------
  |  Branch (171:9): [True: 1.75k, False: 2.49k]
  ------------------
  172|  1.75k|            {   size_t result;
  173|  1.75k|                ZSTDv06_DCtx* const zd = ZSTDv06_createDCtx();
  174|  1.75k|                if (zd==NULL) return ERROR(memory_allocation);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (174:21): [True: 0, False: 1.75k]
  ------------------
  175|  1.75k|                result = ZSTDv06_decompress_usingDict(zd, dst, dstCapacity, src, compressedSize, dict, dictSize);
  176|  1.75k|                ZSTDv06_freeDCtx(zd);
  177|  1.75k|                return result;
  178|  1.75k|            }
  179|      0|#endif
  180|      0|#if (ZSTD_LEGACY_SUPPORT <= 7)
  181|  1.01k|        case 7 :
  ------------------
  |  Branch (181:9): [True: 1.01k, False: 3.23k]
  ------------------
  182|  1.01k|            {   size_t result;
  183|  1.01k|                ZSTDv07_DCtx* const zd = ZSTDv07_createDCtx();
  184|  1.01k|                if (zd==NULL) return ERROR(memory_allocation);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (184:21): [True: 0, False: 1.01k]
  ------------------
  185|  1.01k|                result = ZSTDv07_decompress_usingDict(zd, dst, dstCapacity, src, compressedSize, dict, dictSize);
  186|  1.01k|                ZSTDv07_freeDCtx(zd);
  187|  1.01k|                return result;
  188|  1.01k|            }
  189|      0|#endif
  190|      0|        default :
  ------------------
  |  Branch (190:9): [True: 0, False: 4.25k]
  ------------------
  191|      0|            return ERROR(prefix_unknown);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|  4.25k|    }
  193|  4.25k|}

FSEv05_buildDTable:
 1158|  1.27k|{
 1159|  1.27k|    FSEv05_DTableHeader DTableH;
 1160|  1.27k|    void* const tdPtr = dt+1;   /* because dt is unsigned, 32-bits aligned on 32-bits */
 1161|  1.27k|    FSEv05_DECODE_TYPE* const tableDecode = (FSEv05_DECODE_TYPE*) (tdPtr);
  ------------------
  |  | 1056|  1.27k|#define FSEv05_DECODE_TYPE FSEv05_decode_t
  ------------------
 1162|  1.27k|    const U32 tableSize = 1 << tableLog;
 1163|  1.27k|    const U32 tableMask = tableSize-1;
 1164|  1.27k|    const U32 step = FSEv05_tableStep(tableSize);
 1165|  1.27k|    U16 symbolNext[FSEv05_MAX_SYMBOL_VALUE+1];
 1166|  1.27k|    U32 position = 0;
 1167|  1.27k|    U32 highThreshold = tableSize-1;
 1168|  1.27k|    const S16 largeLimit= (S16)(1 << (tableLog-1));
 1169|  1.27k|    U32 noLarge = 1;
 1170|  1.27k|    U32 s;
 1171|       |
 1172|       |    /* Sanity Checks */
 1173|  1.27k|    if (maxSymbolValue > FSEv05_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  | 1048|  1.27k|#define FSEv05_MAX_SYMBOL_VALUE 255
  ------------------
                  if (maxSymbolValue > FSEv05_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1173:9): [True: 0, False: 1.27k]
  ------------------
 1174|  1.27k|    if (tableLog > FSEv05_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1094|  1.27k|#define FSEv05_MAX_TABLELOG  (FSEv05_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1042|  1.27k|#define FSEv05_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
                  if (tableLog > FSEv05_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1174:9): [True: 10, False: 1.26k]
  ------------------
 1175|       |
 1176|       |    /* Init, lay down lowprob symbols */
 1177|  1.26k|    memset(tableDecode, 0, sizeof(FSEv05_FUNCTION_TYPE) * (maxSymbolValue+1) );   /* useless init, but keep static analyzer happy, and we don't need to performance optimize legacy decoders */
 1178|  1.26k|    DTableH.tableLog = (U16)tableLog;
 1179|  23.4k|    for (s=0; s<=maxSymbolValue; s++) {
  ------------------
  |  Branch (1179:15): [True: 22.1k, False: 1.26k]
  ------------------
 1180|  22.1k|        if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (1180:13): [True: 6.08k, False: 16.0k]
  ------------------
 1181|  6.08k|            tableDecode[highThreshold--].symbol = (FSEv05_FUNCTION_TYPE)s;
 1182|  6.08k|            symbolNext[s] = 1;
 1183|  16.0k|        } else {
 1184|  16.0k|            if (normalizedCounter[s] >= largeLimit) noLarge=0;
  ------------------
  |  Branch (1184:17): [True: 733, False: 15.3k]
  ------------------
 1185|  16.0k|            symbolNext[s] = normalizedCounter[s];
 1186|  16.0k|    }   }
 1187|       |
 1188|       |    /* Spread symbols */
 1189|  23.4k|    for (s=0; s<=maxSymbolValue; s++) {
  ------------------
  |  Branch (1189:15): [True: 22.1k, False: 1.26k]
  ------------------
 1190|  22.1k|        int i;
 1191|   494k|        for (i=0; i<normalizedCounter[s]; i++) {
  ------------------
  |  Branch (1191:19): [True: 472k, False: 22.1k]
  ------------------
 1192|   472k|            tableDecode[position].symbol = (FSEv05_FUNCTION_TYPE)s;
 1193|   472k|            position = (position + step) & tableMask;
 1194|   478k|            while (position > highThreshold) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  Branch (1194:20): [True: 6.08k, False: 472k]
  ------------------
 1195|   472k|    }   }
 1196|       |
 1197|  1.26k|    if (position!=0) return ERROR(GENERIC);   /* position must reach all cells once, otherwise normalizedCounter is incorrect */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1197:9): [True: 0, False: 1.26k]
  ------------------
 1198|       |
 1199|       |    /* Build Decoding table */
 1200|  1.26k|    {
 1201|  1.26k|        U32 i;
 1202|   479k|        for (i=0; i<tableSize; i++) {
  ------------------
  |  Branch (1202:19): [True: 478k, False: 1.26k]
  ------------------
 1203|   478k|            FSEv05_FUNCTION_TYPE symbol = (FSEv05_FUNCTION_TYPE)(tableDecode[i].symbol);
  ------------------
  |  | 1054|   478k|#define FSEv05_FUNCTION_TYPE BYTE
  ------------------
 1204|   478k|            U16 nextState = symbolNext[symbol]++;
 1205|   478k|            tableDecode[i].nbBits = (BYTE) (tableLog - BITv05_highbit32 ((U32)nextState) );
 1206|   478k|            tableDecode[i].newState = (U16) ( (nextState << tableDecode[i].nbBits) - tableSize);
 1207|   478k|    }   }
 1208|       |
 1209|  1.26k|    DTableH.fastMode = (U16)noLarge;
 1210|  1.26k|    memcpy(dt, &DTableH, sizeof(DTableH));
 1211|  1.26k|    return 0;
 1212|  1.26k|}
FSEv05_isError:
 1219|  3.68k|unsigned FSEv05_isError(size_t code) { return ERR_isError(code); }
FSEv05_readNCount:
 1232|  1.46k|{
 1233|  1.46k|    const BYTE* const istart = (const BYTE*) headerBuffer;
 1234|  1.46k|    const BYTE* const iend = istart + hbSize;
 1235|  1.46k|    const BYTE* ip = istart;
 1236|  1.46k|    int nbBits;
 1237|  1.46k|    int remaining;
 1238|  1.46k|    int threshold;
 1239|  1.46k|    U32 bitStream;
 1240|  1.46k|    int bitCount;
 1241|  1.46k|    unsigned charnum = 0;
 1242|  1.46k|    int previous0 = 0;
 1243|       |
 1244|  1.46k|    if (hbSize < 4) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     15|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     15|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     15|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1244:9): [True: 15, False: 1.44k]
  ------------------
 1245|  1.44k|    bitStream = MEM_readLE32(ip);
 1246|  1.44k|    nbBits = (bitStream & 0xF) + FSEv05_MIN_TABLELOG;   /* extract tableLog */
  ------------------
  |  | 1098|  1.44k|#define FSEv05_MIN_TABLELOG 5
  ------------------
 1247|  1.44k|    if (nbBits > FSEv05_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1100|  1.44k|#define FSEv05_TABLELOG_ABSOLUTE_MAX 15
  ------------------
                  if (nbBits > FSEv05_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|     41|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     41|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     41|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1247:9): [True: 41, False: 1.40k]
  ------------------
 1248|  1.40k|    bitStream >>= 4;
 1249|  1.40k|    bitCount = 4;
 1250|  1.40k|    *tableLogPtr = nbBits;
 1251|  1.40k|    remaining = (1<<nbBits)+1;
 1252|  1.40k|    threshold = 1<<nbBits;
 1253|  1.40k|    nbBits++;
 1254|       |
 1255|  21.2k|    while ((remaining>1) && (charnum<=*maxSVPtr)) {
  ------------------
  |  Branch (1255:12): [True: 19.9k, False: 1.36k]
  |  Branch (1255:29): [True: 19.8k, False: 22]
  ------------------
 1256|  19.8k|        if (previous0) {
  ------------------
  |  Branch (1256:13): [True: 2.96k, False: 16.9k]
  ------------------
 1257|  2.96k|            unsigned n0 = charnum;
 1258|  3.09k|            while ((bitStream & 0xFFFF) == 0xFFFF) {
  ------------------
  |  Branch (1258:20): [True: 129, False: 2.96k]
  ------------------
 1259|    129|                n0+=24;
 1260|    129|                if (ip < iend-5) {
  ------------------
  |  Branch (1260:21): [True: 121, False: 8]
  ------------------
 1261|    121|                    ip+=2;
 1262|    121|                    bitStream = MEM_readLE32(ip) >> bitCount;
 1263|    121|                } else {
 1264|      8|                    bitStream >>= 16;
 1265|      8|                    bitCount+=16;
 1266|      8|            }   }
 1267|  4.93k|            while ((bitStream & 3) == 3) {
  ------------------
  |  Branch (1267:20): [True: 1.96k, False: 2.96k]
  ------------------
 1268|  1.96k|                n0+=3;
 1269|  1.96k|                bitStream>>=2;
 1270|  1.96k|                bitCount+=2;
 1271|  1.96k|            }
 1272|  2.96k|            n0 += bitStream & 3;
 1273|  2.96k|            bitCount += 2;
 1274|  2.96k|            if (n0 > *maxSVPtr) return ERROR(maxSymbolValue_tooSmall);
  ------------------
  |  |   49|     19|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     19|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     19|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1274:17): [True: 19, False: 2.94k]
  ------------------
 1275|  12.6k|            while (charnum < n0) normalizedCounter[charnum++] = 0;
  ------------------
  |  Branch (1275:20): [True: 9.67k, False: 2.94k]
  ------------------
 1276|  2.94k|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1276:17): [True: 2.00k, False: 944]
  |  Branch (1276:35): [True: 105, False: 839]
  ------------------
 1277|  2.10k|                ip += bitCount>>3;
 1278|  2.10k|                bitCount &= 7;
 1279|  2.10k|                bitStream = MEM_readLE32(ip) >> bitCount;
 1280|  2.10k|            }
 1281|    839|            else
 1282|    839|                bitStream >>= 2;
 1283|  2.94k|        }
 1284|  19.8k|        {
 1285|  19.8k|            const short max = (short)((2*threshold-1)-remaining);
 1286|  19.8k|            short count;
 1287|       |
 1288|  19.8k|            if ((bitStream & (threshold-1)) < (U32)max) {
  ------------------
  |  Branch (1288:17): [True: 15.2k, False: 4.59k]
  ------------------
 1289|  15.2k|                count = (short)(bitStream & (threshold-1));
 1290|  15.2k|                bitCount   += nbBits-1;
 1291|  15.2k|            } else {
 1292|  4.59k|                count = (short)(bitStream & (2*threshold-1));
 1293|  4.59k|                if (count >= threshold) count -= max;
  ------------------
  |  Branch (1293:21): [True: 2.04k, False: 2.55k]
  ------------------
 1294|  4.59k|                bitCount   += nbBits;
 1295|  4.59k|            }
 1296|       |
 1297|  19.8k|            count--;   /* extra accuracy */
 1298|  19.8k|            remaining -= FSEv05_abs(count);
 1299|  19.8k|            normalizedCounter[charnum++] = count;
 1300|  19.8k|            previous0 = !count;
 1301|  29.7k|            while (remaining < threshold) {
  ------------------
  |  Branch (1301:20): [True: 9.90k, False: 19.8k]
  ------------------
 1302|  9.90k|                nbBits--;
 1303|  9.90k|                threshold >>= 1;
 1304|  9.90k|            }
 1305|       |
 1306|  19.8k|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1306:17): [True: 13.8k, False: 6.00k]
  |  Branch (1306:35): [True: 952, False: 5.05k]
  ------------------
 1307|  14.8k|                ip += bitCount>>3;
 1308|  14.8k|                bitCount &= 7;
 1309|  14.8k|            } else {
 1310|  5.05k|                bitCount -= (int)(8 * (iend - 4 - ip));
 1311|  5.05k|                ip = iend - 4;
 1312|  5.05k|            }
 1313|  19.8k|            bitStream = MEM_readLE32(ip) >> (bitCount & 31);
 1314|  19.8k|    }   }
 1315|  1.38k|    if (remaining != 1) return ERROR(GENERIC);
  ------------------
  |  |   49|     22|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     22|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     22|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1315:9): [True: 22, False: 1.36k]
  ------------------
 1316|  1.36k|    *maxSVPtr = charnum-1;
 1317|       |
 1318|  1.36k|    ip += (bitCount+7)>>3;
 1319|  1.36k|    if ((size_t)(ip-istart) > hbSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     25|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     25|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     25|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1319:9): [True: 25, False: 1.34k]
  ------------------
 1320|  1.34k|    return ip-istart;
 1321|  1.36k|}
FSEv05_buildDTable_rle:
 1329|    245|{
 1330|    245|    void* ptr = dt;
 1331|    245|    FSEv05_DTableHeader* const DTableH = (FSEv05_DTableHeader*)ptr;
 1332|    245|    void* dPtr = dt + 1;
 1333|    245|    FSEv05_decode_t* const cell = (FSEv05_decode_t*)dPtr;
 1334|       |
 1335|    245|    DTableH->tableLog = 0;
 1336|    245|    DTableH->fastMode = 0;
 1337|       |
 1338|    245|    cell->newState = 0;
 1339|    245|    cell->symbol = symbolValue;
 1340|    245|    cell->nbBits = 0;
 1341|       |
 1342|    245|    return 0;
 1343|    245|}
FSEv05_buildDTable_raw:
 1347|    406|{
 1348|    406|    void* ptr = dt;
 1349|    406|    FSEv05_DTableHeader* const DTableH = (FSEv05_DTableHeader*)ptr;
 1350|    406|    void* dPtr = dt + 1;
 1351|    406|    FSEv05_decode_t* const dinfo = (FSEv05_decode_t*)dPtr;
 1352|    406|    const unsigned tableSize = 1 << nbBits;
 1353|    406|    const unsigned tableMask = tableSize - 1;
 1354|    406|    const unsigned maxSymbolValue = tableMask;
 1355|    406|    unsigned s;
 1356|       |
 1357|       |    /* Sanity checks */
 1358|    406|    if (nbBits < 1) return ERROR(GENERIC);         /* min size */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1358:9): [True: 0, False: 406]
  ------------------
 1359|       |
 1360|       |    /* Build Decoding Table */
 1361|    406|    DTableH->tableLog = (U16)nbBits;
 1362|    406|    DTableH->fastMode = 1;
 1363|  36.0k|    for (s=0; s<=maxSymbolValue; s++) {
  ------------------
  |  Branch (1363:15): [True: 35.6k, False: 406]
  ------------------
 1364|  35.6k|        dinfo[s].newState = 0;
 1365|  35.6k|        dinfo[s].symbol = (BYTE)s;
 1366|  35.6k|        dinfo[s].nbBits = (BYTE)nbBits;
 1367|  35.6k|    }
 1368|       |
 1369|    406|    return 0;
 1370|    406|}
FSEv05_decompress_usingDTable:
 1443|    596|{
 1444|    596|    const void* ptr = dt;
 1445|    596|    const FSEv05_DTableHeader* DTableH = (const FSEv05_DTableHeader*)ptr;
 1446|    596|    const U32 fastMode = DTableH->fastMode;
 1447|       |
 1448|       |    /* select fast mode (static) */
 1449|    596|    if (fastMode) return FSEv05_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 1);
  ------------------
  |  Branch (1449:9): [True: 334, False: 262]
  ------------------
 1450|    262|    return FSEv05_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 0);
 1451|    596|}
FSEv05_decompress:
 1455|    663|{
 1456|    663|    const BYTE* const istart = (const BYTE*)cSrc;
 1457|    663|    const BYTE* ip = istart;
 1458|    663|    short counting[FSEv05_MAX_SYMBOL_VALUE+1];
 1459|    663|    DTable_max_t dt;   /* Static analyzer seems unable to understand this table will be properly initialized later */
 1460|    663|    unsigned tableLog;
 1461|    663|    unsigned maxSymbolValue = FSEv05_MAX_SYMBOL_VALUE;
  ------------------
  |  | 1048|    663|#define FSEv05_MAX_SYMBOL_VALUE 255
  ------------------
 1462|    663|    size_t errorCode;
 1463|       |
 1464|    663|    if (cSrcSize<2) return ERROR(srcSize_wrong);   /* too small input size */
  ------------------
  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1464:9): [True: 10, False: 653]
  ------------------
 1465|       |
 1466|       |    /* normal FSEv05 decoding mode */
 1467|    653|    errorCode = FSEv05_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize);
 1468|    653|    if (FSEv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1468:9): [True: 37, False: 616]
  ------------------
 1469|    616|    if (errorCode >= cSrcSize) return ERROR(srcSize_wrong);   /* too small input size */
  ------------------
  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1469:9): [True: 10, False: 606]
  ------------------
 1470|    606|    ip += errorCode;
 1471|    606|    cSrcSize -= errorCode;
 1472|       |
 1473|    606|    errorCode = FSEv05_buildDTable (dt, counting, maxSymbolValue, tableLog);
 1474|    606|    if (FSEv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1474:9): [True: 10, False: 596]
  ------------------
 1475|       |
 1476|       |    /* always return, even if it is an error code */
 1477|    596|    return FSEv05_decompress_usingDTable (dst, maxDstSize, ip, cSrcSize, dt);
 1478|    606|}
HUFv05_isError:
 1723|  2.95k|unsigned HUFv05_isError(size_t code) { return ERR_isError(code); }
HUFv05_readDTableX2:
 1818|    263|{
 1819|    263|    BYTE huffWeight[HUFv05_MAX_SYMBOL_VALUE + 1];
 1820|    263|    U32 rankVal[HUFv05_ABSOLUTEMAX_TABLELOG + 1];   /* large enough for values from 0 to 16 */
 1821|    263|    U32 tableLog = 0;
 1822|    263|    size_t iSize;
 1823|    263|    U32 nbSymbols = 0;
 1824|    263|    U32 n;
 1825|    263|    U32 nextRankStart;
 1826|    263|    void* const dtPtr = DTable + 1;
 1827|    263|    HUFv05_DEltX2* const dt = (HUFv05_DEltX2*)dtPtr;
 1828|       |
 1829|    263|    HUFv05_STATIC_ASSERT(sizeof(HUFv05_DEltX2) == sizeof(U16));   /* if compilation fails here, assertion is false */
  ------------------
  |  | 1725|    263|#define HUFv05_STATIC_ASSERT(c) { enum { HUFv05_static_assert = 1/(int)(!!(c)) }; }   /* use only *after* variable declarations */
  ------------------
 1830|       |    /* memset(huffWeight, 0, sizeof(huffWeight)); */   /* is not necessary, even though some analyzer complain ... */
 1831|       |
 1832|    263|    iSize = HUFv05_readStats(huffWeight, HUFv05_MAX_SYMBOL_VALUE + 1, rankVal, &nbSymbols, &tableLog, src, srcSize);
  ------------------
  |  | 1714|    263|#define HUFv05_MAX_SYMBOL_VALUE 255
  ------------------
 1833|    263|    if (HUFv05_isError(iSize)) return iSize;
  ------------------
  |  Branch (1833:9): [True: 47, False: 216]
  ------------------
 1834|       |
 1835|       |    /* check result */
 1836|    216|    if (tableLog > DTable[0]) return ERROR(tableLog_tooLarge);   /* DTable is too small */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1836:9): [True: 0, False: 216]
  ------------------
 1837|    216|    DTable[0] = (U16)tableLog;   /* maybe should separate sizeof allocated DTable, from used size of DTable, in case of re-use */
 1838|       |
 1839|       |    /* Prepare ranks */
 1840|    216|    nextRankStart = 0;
 1841|  1.26k|    for (n=1; n<=tableLog; n++) {
  ------------------
  |  Branch (1841:15): [True: 1.04k, False: 216]
  ------------------
 1842|  1.04k|        U32 current = nextRankStart;
 1843|  1.04k|        nextRankStart += (rankVal[n] << (n-1));
 1844|  1.04k|        rankVal[n] = current;
 1845|  1.04k|    }
 1846|       |
 1847|       |    /* fill DTable */
 1848|  9.87k|    for (n=0; n<nbSymbols; n++) {
  ------------------
  |  Branch (1848:15): [True: 9.65k, False: 216]
  ------------------
 1849|  9.65k|        const U32 w = huffWeight[n];
 1850|  9.65k|        const U32 length = (1 << w) >> 1;
 1851|  9.65k|        U32 i;
 1852|  9.65k|        HUFv05_DEltX2 D;
 1853|  9.65k|        D.byte = (BYTE)n; D.nbBits = (BYTE)(tableLog + 1 - w);
 1854|  24.5k|        for (i = rankVal[w]; i < rankVal[w] + length; i++)
  ------------------
  |  Branch (1854:30): [True: 14.9k, False: 9.65k]
  ------------------
 1855|  14.9k|            dt[i] = D;
 1856|  9.65k|        rankVal[w] += length;
 1857|  9.65k|    }
 1858|       |
 1859|    216|    return iSize;
 1860|    216|}
HUFv05_decompress1X2_usingDTable:
 1908|     71|{
 1909|     71|    BYTE* op = (BYTE*)dst;
 1910|     71|    BYTE* const oend = op + dstSize;
 1911|     71|    const U32 dtLog = DTable[0];
 1912|     71|    const void* dtPtr = DTable;
 1913|     71|    const HUFv05_DEltX2* const dt = ((const HUFv05_DEltX2*)dtPtr)+1;
 1914|     71|    BITv05_DStream_t bitD;
 1915|       |
 1916|     71|    if (dstSize <= cSrcSize) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1916:9): [True: 1, False: 70]
  ------------------
 1917|     70|    { size_t const errorCode = BITv05_initDStream(&bitD, cSrc, cSrcSize);
 1918|     70|      if (HUFv05_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1918:11): [True: 16, False: 54]
  ------------------
 1919|       |
 1920|     54|    HUFv05_decodeStreamX2(op, &bitD, oend, dt, dtLog);
 1921|       |
 1922|       |    /* check */
 1923|     54|    if (!BITv05_endOfDStream(&bitD)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     53|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     53|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     53|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1923:9): [True: 53, False: 1]
  ------------------
 1924|       |
 1925|      1|    return dstSize;
 1926|     54|}
HUFv05_decompress1X2:
 1929|     79|{
 1930|     79|    HUFv05_CREATE_STATIC_DTABLEX2(DTable, HUFv05_MAX_TABLELOG);
  ------------------
  |  | 1604|     79|        unsigned short DTable[HUFv05_DTABLE_SIZE(maxTableLog)] = { maxTableLog }
  ------------------
 1931|     79|    const BYTE* ip = (const BYTE*) cSrc;
 1932|     79|    size_t errorCode;
 1933|       |
 1934|     79|    errorCode = HUFv05_readDTableX2 (DTable, cSrc, cSrcSize);
 1935|     79|    if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1935:9): [True: 7, False: 72]
  ------------------
 1936|     72|    if (errorCode >= cSrcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1936:9): [True: 1, False: 71]
  ------------------
 1937|     71|    ip += errorCode;
 1938|     71|    cSrcSize -= errorCode;
 1939|       |
 1940|     71|    return HUFv05_decompress1X2_usingDTable (dst, dstSize, ip, cSrcSize, DTable);
 1941|     72|}
HUFv05_decompress4X2_usingDTable:
 1948|    143|{
 1949|       |    /* Check */
 1950|    143|    if (cSrcSize < 10) return ERROR(corruption_detected);   /* strict minimum : jump table + 1 byte per stream */
  ------------------
  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1950:9): [True: 4, False: 139]
  ------------------
 1951|    139|    {
 1952|    139|        const BYTE* const istart = (const BYTE*) cSrc;
 1953|    139|        BYTE* const ostart = (BYTE*) dst;
 1954|    139|        BYTE* const oend = ostart + dstSize;
 1955|    139|        const void* const dtPtr = DTable;
 1956|    139|        const HUFv05_DEltX2* const dt = ((const HUFv05_DEltX2*)dtPtr) +1;
 1957|    139|        const U32 dtLog = DTable[0];
 1958|    139|        size_t errorCode;
 1959|       |
 1960|       |        /* Init */
 1961|    139|        BITv05_DStream_t bitD1;
 1962|    139|        BITv05_DStream_t bitD2;
 1963|    139|        BITv05_DStream_t bitD3;
 1964|    139|        BITv05_DStream_t bitD4;
 1965|    139|        const size_t length1 = MEM_readLE16(istart);
 1966|    139|        const size_t length2 = MEM_readLE16(istart+2);
 1967|    139|        const size_t length3 = MEM_readLE16(istart+4);
 1968|    139|        size_t length4;
 1969|    139|        const BYTE* const istart1 = istart + 6;  /* jumpTable */
 1970|    139|        const BYTE* const istart2 = istart1 + length1;
 1971|    139|        const BYTE* const istart3 = istart2 + length2;
 1972|    139|        const BYTE* const istart4 = istart3 + length3;
 1973|    139|        const size_t segmentSize = (dstSize+3) / 4;
 1974|    139|        BYTE* const opStart2 = ostart + segmentSize;
 1975|    139|        BYTE* const opStart3 = opStart2 + segmentSize;
 1976|    139|        BYTE* const opStart4 = opStart3 + segmentSize;
 1977|    139|        BYTE* op1 = ostart;
 1978|    139|        BYTE* op2 = opStart2;
 1979|    139|        BYTE* op3 = opStart3;
 1980|    139|        BYTE* op4 = opStart4;
 1981|    139|        U32 endSignal;
 1982|       |
 1983|    139|        length4 = cSrcSize - (length1 + length2 + length3 + 6);
 1984|    139|        if (length4 > cSrcSize) return ERROR(corruption_detected);   /* overflow */
  ------------------
  |  |   49|     13|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     13|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     13|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1984:13): [True: 13, False: 126]
  ------------------
 1985|    126|        errorCode = BITv05_initDStream(&bitD1, istart1, length1);
 1986|    126|        if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1986:13): [True: 11, False: 115]
  ------------------
 1987|    115|        errorCode = BITv05_initDStream(&bitD2, istart2, length2);
 1988|    115|        if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1988:13): [True: 13, False: 102]
  ------------------
 1989|    102|        errorCode = BITv05_initDStream(&bitD3, istart3, length3);
 1990|    102|        if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1990:13): [True: 23, False: 79]
  ------------------
 1991|     79|        errorCode = BITv05_initDStream(&bitD4, istart4, length4);
 1992|     79|        if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1992:13): [True: 4, False: 75]
  ------------------
 1993|       |
 1994|       |        /* 16-32 symbols per loop (4-8 symbols per stream) */
 1995|     75|        endSignal = BITv05_reloadDStream(&bitD1) | BITv05_reloadDStream(&bitD2) | BITv05_reloadDStream(&bitD3) | BITv05_reloadDStream(&bitD4);
 1996|    530|        for ( ; (endSignal==BITv05_DStream_unfinished) && (op4<(oend-7)) ; ) {
  ------------------
  |  Branch (1996:17): [True: 460, False: 70]
  |  Branch (1996:59): [True: 455, False: 5]
  ------------------
 1997|    455|            HUFv05_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 1878|    455|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 455, False: 0]
  |  |  ------------------
  |  | 1879|    455|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    455|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1998|    455|            HUFv05_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 1878|    455|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 455, False: 0]
  |  |  ------------------
  |  | 1879|    455|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    455|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1999|    455|            HUFv05_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 1878|    455|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 455, False: 0]
  |  |  ------------------
  |  | 1879|    455|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    455|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2000|    455|            HUFv05_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 1878|    455|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 455, False: 0]
  |  |  ------------------
  |  | 1879|    455|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    455|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2001|    455|            HUFv05_DECODE_SYMBOLX2_1(op1, &bitD1);
  ------------------
  |  | 1874|    455|    if (MEM_64bits() || (HUFv05_MAX_TABLELOG<=12)) \
  |  |  ------------------
  |  |  |  | 1712|      0|#define HUFv05_MAX_TABLELOG  12           /* max configured tableLog (for static allocation); can be modified up to HUFv05_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (1874:9): [True: 455, False: 0]
  |  |  |  Branch (1874:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1875|    455|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    455|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2002|    455|            HUFv05_DECODE_SYMBOLX2_1(op2, &bitD2);
  ------------------
  |  | 1874|    455|    if (MEM_64bits() || (HUFv05_MAX_TABLELOG<=12)) \
  |  |  ------------------
  |  |  |  | 1712|      0|#define HUFv05_MAX_TABLELOG  12           /* max configured tableLog (for static allocation); can be modified up to HUFv05_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (1874:9): [True: 455, False: 0]
  |  |  |  Branch (1874:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1875|    455|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    455|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2003|    455|            HUFv05_DECODE_SYMBOLX2_1(op3, &bitD3);
  ------------------
  |  | 1874|    455|    if (MEM_64bits() || (HUFv05_MAX_TABLELOG<=12)) \
  |  |  ------------------
  |  |  |  | 1712|      0|#define HUFv05_MAX_TABLELOG  12           /* max configured tableLog (for static allocation); can be modified up to HUFv05_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (1874:9): [True: 455, False: 0]
  |  |  |  Branch (1874:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1875|    455|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    455|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2004|    455|            HUFv05_DECODE_SYMBOLX2_1(op4, &bitD4);
  ------------------
  |  | 1874|    455|    if (MEM_64bits() || (HUFv05_MAX_TABLELOG<=12)) \
  |  |  ------------------
  |  |  |  | 1712|      0|#define HUFv05_MAX_TABLELOG  12           /* max configured tableLog (for static allocation); can be modified up to HUFv05_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (1874:9): [True: 455, False: 0]
  |  |  |  Branch (1874:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1875|    455|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    455|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2005|    455|            HUFv05_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 1878|    455|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 455, False: 0]
  |  |  ------------------
  |  | 1879|    455|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    455|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2006|    455|            HUFv05_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 1878|    455|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 455, False: 0]
  |  |  ------------------
  |  | 1879|    455|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    455|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2007|    455|            HUFv05_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 1878|    455|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 455, False: 0]
  |  |  ------------------
  |  | 1879|    455|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    455|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2008|    455|            HUFv05_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 1878|    455|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 455, False: 0]
  |  |  ------------------
  |  | 1879|    455|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    455|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2009|    455|            HUFv05_DECODE_SYMBOLX2_0(op1, &bitD1);
  ------------------
  |  | 1871|    455|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2010|    455|            HUFv05_DECODE_SYMBOLX2_0(op2, &bitD2);
  ------------------
  |  | 1871|    455|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2011|    455|            HUFv05_DECODE_SYMBOLX2_0(op3, &bitD3);
  ------------------
  |  | 1871|    455|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2012|    455|            HUFv05_DECODE_SYMBOLX2_0(op4, &bitD4);
  ------------------
  |  | 1871|    455|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2013|    455|            endSignal = BITv05_reloadDStream(&bitD1) | BITv05_reloadDStream(&bitD2) | BITv05_reloadDStream(&bitD3) | BITv05_reloadDStream(&bitD4);
 2014|    455|        }
 2015|       |
 2016|       |        /* check corruption */
 2017|     75|        if (op1 > opStart2) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2017:13): [True: 0, False: 75]
  ------------------
 2018|     75|        if (op2 > opStart3) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2018:13): [True: 0, False: 75]
  ------------------
 2019|     75|        if (op3 > opStart4) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2019:13): [True: 0, False: 75]
  ------------------
 2020|       |        /* note : op4 supposed already verified within main loop */
 2021|       |
 2022|       |        /* finish bitStreams one by one */
 2023|     75|        HUFv05_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog);
 2024|     75|        HUFv05_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog);
 2025|     75|        HUFv05_decodeStreamX2(op3, &bitD3, opStart4, dt, dtLog);
 2026|     75|        HUFv05_decodeStreamX2(op4, &bitD4, oend,     dt, dtLog);
 2027|       |
 2028|       |        /* check */
 2029|     75|        endSignal = BITv05_endOfDStream(&bitD1) & BITv05_endOfDStream(&bitD2) & BITv05_endOfDStream(&bitD3) & BITv05_endOfDStream(&bitD4);
 2030|     75|        if (!endSignal) return ERROR(corruption_detected);
  ------------------
  |  |   49|     75|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     75|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     75|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2030:13): [True: 75, False: 0]
  ------------------
 2031|       |
 2032|       |        /* decoded size */
 2033|      0|        return dstSize;
 2034|     75|    }
 2035|     75|}
HUFv05_decompress4X2:
 2039|    184|{
 2040|    184|    HUFv05_CREATE_STATIC_DTABLEX2(DTable, HUFv05_MAX_TABLELOG);
  ------------------
  |  | 1604|    184|        unsigned short DTable[HUFv05_DTABLE_SIZE(maxTableLog)] = { maxTableLog }
  ------------------
 2041|    184|    const BYTE* ip = (const BYTE*) cSrc;
 2042|    184|    size_t errorCode;
 2043|       |
 2044|    184|    errorCode = HUFv05_readDTableX2 (DTable, cSrc, cSrcSize);
 2045|    184|    if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2045:9): [True: 40, False: 144]
  ------------------
 2046|    144|    if (errorCode >= cSrcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2046:9): [True: 1, False: 143]
  ------------------
 2047|    143|    ip += errorCode;
 2048|    143|    cSrcSize -= errorCode;
 2049|       |
 2050|    143|    return HUFv05_decompress4X2_usingDTable (dst, dstSize, ip, cSrcSize, DTable);
 2051|    144|}
HUFv05_readDTableX4:
 2146|    760|{
 2147|    760|    BYTE weightList[HUFv05_MAX_SYMBOL_VALUE + 1];
 2148|    760|    sortedSymbol_t sortedSymbol[HUFv05_MAX_SYMBOL_VALUE + 1];
 2149|    760|    U32 rankStats[HUFv05_ABSOLUTEMAX_TABLELOG + 1] = { 0 };
 2150|    760|    U32 rankStart0[HUFv05_ABSOLUTEMAX_TABLELOG + 2] = { 0 };
 2151|    760|    U32* const rankStart = rankStart0+1;
 2152|    760|    rankVal_t rankVal;
 2153|    760|    U32 tableLog, maxW, sizeOfSort, nbSymbols;
 2154|    760|    const U32 memLog = DTable[0];
 2155|    760|    size_t iSize;
 2156|    760|    void* dtPtr = DTable;
 2157|    760|    HUFv05_DEltX4* const dt = ((HUFv05_DEltX4*)dtPtr) + 1;
 2158|       |
 2159|    760|    HUFv05_STATIC_ASSERT(sizeof(HUFv05_DEltX4) == sizeof(unsigned));   /* if compilation fails here, assertion is false */
  ------------------
  |  | 1725|    760|#define HUFv05_STATIC_ASSERT(c) { enum { HUFv05_static_assert = 1/(int)(!!(c)) }; }   /* use only *after* variable declarations */
  ------------------
 2160|    760|    if (memLog > HUFv05_ABSOLUTEMAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1711|    760|#define HUFv05_ABSOLUTEMAX_TABLELOG  16   /* absolute limit of HUFv05_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
                  if (memLog > HUFv05_ABSOLUTEMAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2160:9): [True: 0, False: 760]
  ------------------
 2161|       |    /* memset(weightList, 0, sizeof(weightList)); */   /* is not necessary, even though some analyzer complain ... */
 2162|       |
 2163|    760|    iSize = HUFv05_readStats(weightList, HUFv05_MAX_SYMBOL_VALUE + 1, rankStats, &nbSymbols, &tableLog, src, srcSize);
  ------------------
  |  | 1714|    760|#define HUFv05_MAX_SYMBOL_VALUE 255
  ------------------
 2164|    760|    if (HUFv05_isError(iSize)) return iSize;
  ------------------
  |  Branch (2164:9): [True: 548, False: 212]
  ------------------
 2165|       |
 2166|       |    /* check result */
 2167|    212|    if (tableLog > memLog) return ERROR(tableLog_tooLarge);   /* DTable can't fit code depth */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2167:9): [True: 0, False: 212]
  ------------------
 2168|       |
 2169|       |    /* find maxWeight */
 2170|    651|    for (maxW = tableLog; rankStats[maxW]==0; maxW--) {}  /* necessarily finds a solution before 0 */
  ------------------
  |  Branch (2170:27): [True: 439, False: 212]
  ------------------
 2171|       |
 2172|       |    /* Get start index of each weight */
 2173|    212|    {
 2174|    212|        U32 w, nextRankStart = 0;
 2175|  1.23k|        for (w=1; w<=maxW; w++) {
  ------------------
  |  Branch (2175:19): [True: 1.02k, False: 212]
  ------------------
 2176|  1.02k|            U32 current = nextRankStart;
 2177|  1.02k|            nextRankStart += rankStats[w];
 2178|  1.02k|            rankStart[w] = current;
 2179|  1.02k|        }
 2180|    212|        rankStart[0] = nextRankStart;   /* put all 0w symbols at the end of sorted list*/
 2181|    212|        sizeOfSort = nextRankStart;
 2182|    212|    }
 2183|       |
 2184|       |    /* sort symbols by weight */
 2185|    212|    {
 2186|    212|        U32 s;
 2187|  21.8k|        for (s=0; s<nbSymbols; s++) {
  ------------------
  |  Branch (2187:19): [True: 21.6k, False: 212]
  ------------------
 2188|  21.6k|            U32 w = weightList[s];
 2189|  21.6k|            U32 r = rankStart[w]++;
 2190|  21.6k|            sortedSymbol[r].symbol = (BYTE)s;
 2191|  21.6k|            sortedSymbol[r].weight = (BYTE)w;
 2192|  21.6k|        }
 2193|    212|        rankStart[0] = 0;   /* forget 0w symbols; this is beginning of weight(1) */
 2194|    212|    }
 2195|       |
 2196|       |    /* Build rankVal */
 2197|    212|    {
 2198|    212|        const U32 minBits = tableLog+1 - maxW;
 2199|    212|        U32 nextRankVal = 0;
 2200|    212|        U32 w, consumed;
 2201|    212|        const int rescale = (memLog-tableLog) - 1;   /* tableLog <= memLog */
 2202|    212|        U32* rankVal0 = rankVal[0];
 2203|  1.23k|        for (w=1; w<=maxW; w++) {
  ------------------
  |  Branch (2203:19): [True: 1.02k, False: 212]
  ------------------
 2204|  1.02k|            U32 current = nextRankVal;
 2205|  1.02k|            nextRankVal += rankStats[w] << (w+rescale);
 2206|  1.02k|            rankVal0[w] = current;
 2207|  1.02k|        }
 2208|  1.70k|        for (consumed = minBits; consumed <= memLog - minBits; consumed++) {
  ------------------
  |  Branch (2208:34): [True: 1.49k, False: 212]
  ------------------
 2209|  1.49k|            U32* rankValPtr = rankVal[consumed];
 2210|  11.5k|            for (w = 1; w <= maxW; w++) {
  ------------------
  |  Branch (2210:25): [True: 10.1k, False: 1.49k]
  ------------------
 2211|  10.1k|                rankValPtr[w] = rankVal0[w] >> consumed;
 2212|  10.1k|    }   }   }
 2213|       |
 2214|    212|    HUFv05_fillDTableX4(dt, memLog,
 2215|    212|                   sortedSymbol, sizeOfSort,
 2216|    212|                   rankStart0, rankVal, maxW,
 2217|    212|                   tableLog+1);
 2218|       |
 2219|    212|    return iSize;
 2220|    212|}
HUFv05_decompress1X4_usingDTable:
 2287|     67|{
 2288|     67|    const BYTE* const istart = (const BYTE*) cSrc;
 2289|     67|    BYTE* const ostart = (BYTE*) dst;
 2290|     67|    BYTE* const oend = ostart + dstSize;
 2291|       |
 2292|     67|    const U32 dtLog = DTable[0];
 2293|     67|    const void* const dtPtr = DTable;
 2294|     67|    const HUFv05_DEltX4* const dt = ((const HUFv05_DEltX4*)dtPtr) +1;
 2295|     67|    size_t errorCode;
 2296|       |
 2297|       |    /* Init */
 2298|     67|    BITv05_DStream_t bitD;
 2299|     67|    errorCode = BITv05_initDStream(&bitD, istart, cSrcSize);
 2300|     67|    if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2300:9): [True: 8, False: 59]
  ------------------
 2301|       |
 2302|       |    /* finish bitStreams one by one */
 2303|     59|    HUFv05_decodeStreamX4(ostart, &bitD, oend,     dt, dtLog);
 2304|       |
 2305|       |    /* check */
 2306|     59|    if (!BITv05_endOfDStream(&bitD)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     58|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     58|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     58|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2306:9): [True: 58, False: 1]
  ------------------
 2307|       |
 2308|       |    /* decoded size */
 2309|      1|    return dstSize;
 2310|     59|}
HUFv05_decompress:
 2465|    201|{
 2466|    201|    static const decompressionAlgo decompress[3] = { HUFv05_decompress4X2, HUFv05_decompress4X4, NULL };
 2467|       |    /* estimate decompression time */
 2468|    201|    U32 Q;
 2469|    201|    const U32 D256 = (U32)(dstSize >> 8);
 2470|    201|    U32 Dtime[3];
 2471|    201|    U32 algoNb = 0;
 2472|    201|    int n;
 2473|       |
 2474|       |    /* validation checks */
 2475|    201|    if (dstSize == 0) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2475:9): [True: 2, False: 199]
  ------------------
 2476|    199|    if (cSrcSize >= dstSize) return ERROR(corruption_detected);   /* invalid, or not compressed, but not compressed already dealt with */
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2476:9): [True: 1, False: 198]
  ------------------
 2477|    198|    if (cSrcSize == 1) { memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; }   /* RLE */
  ------------------
  |  Branch (2477:9): [True: 14, False: 184]
  ------------------
 2478|       |
 2479|       |    /* decoder timing evaluation */
 2480|    184|    Q = (U32)(cSrcSize * 16 / dstSize);   /* Q < 16 since dstSize > cSrcSize */
 2481|    736|    for (n=0; n<3; n++)
  ------------------
  |  Branch (2481:15): [True: 552, False: 184]
  ------------------
 2482|    552|        Dtime[n] = algoTime[Q][n].tableTime + (algoTime[Q][n].decode256Time * D256);
 2483|       |
 2484|    184|    Dtime[1] += Dtime[1] >> 4; Dtime[2] += Dtime[2] >> 3; /* advantage to algorithms using less memory, for cache eviction */
 2485|       |
 2486|    184|    if (Dtime[1] < Dtime[0]) algoNb = 1;
  ------------------
  |  Branch (2486:9): [True: 0, False: 184]
  ------------------
 2487|       |
 2488|    184|    return decompress[algoNb](dst, dstSize, cSrc, cSrcSize);
 2489|       |
 2490|       |    /* return HUFv05_decompress4X2(dst, dstSize, cSrc, cSrcSize); */   /* multi-streams single-symbol decoding */
 2491|       |    /* return HUFv05_decompress4X4(dst, dstSize, cSrc, cSrcSize); */   /* multi-streams double-symbols decoding */
 2492|       |    /* return HUFv05_decompress4X6(dst, dstSize, cSrc, cSrcSize); */   /* multi-streams quad-symbols decoding */
 2493|    198|}
ZSTDv05_isError:
 2577|  41.6k|unsigned ZSTDv05_isError(size_t code) { return ERR_isError(code); }
ZSTDv05_decompressBegin:
 2617|  2.96k|{
 2618|  2.96k|    dctx->expected = ZSTDv05_frameHeaderSize_min;
 2619|  2.96k|    dctx->stage = ZSTDv05ds_getFrameHeaderSize;
 2620|  2.96k|    dctx->previousDstEnd = NULL;
 2621|  2.96k|    dctx->base = NULL;
 2622|  2.96k|    dctx->vBase = NULL;
 2623|  2.96k|    dctx->dictEnd = NULL;
 2624|  2.96k|    dctx->hufTableX4[0] = ZSTD_HUFFDTABLE_CAPACITY_LOG;
  ------------------
  |  |  436|  2.96k|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
 2625|  2.96k|    dctx->flagStaticTables = 0;
 2626|  2.96k|    return 0;
 2627|  2.96k|}
ZSTDv05_createDCtx:
 2630|  1.48k|{
 2631|  1.48k|    ZSTDv05_DCtx* dctx = (ZSTDv05_DCtx*)malloc(sizeof(ZSTDv05_DCtx));
 2632|  1.48k|    if (dctx==NULL) return NULL;
  ------------------
  |  Branch (2632:9): [True: 0, False: 1.48k]
  ------------------
 2633|  1.48k|    ZSTDv05_decompressBegin(dctx);
 2634|  1.48k|    return dctx;
 2635|  1.48k|}
ZSTDv05_freeDCtx:
 2638|  1.48k|{
 2639|  1.48k|    free(dctx);
 2640|  1.48k|    return 0;   /* reserved as a potential error code in the future */
 2641|  1.48k|}
ZSTDv05_getFrameParams:
 2752|  2.21k|{
 2753|  2.21k|    U32 magicNumber;
 2754|  2.21k|    if (srcSize < ZSTDv05_frameHeaderSize_min) return ZSTDv05_frameHeaderSize_max;
  ------------------
  |  |  400|      0|#define ZSTDv05_frameHeaderSize_max 5         /* define, for static allocation */
  ------------------
  |  Branch (2754:9): [True: 0, False: 2.21k]
  ------------------
 2755|  2.21k|    magicNumber = MEM_readLE32(src);
 2756|  2.21k|    if (magicNumber != ZSTDv05_MAGICNUMBER) return ERROR(prefix_unknown);
  ------------------
  |  |  153|  2.21k|#define ZSTDv05_MAGICNUMBER 0xFD2FB525   /* v0.5 */
  ------------------
                  if (magicNumber != ZSTDv05_MAGICNUMBER) return ERROR(prefix_unknown);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2756:9): [True: 0, False: 2.21k]
  ------------------
 2757|  2.21k|    memset(params, 0, sizeof(*params));
 2758|  2.21k|    params->windowLog = (((const BYTE*)src)[4] & 15) + ZSTDv05_WINDOWLOG_ABSOLUTEMIN;
  ------------------
  |  |  256|  2.21k|#define ZSTDv05_WINDOWLOG_ABSOLUTEMIN 11
  ------------------
 2759|  2.21k|    if ((((const BYTE*)src)[4] >> 4) != 0) return ERROR(frameParameter_unsupported);   /* reserved bits */
  ------------------
  |  |   49|     22|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     22|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     22|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2759:9): [True: 22, False: 2.19k]
  ------------------
 2760|  2.19k|    return 0;
 2761|  2.21k|}
ZSTDv05_decompress_usingDict:
 3449|  1.48k|{
 3450|  1.48k|    ZSTDv05_decompressBegin_usingDict(dctx, dict, dictSize);
 3451|  1.48k|    ZSTDv05_checkContinuity(dctx, dst);
 3452|  1.48k|    return ZSTDv05_decompress_continueDCtx(dctx, dst, maxDstSize, src, srcSize);
 3453|  1.48k|}
ZSTDv05_findFrameSizeInfoLegacy:
 3485|  1.54k|{
 3486|  1.54k|    const BYTE* ip = (const BYTE*)src;
 3487|  1.54k|    size_t remainingSize = srcSize;
 3488|  1.54k|    size_t nbBlocks = 0;
 3489|  1.54k|    blockProperties_t blockProperties;
 3490|       |
 3491|       |    /* Frame Header */
 3492|  1.54k|    if (srcSize < ZSTDv05_frameHeaderSize_min) {
  ------------------
  |  Branch (3492:9): [True: 0, False: 1.54k]
  ------------------
 3493|      0|        ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(srcSize_wrong));
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3494|      0|        return;
 3495|      0|    }
 3496|  1.54k|    if (MEM_readLE32(src) != ZSTDv05_MAGICNUMBER) {
  ------------------
  |  |  153|  1.54k|#define ZSTDv05_MAGICNUMBER 0xFD2FB525   /* v0.5 */
  ------------------
  |  Branch (3496:9): [True: 0, False: 1.54k]
  ------------------
 3497|      0|        ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(prefix_unknown));
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3498|      0|        return;
 3499|      0|    }
 3500|  1.54k|    ip += ZSTDv05_frameHeaderSize_min; remainingSize -= ZSTDv05_frameHeaderSize_min;
 3501|       |
 3502|       |    /* Loop on each block */
 3503|  3.51k|    while (1)
  ------------------
  |  Branch (3503:12): [True: 3.51k, Folded]
  ------------------
 3504|  3.51k|    {
 3505|  3.51k|        size_t cBlockSize = ZSTDv05_getcBlockSize(ip, remainingSize, &blockProperties);
 3506|  3.51k|        if (ZSTDv05_isError(cBlockSize)) {
  ------------------
  |  Branch (3506:13): [True: 5, False: 3.51k]
  ------------------
 3507|      5|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, cBlockSize);
 3508|      5|            return;
 3509|      5|        }
 3510|       |
 3511|  3.51k|        ip += ZSTDv05_blockHeaderSize;
 3512|  3.51k|        remainingSize -= ZSTDv05_blockHeaderSize;
 3513|  3.51k|        if (cBlockSize > remainingSize) {
  ------------------
  |  Branch (3513:13): [True: 53, False: 3.45k]
  ------------------
 3514|     53|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(srcSize_wrong));
  ------------------
  |  |   49|     53|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     53|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     53|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3515|     53|            return;
 3516|     53|        }
 3517|       |
 3518|  3.45k|        if (cBlockSize == 0) break;   /* bt_end */
  ------------------
  |  Branch (3518:13): [True: 1.48k, False: 1.97k]
  ------------------
 3519|       |
 3520|  1.97k|        ip += cBlockSize;
 3521|  1.97k|        remainingSize -= cBlockSize;
 3522|  1.97k|        nbBlocks++;
 3523|  1.97k|    }
 3524|       |
 3525|  1.48k|    *cSize = ip - (const BYTE*)src;
 3526|  1.48k|    *dBound = nbBlocks * BLOCKSIZE;
  ------------------
  |  |  396|  1.48k|#define BLOCKSIZE (128 KB)                 /* define, for static allocation */
  |  |  ------------------
  |  |  |  |  392|  1.48k|#define KB *(1 <<10)
  |  |  ------------------
  ------------------
 3527|  1.48k|}
ZSTDv05_decompressBegin_usingDict:
 3687|  1.48k|{
 3688|  1.48k|    size_t errorCode;
 3689|  1.48k|    errorCode = ZSTDv05_decompressBegin(dctx);
 3690|  1.48k|    if (ZSTDv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (3690:9): [True: 0, False: 1.48k]
  ------------------
 3691|       |
 3692|  1.48k|    if (dict && dictSize) {
  ------------------
  |  Branch (3692:9): [True: 1.48k, False: 0]
  |  Branch (3692:17): [True: 951, False: 533]
  ------------------
 3693|    951|        errorCode = ZSTDv05_decompress_insertDictionary(dctx, dict, dictSize);
 3694|    951|        if (ZSTDv05_isError(errorCode)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|    666|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    666|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    666|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3694:13): [True: 666, False: 285]
  ------------------
 3695|    951|    }
 3696|       |
 3697|    818|    return 0;
 3698|  1.48k|}
zstd_v05.c:FSEv05_tableStep:
 1142|  1.27k|static U32 FSEv05_tableStep(U32 tableSize) { return (tableSize>>1) + (tableSize>>3) + 3; }
zstd_v05.c:BITv05_highbit32:
  702|   481k|{
  703|       |#   if defined(_MSC_VER)   /* Visual */
  704|       |    unsigned long r;
  705|       |    return _BitScanReverse(&r, val) ? (unsigned)r : 0;
  706|       |#   elif defined(__GNUC__) && (__GNUC__ >= 3)   /* Use GCC Intrinsic */
  707|       |    return __builtin_clz (val) ^ 31;
  708|       |#   else   /* Software version */
  709|       |    static const unsigned DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 };
  710|       |    U32 v = val;
  711|       |    unsigned r;
  712|       |    v |= v >> 1;
  713|       |    v |= v >> 2;
  714|       |    v |= v >> 4;
  715|       |    v |= v >> 8;
  716|       |    v |= v >> 16;
  717|       |    r = DeBruijnClz[ (U32) (v * 0x07C4ACDDU) >> 27];
  718|       |    return r;
  719|       |#   endif
  720|   481k|}
zstd_v05.c:FSEv05_abs:
 1227|  19.8k|static short FSEv05_abs(short a) { return a<0 ? -a : a; }
  ------------------
  |  Branch (1227:43): [True: 9.57k, False: 10.2k]
  ------------------
zstd_v05.c:FSEv05_decompress_usingDTable_generic:
 1376|    596|{
 1377|    596|    BYTE* const ostart = (BYTE*) dst;
 1378|    596|    BYTE* op = ostart;
 1379|    596|    BYTE* const omax = op + maxDstSize;
 1380|    596|    BYTE* const olimit = omax-3;
 1381|       |
 1382|    596|    BITv05_DStream_t bitD;
 1383|    596|    FSEv05_DState_t state1;
 1384|    596|    FSEv05_DState_t state2;
 1385|    596|    size_t errorCode;
 1386|       |
 1387|       |    /* Init */
 1388|    596|    errorCode = BITv05_initDStream(&bitD, cSrc, cSrcSize);   /* replaced last arg by maxCompressed Size */
 1389|    596|    if (FSEv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1389:9): [True: 48, False: 548]
  ------------------
 1390|       |
 1391|    548|    FSEv05_initDState(&state1, &bitD, dt);
 1392|    548|    FSEv05_initDState(&state2, &bitD, dt);
 1393|       |
 1394|    548|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
 1395|       |
 1396|       |    /* 4 symbols per loop */
 1397|  6.25k|    for ( ; (BITv05_reloadDStream(&bitD)==BITv05_DStream_unfinished) && (op<olimit) ; op+=4) {
  ------------------
  |  Branch (1397:13): [True: 5.74k, False: 511]
  |  Branch (1397:73): [True: 5.70k, False: 37]
  ------------------
 1398|  5.70k|        op[0] = FSEv05_GETSYMBOL(&state1);
  ------------------
  |  | 1394|  5.70k|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 1.22k, False: 4.48k]
  |  |  ------------------
  ------------------
 1399|       |
 1400|  5.70k|        if (FSEv05_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1094|  5.70k|#define FSEv05_MAX_TABLELOG  (FSEv05_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1042|  5.70k|#define FSEv05_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1400:13): [Folded, False: 5.70k]
  ------------------
 1401|      0|            BITv05_reloadDStream(&bitD);
 1402|       |
 1403|  5.70k|        op[1] = FSEv05_GETSYMBOL(&state2);
  ------------------
  |  | 1394|  5.70k|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 1.22k, False: 4.48k]
  |  |  ------------------
  ------------------
 1404|       |
 1405|  5.70k|        if (FSEv05_MAX_TABLELOG*4+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1094|  5.70k|#define FSEv05_MAX_TABLELOG  (FSEv05_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1042|  5.70k|#define FSEv05_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1405:13): [Folded, False: 5.70k]
  ------------------
 1406|      0|            { if (BITv05_reloadDStream(&bitD) > BITv05_DStream_unfinished) { op+=2; break; } }
  ------------------
  |  Branch (1406:19): [True: 0, False: 0]
  ------------------
 1407|       |
 1408|  5.70k|        op[2] = FSEv05_GETSYMBOL(&state1);
  ------------------
  |  | 1394|  5.70k|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 1.22k, False: 4.48k]
  |  |  ------------------
  ------------------
 1409|       |
 1410|  5.70k|        if (FSEv05_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1094|  5.70k|#define FSEv05_MAX_TABLELOG  (FSEv05_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1042|  5.70k|#define FSEv05_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1410:13): [Folded, False: 5.70k]
  ------------------
 1411|      0|            BITv05_reloadDStream(&bitD);
 1412|       |
 1413|  5.70k|        op[3] = FSEv05_GETSYMBOL(&state2);
  ------------------
  |  | 1394|  5.70k|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 1.22k, False: 4.48k]
  |  |  ------------------
  ------------------
 1414|  5.70k|    }
 1415|       |
 1416|       |    /* tail */
 1417|       |    /* note : BITv05_reloadDStream(&bitD) >= FSEv05_DStream_partiallyFilled; Ends at exactly BITv05_DStream_completed */
 1418|  7.20k|    while (1) {
  ------------------
  |  Branch (1418:12): [True: 7.20k, Folded]
  ------------------
 1419|  7.20k|        if ( (BITv05_reloadDStream(&bitD)>BITv05_DStream_completed) || (op==omax) || (BITv05_endOfDStream(&bitD) && (fast || FSEv05_endOfDState(&state1))) )
  ------------------
  |  Branch (1419:14): [True: 113, False: 7.08k]
  |  Branch (1419:72): [True: 0, False: 7.08k]
  |  Branch (1419:87): [True: 178, False: 6.91k]
  |  Branch (1419:118): [True: 40, False: 138]
  |  Branch (1419:126): [True: 31, False: 107]
  ------------------
 1420|    184|            break;
 1421|       |
 1422|  7.01k|        *op++ = FSEv05_GETSYMBOL(&state1);
  ------------------
  |  | 1394|  7.01k|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 2.70k, False: 4.30k]
  |  |  ------------------
  ------------------
 1423|       |
 1424|  7.01k|        if ( (BITv05_reloadDStream(&bitD)>BITv05_DStream_completed) || (op==omax) || (BITv05_endOfDStream(&bitD) && (fast || FSEv05_endOfDState(&state2))) )
  ------------------
  |  Branch (1424:14): [True: 89, False: 6.92k]
  |  Branch (1424:72): [True: 62, False: 6.86k]
  |  Branch (1424:87): [True: 309, False: 6.55k]
  |  Branch (1424:118): [True: 176, False: 133]
  |  Branch (1424:126): [True: 37, False: 96]
  ------------------
 1425|    364|            break;
 1426|       |
 1427|  6.65k|        *op++ = FSEv05_GETSYMBOL(&state2);
  ------------------
  |  | 1394|  6.65k|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 2.48k, False: 4.16k]
  |  |  ------------------
  ------------------
 1428|  6.65k|    }
 1429|       |
 1430|       |    /* end ? */
 1431|    548|    if (BITv05_endOfDStream(&bitD) && FSEv05_endOfDState(&state1) && FSEv05_endOfDState(&state2))
  ------------------
  |  Branch (1431:9): [True: 295, False: 253]
  |  Branch (1431:39): [True: 207, False: 88]
  |  Branch (1431:70): [True: 187, False: 20]
  ------------------
 1432|    187|        return op-ostart;
 1433|       |
 1434|    361|    if (op==omax) return ERROR(dstSize_tooSmall);   /* dst buffer is full, but cSrc unfinished */
  ------------------
  |  |   49|     62|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     62|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     62|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1434:9): [True: 62, False: 299]
  ------------------
 1435|       |
 1436|    299|    return ERROR(corruption_detected);
  ------------------
  |  |   49|    299|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    299|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    299|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1437|    361|}
zstd_v05.c:FSEv05_initDState:
  951|  1.94k|{
  952|  1.94k|    const void* ptr = dt;
  953|  1.94k|    const FSEv05_DTableHeader* const DTableH = (const FSEv05_DTableHeader*)ptr;
  954|  1.94k|    DStatePtr->state = BITv05_readBits(bitD, DTableH->tableLog);
  955|  1.94k|    BITv05_reloadDStream(bitD);
  956|  1.94k|    DStatePtr->table = dt + 1;
  957|  1.94k|}
zstd_v05.c:BITv05_readBits:
  790|   135k|{
  791|   135k|    size_t value = BITv05_lookBits(bitD, nbBits);
  792|   135k|    BITv05_skipBits(bitD, nbBits);
  793|   135k|    return value;
  794|   135k|}
zstd_v05.c:BITv05_lookBits:
  771|   135k|{
  772|   135k|    const U32 bitMask = sizeof(bitD->bitContainer)*8 - 1;
  773|   135k|    return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask);
  774|   135k|}
zstd_v05.c:BITv05_skipBits:
  785|  4.26M|{
  786|  4.26M|    bitD->bitsConsumed += nbBits;
  787|  4.26M|}
zstd_v05.c:FSEv05_decodeSymbolFast:
  977|  10.0k|{
  978|  10.0k|    const FSEv05_decode_t DInfo = ((const FSEv05_decode_t*)(DStatePtr->table))[DStatePtr->state];
  979|  10.0k|    const U32 nbBits = DInfo.nbBits;
  980|  10.0k|    BYTE symbol = DInfo.symbol;
  981|  10.0k|    size_t lowBits = BITv05_readBitsFast(bitD, nbBits);
  982|       |
  983|  10.0k|    DStatePtr->state = DInfo.newState + lowBits;
  984|  10.0k|    return symbol;
  985|  10.0k|}
zstd_v05.c:BITv05_readBitsFast:
  799|  10.0k|{
  800|  10.0k|    size_t value = BITv05_lookBitsFast(bitD, nbBits);
  801|  10.0k|    BITv05_skipBits(bitD, nbBits);
  802|  10.0k|    return value;
  803|  10.0k|}
zstd_v05.c:BITv05_lookBitsFast:
  779|  4.13M|{
  780|  4.13M|    const U32 bitMask = sizeof(bitD->bitContainer)*8 - 1;
  781|  4.13M|    return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask);
  782|  4.13M|}
zstd_v05.c:FSEv05_decodeSymbol:
  966|   106k|{
  967|   106k|    const FSEv05_decode_t DInfo = ((const FSEv05_decode_t*)(DStatePtr->table))[DStatePtr->state];
  968|   106k|    const U32  nbBits = DInfo.nbBits;
  969|   106k|    BYTE symbol = DInfo.symbol;
  970|   106k|    size_t lowBits = BITv05_readBits(bitD, nbBits);
  971|       |
  972|   106k|    DStatePtr->state = DInfo.newState + lowBits;
  973|   106k|    return symbol;
  974|   106k|}
zstd_v05.c:FSEv05_endOfDState:
  988|    773|{
  989|    773|    return DStatePtr->state == 0;
  990|    773|}
zstd_v05.c:HUFv05_readStats:
 1745|  1.02k|{
 1746|  1.02k|    U32 weightTotal;
 1747|  1.02k|    U32 tableLog;
 1748|  1.02k|    const BYTE* ip = (const BYTE*) src;
 1749|  1.02k|    size_t iSize;
 1750|  1.02k|    size_t oSize;
 1751|  1.02k|    U32 n;
 1752|       |
 1753|  1.02k|    if (!srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     14|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     14|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     14|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1753:9): [True: 14, False: 1.00k]
  ------------------
 1754|  1.00k|    iSize = ip[0];
 1755|       |    /* memset(huffWeight, 0, hwSize); */   /* is not necessary, even though some analyzer complain ... */
 1756|       |
 1757|  1.00k|    if (iSize >= 128)  { /* special header */
  ------------------
  |  Branch (1757:9): [True: 329, False: 680]
  ------------------
 1758|    329|        if (iSize >= (242)) {  /* RLE */
  ------------------
  |  Branch (1758:13): [True: 260, False: 69]
  ------------------
 1759|    260|            static int l[14] = { 1, 2, 3, 4, 7, 8, 15, 16, 31, 32, 63, 64, 127, 128 };
 1760|    260|            oSize = l[iSize-242];
 1761|    260|            memset(huffWeight, 1, hwSize);
 1762|    260|            iSize = 0;
 1763|    260|        }
 1764|     69|        else {   /* Incompressible */
 1765|     69|            oSize = iSize - 127;
 1766|     69|            iSize = ((oSize+1)/2);
 1767|     69|            if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     17|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     17|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     17|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1767:17): [True: 17, False: 52]
  ------------------
 1768|     52|            if (oSize >= hwSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1768:17): [True: 0, False: 52]
  ------------------
 1769|     52|            ip += 1;
 1770|    889|            for (n=0; n<oSize; n+=2) {
  ------------------
  |  Branch (1770:23): [True: 837, False: 52]
  ------------------
 1771|    837|                huffWeight[n]   = ip[n/2] >> 4;
 1772|    837|                huffWeight[n+1] = ip[n/2] & 15;
 1773|    837|    }   }   }
 1774|    680|    else  {   /* header compressed with FSEv05 (normal case) */
 1775|    680|        if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     17|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     17|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     17|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1775:13): [True: 17, False: 663]
  ------------------
 1776|    663|        oSize = FSEv05_decompress(huffWeight, hwSize-1, ip+1, iSize);   /* max (hwSize-1) values decoded, as last one is implied */
 1777|    663|        if (FSEv05_isError(oSize)) return oSize;
  ------------------
  |  Branch (1777:13): [True: 476, False: 187]
  ------------------
 1778|    663|    }
 1779|       |
 1780|       |    /* collect weight stats */
 1781|    499|    memset(rankStats, 0, (HUFv05_ABSOLUTEMAX_TABLELOG + 1) * sizeof(U32));
  ------------------
  |  | 1711|    499|#define HUFv05_ABSOLUTEMAX_TABLELOG  16   /* absolute limit of HUFv05_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
 1782|    499|    weightTotal = 0;
 1783|  34.4k|    for (n=0; n<oSize; n++) {
  ------------------
  |  Branch (1783:15): [True: 33.9k, False: 489]
  ------------------
 1784|  33.9k|        if (huffWeight[n] >= HUFv05_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  | 1711|  33.9k|#define HUFv05_ABSOLUTEMAX_TABLELOG  16   /* absolute limit of HUFv05_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
                      if (huffWeight[n] >= HUFv05_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1784:13): [True: 10, False: 33.9k]
  ------------------
 1785|  33.9k|        rankStats[huffWeight[n]]++;
 1786|  33.9k|        weightTotal += (1 << huffWeight[n]) >> 1;
 1787|  33.9k|    }
 1788|    489|    if (weightTotal == 0) return ERROR(corruption_detected);
  ------------------
  |  |   49|     11|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     11|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     11|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1788:9): [True: 11, False: 478]
  ------------------
 1789|       |
 1790|       |    /* get last non-null symbol weight (implied, total must be 2^n) */
 1791|    478|    tableLog = BITv05_highbit32(weightTotal) + 1;
 1792|    478|    if (tableLog > HUFv05_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  | 1711|    478|#define HUFv05_ABSOLUTEMAX_TABLELOG  16   /* absolute limit of HUFv05_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
                  if (tableLog > HUFv05_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  |   49|     17|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     17|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     17|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1792:9): [True: 17, False: 461]
  ------------------
 1793|    461|    {   /* determine last weight */
 1794|    461|        U32 total = 1 << tableLog;
 1795|    461|        U32 rest = total - weightTotal;
 1796|    461|        U32 verif = 1 << BITv05_highbit32(rest);
 1797|    461|        U32 lastWeight = BITv05_highbit32(rest) + 1;
 1798|    461|        if (verif != rest) return ERROR(corruption_detected);    /* last value must be a clean power of 2 */
  ------------------
  |  |   49|     23|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     23|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     23|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1798:13): [True: 23, False: 438]
  ------------------
 1799|    438|        huffWeight[oSize] = (BYTE)lastWeight;
 1800|    438|        rankStats[lastWeight]++;
 1801|    438|    }
 1802|       |
 1803|       |    /* check tree construction validity */
 1804|    438|    if ((rankStats[1] < 2) || (rankStats[1] & 1)) return ERROR(corruption_detected);   /* by construction : at least 2 elts of rank 1, must be even */
  ------------------
  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1804:9): [True: 10, False: 428]
  |  Branch (1804:31): [True: 0, False: 428]
  ------------------
 1805|       |
 1806|       |    /* results */
 1807|    428|    *nbSymbolsPtr = (U32)(oSize+1);
 1808|    428|    *tableLogPtr = tableLog;
 1809|    428|    return iSize+1;
 1810|    438|}
zstd_v05.c:BITv05_initDStream:
  735|  1.44k|{
  736|  1.44k|    if (srcSize < 1) { memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   49|      9|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      9|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      9|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (736:9): [True: 9, False: 1.43k]
  ------------------
  737|       |
  738|  1.43k|    if (srcSize >=  sizeof(size_t)) {  /* normal case */
  ------------------
  |  Branch (738:9): [True: 1.01k, False: 425]
  ------------------
  739|  1.01k|        U32 contain32;
  740|  1.01k|        bitD->start = (const char*)srcBuffer;
  741|  1.01k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(size_t);
  742|  1.01k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  743|  1.01k|        contain32 = ((const BYTE*)srcBuffer)[srcSize-1];
  744|  1.01k|        if (contain32 == 0) return ERROR(GENERIC);   /* endMark not present */
  ------------------
  |  |   49|     84|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     84|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     84|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (744:13): [True: 84, False: 928]
  ------------------
  745|    928|        bitD->bitsConsumed = 8 - BITv05_highbit32(contain32);
  746|    928|    } else {
  747|    425|        U32 contain32;
  748|    425|        bitD->start = (const char*)srcBuffer;
  749|    425|        bitD->ptr   = bitD->start;
  750|    425|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  751|    425|        switch(srcSize)
  752|    425|        {
  753|     44|            case 7: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[6]) << (sizeof(size_t)*8 - 16);/* fall-through */
  ------------------
  |  Branch (753:13): [True: 44, False: 381]
  ------------------
  754|     80|            case 6: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[5]) << (sizeof(size_t)*8 - 24);/* fall-through */
  ------------------
  |  Branch (754:13): [True: 36, False: 389]
  ------------------
  755|    244|            case 5: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[4]) << (sizeof(size_t)*8 - 32);/* fall-through */
  ------------------
  |  Branch (755:13): [True: 164, False: 261]
  ------------------
  756|    282|            case 4: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[3]) << 24; /* fall-through */
  ------------------
  |  Branch (756:13): [True: 38, False: 387]
  ------------------
  757|    332|            case 3: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[2]) << 16; /* fall-through */
  ------------------
  |  Branch (757:13): [True: 50, False: 375]
  ------------------
  758|    380|            case 2: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[1]) <<  8; /* fall-through */
  ------------------
  |  Branch (758:13): [True: 48, False: 377]
  ------------------
  759|    425|            default: break;
  ------------------
  |  Branch (759:13): [True: 45, False: 380]
  ------------------
  760|    425|        }
  761|    425|        contain32 = ((const BYTE*)srcBuffer)[srcSize-1];
  762|    425|        if (contain32 == 0) return ERROR(GENERIC);   /* endMark not present */
  ------------------
  |  |   49|     37|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     37|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     37|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (762:13): [True: 37, False: 388]
  ------------------
  763|    388|        bitD->bitsConsumed = 8 - BITv05_highbit32(contain32);
  764|    388|        bitD->bitsConsumed += (U32)(sizeof(size_t) - srcSize)*8;
  765|    388|    }
  766|       |
  767|  1.31k|    return srcSize;
  768|  1.43k|}
zstd_v05.c:HUFv05_decodeStreamX2:
 1882|    354|{
 1883|    354|    BYTE* const pStart = p;
 1884|       |
 1885|       |    /* up to 4 symbols at a time */
 1886|  7.07k|    while ((BITv05_reloadDStream(bitDPtr) == BITv05_DStream_unfinished) && (p <= pEnd-4)) {
  ------------------
  |  Branch (1886:12): [True: 6.76k, False: 311]
  |  Branch (1886:76): [True: 6.71k, False: 43]
  ------------------
 1887|  6.71k|        HUFv05_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1878|  6.71k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 6.71k, False: 0]
  |  |  ------------------
  |  | 1879|  6.71k|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|  6.71k|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1888|  6.71k|        HUFv05_DECODE_SYMBOLX2_1(p, bitDPtr);
  ------------------
  |  | 1874|  6.71k|    if (MEM_64bits() || (HUFv05_MAX_TABLELOG<=12)) \
  |  |  ------------------
  |  |  |  | 1712|      0|#define HUFv05_MAX_TABLELOG  12           /* max configured tableLog (for static allocation); can be modified up to HUFv05_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (1874:9): [True: 6.71k, False: 0]
  |  |  |  Branch (1874:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1875|  6.71k|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|  6.71k|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1889|  6.71k|        HUFv05_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1878|  6.71k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 6.71k, False: 0]
  |  |  ------------------
  |  | 1879|  6.71k|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|  6.71k|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1890|  6.71k|        HUFv05_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1871|  6.71k|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1891|  6.71k|    }
 1892|       |
 1893|       |    /* closer to the end */
 1894|    435|    while ((BITv05_reloadDStream(bitDPtr) == BITv05_DStream_unfinished) && (p < pEnd))
  ------------------
  |  Branch (1894:12): [True: 118, False: 317]
  |  Branch (1894:76): [True: 81, False: 37]
  ------------------
 1895|     81|        HUFv05_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1871|     81|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1896|       |
 1897|       |    /* no more data to retrieve from bitstream, hence no need to reload */
 1898|  4.07M|    while (p < pEnd)
  ------------------
  |  Branch (1898:12): [True: 4.07M, False: 354]
  ------------------
 1899|  4.07M|        HUFv05_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1871|  4.07M|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1900|       |
 1901|    354|    return pEnd-pStart;
 1902|    354|}
zstd_v05.c:BITv05_endOfDStream:
  838|  14.9k|{
  839|  14.9k|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (839:13): [True: 14.7k, False: 168]
  |  Branch (839:49): [True: 786, False: 13.9k]
  ------------------
  840|  14.9k|}
zstd_v05.c:BITv05_reloadDStream:
  806|  59.3k|{
  807|  59.3k|    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))  /* should never happen */
  ------------------
  |  Branch (807:9): [True: 389, False: 58.9k]
  ------------------
  808|    389|        return BITv05_DStream_overflow;
  809|       |
  810|  58.9k|    if (bitD->ptr >= bitD->start + sizeof(bitD->bitContainer)) {
  ------------------
  |  Branch (810:9): [True: 34.0k, False: 24.9k]
  ------------------
  811|  34.0k|        bitD->ptr -= bitD->bitsConsumed >> 3;
  812|  34.0k|        bitD->bitsConsumed &= 7;
  813|  34.0k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  814|  34.0k|        return BITv05_DStream_unfinished;
  815|  34.0k|    }
  816|  24.9k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (816:9): [True: 18.6k, False: 6.25k]
  ------------------
  817|  18.6k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BITv05_DStream_endOfBuffer;
  ------------------
  |  Branch (817:13): [True: 18.1k, False: 549]
  ------------------
  818|    549|        return BITv05_DStream_completed;
  819|  18.6k|    }
  820|  6.25k|    {
  821|  6.25k|        U32 nbBytes = bitD->bitsConsumed >> 3;
  822|  6.25k|        BITv05_DStream_status result = BITv05_DStream_unfinished;
  823|  6.25k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (823:13): [True: 241, False: 6.01k]
  ------------------
  824|    241|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  825|    241|            result = BITv05_DStream_endOfBuffer;
  826|    241|        }
  827|  6.25k|        bitD->ptr -= nbBytes;
  828|  6.25k|        bitD->bitsConsumed -= nbBytes*8;
  829|  6.25k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD) */
  830|  6.25k|        return result;
  831|  24.9k|    }
  832|  24.9k|}
zstd_v05.c:HUFv05_decodeSymbolX2:
 1863|  4.11M|{
 1864|  4.11M|        const size_t val = BITv05_lookBitsFast(Dstream, dtLog); /* note : dtLog >= 1 */
 1865|  4.11M|        const BYTE c = dt[val].byte;
 1866|  4.11M|        BITv05_skipBits(Dstream, dt[val].nbBits);
 1867|  4.11M|        return c;
 1868|  4.11M|}
zstd_v05.c:HUFv05_fillDTableX4:
 2105|    212|{
 2106|    212|    U32 rankVal[HUFv05_ABSOLUTEMAX_TABLELOG + 1];
 2107|    212|    const int scaleLog = nbBitsBaseline - targetLog;   /* note : targetLog >= srcLog, hence scaleLog <= 1 */
 2108|    212|    const U32 minBits  = nbBitsBaseline - maxWeight;
 2109|    212|    U32 s;
 2110|       |
 2111|    212|    memcpy(rankVal, rankValOrigin, sizeof(rankVal));
 2112|       |
 2113|       |    /* fill DTable */
 2114|  21.8k|    for (s=0; s<sortedListSize; s++) {
  ------------------
  |  Branch (2114:15): [True: 21.6k, False: 212]
  ------------------
 2115|  21.6k|        const U16 symbol = sortedList[s].symbol;
 2116|  21.6k|        const U32 weight = sortedList[s].weight;
 2117|  21.6k|        const U32 nbBits = nbBitsBaseline - weight;
 2118|  21.6k|        const U32 start = rankVal[weight];
 2119|  21.6k|        const U32 length = 1 << (targetLog-nbBits);
 2120|       |
 2121|  21.6k|        if (targetLog-nbBits >= minBits) {   /* enough room for a second symbol */
  ------------------
  |  Branch (2121:13): [True: 15.6k, False: 5.95k]
  ------------------
 2122|  15.6k|            U32 sortedRank;
 2123|  15.6k|            int minWeight = nbBits + scaleLog;
 2124|  15.6k|            if (minWeight < 1) minWeight = 1;
  ------------------
  |  Branch (2124:17): [True: 538, False: 15.1k]
  ------------------
 2125|  15.6k|            sortedRank = rankStart[minWeight];
 2126|  15.6k|            HUFv05_fillDTableX4Level2(DTable+start, targetLog-nbBits, nbBits,
 2127|  15.6k|                           rankValOrigin[nbBits], minWeight,
 2128|  15.6k|                           sortedList+sortedRank, sortedListSize-sortedRank,
 2129|  15.6k|                           nbBitsBaseline, symbol);
 2130|  15.6k|        } else {
 2131|  5.95k|            U32 i;
 2132|  5.95k|            const U32 end = start + length;
 2133|  5.95k|            HUFv05_DEltX4 DElt;
 2134|       |
 2135|  5.95k|            MEM_writeLE16(&(DElt.sequence), symbol);
 2136|  5.95k|            DElt.nbBits   = (BYTE)(nbBits);
 2137|  5.95k|            DElt.length   = 1;
 2138|   183k|            for (i = start; i < end; i++)
  ------------------
  |  Branch (2138:29): [True: 177k, False: 5.95k]
  ------------------
 2139|   177k|                DTable[i] = DElt;
 2140|  5.95k|        }
 2141|  21.6k|        rankVal[weight] += length;
 2142|  21.6k|    }
 2143|    212|}
zstd_v05.c:HUFv05_fillDTableX4Level2:
 2062|  15.6k|{
 2063|  15.6k|    HUFv05_DEltX4 DElt;
 2064|  15.6k|    U32 rankVal[HUFv05_ABSOLUTEMAX_TABLELOG + 1];
 2065|  15.6k|    U32 s;
 2066|       |
 2067|       |    /* get pre-calculated rankVal */
 2068|  15.6k|    memcpy(rankVal, rankValOrigin, sizeof(rankVal));
 2069|       |
 2070|       |    /* fill skipped values */
 2071|  15.6k|    if (minWeight>1) {
  ------------------
  |  Branch (2071:9): [True: 13.6k, False: 1.96k]
  ------------------
 2072|  13.6k|        U32 i, skipSize = rankVal[minWeight];
 2073|  13.6k|        MEM_writeLE16(&(DElt.sequence), baseSeq);
 2074|  13.6k|        DElt.nbBits   = (BYTE)(consumed);
 2075|  13.6k|        DElt.length   = 1;
 2076|   121k|        for (i = 0; i < skipSize; i++)
  ------------------
  |  Branch (2076:21): [True: 107k, False: 13.6k]
  ------------------
 2077|   107k|            DTable[i] = DElt;
 2078|  13.6k|    }
 2079|       |
 2080|       |    /* fill DTable */
 2081|   148k|    for (s=0; s<sortedListSize; s++) {   /* note : sortedSymbols already skipped */
  ------------------
  |  Branch (2081:15): [True: 132k, False: 15.6k]
  ------------------
 2082|   132k|        const U32 symbol = sortedSymbols[s].symbol;
 2083|   132k|        const U32 weight = sortedSymbols[s].weight;
 2084|   132k|        const U32 nbBits = nbBitsBaseline - weight;
 2085|   132k|        const U32 length = 1 << (sizeLog-nbBits);
 2086|   132k|        const U32 start = rankVal[weight];
 2087|   132k|        U32 i = start;
 2088|   132k|        const U32 end = start + length;
 2089|       |
 2090|   132k|        MEM_writeLE16(&(DElt.sequence), (U16)(baseSeq + (symbol << 8)));
 2091|   132k|        DElt.nbBits = (BYTE)(nbBits + consumed);
 2092|   132k|        DElt.length = 2;
 2093|   582k|        do { DTable[i++] = DElt; } while (i<end);   /* since length >= 1 */
  ------------------
  |  Branch (2093:43): [True: 449k, False: 132k]
  ------------------
 2094|       |
 2095|   132k|        rankVal[weight] += length;
 2096|   132k|    }
 2097|  15.6k|}
zstd_v05.c:HUFv05_decodeStreamX4:
 2258|     59|{
 2259|     59|    BYTE* const pStart = p;
 2260|       |
 2261|       |    /* up to 8 symbols at a time */
 2262|    333|    while ((BITv05_reloadDStream(bitDPtr) == BITv05_DStream_unfinished) && (p < pEnd-7)) {
  ------------------
  |  Branch (2262:12): [True: 292, False: 41]
  |  Branch (2262:76): [True: 274, False: 18]
  ------------------
 2263|    274|        HUFv05_DECODE_SYMBOLX4_2(p, bitDPtr);
  ------------------
  |  | 2254|    274|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2254:9): [True: 274, False: 0]
  |  |  ------------------
  |  | 2255|    274|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2264|    274|        HUFv05_DECODE_SYMBOLX4_1(p, bitDPtr);
  ------------------
  |  | 2250|    274|    if (MEM_64bits() || (HUFv05_MAX_TABLELOG<=12)) \
  |  |  ------------------
  |  |  |  | 1712|      0|#define HUFv05_MAX_TABLELOG  12           /* max configured tableLog (for static allocation); can be modified up to HUFv05_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (2250:9): [True: 274, False: 0]
  |  |  |  Branch (2250:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2251|    274|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2265|    274|        HUFv05_DECODE_SYMBOLX4_2(p, bitDPtr);
  ------------------
  |  | 2254|    274|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2254:9): [True: 274, False: 0]
  |  |  ------------------
  |  | 2255|    274|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2266|    274|        HUFv05_DECODE_SYMBOLX4_0(p, bitDPtr);
  ------------------
  |  | 2247|    274|    ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2267|    274|    }
 2268|       |
 2269|       |    /* closer to the end */
 2270|     79|    while ((BITv05_reloadDStream(bitDPtr) == BITv05_DStream_unfinished) && (p <= pEnd-2))
  ------------------
  |  Branch (2270:12): [True: 36, False: 43]
  |  Branch (2270:76): [True: 20, False: 16]
  ------------------
 2271|     20|        HUFv05_DECODE_SYMBOLX4_0(p, bitDPtr);
  ------------------
  |  | 2247|     20|    ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2272|       |
 2273|  5.46k|    while (p <= pEnd-2)
  ------------------
  |  Branch (2273:12): [True: 5.40k, False: 59]
  ------------------
 2274|  5.40k|        HUFv05_DECODE_SYMBOLX4_0(p, bitDPtr);   /* no need to reload : reached the end of DStream */
  ------------------
  |  | 2247|  5.40k|    ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2275|       |
 2276|     59|    if (p < pEnd)
  ------------------
  |  Branch (2276:9): [True: 31, False: 28]
  ------------------
 2277|     31|        p += HUFv05_decodeLastSymbolX4(p, bitDPtr, dt, dtLog);
 2278|       |
 2279|     59|    return p-pStart;
 2280|     59|}
zstd_v05.c:HUFv05_decodeLastSymbolX4:
 2232|     31|{
 2233|     31|    const size_t val = BITv05_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */
 2234|     31|    memcpy(op, dt+val, 1);
 2235|     31|    if (dt[val].length==1) BITv05_skipBits(DStream, dt[val].nbBits);
  ------------------
  |  Branch (2235:9): [True: 16, False: 15]
  ------------------
 2236|     15|    else {
 2237|     15|        if (DStream->bitsConsumed < (sizeof(DStream->bitContainer)*8)) {
  ------------------
  |  Branch (2237:13): [True: 8, False: 7]
  ------------------
 2238|      8|            BITv05_skipBits(DStream, dt[val].nbBits);
 2239|      8|            if (DStream->bitsConsumed > (sizeof(DStream->bitContainer)*8))
  ------------------
  |  Branch (2239:17): [True: 0, False: 8]
  ------------------
 2240|      0|                DStream->bitsConsumed = (sizeof(DStream->bitContainer)*8);   /* ugly hack; works only because it's the last symbol. Note : can't easily extract nbBits from just this symbol */
 2241|      8|    }   }
 2242|     31|    return 1;
 2243|     31|}
zstd_v05.c:HUFv05_decodeSymbolX4:
 2224|  6.52k|{
 2225|  6.52k|    const size_t val = BITv05_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */
 2226|  6.52k|    memcpy(op, dt+val, 2);
 2227|  6.52k|    BITv05_skipBits(DStream, dt[val].nbBits);
 2228|  6.52k|    return dt[val].length;
 2229|  6.52k|}
zstd_v05.c:ZSTDv05_checkContinuity:
 3330|  1.48k|{
 3331|  1.48k|    if (dst != dctx->previousDstEnd) {   /* not contiguous */
  ------------------
  |  Branch (3331:9): [True: 1.48k, False: 0]
  ------------------
 3332|  1.48k|        dctx->dictEnd = dctx->previousDstEnd;
 3333|  1.48k|        dctx->vBase = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3334|  1.48k|        dctx->base = dst;
 3335|  1.48k|        dctx->previousDstEnd = dst;
 3336|  1.48k|    }
 3337|  1.48k|}
zstd_v05.c:ZSTDv05_decompressBlock_internal:
 3343|  1.02k|{   /* blockType == blockCompressed */
 3344|  1.02k|    const BYTE* ip = (const BYTE*)src;
 3345|  1.02k|    size_t litCSize;
 3346|       |
 3347|  1.02k|    if (srcSize >= BLOCKSIZE) return ERROR(srcSize_wrong);
  ------------------
  |  |  396|  1.02k|#define BLOCKSIZE (128 KB)                 /* define, for static allocation */
  |  |  ------------------
  |  |  |  |  392|  1.02k|#define KB *(1 <<10)
  |  |  ------------------
  ------------------
                  if (srcSize >= BLOCKSIZE) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3347:9): [True: 0, False: 1.02k]
  ------------------
 3348|       |
 3349|       |    /* Decode literals sub-block */
 3350|  1.02k|    litCSize = ZSTDv05_decodeLiteralsBlock(dctx, src, srcSize);
 3351|  1.02k|    if (ZSTDv05_isError(litCSize)) return litCSize;
  ------------------
  |  Branch (3351:9): [True: 661, False: 365]
  ------------------
 3352|    365|    ip += litCSize;
 3353|    365|    srcSize -= litCSize;
 3354|       |
 3355|    365|    return ZSTDv05_decompressSequences(dctx, dst, dstCapacity, ip, srcSize);
 3356|  1.02k|}
zstd_v05.c:ZSTDv05_decodeLiteralsBlock:
 2812|  1.02k|{
 2813|  1.02k|    const BYTE* const istart = (const BYTE*) src;
 2814|       |
 2815|       |    /* any compressed block with literals segment must be at least this size */
 2816|  1.02k|    if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  |  439|  1.02k|#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */ + MIN_SEQUENCES_SIZE /* nbSeq==0 */)   /* for a non-null block */
  |  |  ------------------
  |  |  |  |  438|  1.02k|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  |  |  ------------------
  ------------------
                  if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  |   49|    263|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    263|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    263|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2816:9): [True: 263, False: 763]
  ------------------
 2817|       |
 2818|    763|    switch(istart[0]>> 6)
 2819|    763|    {
 2820|    320|    case IS_HUFv05:
  ------------------
  |  |  409|    320|#define IS_HUFv05 0
  ------------------
  |  Branch (2820:5): [True: 320, False: 443]
  ------------------
 2821|    320|        {
 2822|    320|            size_t litSize, litCSize, singleStream=0;
 2823|    320|            U32 lhSize = ((istart[0]) >> 4) & 3;
 2824|    320|            if (srcSize < 5) return ERROR(corruption_detected);   /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for case 3 */
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2824:17): [True: 1, False: 319]
  ------------------
 2825|    319|            switch(lhSize)
 2826|    319|            {
 2827|    104|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (2827:13): [True: 24, False: 295]
  |  Branch (2827:21): [True: 80, False: 239]
  |  Branch (2827:29): [True: 0, False: 319]
  ------------------
 2828|       |                /* 2 - 2 - 10 - 10 */
 2829|    104|                lhSize=3;
 2830|    104|                singleStream = istart[0] & 16;
 2831|    104|                litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 2832|    104|                litCSize = ((istart[1] &  3) << 8) + istart[2];
 2833|    104|                break;
 2834|     41|            case 2:
  ------------------
  |  Branch (2834:13): [True: 41, False: 278]
  ------------------
 2835|       |                /* 2 - 2 - 14 - 14 */
 2836|     41|                lhSize=4;
 2837|     41|                litSize  = ((istart[0] & 15) << 10) + (istart[1] << 2) + (istart[2] >> 6);
 2838|     41|                litCSize = ((istart[2] & 63) <<  8) + istart[3];
 2839|     41|                break;
 2840|    174|            case 3:
  ------------------
  |  Branch (2840:13): [True: 174, False: 145]
  ------------------
 2841|       |                /* 2 - 2 - 18 - 18 */
 2842|    174|                lhSize=5;
 2843|    174|                litSize  = ((istart[0] & 15) << 14) + (istart[1] << 6) + (istart[2] >> 2);
 2844|    174|                litCSize = ((istart[2] &  3) << 16) + (istart[3] << 8) + istart[4];
 2845|    174|                break;
 2846|    319|            }
 2847|    319|            if (litSize > BLOCKSIZE) return ERROR(corruption_detected);
  ------------------
  |  |  396|    319|#define BLOCKSIZE (128 KB)                 /* define, for static allocation */
  |  |  ------------------
  |  |  |  |  392|    319|#define KB *(1 <<10)
  |  |  ------------------
  ------------------
                          if (litSize > BLOCKSIZE) return ERROR(corruption_detected);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2847:17): [True: 1, False: 318]
  ------------------
 2848|    318|            if (litCSize + lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|     38|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     38|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     38|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2848:17): [True: 38, False: 280]
  ------------------
 2849|       |
 2850|    280|            if (HUFv05_isError(singleStream ?
  ------------------
  |  Branch (2850:17): [True: 265, False: 15]
  |  Branch (2850:32): [True: 79, False: 201]
  ------------------
 2851|     79|                            HUFv05_decompress1X2(dctx->litBuffer, litSize, istart+lhSize, litCSize) :
 2852|    280|                            HUFv05_decompress   (dctx->litBuffer, litSize, istart+lhSize, litCSize) ))
 2853|    265|                return ERROR(corruption_detected);
  ------------------
  |  |   49|    265|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    265|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    265|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2854|       |
 2855|     15|            dctx->litPtr = dctx->litBuffer;
 2856|     15|            dctx->litSize = litSize;
 2857|     15|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  441|     15|#define WILDCOPY_OVERLENGTH 8
  ------------------
 2858|     15|            return litCSize + lhSize;
 2859|    280|        }
 2860|     72|    case IS_PCH:
  ------------------
  |  |  410|     72|#define IS_PCH 1
  ------------------
  |  Branch (2860:5): [True: 72, False: 691]
  ------------------
 2861|     72|        {
 2862|     72|            size_t errorCode;
 2863|     72|            size_t litSize, litCSize;
 2864|     72|            U32 lhSize = ((istart[0]) >> 4) & 3;
 2865|     72|            if (lhSize != 1)  /* only case supported for now : small litSize, single stream */
  ------------------
  |  Branch (2865:17): [True: 1, False: 71]
  ------------------
 2866|      1|                return ERROR(corruption_detected);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2867|     71|            if (!dctx->flagStaticTables)
  ------------------
  |  Branch (2867:17): [True: 2, False: 69]
  ------------------
 2868|      2|                return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2869|       |
 2870|       |            /* 2 - 2 - 10 - 10 */
 2871|     69|            lhSize=3;
 2872|     69|            litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 2873|     69|            litCSize = ((istart[1] &  3) << 8) + istart[2];
 2874|     69|            if (litCSize + lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2874:17): [True: 2, False: 67]
  ------------------
 2875|       |
 2876|     67|            errorCode = HUFv05_decompress1X4_usingDTable(dctx->litBuffer, litSize, istart+lhSize, litCSize, dctx->hufTableX4);
 2877|     67|            if (HUFv05_isError(errorCode)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     66|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     66|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     66|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2877:17): [True: 66, False: 1]
  ------------------
 2878|       |
 2879|      1|            dctx->litPtr = dctx->litBuffer;
 2880|      1|            dctx->litSize = litSize;
 2881|      1|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  441|      1|#define WILDCOPY_OVERLENGTH 8
  ------------------
 2882|      1|            return litCSize + lhSize;
 2883|     67|        }
 2884|     20|    case IS_RAW:
  ------------------
  |  |  411|     20|#define IS_RAW 2
  ------------------
  |  Branch (2884:5): [True: 20, False: 743]
  ------------------
 2885|     20|        {
 2886|     20|            size_t litSize;
 2887|     20|            U32 lhSize = ((istart[0]) >> 4) & 3;
 2888|     20|            switch(lhSize)
 2889|     20|            {
 2890|      9|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (2890:13): [True: 7, False: 13]
  |  Branch (2890:21): [True: 2, False: 18]
  |  Branch (2890:29): [True: 0, False: 20]
  ------------------
 2891|      9|                lhSize=1;
 2892|      9|                litSize = istart[0] & 31;
 2893|      9|                break;
 2894|      5|            case 2:
  ------------------
  |  Branch (2894:13): [True: 5, False: 15]
  ------------------
 2895|      5|                litSize = ((istart[0] & 15) << 8) + istart[1];
 2896|      5|                break;
 2897|      6|            case 3:
  ------------------
  |  Branch (2897:13): [True: 6, False: 14]
  ------------------
 2898|      6|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 2899|      6|                break;
 2900|     20|            }
 2901|       |
 2902|     20|            if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */
  ------------------
  |  |  441|     20|#define WILDCOPY_OVERLENGTH 8
  ------------------
  |  Branch (2902:17): [True: 16, False: 4]
  ------------------
 2903|     16|                if (litSize+lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|     11|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     11|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     11|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2903:21): [True: 11, False: 5]
  ------------------
 2904|      5|                memcpy(dctx->litBuffer, istart+lhSize, litSize);
 2905|      5|                dctx->litPtr = dctx->litBuffer;
 2906|      5|                dctx->litSize = litSize;
 2907|      5|                memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  441|      5|#define WILDCOPY_OVERLENGTH 8
  ------------------
 2908|      5|                return lhSize+litSize;
 2909|     16|            }
 2910|       |            /* direct reference into compressed stream */
 2911|      4|            dctx->litPtr = istart+lhSize;
 2912|      4|            dctx->litSize = litSize;
 2913|      4|            return lhSize+litSize;
 2914|     20|        }
 2915|    351|    case IS_RLE:
  ------------------
  |  |  412|    351|#define IS_RLE 3
  ------------------
  |  Branch (2915:5): [True: 351, False: 412]
  ------------------
 2916|    351|        {
 2917|    351|            size_t litSize;
 2918|    351|            U32 lhSize = ((istart[0]) >> 4) & 3;
 2919|    351|            switch(lhSize)
 2920|    351|            {
 2921|     87|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (2921:13): [True: 4, False: 347]
  |  Branch (2921:21): [True: 83, False: 268]
  |  Branch (2921:29): [True: 0, False: 351]
  ------------------
 2922|     87|                lhSize = 1;
 2923|     87|                litSize = istart[0] & 31;
 2924|     87|                break;
 2925|    208|            case 2:
  ------------------
  |  Branch (2925:13): [True: 208, False: 143]
  ------------------
 2926|    208|                litSize = ((istart[0] & 15) << 8) + istart[1];
 2927|    208|                break;
 2928|     56|            case 3:
  ------------------
  |  Branch (2928:13): [True: 56, False: 295]
  ------------------
 2929|     56|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 2930|     56|                if (srcSize<4) return ERROR(corruption_detected);   /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need lhSize+1 = 4 */
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2930:21): [True: 1, False: 55]
  ------------------
 2931|     55|                break;
 2932|    351|            }
 2933|    350|            if (litSize > BLOCKSIZE) return ERROR(corruption_detected);
  ------------------
  |  |  396|    350|#define BLOCKSIZE (128 KB)                 /* define, for static allocation */
  |  |  ------------------
  |  |  |  |  392|    350|#define KB *(1 <<10)
  |  |  ------------------
  ------------------
                          if (litSize > BLOCKSIZE) return ERROR(corruption_detected);
  ------------------
  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2933:17): [True: 10, False: 340]
  ------------------
 2934|    340|            memset(dctx->litBuffer, istart[lhSize], litSize + WILDCOPY_OVERLENGTH);
  ------------------
  |  |  441|    340|#define WILDCOPY_OVERLENGTH 8
  ------------------
 2935|    340|            dctx->litPtr = dctx->litBuffer;
 2936|    340|            dctx->litSize = litSize;
 2937|    340|            return lhSize+1;
 2938|    350|        }
 2939|      0|    default:
  ------------------
  |  Branch (2939:5): [True: 0, False: 763]
  ------------------
 2940|      0|        return ERROR(corruption_detected);   /* impossible */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2941|    763|    }
 2942|    763|}
zstd_v05.c:ZSTDv05_decompressSequences:
 3260|    365|{
 3261|    365|    const BYTE* ip = (const BYTE*)seqStart;
 3262|    365|    const BYTE* const iend = ip + seqSize;
 3263|    365|    BYTE* const ostart = (BYTE*)dst;
 3264|    365|    BYTE* op = ostart;
 3265|    365|    BYTE* const oend = ostart + maxDstSize;
 3266|    365|    size_t errorCode, dumpsLength=0;
 3267|    365|    const BYTE* litPtr = dctx->litPtr;
 3268|    365|    const BYTE* const litEnd = litPtr + dctx->litSize;
 3269|    365|    int nbSeq=0;
 3270|    365|    const BYTE* dumps = NULL;
 3271|    365|    unsigned* DTableLL = dctx->LLTable;
 3272|    365|    unsigned* DTableML = dctx->MLTable;
 3273|    365|    unsigned* DTableOffb = dctx->OffTable;
 3274|    365|    const BYTE* const base = (const BYTE*) (dctx->base);
 3275|    365|    const BYTE* const vBase = (const BYTE*) (dctx->vBase);
 3276|    365|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 3277|       |
 3278|       |    /* Build Decoding Tables */
 3279|    365|    errorCode = ZSTDv05_decodeSeqHeaders(&nbSeq, &dumps, &dumpsLength,
 3280|    365|                                      DTableLL, DTableML, DTableOffb,
 3281|    365|                                      ip, seqSize, dctx->flagStaticTables);
 3282|    365|    if (ZSTDv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (3282:9): [True: 49, False: 316]
  ------------------
 3283|    316|    ip += errorCode;
 3284|       |
 3285|       |    /* Regen sequences */
 3286|    316|    if (nbSeq) {
  ------------------
  |  Branch (3286:9): [True: 291, False: 25]
  ------------------
 3287|    291|        seq_t sequence;
 3288|    291|        seqState_t seqState;
 3289|       |
 3290|    291|        memset(&sequence, 0, sizeof(sequence));
 3291|    291|        sequence.offset = REPCODE_STARTVALUE;
  ------------------
  |  |  415|    291|#define REPCODE_STARTVALUE 1
  ------------------
 3292|    291|        seqState.dumps = dumps;
 3293|    291|        seqState.dumpsEnd = dumps + dumpsLength;
 3294|    291|        seqState.prevOffset = REPCODE_STARTVALUE;
  ------------------
  |  |  415|    291|#define REPCODE_STARTVALUE 1
  ------------------
 3295|    291|        errorCode = BITv05_initDStream(&(seqState.DStream), ip, iend-ip);
 3296|    291|        if (ERR_isError(errorCode)) return ERROR(corruption_detected);
  ------------------
  |  |   49|      7|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      7|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      7|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3296:13): [True: 7, False: 284]
  ------------------
 3297|    284|        FSEv05_initDState(&(seqState.stateLL), &(seqState.DStream), DTableLL);
 3298|    284|        FSEv05_initDState(&(seqState.stateOffb), &(seqState.DStream), DTableOffb);
 3299|    284|        FSEv05_initDState(&(seqState.stateML), &(seqState.DStream), DTableML);
 3300|       |
 3301|  26.8k|        for ( ; (BITv05_reloadDStream(&(seqState.DStream)) <= BITv05_DStream_completed) && nbSeq ; ) {
  ------------------
  |  Branch (3301:17): [True: 26.8k, False: 89]
  |  Branch (3301:92): [True: 26.7k, False: 20]
  ------------------
 3302|  26.7k|            size_t oneSeqSize;
 3303|  26.7k|            nbSeq--;
 3304|  26.7k|            ZSTDv05_decodeSequence(&sequence, &seqState);
 3305|  26.7k|            oneSeqSize = ZSTDv05_execSequence(op, oend, sequence, &litPtr, litEnd, base, vBase, dictEnd);
 3306|  26.7k|            if (ZSTDv05_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  Branch (3306:17): [True: 175, False: 26.6k]
  ------------------
 3307|  26.6k|            op += oneSeqSize;
 3308|  26.6k|        }
 3309|       |
 3310|       |        /* check if reached exact end */
 3311|    109|        if (nbSeq) return ERROR(corruption_detected);
  ------------------
  |  |   49|     87|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     87|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     87|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3311:13): [True: 87, False: 22]
  ------------------
 3312|    109|    }
 3313|       |
 3314|       |    /* last literal segment */
 3315|     47|    {
 3316|     47|        size_t lastLLSize = litEnd - litPtr;
 3317|     47|        if (litPtr > litEnd) return ERROR(corruption_detected);   /* too many literals already used */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3317:13): [True: 0, False: 47]
  ------------------
 3318|     47|        if (op+lastLLSize > oend) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3318:13): [True: 2, False: 45]
  ------------------
 3319|     45|        if (lastLLSize > 0) {
  ------------------
  |  Branch (3319:13): [True: 43, False: 2]
  ------------------
 3320|     43|            memcpy(op, litPtr, lastLLSize);
 3321|     43|            op += lastLLSize;
 3322|     43|        }
 3323|     45|    }
 3324|       |
 3325|      0|    return op-ostart;
 3326|     47|}
zstd_v05.c:ZSTDv05_decodeSeqHeaders:
 2948|    365|{
 2949|    365|    const BYTE* const istart = (const BYTE*)src;
 2950|    365|    const BYTE* ip = istart;
 2951|    365|    const BYTE* const iend = istart + srcSize;
 2952|    365|    U32 LLtype, Offtype, MLtype;
 2953|    365|    unsigned LLlog, Offlog, MLlog;
 2954|    365|    size_t dumpsLength;
 2955|       |
 2956|       |    /* check */
 2957|    365|    if (srcSize < MIN_SEQUENCES_SIZE)
  ------------------
  |  |  438|    365|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  ------------------
  |  Branch (2957:9): [True: 1, False: 364]
  ------------------
 2958|      1|        return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2959|       |
 2960|       |    /* SeqHead */
 2961|    364|    *nbSeq = *ip++;
 2962|    364|    if (*nbSeq==0) return 1;
  ------------------
  |  Branch (2962:9): [True: 20, False: 344]
  ------------------
 2963|    344|    if (*nbSeq >= 128) {
  ------------------
  |  Branch (2963:9): [True: 210, False: 134]
  ------------------
 2964|    210|        if (ip >= iend) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2964:13): [True: 1, False: 209]
  ------------------
 2965|    209|        *nbSeq = ((nbSeq[0]-128)<<8) + *ip++;
 2966|    209|    }
 2967|       |
 2968|    343|    if (ip >= iend) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2968:9): [True: 1, False: 342]
  ------------------
 2969|    342|    LLtype  = *ip >> 6;
 2970|    342|    Offtype = (*ip >> 4) & 3;
 2971|    342|    MLtype  = (*ip >> 2) & 3;
 2972|    342|    if (*ip & 2) {
  ------------------
  |  Branch (2972:9): [True: 52, False: 290]
  ------------------
 2973|     52|        if (ip+3 > iend) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2973:13): [True: 2, False: 50]
  ------------------
 2974|     50|        dumpsLength  = ip[2];
 2975|     50|        dumpsLength += ip[1] << 8;
 2976|     50|        ip += 3;
 2977|    290|    } else {
 2978|    290|        if (ip+2 > iend) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2978:13): [True: 1, False: 289]
  ------------------
 2979|    289|        dumpsLength  = ip[1];
 2980|    289|        dumpsLength += (ip[0] & 1) << 8;
 2981|    289|        ip += 2;
 2982|    289|    }
 2983|    339|    *dumpsPtr = ip;
 2984|    339|    ip += dumpsLength;
 2985|    339|    *dumpsLengthPtr = dumpsLength;
 2986|       |
 2987|       |    /* check */
 2988|    339|    if (ip > iend-3) return ERROR(srcSize_wrong); /* min : all 3 are "raw", hence no header, but at least xxLog bits per type */
  ------------------
  |  |   49|      8|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      8|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      8|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2988:9): [True: 8, False: 331]
  ------------------
 2989|       |
 2990|       |    /* sequences */
 2991|    331|    {
 2992|    331|        S16 norm[MaxML+1];    /* assumption : MaxML >= MaxLL >= MaxOff */
 2993|    331|        size_t headerSize;
 2994|       |
 2995|       |        /* Build DTables */
 2996|    331|        switch(LLtype)
 2997|    331|        {
 2998|     53|        case FSEv05_ENCODING_RLE :
  ------------------
  |  |  431|     53|#define FSEv05_ENCODING_RLE     1
  ------------------
  |  Branch (2998:9): [True: 53, False: 278]
  ------------------
 2999|     53|            LLlog = 0;
 3000|     53|            FSEv05_buildDTable_rle(DTableLL, *ip++);
 3001|     53|            break;
 3002|    187|        case FSEv05_ENCODING_RAW :
  ------------------
  |  |  430|    187|#define FSEv05_ENCODING_RAW     0
  ------------------
  |  Branch (3002:9): [True: 187, False: 144]
  ------------------
 3003|    187|            LLlog = LLbits;
  ------------------
  |  |  419|    187|#define LLbits   6
  ------------------
 3004|    187|            FSEv05_buildDTable_raw(DTableLL, LLbits);
  ------------------
  |  |  419|    187|#define LLbits   6
  ------------------
 3005|    187|            break;
 3006|      3|        case FSEv05_ENCODING_STATIC:
  ------------------
  |  |  432|      3|#define FSEv05_ENCODING_STATIC  2
  ------------------
  |  Branch (3006:9): [True: 3, False: 328]
  ------------------
 3007|      3|            if (!flagStaticTable) return ERROR(corruption_detected);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3007:17): [True: 1, False: 2]
  ------------------
 3008|      2|            break;
 3009|     88|        case FSEv05_ENCODING_DYNAMIC :
  ------------------
  |  |  433|     88|#define FSEv05_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3009:9): [True: 88, False: 243]
  ------------------
 3010|     88|        default :   /* impossible */
  ------------------
  |  Branch (3010:9): [True: 0, False: 331]
  ------------------
 3011|     88|            {   unsigned max = MaxLL;
  ------------------
  |  |  423|     88|#define MaxLL  ((1<<LLbits) - 1)
  |  |  ------------------
  |  |  |  |  419|     88|#define LLbits   6
  |  |  ------------------
  ------------------
 3012|     88|                headerSize = FSEv05_readNCount(norm, &max, &LLlog, ip, iend-ip);
 3013|     88|                if (FSEv05_isError(headerSize)) return ERROR(GENERIC);
  ------------------
  |  |   49|      6|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      6|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      6|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3013:21): [True: 6, False: 82]
  ------------------
 3014|     82|                if (LLlog > LLFSEv05Log) return ERROR(corruption_detected);
  ------------------
  |  |  426|     82|#define LLFSEv05Log   10
  ------------------
                              if (LLlog > LLFSEv05Log) return ERROR(corruption_detected);
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3014:21): [True: 2, False: 80]
  ------------------
 3015|     80|                ip += headerSize;
 3016|     80|                FSEv05_buildDTable(DTableLL, norm, max, LLlog);
 3017|     80|        }   }
 3018|       |
 3019|    322|        switch(Offtype)
 3020|    322|        {
 3021|    136|        case FSEv05_ENCODING_RLE :
  ------------------
  |  |  431|    136|#define FSEv05_ENCODING_RLE     1
  ------------------
  |  Branch (3021:9): [True: 136, False: 186]
  ------------------
 3022|    136|            Offlog = 0;
 3023|    136|            if (ip > iend-2) return ERROR(srcSize_wrong);   /* min : "raw", hence no header, but at least xxLog bits */
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3023:17): [True: 1, False: 135]
  ------------------
 3024|    135|            FSEv05_buildDTable_rle(DTableOffb, *ip++ & MaxOff); /* if *ip > MaxOff, data is corrupted */
  ------------------
  |  |  424|    135|#define MaxOff ((1<<Offbits)- 1)
  |  |  ------------------
  |  |  |  |  420|    135|#define Offbits  5
  |  |  ------------------
  ------------------
 3025|    135|            break;
 3026|     45|        case FSEv05_ENCODING_RAW :
  ------------------
  |  |  430|     45|#define FSEv05_ENCODING_RAW     0
  ------------------
  |  Branch (3026:9): [True: 45, False: 277]
  ------------------
 3027|     45|            Offlog = Offbits;
  ------------------
  |  |  420|     45|#define Offbits  5
  ------------------
 3028|     45|            FSEv05_buildDTable_raw(DTableOffb, Offbits);
  ------------------
  |  |  420|     45|#define Offbits  5
  ------------------
 3029|     45|            break;
 3030|      4|        case FSEv05_ENCODING_STATIC:
  ------------------
  |  |  432|      4|#define FSEv05_ENCODING_STATIC  2
  ------------------
  |  Branch (3030:9): [True: 4, False: 318]
  ------------------
 3031|      4|            if (!flagStaticTable) return ERROR(corruption_detected);
  ------------------
  |  |   49|      3|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      3|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      3|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3031:17): [True: 3, False: 1]
  ------------------
 3032|      1|            break;
 3033|    137|        case FSEv05_ENCODING_DYNAMIC :
  ------------------
  |  |  433|    137|#define FSEv05_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3033:9): [True: 137, False: 185]
  ------------------
 3034|    137|        default :   /* impossible */
  ------------------
  |  Branch (3034:9): [True: 0, False: 322]
  ------------------
 3035|    137|            {   unsigned max = MaxOff;
  ------------------
  |  |  424|    137|#define MaxOff ((1<<Offbits)- 1)
  |  |  ------------------
  |  |  |  |  420|    137|#define Offbits  5
  |  |  ------------------
  ------------------
 3036|    137|                headerSize = FSEv05_readNCount(norm, &max, &Offlog, ip, iend-ip);
 3037|    137|                if (FSEv05_isError(headerSize)) return ERROR(GENERIC);
  ------------------
  |  |   49|      3|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      3|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      3|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3037:21): [True: 3, False: 134]
  ------------------
 3038|    134|                if (Offlog > OffFSEv05Log) return ERROR(corruption_detected);
  ------------------
  |  |  427|    134|#define OffFSEv05Log   9
  ------------------
                              if (Offlog > OffFSEv05Log) return ERROR(corruption_detected);
  ------------------
  |  |   49|      3|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      3|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      3|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3038:21): [True: 3, False: 131]
  ------------------
 3039|    131|                ip += headerSize;
 3040|    131|                FSEv05_buildDTable(DTableOffb, norm, max, Offlog);
 3041|    131|        }   }
 3042|       |
 3043|    312|        switch(MLtype)
 3044|    312|        {
 3045|     58|        case FSEv05_ENCODING_RLE :
  ------------------
  |  |  431|     58|#define FSEv05_ENCODING_RLE     1
  ------------------
  |  Branch (3045:9): [True: 58, False: 254]
  ------------------
 3046|     58|            MLlog = 0;
 3047|     58|            if (ip > iend-2) return ERROR(srcSize_wrong); /* min : "raw", hence no header, but at least xxLog bits */
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3047:17): [True: 1, False: 57]
  ------------------
 3048|     57|            FSEv05_buildDTable_rle(DTableML, *ip++);
 3049|     57|            break;
 3050|    174|        case FSEv05_ENCODING_RAW :
  ------------------
  |  |  430|    174|#define FSEv05_ENCODING_RAW     0
  ------------------
  |  Branch (3050:9): [True: 174, False: 138]
  ------------------
 3051|    174|            MLlog = MLbits;
  ------------------
  |  |  418|    174|#define MLbits   7
  ------------------
 3052|    174|            FSEv05_buildDTable_raw(DTableML, MLbits);
  ------------------
  |  |  418|    174|#define MLbits   7
  ------------------
 3053|    174|            break;
 3054|      5|        case FSEv05_ENCODING_STATIC:
  ------------------
  |  |  432|      5|#define FSEv05_ENCODING_STATIC  2
  ------------------
  |  Branch (3054:9): [True: 5, False: 307]
  ------------------
 3055|      5|            if (!flagStaticTable) return ERROR(corruption_detected);
  ------------------
  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3055:17): [True: 4, False: 1]
  ------------------
 3056|      1|            break;
 3057|     75|        case FSEv05_ENCODING_DYNAMIC :
  ------------------
  |  |  433|     75|#define FSEv05_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3057:9): [True: 75, False: 237]
  ------------------
 3058|     75|        default :   /* impossible */
  ------------------
  |  Branch (3058:9): [True: 0, False: 312]
  ------------------
 3059|     75|            {   unsigned max = MaxML;
  ------------------
  |  |  422|     75|#define MaxML  ((1<<MLbits) - 1)
  |  |  ------------------
  |  |  |  |  418|     75|#define MLbits   7
  |  |  ------------------
  ------------------
 3060|     75|                headerSize = FSEv05_readNCount(norm, &max, &MLlog, ip, iend-ip);
 3061|     75|                if (FSEv05_isError(headerSize)) return ERROR(GENERIC);
  ------------------
  |  |   49|      8|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      8|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      8|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3061:21): [True: 8, False: 67]
  ------------------
 3062|     67|                if (MLlog > MLFSEv05Log) return ERROR(corruption_detected);
  ------------------
  |  |  425|     67|#define MLFSEv05Log   10
  ------------------
                              if (MLlog > MLFSEv05Log) return ERROR(corruption_detected);
  ------------------
  |  |   49|      3|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      3|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      3|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3062:21): [True: 3, False: 64]
  ------------------
 3063|     64|                ip += headerSize;
 3064|     64|                FSEv05_buildDTable(DTableML, norm, max, MLlog);
 3065|     64|    }   }   }
 3066|       |
 3067|    296|    return ip-istart;
 3068|    312|}
zstd_v05.c:ZSTDv05_decodeSequence:
 3090|  26.7k|{
 3091|  26.7k|    size_t litLength;
 3092|  26.7k|    size_t prevOffset;
 3093|  26.7k|    size_t offset;
 3094|  26.7k|    size_t matchLength;
 3095|  26.7k|    const BYTE* dumps = seqState->dumps;
 3096|  26.7k|    const BYTE* const de = seqState->dumpsEnd;
 3097|       |
 3098|       |    /* Literal length */
 3099|  26.7k|    litLength = FSEv05_peakSymbol(&(seqState->stateLL));
 3100|  26.7k|    prevOffset = litLength ? seq->offset : seqState->prevOffset;
  ------------------
  |  Branch (3100:18): [True: 6.42k, False: 20.3k]
  ------------------
 3101|  26.7k|    if (litLength == MaxLL) {
  ------------------
  |  |  423|  26.7k|#define MaxLL  ((1<<LLbits) - 1)
  |  |  ------------------
  |  |  |  |  419|  26.7k|#define LLbits   6
  |  |  ------------------
  ------------------
  |  Branch (3101:9): [True: 1.94k, False: 24.8k]
  ------------------
 3102|  1.94k|        const U32 add = *dumps++;
 3103|  1.94k|        if (add < 255) litLength += add;
  ------------------
  |  Branch (3103:13): [True: 1.54k, False: 407]
  ------------------
 3104|    407|        else if (dumps + 2 <= de) {
  ------------------
  |  Branch (3104:18): [True: 106, False: 301]
  ------------------
 3105|    106|            litLength = MEM_readLE16(dumps);
 3106|    106|            dumps += 2;
 3107|    106|            if ((litLength & 1) && dumps < de) {
  ------------------
  |  Branch (3107:17): [True: 54, False: 52]
  |  Branch (3107:36): [True: 52, False: 2]
  ------------------
 3108|     52|                litLength += *dumps << 16;
 3109|     52|                dumps += 1;
 3110|     52|            }
 3111|    106|            litLength>>=1;
 3112|    106|        }
 3113|  1.94k|        if (dumps >= de) { dumps = de-1; }  /* late correction, to avoid read overflow (data is now corrupted anyway) */
  ------------------
  |  Branch (3113:13): [True: 944, False: 1.00k]
  ------------------
 3114|  1.94k|    }
 3115|       |
 3116|       |    /* Offset */
 3117|  26.7k|    {
 3118|  26.7k|        static const U32 offsetPrefix[MaxOff+1] = {
 3119|  26.7k|                1 /*fake*/, 1, 2, 4, 8, 16, 32, 64, 128, 256,
 3120|  26.7k|                512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144,
 3121|  26.7k|                524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, /*fake*/ 1, 1, 1, 1, 1 };
 3122|  26.7k|        U32 offsetCode = FSEv05_peakSymbol(&(seqState->stateOffb));   /* <= maxOff, by table construction */
 3123|  26.7k|        U32 nbBits = offsetCode - 1;
 3124|  26.7k|        if (offsetCode==0) nbBits = 0;   /* cmove */
  ------------------
  |  Branch (3124:13): [True: 22.1k, False: 4.61k]
  ------------------
 3125|  26.7k|        offset = offsetPrefix[offsetCode] + BITv05_readBits(&(seqState->DStream), nbBits);
 3126|  26.7k|        if (MEM_32bits()) BITv05_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3126:13): [True: 0, False: 26.7k]
  ------------------
 3127|  26.7k|        if (offsetCode==0) offset = prevOffset;   /* repcode, cmove */
  ------------------
  |  Branch (3127:13): [True: 22.1k, False: 4.61k]
  ------------------
 3128|  26.7k|        if (offsetCode | !litLength) seqState->prevOffset = seq->offset;   /* cmove */
  ------------------
  |  Branch (3128:13): [True: 23.4k, False: 3.36k]
  ------------------
 3129|  26.7k|        FSEv05_decodeSymbol(&(seqState->stateOffb), &(seqState->DStream));    /* update */
 3130|  26.7k|    }
 3131|       |
 3132|       |    /* Literal length update */
 3133|  26.7k|    FSEv05_decodeSymbol(&(seqState->stateLL), &(seqState->DStream));   /* update */
 3134|  26.7k|    if (MEM_32bits()) BITv05_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3134:9): [True: 0, False: 26.7k]
  ------------------
 3135|       |
 3136|       |    /* MatchLength */
 3137|  26.7k|    matchLength = FSEv05_decodeSymbol(&(seqState->stateML), &(seqState->DStream));
 3138|  26.7k|    if (matchLength == MaxML) {
  ------------------
  |  |  422|  26.7k|#define MaxML  ((1<<MLbits) - 1)
  |  |  ------------------
  |  |  |  |  418|  26.7k|#define MLbits   7
  |  |  ------------------
  ------------------
  |  Branch (3138:9): [True: 1.92k, False: 24.8k]
  ------------------
 3139|  1.92k|        const U32 add = dumps<de ? *dumps++ : 0;
  ------------------
  |  Branch (3139:25): [True: 1.91k, False: 6]
  ------------------
 3140|  1.92k|        if (add < 255) matchLength += add;
  ------------------
  |  Branch (3140:13): [True: 1.47k, False: 443]
  ------------------
 3141|    443|        else if (dumps + 2 <= de) {
  ------------------
  |  Branch (3141:18): [True: 142, False: 301]
  ------------------
 3142|    142|            matchLength = MEM_readLE16(dumps);
 3143|    142|            dumps += 2;
 3144|    142|            if ((matchLength & 1) && dumps < de) {
  ------------------
  |  Branch (3144:17): [True: 83, False: 59]
  |  Branch (3144:38): [True: 78, False: 5]
  ------------------
 3145|     78|                matchLength += *dumps << 16;
 3146|     78|                dumps += 1;
 3147|     78|            }
 3148|    142|            matchLength >>= 1;
 3149|    142|        }
 3150|  1.92k|        if (dumps >= de) { dumps = de-1; }  /* late correction, to avoid read overflow (data is now corrupted anyway) */
  ------------------
  |  Branch (3150:13): [True: 874, False: 1.04k]
  ------------------
 3151|  1.92k|    }
 3152|  26.7k|    matchLength += MINMATCH;
  ------------------
  |  |  414|  26.7k|#define MINMATCH 4
  ------------------
 3153|       |
 3154|       |    /* save result */
 3155|  26.7k|    seq->litLength = litLength;
 3156|  26.7k|    seq->offset = offset;
 3157|  26.7k|    seq->matchLength = matchLength;
 3158|  26.7k|    seqState->dumps = dumps;
 3159|       |
 3160|       |#if 0   /* debug */
 3161|       |    {
 3162|       |        static U64 totalDecoded = 0;
 3163|       |        printf("pos %6u : %3u literals & match %3u bytes at distance %6u \n",
 3164|       |           (U32)(totalDecoded), (U32)litLength, (U32)matchLength, (U32)offset);
 3165|       |        totalDecoded += litLength + matchLength;
 3166|       |    }
 3167|       |#endif
 3168|  26.7k|}
zstd_v05.c:FSEv05_peakSymbol:
  960|  53.5k|{
  961|  53.5k|    const FSEv05_decode_t DInfo = ((const FSEv05_decode_t*)(DStatePtr->table))[DStatePtr->state];
  962|  53.5k|    return DInfo.symbol;
  963|  53.5k|}
zstd_v05.c:ZSTDv05_execSequence:
 3175|  26.7k|{
 3176|  26.7k|    static const int dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
 3177|  26.7k|    static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
 3178|  26.7k|    BYTE* const oLitEnd = op + sequence.litLength;
 3179|  26.7k|    const size_t sequenceLength = sequence.litLength + sequence.matchLength;
 3180|  26.7k|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 3181|  26.7k|    BYTE* const oend_8 = oend-8;
 3182|  26.7k|    const BYTE* const litEnd = *litPtr + sequence.litLength;
 3183|  26.7k|    const BYTE* match = oLitEnd - sequence.offset;
 3184|       |
 3185|       |    /* checks */
 3186|  26.7k|    size_t const seqLength = sequence.litLength + sequence.matchLength;
 3187|       |
 3188|  26.7k|    if (seqLength > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|     47|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     47|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     47|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3188:9): [True: 47, False: 26.7k]
  ------------------
 3189|  26.7k|    if (sequence.litLength > (size_t)(litLimit - *litPtr)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     51|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     51|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     51|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3189:9): [True: 51, False: 26.6k]
  ------------------
 3190|       |    /* Now we know there are no overflow in literal nor match lengths, can use pointer checks */
 3191|  26.6k|    if (oLitEnd > oend_8) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3191:9): [True: 4, False: 26.6k]
  ------------------
 3192|       |
 3193|  26.6k|    if (oMatchEnd > oend) return ERROR(dstSize_tooSmall);   /* overwrite beyond dst buffer */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3193:9): [True: 0, False: 26.6k]
  ------------------
 3194|  26.6k|    if (litEnd > litLimit) return ERROR(corruption_detected);   /* overRead beyond lit buffer */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3194:9): [True: 0, False: 26.6k]
  ------------------
 3195|       |
 3196|       |    /* copy Literals */
 3197|  26.6k|    ZSTDv05_wildcopy(op, *litPtr, (ptrdiff_t)sequence.litLength);   /* note : oLitEnd <= oend-8 : no risk of overwrite beyond oend */
 3198|  26.6k|    op = oLitEnd;
 3199|  26.6k|    *litPtr = litEnd;   /* update for next sequence */
 3200|       |
 3201|       |    /* copy Match */
 3202|  26.6k|    if (sequence.offset > (size_t)(oLitEnd - base)) {
  ------------------
  |  Branch (3202:9): [True: 185, False: 26.5k]
  ------------------
 3203|       |        /* offset beyond prefix */
 3204|    185|        if (sequence.offset > (size_t)(oLitEnd - vBase))
  ------------------
  |  Branch (3204:13): [True: 73, False: 112]
  ------------------
 3205|     73|            return ERROR(corruption_detected);
  ------------------
  |  |   49|     73|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     73|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     73|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3206|    112|        match = dictEnd - (base-match);
 3207|    112|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (3207:13): [True: 76, False: 36]
  ------------------
 3208|     76|            memmove(oLitEnd, match, sequence.matchLength);
 3209|     76|            return sequenceLength;
 3210|     76|        }
 3211|       |        /* span extDict & currentPrefixSegment */
 3212|     36|        {
 3213|     36|            size_t length1 = dictEnd - match;
 3214|     36|            memmove(oLitEnd, match, length1);
 3215|     36|            op = oLitEnd + length1;
 3216|     36|            sequence.matchLength -= length1;
 3217|     36|            match = base;
 3218|     36|            if (op > oend_8 || sequence.matchLength < MINMATCH) {
  ------------------
  |  |  414|     36|#define MINMATCH 4
  ------------------
  |  Branch (3218:17): [True: 0, False: 36]
  |  Branch (3218:32): [True: 15, False: 21]
  ------------------
 3219|     48|              while (op < oMatchEnd) *op++ = *match++;
  ------------------
  |  Branch (3219:22): [True: 33, False: 15]
  ------------------
 3220|     15|              return sequenceLength;
 3221|     15|            }
 3222|     36|    }   }
 3223|       |    /* Requirement: op <= oend_8 */
 3224|       |
 3225|       |    /* match within prefix */
 3226|  26.5k|    if (sequence.offset < 8) {
  ------------------
  |  Branch (3226:9): [True: 23.4k, False: 3.12k]
  ------------------
 3227|       |        /* close range match, overlap */
 3228|  23.4k|        const int sub2 = dec64table[sequence.offset];
 3229|  23.4k|        op[0] = match[0];
 3230|  23.4k|        op[1] = match[1];
 3231|  23.4k|        op[2] = match[2];
 3232|  23.4k|        op[3] = match[3];
 3233|  23.4k|        match += dec32table[sequence.offset];
 3234|  23.4k|        ZSTDv05_copy4(op+4, match);
 3235|  23.4k|        match -= sub2;
 3236|  23.4k|    } else {
 3237|  3.12k|        ZSTDv05_copy8(op, match);
 3238|  3.12k|    }
 3239|  26.5k|    op += 8; match += 8;
 3240|       |
 3241|  26.5k|    if (oMatchEnd > oend-(16-MINMATCH)) {
  ------------------
  |  |  414|  26.5k|#define MINMATCH 4
  ------------------
  |  Branch (3241:9): [True: 25, False: 26.4k]
  ------------------
 3242|     25|        if (op < oend_8) {
  ------------------
  |  Branch (3242:13): [True: 20, False: 5]
  ------------------
 3243|     20|            ZSTDv05_wildcopy(op, match, oend_8 - op);
 3244|     20|            match += oend_8 - op;
 3245|     20|            op = oend_8;
 3246|     20|        }
 3247|    104|        while (op < oMatchEnd)
  ------------------
  |  Branch (3247:16): [True: 79, False: 25]
  ------------------
 3248|     79|            *op++ = *match++;
 3249|  26.4k|    } else {
 3250|  26.4k|        ZSTDv05_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8);   /* works even if matchLength < 8 */
 3251|  26.4k|    }
 3252|  26.5k|    return sequenceLength;
 3253|  26.6k|}
zstd_v05.c:ZSTDv05_wildcopy:
  458|  53.2k|{
  459|  53.2k|    const BYTE* ip = (const BYTE*)src;
  460|  53.2k|    BYTE* op = (BYTE*)dst;
  461|  53.2k|    BYTE* const oend = op + length;
  462|  53.2k|    do
  463|  42.9M|        COPY8(op, ip)
  ------------------
  |  |  453|  42.9M|#define COPY8(d,s) { ZSTDv05_copy8(d,s); d+=8; s+=8; }
  ------------------
  464|  42.9M|    while (op < oend);
  ------------------
  |  Branch (464:12): [True: 42.9M, False: 53.2k]
  ------------------
  465|  53.2k|}
zstd_v05.c:ZSTDv05_copy4:
 2569|  23.4k|static void ZSTDv05_copy4(void* dst, const void* src) { memcpy(dst, src, 4); }
zstd_v05.c:ZSTDv05_copy8:
  451|  42.9M|static void ZSTDv05_copy8(void* dst, const void* src) { memcpy(dst, src, 8); }
zstd_v05.c:ZSTDv05_decompress_continueDCtx:
 3373|  1.48k|{
 3374|  1.48k|    const BYTE* ip = (const BYTE*)src;
 3375|  1.48k|    const BYTE* iend = ip + srcSize;
 3376|  1.48k|    BYTE* const ostart = (BYTE*)dst;
 3377|  1.48k|    BYTE* op = ostart;
 3378|  1.48k|    BYTE* const oend = ostart + maxDstSize;
 3379|  1.48k|    size_t remainingSize = srcSize;
 3380|  1.48k|    blockProperties_t blockProperties;
 3381|  1.48k|    memset(&blockProperties, 0, sizeof(blockProperties));
 3382|       |
 3383|       |    /* Frame Header */
 3384|  1.48k|    {   size_t frameHeaderSize;
 3385|  1.48k|        if (srcSize < ZSTDv05_frameHeaderSize_min+ZSTDv05_blockHeaderSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3385:13): [True: 0, False: 1.48k]
  ------------------
 3386|  1.48k|        frameHeaderSize = ZSTDv05_decodeFrameHeader_Part1(dctx, src, ZSTDv05_frameHeaderSize_min);
 3387|  1.48k|        if (ZSTDv05_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  Branch (3387:13): [True: 0, False: 1.48k]
  ------------------
 3388|  1.48k|        if (srcSize < frameHeaderSize+ZSTDv05_blockHeaderSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3388:13): [True: 0, False: 1.48k]
  ------------------
 3389|  1.48k|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3390|  1.48k|        frameHeaderSize = ZSTDv05_decodeFrameHeader_Part2(dctx, src, frameHeaderSize);
 3391|  1.48k|        if (ZSTDv05_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  Branch (3391:13): [True: 22, False: 1.46k]
  ------------------
 3392|  1.48k|    }
 3393|       |
 3394|       |    /* Loop on each block */
 3395|  2.27k|    while (1)
  ------------------
  |  Branch (3395:12): [True: 2.27k, Folded]
  ------------------
 3396|  2.27k|    {
 3397|  2.27k|        size_t decodedSize=0;
 3398|  2.27k|        size_t cBlockSize = ZSTDv05_getcBlockSize(ip, iend-ip, &blockProperties);
 3399|  2.27k|        if (ZSTDv05_isError(cBlockSize)) return cBlockSize;
  ------------------
  |  Branch (3399:13): [True: 0, False: 2.27k]
  ------------------
 3400|       |
 3401|  2.27k|        ip += ZSTDv05_blockHeaderSize;
 3402|  2.27k|        remainingSize -= ZSTDv05_blockHeaderSize;
 3403|  2.27k|        if (cBlockSize > remainingSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3403:13): [True: 0, False: 2.27k]
  ------------------
 3404|       |
 3405|  2.27k|        switch(blockProperties.blockType)
 3406|  2.27k|        {
 3407|  1.02k|        case bt_compressed:
  ------------------
  |  Branch (3407:9): [True: 1.02k, False: 1.24k]
  ------------------
 3408|  1.02k|            decodedSize = ZSTDv05_decompressBlock_internal(dctx, op, oend-op, ip, cBlockSize);
 3409|  1.02k|            break;
 3410|    821|        case bt_raw :
  ------------------
  |  Branch (3410:9): [True: 821, False: 1.45k]
  ------------------
 3411|    821|            decodedSize = ZSTDv05_copyRawBlock(op, oend-op, ip, cBlockSize);
 3412|    821|            break;
 3413|     11|        case bt_rle :
  ------------------
  |  Branch (3413:9): [True: 11, False: 2.26k]
  ------------------
 3414|     11|            return ERROR(GENERIC);   /* not yet supported */
  ------------------
  |  |   49|     11|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     11|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     11|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3415|      0|            break;
 3416|    414|        case bt_end :
  ------------------
  |  Branch (3416:9): [True: 414, False: 1.85k]
  ------------------
 3417|       |            /* end of frame */
 3418|    414|            if (remainingSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3418:17): [True: 0, False: 414]
  ------------------
 3419|    414|            break;
 3420|    414|        default:
  ------------------
  |  Branch (3420:9): [True: 0, False: 2.27k]
  ------------------
 3421|      0|            return ERROR(GENERIC);   /* impossible */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3422|  2.27k|        }
 3423|  2.26k|        if (cBlockSize == 0) break;   /* bt_end */
  ------------------
  |  Branch (3423:13): [True: 730, False: 1.53k]
  ------------------
 3424|       |
 3425|  1.53k|        if (ZSTDv05_isError(decodedSize)) return decodedSize;
  ------------------
  |  Branch (3425:13): [True: 721, False: 810]
  ------------------
 3426|    810|        op += decodedSize;
 3427|    810|        ip += cBlockSize;
 3428|    810|        remainingSize -= cBlockSize;
 3429|    810|    }
 3430|       |
 3431|    730|    return op-ostart;
 3432|  1.46k|}
zstd_v05.c:ZSTD_errorFrameSizeInfoLegacy:
 3479|     58|{
 3480|     58|    *cSize = ret;
 3481|     58|    *dBound = ZSTD_CONTENTSIZE_ERROR;
  ------------------
  |  |  443|     58|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
 3482|     58|}
zstd_v05.c:ZSTDv05_getcBlockSize:
 2779|  5.78k|{
 2780|  5.78k|    const BYTE* const in = (const BYTE*)src;
 2781|  5.78k|    BYTE headerFlags;
 2782|  5.78k|    U32 cSize;
 2783|       |
 2784|  5.78k|    if (srcSize < 3)
  ------------------
  |  Branch (2784:9): [True: 5, False: 5.78k]
  ------------------
 2785|      5|        return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      5|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      5|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      5|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2786|       |
 2787|  5.78k|    headerFlags = *in;
 2788|  5.78k|    cSize = in[2] + (in[1]<<8) + ((in[0] & 7)<<16);
 2789|       |
 2790|  5.78k|    bpPtr->blockType = (blockType_t)(headerFlags >> 6);
 2791|  5.78k|    bpPtr->origSize = (bpPtr->blockType == bt_rle) ? cSize : 0;
  ------------------
  |  Branch (2791:23): [True: 368, False: 5.41k]
  ------------------
 2792|       |
 2793|  5.78k|    if (bpPtr->blockType == bt_end) return 0;
  ------------------
  |  Branch (2793:9): [True: 1.45k, False: 4.33k]
  ------------------
 2794|  4.33k|    if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (2794:9): [True: 368, False: 3.96k]
  ------------------
 2795|  3.96k|    return cSize;
 2796|  4.33k|}
zstd_v05.c:ZSTDv05_decodeFrameHeader_Part1:
 2740|  1.48k|{
 2741|  1.48k|    U32 magicNumber;
 2742|  1.48k|    if (srcSize != ZSTDv05_frameHeaderSize_min)
  ------------------
  |  Branch (2742:9): [True: 0, False: 1.48k]
  ------------------
 2743|      0|        return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2744|  1.48k|    magicNumber = MEM_readLE32(src);
 2745|  1.48k|    if (magicNumber != ZSTDv05_MAGICNUMBER) return ERROR(prefix_unknown);
  ------------------
  |  |  153|  1.48k|#define ZSTDv05_MAGICNUMBER 0xFD2FB525   /* v0.5 */
  ------------------
                  if (magicNumber != ZSTDv05_MAGICNUMBER) return ERROR(prefix_unknown);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2745:9): [True: 0, False: 1.48k]
  ------------------
 2746|  1.48k|    zc->headerSize = ZSTDv05_frameHeaderSize_min;
 2747|  1.48k|    return zc->headerSize;
 2748|  1.48k|}
zstd_v05.c:ZSTDv05_decodeFrameHeader_Part2:
 2768|  1.48k|{
 2769|  1.48k|    size_t result;
 2770|  1.48k|    if (srcSize != zc->headerSize)
  ------------------
  |  Branch (2770:9): [True: 0, False: 1.48k]
  ------------------
 2771|      0|        return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2772|  1.48k|    result = ZSTDv05_getFrameParams(&(zc->params), src, srcSize);
 2773|  1.48k|    if ((MEM_32bits()) && (zc->params.windowLog > 25)) return ERROR(frameParameter_unsupported);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2773:9): [True: 0, False: 1.48k]
  |  Branch (2773:27): [True: 0, False: 0]
  ------------------
 2774|  1.48k|    return result;
 2775|  1.48k|}
zstd_v05.c:ZSTDv05_copyRawBlock:
 2800|    821|{
 2801|    821|    if (dst==NULL) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2801:9): [True: 0, False: 821]
  ------------------
 2802|    821|    if (srcSize > maxDstSize) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2802:9): [True: 0, False: 821]
  ------------------
 2803|    821|    memcpy(dst, src, srcSize);
 2804|    821|    return srcSize;
 2805|    821|}
zstd_v05.c:ZSTDv05_decompress_insertDictionary:
 3663|    951|{
 3664|    951|    size_t eSize;
 3665|    951|    U32 magic = MEM_readLE32(dict);
 3666|    951|    if (magic != ZSTDv05_DICT_MAGIC) {
  ------------------
  |  |  390|    951|#define ZSTDv05_DICT_MAGIC  0xEC30A435
  ------------------
  |  Branch (3666:9): [True: 191, False: 760]
  ------------------
 3667|       |        /* pure content mode */
 3668|    191|        ZSTDv05_refDictContent(dctx, dict, dictSize);
 3669|    191|        return 0;
 3670|    191|    }
 3671|       |    /* load entropy tables */
 3672|    760|    dict = (const char*)dict + 4;
 3673|    760|    dictSize -= 4;
 3674|    760|    eSize = ZSTDv05_loadEntropy(dctx, dict, dictSize);
 3675|    760|    if (ZSTDv05_isError(eSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|    666|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    666|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    666|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3675:9): [True: 666, False: 94]
  ------------------
 3676|       |
 3677|       |    /* reference dictionary content */
 3678|     94|    dict = (const char*)dict + eSize;
 3679|     94|    dictSize -= eSize;
 3680|     94|    ZSTDv05_refDictContent(dctx, dict, dictSize);
 3681|       |
 3682|     94|    return 0;
 3683|    760|}
zstd_v05.c:ZSTDv05_refDictContent:
 3614|    285|{
 3615|    285|    dctx->dictEnd = dctx->previousDstEnd;
 3616|    285|    dctx->vBase = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3617|    285|    dctx->base = dict;
 3618|    285|    dctx->previousDstEnd = (const char*)dict + dictSize;
 3619|    285|}
zstd_v05.c:ZSTDv05_loadEntropy:
 3622|    760|{
 3623|    760|    size_t hSize, offcodeHeaderSize, matchlengthHeaderSize, errorCode, litlengthHeaderSize;
 3624|    760|    short offcodeNCount[MaxOff+1];
 3625|    760|    unsigned offcodeMaxValue=MaxOff, offcodeLog;
  ------------------
  |  |  424|    760|#define MaxOff ((1<<Offbits)- 1)
  |  |  ------------------
  |  |  |  |  420|    760|#define Offbits  5
  |  |  ------------------
  ------------------
 3626|    760|    short matchlengthNCount[MaxML+1];
 3627|    760|    unsigned matchlengthMaxValue = MaxML, matchlengthLog;
  ------------------
  |  |  422|    760|#define MaxML  ((1<<MLbits) - 1)
  |  |  ------------------
  |  |  |  |  418|    760|#define MLbits   7
  |  |  ------------------
  ------------------
 3628|    760|    short litlengthNCount[MaxLL+1];
 3629|    760|    unsigned litlengthMaxValue = MaxLL, litlengthLog;
  ------------------
  |  |  423|    760|#define MaxLL  ((1<<LLbits) - 1)
  |  |  ------------------
  |  |  |  |  419|    760|#define LLbits   6
  |  |  ------------------
  ------------------
 3630|       |
 3631|    760|    hSize = HUFv05_readDTableX4(dctx->hufTableX4, dict, dictSize);
 3632|    760|    if (HUFv05_isError(hSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|    548|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    548|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    548|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3632:9): [True: 548, False: 212]
  ------------------
 3633|    212|    dict = (const char*)dict + hSize;
 3634|    212|    dictSize -= hSize;
 3635|       |
 3636|    212|    offcodeHeaderSize = FSEv05_readNCount(offcodeNCount, &offcodeMaxValue, &offcodeLog, dict, dictSize);
 3637|    212|    if (FSEv05_isError(offcodeHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|     27|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     27|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     27|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3637:9): [True: 27, False: 185]
  ------------------
 3638|    185|    if (offcodeLog > OffFSEv05Log) return ERROR(dictionary_corrupted);
  ------------------
  |  |  427|    185|#define OffFSEv05Log   9
  ------------------
                  if (offcodeLog > OffFSEv05Log) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|     18|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     18|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     18|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3638:9): [True: 18, False: 167]
  ------------------
 3639|    167|    errorCode = FSEv05_buildDTable(dctx->OffTable, offcodeNCount, offcodeMaxValue, offcodeLog);
 3640|    167|    if (FSEv05_isError(errorCode)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3640:9): [True: 0, False: 167]
  ------------------
 3641|    167|    dict = (const char*)dict + offcodeHeaderSize;
 3642|    167|    dictSize -= offcodeHeaderSize;
 3643|       |
 3644|    167|    matchlengthHeaderSize = FSEv05_readNCount(matchlengthNCount, &matchlengthMaxValue, &matchlengthLog, dict, dictSize);
 3645|    167|    if (FSEv05_isError(matchlengthHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|     18|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     18|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     18|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3645:9): [True: 18, False: 149]
  ------------------
 3646|    149|    if (matchlengthLog > MLFSEv05Log) return ERROR(dictionary_corrupted);
  ------------------
  |  |  425|    149|#define MLFSEv05Log   10
  ------------------
                  if (matchlengthLog > MLFSEv05Log) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|     18|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     18|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     18|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3646:9): [True: 18, False: 131]
  ------------------
 3647|    131|    errorCode = FSEv05_buildDTable(dctx->MLTable, matchlengthNCount, matchlengthMaxValue, matchlengthLog);
 3648|    131|    if (FSEv05_isError(errorCode)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3648:9): [True: 0, False: 131]
  ------------------
 3649|    131|    dict = (const char*)dict + matchlengthHeaderSize;
 3650|    131|    dictSize -= matchlengthHeaderSize;
 3651|       |
 3652|    131|    litlengthHeaderSize = FSEv05_readNCount(litlengthNCount, &litlengthMaxValue, &litlengthLog, dict, dictSize);
 3653|    131|    if (litlengthLog > LLFSEv05Log) return ERROR(dictionary_corrupted);
  ------------------
  |  |  426|    131|#define LLFSEv05Log   10
  ------------------
                  if (litlengthLog > LLFSEv05Log) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|     31|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     31|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     31|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3653:9): [True: 31, False: 100]
  ------------------
 3654|    100|    if (FSEv05_isError(litlengthHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|      6|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      6|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      6|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3654:9): [True: 6, False: 94]
  ------------------
 3655|     94|    errorCode = FSEv05_buildDTable(dctx->LLTable, litlengthNCount, litlengthMaxValue, litlengthLog);
 3656|     94|    if (FSEv05_isError(errorCode)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3656:9): [True: 0, False: 94]
  ------------------
 3657|       |
 3658|     94|    dctx->flagStaticTables = 1;
 3659|     94|    return hSize + offcodeHeaderSize + matchlengthHeaderSize + litlengthHeaderSize;
 3660|     94|}

FSEv06_readNCount:
 1209|  1.95k|{
 1210|  1.95k|    const BYTE* const istart = (const BYTE*) headerBuffer;
 1211|  1.95k|    const BYTE* const iend = istart + hbSize;
 1212|  1.95k|    const BYTE* ip = istart;
 1213|  1.95k|    int nbBits;
 1214|  1.95k|    int remaining;
 1215|  1.95k|    int threshold;
 1216|  1.95k|    U32 bitStream;
 1217|  1.95k|    int bitCount;
 1218|  1.95k|    unsigned charnum = 0;
 1219|  1.95k|    int previous0 = 0;
 1220|       |
 1221|  1.95k|    if (hbSize < 4) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     18|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     18|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     18|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1221:9): [True: 18, False: 1.94k]
  ------------------
 1222|  1.94k|    bitStream = MEM_readLE32(ip);
 1223|  1.94k|    nbBits = (bitStream & 0xF) + FSEv06_MIN_TABLELOG;   /* extract tableLog */
  ------------------
  |  | 1138|  1.94k|#define FSEv06_MIN_TABLELOG 5
  ------------------
 1224|  1.94k|    if (nbBits > FSEv06_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1140|  1.94k|#define FSEv06_TABLELOG_ABSOLUTE_MAX 15
  ------------------
                  if (nbBits > FSEv06_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|     79|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     79|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     79|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1224:9): [True: 79, False: 1.86k]
  ------------------
 1225|  1.86k|    bitStream >>= 4;
 1226|  1.86k|    bitCount = 4;
 1227|  1.86k|    *tableLogPtr = nbBits;
 1228|  1.86k|    remaining = (1<<nbBits)+1;
 1229|  1.86k|    threshold = 1<<nbBits;
 1230|  1.86k|    nbBits++;
 1231|       |
 1232|  25.0k|    while ((remaining>1) && (charnum<=*maxSVPtr)) {
  ------------------
  |  Branch (1232:12): [True: 23.2k, False: 1.81k]
  |  Branch (1232:29): [True: 23.2k, False: 16]
  ------------------
 1233|  23.2k|        if (previous0) {
  ------------------
  |  Branch (1233:13): [True: 2.09k, False: 21.1k]
  ------------------
 1234|  2.09k|            unsigned n0 = charnum;
 1235|  2.20k|            while ((bitStream & 0xFFFF) == 0xFFFF) {
  ------------------
  |  Branch (1235:20): [True: 107, False: 2.09k]
  ------------------
 1236|    107|                n0+=24;
 1237|    107|                if (ip < iend-5) {
  ------------------
  |  Branch (1237:21): [True: 91, False: 16]
  ------------------
 1238|     91|                    ip+=2;
 1239|     91|                    bitStream = MEM_readLE32(ip) >> bitCount;
 1240|     91|                } else {
 1241|     16|                    bitStream >>= 16;
 1242|     16|                    bitCount+=16;
 1243|     16|            }   }
 1244|  2.68k|            while ((bitStream & 3) == 3) {
  ------------------
  |  Branch (1244:20): [True: 583, False: 2.09k]
  ------------------
 1245|    583|                n0+=3;
 1246|    583|                bitStream>>=2;
 1247|    583|                bitCount+=2;
 1248|    583|            }
 1249|  2.09k|            n0 += bitStream & 3;
 1250|  2.09k|            bitCount += 2;
 1251|  2.09k|            if (n0 > *maxSVPtr) return ERROR(maxSymbolValue_tooSmall);
  ------------------
  |  |   49|     29|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     29|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     29|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1251:17): [True: 29, False: 2.07k]
  ------------------
 1252|  5.79k|            while (charnum < n0) normalizedCounter[charnum++] = 0;
  ------------------
  |  Branch (1252:20): [True: 3.72k, False: 2.07k]
  ------------------
 1253|  2.07k|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1253:17): [True: 1.36k, False: 706]
  |  Branch (1253:35): [True: 204, False: 502]
  ------------------
 1254|  1.56k|                ip += bitCount>>3;
 1255|  1.56k|                bitCount &= 7;
 1256|  1.56k|                bitStream = MEM_readLE32(ip) >> bitCount;
 1257|  1.56k|            }
 1258|    502|            else
 1259|    502|                bitStream >>= 2;
 1260|  2.07k|        }
 1261|  23.1k|        {   short const max = (short)((2*threshold-1)-remaining);
 1262|  23.1k|            short count;
 1263|       |
 1264|  23.1k|            if ((bitStream & (threshold-1)) < (U32)max) {
  ------------------
  |  Branch (1264:17): [True: 16.3k, False: 6.88k]
  ------------------
 1265|  16.3k|                count = (short)(bitStream & (threshold-1));
 1266|  16.3k|                bitCount   += nbBits-1;
 1267|  16.3k|            } else {
 1268|  6.88k|                count = (short)(bitStream & (2*threshold-1));
 1269|  6.88k|                if (count >= threshold) count -= max;
  ------------------
  |  Branch (1269:21): [True: 2.72k, False: 4.15k]
  ------------------
 1270|  6.88k|                bitCount   += nbBits;
 1271|  6.88k|            }
 1272|       |
 1273|  23.1k|            count--;   /* extra accuracy */
 1274|  23.1k|            remaining -= FSEv06_abs(count);
 1275|  23.1k|            normalizedCounter[charnum++] = count;
 1276|  23.1k|            previous0 = !count;
 1277|  36.1k|            while (remaining < threshold) {
  ------------------
  |  Branch (1277:20): [True: 12.9k, False: 23.1k]
  ------------------
 1278|  12.9k|                nbBits--;
 1279|  12.9k|                threshold >>= 1;
 1280|  12.9k|            }
 1281|       |
 1282|  23.1k|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1282:17): [True: 19.0k, False: 4.09k]
  |  Branch (1282:35): [True: 1.37k, False: 2.72k]
  ------------------
 1283|  20.4k|                ip += bitCount>>3;
 1284|  20.4k|                bitCount &= 7;
 1285|  20.4k|            } else {
 1286|  2.72k|                bitCount -= (int)(8 * (iend - 4 - ip));
 1287|  2.72k|                ip = iend - 4;
 1288|  2.72k|            }
 1289|  23.1k|            bitStream = MEM_readLE32(ip) >> (bitCount & 31);
 1290|  23.1k|    }   }   /* while ((remaining>1) && (charnum<=*maxSVPtr)) */
 1291|  1.83k|    if (remaining != 1) return ERROR(GENERIC);
  ------------------
  |  |   49|     16|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     16|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     16|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1291:9): [True: 16, False: 1.81k]
  ------------------
 1292|  1.81k|    *maxSVPtr = charnum-1;
 1293|       |
 1294|  1.81k|    ip += (bitCount+7)>>3;
 1295|  1.81k|    if ((size_t)(ip-istart) > hbSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     31|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     31|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     31|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1295:9): [True: 31, False: 1.78k]
  ------------------
 1296|  1.78k|    return ip-istart;
 1297|  1.81k|}
FSEv06_buildDTable:
 1403|  2.08k|{
 1404|  2.08k|    void* const tdPtr = dt+1;   /* because *dt is unsigned, 32-bits aligned on 32-bits */
 1405|  2.08k|    FSEv06_DECODE_TYPE* const tableDecode = (FSEv06_DECODE_TYPE*) (tdPtr);
  ------------------
  |  | 1125|  2.08k|#define FSEv06_DECODE_TYPE FSEv06_decode_t
  ------------------
 1406|  2.08k|    U16 symbolNext[FSEv06_MAX_SYMBOL_VALUE+1];
 1407|       |
 1408|  2.08k|    U32 const maxSV1 = maxSymbolValue + 1;
 1409|  2.08k|    U32 const tableSize = 1 << tableLog;
 1410|  2.08k|    U32 highThreshold = tableSize-1;
 1411|       |
 1412|       |    /* Sanity Checks */
 1413|  2.08k|    if (maxSymbolValue > FSEv06_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  | 1117|  2.08k|#define FSEv06_MAX_SYMBOL_VALUE 255
  ------------------
                  if (maxSymbolValue > FSEv06_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1413:9): [True: 0, False: 2.08k]
  ------------------
 1414|  2.08k|    if (tableLog > FSEv06_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1134|  2.08k|#define FSEv06_MAX_TABLELOG  (FSEv06_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1111|  2.08k|#define FSEv06_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
                  if (tableLog > FSEv06_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|     11|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     11|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     11|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1414:9): [True: 11, False: 2.07k]
  ------------------
 1415|       |
 1416|       |    /* Init, lay down lowprob symbols */
 1417|  2.07k|    {   FSEv06_DTableHeader DTableH;
 1418|  2.07k|        DTableH.tableLog = (U16)tableLog;
 1419|  2.07k|        DTableH.fastMode = 1;
 1420|  2.07k|        {   S16 const largeLimit= (S16)(1 << (tableLog-1));
 1421|  2.07k|            U32 s;
 1422|  39.3k|            for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (1422:23): [True: 37.2k, False: 2.07k]
  ------------------
 1423|  37.2k|                if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (1423:21): [True: 11.4k, False: 25.7k]
  ------------------
 1424|  11.4k|                    tableDecode[highThreshold--].symbol = (FSEv06_FUNCTION_TYPE)s;
 1425|  11.4k|                    symbolNext[s] = 1;
 1426|  25.7k|                } else {
 1427|  25.7k|                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
  ------------------
  |  Branch (1427:25): [True: 966, False: 24.8k]
  ------------------
 1428|  25.7k|                    symbolNext[s] = normalizedCounter[s];
 1429|  25.7k|        }   }   }
 1430|  2.07k|        memcpy(dt, &DTableH, sizeof(DTableH));
 1431|  2.07k|    }
 1432|       |
 1433|       |    /* Spread symbols */
 1434|  2.07k|    {   U32 const tableMask = tableSize-1;
 1435|  2.07k|        U32 const step = FSEv06_TABLESTEP(tableSize);
  ------------------
  |  | 1145|  2.07k|#define FSEv06_TABLESTEP(tableSize) ((tableSize>>1) + (tableSize>>3) + 3)
  ------------------
 1436|  2.07k|        U32 s, position = 0;
 1437|  39.3k|        for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (1437:19): [True: 37.2k, False: 2.07k]
  ------------------
 1438|  37.2k|            int i;
 1439|   656k|            for (i=0; i<normalizedCounter[s]; i++) {
  ------------------
  |  Branch (1439:23): [True: 619k, False: 37.2k]
  ------------------
 1440|   619k|                tableDecode[position].symbol = (FSEv06_FUNCTION_TYPE)s;
 1441|   619k|                position = (position + step) & tableMask;
 1442|   630k|                while (position > highThreshold) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  Branch (1442:24): [True: 11.2k, False: 619k]
  ------------------
 1443|   619k|        }   }
 1444|       |
 1445|  2.07k|        if (position!=0) return ERROR(GENERIC);   /* position must reach all cells once, otherwise normalizedCounter is incorrect */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1445:13): [True: 0, False: 2.07k]
  ------------------
 1446|  2.07k|    }
 1447|       |
 1448|       |    /* Build Decoding table */
 1449|  2.07k|    {   U32 u;
 1450|   633k|        for (u=0; u<tableSize; u++) {
  ------------------
  |  Branch (1450:19): [True: 631k, False: 2.07k]
  ------------------
 1451|   631k|            FSEv06_FUNCTION_TYPE const symbol = (FSEv06_FUNCTION_TYPE)(tableDecode[u].symbol);
  ------------------
  |  | 1123|   631k|#define FSEv06_FUNCTION_TYPE BYTE
  ------------------
 1452|   631k|            U16 nextState = symbolNext[symbol]++;
 1453|   631k|            tableDecode[u].nbBits = (BYTE) (tableLog - BITv06_highbit32 ((U32)nextState) );
 1454|   631k|            tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
 1455|   631k|    }   }
 1456|       |
 1457|  2.07k|    return 0;
 1458|  2.07k|}
FSEv06_buildDTable_rle:
 1468|    231|{
 1469|    231|    void* ptr = dt;
 1470|    231|    FSEv06_DTableHeader* const DTableH = (FSEv06_DTableHeader*)ptr;
 1471|    231|    void* dPtr = dt + 1;
 1472|    231|    FSEv06_decode_t* const cell = (FSEv06_decode_t*)dPtr;
 1473|       |
 1474|    231|    DTableH->tableLog = 0;
 1475|    231|    DTableH->fastMode = 0;
 1476|       |
 1477|    231|    cell->newState = 0;
 1478|    231|    cell->symbol = symbolValue;
 1479|    231|    cell->nbBits = 0;
 1480|       |
 1481|    231|    return 0;
 1482|    231|}
FSEv06_decompress_usingDTable:
 1582|    705|{
 1583|    705|    const void* ptr = dt;
 1584|    705|    const FSEv06_DTableHeader* DTableH = (const FSEv06_DTableHeader*)ptr;
 1585|    705|    const U32 fastMode = DTableH->fastMode;
 1586|       |
 1587|       |    /* select fast mode (static) */
 1588|    705|    if (fastMode) return FSEv06_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 1);
  ------------------
  |  Branch (1588:9): [True: 273, False: 432]
  ------------------
 1589|    432|    return FSEv06_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 0);
 1590|    705|}
FSEv06_decompress:
 1594|    766|{
 1595|    766|    const BYTE* const istart = (const BYTE*)cSrc;
 1596|    766|    const BYTE* ip = istart;
 1597|    766|    short counting[FSEv06_MAX_SYMBOL_VALUE+1];
 1598|    766|    DTable_max_t dt;   /* Static analyzer seems unable to understand this table will be properly initialized later */
 1599|    766|    unsigned tableLog;
 1600|    766|    unsigned maxSymbolValue = FSEv06_MAX_SYMBOL_VALUE;
  ------------------
  |  | 1117|    766|#define FSEv06_MAX_SYMBOL_VALUE 255
  ------------------
 1601|       |
 1602|    766|    if (cSrcSize<2) return ERROR(srcSize_wrong);   /* too small input size */
  ------------------
  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1602:9): [True: 10, False: 756]
  ------------------
 1603|       |
 1604|       |    /* normal FSE decoding mode */
 1605|    756|    {   size_t const NCountLength = FSEv06_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize);
 1606|    756|        if (FSEv06_isError(NCountLength)) return NCountLength;
  ------------------
  |  | 1357|    756|#define FSEv06_isError ERR_isError
  ------------------
  |  Branch (1606:13): [True: 30, False: 726]
  ------------------
 1607|    726|        if (NCountLength >= cSrcSize) return ERROR(srcSize_wrong);   /* too small input size */
  ------------------
  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1607:13): [True: 10, False: 716]
  ------------------
 1608|    716|        ip += NCountLength;
 1609|    716|        cSrcSize -= NCountLength;
 1610|    716|    }
 1611|       |
 1612|      0|    { size_t const errorCode = FSEv06_buildDTable (dt, counting, maxSymbolValue, tableLog);
 1613|    716|      if (FSEv06_isError(errorCode)) return errorCode; }
  ------------------
  |  | 1357|    716|#define FSEv06_isError ERR_isError
  ------------------
  |  Branch (1613:11): [True: 11, False: 705]
  ------------------
 1614|       |
 1615|    705|    return FSEv06_decompress_usingDTable (dst, maxDstSize, ip, cSrcSize, dt);   /* always return, even if it is an error code */
 1616|    716|}
HUFv06_readDTableX2:
 1949|    479|{
 1950|    479|    BYTE huffWeight[HUFv06_MAX_SYMBOL_VALUE + 1];
 1951|    479|    U32 rankVal[HUFv06_ABSOLUTEMAX_TABLELOG + 1];   /* large enough for values from 0 to 16 */
 1952|    479|    U32 tableLog = 0;
 1953|    479|    size_t iSize;
 1954|    479|    U32 nbSymbols = 0;
 1955|    479|    U32 n;
 1956|    479|    U32 nextRankStart;
 1957|    479|    void* const dtPtr = DTable + 1;
 1958|    479|    HUFv06_DEltX2* const dt = (HUFv06_DEltX2*)dtPtr;
 1959|       |
 1960|    479|    HUFv06_STATIC_ASSERT(sizeof(HUFv06_DEltX2) == sizeof(U16));   /* if compilation fails here, assertion is false */
  ------------------
  |  | 1929|    479|#define HUFv06_STATIC_ASSERT(c) { enum { HUFv06_static_assert = 1/(int)(!!(c)) }; }   /* use only *after* variable declarations */
  ------------------
 1961|       |    /* memset(huffWeight, 0, sizeof(huffWeight)); */   /* is not necessary, even though some analyzer complain ... */
 1962|       |
 1963|    479|    iSize = HUFv06_readStats(huffWeight, HUFv06_MAX_SYMBOL_VALUE + 1, rankVal, &nbSymbols, &tableLog, src, srcSize);
  ------------------
  |  | 1786|    479|#define HUFv06_MAX_SYMBOL_VALUE 255
  ------------------
 1964|    479|    if (HUFv06_isError(iSize)) return iSize;
  ------------------
  |  Branch (1964:9): [True: 137, False: 342]
  ------------------
 1965|       |
 1966|       |    /* check result */
 1967|    342|    if (tableLog > DTable[0]) return ERROR(tableLog_tooLarge);   /* DTable is too small */
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1967:9): [True: 1, False: 341]
  ------------------
 1968|    341|    DTable[0] = (U16)tableLog;   /* maybe should separate sizeof allocated DTable, from used size of DTable, in case of re-use */
 1969|       |
 1970|       |    /* Prepare ranks */
 1971|    341|    nextRankStart = 0;
 1972|  2.22k|    for (n=1; n<tableLog+1; n++) {
  ------------------
  |  Branch (1972:15): [True: 1.87k, False: 341]
  ------------------
 1973|  1.87k|        U32 current = nextRankStart;
 1974|  1.87k|        nextRankStart += (rankVal[n] << (n-1));
 1975|  1.87k|        rankVal[n] = current;
 1976|  1.87k|    }
 1977|       |
 1978|       |    /* fill DTable */
 1979|  14.3k|    for (n=0; n<nbSymbols; n++) {
  ------------------
  |  Branch (1979:15): [True: 14.0k, False: 341]
  ------------------
 1980|  14.0k|        const U32 w = huffWeight[n];
 1981|  14.0k|        const U32 length = (1 << w) >> 1;
 1982|  14.0k|        U32 i;
 1983|  14.0k|        HUFv06_DEltX2 D;
 1984|  14.0k|        D.byte = (BYTE)n; D.nbBits = (BYTE)(tableLog + 1 - w);
 1985|  57.1k|        for (i = rankVal[w]; i < rankVal[w] + length; i++)
  ------------------
  |  Branch (1985:30): [True: 43.1k, False: 14.0k]
  ------------------
 1986|  43.1k|            dt[i] = D;
 1987|  14.0k|        rankVal[w] += length;
 1988|  14.0k|    }
 1989|       |
 1990|    341|    return iSize;
 1991|    342|}
HUFv06_decompress1X2_usingDTable:
 2040|     97|{
 2041|     97|    BYTE* op = (BYTE*)dst;
 2042|     97|    BYTE* const oend = op + dstSize;
 2043|     97|    const U32 dtLog = DTable[0];
 2044|     97|    const void* dtPtr = DTable;
 2045|     97|    const HUFv06_DEltX2* const dt = ((const HUFv06_DEltX2*)dtPtr)+1;
 2046|     97|    BITv06_DStream_t bitD;
 2047|       |
 2048|     97|    { size_t const errorCode = BITv06_initDStream(&bitD, cSrc, cSrcSize);
 2049|     97|      if (HUFv06_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (2049:11): [True: 23, False: 74]
  ------------------
 2050|       |
 2051|     74|    HUFv06_decodeStreamX2(op, &bitD, oend, dt, dtLog);
 2052|       |
 2053|       |    /* check */
 2054|     74|    if (!BITv06_endOfDStream(&bitD)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     73|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     73|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     73|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2054:9): [True: 73, False: 1]
  ------------------
 2055|       |
 2056|      1|    return dstSize;
 2057|     74|}
HUFv06_decompress1X2:
 2060|    100|{
 2061|    100|    HUFv06_CREATE_STATIC_DTABLEX2(DTable, HUFv06_MAX_TABLELOG);
  ------------------
  |  | 1743|    100|        unsigned short DTable[HUFv06_DTABLE_SIZE(maxTableLog)] = { maxTableLog }
  ------------------
 2062|    100|    const BYTE* ip = (const BYTE*) cSrc;
 2063|       |
 2064|    100|    size_t const errorCode = HUFv06_readDTableX2 (DTable, cSrc, cSrcSize);
 2065|    100|    if (HUFv06_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2065:9): [True: 2, False: 98]
  ------------------
 2066|     98|    if (errorCode >= cSrcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2066:9): [True: 1, False: 97]
  ------------------
 2067|     97|    ip += errorCode;
 2068|     97|    cSrcSize -= errorCode;
 2069|       |
 2070|     97|    return HUFv06_decompress1X2_usingDTable (dst, dstSize, ip, cSrcSize, DTable);
 2071|     98|}
HUFv06_decompress4X2_usingDTable:
 2078|    242|{
 2079|       |    /* Check */
 2080|    242|    if (cSrcSize < 10) return ERROR(corruption_detected);  /* strict minimum : jump table + 1 byte per stream */
  ------------------
  |  |   49|     25|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     25|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     25|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2080:9): [True: 25, False: 217]
  ------------------
 2081|       |
 2082|    217|    {   const BYTE* const istart = (const BYTE*) cSrc;
 2083|    217|        BYTE* const ostart = (BYTE*) dst;
 2084|    217|        BYTE* const oend = ostart + dstSize;
 2085|    217|        const void* const dtPtr = DTable;
 2086|    217|        const HUFv06_DEltX2* const dt = ((const HUFv06_DEltX2*)dtPtr) +1;
 2087|    217|        const U32 dtLog = DTable[0];
 2088|    217|        size_t errorCode;
 2089|       |
 2090|       |        /* Init */
 2091|    217|        BITv06_DStream_t bitD1;
 2092|    217|        BITv06_DStream_t bitD2;
 2093|    217|        BITv06_DStream_t bitD3;
 2094|    217|        BITv06_DStream_t bitD4;
 2095|    217|        const size_t length1 = MEM_readLE16(istart);
 2096|    217|        const size_t length2 = MEM_readLE16(istart+2);
 2097|    217|        const size_t length3 = MEM_readLE16(istart+4);
 2098|    217|        size_t length4;
 2099|    217|        const BYTE* const istart1 = istart + 6;  /* jumpTable */
 2100|    217|        const BYTE* const istart2 = istart1 + length1;
 2101|    217|        const BYTE* const istart3 = istart2 + length2;
 2102|    217|        const BYTE* const istart4 = istart3 + length3;
 2103|    217|        const size_t segmentSize = (dstSize+3) / 4;
 2104|    217|        BYTE* const opStart2 = ostart + segmentSize;
 2105|    217|        BYTE* const opStart3 = opStart2 + segmentSize;
 2106|    217|        BYTE* const opStart4 = opStart3 + segmentSize;
 2107|    217|        BYTE* op1 = ostart;
 2108|    217|        BYTE* op2 = opStart2;
 2109|    217|        BYTE* op3 = opStart3;
 2110|    217|        BYTE* op4 = opStart4;
 2111|    217|        U32 endSignal;
 2112|       |
 2113|    217|        length4 = cSrcSize - (length1 + length2 + length3 + 6);
 2114|    217|        if (length4 > cSrcSize) return ERROR(corruption_detected);   /* overflow */
  ------------------
  |  |   49|     23|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     23|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     23|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2114:13): [True: 23, False: 194]
  ------------------
 2115|    194|        errorCode = BITv06_initDStream(&bitD1, istart1, length1);
 2116|    194|        if (HUFv06_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2116:13): [True: 16, False: 178]
  ------------------
 2117|    178|        errorCode = BITv06_initDStream(&bitD2, istart2, length2);
 2118|    178|        if (HUFv06_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2118:13): [True: 28, False: 150]
  ------------------
 2119|    150|        errorCode = BITv06_initDStream(&bitD3, istart3, length3);
 2120|    150|        if (HUFv06_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2120:13): [True: 27, False: 123]
  ------------------
 2121|    123|        errorCode = BITv06_initDStream(&bitD4, istart4, length4);
 2122|    123|        if (HUFv06_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2122:13): [True: 6, False: 117]
  ------------------
 2123|       |
 2124|       |        /* 16-32 symbols per loop (4-8 symbols per stream) */
 2125|    117|        endSignal = BITv06_reloadDStream(&bitD1) | BITv06_reloadDStream(&bitD2) | BITv06_reloadDStream(&bitD3) | BITv06_reloadDStream(&bitD4);
 2126|    999|        for ( ; (endSignal==BITv06_DStream_unfinished) && (op4<(oend-7)) ; ) {
  ------------------
  |  Branch (2126:17): [True: 890, False: 109]
  |  Branch (2126:59): [True: 882, False: 8]
  ------------------
 2127|    882|            HUFv06_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 2010|    882|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 882, False: 0]
  |  |  ------------------
  |  | 2011|    882|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    882|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2128|    882|            HUFv06_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 2010|    882|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 882, False: 0]
  |  |  ------------------
  |  | 2011|    882|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    882|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2129|    882|            HUFv06_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 2010|    882|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 882, False: 0]
  |  |  ------------------
  |  | 2011|    882|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    882|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2130|    882|            HUFv06_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 2010|    882|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 882, False: 0]
  |  |  ------------------
  |  | 2011|    882|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    882|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2131|    882|            HUFv06_DECODE_SYMBOLX2_1(op1, &bitD1);
  ------------------
  |  | 2006|    882|    if (MEM_64bits() || (HUFv06_MAX_TABLELOG<=12)) \
  |  |  ------------------
  |  |  |  | 1784|      0|#define HUFv06_MAX_TABLELOG  12           /* max configured tableLog (for static allocation); can be modified up to HUFv06_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (2006:9): [True: 882, False: 0]
  |  |  |  Branch (2006:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2007|    882|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    882|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2132|    882|            HUFv06_DECODE_SYMBOLX2_1(op2, &bitD2);
  ------------------
  |  | 2006|    882|    if (MEM_64bits() || (HUFv06_MAX_TABLELOG<=12)) \
  |  |  ------------------
  |  |  |  | 1784|      0|#define HUFv06_MAX_TABLELOG  12           /* max configured tableLog (for static allocation); can be modified up to HUFv06_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (2006:9): [True: 882, False: 0]
  |  |  |  Branch (2006:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2007|    882|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    882|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2133|    882|            HUFv06_DECODE_SYMBOLX2_1(op3, &bitD3);
  ------------------
  |  | 2006|    882|    if (MEM_64bits() || (HUFv06_MAX_TABLELOG<=12)) \
  |  |  ------------------
  |  |  |  | 1784|      0|#define HUFv06_MAX_TABLELOG  12           /* max configured tableLog (for static allocation); can be modified up to HUFv06_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (2006:9): [True: 882, False: 0]
  |  |  |  Branch (2006:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2007|    882|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    882|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2134|    882|            HUFv06_DECODE_SYMBOLX2_1(op4, &bitD4);
  ------------------
  |  | 2006|    882|    if (MEM_64bits() || (HUFv06_MAX_TABLELOG<=12)) \
  |  |  ------------------
  |  |  |  | 1784|      0|#define HUFv06_MAX_TABLELOG  12           /* max configured tableLog (for static allocation); can be modified up to HUFv06_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (2006:9): [True: 882, False: 0]
  |  |  |  Branch (2006:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2007|    882|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    882|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2135|    882|            HUFv06_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 2010|    882|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 882, False: 0]
  |  |  ------------------
  |  | 2011|    882|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    882|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2136|    882|            HUFv06_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 2010|    882|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 882, False: 0]
  |  |  ------------------
  |  | 2011|    882|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    882|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2137|    882|            HUFv06_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 2010|    882|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 882, False: 0]
  |  |  ------------------
  |  | 2011|    882|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    882|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2138|    882|            HUFv06_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 2010|    882|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 882, False: 0]
  |  |  ------------------
  |  | 2011|    882|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    882|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2139|    882|            HUFv06_DECODE_SYMBOLX2_0(op1, &bitD1);
  ------------------
  |  | 2003|    882|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2140|    882|            HUFv06_DECODE_SYMBOLX2_0(op2, &bitD2);
  ------------------
  |  | 2003|    882|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2141|    882|            HUFv06_DECODE_SYMBOLX2_0(op3, &bitD3);
  ------------------
  |  | 2003|    882|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2142|    882|            HUFv06_DECODE_SYMBOLX2_0(op4, &bitD4);
  ------------------
  |  | 2003|    882|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2143|    882|            endSignal = BITv06_reloadDStream(&bitD1) | BITv06_reloadDStream(&bitD2) | BITv06_reloadDStream(&bitD3) | BITv06_reloadDStream(&bitD4);
 2144|    882|        }
 2145|       |
 2146|       |        /* check corruption */
 2147|    117|        if (op1 > opStart2) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2147:13): [True: 0, False: 117]
  ------------------
 2148|    117|        if (op2 > opStart3) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2148:13): [True: 0, False: 117]
  ------------------
 2149|    117|        if (op3 > opStart4) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2149:13): [True: 0, False: 117]
  ------------------
 2150|       |        /* note : op4 supposed already verified within main loop */
 2151|       |
 2152|       |        /* finish bitStreams one by one */
 2153|    117|        HUFv06_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog);
 2154|    117|        HUFv06_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog);
 2155|    117|        HUFv06_decodeStreamX2(op3, &bitD3, opStart4, dt, dtLog);
 2156|    117|        HUFv06_decodeStreamX2(op4, &bitD4, oend,     dt, dtLog);
 2157|       |
 2158|       |        /* check */
 2159|    117|        endSignal = BITv06_endOfDStream(&bitD1) & BITv06_endOfDStream(&bitD2) & BITv06_endOfDStream(&bitD3) & BITv06_endOfDStream(&bitD4);
 2160|    117|        if (!endSignal) return ERROR(corruption_detected);
  ------------------
  |  |   49|    117|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    117|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    117|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2160:13): [True: 117, False: 0]
  ------------------
 2161|       |
 2162|       |        /* decoded size */
 2163|      0|        return dstSize;
 2164|    117|    }
 2165|    117|}
HUFv06_decompress4X2:
 2169|    379|{
 2170|    379|    HUFv06_CREATE_STATIC_DTABLEX2(DTable, HUFv06_MAX_TABLELOG);
  ------------------
  |  | 1743|    379|        unsigned short DTable[HUFv06_DTABLE_SIZE(maxTableLog)] = { maxTableLog }
  ------------------
 2171|    379|    const BYTE* ip = (const BYTE*) cSrc;
 2172|       |
 2173|    379|    size_t const errorCode = HUFv06_readDTableX2 (DTable, cSrc, cSrcSize);
 2174|    379|    if (HUFv06_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2174:9): [True: 136, False: 243]
  ------------------
 2175|    243|    if (errorCode >= cSrcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2175:9): [True: 1, False: 242]
  ------------------
 2176|    242|    ip += errorCode;
 2177|    242|    cSrcSize -= errorCode;
 2178|       |
 2179|    242|    return HUFv06_decompress4X2_usingDTable (dst, dstSize, ip, cSrcSize, DTable);
 2180|    243|}
HUFv06_readDTableX4:
 2272|    610|{
 2273|    610|    BYTE weightList[HUFv06_MAX_SYMBOL_VALUE + 1];
 2274|    610|    sortedSymbol_t sortedSymbol[HUFv06_MAX_SYMBOL_VALUE + 1];
 2275|    610|    U32 rankStats[HUFv06_ABSOLUTEMAX_TABLELOG + 1] = { 0 };
 2276|    610|    U32 rankStart0[HUFv06_ABSOLUTEMAX_TABLELOG + 2] = { 0 };
 2277|    610|    U32* const rankStart = rankStart0+1;
 2278|    610|    rankVal_t rankVal;
 2279|    610|    U32 tableLog, maxW, sizeOfSort, nbSymbols;
 2280|    610|    const U32 memLog = DTable[0];
 2281|    610|    size_t iSize;
 2282|    610|    void* dtPtr = DTable;
 2283|    610|    HUFv06_DEltX4* const dt = ((HUFv06_DEltX4*)dtPtr) + 1;
 2284|       |
 2285|    610|    HUFv06_STATIC_ASSERT(sizeof(HUFv06_DEltX4) == sizeof(U32));   /* if compilation fails here, assertion is false */
  ------------------
  |  | 1929|    610|#define HUFv06_STATIC_ASSERT(c) { enum { HUFv06_static_assert = 1/(int)(!!(c)) }; }   /* use only *after* variable declarations */
  ------------------
 2286|    610|    if (memLog > HUFv06_ABSOLUTEMAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1783|    610|#define HUFv06_ABSOLUTEMAX_TABLELOG  16   /* absolute limit of HUFv06_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
                  if (memLog > HUFv06_ABSOLUTEMAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2286:9): [True: 0, False: 610]
  ------------------
 2287|       |    /* memset(weightList, 0, sizeof(weightList)); */   /* is not necessary, even though some analyzer complain ... */
 2288|       |
 2289|    610|    iSize = HUFv06_readStats(weightList, HUFv06_MAX_SYMBOL_VALUE + 1, rankStats, &nbSymbols, &tableLog, src, srcSize);
  ------------------
  |  | 1786|    610|#define HUFv06_MAX_SYMBOL_VALUE 255
  ------------------
 2290|    610|    if (HUFv06_isError(iSize)) return iSize;
  ------------------
  |  Branch (2290:9): [True: 316, False: 294]
  ------------------
 2291|       |
 2292|       |    /* check result */
 2293|    294|    if (tableLog > memLog) return ERROR(tableLog_tooLarge);   /* DTable can't fit code depth */
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2293:9): [True: 1, False: 293]
  ------------------
 2294|       |
 2295|       |    /* find maxWeight */
 2296|    597|    for (maxW = tableLog; rankStats[maxW]==0; maxW--) {}  /* necessarily finds a solution before 0 */
  ------------------
  |  Branch (2296:27): [True: 304, False: 293]
  ------------------
 2297|       |
 2298|       |    /* Get start index of each weight */
 2299|    293|    {   U32 w, nextRankStart = 0;
 2300|  1.71k|        for (w=1; w<maxW+1; w++) {
  ------------------
  |  Branch (2300:19): [True: 1.42k, False: 293]
  ------------------
 2301|  1.42k|            U32 current = nextRankStart;
 2302|  1.42k|            nextRankStart += rankStats[w];
 2303|  1.42k|            rankStart[w] = current;
 2304|  1.42k|        }
 2305|    293|        rankStart[0] = nextRankStart;   /* put all 0w symbols at the end of sorted list*/
 2306|    293|        sizeOfSort = nextRankStart;
 2307|    293|    }
 2308|       |
 2309|       |    /* sort symbols by weight */
 2310|    293|    {   U32 s;
 2311|  19.9k|        for (s=0; s<nbSymbols; s++) {
  ------------------
  |  Branch (2311:19): [True: 19.6k, False: 293]
  ------------------
 2312|  19.6k|            U32 const w = weightList[s];
 2313|  19.6k|            U32 const r = rankStart[w]++;
 2314|  19.6k|            sortedSymbol[r].symbol = (BYTE)s;
 2315|  19.6k|            sortedSymbol[r].weight = (BYTE)w;
 2316|  19.6k|        }
 2317|    293|        rankStart[0] = 0;   /* forget 0w symbols; this is beginning of weight(1) */
 2318|    293|    }
 2319|       |
 2320|       |    /* Build rankVal */
 2321|    293|    {   U32* const rankVal0 = rankVal[0];
 2322|    293|        {   int const rescale = (memLog-tableLog) - 1;   /* tableLog <= memLog */
 2323|    293|            U32 nextRankVal = 0;
 2324|    293|            U32 w;
 2325|  1.71k|            for (w=1; w<maxW+1; w++) {
  ------------------
  |  Branch (2325:23): [True: 1.42k, False: 293]
  ------------------
 2326|  1.42k|                U32 current = nextRankVal;
 2327|  1.42k|                nextRankVal += rankStats[w] << (w+rescale);
 2328|  1.42k|                rankVal0[w] = current;
 2329|  1.42k|        }   }
 2330|    293|        {   U32 const minBits = tableLog+1 - maxW;
 2331|    293|            U32 consumed;
 2332|  2.91k|            for (consumed = minBits; consumed < memLog - minBits + 1; consumed++) {
  ------------------
  |  Branch (2332:38): [True: 2.62k, False: 293]
  ------------------
 2333|  2.62k|                U32* const rankValPtr = rankVal[consumed];
 2334|  2.62k|                U32 w;
 2335|  16.1k|                for (w = 1; w < maxW+1; w++) {
  ------------------
  |  Branch (2335:29): [True: 13.5k, False: 2.62k]
  ------------------
 2336|  13.5k|                    rankValPtr[w] = rankVal0[w] >> consumed;
 2337|  13.5k|    }   }   }   }
 2338|       |
 2339|    293|    HUFv06_fillDTableX4(dt, memLog,
 2340|    293|                   sortedSymbol, sizeOfSort,
 2341|    293|                   rankStart0, rankVal, maxW,
 2342|    293|                   tableLog+1);
 2343|       |
 2344|    293|    return iSize;
 2345|    294|}
HUFv06_decompress1X4_usingDTable:
 2412|     63|{
 2413|     63|    const BYTE* const istart = (const BYTE*) cSrc;
 2414|     63|    BYTE* const ostart = (BYTE*) dst;
 2415|     63|    BYTE* const oend = ostart + dstSize;
 2416|       |
 2417|     63|    const U32 dtLog = DTable[0];
 2418|     63|    const void* const dtPtr = DTable;
 2419|     63|    const HUFv06_DEltX4* const dt = ((const HUFv06_DEltX4*)dtPtr) +1;
 2420|       |
 2421|       |    /* Init */
 2422|     63|    BITv06_DStream_t bitD;
 2423|     63|    { size_t const errorCode = BITv06_initDStream(&bitD, istart, cSrcSize);
 2424|     63|      if (HUFv06_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (2424:11): [True: 12, False: 51]
  ------------------
 2425|       |
 2426|       |    /* decode */
 2427|     51|    HUFv06_decodeStreamX4(ostart, &bitD, oend, dt, dtLog);
 2428|       |
 2429|       |    /* check */
 2430|     51|    if (!BITv06_endOfDStream(&bitD)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     49|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     49|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     49|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2430:9): [True: 49, False: 2]
  ------------------
 2431|       |
 2432|       |    /* decoded size */
 2433|      2|    return dstSize;
 2434|     51|}
HUFv06_decompress:
 2590|    421|{
 2591|    421|    static const decompressionAlgo decompress[3] = { HUFv06_decompress4X2, HUFv06_decompress4X4, NULL };
 2592|    421|    U32 Dtime[3];   /* decompression time estimation */
 2593|       |
 2594|       |    /* validation checks */
 2595|    421|    if (dstSize == 0) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2595:9): [True: 4, False: 417]
  ------------------
 2596|    417|    if (cSrcSize > dstSize) return ERROR(corruption_detected);   /* invalid */
  ------------------
  |  |   49|      6|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      6|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      6|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2596:9): [True: 6, False: 411]
  ------------------
 2597|    411|    if (cSrcSize == dstSize) { memcpy(dst, cSrc, dstSize); return dstSize; }   /* not compressed */
  ------------------
  |  Branch (2597:9): [True: 1, False: 410]
  ------------------
 2598|    410|    if (cSrcSize == 1) { memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; }   /* RLE */
  ------------------
  |  Branch (2598:9): [True: 31, False: 379]
  ------------------
 2599|       |
 2600|       |    /* decoder timing evaluation */
 2601|    379|    {   U32 const Q = (U32)(cSrcSize * 16 / dstSize);   /* Q < 16 since dstSize > cSrcSize */
 2602|    379|        U32 const D256 = (U32)(dstSize >> 8);
 2603|  1.51k|        U32 n; for (n=0; n<3; n++)
  ------------------
  |  Branch (2603:26): [True: 1.13k, False: 379]
  ------------------
 2604|  1.13k|            Dtime[n] = algoTime[Q][n].tableTime + (algoTime[Q][n].decode256Time * D256);
 2605|    379|    }
 2606|       |
 2607|    379|    Dtime[1] += Dtime[1] >> 4; Dtime[2] += Dtime[2] >> 3; /* advantage to algorithms using less memory, for cache eviction */
 2608|       |
 2609|    379|    {   U32 algoNb = 0;
 2610|    379|        if (Dtime[1] < Dtime[0]) algoNb = 1;
  ------------------
  |  Branch (2610:13): [True: 0, False: 379]
  ------------------
 2611|       |        /* if (Dtime[2] < Dtime[algoNb]) algoNb = 2; */   /* current speed of HUFv06_decompress4X6 is not good */
 2612|    379|        return decompress[algoNb](dst, dstSize, cSrc, cSrcSize);
 2613|    410|    }
 2614|       |
 2615|       |    /* return HUFv06_decompress4X2(dst, dstSize, cSrc, cSrcSize); */   /* multi-streams single-symbol decoding */
 2616|       |    /* return HUFv06_decompress4X4(dst, dstSize, cSrc, cSrcSize); */   /* multi-streams double-symbols decoding */
 2617|       |    /* return HUFv06_decompress4X6(dst, dstSize, cSrc, cSrcSize); */   /* multi-streams quad-symbols decoding */
 2618|    410|}
ZSTDv06_decompressBegin:
 2774|  3.51k|{
 2775|  3.51k|    dctx->expected = ZSTDv06_frameHeaderSize_min;
 2776|  3.51k|    dctx->stage = ZSTDds_getFrameHeaderSize;
 2777|  3.51k|    dctx->previousDstEnd = NULL;
 2778|  3.51k|    dctx->base = NULL;
 2779|  3.51k|    dctx->vBase = NULL;
 2780|  3.51k|    dctx->dictEnd = NULL;
 2781|  3.51k|    dctx->hufTableX4[0] = ZSTD_HUFFDTABLE_CAPACITY_LOG;
  ------------------
  |  |  426|  3.51k|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
 2782|  3.51k|    dctx->flagRepeatTable = 0;
 2783|  3.51k|    return 0;
 2784|  3.51k|}
ZSTDv06_createDCtx:
 2787|  1.75k|{
 2788|  1.75k|    ZSTDv06_DCtx* dctx = (ZSTDv06_DCtx*)malloc(sizeof(ZSTDv06_DCtx));
 2789|  1.75k|    if (dctx==NULL) return NULL;
  ------------------
  |  Branch (2789:9): [True: 0, False: 1.75k]
  ------------------
 2790|  1.75k|    ZSTDv06_decompressBegin(dctx);
 2791|  1.75k|    return dctx;
 2792|  1.75k|}
ZSTDv06_freeDCtx:
 2795|  1.75k|{
 2796|  1.75k|    free(dctx);
 2797|  1.75k|    return 0;   /* reserved as a potential error code in the future */
 2798|  1.75k|}
ZSTDv06_getFrameParams:
 2925|  2.46k|{
 2926|  2.46k|    const BYTE* ip = (const BYTE*)src;
 2927|       |
 2928|  2.46k|    if (srcSize < ZSTDv06_frameHeaderSize_min) return ZSTDv06_frameHeaderSize_min;
  ------------------
  |  Branch (2928:9): [True: 0, False: 2.46k]
  ------------------
 2929|  2.46k|    if (MEM_readLE32(src) != ZSTDv06_MAGICNUMBER) return ERROR(prefix_unknown);
  ------------------
  |  |  164|  2.46k|#define ZSTDv06_MAGICNUMBER 0xFD2FB526   /* v0.6 */
  ------------------
                  if (MEM_readLE32(src) != ZSTDv06_MAGICNUMBER) return ERROR(prefix_unknown);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2929:9): [True: 0, False: 2.46k]
  ------------------
 2930|       |
 2931|       |    /* ensure there is enough `srcSize` to fully read/decode frame header */
 2932|  2.46k|    { size_t const fhsize = ZSTDv06_frameHeaderSize(src, srcSize);
 2933|  2.46k|      if (srcSize < fhsize) return fhsize; }
  ------------------
  |  Branch (2933:11): [True: 0, False: 2.46k]
  ------------------
 2934|       |
 2935|  2.46k|    memset(fparamsPtr, 0, sizeof(*fparamsPtr));
 2936|  2.46k|    {   BYTE const frameDesc = ip[4];
 2937|  2.46k|        fparamsPtr->windowLog = (frameDesc & 0xF) + ZSTDv06_WINDOWLOG_ABSOLUTEMIN;
  ------------------
  |  |  416|  2.46k|#define ZSTDv06_WINDOWLOG_ABSOLUTEMIN 12
  ------------------
 2938|  2.46k|        if ((frameDesc & 0x20) != 0) return ERROR(frameParameter_unsupported);   /* reserved 1 bit */
  ------------------
  |  |   49|      6|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      6|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      6|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2938:13): [True: 6, False: 2.45k]
  ------------------
 2939|  2.45k|        switch(frameDesc >> 6)  /* fcsId */
 2940|  2.45k|        {
 2941|      0|            default:   /* impossible */
  ------------------
  |  Branch (2941:13): [True: 0, False: 2.45k]
  ------------------
 2942|  1.36k|            case 0 : fparamsPtr->frameContentSize = 0; break;
  ------------------
  |  Branch (2942:13): [True: 1.36k, False: 1.09k]
  ------------------
 2943|      8|            case 1 : fparamsPtr->frameContentSize = ip[5]; break;
  ------------------
  |  Branch (2943:13): [True: 8, False: 2.44k]
  ------------------
 2944|    930|            case 2 : fparamsPtr->frameContentSize = MEM_readLE16(ip+5)+256; break;
  ------------------
  |  Branch (2944:13): [True: 930, False: 1.52k]
  ------------------
 2945|    154|            case 3 : fparamsPtr->frameContentSize = MEM_readLE64(ip+5); break;
  ------------------
  |  Branch (2945:13): [True: 154, False: 2.30k]
  ------------------
 2946|  2.45k|    }   }
 2947|  2.45k|    return 0;
 2948|  2.45k|}
ZSTDv06_decompress_usingDict:
 3581|  1.75k|{
 3582|  1.75k|    ZSTDv06_decompressBegin_usingDict(dctx, dict, dictSize);
 3583|  1.75k|    ZSTDv06_checkContinuity(dctx, dst);
 3584|  1.75k|    return ZSTDv06_decompressFrame(dctx, dst, dstCapacity, src, srcSize);
 3585|  1.75k|}
ZSTDv06_findFrameSizeInfoLegacy:
 3618|  1.80k|{
 3619|  1.80k|    const BYTE* ip = (const BYTE*)src;
 3620|  1.80k|    size_t remainingSize = srcSize;
 3621|  1.80k|    size_t nbBlocks = 0;
 3622|  1.80k|    blockProperties_t blockProperties = { bt_compressed, 0 };
 3623|       |
 3624|       |    /* Frame Header */
 3625|  1.80k|    {   size_t const frameHeaderSize = ZSTDv06_frameHeaderSize(src, srcSize);
 3626|  1.80k|        if (ZSTDv06_isError(frameHeaderSize)) {
  ------------------
  |  | 2731|  1.80k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3626:13): [True: 0, False: 1.80k]
  ------------------
 3627|      0|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, frameHeaderSize);
 3628|      0|            return;
 3629|      0|        }
 3630|  1.80k|        if (MEM_readLE32(src) != ZSTDv06_MAGICNUMBER) {
  ------------------
  |  |  164|  1.80k|#define ZSTDv06_MAGICNUMBER 0xFD2FB526   /* v0.6 */
  ------------------
  |  Branch (3630:13): [True: 0, False: 1.80k]
  ------------------
 3631|      0|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(prefix_unknown));
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3632|      0|            return;
 3633|      0|        }
 3634|  1.80k|        if (srcSize < frameHeaderSize+ZSTDv06_blockHeaderSize) {
  ------------------
  |  Branch (3634:13): [True: 2, False: 1.80k]
  ------------------
 3635|      2|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(srcSize_wrong));
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3636|      2|            return;
 3637|      2|        }
 3638|  1.80k|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3639|  1.80k|    }
 3640|       |
 3641|       |    /* Loop on each block */
 3642|  4.21k|    while (1) {
  ------------------
  |  Branch (3642:12): [True: 4.21k, Folded]
  ------------------
 3643|  4.21k|        size_t const cBlockSize = ZSTDv06_getcBlockSize(ip, remainingSize, &blockProperties);
 3644|  4.21k|        if (ZSTDv06_isError(cBlockSize)) {
  ------------------
  |  | 2731|  4.21k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3644:13): [True: 2, False: 4.21k]
  ------------------
 3645|      2|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, cBlockSize);
 3646|      2|            return;
 3647|      2|        }
 3648|       |
 3649|  4.21k|        ip += ZSTDv06_blockHeaderSize;
 3650|  4.21k|        remainingSize -= ZSTDv06_blockHeaderSize;
 3651|  4.21k|        if (cBlockSize > remainingSize) {
  ------------------
  |  Branch (3651:13): [True: 45, False: 4.16k]
  ------------------
 3652|     45|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(srcSize_wrong));
  ------------------
  |  |   49|     45|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     45|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     45|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3653|     45|            return;
 3654|     45|        }
 3655|       |
 3656|  4.16k|        if (cBlockSize == 0) break;   /* bt_end */
  ------------------
  |  Branch (3656:13): [True: 1.75k, False: 2.41k]
  ------------------
 3657|       |
 3658|  2.41k|        ip += cBlockSize;
 3659|  2.41k|        remainingSize -= cBlockSize;
 3660|  2.41k|        nbBlocks++;
 3661|  2.41k|    }
 3662|       |
 3663|  1.75k|    *cSize = ip - (const BYTE*)src;
 3664|  1.75k|    *dBound = nbBlocks * ZSTDv06_BLOCKSIZE_MAX;
  ------------------
  |  |  344|  1.75k|#define ZSTDv06_BLOCKSIZE_MAX (128 * 1024)   /* define, for static allocation */
  ------------------
 3665|  1.75k|}
ZSTDv06_decompressBegin_usingDict:
 3827|  1.75k|{
 3828|  1.75k|    { size_t const errorCode = ZSTDv06_decompressBegin(dctx);
 3829|  1.75k|      if (ZSTDv06_isError(errorCode)) return errorCode; }
  ------------------
  |  | 2731|  1.75k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3829:11): [True: 0, False: 1.75k]
  ------------------
 3830|       |
 3831|  1.75k|    if (dict && dictSize) {
  ------------------
  |  Branch (3831:9): [True: 1.75k, False: 0]
  |  Branch (3831:17): [True: 719, False: 1.03k]
  ------------------
 3832|    719|        size_t const errorCode = ZSTDv06_decompress_insertDictionary(dctx, dict, dictSize);
 3833|    719|        if (ZSTDv06_isError(errorCode)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2731|    719|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
                      if (ZSTDv06_isError(errorCode)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|    503|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    503|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    503|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3833:13): [True: 503, False: 216]
  ------------------
 3834|    719|    }
 3835|       |
 3836|  1.25k|    return 0;
 3837|  1.75k|}
zstd_v06.c:MEM_readLE32:
  190|  31.7k|{
  191|  31.7k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (191:9): [True: 31.7k, False: 0]
  ------------------
  192|  31.7k|        return MEM_read32(memPtr);
  193|      0|    else
  194|      0|        return MEM_swap32(MEM_read32(memPtr));
  195|  31.7k|}
zstd_v06.c:MEM_isLittleEndian:
  108|   219k|{
  109|   219k|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  110|   219k|    return one.c[0];
  111|   219k|}
zstd_v06.c:MEM_read32:
  119|  31.7k|{
  120|  31.7k|    U32 val; memcpy(&val, memPtr, sizeof(val)); return val;
  121|  31.7k|}
zstd_v06.c:FSEv06_abs:
 1205|  23.1k|static short FSEv06_abs(short a) { return a<0 ? -a : a; }
  ------------------
  |  Branch (1205:43): [True: 11.5k, False: 11.6k]
  ------------------
zstd_v06.c:BITv06_highbit32:
  802|   635k|{
  803|       |#   if defined(_MSC_VER)   /* Visual */
  804|       |    unsigned long r;
  805|       |    return _BitScanReverse(&r, val) ? (unsigned)r : 0;
  806|       |#   elif defined(__GNUC__) && (__GNUC__ >= 3)   /* Use GCC Intrinsic */
  807|       |    return __builtin_clz (val) ^ 31;
  808|       |#   else   /* Software version */
  809|       |    static const unsigned DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 };
  810|       |    U32 v = val;
  811|       |    unsigned r;
  812|       |    v |= v >> 1;
  813|       |    v |= v >> 2;
  814|       |    v |= v >> 4;
  815|       |    v |= v >> 8;
  816|       |    v |= v >> 16;
  817|       |    r = DeBruijnClz[ (U32) (v * 0x07C4ACDDU) >> 27];
  818|       |    return r;
  819|       |#   endif
  820|   635k|}
zstd_v06.c:FSEv06_decompress_usingDTable_generic:
 1515|    705|{
 1516|    705|    BYTE* const ostart = (BYTE*) dst;
 1517|    705|    BYTE* op = ostart;
 1518|    705|    BYTE* const omax = op + maxDstSize;
 1519|    705|    BYTE* const olimit = omax-3;
 1520|       |
 1521|    705|    BITv06_DStream_t bitD;
 1522|    705|    FSEv06_DState_t state1;
 1523|    705|    FSEv06_DState_t state2;
 1524|       |
 1525|       |    /* Init */
 1526|    705|    { size_t const errorCode = BITv06_initDStream(&bitD, cSrc, cSrcSize);   /* replaced last arg by maxCompressed Size */
 1527|    705|      if (FSEv06_isError(errorCode)) return errorCode; }
  ------------------
  |  | 1357|    705|#define FSEv06_isError ERR_isError
  ------------------
  |  Branch (1527:11): [True: 51, False: 654]
  ------------------
 1528|       |
 1529|    654|    FSEv06_initDState(&state1, &bitD, dt);
 1530|    654|    FSEv06_initDState(&state2, &bitD, dt);
 1531|       |
 1532|    654|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
 1533|       |
 1534|       |    /* 4 symbols per loop */
 1535|  6.75k|    for ( ; (BITv06_reloadDStream(&bitD)==BITv06_DStream_unfinished) && (op<olimit) ; op+=4) {
  ------------------
  |  Branch (1535:13): [True: 6.13k, False: 614]
  |  Branch (1535:73): [True: 6.09k, False: 40]
  ------------------
 1536|  6.09k|        op[0] = FSEv06_GETSYMBOL(&state1);
  ------------------
  |  | 1532|  6.09k|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1532:36): [True: 2.21k, False: 3.88k]
  |  |  ------------------
  ------------------
 1537|       |
 1538|  6.09k|        if (FSEv06_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1134|  6.09k|#define FSEv06_MAX_TABLELOG  (FSEv06_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1111|  6.09k|#define FSEv06_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1538:13): [Folded, False: 6.09k]
  ------------------
 1539|      0|            BITv06_reloadDStream(&bitD);
 1540|       |
 1541|  6.09k|        op[1] = FSEv06_GETSYMBOL(&state2);
  ------------------
  |  | 1532|  6.09k|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1532:36): [True: 2.21k, False: 3.88k]
  |  |  ------------------
  ------------------
 1542|       |
 1543|  6.09k|        if (FSEv06_MAX_TABLELOG*4+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1134|  6.09k|#define FSEv06_MAX_TABLELOG  (FSEv06_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1111|  6.09k|#define FSEv06_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1543:13): [Folded, False: 6.09k]
  ------------------
 1544|      0|            { if (BITv06_reloadDStream(&bitD) > BITv06_DStream_unfinished) { op+=2; break; } }
  ------------------
  |  Branch (1544:19): [True: 0, False: 0]
  ------------------
 1545|       |
 1546|  6.09k|        op[2] = FSEv06_GETSYMBOL(&state1);
  ------------------
  |  | 1532|  6.09k|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1532:36): [True: 2.21k, False: 3.88k]
  |  |  ------------------
  ------------------
 1547|       |
 1548|  6.09k|        if (FSEv06_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1134|  6.09k|#define FSEv06_MAX_TABLELOG  (FSEv06_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1111|  6.09k|#define FSEv06_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1548:13): [Folded, False: 6.09k]
  ------------------
 1549|      0|            BITv06_reloadDStream(&bitD);
 1550|       |
 1551|  6.09k|        op[3] = FSEv06_GETSYMBOL(&state2);
  ------------------
  |  | 1532|  6.09k|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1532:36): [True: 2.21k, False: 3.88k]
  |  |  ------------------
  ------------------
 1552|  6.09k|    }
 1553|       |
 1554|       |    /* tail */
 1555|       |    /* note : BITv06_reloadDStream(&bitD) >= FSEv06_DStream_partiallyFilled; Ends at exactly BITv06_DStream_completed */
 1556|  7.72k|    while (1) {
  ------------------
  |  Branch (1556:12): [True: 7.72k, Folded]
  ------------------
 1557|  7.72k|        if (op>(omax-2)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|     50|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     50|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     50|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1557:13): [True: 50, False: 7.67k]
  ------------------
 1558|       |
 1559|  7.67k|        *op++ = FSEv06_GETSYMBOL(&state1);
  ------------------
  |  | 1532|  7.67k|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1532:36): [True: 1.83k, False: 5.84k]
  |  |  ------------------
  ------------------
 1560|       |
 1561|  7.67k|        if (BITv06_reloadDStream(&bitD)==BITv06_DStream_overflow) {
  ------------------
  |  Branch (1561:13): [True: 362, False: 7.31k]
  ------------------
 1562|    362|            *op++ = FSEv06_GETSYMBOL(&state2);
  ------------------
  |  | 1532|    362|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1532:36): [True: 132, False: 230]
  |  |  ------------------
  ------------------
 1563|    362|            break;
 1564|    362|        }
 1565|       |
 1566|  7.31k|        if (op>(omax-2)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1566:13): [True: 0, False: 7.31k]
  ------------------
 1567|       |
 1568|  7.31k|        *op++ = FSEv06_GETSYMBOL(&state2);
  ------------------
  |  | 1532|  7.31k|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1532:36): [True: 1.70k, False: 5.61k]
  |  |  ------------------
  ------------------
 1569|       |
 1570|  7.31k|        if (BITv06_reloadDStream(&bitD)==BITv06_DStream_overflow) {
  ------------------
  |  Branch (1570:13): [True: 242, False: 7.07k]
  ------------------
 1571|    242|            *op++ = FSEv06_GETSYMBOL(&state1);
  ------------------
  |  | 1532|    242|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1532:36): [True: 97, False: 145]
  |  |  ------------------
  ------------------
 1572|    242|            break;
 1573|    242|    }   }
 1574|       |
 1575|    604|    return op-ostart;
 1576|    654|}
zstd_v06.c:FSEv06_initDState:
 1053|  2.25k|{
 1054|  2.25k|    const void* ptr = dt;
 1055|  2.25k|    const FSEv06_DTableHeader* const DTableH = (const FSEv06_DTableHeader*)ptr;
 1056|  2.25k|    DStatePtr->state = BITv06_readBits(bitD, DTableH->tableLog);
 1057|  2.25k|    BITv06_reloadDStream(bitD);
 1058|  2.25k|    DStatePtr->table = dt + 1;
 1059|  2.25k|}
zstd_v06.c:BITv06_readBits:
  888|  73.3k|{
  889|  73.3k|    size_t const value = BITv06_lookBits(bitD, nbBits);
  890|  73.3k|    BITv06_skipBits(bitD, nbBits);
  891|  73.3k|    return value;
  892|  73.3k|}
zstd_v06.c:BITv06_lookBits:
  869|  73.3k|{
  870|  73.3k|    U32 const bitMask = sizeof(bitD->bitContainer)*8 - 1;
  871|  73.3k|    return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask);
  872|  73.3k|}
zstd_v06.c:BITv06_skipBits:
  883|  5.48M|{
  884|  5.48M|    bitD->bitsConsumed += nbBits;
  885|  5.48M|}
zstd_v06.c:FSEv06_decodeSymbolFast:
 1089|  12.6k|{
 1090|  12.6k|    FSEv06_decode_t const DInfo = ((const FSEv06_decode_t*)(DStatePtr->table))[DStatePtr->state];
 1091|  12.6k|    U32 const nbBits = DInfo.nbBits;
 1092|  12.6k|    BYTE const symbol = DInfo.symbol;
 1093|  12.6k|    size_t const lowBits = BITv06_readBitsFast(bitD, nbBits);
 1094|       |
 1095|  12.6k|    DStatePtr->state = DInfo.newState + lowBits;
 1096|  12.6k|    return symbol;
 1097|  12.6k|}
zstd_v06.c:BITv06_readBitsFast:
  897|  12.6k|{
  898|  12.6k|    size_t const value = BITv06_lookBitsFast(bitD, nbBits);
  899|  12.6k|    BITv06_skipBits(bitD, nbBits);
  900|  12.6k|    return value;
  901|  12.6k|}
zstd_v06.c:BITv06_lookBitsFast:
  877|  5.41M|{
  878|  5.41M|    U32 const bitMask = sizeof(bitD->bitContainer)*8 - 1;
  879|  5.41M|    return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask);
  880|  5.41M|}
zstd_v06.c:FSEv06_decodeSymbol:
 1076|  27.3k|{
 1077|  27.3k|    FSEv06_decode_t const DInfo = ((const FSEv06_decode_t*)(DStatePtr->table))[DStatePtr->state];
 1078|  27.3k|    U32 const nbBits = DInfo.nbBits;
 1079|  27.3k|    BYTE const symbol = DInfo.symbol;
 1080|  27.3k|    size_t const lowBits = BITv06_readBits(bitD, nbBits);
 1081|       |
 1082|  27.3k|    DStatePtr->state = DInfo.newState + lowBits;
 1083|  27.3k|    return symbol;
 1084|  27.3k|}
zstd_v06.c:HUFv06_readStats:
 1801|  1.08k|{
 1802|  1.08k|    U32 weightTotal;
 1803|  1.08k|    const BYTE* ip = (const BYTE*) src;
 1804|  1.08k|    size_t iSize;
 1805|  1.08k|    size_t oSize;
 1806|       |
 1807|  1.08k|    if (!srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     12|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     12|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     12|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1807:9): [True: 12, False: 1.07k]
  ------------------
 1808|  1.07k|    iSize = ip[0];
 1809|       |    /* memset(huffWeight, 0, hwSize); */   /* is not necessary, even though some analyzer complain ... */
 1810|       |
 1811|  1.07k|    if (iSize >= 128)  { /* special header */
  ------------------
  |  Branch (1811:9): [True: 297, False: 780]
  ------------------
 1812|    297|        if (iSize >= (242)) {  /* RLE */
  ------------------
  |  Branch (1812:13): [True: 247, False: 50]
  ------------------
 1813|    247|            static U32 l[14] = { 1, 2, 3, 4, 7, 8, 15, 16, 31, 32, 63, 64, 127, 128 };
 1814|    247|            oSize = l[iSize-242];
 1815|    247|            memset(huffWeight, 1, hwSize);
 1816|    247|            iSize = 0;
 1817|    247|        }
 1818|     50|        else {   /* Incompressible */
 1819|     50|            oSize = iSize - 127;
 1820|     50|            iSize = ((oSize+1)/2);
 1821|     50|            if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     15|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     15|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     15|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1821:17): [True: 15, False: 35]
  ------------------
 1822|     35|            if (oSize >= hwSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1822:17): [True: 0, False: 35]
  ------------------
 1823|     35|            ip += 1;
 1824|     35|            {   U32 n;
 1825|    571|                for (n=0; n<oSize; n+=2) {
  ------------------
  |  Branch (1825:27): [True: 536, False: 35]
  ------------------
 1826|    536|                    huffWeight[n]   = ip[n/2] >> 4;
 1827|    536|                    huffWeight[n+1] = ip[n/2] & 15;
 1828|    536|    }   }   }   }
 1829|    780|    else  {   /* header compressed with FSE (normal case) */
 1830|    780|        if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     14|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     14|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     14|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1830:13): [True: 14, False: 766]
  ------------------
 1831|    766|        oSize = FSEv06_decompress(huffWeight, hwSize-1, ip+1, iSize);   /* max (hwSize-1) values decoded, as last one is implied */
 1832|    766|        if (FSEv06_isError(oSize)) return oSize;
  ------------------
  |  | 1357|    766|#define FSEv06_isError ERR_isError
  ------------------
  |  Branch (1832:13): [True: 162, False: 604]
  ------------------
 1833|    766|    }
 1834|       |
 1835|       |    /* collect weight stats */
 1836|    886|    memset(rankStats, 0, (HUFv06_ABSOLUTEMAX_TABLELOG + 1) * sizeof(U32));
  ------------------
  |  | 1783|    886|#define HUFv06_ABSOLUTEMAX_TABLELOG  16   /* absolute limit of HUFv06_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
 1837|    886|    weightTotal = 0;
 1838|  41.5k|    {   U32 n; for (n=0; n<oSize; n++) {
  ------------------
  |  Branch (1838:26): [True: 40.7k, False: 826]
  ------------------
 1839|  40.7k|            if (huffWeight[n] >= HUFv06_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  | 1783|  40.7k|#define HUFv06_ABSOLUTEMAX_TABLELOG  16   /* absolute limit of HUFv06_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
                          if (huffWeight[n] >= HUFv06_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  |   49|     60|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     60|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     60|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1839:17): [True: 60, False: 40.6k]
  ------------------
 1840|  40.6k|            rankStats[huffWeight[n]]++;
 1841|  40.6k|            weightTotal += (1 << huffWeight[n]) >> 1;
 1842|  40.6k|    }   }
 1843|    826|    if (weightTotal == 0) return ERROR(corruption_detected);
  ------------------
  |  |   49|     12|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     12|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     12|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1843:9): [True: 12, False: 814]
  ------------------
 1844|       |
 1845|       |    /* get last non-null symbol weight (implied, total must be 2^n) */
 1846|    814|    {   U32 const tableLog = BITv06_highbit32(weightTotal) + 1;
 1847|    814|        if (tableLog > HUFv06_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  | 1783|    814|#define HUFv06_ABSOLUTEMAX_TABLELOG  16   /* absolute limit of HUFv06_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
                      if (tableLog > HUFv06_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  |   49|     15|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     15|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     15|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1847:13): [True: 15, False: 799]
  ------------------
 1848|    799|        *tableLogPtr = tableLog;
 1849|       |        /* determine last weight */
 1850|    799|        {   U32 const total = 1 << tableLog;
 1851|    799|            U32 const rest = total - weightTotal;
 1852|    799|            U32 const verif = 1 << BITv06_highbit32(rest);
 1853|    799|            U32 const lastWeight = BITv06_highbit32(rest) + 1;
 1854|    799|            if (verif != rest) return ERROR(corruption_detected);    /* last value must be a clean power of 2 */
  ------------------
  |  |   49|    134|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    134|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    134|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1854:17): [True: 134, False: 665]
  ------------------
 1855|    665|            huffWeight[oSize] = (BYTE)lastWeight;
 1856|    665|            rankStats[lastWeight]++;
 1857|    665|    }   }
 1858|       |
 1859|       |    /* check tree construction validity */
 1860|    665|    if ((rankStats[1] < 2) || (rankStats[1] & 1)) return ERROR(corruption_detected);   /* by construction : at least 2 elts of rank 1, must be even */
  ------------------
  |  |   49|     29|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     29|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     29|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1860:9): [True: 29, False: 636]
  |  Branch (1860:31): [True: 0, False: 636]
  ------------------
 1861|       |
 1862|       |    /* results */
 1863|    636|    *nbSymbolsPtr = (U32)(oSize+1);
 1864|    636|    return iSize+1;
 1865|    665|}
zstd_v06.c:HUFv06_isError:
 1199|  2.37k|static unsigned HUFv06_isError(size_t code) { return ERR_isError(code); }
zstd_v06.c:BITv06_initDStream:
  834|  1.85k|{
  835|  1.85k|    if (srcSize < 1) { memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   49|      9|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      9|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      9|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (835:9): [True: 9, False: 1.84k]
  ------------------
  836|       |
  837|  1.84k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (837:9): [True: 1.28k, False: 563]
  ------------------
  838|  1.28k|        bitD->start = (const char*)srcBuffer;
  839|  1.28k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  840|  1.28k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  841|  1.28k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  842|  1.28k|          if (lastByte == 0) return ERROR(GENERIC);   /* endMark not present */
  ------------------
  |  |   49|    132|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    132|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    132|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (842:15): [True: 132, False: 1.15k]
  ------------------
  843|  1.15k|          bitD->bitsConsumed = 8 - BITv06_highbit32(lastByte); }
  844|  1.15k|    } else {
  845|    563|        bitD->start = (const char*)srcBuffer;
  846|    563|        bitD->ptr   = bitD->start;
  847|    563|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  848|    563|        switch(srcSize)
  849|    563|        {
  850|     40|            case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);/* fall-through */
  ------------------
  |  Branch (850:13): [True: 40, False: 523]
  ------------------
  851|     90|            case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);/* fall-through */
  ------------------
  |  Branch (851:13): [True: 50, False: 513]
  ------------------
  852|    154|            case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);/* fall-through */
  ------------------
  |  Branch (852:13): [True: 64, False: 499]
  ------------------
  853|    344|            case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24; /* fall-through */
  ------------------
  |  Branch (853:13): [True: 190, False: 373]
  ------------------
  854|    425|            case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16; /* fall-through */
  ------------------
  |  Branch (854:13): [True: 81, False: 482]
  ------------------
  855|    503|            case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) <<  8; /* fall-through */
  ------------------
  |  Branch (855:13): [True: 78, False: 485]
  ------------------
  856|    563|            default: break;
  ------------------
  |  Branch (856:13): [True: 60, False: 503]
  ------------------
  857|    563|        }
  858|    563|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  859|    563|          if (lastByte == 0) return ERROR(GENERIC);   /* endMark not present */
  ------------------
  |  |   49|     51|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     51|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     51|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (859:15): [True: 51, False: 512]
  ------------------
  860|    512|          bitD->bitsConsumed = 8 - BITv06_highbit32(lastByte); }
  861|      0|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  862|    512|    }
  863|       |
  864|  1.66k|    return srcSize;
  865|  1.84k|}
zstd_v06.c:MEM_readLEST:
  208|  30.5k|{
  209|  30.5k|    if (MEM_32bits())
  ------------------
  |  Branch (209:9): [True: 0, False: 30.5k]
  ------------------
  210|      0|        return (size_t)MEM_readLE32(memPtr);
  211|  30.5k|    else
  212|  30.5k|        return (size_t)MEM_readLE64(memPtr);
  213|  30.5k|}
zstd_v06.c:MEM_32bits:
  104|  73.4k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_v06.c:HUFv06_decodeStreamX2:
 2014|    542|{
 2015|    542|    BYTE* const pStart = p;
 2016|       |
 2017|       |    /* up to 4 symbols at a time */
 2018|  7.42k|    while ((BITv06_reloadDStream(bitDPtr) == BITv06_DStream_unfinished) && (p <= pEnd-4)) {
  ------------------
  |  Branch (2018:12): [True: 6.97k, False: 456]
  |  Branch (2018:76): [True: 6.88k, False: 86]
  ------------------
 2019|  6.88k|        HUFv06_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 2010|  6.88k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 6.88k, False: 0]
  |  |  ------------------
  |  | 2011|  6.88k|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|  6.88k|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2020|  6.88k|        HUFv06_DECODE_SYMBOLX2_1(p, bitDPtr);
  ------------------
  |  | 2006|  6.88k|    if (MEM_64bits() || (HUFv06_MAX_TABLELOG<=12)) \
  |  |  ------------------
  |  |  |  | 1784|      0|#define HUFv06_MAX_TABLELOG  12           /* max configured tableLog (for static allocation); can be modified up to HUFv06_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (2006:9): [True: 6.88k, False: 0]
  |  |  |  Branch (2006:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2007|  6.88k|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|  6.88k|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2021|  6.88k|        HUFv06_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 2010|  6.88k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 6.88k, False: 0]
  |  |  ------------------
  |  | 2011|  6.88k|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|  6.88k|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2022|  6.88k|        HUFv06_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 2003|  6.88k|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2023|  6.88k|    }
 2024|       |
 2025|       |    /* closer to the end */
 2026|    634|    while ((BITv06_reloadDStream(bitDPtr) == BITv06_DStream_unfinished) && (p < pEnd))
  ------------------
  |  Branch (2026:12): [True: 163, False: 471]
  |  Branch (2026:76): [True: 92, False: 71]
  ------------------
 2027|     92|        HUFv06_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 2003|     92|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2028|       |
 2029|       |    /* no more data to retrieve from bitstream, hence no need to reload */
 2030|  5.35M|    while (p < pEnd)
  ------------------
  |  Branch (2030:12): [True: 5.35M, False: 542]
  ------------------
 2031|  5.35M|        HUFv06_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 2003|  5.35M|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2032|       |
 2033|    542|    return pEnd-pStart;
 2034|    542|}
zstd_v06.c:BITv06_endOfDStream:
  935|    593|{
  936|    593|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (936:13): [True: 507, False: 86]
  |  Branch (936:49): [True: 6, False: 501]
  ------------------
  937|    593|}
zstd_v06.c:MEM_readLE16:
  169|  1.62k|{
  170|  1.62k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (170:9): [True: 1.62k, False: 0]
  ------------------
  171|  1.62k|        return MEM_read16(memPtr);
  172|      0|    else {
  173|      0|        const BYTE* p = (const BYTE*)memPtr;
  174|      0|        return (U16)(p[0] + (p[1]<<8));
  175|      0|    }
  176|  1.62k|}
zstd_v06.c:MEM_read16:
  114|  1.62k|{
  115|  1.62k|    U16 val; memcpy(&val, memPtr, sizeof(val)); return val;
  116|  1.62k|}
zstd_v06.c:BITv06_reloadDStream:
  904|  48.7k|{
  905|  48.7k|    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))  /* should never happen */
  ------------------
  |  Branch (905:9): [True: 888, False: 47.9k]
  ------------------
  906|    888|        return BITv06_DStream_overflow;
  907|       |
  908|  47.9k|    if (bitD->ptr >= bitD->start + sizeof(bitD->bitContainer)) {
  ------------------
  |  Branch (908:9): [True: 22.2k, False: 25.6k]
  ------------------
  909|  22.2k|        bitD->ptr -= bitD->bitsConsumed >> 3;
  910|  22.2k|        bitD->bitsConsumed &= 7;
  911|  22.2k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  912|  22.2k|        return BITv06_DStream_unfinished;
  913|  22.2k|    }
  914|  25.6k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (914:9): [True: 18.6k, False: 7.04k]
  ------------------
  915|  18.6k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BITv06_DStream_endOfBuffer;
  ------------------
  |  Branch (915:13): [True: 17.9k, False: 673]
  ------------------
  916|    673|        return BITv06_DStream_completed;
  917|  18.6k|    }
  918|  7.04k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  919|  7.04k|        BITv06_DStream_status result = BITv06_DStream_unfinished;
  920|  7.04k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (920:13): [True: 239, False: 6.80k]
  ------------------
  921|    239|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  922|    239|            result = BITv06_DStream_endOfBuffer;
  923|    239|        }
  924|  7.04k|        bitD->ptr -= nbBytes;
  925|  7.04k|        bitD->bitsConsumed -= nbBytes*8;
  926|  7.04k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD) */
  927|  7.04k|        return result;
  928|  25.6k|    }
  929|  25.6k|}
zstd_v06.c:MEM_64bits:
  105|  32.3k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_v06.c:HUFv06_decodeSymbolX2:
 1995|  5.39M|{
 1996|  5.39M|    const size_t val = BITv06_lookBitsFast(Dstream, dtLog); /* note : dtLog >= 1 */
 1997|  5.39M|    const BYTE c = dt[val].byte;
 1998|  5.39M|    BITv06_skipBits(Dstream, dt[val].nbBits);
 1999|  5.39M|    return c;
 2000|  5.39M|}
zstd_v06.c:HUFv06_fillDTableX4:
 2233|    293|{
 2234|    293|    U32 rankVal[HUFv06_ABSOLUTEMAX_TABLELOG + 1];
 2235|    293|    const int scaleLog = nbBitsBaseline - targetLog;   /* note : targetLog >= srcLog, hence scaleLog <= 1 */
 2236|    293|    const U32 minBits  = nbBitsBaseline - maxWeight;
 2237|    293|    U32 s;
 2238|       |
 2239|    293|    memcpy(rankVal, rankValOrigin, sizeof(rankVal));
 2240|       |
 2241|       |    /* fill DTable */
 2242|  16.8k|    for (s=0; s<sortedListSize; s++) {
  ------------------
  |  Branch (2242:15): [True: 16.5k, False: 293]
  ------------------
 2243|  16.5k|        const U16 symbol = sortedList[s].symbol;
 2244|  16.5k|        const U32 weight = sortedList[s].weight;
 2245|  16.5k|        const U32 nbBits = nbBitsBaseline - weight;
 2246|  16.5k|        const U32 start = rankVal[weight];
 2247|  16.5k|        const U32 length = 1 << (targetLog-nbBits);
 2248|       |
 2249|  16.5k|        if (targetLog-nbBits >= minBits) {   /* enough room for a second symbol */
  ------------------
  |  Branch (2249:13): [True: 13.3k, False: 3.24k]
  ------------------
 2250|  13.3k|            U32 sortedRank;
 2251|  13.3k|            int minWeight = nbBits + scaleLog;
 2252|  13.3k|            if (minWeight < 1) minWeight = 1;
  ------------------
  |  Branch (2252:17): [True: 1.27k, False: 12.0k]
  ------------------
 2253|  13.3k|            sortedRank = rankStart[minWeight];
 2254|  13.3k|            HUFv06_fillDTableX4Level2(DTable+start, targetLog-nbBits, nbBits,
 2255|  13.3k|                           rankValOrigin[nbBits], minWeight,
 2256|  13.3k|                           sortedList+sortedRank, sortedListSize-sortedRank,
 2257|  13.3k|                           nbBitsBaseline, symbol);
 2258|  13.3k|        } else {
 2259|  3.24k|            HUFv06_DEltX4 DElt;
 2260|  3.24k|            MEM_writeLE16(&(DElt.sequence), symbol);
 2261|  3.24k|            DElt.nbBits = (BYTE)(nbBits);
 2262|  3.24k|            DElt.length = 1;
 2263|  3.24k|            {   U32 u;
 2264|  3.24k|                const U32 end = start + length;
 2265|  72.1k|                for (u = start; u < end; u++) DTable[u] = DElt;
  ------------------
  |  Branch (2265:33): [True: 68.8k, False: 3.24k]
  ------------------
 2266|  3.24k|        }   }
 2267|  16.5k|        rankVal[weight] += length;
 2268|  16.5k|    }
 2269|    293|}
zstd_v06.c:HUFv06_fillDTableX4Level2:
 2191|  13.3k|{
 2192|  13.3k|    HUFv06_DEltX4 DElt;
 2193|  13.3k|    U32 rankVal[HUFv06_ABSOLUTEMAX_TABLELOG + 1];
 2194|       |
 2195|       |    /* get pre-calculated rankVal */
 2196|  13.3k|    memcpy(rankVal, rankValOrigin, sizeof(rankVal));
 2197|       |
 2198|       |    /* fill skipped values */
 2199|  13.3k|    if (minWeight>1) {
  ------------------
  |  Branch (2199:9): [True: 11.2k, False: 2.02k]
  ------------------
 2200|  11.2k|        U32 i, skipSize = rankVal[minWeight];
 2201|  11.2k|        MEM_writeLE16(&(DElt.sequence), baseSeq);
 2202|  11.2k|        DElt.nbBits   = (BYTE)(consumed);
 2203|  11.2k|        DElt.length   = 1;
 2204|   150k|        for (i = 0; i < skipSize; i++)
  ------------------
  |  Branch (2204:21): [True: 139k, False: 11.2k]
  ------------------
 2205|   139k|            DTable[i] = DElt;
 2206|  11.2k|    }
 2207|       |
 2208|       |    /* fill DTable */
 2209|   154k|    { U32 s; for (s=0; s<sortedListSize; s++) {   /* note : sortedSymbols already skipped */
  ------------------
  |  Branch (2209:24): [True: 140k, False: 13.3k]
  ------------------
 2210|   140k|        const U32 symbol = sortedSymbols[s].symbol;
 2211|   140k|        const U32 weight = sortedSymbols[s].weight;
 2212|   140k|        const U32 nbBits = nbBitsBaseline - weight;
 2213|   140k|        const U32 length = 1 << (sizeLog-nbBits);
 2214|   140k|        const U32 start = rankVal[weight];
 2215|   140k|        U32 i = start;
 2216|   140k|        const U32 end = start + length;
 2217|       |
 2218|   140k|        MEM_writeLE16(&(DElt.sequence), (U16)(baseSeq + (symbol << 8)));
 2219|   140k|        DElt.nbBits = (BYTE)(nbBits + consumed);
 2220|   140k|        DElt.length = 2;
 2221|   992k|        do { DTable[i++] = DElt; } while (i<end);   /* since length >= 1 */
  ------------------
  |  Branch (2221:43): [True: 851k, False: 140k]
  ------------------
 2222|       |
 2223|   140k|        rankVal[weight] += length;
 2224|   140k|    }}
 2225|  13.3k|}
zstd_v06.c:MEM_writeLE16:
  179|   155k|{
  180|   155k|    if (MEM_isLittleEndian()) {
  ------------------
  |  Branch (180:9): [True: 155k, False: 0]
  ------------------
  181|   155k|        MEM_write16(memPtr, val);
  182|   155k|    } else {
  183|      0|        BYTE* p = (BYTE*)memPtr;
  184|      0|        p[0] = (BYTE)val;
  185|      0|        p[1] = (BYTE)(val>>8);
  186|      0|    }
  187|   155k|}
zstd_v06.c:MEM_write16:
  129|   155k|{
  130|   155k|    memcpy(memPtr, &value, sizeof(value));
  131|   155k|}
zstd_v06.c:HUFv06_decodeStreamX4:
 2383|     51|{
 2384|     51|    BYTE* const pStart = p;
 2385|       |
 2386|       |    /* up to 8 symbols at a time */
 2387|    418|    while ((BITv06_reloadDStream(bitDPtr) == BITv06_DStream_unfinished) && (p < pEnd-7)) {
  ------------------
  |  Branch (2387:12): [True: 386, False: 32]
  |  Branch (2387:76): [True: 367, False: 19]
  ------------------
 2388|    367|        HUFv06_DECODE_SYMBOLX4_2(p, bitDPtr);
  ------------------
  |  | 2379|    367|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2379:9): [True: 367, False: 0]
  |  |  ------------------
  |  | 2380|    367|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2389|    367|        HUFv06_DECODE_SYMBOLX4_1(p, bitDPtr);
  ------------------
  |  | 2375|    367|    if (MEM_64bits() || (HUFv06_MAX_TABLELOG<=12)) \
  |  |  ------------------
  |  |  |  | 1784|      0|#define HUFv06_MAX_TABLELOG  12           /* max configured tableLog (for static allocation); can be modified up to HUFv06_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (2375:9): [True: 367, False: 0]
  |  |  |  Branch (2375:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2376|    367|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2390|    367|        HUFv06_DECODE_SYMBOLX4_2(p, bitDPtr);
  ------------------
  |  | 2379|    367|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2379:9): [True: 367, False: 0]
  |  |  ------------------
  |  | 2380|    367|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2391|    367|        HUFv06_DECODE_SYMBOLX4_0(p, bitDPtr);
  ------------------
  |  | 2372|    367|    ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2392|    367|    }
 2393|       |
 2394|       |    /* closer to the end */
 2395|     92|    while ((BITv06_reloadDStream(bitDPtr) == BITv06_DStream_unfinished) && (p <= pEnd-2))
  ------------------
  |  Branch (2395:12): [True: 58, False: 34]
  |  Branch (2395:76): [True: 41, False: 17]
  ------------------
 2396|     41|        HUFv06_DECODE_SYMBOLX4_0(p, bitDPtr);
  ------------------
  |  | 2372|     41|    ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2397|       |
 2398|  4.26k|    while (p <= pEnd-2)
  ------------------
  |  Branch (2398:12): [True: 4.21k, False: 51]
  ------------------
 2399|  4.21k|        HUFv06_DECODE_SYMBOLX4_0(p, bitDPtr);   /* no need to reload : reached the end of DStream */
  ------------------
  |  | 2372|  4.21k|    ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2400|       |
 2401|     51|    if (p < pEnd)
  ------------------
  |  Branch (2401:9): [True: 29, False: 22]
  ------------------
 2402|     29|        p += HUFv06_decodeLastSymbolX4(p, bitDPtr, dt, dtLog);
 2403|       |
 2404|     51|    return p-pStart;
 2405|     51|}
zstd_v06.c:HUFv06_decodeLastSymbolX4:
 2357|     29|{
 2358|     29|    const size_t val = BITv06_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */
 2359|     29|    memcpy(op, dt+val, 1);
 2360|     29|    if (dt[val].length==1) BITv06_skipBits(DStream, dt[val].nbBits);
  ------------------
  |  Branch (2360:9): [True: 11, False: 18]
  ------------------
 2361|     18|    else {
 2362|     18|        if (DStream->bitsConsumed < (sizeof(DStream->bitContainer)*8)) {
  ------------------
  |  Branch (2362:13): [True: 13, False: 5]
  ------------------
 2363|     13|            BITv06_skipBits(DStream, dt[val].nbBits);
 2364|     13|            if (DStream->bitsConsumed > (sizeof(DStream->bitContainer)*8))
  ------------------
  |  Branch (2364:17): [True: 1, False: 12]
  ------------------
 2365|      1|                DStream->bitsConsumed = (sizeof(DStream->bitContainer)*8);   /* ugly hack; works only because it's the last symbol. Note : can't easily extract nbBits from just this symbol */
 2366|     13|    }   }
 2367|     29|    return 1;
 2368|     29|}
zstd_v06.c:HUFv06_decodeSymbolX4:
 2349|  5.72k|{
 2350|  5.72k|    const size_t val = BITv06_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */
 2351|  5.72k|    memcpy(op, dt+val, 2);
 2352|  5.72k|    BITv06_skipBits(DStream, dt[val].nbBits);
 2353|  5.72k|    return dt[val].length;
 2354|  5.72k|}
zstd_v06.c:ZSTDv06_frameHeaderSize:
 2912|  6.02k|{
 2913|  6.02k|    if (srcSize < ZSTDv06_frameHeaderSize_min) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2913:9): [True: 0, False: 6.02k]
  ------------------
 2914|  6.02k|    { U32 const fcsId = (((const BYTE*)src)[4]) >> 6;
 2915|  6.02k|      return ZSTDv06_frameHeaderSize_min + ZSTDv06_fcs_fieldSize[fcsId]; }
 2916|  6.02k|}
zstd_v06.c:MEM_readLE64:
  199|  30.7k|{
  200|  30.7k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (200:9): [True: 30.7k, False: 0]
  ------------------
  201|  30.7k|        return MEM_read64(memPtr);
  202|      0|    else
  203|      0|        return MEM_swap64(MEM_read64(memPtr));
  204|  30.7k|}
zstd_v06.c:MEM_read64:
  124|  30.7k|{
  125|  30.7k|    U64 val; memcpy(&val, memPtr, sizeof(val)); return val;
  126|  30.7k|}
zstd_v06.c:ZSTDv06_checkContinuity:
 3465|  1.75k|{
 3466|  1.75k|    if (dst != dctx->previousDstEnd) {   /* not contiguous */
  ------------------
  |  Branch (3466:9): [True: 1.75k, False: 0]
  ------------------
 3467|  1.75k|        dctx->dictEnd = dctx->previousDstEnd;
 3468|  1.75k|        dctx->vBase = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3469|  1.75k|        dctx->base = dst;
 3470|  1.75k|        dctx->previousDstEnd = dst;
 3471|  1.75k|    }
 3472|  1.75k|}
zstd_v06.c:ZSTDv06_decompressBlock_internal:
 3478|  1.34k|{   /* blockType == blockCompressed */
 3479|  1.34k|    const BYTE* ip = (const BYTE*)src;
 3480|       |
 3481|  1.34k|    if (srcSize >= ZSTDv06_BLOCKSIZE_MAX) return ERROR(srcSize_wrong);
  ------------------
  |  |  344|  1.34k|#define ZSTDv06_BLOCKSIZE_MAX (128 * 1024)   /* define, for static allocation */
  ------------------
                  if (srcSize >= ZSTDv06_BLOCKSIZE_MAX) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3481:9): [True: 0, False: 1.34k]
  ------------------
 3482|       |
 3483|       |    /* Decode literals sub-block */
 3484|  1.34k|    {   size_t const litCSize = ZSTDv06_decodeLiteralsBlock(dctx, src, srcSize);
 3485|  1.34k|        if (ZSTDv06_isError(litCSize)) return litCSize;
  ------------------
  |  | 2731|  1.34k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3485:13): [True: 898, False: 446]
  ------------------
 3486|    446|        ip += litCSize;
 3487|    446|        srcSize -= litCSize;
 3488|    446|    }
 3489|      0|    return ZSTDv06_decompressSequences(dctx, dst, dstCapacity, ip, srcSize);
 3490|  1.34k|}
zstd_v06.c:ZSTDv06_decodeLiteralsBlock:
 3000|  1.34k|{
 3001|  1.34k|    const BYTE* const istart = (const BYTE*) src;
 3002|       |
 3003|       |    /* any compressed block with literals segment must be at least this size */
 3004|  1.34k|    if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  |  424|  1.34k|#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */ + MIN_SEQUENCES_SIZE /* nbSeq==0 */)   /* for a non-null block */
  |  |  ------------------
  |  |  |  |  423|  1.34k|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  |  |  ------------------
  ------------------
                  if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  |   49|    248|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    248|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    248|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3004:9): [True: 248, False: 1.09k]
  ------------------
 3005|       |
 3006|  1.09k|    switch(istart[0]>> 6)
 3007|  1.09k|    {
 3008|    560|    case IS_HUF:
  ------------------
  |  |  428|    560|#define IS_HUF 0
  ------------------
  |  Branch (3008:5): [True: 560, False: 536]
  ------------------
 3009|    560|        {   size_t litSize, litCSize, singleStream=0;
 3010|    560|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3011|    560|            if (srcSize < 5) return ERROR(corruption_detected);   /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for lhSize, + cSize (+nbSeq) */
  ------------------
  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3011:17): [True: 4, False: 556]
  ------------------
 3012|    556|            switch(lhSize)
 3013|    556|            {
 3014|    133|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3014:13): [True: 31, False: 525]
  |  Branch (3014:21): [True: 102, False: 454]
  |  Branch (3014:29): [True: 0, False: 556]
  ------------------
 3015|       |                /* 2 - 2 - 10 - 10 */
 3016|    133|                lhSize=3;
 3017|    133|                singleStream = istart[0] & 16;
 3018|    133|                litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 3019|    133|                litCSize = ((istart[1] &  3) << 8) + istart[2];
 3020|    133|                break;
 3021|    212|            case 2:
  ------------------
  |  Branch (3021:13): [True: 212, False: 344]
  ------------------
 3022|       |                /* 2 - 2 - 14 - 14 */
 3023|    212|                lhSize=4;
 3024|    212|                litSize  = ((istart[0] & 15) << 10) + (istart[1] << 2) + (istart[2] >> 6);
 3025|    212|                litCSize = ((istart[2] & 63) <<  8) + istart[3];
 3026|    212|                break;
 3027|    211|            case 3:
  ------------------
  |  Branch (3027:13): [True: 211, False: 345]
  ------------------
 3028|       |                /* 2 - 2 - 18 - 18 */
 3029|    211|                lhSize=5;
 3030|    211|                litSize  = ((istart[0] & 15) << 14) + (istart[1] << 6) + (istart[2] >> 2);
 3031|    211|                litCSize = ((istart[2] &  3) << 16) + (istart[3] << 8) + istart[4];
 3032|    211|                break;
 3033|    556|            }
 3034|    556|            if (litSize > ZSTDv06_BLOCKSIZE_MAX) return ERROR(corruption_detected);
  ------------------
  |  |  344|    556|#define ZSTDv06_BLOCKSIZE_MAX (128 * 1024)   /* define, for static allocation */
  ------------------
                          if (litSize > ZSTDv06_BLOCKSIZE_MAX) return ERROR(corruption_detected);
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3034:17): [True: 2, False: 554]
  ------------------
 3035|    554|            if (litCSize + lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|     33|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     33|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     33|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3035:17): [True: 33, False: 521]
  ------------------
 3036|       |
 3037|    521|            if (HUFv06_isError(singleStream ?
  ------------------
  |  | 2733|    521|#define HUFv06_isError  ERR_isError
  ------------------
  |  Branch (3037:17): [True: 488, False: 33]
  |  Branch (3037:32): [True: 100, False: 421]
  ------------------
 3038|    100|                            HUFv06_decompress1X2(dctx->litBuffer, litSize, istart+lhSize, litCSize) :
 3039|    521|                            HUFv06_decompress   (dctx->litBuffer, litSize, istart+lhSize, litCSize) ))
 3040|    488|                return ERROR(corruption_detected);
  ------------------
  |  |   49|    488|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    488|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    488|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3041|       |
 3042|     33|            dctx->litPtr = dctx->litBuffer;
 3043|     33|            dctx->litSize = litSize;
 3044|     33|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  487|     33|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3045|     33|            return litCSize + lhSize;
 3046|    521|        }
 3047|     86|    case IS_PCH:
  ------------------
  |  |  429|     86|#define IS_PCH 1
  ------------------
  |  Branch (3047:5): [True: 86, False: 1.01k]
  ------------------
 3048|     86|        {   size_t litSize, litCSize;
 3049|     86|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3050|     86|            if (lhSize != 1)  /* only case supported for now : small litSize, single stream */
  ------------------
  |  Branch (3050:17): [True: 5, False: 81]
  ------------------
 3051|      5|                return ERROR(corruption_detected);
  ------------------
  |  |   49|      5|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      5|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      5|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3052|     81|            if (!dctx->flagRepeatTable)
  ------------------
  |  Branch (3052:17): [True: 16, False: 65]
  ------------------
 3053|     16|                return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|     16|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     16|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     16|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3054|       |
 3055|       |            /* 2 - 2 - 10 - 10 */
 3056|     65|            lhSize=3;
 3057|     65|            litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 3058|     65|            litCSize = ((istart[1] &  3) << 8) + istart[2];
 3059|     65|            if (litCSize + lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3059:17): [True: 2, False: 63]
  ------------------
 3060|       |
 3061|     63|            {   size_t const errorCode = HUFv06_decompress1X4_usingDTable(dctx->litBuffer, litSize, istart+lhSize, litCSize, dctx->hufTableX4);
 3062|     63|                if (HUFv06_isError(errorCode)) return ERROR(corruption_detected);
  ------------------
  |  | 2733|     63|#define HUFv06_isError  ERR_isError
  ------------------
                              if (HUFv06_isError(errorCode)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     61|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     61|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     61|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3062:21): [True: 61, False: 2]
  ------------------
 3063|     63|            }
 3064|      2|            dctx->litPtr = dctx->litBuffer;
 3065|      2|            dctx->litSize = litSize;
 3066|      2|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  487|      2|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3067|      2|            return litCSize + lhSize;
 3068|     63|        }
 3069|     50|    case IS_RAW:
  ------------------
  |  |  430|     50|#define IS_RAW 2
  ------------------
  |  Branch (3069:5): [True: 50, False: 1.04k]
  ------------------
 3070|     50|        {   size_t litSize;
 3071|     50|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3072|     50|            switch(lhSize)
 3073|     50|            {
 3074|     26|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3074:13): [True: 16, False: 34]
  |  Branch (3074:21): [True: 10, False: 40]
  |  Branch (3074:29): [True: 0, False: 50]
  ------------------
 3075|     26|                lhSize=1;
 3076|     26|                litSize = istart[0] & 31;
 3077|     26|                break;
 3078|     11|            case 2:
  ------------------
  |  Branch (3078:13): [True: 11, False: 39]
  ------------------
 3079|     11|                litSize = ((istart[0] & 15) << 8) + istart[1];
 3080|     11|                break;
 3081|     13|            case 3:
  ------------------
  |  Branch (3081:13): [True: 13, False: 37]
  ------------------
 3082|     13|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 3083|     13|                break;
 3084|     50|            }
 3085|       |
 3086|     50|            if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */
  ------------------
  |  |  487|     50|#define WILDCOPY_OVERLENGTH 8
  ------------------
  |  Branch (3086:17): [True: 29, False: 21]
  ------------------
 3087|     29|                if (litSize+lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|     25|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     25|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     25|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3087:21): [True: 25, False: 4]
  ------------------
 3088|      4|                memcpy(dctx->litBuffer, istart+lhSize, litSize);
 3089|      4|                dctx->litPtr = dctx->litBuffer;
 3090|      4|                dctx->litSize = litSize;
 3091|      4|                memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  487|      4|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3092|      4|                return lhSize+litSize;
 3093|     29|            }
 3094|       |            /* direct reference into compressed stream */
 3095|     21|            dctx->litPtr = istart+lhSize;
 3096|     21|            dctx->litSize = litSize;
 3097|     21|            return lhSize+litSize;
 3098|     50|        }
 3099|    400|    case IS_RLE:
  ------------------
  |  |  431|    400|#define IS_RLE 3
  ------------------
  |  Branch (3099:5): [True: 400, False: 696]
  ------------------
 3100|    400|        {   size_t litSize;
 3101|    400|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3102|    400|            switch(lhSize)
 3103|    400|            {
 3104|     19|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3104:13): [True: 8, False: 392]
  |  Branch (3104:21): [True: 11, False: 389]
  |  Branch (3104:29): [True: 0, False: 400]
  ------------------
 3105|     19|                lhSize = 1;
 3106|     19|                litSize = istart[0] & 31;
 3107|     19|                break;
 3108|    289|            case 2:
  ------------------
  |  Branch (3108:13): [True: 289, False: 111]
  ------------------
 3109|    289|                litSize = ((istart[0] & 15) << 8) + istart[1];
 3110|    289|                break;
 3111|     92|            case 3:
  ------------------
  |  Branch (3111:13): [True: 92, False: 308]
  ------------------
 3112|     92|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 3113|     92|                if (srcSize<4) return ERROR(corruption_detected);   /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need lhSize+1 = 4 */
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3113:21): [True: 1, False: 91]
  ------------------
 3114|     91|                break;
 3115|    400|            }
 3116|    399|            if (litSize > ZSTDv06_BLOCKSIZE_MAX) return ERROR(corruption_detected);
  ------------------
  |  |  344|    399|#define ZSTDv06_BLOCKSIZE_MAX (128 * 1024)   /* define, for static allocation */
  ------------------
                          if (litSize > ZSTDv06_BLOCKSIZE_MAX) return ERROR(corruption_detected);
  ------------------
  |  |   49|     13|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     13|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     13|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3116:17): [True: 13, False: 386]
  ------------------
 3117|    386|            memset(dctx->litBuffer, istart[lhSize], litSize + WILDCOPY_OVERLENGTH);
  ------------------
  |  |  487|    386|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3118|    386|            dctx->litPtr = dctx->litBuffer;
 3119|    386|            dctx->litSize = litSize;
 3120|    386|            return lhSize+1;
 3121|    399|        }
 3122|      0|    default:
  ------------------
  |  Branch (3122:5): [True: 0, False: 1.09k]
  ------------------
 3123|      0|        return ERROR(corruption_detected);   /* impossible */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3124|  1.09k|    }
 3125|  1.09k|}
zstd_v06.c:ZSTDv06_decompressSequences:
 3391|    446|{
 3392|    446|    const BYTE* ip = (const BYTE*)seqStart;
 3393|    446|    const BYTE* const iend = ip + seqSize;
 3394|    446|    BYTE* const ostart = (BYTE*)dst;
 3395|    446|    BYTE* const oend = ostart + maxDstSize;
 3396|    446|    BYTE* op = ostart;
 3397|    446|    const BYTE* litPtr = dctx->litPtr;
 3398|    446|    const BYTE* const litEnd = litPtr + dctx->litSize;
 3399|    446|    FSEv06_DTable* DTableLL = dctx->LLTable;
 3400|    446|    FSEv06_DTable* DTableML = dctx->MLTable;
 3401|    446|    FSEv06_DTable* DTableOffb = dctx->OffTable;
 3402|    446|    const BYTE* const base = (const BYTE*) (dctx->base);
 3403|    446|    const BYTE* const vBase = (const BYTE*) (dctx->vBase);
 3404|    446|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 3405|    446|    int nbSeq;
 3406|       |
 3407|       |    /* Build Decoding Tables */
 3408|    446|    {   size_t const seqHSize = ZSTDv06_decodeSeqHeaders(&nbSeq, DTableLL, DTableML, DTableOffb, dctx->flagRepeatTable, ip, seqSize);
 3409|    446|        if (ZSTDv06_isError(seqHSize)) return seqHSize;
  ------------------
  |  | 2731|    446|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3409:13): [True: 65, False: 381]
  ------------------
 3410|    381|        ip += seqHSize;
 3411|    381|        dctx->flagRepeatTable = 0;
 3412|    381|    }
 3413|       |
 3414|       |    /* Regen sequences */
 3415|    381|    if (nbSeq) {
  ------------------
  |  Branch (3415:9): [True: 345, False: 36]
  ------------------
 3416|    345|        seq_t sequence;
 3417|    345|        seqState_t seqState;
 3418|       |
 3419|    345|        memset(&sequence, 0, sizeof(sequence));
 3420|    345|        sequence.offset = REPCODE_STARTVALUE;
  ------------------
  |  |  437|    345|#define REPCODE_STARTVALUE 1
  ------------------
 3421|  1.38k|        { U32 i; for (i=0; i<ZSTDv06_REP_INIT; i++) seqState.prevOffset[i] = REPCODE_STARTVALUE; }
  ------------------
  |  |  402|  1.38k|#define ZSTDv06_REP_INIT   ZSTDv06_REP_NUM
  |  |  ------------------
  |  |  |  |  401|  1.38k|#define ZSTDv06_REP_NUM    3
  |  |  ------------------
  ------------------
                      { U32 i; for (i=0; i<ZSTDv06_REP_INIT; i++) seqState.prevOffset[i] = REPCODE_STARTVALUE; }
  ------------------
  |  |  437|  1.03k|#define REPCODE_STARTVALUE 1
  ------------------
  |  Branch (3421:28): [True: 1.03k, False: 345]
  ------------------
 3422|    345|        { size_t const errorCode = BITv06_initDStream(&(seqState.DStream), ip, iend-ip);
 3423|    345|          if (ERR_isError(errorCode)) return ERROR(corruption_detected); }
  ------------------
  |  |   49|     29|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     29|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     29|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3423:15): [True: 29, False: 316]
  ------------------
 3424|    316|        FSEv06_initDState(&(seqState.stateLL), &(seqState.DStream), DTableLL);
 3425|    316|        FSEv06_initDState(&(seqState.stateOffb), &(seqState.DStream), DTableOffb);
 3426|    316|        FSEv06_initDState(&(seqState.stateML), &(seqState.DStream), DTableML);
 3427|       |
 3428|  12.1k|        for ( ; (BITv06_reloadDStream(&(seqState.DStream)) <= BITv06_DStream_completed) && nbSeq ; ) {
  ------------------
  |  Branch (3428:17): [True: 12.0k, False: 95]
  |  Branch (3428:92): [True: 12.0k, False: 36]
  ------------------
 3429|  12.0k|            nbSeq--;
 3430|  12.0k|            ZSTDv06_decodeSequence(&sequence, &seqState);
 3431|       |
 3432|       |#if 0  /* debug */
 3433|       |            static BYTE* start = NULL;
 3434|       |            if (start==NULL) start = op;
 3435|       |            size_t pos = (size_t)(op-start);
 3436|       |            if ((pos >= 5810037) && (pos < 5810400))
 3437|       |                printf("Dpos %6u :%5u literals & match %3u bytes at distance %6u \n",
 3438|       |                       pos, (U32)sequence.litLength, (U32)sequence.matchLength, (U32)sequence.offset);
 3439|       |#endif
 3440|       |
 3441|  12.0k|            {   size_t const oneSeqSize = ZSTDv06_execSequence(op, oend, sequence, &litPtr, litEnd, base, vBase, dictEnd);
 3442|  12.0k|                if (ZSTDv06_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  | 2731|  12.0k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3442:21): [True: 185, False: 11.8k]
  ------------------
 3443|  11.8k|                op += oneSeqSize;
 3444|  11.8k|        }   }
 3445|       |
 3446|       |        /* check if reached exact end */
 3447|    131|        if (nbSeq) return ERROR(corruption_detected);
  ------------------
  |  |   49|     87|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     87|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     87|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3447:13): [True: 87, False: 44]
  ------------------
 3448|    131|    }
 3449|       |
 3450|       |    /* last literal segment */
 3451|     80|    {   size_t const lastLLSize = litEnd - litPtr;
 3452|     80|        if (litPtr > litEnd) return ERROR(corruption_detected);   /* too many literals already used */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3452:13): [True: 0, False: 80]
  ------------------
 3453|     80|        if (op+lastLLSize > oend) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3453:13): [True: 2, False: 78]
  ------------------
 3454|     78|        if (lastLLSize > 0) {
  ------------------
  |  Branch (3454:13): [True: 73, False: 5]
  ------------------
 3455|     73|            memcpy(op, litPtr, lastLLSize);
 3456|     73|            op += lastLLSize;
 3457|     73|        }
 3458|     78|    }
 3459|       |
 3460|      0|    return op-ostart;
 3461|     80|}
zstd_v06.c:ZSTDv06_decodeSeqHeaders:
 3165|    446|{
 3166|    446|    const BYTE* const istart = (const BYTE*)src;
 3167|    446|    const BYTE* const iend = istart + srcSize;
 3168|    446|    const BYTE* ip = istart;
 3169|       |
 3170|       |    /* check */
 3171|    446|    if (srcSize < MIN_SEQUENCES_SIZE) return ERROR(srcSize_wrong);
  ------------------
  |  |  423|    446|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  ------------------
                  if (srcSize < MIN_SEQUENCES_SIZE) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3171:9): [True: 1, False: 445]
  ------------------
 3172|       |
 3173|       |    /* SeqHead */
 3174|    445|    {   int nbSeq = *ip++;
 3175|    445|        if (!nbSeq) { *nbSeqPtr=0; return 1; }
  ------------------
  |  Branch (3175:13): [True: 31, False: 414]
  ------------------
 3176|    414|        if (nbSeq > 0x7F) {
  ------------------
  |  Branch (3176:13): [True: 120, False: 294]
  ------------------
 3177|    120|            if (nbSeq == 0xFF) {
  ------------------
  |  Branch (3177:17): [True: 41, False: 79]
  ------------------
 3178|     41|                if (ip+2 > iend) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3178:21): [True: 1, False: 40]
  ------------------
 3179|     40|                nbSeq = MEM_readLE16(ip) + LONGNBSEQ, ip+=2;
  ------------------
  |  |  433|     40|#define LONGNBSEQ 0x7F00
  ------------------
 3180|     79|            } else {
 3181|     79|                if (ip >= iend) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3181:21): [True: 1, False: 78]
  ------------------
 3182|     78|                nbSeq = ((nbSeq-0x80)<<8) + *ip++;
 3183|     78|            }
 3184|    120|        }
 3185|    412|        *nbSeqPtr = nbSeq;
 3186|    412|    }
 3187|       |
 3188|       |    /* FSE table descriptors */
 3189|    412|    if (ip + 4 > iend) return ERROR(srcSize_wrong); /* min : header byte + all 3 are "raw", hence no header, but at least xxLog bits per type */
  ------------------
  |  |   49|      3|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      3|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      3|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3189:9): [True: 3, False: 409]
  ------------------
 3190|    409|    {   U32 const LLtype  = *ip >> 6;
 3191|    409|        U32 const Offtype = (*ip >> 4) & 3;
 3192|    409|        U32 const MLtype  = (*ip >> 2) & 3;
 3193|    409|        ip++;
 3194|       |
 3195|       |        /* Build DTables */
 3196|    409|        {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableLL, LLtype, MaxLL, LLFSELog, ip, iend-ip, LL_defaultNorm, LL_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  442|    409|#define MaxLL  35
  ------------------
                      {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableLL, LLtype, MaxLL, LLFSELog, ip, iend-ip, LL_defaultNorm, LL_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  446|    409|#define LLFSELog    9
  ------------------
 3197|    409|            if (ZSTDv06_isError(bhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2731|    409|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
                          if (ZSTDv06_isError(bhSize)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     15|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     15|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     15|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3197:17): [True: 15, False: 394]
  ------------------
 3198|    394|            ip += bhSize;
 3199|    394|        }
 3200|    394|        {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableOffb, Offtype, MaxOff, OffFSELog, ip, iend-ip, OF_defaultNorm, OF_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  443|    394|#define MaxOff 28
  ------------------
                      {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableOffb, Offtype, MaxOff, OffFSELog, ip, iend-ip, OF_defaultNorm, OF_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  447|    394|#define OffFSELog   8
  ------------------
 3201|    394|            if (ZSTDv06_isError(bhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2731|    394|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
                          if (ZSTDv06_isError(bhSize)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     20|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     20|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     20|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3201:17): [True: 20, False: 374]
  ------------------
 3202|    374|            ip += bhSize;
 3203|    374|        }
 3204|    374|        {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableML, MLtype, MaxML, MLFSELog, ip, iend-ip, ML_defaultNorm, ML_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  441|    374|#define MaxML  52
  ------------------
                      {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableML, MLtype, MaxML, MLFSELog, ip, iend-ip, ML_defaultNorm, ML_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  445|    374|#define MLFSELog    9
  ------------------
 3205|    374|            if (ZSTDv06_isError(bhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2731|    374|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
                          if (ZSTDv06_isError(bhSize)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     24|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     24|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     24|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3205:17): [True: 24, False: 350]
  ------------------
 3206|    350|            ip += bhSize;
 3207|    350|    }   }
 3208|       |
 3209|      0|    return ip-istart;
 3210|    374|}
zstd_v06.c:ZSTDv06_buildSeqTable:
 3135|  1.17k|{
 3136|  1.17k|    switch(type)
 3137|  1.17k|    {
 3138|    244|    case FSEv06_ENCODING_RLE :
  ------------------
  |  |  450|    244|#define FSEv06_ENCODING_RLE     1
  ------------------
  |  Branch (3138:5): [True: 244, False: 933]
  ------------------
 3139|    244|        if (!srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3139:13): [True: 2, False: 242]
  ------------------
 3140|    242|        if ( (*(const BYTE*)src) > max) return ERROR(corruption_detected);
  ------------------
  |  |   49|     11|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     11|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     11|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3140:14): [True: 11, False: 231]
  ------------------
 3141|    231|        FSEv06_buildDTable_rle(DTable, *(const BYTE*)src);   /* if *src > max, data is corrupted */
 3142|    231|        return 1;
 3143|    394|    case FSEv06_ENCODING_RAW :
  ------------------
  |  |  449|    394|#define FSEv06_ENCODING_RAW     0
  ------------------
  |  Branch (3143:5): [True: 394, False: 783]
  ------------------
 3144|    394|        FSEv06_buildDTable(DTable, defaultNorm, max, defaultLog);
 3145|    394|        return 0;
 3146|      7|    case FSEv06_ENCODING_STATIC:
  ------------------
  |  |  451|      7|#define FSEv06_ENCODING_STATIC  2
  ------------------
  |  Branch (3146:5): [True: 7, False: 1.17k]
  ------------------
 3147|      7|        if (!flagRepeatTable) return ERROR(corruption_detected);
  ------------------
  |  |   49|      3|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      3|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      3|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3147:13): [True: 3, False: 4]
  ------------------
 3148|      4|        return 0;
 3149|      0|    default :   /* impossible */
  ------------------
  |  Branch (3149:5): [True: 0, False: 1.17k]
  ------------------
 3150|    532|    case FSEv06_ENCODING_DYNAMIC :
  ------------------
  |  |  452|    532|#define FSEv06_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3150:5): [True: 532, False: 645]
  ------------------
 3151|    532|        {   U32 tableLog;
 3152|    532|            S16 norm[MaxSeq+1];
 3153|    532|            size_t const headerSize = FSEv06_readNCount(norm, &max, &tableLog, src, srcSize);
 3154|    532|            if (FSEv06_isError(headerSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2732|    532|#define FSEv06_isError  ERR_isError
  ------------------
                          if (FSEv06_isError(headerSize)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     24|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     24|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     24|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3154:17): [True: 24, False: 508]
  ------------------
 3155|    508|            if (tableLog > maxLog) return ERROR(corruption_detected);
  ------------------
  |  |   49|     19|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     19|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     19|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3155:17): [True: 19, False: 489]
  ------------------
 3156|    489|            FSEv06_buildDTable(DTable, norm, max, tableLog);
 3157|    489|            return headerSize;
 3158|    508|    }   }
 3159|  1.17k|}
zstd_v06.c:ZSTDv06_decodeSequence:
 3230|  12.0k|{
 3231|       |    /* Literal length */
 3232|  12.0k|    U32 const llCode = FSEv06_peekSymbol(&(seqState->stateLL));
 3233|  12.0k|    U32 const mlCode = FSEv06_peekSymbol(&(seqState->stateML));
 3234|  12.0k|    U32 const ofCode = FSEv06_peekSymbol(&(seqState->stateOffb));   /* <= maxOff, by table construction */
 3235|       |
 3236|  12.0k|    U32 const llBits = LL_bits[llCode];
 3237|  12.0k|    U32 const mlBits = ML_bits[mlCode];
 3238|  12.0k|    U32 const ofBits = ofCode;
 3239|  12.0k|    U32 const totalBits = llBits+mlBits+ofBits;
 3240|       |
 3241|  12.0k|    static const U32 LL_base[MaxLL+1] = {
 3242|  12.0k|                             0,  1,  2,  3,  4,  5,  6,  7,  8,  9,   10,    11,    12,    13,    14,     15,
 3243|  12.0k|                            16, 18, 20, 22, 24, 28, 32, 40, 48, 64, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000,
 3244|  12.0k|                            0x2000, 0x4000, 0x8000, 0x10000 };
 3245|       |
 3246|  12.0k|    static const U32 ML_base[MaxML+1] = {
 3247|  12.0k|                             0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10,   11,    12,    13,    14,    15,
 3248|  12.0k|                            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,   27,    28,    29,    30,    31,
 3249|  12.0k|                            32, 34, 36, 38, 40, 44, 48, 56, 64, 80, 96, 0x80, 0x100, 0x200, 0x400, 0x800,
 3250|  12.0k|                            0x1000, 0x2000, 0x4000, 0x8000, 0x10000 };
 3251|       |
 3252|  12.0k|    static const U32 OF_base[MaxOff+1] = {
 3253|  12.0k|                 0,        1,       3,       7,     0xF,     0x1F,     0x3F,     0x7F,
 3254|  12.0k|                 0xFF,   0x1FF,   0x3FF,   0x7FF,   0xFFF,   0x1FFF,   0x3FFF,   0x7FFF,
 3255|  12.0k|                 0xFFFF, 0x1FFFF, 0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF, 0x7FFFFF,
 3256|  12.0k|                 0xFFFFFF, 0x1FFFFFF, 0x3FFFFFF, /*fake*/ 1, 1 };
 3257|       |
 3258|       |    /* sequence */
 3259|  12.0k|    {   size_t offset;
 3260|  12.0k|        if (!ofCode)
  ------------------
  |  Branch (3260:13): [True: 7.07k, False: 4.96k]
  ------------------
 3261|  7.07k|            offset = 0;
 3262|  4.96k|        else {
 3263|  4.96k|            offset = OF_base[ofCode] + BITv06_readBits(&(seqState->DStream), ofBits);   /* <=  26 bits */
 3264|  4.96k|            if (MEM_32bits()) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3264:17): [True: 0, False: 4.96k]
  ------------------
 3265|  4.96k|        }
 3266|       |
 3267|  12.0k|        if (offset < ZSTDv06_REP_NUM) {
  ------------------
  |  |  401|  12.0k|#define ZSTDv06_REP_NUM    3
  ------------------
  |  Branch (3267:13): [True: 10.3k, False: 1.68k]
  ------------------
 3268|  10.3k|            if (llCode == 0 && offset <= 1) offset = 1-offset;
  ------------------
  |  Branch (3268:17): [True: 3.74k, False: 6.60k]
  |  Branch (3268:32): [True: 3.31k, False: 431]
  ------------------
 3269|       |
 3270|  10.3k|            if (offset != 0) {
  ------------------
  |  Branch (3270:17): [True: 5.23k, False: 5.11k]
  ------------------
 3271|  5.23k|                size_t temp = seqState->prevOffset[offset];
 3272|  5.23k|                if (offset != 1) {
  ------------------
  |  Branch (3272:21): [True: 1.21k, False: 4.01k]
  ------------------
 3273|  1.21k|                    seqState->prevOffset[2] = seqState->prevOffset[1];
 3274|  1.21k|                }
 3275|  5.23k|                seqState->prevOffset[1] = seqState->prevOffset[0];
 3276|  5.23k|                seqState->prevOffset[0] = offset = temp;
 3277|       |
 3278|  5.23k|            } else {
 3279|  5.11k|                offset = seqState->prevOffset[0];
 3280|  5.11k|            }
 3281|  10.3k|        } else {
 3282|  1.68k|            offset -= ZSTDv06_REP_MOVE;
  ------------------
  |  |  403|  1.68k|#define ZSTDv06_REP_MOVE   (ZSTDv06_REP_NUM-1)
  |  |  ------------------
  |  |  |  |  401|  1.68k|#define ZSTDv06_REP_NUM    3
  |  |  ------------------
  ------------------
 3283|  1.68k|            seqState->prevOffset[2] = seqState->prevOffset[1];
 3284|  1.68k|            seqState->prevOffset[1] = seqState->prevOffset[0];
 3285|  1.68k|            seqState->prevOffset[0] = offset;
 3286|  1.68k|        }
 3287|  12.0k|        seq->offset = offset;
 3288|  12.0k|    }
 3289|       |
 3290|  12.0k|    seq->matchLength = ML_base[mlCode] + MINMATCH + ((mlCode>31) ? BITv06_readBits(&(seqState->DStream), mlBits) : 0);   /* <=  16 bits */
  ------------------
  |  |  435|  12.0k|#define MINMATCH 3
  ------------------
  |  Branch (3290:54): [True: 1.42k, False: 10.6k]
  ------------------
 3291|  12.0k|    if (MEM_32bits() && (mlBits+llBits>24)) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3291:9): [True: 0, False: 12.0k]
  |  Branch (3291:25): [True: 0, False: 0]
  ------------------
 3292|       |
 3293|  12.0k|    seq->litLength = LL_base[llCode] + ((llCode>15) ? BITv06_readBits(&(seqState->DStream), llBits) : 0);   /* <=  16 bits */
  ------------------
  |  Branch (3293:41): [True: 1.21k, False: 10.8k]
  ------------------
 3294|  12.0k|    if (MEM_32bits() ||
  ------------------
  |  Branch (3294:9): [True: 0, False: 12.0k]
  ------------------
 3295|  12.0k|       (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  |  446|  12.0k|#define LLFSELog    9
  ------------------
                     (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  |  445|  12.0k|#define MLFSELog    9
  ------------------
                     (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  |  447|  12.0k|#define OffFSELog   8
  ------------------
  |  Branch (3295:8): [True: 59, False: 11.9k]
  ------------------
 3296|       |
 3297|       |    /* ANS state update */
 3298|  12.0k|    FSEv06_updateState(&(seqState->stateLL), &(seqState->DStream));   /* <=  9 bits */
 3299|  12.0k|    FSEv06_updateState(&(seqState->stateML), &(seqState->DStream));   /* <=  9 bits */
 3300|  12.0k|    if (MEM_32bits()) BITv06_reloadDStream(&(seqState->DStream));     /* <= 18 bits */
  ------------------
  |  Branch (3300:9): [True: 0, False: 12.0k]
  ------------------
 3301|  12.0k|    FSEv06_updateState(&(seqState->stateOffb), &(seqState->DStream)); /* <=  8 bits */
 3302|  12.0k|}
zstd_v06.c:FSEv06_peekSymbol:
 1062|  36.1k|{
 1063|  36.1k|    FSEv06_decode_t const DInfo = ((const FSEv06_decode_t*)(DStatePtr->table))[DStatePtr->state];
 1064|  36.1k|    return DInfo.symbol;
 1065|  36.1k|}
zstd_v06.c:FSEv06_updateState:
 1068|  36.1k|{
 1069|  36.1k|    FSEv06_decode_t const DInfo = ((const FSEv06_decode_t*)(DStatePtr->table))[DStatePtr->state];
 1070|  36.1k|    U32 const nbBits = DInfo.nbBits;
 1071|  36.1k|    size_t const lowBits = BITv06_readBits(bitD, nbBits);
 1072|  36.1k|    DStatePtr->state = DInfo.newState + lowBits;
 1073|  36.1k|}
zstd_v06.c:ZSTDv06_execSequence:
 3309|  12.0k|{
 3310|  12.0k|    BYTE* const oLitEnd = op + sequence.litLength;
 3311|  12.0k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 3312|  12.0k|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 3313|  12.0k|    BYTE* const oend_8 = oend-8;
 3314|  12.0k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 3315|  12.0k|    const BYTE* match = oLitEnd - sequence.offset;
 3316|       |
 3317|       |    /* checks */
 3318|  12.0k|    size_t const seqLength = sequence.litLength + sequence.matchLength;
 3319|       |
 3320|  12.0k|    if (seqLength > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|     26|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     26|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     26|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3320:9): [True: 26, False: 12.0k]
  ------------------
 3321|  12.0k|    if (sequence.litLength > (size_t)(litLimit - *litPtr)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     66|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     66|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     66|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3321:9): [True: 66, False: 11.9k]
  ------------------
 3322|       |    /* Now we know there are no overflow in literal nor match lengths, can use pointer checks */
 3323|  11.9k|    if (oLitEnd > oend_8) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      3|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      3|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      3|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3323:9): [True: 3, False: 11.9k]
  ------------------
 3324|       |
 3325|  11.9k|    if (oMatchEnd > oend) return ERROR(dstSize_tooSmall);   /* overwrite beyond dst buffer */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3325:9): [True: 0, False: 11.9k]
  ------------------
 3326|  11.9k|    if (iLitEnd > litLimit) return ERROR(corruption_detected);   /* overRead beyond lit buffer */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3326:9): [True: 0, False: 11.9k]
  ------------------
 3327|       |
 3328|       |    /* copy Literals */
 3329|  11.9k|    ZSTDv06_wildcopy(op, *litPtr, (ptrdiff_t)sequence.litLength);   /* note : oLitEnd <= oend-8 : no risk of overwrite beyond oend */
 3330|  11.9k|    op = oLitEnd;
 3331|  11.9k|    *litPtr = iLitEnd;   /* update for next sequence */
 3332|       |
 3333|       |    /* copy Match */
 3334|  11.9k|    if (sequence.offset > (size_t)(oLitEnd - base)) {
  ------------------
  |  Branch (3334:9): [True: 195, False: 11.7k]
  ------------------
 3335|       |        /* offset beyond prefix */
 3336|    195|        if (sequence.offset > (size_t)(oLitEnd - vBase)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     90|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     90|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     90|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3336:13): [True: 90, False: 105]
  ------------------
 3337|    105|        match = dictEnd - (base-match);
 3338|    105|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (3338:13): [True: 75, False: 30]
  ------------------
 3339|     75|            memmove(oLitEnd, match, sequence.matchLength);
 3340|     75|            return sequenceLength;
 3341|     75|        }
 3342|       |        /* span extDict & currentPrefixSegment */
 3343|     30|        {   size_t const length1 = dictEnd - match;
 3344|     30|            memmove(oLitEnd, match, length1);
 3345|     30|            op = oLitEnd + length1;
 3346|     30|            sequence.matchLength -= length1;
 3347|     30|            match = base;
 3348|     30|            if (op > oend_8 || sequence.matchLength < MINMATCH) {
  ------------------
  |  |  435|     30|#define MINMATCH 3
  ------------------
  |  Branch (3348:17): [True: 0, False: 30]
  |  Branch (3348:32): [True: 19, False: 11]
  ------------------
 3349|     52|              while (op < oMatchEnd) *op++ = *match++;
  ------------------
  |  Branch (3349:22): [True: 33, False: 19]
  ------------------
 3350|     19|              return sequenceLength;
 3351|     19|            }
 3352|     30|    }   }
 3353|       |    /* Requirement: op <= oend_8 */
 3354|       |
 3355|       |    /* match within prefix */
 3356|  11.7k|    if (sequence.offset < 8) {
  ------------------
  |  Branch (3356:9): [True: 10.1k, False: 1.65k]
  ------------------
 3357|       |        /* close range match, overlap */
 3358|  10.1k|        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
 3359|  10.1k|        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
 3360|  10.1k|        int const sub2 = dec64table[sequence.offset];
 3361|  10.1k|        op[0] = match[0];
 3362|  10.1k|        op[1] = match[1];
 3363|  10.1k|        op[2] = match[2];
 3364|  10.1k|        op[3] = match[3];
 3365|  10.1k|        match += dec32table[sequence.offset];
 3366|  10.1k|        ZSTDv06_copy4(op+4, match);
 3367|  10.1k|        match -= sub2;
 3368|  10.1k|    } else {
 3369|  1.65k|        ZSTDv06_copy8(op, match);
 3370|  1.65k|    }
 3371|  11.7k|    op += 8; match += 8;
 3372|       |
 3373|  11.7k|    if (oMatchEnd > oend-(16-MINMATCH)) {
  ------------------
  |  |  435|  11.7k|#define MINMATCH 3
  ------------------
  |  Branch (3373:9): [True: 25, False: 11.7k]
  ------------------
 3374|     25|        if (op < oend_8) {
  ------------------
  |  Branch (3374:13): [True: 18, False: 7]
  ------------------
 3375|     18|            ZSTDv06_wildcopy(op, match, oend_8 - op);
 3376|     18|            match += oend_8 - op;
 3377|     18|            op = oend_8;
 3378|     18|        }
 3379|     74|        while (op < oMatchEnd) *op++ = *match++;
  ------------------
  |  Branch (3379:16): [True: 49, False: 25]
  ------------------
 3380|  11.7k|    } else {
 3381|  11.7k|        ZSTDv06_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8);   /* works even if matchLength < 8 */
 3382|  11.7k|    }
 3383|  11.7k|    return sequenceLength;
 3384|  11.9k|}
zstd_v06.c:ZSTDv06_wildcopy:
  489|  23.6k|{
  490|  23.6k|    const BYTE* ip = (const BYTE*)src;
  491|  23.6k|    BYTE* op = (BYTE*)dst;
  492|  23.6k|    BYTE* const oend = op + length;
  493|  23.6k|    do
  494|  2.21M|        COPY8(op, ip)
  ------------------
  |  |  483|  2.21M|#define COPY8(d,s) { ZSTDv06_copy8(d,s); d+=8; s+=8; }
  ------------------
  495|  2.21M|    while (op < oend);
  ------------------
  |  Branch (495:12): [True: 2.18M, False: 23.6k]
  ------------------
  496|  23.6k|}
zstd_v06.c:ZSTDv06_copy4:
 2739|  10.1k|static void ZSTDv06_copy4(void* dst, const void* src) { memcpy(dst, src, 4); }
zstd_v06.c:ZSTDv06_copy8:
  482|  2.21M|static void ZSTDv06_copy8(void* dst, const void* src) { memcpy(dst, src, 8); }
zstd_v06.c:ZSTDv06_decompressFrame:
 3507|  1.75k|{
 3508|  1.75k|    const BYTE* ip = (const BYTE*)src;
 3509|  1.75k|    const BYTE* const iend = ip + srcSize;
 3510|  1.75k|    BYTE* const ostart = (BYTE*)dst;
 3511|  1.75k|    BYTE* op = ostart;
 3512|  1.75k|    BYTE* const oend = ostart + dstCapacity;
 3513|  1.75k|    size_t remainingSize = srcSize;
 3514|  1.75k|    blockProperties_t blockProperties = { bt_compressed, 0 };
 3515|       |
 3516|       |    /* check */
 3517|  1.75k|    if (srcSize < ZSTDv06_frameHeaderSize_min+ZSTDv06_blockHeaderSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3517:9): [True: 0, False: 1.75k]
  ------------------
 3518|       |
 3519|       |    /* Frame Header */
 3520|  1.75k|    {   size_t const frameHeaderSize = ZSTDv06_frameHeaderSize(src, ZSTDv06_frameHeaderSize_min);
 3521|  1.75k|        if (ZSTDv06_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  | 2731|  1.75k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3521:13): [True: 0, False: 1.75k]
  ------------------
 3522|  1.75k|        if (srcSize < frameHeaderSize+ZSTDv06_blockHeaderSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3522:13): [True: 0, False: 1.75k]
  ------------------
 3523|  1.75k|        if (ZSTDv06_decodeFrameHeader(dctx, src, frameHeaderSize)) return ERROR(corruption_detected);
  ------------------
  |  |   49|      6|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      6|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      6|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3523:13): [True: 6, False: 1.74k]
  ------------------
 3524|  1.74k|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3525|  1.74k|    }
 3526|       |
 3527|       |    /* Loop on each block */
 3528|  2.14k|    while (1) {
  ------------------
  |  Branch (3528:12): [True: 2.14k, Folded]
  ------------------
 3529|  2.14k|        size_t decodedSize=0;
 3530|  2.14k|        size_t const cBlockSize = ZSTDv06_getcBlockSize(ip, iend-ip, &blockProperties);
 3531|  2.14k|        if (ZSTDv06_isError(cBlockSize)) return cBlockSize;
  ------------------
  |  | 2731|  2.14k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3531:13): [True: 0, False: 2.14k]
  ------------------
 3532|       |
 3533|  2.14k|        ip += ZSTDv06_blockHeaderSize;
 3534|  2.14k|        remainingSize -= ZSTDv06_blockHeaderSize;
 3535|  2.14k|        if (cBlockSize > remainingSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3535:13): [True: 0, False: 2.14k]
  ------------------
 3536|       |
 3537|  2.14k|        switch(blockProperties.blockType)
 3538|  2.14k|        {
 3539|  1.34k|        case bt_compressed:
  ------------------
  |  Branch (3539:9): [True: 1.34k, False: 796]
  ------------------
 3540|  1.34k|            decodedSize = ZSTDv06_decompressBlock_internal(dctx, op, oend-op, ip, cBlockSize);
 3541|  1.34k|            break;
 3542|    619|        case bt_raw :
  ------------------
  |  Branch (3542:9): [True: 619, False: 1.52k]
  ------------------
 3543|    619|            decodedSize = ZSTDv06_copyRawBlock(op, oend-op, ip, cBlockSize);
 3544|    619|            break;
 3545|     18|        case bt_rle :
  ------------------
  |  Branch (3545:9): [True: 18, False: 2.12k]
  ------------------
 3546|     18|            return ERROR(GENERIC);   /* not yet supported */
  ------------------
  |  |   49|     18|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     18|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     18|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3547|      0|            break;
 3548|    159|        case bt_end :
  ------------------
  |  Branch (3548:9): [True: 159, False: 1.98k]
  ------------------
 3549|       |            /* end of frame */
 3550|    159|            if (remainingSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3550:17): [True: 0, False: 159]
  ------------------
 3551|    159|            break;
 3552|    159|        default:
  ------------------
  |  Branch (3552:9): [True: 0, False: 2.14k]
  ------------------
 3553|      0|            return ERROR(GENERIC);   /* impossible */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3554|  2.14k|        }
 3555|  2.12k|        if (cBlockSize == 0) break;   /* bt_end */
  ------------------
  |  Branch (3555:13): [True: 707, False: 1.41k]
  ------------------
 3556|       |
 3557|  1.41k|        if (ZSTDv06_isError(decodedSize)) return decodedSize;
  ------------------
  |  | 2731|  1.41k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3557:13): [True: 1.02k, False: 391]
  ------------------
 3558|    391|        op += decodedSize;
 3559|    391|        ip += cBlockSize;
 3560|    391|        remainingSize -= cBlockSize;
 3561|    391|    }
 3562|       |
 3563|    707|    return op-ostart;
 3564|  1.74k|}
zstd_v06.c:ZSTD_errorFrameSizeInfoLegacy:
 3612|     49|{
 3613|     49|    *cSize = ret;
 3614|     49|    *dBound = ZSTD_CONTENTSIZE_ERROR;
  ------------------
  |  |  454|     49|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
 3615|     49|}
zstd_v06.c:ZSTDv06_getcBlockSize:
 2971|  6.35k|{
 2972|  6.35k|    const BYTE* const in = (const BYTE*)src;
 2973|  6.35k|    U32 cSize;
 2974|       |
 2975|  6.35k|    if (srcSize < ZSTDv06_blockHeaderSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2975:9): [True: 2, False: 6.35k]
  ------------------
 2976|       |
 2977|  6.35k|    bpPtr->blockType = (blockType_t)((*in) >> 6);
 2978|  6.35k|    cSize = in[2] + (in[1]<<8) + ((in[0] & 7)<<16);
 2979|  6.35k|    bpPtr->origSize = (bpPtr->blockType == bt_rle) ? cSize : 0;
  ------------------
  |  Branch (2979:23): [True: 891, False: 5.46k]
  ------------------
 2980|       |
 2981|  6.35k|    if (bpPtr->blockType == bt_end) return 0;
  ------------------
  |  Branch (2981:9): [True: 1.02k, False: 5.32k]
  ------------------
 2982|  5.32k|    if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (2982:9): [True: 891, False: 4.43k]
  ------------------
 2983|  4.43k|    return cSize;
 2984|  5.32k|}
zstd_v06.c:ZSTDv06_decodeFrameHeader:
 2955|  1.75k|{
 2956|  1.75k|    size_t const result = ZSTDv06_getFrameParams(&(zc->fParams), src, srcSize);
 2957|  1.75k|    if ((MEM_32bits()) && (zc->fParams.windowLog > 25)) return ERROR(frameParameter_unsupported);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2957:9): [True: 0, False: 1.75k]
  |  Branch (2957:27): [True: 0, False: 0]
  ------------------
 2958|  1.75k|    return result;
 2959|  1.75k|}
zstd_v06.c:ZSTDv06_copyRawBlock:
 2988|    619|{
 2989|    619|    if (dst==NULL) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2989:9): [True: 0, False: 619]
  ------------------
 2990|    619|    if (srcSize > dstCapacity) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2990:9): [True: 1, False: 618]
  ------------------
 2991|    618|    memcpy(dst, src, srcSize);
 2992|    618|    return srcSize;
 2993|    619|}
zstd_v06.c:ZSTDv06_decompress_insertDictionary:
 3803|    719|{
 3804|    719|    size_t eSize;
 3805|    719|    U32 const magic = MEM_readLE32(dict);
 3806|    719|    if (magic != ZSTDv06_DICT_MAGIC) {
  ------------------
  |  |  399|    719|#define ZSTDv06_DICT_MAGIC  0xEC30A436
  ------------------
  |  Branch (3806:9): [True: 109, False: 610]
  ------------------
 3807|       |        /* pure content mode */
 3808|    109|        ZSTDv06_refDictContent(dctx, dict, dictSize);
 3809|    109|        return 0;
 3810|    109|    }
 3811|       |    /* load entropy tables */
 3812|    610|    dict = (const char*)dict + 4;
 3813|    610|    dictSize -= 4;
 3814|    610|    eSize = ZSTDv06_loadEntropy(dctx, dict, dictSize);
 3815|    610|    if (ZSTDv06_isError(eSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2731|    610|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
                  if (ZSTDv06_isError(eSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|    503|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    503|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    503|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3815:9): [True: 503, False: 107]
  ------------------
 3816|       |
 3817|       |    /* reference dictionary content */
 3818|    107|    dict = (const char*)dict + eSize;
 3819|    107|    dictSize -= eSize;
 3820|    107|    ZSTDv06_refDictContent(dctx, dict, dictSize);
 3821|       |
 3822|    107|    return 0;
 3823|    610|}
zstd_v06.c:ZSTDv06_refDictContent:
 3751|    216|{
 3752|    216|    dctx->dictEnd = dctx->previousDstEnd;
 3753|    216|    dctx->vBase = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3754|    216|    dctx->base = dict;
 3755|    216|    dctx->previousDstEnd = (const char*)dict + dictSize;
 3756|    216|}
zstd_v06.c:ZSTDv06_loadEntropy:
 3759|    610|{
 3760|    610|    size_t hSize, offcodeHeaderSize, matchlengthHeaderSize, litlengthHeaderSize;
 3761|       |
 3762|    610|    hSize = HUFv06_readDTableX4(dctx->hufTableX4, dict, dictSize);
 3763|    610|    if (HUFv06_isError(hSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2733|    610|#define HUFv06_isError  ERR_isError
  ------------------
                  if (HUFv06_isError(hSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|    317|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    317|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    317|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3763:9): [True: 317, False: 293]
  ------------------
 3764|    293|    dict = (const char*)dict + hSize;
 3765|    293|    dictSize -= hSize;
 3766|       |
 3767|    293|    {   short offcodeNCount[MaxOff+1];
 3768|    293|        U32 offcodeMaxValue=MaxOff, offcodeLog;
  ------------------
  |  |  443|    293|#define MaxOff 28
  ------------------
 3769|    293|        offcodeHeaderSize = FSEv06_readNCount(offcodeNCount, &offcodeMaxValue, &offcodeLog, dict, dictSize);
 3770|    293|        if (FSEv06_isError(offcodeHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2732|    293|#define FSEv06_isError  ERR_isError
  ------------------
                      if (FSEv06_isError(offcodeHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|     50|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     50|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     50|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3770:13): [True: 50, False: 243]
  ------------------
 3771|    243|        if (offcodeLog > OffFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  |  447|    243|#define OffFSELog   8
  ------------------
                      if (offcodeLog > OffFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|     23|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     23|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     23|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3771:13): [True: 23, False: 220]
  ------------------
 3772|    220|        { size_t const errorCode = FSEv06_buildDTable(dctx->OffTable, offcodeNCount, offcodeMaxValue, offcodeLog);
 3773|    220|          if (FSEv06_isError(errorCode)) return ERROR(dictionary_corrupted); }
  ------------------
  |  | 2732|    220|#define FSEv06_isError  ERR_isError
  ------------------
                        if (FSEv06_isError(errorCode)) return ERROR(dictionary_corrupted); }
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3773:15): [True: 0, False: 220]
  ------------------
 3774|    220|        dict = (const char*)dict + offcodeHeaderSize;
 3775|    220|        dictSize -= offcodeHeaderSize;
 3776|    220|    }
 3777|       |
 3778|      0|    {   short matchlengthNCount[MaxML+1];
 3779|    220|        unsigned matchlengthMaxValue = MaxML, matchlengthLog;
  ------------------
  |  |  441|    220|#define MaxML  52
  ------------------
 3780|    220|        matchlengthHeaderSize = FSEv06_readNCount(matchlengthNCount, &matchlengthMaxValue, &matchlengthLog, dict, dictSize);
 3781|    220|        if (FSEv06_isError(matchlengthHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2732|    220|#define FSEv06_isError  ERR_isError
  ------------------
                      if (FSEv06_isError(matchlengthHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|     41|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     41|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     41|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3781:13): [True: 41, False: 179]
  ------------------
 3782|    179|        if (matchlengthLog > MLFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  |  445|    179|#define MLFSELog    9
  ------------------
                      if (matchlengthLog > MLFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|     21|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     21|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     21|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3782:13): [True: 21, False: 158]
  ------------------
 3783|    158|        { size_t const errorCode = FSEv06_buildDTable(dctx->MLTable, matchlengthNCount, matchlengthMaxValue, matchlengthLog);
 3784|    158|          if (FSEv06_isError(errorCode)) return ERROR(dictionary_corrupted); }
  ------------------
  |  | 2732|    158|#define FSEv06_isError  ERR_isError
  ------------------
                        if (FSEv06_isError(errorCode)) return ERROR(dictionary_corrupted); }
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3784:15): [True: 0, False: 158]
  ------------------
 3785|    158|        dict = (const char*)dict + matchlengthHeaderSize;
 3786|    158|        dictSize -= matchlengthHeaderSize;
 3787|    158|    }
 3788|       |
 3789|      0|    {   short litlengthNCount[MaxLL+1];
 3790|    158|        unsigned litlengthMaxValue = MaxLL, litlengthLog;
  ------------------
  |  |  442|    158|#define MaxLL  35
  ------------------
 3791|    158|        litlengthHeaderSize = FSEv06_readNCount(litlengthNCount, &litlengthMaxValue, &litlengthLog, dict, dictSize);
 3792|    158|        if (FSEv06_isError(litlengthHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2732|    158|#define FSEv06_isError  ERR_isError
  ------------------
                      if (FSEv06_isError(litlengthHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|     28|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     28|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     28|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3792:13): [True: 28, False: 130]
  ------------------
 3793|    130|        if (litlengthLog > LLFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  |  446|    130|#define LLFSELog    9
  ------------------
                      if (litlengthLog > LLFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|     23|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     23|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     23|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3793:13): [True: 23, False: 107]
  ------------------
 3794|    107|        { size_t const errorCode = FSEv06_buildDTable(dctx->LLTable, litlengthNCount, litlengthMaxValue, litlengthLog);
 3795|    107|          if (FSEv06_isError(errorCode)) return ERROR(dictionary_corrupted); }
  ------------------
  |  | 2732|    107|#define FSEv06_isError  ERR_isError
  ------------------
                        if (FSEv06_isError(errorCode)) return ERROR(dictionary_corrupted); }
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3795:15): [True: 0, False: 107]
  ------------------
 3796|    107|    }
 3797|       |
 3798|    107|    dctx->flagRepeatTable = 1;
 3799|    107|    return hSize + offcodeHeaderSize + matchlengthHeaderSize + litlengthHeaderSize;
 3800|    107|}

FSEv07_isError:
 1134|    162|unsigned FSEv07_isError(size_t code) { return ERR_isError(code); }
HUFv07_isError:
 1142|  1.25k|unsigned HUFv07_isError(size_t code) { return ERR_isError(code); }
FSEv07_readNCount:
 1154|    628|{
 1155|    628|    const BYTE* const istart = (const BYTE*) headerBuffer;
 1156|    628|    const BYTE* const iend = istart + hbSize;
 1157|    628|    const BYTE* ip = istart;
 1158|    628|    int nbBits;
 1159|    628|    int remaining;
 1160|    628|    int threshold;
 1161|    628|    U32 bitStream;
 1162|    628|    int bitCount;
 1163|    628|    unsigned charnum = 0;
 1164|    628|    int previous0 = 0;
 1165|       |
 1166|    628|    if (hbSize < 4) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      5|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      5|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      5|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1166:9): [True: 5, False: 623]
  ------------------
 1167|    623|    bitStream = MEM_readLE32(ip);
 1168|    623|    nbBits = (bitStream & 0xF) + FSEv07_MIN_TABLELOG;   /* extract tableLog */
  ------------------
  |  |  903|    623|#define FSEv07_MIN_TABLELOG 5
  ------------------
 1169|    623|    if (nbBits > FSEv07_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |  905|    623|#define FSEv07_TABLELOG_ABSOLUTE_MAX 15
  ------------------
                  if (nbBits > FSEv07_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|      6|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      6|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      6|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1169:9): [True: 6, False: 617]
  ------------------
 1170|    617|    bitStream >>= 4;
 1171|    617|    bitCount = 4;
 1172|    617|    *tableLogPtr = nbBits;
 1173|    617|    remaining = (1<<nbBits)+1;
 1174|    617|    threshold = 1<<nbBits;
 1175|    617|    nbBits++;
 1176|       |
 1177|  8.45k|    while ((remaining>1) && (charnum<=*maxSVPtr)) {
  ------------------
  |  Branch (1177:12): [True: 7.84k, False: 603]
  |  Branch (1177:29): [True: 7.84k, False: 4]
  ------------------
 1178|  7.84k|        if (previous0) {
  ------------------
  |  Branch (1178:13): [True: 1.00k, False: 6.83k]
  ------------------
 1179|  1.00k|            unsigned n0 = charnum;
 1180|  1.06k|            while ((bitStream & 0xFFFF) == 0xFFFF) {
  ------------------
  |  Branch (1180:20): [True: 61, False: 1.00k]
  ------------------
 1181|     61|                n0+=24;
 1182|     61|                if (ip < iend-5) {
  ------------------
  |  Branch (1182:21): [True: 44, False: 17]
  ------------------
 1183|     44|                    ip+=2;
 1184|     44|                    bitStream = MEM_readLE32(ip) >> bitCount;
 1185|     44|                } else {
 1186|     17|                    bitStream >>= 16;
 1187|     17|                    bitCount+=16;
 1188|     17|            }   }
 1189|  1.37k|            while ((bitStream & 3) == 3) {
  ------------------
  |  Branch (1189:20): [True: 371, False: 1.00k]
  ------------------
 1190|    371|                n0+=3;
 1191|    371|                bitStream>>=2;
 1192|    371|                bitCount+=2;
 1193|    371|            }
 1194|  1.00k|            n0 += bitStream & 3;
 1195|  1.00k|            bitCount += 2;
 1196|  1.00k|            if (n0 > *maxSVPtr) return ERROR(maxSymbolValue_tooSmall);
  ------------------
  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1196:17): [True: 10, False: 997]
  ------------------
 1197|  3.14k|            while (charnum < n0) normalizedCounter[charnum++] = 0;
  ------------------
  |  Branch (1197:20): [True: 2.14k, False: 997]
  ------------------
 1198|    997|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1198:17): [True: 503, False: 494]
  |  Branch (1198:35): [True: 45, False: 449]
  ------------------
 1199|    548|                ip += bitCount>>3;
 1200|    548|                bitCount &= 7;
 1201|    548|                bitStream = MEM_readLE32(ip) >> bitCount;
 1202|    548|            }
 1203|    449|            else
 1204|    449|                bitStream >>= 2;
 1205|    997|        }
 1206|  7.83k|        {   short const max = (short)((2*threshold-1)-remaining);
 1207|  7.83k|            short count;
 1208|       |
 1209|  7.83k|            if ((bitStream & (threshold-1)) < (U32)max) {
  ------------------
  |  Branch (1209:17): [True: 5.54k, False: 2.29k]
  ------------------
 1210|  5.54k|                count = (short)(bitStream & (threshold-1));
 1211|  5.54k|                bitCount   += nbBits-1;
 1212|  5.54k|            } else {
 1213|  2.29k|                count = (short)(bitStream & (2*threshold-1));
 1214|  2.29k|                if (count >= threshold) count -= max;
  ------------------
  |  Branch (1214:21): [True: 856, False: 1.43k]
  ------------------
 1215|  2.29k|                bitCount   += nbBits;
 1216|  2.29k|            }
 1217|       |
 1218|  7.83k|            count--;   /* extra accuracy */
 1219|  7.83k|            remaining -= FSEv07_abs(count);
 1220|  7.83k|            normalizedCounter[charnum++] = count;
 1221|  7.83k|            previous0 = !count;
 1222|  12.0k|            while (remaining < threshold) {
  ------------------
  |  Branch (1222:20): [True: 4.17k, False: 7.83k]
  ------------------
 1223|  4.17k|                nbBits--;
 1224|  4.17k|                threshold >>= 1;
 1225|  4.17k|            }
 1226|       |
 1227|  7.83k|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1227:17): [True: 6.32k, False: 1.50k]
  |  Branch (1227:35): [True: 299, False: 1.20k]
  ------------------
 1228|  6.62k|                ip += bitCount>>3;
 1229|  6.62k|                bitCount &= 7;
 1230|  6.62k|            } else {
 1231|  1.20k|                bitCount -= (int)(8 * (iend - 4 - ip));
 1232|  1.20k|                ip = iend - 4;
 1233|  1.20k|            }
 1234|  7.83k|            bitStream = MEM_readLE32(ip) >> (bitCount & 31);
 1235|  7.83k|    }   }   /* while ((remaining>1) && (charnum<=*maxSVPtr)) */
 1236|    607|    if (remaining != 1) return ERROR(GENERIC);
  ------------------
  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1236:9): [True: 4, False: 603]
  ------------------
 1237|    603|    *maxSVPtr = charnum-1;
 1238|       |
 1239|    603|    ip += (bitCount+7)>>3;
 1240|    603|    if ((size_t)(ip-istart) > hbSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     12|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     12|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     12|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1240:9): [True: 12, False: 591]
  ------------------
 1241|    591|    return ip-istart;
 1242|    603|}
HUFv07_readStats:
 1254|    363|{
 1255|    363|    U32 weightTotal;
 1256|    363|    const BYTE* ip = (const BYTE*) src;
 1257|    363|    size_t iSize;
 1258|    363|    size_t oSize;
 1259|       |
 1260|    363|    if (!srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1260:9): [True: 1, False: 362]
  ------------------
 1261|    362|    iSize = ip[0];
 1262|       |    /* memset(huffWeight, 0, hwSize); */   /* is not necessary, even though some analyzer complain ... */
 1263|       |
 1264|    362|    if (iSize >= 128)  { /* special header */
  ------------------
  |  Branch (1264:9): [True: 199, False: 163]
  ------------------
 1265|    199|        if (iSize >= (242)) {  /* RLE */
  ------------------
  |  Branch (1265:13): [True: 30, False: 169]
  ------------------
 1266|     30|            static U32 l[14] = { 1, 2, 3, 4, 7, 8, 15, 16, 31, 32, 63, 64, 127, 128 };
 1267|     30|            oSize = l[iSize-242];
 1268|     30|            memset(huffWeight, 1, hwSize);
 1269|     30|            iSize = 0;
 1270|     30|        }
 1271|    169|        else {   /* Incompressible */
 1272|    169|            oSize = iSize - 127;
 1273|    169|            iSize = ((oSize+1)/2);
 1274|    169|            if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1274:17): [True: 1, False: 168]
  ------------------
 1275|    168|            if (oSize >= hwSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1275:17): [True: 0, False: 168]
  ------------------
 1276|    168|            ip += 1;
 1277|    168|            {   U32 n;
 1278|    615|                for (n=0; n<oSize; n+=2) {
  ------------------
  |  Branch (1278:27): [True: 447, False: 168]
  ------------------
 1279|    447|                    huffWeight[n]   = ip[n/2] >> 4;
 1280|    447|                    huffWeight[n+1] = ip[n/2] & 15;
 1281|    447|    }   }   }   }
 1282|    163|    else  {   /* header compressed with FSE (normal case) */
 1283|    163|        if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1283:13): [True: 1, False: 162]
  ------------------
 1284|    162|        oSize = FSEv07_decompress(huffWeight, hwSize-1, ip+1, iSize);   /* max (hwSize-1) values decoded, as last one is implied */
 1285|    162|        if (FSEv07_isError(oSize)) return oSize;
  ------------------
  |  Branch (1285:13): [True: 34, False: 128]
  ------------------
 1286|    162|    }
 1287|       |
 1288|       |    /* collect weight stats */
 1289|    326|    memset(rankStats, 0, (HUFv07_TABLELOG_ABSOLUTEMAX + 1) * sizeof(U32));
  ------------------
  |  |  996|    326|#define HUFv07_TABLELOG_ABSOLUTEMAX  16   /* absolute limit of HUFv07_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
 1290|    326|    weightTotal = 0;
 1291|  11.7k|    {   U32 n; for (n=0; n<oSize; n++) {
  ------------------
  |  Branch (1291:26): [True: 11.4k, False: 320]
  ------------------
 1292|  11.4k|            if (huffWeight[n] >= HUFv07_TABLELOG_ABSOLUTEMAX) return ERROR(corruption_detected);
  ------------------
  |  |  996|  11.4k|#define HUFv07_TABLELOG_ABSOLUTEMAX  16   /* absolute limit of HUFv07_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
                          if (huffWeight[n] >= HUFv07_TABLELOG_ABSOLUTEMAX) return ERROR(corruption_detected);
  ------------------
  |  |   49|      6|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      6|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      6|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1292:17): [True: 6, False: 11.4k]
  ------------------
 1293|  11.4k|            rankStats[huffWeight[n]]++;
 1294|  11.4k|            weightTotal += (1 << huffWeight[n]) >> 1;
 1295|  11.4k|    }   }
 1296|    320|    if (weightTotal == 0) return ERROR(corruption_detected);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1296:9): [True: 1, False: 319]
  ------------------
 1297|       |
 1298|       |    /* get last non-null symbol weight (implied, total must be 2^n) */
 1299|    319|    {   U32 const tableLog = BITv07_highbit32(weightTotal) + 1;
 1300|    319|        if (tableLog > HUFv07_TABLELOG_ABSOLUTEMAX) return ERROR(corruption_detected);
  ------------------
  |  |  996|    319|#define HUFv07_TABLELOG_ABSOLUTEMAX  16   /* absolute limit of HUFv07_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
                      if (tableLog > HUFv07_TABLELOG_ABSOLUTEMAX) return ERROR(corruption_detected);
  ------------------
  |  |   49|      5|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      5|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      5|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1300:13): [True: 5, False: 314]
  ------------------
 1301|    314|        *tableLogPtr = tableLog;
 1302|       |        /* determine last weight */
 1303|    314|        {   U32 const total = 1 << tableLog;
 1304|    314|            U32 const rest = total - weightTotal;
 1305|    314|            U32 const verif = 1 << BITv07_highbit32(rest);
 1306|    314|            U32 const lastWeight = BITv07_highbit32(rest) + 1;
 1307|    314|            if (verif != rest) return ERROR(corruption_detected);    /* last value must be a clean power of 2 */
  ------------------
  |  |   49|     44|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     44|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     44|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1307:17): [True: 44, False: 270]
  ------------------
 1308|    270|            huffWeight[oSize] = (BYTE)lastWeight;
 1309|    270|            rankStats[lastWeight]++;
 1310|    270|    }   }
 1311|       |
 1312|       |    /* check tree construction validity */
 1313|    270|    if ((rankStats[1] < 2) || (rankStats[1] & 1)) return ERROR(corruption_detected);   /* by construction : at least 2 elts of rank 1, must be even */
  ------------------
  |  |   49|      6|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      6|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      6|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1313:9): [True: 6, False: 264]
  |  Branch (1313:31): [True: 0, False: 264]
  ------------------
 1314|       |
 1315|       |    /* results */
 1316|    264|    *nbSymbolsPtr = (U32)(oSize+1);
 1317|    264|    return iSize+1;
 1318|    270|}
FSEv07_buildDTable:
 1424|  1.04k|{
 1425|  1.04k|    void* const tdPtr = dt+1;   /* because *dt is unsigned, 32-bits aligned on 32-bits */
 1426|  1.04k|    FSEv07_DECODE_TYPE* const tableDecode = (FSEv07_DECODE_TYPE*) (tdPtr);
  ------------------
  |  |  890|  1.04k|#define FSEv07_DECODE_TYPE FSEv07_decode_t
  ------------------
 1427|  1.04k|    U16 symbolNext[FSEv07_MAX_SYMBOL_VALUE+1];
 1428|       |
 1429|  1.04k|    U32 const maxSV1 = maxSymbolValue + 1;
 1430|  1.04k|    U32 const tableSize = 1 << tableLog;
 1431|  1.04k|    U32 highThreshold = tableSize-1;
 1432|       |
 1433|       |    /* Sanity Checks */
 1434|  1.04k|    if (maxSymbolValue > FSEv07_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  |  882|  1.04k|#define FSEv07_MAX_SYMBOL_VALUE 255
  ------------------
                  if (maxSymbolValue > FSEv07_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1434:9): [True: 0, False: 1.04k]
  ------------------
 1435|  1.04k|    if (tableLog > FSEv07_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  |  899|  1.04k|#define FSEv07_MAX_TABLELOG  (FSEv07_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  876|  1.04k|#define FSEv07_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
                  if (tableLog > FSEv07_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1435:9): [True: 1, False: 1.04k]
  ------------------
 1436|       |
 1437|       |    /* Init, lay down lowprob symbols */
 1438|  1.04k|    {   FSEv07_DTableHeader DTableH;
 1439|  1.04k|        DTableH.tableLog = (U16)tableLog;
 1440|  1.04k|        DTableH.fastMode = 1;
 1441|  1.04k|        {   S16 const largeLimit= (S16)(1 << (tableLog-1));
 1442|  1.04k|            U32 s;
 1443|  27.8k|            for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (1443:23): [True: 26.8k, False: 1.04k]
  ------------------
 1444|  26.8k|                if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (1444:21): [True: 5.67k, False: 21.1k]
  ------------------
 1445|  5.67k|                    tableDecode[highThreshold--].symbol = (FSEv07_FUNCTION_TYPE)s;
 1446|  5.67k|                    symbolNext[s] = 1;
 1447|  21.1k|                } else {
 1448|  21.1k|                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
  ------------------
  |  Branch (1448:25): [True: 305, False: 20.8k]
  ------------------
 1449|  21.1k|                    symbolNext[s] = normalizedCounter[s];
 1450|  21.1k|        }   }   }
 1451|  1.04k|        memcpy(dt, &DTableH, sizeof(DTableH));
 1452|  1.04k|    }
 1453|       |
 1454|       |    /* Spread symbols */
 1455|  1.04k|    {   U32 const tableMask = tableSize-1;
 1456|  1.04k|        U32 const step = FSEv07_TABLESTEP(tableSize);
  ------------------
  |  |  910|  1.04k|#define FSEv07_TABLESTEP(tableSize) ((tableSize>>1) + (tableSize>>3) + 3)
  ------------------
 1457|  1.04k|        U32 s, position = 0;
 1458|  27.8k|        for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (1458:19): [True: 26.8k, False: 1.04k]
  ------------------
 1459|  26.8k|            int i;
 1460|   237k|            for (i=0; i<normalizedCounter[s]; i++) {
  ------------------
  |  Branch (1460:23): [True: 210k, False: 26.8k]
  ------------------
 1461|   210k|                tableDecode[position].symbol = (FSEv07_FUNCTION_TYPE)s;
 1462|   210k|                position = (position + step) & tableMask;
 1463|   216k|                while (position > highThreshold) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  Branch (1463:24): [True: 5.64k, False: 210k]
  ------------------
 1464|   210k|        }   }
 1465|       |
 1466|  1.04k|        if (position!=0) return ERROR(GENERIC);   /* position must reach all cells once, otherwise normalizedCounter is incorrect */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1466:13): [True: 0, False: 1.04k]
  ------------------
 1467|  1.04k|    }
 1468|       |
 1469|       |    /* Build Decoding table */
 1470|  1.04k|    {   U32 u;
 1471|   217k|        for (u=0; u<tableSize; u++) {
  ------------------
  |  Branch (1471:19): [True: 216k, False: 1.04k]
  ------------------
 1472|   216k|            FSEv07_FUNCTION_TYPE const symbol = (FSEv07_FUNCTION_TYPE)(tableDecode[u].symbol);
  ------------------
  |  |  888|   216k|#define FSEv07_FUNCTION_TYPE BYTE
  ------------------
 1473|   216k|            U16 nextState = symbolNext[symbol]++;
 1474|   216k|            tableDecode[u].nbBits = (BYTE) (tableLog - BITv07_highbit32 ((U32)nextState) );
 1475|   216k|            tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
 1476|   216k|    }   }
 1477|       |
 1478|  1.04k|    return 0;
 1479|  1.04k|}
FSEv07_buildDTable_rle:
 1489|    185|{
 1490|    185|    void* ptr = dt;
 1491|    185|    FSEv07_DTableHeader* const DTableH = (FSEv07_DTableHeader*)ptr;
 1492|    185|    void* dPtr = dt + 1;
 1493|    185|    FSEv07_decode_t* const cell = (FSEv07_decode_t*)dPtr;
 1494|       |
 1495|    185|    DTableH->tableLog = 0;
 1496|    185|    DTableH->fastMode = 0;
 1497|       |
 1498|    185|    cell->newState = 0;
 1499|    185|    cell->symbol = symbolValue;
 1500|    185|    cell->nbBits = 0;
 1501|       |
 1502|    185|    return 0;
 1503|    185|}
FSEv07_decompress_usingDTable:
 1603|    143|{
 1604|    143|    const void* ptr = dt;
 1605|    143|    const FSEv07_DTableHeader* DTableH = (const FSEv07_DTableHeader*)ptr;
 1606|    143|    const U32 fastMode = DTableH->fastMode;
 1607|       |
 1608|       |    /* select fast mode (static) */
 1609|    143|    if (fastMode) return FSEv07_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 1);
  ------------------
  |  Branch (1609:9): [True: 57, False: 86]
  ------------------
 1610|     86|    return FSEv07_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 0);
 1611|    143|}
FSEv07_decompress:
 1615|    162|{
 1616|    162|    const BYTE* const istart = (const BYTE*)cSrc;
 1617|    162|    const BYTE* ip = istart;
 1618|    162|    short counting[FSEv07_MAX_SYMBOL_VALUE+1];
 1619|    162|    DTable_max_t dt;   /* Static analyzer seems unable to understand this table will be properly initialized later */
 1620|    162|    unsigned tableLog;
 1621|    162|    unsigned maxSymbolValue = FSEv07_MAX_SYMBOL_VALUE;
  ------------------
  |  |  882|    162|#define FSEv07_MAX_SYMBOL_VALUE 255
  ------------------
 1622|       |
 1623|    162|    if (cSrcSize<2) return ERROR(srcSize_wrong);   /* too small input size */
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1623:9): [True: 1, False: 161]
  ------------------
 1624|       |
 1625|       |    /* normal FSE decoding mode */
 1626|    161|    {   size_t const NCountLength = FSEv07_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize);
 1627|    161|        if (FSEv07_isError(NCountLength)) return NCountLength;
  ------------------
  |  | 1378|    161|#define FSEv07_isError ERR_isError
  ------------------
  |  Branch (1627:13): [True: 16, False: 145]
  ------------------
 1628|    145|        if (NCountLength >= cSrcSize) return ERROR(srcSize_wrong);   /* too small input size */
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1628:13): [True: 1, False: 144]
  ------------------
 1629|    144|        ip += NCountLength;
 1630|    144|        cSrcSize -= NCountLength;
 1631|    144|    }
 1632|       |
 1633|      0|    { size_t const errorCode = FSEv07_buildDTable (dt, counting, maxSymbolValue, tableLog);
 1634|    144|      if (FSEv07_isError(errorCode)) return errorCode; }
  ------------------
  |  | 1378|    144|#define FSEv07_isError ERR_isError
  ------------------
  |  Branch (1634:11): [True: 1, False: 143]
  ------------------
 1635|       |
 1636|    143|    return FSEv07_decompress_usingDTable (dst, maxDstSize, ip, cSrcSize, dt);   /* always return, even if it is an error code */
 1637|    144|}
HUFv07_readDTableX2:
 1722|    363|{
 1723|    363|    BYTE huffWeight[HUFv07_SYMBOLVALUE_MAX + 1];
 1724|    363|    U32 rankVal[HUFv07_TABLELOG_ABSOLUTEMAX + 1];   /* large enough for values from 0 to 16 */
 1725|    363|    U32 tableLog = 0;
 1726|    363|    U32 nbSymbols = 0;
 1727|    363|    size_t iSize;
 1728|    363|    void* const dtPtr = DTable + 1;
 1729|    363|    HUFv07_DEltX2* const dt = (HUFv07_DEltX2*)dtPtr;
 1730|       |
 1731|    363|    HUFv07_STATIC_ASSERT(sizeof(DTableDesc) == sizeof(HUFv07_DTable));
  ------------------
  |  | 1698|    363|#define HUFv07_STATIC_ASSERT(c) { enum { HUFv07_static_assert = 1/(int)(!!(c)) }; }   /* use only *after* variable declarations */
  ------------------
 1732|       |    /* memset(huffWeight, 0, sizeof(huffWeight)); */   /* is not necessary, even though some analyzer complain ... */
 1733|       |
 1734|    363|    iSize = HUFv07_readStats(huffWeight, HUFv07_SYMBOLVALUE_MAX + 1, rankVal, &nbSymbols, &tableLog, src, srcSize);
  ------------------
  |  |  999|    363|#define HUFv07_SYMBOLVALUE_MAX 255
  ------------------
 1735|    363|    if (HUFv07_isError(iSize)) return iSize;
  ------------------
  |  Branch (1735:9): [True: 99, False: 264]
  ------------------
 1736|       |
 1737|       |    /* Table header */
 1738|    264|    {   DTableDesc dtd = HUFv07_getDTableDesc(DTable);
 1739|    264|        if (tableLog > (U32)(dtd.maxTableLog+1)) return ERROR(tableLog_tooLarge);   /* DTable too small, huffman tree cannot fit in */
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1739:13): [True: 1, False: 263]
  ------------------
 1740|    263|        dtd.tableType = 0;
 1741|    263|        dtd.tableLog = (BYTE)tableLog;
 1742|    263|        memcpy(DTable, &dtd, sizeof(dtd));
 1743|    263|    }
 1744|       |
 1745|       |    /* Prepare ranks */
 1746|      0|    {   U32 n, nextRankStart = 0;
 1747|  1.24k|        for (n=1; n<tableLog+1; n++) {
  ------------------
  |  Branch (1747:19): [True: 980, False: 263]
  ------------------
 1748|    980|            U32 current = nextRankStart;
 1749|    980|            nextRankStart += (rankVal[n] << (n-1));
 1750|    980|            rankVal[n] = current;
 1751|    980|    }   }
 1752|       |
 1753|       |    /* fill DTable */
 1754|    263|    {   U32 n;
 1755|  9.66k|        for (n=0; n<nbSymbols; n++) {
  ------------------
  |  Branch (1755:19): [True: 9.39k, False: 263]
  ------------------
 1756|  9.39k|            U32 const w = huffWeight[n];
 1757|  9.39k|            U32 const length = (1 << w) >> 1;
 1758|  9.39k|            U32 i;
 1759|  9.39k|            HUFv07_DEltX2 D;
 1760|  9.39k|            D.byte = (BYTE)n; D.nbBits = (BYTE)(tableLog + 1 - w);
 1761|  37.7k|            for (i = rankVal[w]; i < rankVal[w] + length; i++)
  ------------------
  |  Branch (1761:34): [True: 28.3k, False: 9.39k]
  ------------------
 1762|  28.3k|                dt[i] = D;
 1763|  9.39k|            rankVal[w] += length;
 1764|  9.39k|    }   }
 1765|       |
 1766|    263|    return iSize;
 1767|    264|}
HUFv07_decompress1X2_DCtx:
 1847|    127|{
 1848|    127|    const BYTE* ip = (const BYTE*) cSrc;
 1849|       |
 1850|    127|    size_t const hSize = HUFv07_readDTableX2 (DCtx, cSrc, cSrcSize);
 1851|    127|    if (HUFv07_isError(hSize)) return hSize;
  ------------------
  |  Branch (1851:9): [True: 49, False: 78]
  ------------------
 1852|     78|    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1852:9): [True: 1, False: 77]
  ------------------
 1853|     77|    ip += hSize; cSrcSize -= hSize;
 1854|       |
 1855|     77|    return HUFv07_decompress1X2_usingDTable_internal (dst, dstSize, ip, cSrcSize, DCtx);
 1856|     78|}
HUFv07_decompress4X2_DCtx:
 1970|    236|{
 1971|    236|    const BYTE* ip = (const BYTE*) cSrc;
 1972|       |
 1973|    236|    size_t const hSize = HUFv07_readDTableX2 (dctx, cSrc, cSrcSize);
 1974|    236|    if (HUFv07_isError(hSize)) return hSize;
  ------------------
  |  Branch (1974:9): [True: 51, False: 185]
  ------------------
 1975|    185|    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1975:9): [True: 1, False: 184]
  ------------------
 1976|    184|    ip += hSize; cSrcSize -= hSize;
 1977|       |
 1978|    184|    return HUFv07_decompress4X2_usingDTable_internal (dst, dstSize, ip, cSrcSize, dctx);
 1979|    185|}
HUFv07_selectDecoder:
 2450|    236|{
 2451|       |    /* decoder timing evaluation */
 2452|    236|    U32 const Q = (U32)(cSrcSize * 16 / dstSize);   /* Q < 16 since dstSize > cSrcSize */
 2453|    236|    U32 const D256 = (U32)(dstSize >> 8);
 2454|    236|    U32 const DTime0 = algoTime[Q][0].tableTime + (algoTime[Q][0].decode256Time * D256);
 2455|    236|    U32 DTime1 = algoTime[Q][1].tableTime + (algoTime[Q][1].decode256Time * D256);
 2456|    236|    DTime1 += DTime1 >> 3;  /* advantage to algorithm using less memory, for cache eviction */
 2457|       |
 2458|    236|    return DTime1 < DTime0;
 2459|    236|}
HUFv07_decompress4X_hufOnly:
 2497|    240|{
 2498|       |    /* validation checks */
 2499|    240|    if (dstSize == 0) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2499:9): [True: 2, False: 238]
  ------------------
 2500|    238|    if ((cSrcSize >= dstSize) || (cSrcSize <= 1)) return ERROR(corruption_detected);   /* invalid */
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2500:9): [True: 1, False: 237]
  |  Branch (2500:34): [True: 1, False: 236]
  ------------------
 2501|       |
 2502|    236|    {   U32 const algoNb = HUFv07_selectDecoder(dstSize, cSrcSize);
 2503|    236|        return algoNb ? HUFv07_decompress4X4_DCtx(dctx, dst, dstSize, cSrc, cSrcSize) :
  ------------------
  |  Branch (2503:16): [True: 0, False: 236]
  ------------------
 2504|    236|                        HUFv07_decompress4X2_DCtx(dctx, dst, dstSize, cSrc, cSrcSize) ;
 2505|    238|    }
 2506|    238|}
ZSTDv07_decompressBegin:
 2908|  2.03k|{
 2909|  2.03k|    dctx->expected = ZSTDv07_frameHeaderSize_min;
 2910|  2.03k|    dctx->stage = ZSTDds_getFrameHeaderSize;
 2911|  2.03k|    dctx->previousDstEnd = NULL;
 2912|  2.03k|    dctx->base = NULL;
 2913|  2.03k|    dctx->vBase = NULL;
 2914|  2.03k|    dctx->dictEnd = NULL;
 2915|  2.03k|    dctx->hufTable[0] = (HUFv07_DTable)((ZSTD_HUFFDTABLE_CAPACITY_LOG)*0x1000001);
  ------------------
  |  | 2665|  2.03k|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
 2916|  2.03k|    dctx->litEntropy = dctx->fseEntropy = 0;
 2917|  2.03k|    dctx->dictID = 0;
 2918|  8.12k|    { int i; for (i=0; i<ZSTDv07_REP_NUM; i++) dctx->rep[i] = repStartValue[i]; }
  ------------------
  |  | 2638|  8.12k|#define ZSTDv07_REP_NUM    3
  ------------------
  |  Branch (2918:24): [True: 6.09k, False: 2.03k]
  ------------------
 2919|  2.03k|    return 0;
 2920|  2.03k|}
ZSTDv07_createDCtx_advanced:
 2923|  1.01k|{
 2924|  1.01k|    ZSTDv07_DCtx* dctx;
 2925|       |
 2926|  1.01k|    if (!customMem.customAlloc && !customMem.customFree)
  ------------------
  |  Branch (2926:9): [True: 0, False: 1.01k]
  |  Branch (2926:35): [True: 0, False: 0]
  ------------------
 2927|      0|        customMem = defaultCustomMem;
 2928|       |
 2929|  1.01k|    if (!customMem.customAlloc || !customMem.customFree)
  ------------------
  |  Branch (2929:9): [True: 0, False: 1.01k]
  |  Branch (2929:35): [True: 0, False: 1.01k]
  ------------------
 2930|      0|        return NULL;
 2931|       |
 2932|  1.01k|    dctx = (ZSTDv07_DCtx*) customMem.customAlloc(customMem.opaque, sizeof(ZSTDv07_DCtx));
 2933|  1.01k|    if (!dctx) return NULL;
  ------------------
  |  Branch (2933:9): [True: 0, False: 1.01k]
  ------------------
 2934|  1.01k|    memcpy(&dctx->customMem, &customMem, sizeof(ZSTDv07_customMem));
 2935|  1.01k|    ZSTDv07_decompressBegin(dctx);
 2936|  1.01k|    return dctx;
 2937|  1.01k|}
ZSTDv07_createDCtx:
 2940|  1.01k|{
 2941|  1.01k|    return ZSTDv07_createDCtx_advanced(defaultCustomMem);
 2942|  1.01k|}
ZSTDv07_freeDCtx:
 2945|  1.01k|{
 2946|  1.01k|    if (dctx==NULL) return 0;   /* support free on NULL */
  ------------------
  |  Branch (2946:9): [True: 0, False: 1.01k]
  ------------------
 2947|  1.01k|    dctx->customMem.customFree(dctx->customMem.opaque, dctx);
 2948|  1.01k|    return 0;   /* reserved as a potential error code in the future */
 2949|  1.01k|}
ZSTDv07_getFrameParams:
 3096|  1.15k|{
 3097|  1.15k|    const BYTE* ip = (const BYTE*)src;
 3098|       |
 3099|  1.15k|    if (srcSize < ZSTDv07_frameHeaderSize_min) return ZSTDv07_frameHeaderSize_min;
  ------------------
  |  Branch (3099:9): [True: 0, False: 1.15k]
  ------------------
 3100|  1.15k|    memset(fparamsPtr, 0, sizeof(*fparamsPtr));
 3101|  1.15k|    if (MEM_readLE32(src) != ZSTDv07_MAGICNUMBER) {
  ------------------
  |  |  180|  1.15k|#define ZSTDv07_MAGICNUMBER            0xFD2FB527   /* v0.7 */
  ------------------
  |  Branch (3101:9): [True: 0, False: 1.15k]
  ------------------
 3102|      0|        if ((MEM_readLE32(src) & 0xFFFFFFF0U) == ZSTDv07_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |   41|      0|#define ZSTDv07_MAGIC_SKIPPABLE_START  0x184D2A50U
  ------------------
  |  Branch (3102:13): [True: 0, False: 0]
  ------------------
 3103|      0|            if (srcSize < ZSTDv07_skippableHeaderSize) return ZSTDv07_skippableHeaderSize; /* magic number + skippable frame length */
  ------------------
  |  Branch (3103:17): [True: 0, False: 0]
  ------------------
 3104|      0|            fparamsPtr->frameContentSize = MEM_readLE32((const char *)src + 4);
 3105|      0|            fparamsPtr->windowSize = 0; /* windowSize==0 means a frame is skippable */
 3106|      0|            return 0;
 3107|      0|        }
 3108|      0|        return ERROR(prefix_unknown);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3109|      0|    }
 3110|       |
 3111|       |    /* ensure there is enough `srcSize` to fully read/decode frame header */
 3112|  1.15k|    { size_t const fhsize = ZSTDv07_frameHeaderSize(src, srcSize);
 3113|  1.15k|      if (srcSize < fhsize) return fhsize; }
  ------------------
  |  Branch (3113:11): [True: 0, False: 1.15k]
  ------------------
 3114|       |
 3115|  1.15k|    {   BYTE const fhdByte = ip[4];
 3116|  1.15k|        size_t pos = 5;
 3117|  1.15k|        U32 const dictIDSizeCode = fhdByte&3;
 3118|  1.15k|        U32 const checksumFlag = (fhdByte>>2)&1;
 3119|  1.15k|        U32 const directMode = (fhdByte>>5)&1;
 3120|  1.15k|        U32 const fcsID = fhdByte>>6;
 3121|  1.15k|        U32 const windowSizeMax = 1U << ZSTDv07_WINDOWLOG_MAX;
  ------------------
  |  |   45|  1.15k|#define ZSTDv07_WINDOWLOG_MAX    ((U32)(MEM_32bits() ? ZSTDv07_WINDOWLOG_MAX_32 : ZSTDv07_WINDOWLOG_MAX_64))
  |  |  ------------------
  |  |  |  |   43|      0|#define ZSTDv07_WINDOWLOG_MAX_32  25
  |  |  ------------------
  |  |               #define ZSTDv07_WINDOWLOG_MAX    ((U32)(MEM_32bits() ? ZSTDv07_WINDOWLOG_MAX_32 : ZSTDv07_WINDOWLOG_MAX_64))
  |  |  ------------------
  |  |  |  |   44|  1.15k|#define ZSTDv07_WINDOWLOG_MAX_64  27
  |  |  ------------------
  |  |  |  Branch (45:41): [True: 0, False: 1.15k]
  |  |  ------------------
  ------------------
 3122|  1.15k|        U32 windowSize = 0;
 3123|  1.15k|        U32 dictID = 0;
 3124|  1.15k|        U64 frameContentSize = 0;
 3125|  1.15k|        if ((fhdByte & 0x08) != 0)   /* reserved bits, which must be zero */
  ------------------
  |  Branch (3125:13): [True: 3, False: 1.14k]
  ------------------
 3126|      3|            return ERROR(frameParameter_unsupported);
  ------------------
  |  |   49|      3|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      3|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      3|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3127|  1.14k|        if (!directMode) {
  ------------------
  |  Branch (3127:13): [True: 1.08k, False: 64]
  ------------------
 3128|  1.08k|            BYTE const wlByte = ip[pos++];
 3129|  1.08k|            U32 const windowLog = (wlByte >> 3) + ZSTDv07_WINDOWLOG_ABSOLUTEMIN;
  ------------------
  |  | 2654|  1.08k|#define ZSTDv07_WINDOWLOG_ABSOLUTEMIN 10
  ------------------
 3130|  1.08k|            if (windowLog > ZSTDv07_WINDOWLOG_MAX)
  ------------------
  |  |   45|  1.08k|#define ZSTDv07_WINDOWLOG_MAX    ((U32)(MEM_32bits() ? ZSTDv07_WINDOWLOG_MAX_32 : ZSTDv07_WINDOWLOG_MAX_64))
  |  |  ------------------
  |  |  |  |   43|      0|#define ZSTDv07_WINDOWLOG_MAX_32  25
  |  |  ------------------
  |  |               #define ZSTDv07_WINDOWLOG_MAX    ((U32)(MEM_32bits() ? ZSTDv07_WINDOWLOG_MAX_32 : ZSTDv07_WINDOWLOG_MAX_64))
  |  |  ------------------
  |  |  |  |   44|  1.08k|#define ZSTDv07_WINDOWLOG_MAX_64  27
  |  |  ------------------
  |  |  |  Branch (45:41): [True: 0, False: 1.08k]
  |  |  ------------------
  ------------------
  |  Branch (3130:17): [True: 4, False: 1.08k]
  ------------------
 3131|      4|                return ERROR(frameParameter_unsupported);
  ------------------
  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3132|  1.08k|            windowSize = (1U << windowLog);
 3133|  1.08k|            windowSize += (windowSize >> 3) * (wlByte&7);
 3134|  1.08k|        }
 3135|       |
 3136|  1.14k|        switch(dictIDSizeCode)
 3137|  1.14k|        {
 3138|      0|            default:   /* impossible */
  ------------------
  |  Branch (3138:13): [True: 0, False: 1.14k]
  ------------------
 3139|     70|            case 0 : break;
  ------------------
  |  Branch (3139:13): [True: 70, False: 1.07k]
  ------------------
 3140|  1.02k|            case 1 : dictID = ip[pos]; pos++; break;
  ------------------
  |  Branch (3140:13): [True: 1.02k, False: 119]
  ------------------
 3141|     16|            case 2 : dictID = MEM_readLE16(ip+pos); pos+=2; break;
  ------------------
  |  Branch (3141:13): [True: 16, False: 1.12k]
  ------------------
 3142|     33|            case 3 : dictID = MEM_readLE32(ip+pos); pos+=4; break;
  ------------------
  |  Branch (3142:13): [True: 33, False: 1.11k]
  ------------------
 3143|  1.14k|        }
 3144|  1.14k|        switch(fcsID)
 3145|  1.14k|        {
 3146|      0|            default:   /* impossible */
  ------------------
  |  Branch (3146:13): [True: 0, False: 1.14k]
  ------------------
 3147|    900|            case 0 : if (directMode) frameContentSize = ip[pos]; break;
  ------------------
  |  Branch (3147:13): [True: 900, False: 244]
  |  Branch (3147:26): [True: 8, False: 892]
  ------------------
 3148|     21|            case 1 : frameContentSize = MEM_readLE16(ip+pos)+256; break;
  ------------------
  |  Branch (3148:13): [True: 21, False: 1.12k]
  ------------------
 3149|    140|            case 2 : frameContentSize = MEM_readLE32(ip+pos); break;
  ------------------
  |  Branch (3149:13): [True: 140, False: 1.00k]
  ------------------
 3150|     83|            case 3 : frameContentSize = MEM_readLE64(ip+pos); break;
  ------------------
  |  Branch (3150:13): [True: 83, False: 1.06k]
  ------------------
 3151|  1.14k|        }
 3152|  1.14k|        if (!windowSize) windowSize = (U32)frameContentSize;
  ------------------
  |  Branch (3152:13): [True: 64, False: 1.08k]
  ------------------
 3153|  1.14k|        if (windowSize > windowSizeMax)
  ------------------
  |  Branch (3153:13): [True: 21, False: 1.12k]
  ------------------
 3154|     21|            return ERROR(frameParameter_unsupported);
  ------------------
  |  |   49|     21|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     21|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     21|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3155|  1.12k|        fparamsPtr->frameContentSize = frameContentSize;
 3156|  1.12k|        fparamsPtr->windowSize = windowSize;
 3157|  1.12k|        fparamsPtr->dictID = dictID;
 3158|  1.12k|        fparamsPtr->checksumFlag = checksumFlag;
 3159|  1.12k|    }
 3160|      0|    return 0;
 3161|  1.14k|}
ZSTDv07_decompress_usingDict:
 3824|  1.01k|{
 3825|  1.01k|    ZSTDv07_decompressBegin_usingDict(dctx, dict, dictSize);
 3826|  1.01k|    ZSTDv07_checkContinuity(dctx, dst);
 3827|  1.01k|    return ZSTDv07_decompressFrame(dctx, dst, dstCapacity, src, srcSize);
 3828|  1.01k|}
ZSTDv07_findFrameSizeInfoLegacy:
 3861|  1.03k|{
 3862|  1.03k|    const BYTE* ip = (const BYTE*)src;
 3863|  1.03k|    size_t remainingSize = srcSize;
 3864|  1.03k|    size_t nbBlocks = 0;
 3865|       |
 3866|       |    /* check */
 3867|  1.03k|    if (srcSize < ZSTDv07_frameHeaderSize_min+ZSTDv07_blockHeaderSize) {
  ------------------
  |  Branch (3867:9): [True: 1, False: 1.03k]
  ------------------
 3868|      1|        ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(srcSize_wrong));
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3869|      1|        return;
 3870|      1|    }
 3871|       |
 3872|       |    /* Frame Header */
 3873|  1.03k|    {   size_t const frameHeaderSize = ZSTDv07_frameHeaderSize(src, srcSize);
 3874|  1.03k|        if (ZSTDv07_isError(frameHeaderSize)) {
  ------------------
  |  | 2856|  1.03k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3874:13): [True: 0, False: 1.03k]
  ------------------
 3875|      0|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, frameHeaderSize);
 3876|      0|            return;
 3877|      0|        }
 3878|  1.03k|        if (MEM_readLE32(src) != ZSTDv07_MAGICNUMBER) {
  ------------------
  |  |  180|  1.03k|#define ZSTDv07_MAGICNUMBER            0xFD2FB527   /* v0.7 */
  ------------------
  |  Branch (3878:13): [True: 0, False: 1.03k]
  ------------------
 3879|      0|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(prefix_unknown));
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3880|      0|            return;
 3881|      0|        }
 3882|  1.03k|        if (srcSize < frameHeaderSize+ZSTDv07_blockHeaderSize) {
  ------------------
  |  Branch (3882:13): [True: 1, False: 1.03k]
  ------------------
 3883|      1|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(srcSize_wrong));
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3884|      1|            return;
 3885|      1|        }
 3886|  1.03k|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3887|  1.03k|    }
 3888|       |
 3889|       |    /* Loop on each block */
 3890|  3.05k|    while (1) {
  ------------------
  |  Branch (3890:12): [True: 3.05k, Folded]
  ------------------
 3891|  3.05k|        blockProperties_t blockProperties;
 3892|  3.05k|        size_t const cBlockSize = ZSTDv07_getcBlockSize(ip, remainingSize, &blockProperties);
 3893|  3.05k|        if (ZSTDv07_isError(cBlockSize)) {
  ------------------
  |  | 2856|  3.05k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3893:13): [True: 2, False: 3.05k]
  ------------------
 3894|      2|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, cBlockSize);
 3895|      2|            return;
 3896|      2|        }
 3897|       |
 3898|  3.05k|        ip += ZSTDv07_blockHeaderSize;
 3899|  3.05k|        remainingSize -= ZSTDv07_blockHeaderSize;
 3900|       |
 3901|  3.05k|        if (blockProperties.blockType == bt_end) break;
  ------------------
  |  Branch (3901:13): [True: 1.01k, False: 2.04k]
  ------------------
 3902|       |
 3903|  2.04k|        if (cBlockSize > remainingSize) {
  ------------------
  |  Branch (3903:13): [True: 13, False: 2.02k]
  ------------------
 3904|     13|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(srcSize_wrong));
  ------------------
  |  |   49|     13|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     13|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     13|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3905|     13|            return;
 3906|     13|        }
 3907|       |
 3908|  2.02k|        ip += cBlockSize;
 3909|  2.02k|        remainingSize -= cBlockSize;
 3910|  2.02k|        nbBlocks++;
 3911|  2.02k|    }
 3912|       |
 3913|  1.01k|    *cSize = ip - (const BYTE*)src;
 3914|  1.01k|    *dBound = nbBlocks * ZSTDv07_BLOCKSIZE_ABSOLUTEMAX;
  ------------------
  |  |  175|  1.01k|#define ZSTDv07_BLOCKSIZE_ABSOLUTEMAX (128 * 1024)   /* define, for static allocation */
  ------------------
 3915|  1.01k|}
ZSTDv07_decompressBegin_usingDict:
 4115|  1.01k|{
 4116|  1.01k|    { size_t const errorCode = ZSTDv07_decompressBegin(dctx);
 4117|  1.01k|      if (ZSTDv07_isError(errorCode)) return errorCode; }
  ------------------
  |  | 2856|  1.01k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (4117:11): [True: 0, False: 1.01k]
  ------------------
 4118|       |
 4119|  1.01k|    if (dict && dictSize) {
  ------------------
  |  Branch (4119:9): [True: 1.01k, False: 0]
  |  Branch (4119:17): [True: 42, False: 973]
  ------------------
 4120|     42|        size_t const errorCode = ZSTDv07_decompress_insertDictionary(dctx, dict, dictSize);
 4121|     42|        if (ZSTDv07_isError(errorCode)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2856|     42|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
                      if (ZSTDv07_isError(errorCode)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4121:13): [True: 0, False: 42]
  ------------------
 4122|     42|    }
 4123|       |
 4124|  1.01k|    return 0;
 4125|  1.01k|}
zstd_v07.c:MEM_readLE32:
  350|  11.4k|{
  351|  11.4k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (351:9): [True: 11.4k, False: 0]
  ------------------
  352|  11.4k|        return MEM_read32(memPtr);
  353|      0|    else
  354|      0|        return MEM_swap32(MEM_read32(memPtr));
  355|  11.4k|}
zstd_v07.c:MEM_isLittleEndian:
  268|  93.0k|{
  269|  93.0k|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  270|  93.0k|    return one.c[0];
  271|  93.0k|}
zstd_v07.c:MEM_read32:
  279|  11.4k|{
  280|  11.4k|    U32 val; memcpy(&val, memPtr, sizeof(val)); return val;
  281|  11.4k|}
zstd_v07.c:FSEv07_abs:
 1150|  7.83k|static short FSEv07_abs(short a) { return (short)(a<0 ? -a : a); }
  ------------------
  |  Branch (1150:51): [True: 3.74k, False: 4.08k]
  ------------------
zstd_v07.c:BITv07_highbit32:
  473|   217k|{
  474|       |#   if defined(_MSC_VER)   /* Visual */
  475|       |    unsigned long r;
  476|       |    return _BitScanReverse(&r, val) ? (unsigned)r : 0;
  477|       |#   elif defined(__GNUC__) && (__GNUC__ >= 3)   /* Use GCC Intrinsic */
  478|       |    return __builtin_clz (val) ^ 31;
  479|       |#   else   /* Software version */
  480|       |    static const unsigned DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 };
  481|       |    U32 v = val;
  482|       |    v |= v >> 1;
  483|       |    v |= v >> 2;
  484|       |    v |= v >> 4;
  485|       |    v |= v >> 8;
  486|       |    v |= v >> 16;
  487|       |    return DeBruijnClz[ (U32) (v * 0x07C4ACDDU) >> 27];
  488|       |#   endif
  489|   217k|}
zstd_v07.c:FSEv07_decompress_usingDTable_generic:
 1536|    143|{
 1537|    143|    BYTE* const ostart = (BYTE*) dst;
 1538|    143|    BYTE* op = ostart;
 1539|    143|    BYTE* const omax = op + maxDstSize;
 1540|    143|    BYTE* const olimit = omax-3;
 1541|       |
 1542|    143|    BITv07_DStream_t bitD;
 1543|    143|    FSEv07_DState_t state1;
 1544|    143|    FSEv07_DState_t state2;
 1545|       |
 1546|       |    /* Init */
 1547|    143|    { size_t const errorCode = BITv07_initDStream(&bitD, cSrc, cSrcSize);   /* replaced last arg by maxCompressed Size */
 1548|    143|      if (FSEv07_isError(errorCode)) return errorCode; }
  ------------------
  |  | 1378|    143|#define FSEv07_isError ERR_isError
  ------------------
  |  Branch (1548:11): [True: 5, False: 138]
  ------------------
 1549|       |
 1550|    138|    FSEv07_initDState(&state1, &bitD, dt);
 1551|    138|    FSEv07_initDState(&state2, &bitD, dt);
 1552|       |
 1553|    138|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
 1554|       |
 1555|       |    /* 4 symbols per loop */
 1556|  1.52k|    for ( ; (BITv07_reloadDStream(&bitD)==BITv07_DStream_unfinished) && (op<olimit) ; op+=4) {
  ------------------
  |  Branch (1556:13): [True: 1.39k, False: 133]
  |  Branch (1556:73): [True: 1.38k, False: 5]
  ------------------
 1557|  1.38k|        op[0] = FSEv07_GETSYMBOL(&state1);
  ------------------
  |  | 1553|  1.38k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 334, False: 1.05k]
  |  |  ------------------
  ------------------
 1558|       |
 1559|  1.38k|        if (FSEv07_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  |  899|  1.38k|#define FSEv07_MAX_TABLELOG  (FSEv07_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  876|  1.38k|#define FSEv07_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1559:13): [Folded, False: 1.38k]
  ------------------
 1560|      0|            BITv07_reloadDStream(&bitD);
 1561|       |
 1562|  1.38k|        op[1] = FSEv07_GETSYMBOL(&state2);
  ------------------
  |  | 1553|  1.38k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 334, False: 1.05k]
  |  |  ------------------
  ------------------
 1563|       |
 1564|  1.38k|        if (FSEv07_MAX_TABLELOG*4+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  |  899|  1.38k|#define FSEv07_MAX_TABLELOG  (FSEv07_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  876|  1.38k|#define FSEv07_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1564:13): [Folded, False: 1.38k]
  ------------------
 1565|      0|            { if (BITv07_reloadDStream(&bitD) > BITv07_DStream_unfinished) { op+=2; break; } }
  ------------------
  |  Branch (1565:19): [True: 0, False: 0]
  ------------------
 1566|       |
 1567|  1.38k|        op[2] = FSEv07_GETSYMBOL(&state1);
  ------------------
  |  | 1553|  1.38k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 334, False: 1.05k]
  |  |  ------------------
  ------------------
 1568|       |
 1569|  1.38k|        if (FSEv07_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  |  899|  1.38k|#define FSEv07_MAX_TABLELOG  (FSEv07_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  876|  1.38k|#define FSEv07_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1569:13): [Folded, False: 1.38k]
  ------------------
 1570|      0|            BITv07_reloadDStream(&bitD);
 1571|       |
 1572|  1.38k|        op[3] = FSEv07_GETSYMBOL(&state2);
  ------------------
  |  | 1553|  1.38k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 334, False: 1.05k]
  |  |  ------------------
  ------------------
 1573|  1.38k|    }
 1574|       |
 1575|       |    /* tail */
 1576|       |    /* note : BITv07_reloadDStream(&bitD) >= FSEv07_DStream_partiallyFilled; Ends at exactly BITv07_DStream_completed */
 1577|  2.58k|    while (1) {
  ------------------
  |  Branch (1577:12): [True: 2.58k, Folded]
  ------------------
 1578|  2.58k|        if (op>(omax-2)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1578:13): [True: 10, False: 2.57k]
  ------------------
 1579|       |
 1580|  2.57k|        *op++ = FSEv07_GETSYMBOL(&state1);
  ------------------
  |  | 1553|  2.57k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 550, False: 2.02k]
  |  |  ------------------
  ------------------
 1581|       |
 1582|  2.57k|        if (BITv07_reloadDStream(&bitD)==BITv07_DStream_overflow) {
  ------------------
  |  Branch (1582:13): [True: 84, False: 2.49k]
  ------------------
 1583|     84|            *op++ = FSEv07_GETSYMBOL(&state2);
  ------------------
  |  | 1553|     84|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 37, False: 47]
  |  |  ------------------
  ------------------
 1584|     84|            break;
 1585|     84|        }
 1586|       |
 1587|  2.49k|        if (op>(omax-2)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1587:13): [True: 0, False: 2.49k]
  ------------------
 1588|       |
 1589|  2.49k|        *op++ = FSEv07_GETSYMBOL(&state2);
  ------------------
  |  | 1553|  2.49k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 513, False: 1.97k]
  |  |  ------------------
  ------------------
 1590|       |
 1591|  2.49k|        if (BITv07_reloadDStream(&bitD)==BITv07_DStream_overflow) {
  ------------------
  |  Branch (1591:13): [True: 44, False: 2.44k]
  ------------------
 1592|     44|            *op++ = FSEv07_GETSYMBOL(&state1);
  ------------------
  |  | 1553|     44|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 17, False: 27]
  |  |  ------------------
  ------------------
 1593|     44|            break;
 1594|     44|    }   }
 1595|       |
 1596|    128|    return op-ostart;
 1597|    138|}
zstd_v07.c:BITv07_initDStream:
  503|  1.00k|{
  504|  1.00k|    if (srcSize < 1) { memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   49|     30|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     30|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     30|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (504:9): [True: 30, False: 979]
  ------------------
  505|       |
  506|    979|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (506:9): [True: 650, False: 329]
  ------------------
  507|    650|        bitD->start = (const char*)srcBuffer;
  508|    650|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  509|    650|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  510|    650|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  511|    650|          bitD->bitsConsumed = lastByte ? 8 - BITv07_highbit32(lastByte) : 0;
  ------------------
  |  Branch (511:32): [True: 550, False: 100]
  ------------------
  512|    650|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|    100|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    100|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    100|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (512:15): [True: 100, False: 550]
  ------------------
  513|    650|    } else {
  514|    329|        bitD->start = (const char*)srcBuffer;
  515|    329|        bitD->ptr   = bitD->start;
  516|    329|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  517|    329|        switch(srcSize)
  518|    329|        {
  519|     26|            case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);/* fall-through */
  ------------------
  |  Branch (519:13): [True: 26, False: 303]
  ------------------
  520|    121|            case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);/* fall-through */
  ------------------
  |  Branch (520:13): [True: 95, False: 234]
  ------------------
  521|    141|            case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);/* fall-through */
  ------------------
  |  Branch (521:13): [True: 20, False: 309]
  ------------------
  522|    168|            case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24; /* fall-through */
  ------------------
  |  Branch (522:13): [True: 27, False: 302]
  ------------------
  523|    194|            case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16; /* fall-through */
  ------------------
  |  Branch (523:13): [True: 26, False: 303]
  ------------------
  524|    287|            case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) <<  8; /* fall-through */
  ------------------
  |  Branch (524:13): [True: 93, False: 236]
  ------------------
  525|    329|            default: break;
  ------------------
  |  Branch (525:13): [True: 42, False: 287]
  ------------------
  526|    329|        }
  527|    329|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  528|    329|          bitD->bitsConsumed = lastByte ? 8 - BITv07_highbit32(lastByte) : 0;
  ------------------
  |  Branch (528:32): [True: 306, False: 23]
  ------------------
  529|    329|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|     23|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     23|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     23|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (529:15): [True: 23, False: 306]
  ------------------
  530|    306|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  531|    306|    }
  532|       |
  533|    856|    return srcSize;
  534|    979|}
zstd_v07.c:MEM_readLEST:
  367|  80.9k|{
  368|  80.9k|    if (MEM_32bits())
  ------------------
  |  Branch (368:9): [True: 0, False: 80.9k]
  ------------------
  369|      0|        return (size_t)MEM_readLE32(memPtr);
  370|  80.9k|    else
  371|  80.9k|        return (size_t)MEM_readLE64(memPtr);
  372|  80.9k|}
zstd_v07.c:FSEv07_initDState:
  818|  1.17k|{
  819|  1.17k|    const void* ptr = dt;
  820|  1.17k|    const FSEv07_DTableHeader* const DTableH = (const FSEv07_DTableHeader*)ptr;
  821|  1.17k|    DStatePtr->state = BITv07_readBits(bitD, DTableH->tableLog);
  822|  1.17k|    BITv07_reloadDStream(bitD);
  823|  1.17k|    DStatePtr->table = dt + 1;
  824|  1.17k|}
zstd_v07.c:BITv07_readBits:
  557|   252k|{
  558|   252k|    size_t const value = BITv07_lookBits(bitD, nbBits);
  559|   252k|    BITv07_skipBits(bitD, nbBits);
  560|   252k|    return value;
  561|   252k|}
zstd_v07.c:BITv07_lookBits:
  538|   252k|{
  539|   252k|    U32 const bitMask = sizeof(bitD->bitContainer)*8 - 1;
  540|   252k|    return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask);
  541|   252k|}
zstd_v07.c:BITv07_skipBits:
  552|   315k|{
  553|   315k|    bitD->bitsConsumed += nbBits;
  554|   315k|}
zstd_v07.c:BITv07_reloadDStream:
  573|  89.3k|{
  574|  89.3k|    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))  /* should not happen => corruption detected */
  ------------------
  |  Branch (574:9): [True: 276, False: 89.0k]
  ------------------
  575|    276|        return BITv07_DStream_overflow;
  576|       |
  577|  89.0k|    if (bitD->ptr >= bitD->start + sizeof(bitD->bitContainer)) {
  ------------------
  |  Branch (577:9): [True: 76.2k, False: 12.8k]
  ------------------
  578|  76.2k|        bitD->ptr -= bitD->bitsConsumed >> 3;
  579|  76.2k|        bitD->bitsConsumed &= 7;
  580|  76.2k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  581|  76.2k|        return BITv07_DStream_unfinished;
  582|  76.2k|    }
  583|  12.8k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (583:9): [True: 8.77k, False: 4.06k]
  ------------------
  584|  8.77k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BITv07_DStream_endOfBuffer;
  ------------------
  |  Branch (584:13): [True: 8.56k, False: 210]
  ------------------
  585|    210|        return BITv07_DStream_completed;
  586|  8.77k|    }
  587|  4.06k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  588|  4.06k|        BITv07_DStream_status result = BITv07_DStream_unfinished;
  589|  4.06k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (589:13): [True: 90, False: 3.97k]
  ------------------
  590|     90|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  591|     90|            result = BITv07_DStream_endOfBuffer;
  592|     90|        }
  593|  4.06k|        bitD->ptr -= nbBytes;
  594|  4.06k|        bitD->bitsConsumed -= nbBytes*8;
  595|  4.06k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD) */
  596|  4.06k|        return result;
  597|  12.8k|    }
  598|  12.8k|}
zstd_v07.c:FSEv07_decodeSymbolFast:
  854|  2.45k|{
  855|  2.45k|    FSEv07_decode_t const DInfo = ((const FSEv07_decode_t*)(DStatePtr->table))[DStatePtr->state];
  856|  2.45k|    U32 const nbBits = DInfo.nbBits;
  857|  2.45k|    BYTE const symbol = DInfo.symbol;
  858|  2.45k|    size_t const lowBits = BITv07_readBitsFast(bitD, nbBits);
  859|       |
  860|  2.45k|    DStatePtr->state = DInfo.newState + lowBits;
  861|  2.45k|    return symbol;
  862|  2.45k|}
zstd_v07.c:BITv07_readBitsFast:
  566|  2.45k|{
  567|  2.45k|    size_t const value = BITv07_lookBitsFast(bitD, nbBits);
  568|  2.45k|    BITv07_skipBits(bitD, nbBits);
  569|  2.45k|    return value;
  570|  2.45k|}
zstd_v07.c:BITv07_lookBitsFast:
  546|  63.2k|{
  547|  63.2k|    U32 const bitMask = sizeof(bitD->bitContainer)*8 - 1;
  548|  63.2k|    return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask);
  549|  63.2k|}
zstd_v07.c:FSEv07_decodeSymbol:
  841|  8.29k|{
  842|  8.29k|    FSEv07_decode_t const DInfo = ((const FSEv07_decode_t*)(DStatePtr->table))[DStatePtr->state];
  843|  8.29k|    U32 const nbBits = DInfo.nbBits;
  844|  8.29k|    BYTE const symbol = DInfo.symbol;
  845|  8.29k|    size_t const lowBits = BITv07_readBits(bitD, nbBits);
  846|       |
  847|  8.29k|    DStatePtr->state = DInfo.newState + lowBits;
  848|  8.29k|    return symbol;
  849|  8.29k|}
zstd_v07.c:HUFv07_getDTableDesc:
 1708|    520|{
 1709|    520|    DTableDesc dtd;
 1710|    520|    memcpy(&dtd, table, sizeof(dtd));
 1711|    520|    return dtd;
 1712|    520|}
zstd_v07.c:HUFv07_decompress1X2_usingDTable_internal:
 1816|     77|{
 1817|     77|    BYTE* op = (BYTE*)dst;
 1818|     77|    BYTE* const oend = op + dstSize;
 1819|     77|    const void* dtPtr = DTable + 1;
 1820|     77|    const HUFv07_DEltX2* const dt = (const HUFv07_DEltX2*)dtPtr;
 1821|     77|    BITv07_DStream_t bitD;
 1822|     77|    DTableDesc const dtd = HUFv07_getDTableDesc(DTable);
 1823|     77|    U32 const dtLog = dtd.tableLog;
 1824|       |
 1825|     77|    { size_t const errorCode = BITv07_initDStream(&bitD, cSrc, cSrcSize);
 1826|     77|      if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1826:11): [True: 18, False: 59]
  ------------------
 1827|       |
 1828|     59|    HUFv07_decodeStreamX2(op, &bitD, oend, dt, dtLog);
 1829|       |
 1830|       |    /* check */
 1831|     59|    if (!BITv07_endOfDStream(&bitD)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     58|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     58|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     58|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1831:9): [True: 58, False: 1]
  ------------------
 1832|       |
 1833|      1|    return dstSize;
 1834|     59|}
zstd_v07.c:HUFv07_decodeStreamX2:
 1790|    291|{
 1791|    291|    BYTE* const pStart = p;
 1792|       |
 1793|       |    /* up to 4 symbols at a time */
 1794|  1.49k|    while ((BITv07_reloadDStream(bitDPtr) == BITv07_DStream_unfinished) && (p <= pEnd-4)) {
  ------------------
  |  Branch (1794:12): [True: 1.24k, False: 251]
  |  Branch (1794:76): [True: 1.20k, False: 40]
  ------------------
 1795|  1.20k|        HUFv07_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1786|  1.20k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 1.20k, False: 0]
  |  |  ------------------
  |  | 1787|  1.20k|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|  1.20k|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1796|  1.20k|        HUFv07_DECODE_SYMBOLX2_1(p, bitDPtr);
  ------------------
  |  | 1782|  1.20k|    if (MEM_64bits() || (HUFv07_TABLELOG_MAX<=12)) \
  |  |  ------------------
  |  |  |  |  997|      0|#define HUFv07_TABLELOG_MAX  12           /* max configured tableLog (for static allocation); can be modified up to HUFv07_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (1782:9): [True: 1.20k, False: 0]
  |  |  |  Branch (1782:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1783|  1.20k|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|  1.20k|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1797|  1.20k|        HUFv07_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1786|  1.20k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 1.20k, False: 0]
  |  |  ------------------
  |  | 1787|  1.20k|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|  1.20k|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1798|  1.20k|        HUFv07_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1779|  1.20k|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1799|  1.20k|    }
 1800|       |
 1801|       |    /* closer to the end */
 1802|    326|    while ((BITv07_reloadDStream(bitDPtr) == BITv07_DStream_unfinished) && (p < pEnd))
  ------------------
  |  Branch (1802:12): [True: 72, False: 254]
  |  Branch (1802:76): [True: 35, False: 37]
  ------------------
 1803|     35|        HUFv07_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1779|     35|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1804|       |
 1805|       |    /* no more data to retrieve from bitstream, hence no need to reload */
 1806|  56.2k|    while (p < pEnd)
  ------------------
  |  Branch (1806:12): [True: 55.9k, False: 291]
  ------------------
 1807|  55.9k|        HUFv07_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1779|  55.9k|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1808|       |
 1809|    291|    return pEnd-pStart;
 1810|    291|}
zstd_v07.c:MEM_64bits:
  265|  3.60k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_v07.c:HUFv07_decodeSymbolX2:
 1771|  60.7k|{
 1772|  60.7k|    size_t const val = BITv07_lookBitsFast(Dstream, dtLog); /* note : dtLog >= 1 */
 1773|  60.7k|    BYTE const c = dt[val].byte;
 1774|  60.7k|    BITv07_skipBits(Dstream, dt[val].nbBits);
 1775|  60.7k|    return c;
 1776|  60.7k|}
zstd_v07.c:BITv07_endOfDStream:
  604|    291|{
  605|    291|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (605:13): [True: 257, False: 34]
  |  Branch (605:49): [True: 4, False: 253]
  ------------------
  606|    291|}
zstd_v07.c:HUFv07_decompress4X2_usingDTable_internal:
 1869|    184|{
 1870|       |    /* Check */
 1871|    184|    if (cSrcSize < 10) return ERROR(corruption_detected);  /* strict minimum : jump table + 1 byte per stream */
  ------------------
  |  |   49|      5|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      5|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      5|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1871:9): [True: 5, False: 179]
  ------------------
 1872|       |
 1873|    179|    {   const BYTE* const istart = (const BYTE*) cSrc;
 1874|    179|        BYTE* const ostart = (BYTE*) dst;
 1875|    179|        BYTE* const oend = ostart + dstSize;
 1876|    179|        const void* const dtPtr = DTable + 1;
 1877|    179|        const HUFv07_DEltX2* const dt = (const HUFv07_DEltX2*)dtPtr;
 1878|       |
 1879|       |        /* Init */
 1880|    179|        BITv07_DStream_t bitD1;
 1881|    179|        BITv07_DStream_t bitD2;
 1882|    179|        BITv07_DStream_t bitD3;
 1883|    179|        BITv07_DStream_t bitD4;
 1884|    179|        size_t const length1 = MEM_readLE16(istart);
 1885|    179|        size_t const length2 = MEM_readLE16(istart+2);
 1886|    179|        size_t const length3 = MEM_readLE16(istart+4);
 1887|    179|        size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);
 1888|    179|        const BYTE* const istart1 = istart + 6;  /* jumpTable */
 1889|    179|        const BYTE* const istart2 = istart1 + length1;
 1890|    179|        const BYTE* const istart3 = istart2 + length2;
 1891|    179|        const BYTE* const istart4 = istart3 + length3;
 1892|    179|        const size_t segmentSize = (dstSize+3) / 4;
 1893|    179|        BYTE* const opStart2 = ostart + segmentSize;
 1894|    179|        BYTE* const opStart3 = opStart2 + segmentSize;
 1895|    179|        BYTE* const opStart4 = opStart3 + segmentSize;
 1896|    179|        BYTE* op1 = ostart;
 1897|    179|        BYTE* op2 = opStart2;
 1898|    179|        BYTE* op3 = opStart3;
 1899|    179|        BYTE* op4 = opStart4;
 1900|    179|        U32 endSignal;
 1901|    179|        DTableDesc const dtd = HUFv07_getDTableDesc(DTable);
 1902|    179|        U32 const dtLog = dtd.tableLog;
 1903|       |
 1904|    179|        if (length4 > cSrcSize) return ERROR(corruption_detected);   /* overflow */
  ------------------
  |  |   49|     26|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     26|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     26|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1904:13): [True: 26, False: 153]
  ------------------
 1905|    153|        { size_t const errorCode = BITv07_initDStream(&bitD1, istart1, length1);
 1906|    153|          if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1906:15): [True: 20, False: 133]
  ------------------
 1907|    133|        { size_t const errorCode = BITv07_initDStream(&bitD2, istart2, length2);
 1908|    133|          if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1908:15): [True: 30, False: 103]
  ------------------
 1909|    103|        { size_t const errorCode = BITv07_initDStream(&bitD3, istart3, length3);
 1910|    103|          if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1910:15): [True: 37, False: 66]
  ------------------
 1911|     66|        { size_t const errorCode = BITv07_initDStream(&bitD4, istart4, length4);
 1912|     66|          if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1912:15): [True: 8, False: 58]
  ------------------
 1913|       |
 1914|       |        /* 16-32 symbols per loop (4-8 symbols per stream) */
 1915|     58|        endSignal = BITv07_reloadDStream(&bitD1) | BITv07_reloadDStream(&bitD2) | BITv07_reloadDStream(&bitD3) | BITv07_reloadDStream(&bitD4);
 1916|     58|        for ( ; (endSignal==BITv07_DStream_unfinished) && (op4<(oend-7)) ; ) {
  ------------------
  |  Branch (1916:17): [True: 0, False: 58]
  |  Branch (1916:59): [True: 0, False: 0]
  ------------------
 1917|      0|            HUFv07_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 1786|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1787|      0|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|      0|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1918|      0|            HUFv07_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 1786|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1787|      0|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|      0|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1919|      0|            HUFv07_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 1786|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1787|      0|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|      0|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1920|      0|            HUFv07_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 1786|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1787|      0|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|      0|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1921|      0|            HUFv07_DECODE_SYMBOLX2_1(op1, &bitD1);
  ------------------
  |  | 1782|      0|    if (MEM_64bits() || (HUFv07_TABLELOG_MAX<=12)) \
  |  |  ------------------
  |  |  |  |  997|      0|#define HUFv07_TABLELOG_MAX  12           /* max configured tableLog (for static allocation); can be modified up to HUFv07_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (1782:9): [True: 0, False: 0]
  |  |  |  Branch (1782:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1783|      0|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|      0|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1922|      0|            HUFv07_DECODE_SYMBOLX2_1(op2, &bitD2);
  ------------------
  |  | 1782|      0|    if (MEM_64bits() || (HUFv07_TABLELOG_MAX<=12)) \
  |  |  ------------------
  |  |  |  |  997|      0|#define HUFv07_TABLELOG_MAX  12           /* max configured tableLog (for static allocation); can be modified up to HUFv07_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (1782:9): [True: 0, False: 0]
  |  |  |  Branch (1782:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1783|      0|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|      0|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1923|      0|            HUFv07_DECODE_SYMBOLX2_1(op3, &bitD3);
  ------------------
  |  | 1782|      0|    if (MEM_64bits() || (HUFv07_TABLELOG_MAX<=12)) \
  |  |  ------------------
  |  |  |  |  997|      0|#define HUFv07_TABLELOG_MAX  12           /* max configured tableLog (for static allocation); can be modified up to HUFv07_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (1782:9): [True: 0, False: 0]
  |  |  |  Branch (1782:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1783|      0|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|      0|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1924|      0|            HUFv07_DECODE_SYMBOLX2_1(op4, &bitD4);
  ------------------
  |  | 1782|      0|    if (MEM_64bits() || (HUFv07_TABLELOG_MAX<=12)) \
  |  |  ------------------
  |  |  |  |  997|      0|#define HUFv07_TABLELOG_MAX  12           /* max configured tableLog (for static allocation); can be modified up to HUFv07_ABSOLUTEMAX_TABLELOG */
  |  |  ------------------
  |  |  |  Branch (1782:9): [True: 0, False: 0]
  |  |  |  Branch (1782:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1783|      0|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|      0|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1925|      0|            HUFv07_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 1786|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1787|      0|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|      0|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1926|      0|            HUFv07_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 1786|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1787|      0|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|      0|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1927|      0|            HUFv07_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 1786|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1787|      0|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|      0|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1928|      0|            HUFv07_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 1786|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1787|      0|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|      0|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1929|      0|            HUFv07_DECODE_SYMBOLX2_0(op1, &bitD1);
  ------------------
  |  | 1779|      0|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1930|      0|            HUFv07_DECODE_SYMBOLX2_0(op2, &bitD2);
  ------------------
  |  | 1779|      0|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1931|      0|            HUFv07_DECODE_SYMBOLX2_0(op3, &bitD3);
  ------------------
  |  | 1779|      0|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1932|      0|            HUFv07_DECODE_SYMBOLX2_0(op4, &bitD4);
  ------------------
  |  | 1779|      0|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1933|      0|            endSignal = BITv07_reloadDStream(&bitD1) | BITv07_reloadDStream(&bitD2) | BITv07_reloadDStream(&bitD3) | BITv07_reloadDStream(&bitD4);
 1934|      0|        }
 1935|       |
 1936|       |        /* check corruption */
 1937|     58|        if (op1 > opStart2) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1937:13): [True: 0, False: 58]
  ------------------
 1938|     58|        if (op2 > opStart3) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1938:13): [True: 0, False: 58]
  ------------------
 1939|     58|        if (op3 > opStart4) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1939:13): [True: 0, False: 58]
  ------------------
 1940|       |        /* note : op4 supposed already verified within main loop */
 1941|       |
 1942|       |        /* finish bitStreams one by one */
 1943|     58|        HUFv07_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog);
 1944|     58|        HUFv07_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog);
 1945|     58|        HUFv07_decodeStreamX2(op3, &bitD3, opStart4, dt, dtLog);
 1946|     58|        HUFv07_decodeStreamX2(op4, &bitD4, oend,     dt, dtLog);
 1947|       |
 1948|       |        /* check */
 1949|     58|        endSignal = BITv07_endOfDStream(&bitD1) & BITv07_endOfDStream(&bitD2) & BITv07_endOfDStream(&bitD3) & BITv07_endOfDStream(&bitD4);
 1950|     58|        if (!endSignal) return ERROR(corruption_detected);
  ------------------
  |  |   49|     58|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     58|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     58|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1950:13): [True: 58, False: 0]
  ------------------
 1951|       |
 1952|       |        /* decoded size */
 1953|      0|        return dstSize;
 1954|     58|    }
 1955|     58|}
zstd_v07.c:ZSTDv07_defaultAllocFunction:
 2577|  1.01k|{
 2578|  1.01k|    void* address = malloc(size);
 2579|  1.01k|    (void)opaque;
 2580|       |    /* printf("alloc %p, %d opaque=%p \n", address, (int)size, opaque); */
 2581|  1.01k|    return address;
 2582|  1.01k|}
zstd_v07.c:ZSTDv07_defaultFreeFunction:
 2585|  1.01k|{
 2586|  1.01k|    (void)opaque;
 2587|       |    /* if (address) printf("free %p opaque=%p \n", address, opaque); */
 2588|  1.01k|    free(address);
 2589|  1.01k|}
zstd_v07.c:ZSTDv07_frameHeaderSize:
 3078|  3.19k|{
 3079|  3.19k|    if (srcSize < ZSTDv07_frameHeaderSize_min) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3079:9): [True: 0, False: 3.19k]
  ------------------
 3080|  3.19k|    {   BYTE const fhd = ((const BYTE*)src)[4];
 3081|  3.19k|        U32 const dictID= fhd & 3;
 3082|  3.19k|        U32 const directMode = (fhd >> 5) & 1;
 3083|  3.19k|        U32 const fcsId = fhd >> 6;
 3084|  3.19k|        return ZSTDv07_frameHeaderSize_min + !directMode + ZSTDv07_did_fieldSize[dictID] + ZSTDv07_fcs_fieldSize[fcsId]
 3085|  3.19k|                + (directMode && !ZSTDv07_fcs_fieldSize[fcsId]);
  ------------------
  |  Branch (3085:20): [True: 198, False: 2.99k]
  |  Branch (3085:34): [True: 26, False: 172]
  ------------------
 3086|  3.19k|    }
 3087|  3.19k|}
zstd_v07.c:MEM_32bits:
  264|   323k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_v07.c:MEM_readLE16:
  329|    595|{
  330|    595|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (330:9): [True: 595, False: 0]
  ------------------
  331|    595|        return MEM_read16(memPtr);
  332|      0|    else {
  333|      0|        const BYTE* p = (const BYTE*)memPtr;
  334|      0|        return (U16)(p[0] + (p[1]<<8));
  335|      0|    }
  336|    595|}
zstd_v07.c:MEM_read16:
  274|    595|{
  275|    595|    U16 val; memcpy(&val, memPtr, sizeof(val)); return val;
  276|    595|}
zstd_v07.c:MEM_readLE64:
  359|  81.0k|{
  360|  81.0k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (360:9): [True: 81.0k, False: 0]
  ------------------
  361|  81.0k|        return MEM_read64(memPtr);
  362|      0|    else
  363|      0|        return MEM_swap64(MEM_read64(memPtr));
  364|  81.0k|}
zstd_v07.c:MEM_read64:
  284|  81.0k|{
  285|  81.0k|    U64 val; memcpy(&val, memPtr, sizeof(val)); return val;
  286|  81.0k|}
zstd_v07.c:ZSTDv07_checkContinuity:
 3678|  1.01k|{
 3679|  1.01k|    if (dst != dctx->previousDstEnd) {   /* not contiguous */
  ------------------
  |  Branch (3679:9): [True: 1.01k, False: 0]
  ------------------
 3680|  1.01k|        dctx->dictEnd = dctx->previousDstEnd;
 3681|  1.01k|        dctx->vBase = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3682|  1.01k|        dctx->base = dst;
 3683|  1.01k|        dctx->previousDstEnd = dst;
 3684|  1.01k|    }
 3685|  1.01k|}
zstd_v07.c:ZSTDv07_decompressBlock_internal:
 3691|    869|{   /* blockType == blockCompressed */
 3692|    869|    const BYTE* ip = (const BYTE*)src;
 3693|       |
 3694|    869|    if (srcSize >= ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) return ERROR(srcSize_wrong);
  ------------------
  |  |  175|    869|#define ZSTDv07_BLOCKSIZE_ABSOLUTEMAX (128 * 1024)   /* define, for static allocation */
  ------------------
                  if (srcSize >= ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3694:9): [True: 0, False: 869]
  ------------------
 3695|       |
 3696|       |    /* Decode literals sub-block */
 3697|    869|    {   size_t const litCSize = ZSTDv07_decodeLiteralsBlock(dctx, src, srcSize);
 3698|    869|        if (ZSTDv07_isError(litCSize)) return litCSize;
  ------------------
  |  | 2856|    869|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3698:13): [True: 445, False: 424]
  ------------------
 3699|    424|        ip += litCSize;
 3700|    424|        srcSize -= litCSize;
 3701|    424|    }
 3702|      0|    return ZSTDv07_decompressSequences(dctx, dst, dstCapacity, ip, srcSize);
 3703|    869|}
zstd_v07.c:ZSTDv07_decodeLiteralsBlock:
 3231|    869|{
 3232|    869|    const BYTE* const istart = (const BYTE*) src;
 3233|       |
 3234|    869|    if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  | 2663|    869|#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */ + MIN_SEQUENCES_SIZE /* nbSeq==0 */)   /* for a non-null block */
  |  |  ------------------
  |  |  |  | 2662|    869|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  |  |  ------------------
  ------------------
                  if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  |   49|      9|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      9|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      9|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3234:9): [True: 9, False: 860]
  ------------------
 3235|       |
 3236|    860|    switch((litBlockType_t)(istart[0]>> 6))
 3237|    860|    {
 3238|    414|    case lbt_huffman:
  ------------------
  |  Branch (3238:5): [True: 414, False: 446]
  ------------------
 3239|    414|        {   size_t litSize, litCSize, singleStream=0;
 3240|    414|            U32 lhSize = (istart[0] >> 4) & 3;
 3241|    414|            if (srcSize < 5) return ERROR(corruption_detected);   /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for lhSize, + cSize (+nbSeq) */
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3241:17): [True: 1, False: 413]
  ------------------
 3242|    413|            switch(lhSize)
 3243|    413|            {
 3244|    363|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3244:13): [True: 235, False: 178]
  |  Branch (3244:21): [True: 128, False: 285]
  |  Branch (3244:29): [True: 0, False: 413]
  ------------------
 3245|       |                /* 2 - 2 - 10 - 10 */
 3246|    363|                lhSize=3;
 3247|    363|                singleStream = istart[0] & 16;
 3248|    363|                litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 3249|    363|                litCSize = ((istart[1] &  3) << 8) + istart[2];
 3250|    363|                break;
 3251|     23|            case 2:
  ------------------
  |  Branch (3251:13): [True: 23, False: 390]
  ------------------
 3252|       |                /* 2 - 2 - 14 - 14 */
 3253|     23|                lhSize=4;
 3254|     23|                litSize  = ((istart[0] & 15) << 10) + (istart[1] << 2) + (istart[2] >> 6);
 3255|     23|                litCSize = ((istart[2] & 63) <<  8) + istart[3];
 3256|     23|                break;
 3257|     27|            case 3:
  ------------------
  |  Branch (3257:13): [True: 27, False: 386]
  ------------------
 3258|       |                /* 2 - 2 - 18 - 18 */
 3259|     27|                lhSize=5;
 3260|     27|                litSize  = ((istart[0] & 15) << 14) + (istart[1] << 6) + (istart[2] >> 2);
 3261|     27|                litCSize = ((istart[2] &  3) << 16) + (istart[3] << 8) + istart[4];
 3262|     27|                break;
 3263|    413|            }
 3264|    413|            if (litSize > ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) return ERROR(corruption_detected);
  ------------------
  |  |  175|    413|#define ZSTDv07_BLOCKSIZE_ABSOLUTEMAX (128 * 1024)   /* define, for static allocation */
  ------------------
                          if (litSize > ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) return ERROR(corruption_detected);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3264:17): [True: 1, False: 412]
  ------------------
 3265|    412|            if (litCSize + lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|     45|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     45|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     45|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3265:17): [True: 45, False: 367]
  ------------------
 3266|       |
 3267|    367|            if (HUFv07_isError(singleStream ?
  ------------------
  |  | 2858|    367|#define HUFv07_isError  ERR_isError
  ------------------
  |  Branch (3267:17): [True: 366, False: 1]
  |  Branch (3267:32): [True: 127, False: 240]
  ------------------
 3268|    127|                            HUFv07_decompress1X2_DCtx(dctx->hufTable, dctx->litBuffer, litSize, istart+lhSize, litCSize) :
 3269|    367|                            HUFv07_decompress4X_hufOnly (dctx->hufTable, dctx->litBuffer, litSize, istart+lhSize, litCSize) ))
 3270|    366|                return ERROR(corruption_detected);
  ------------------
  |  |   49|    366|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    366|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    366|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3271|       |
 3272|      1|            dctx->litPtr = dctx->litBuffer;
 3273|      1|            dctx->litSize = litSize;
 3274|      1|            dctx->litEntropy = 1;
 3275|      1|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  | 2721|      1|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3276|      1|            return litCSize + lhSize;
 3277|    367|        }
 3278|      3|    case lbt_repeat:
  ------------------
  |  Branch (3278:5): [True: 3, False: 857]
  ------------------
 3279|      3|        {   size_t litSize, litCSize;
 3280|      3|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3281|      3|            if (lhSize != 1)  /* only case supported for now : small litSize, single stream */
  ------------------
  |  Branch (3281:17): [True: 2, False: 1]
  ------------------
 3282|      2|                return ERROR(corruption_detected);
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3283|      1|            if (dctx->litEntropy==0)
  ------------------
  |  Branch (3283:17): [True: 1, False: 0]
  ------------------
 3284|      1|                return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3285|       |
 3286|       |            /* 2 - 2 - 10 - 10 */
 3287|      0|            lhSize=3;
 3288|      0|            litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 3289|      0|            litCSize = ((istart[1] &  3) << 8) + istart[2];
 3290|      0|            if (litCSize + lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3290:17): [True: 0, False: 0]
  ------------------
 3291|       |
 3292|      0|            {   size_t const errorCode = HUFv07_decompress1X4_usingDTable(dctx->litBuffer, litSize, istart+lhSize, litCSize, dctx->hufTable);
 3293|      0|                if (HUFv07_isError(errorCode)) return ERROR(corruption_detected);
  ------------------
  |  | 2858|      0|#define HUFv07_isError  ERR_isError
  ------------------
                              if (HUFv07_isError(errorCode)) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3293:21): [True: 0, False: 0]
  ------------------
 3294|      0|            }
 3295|      0|            dctx->litPtr = dctx->litBuffer;
 3296|      0|            dctx->litSize = litSize;
 3297|      0|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  | 2721|      0|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3298|      0|            return litCSize + lhSize;
 3299|      0|        }
 3300|     57|    case lbt_raw:
  ------------------
  |  Branch (3300:5): [True: 57, False: 803]
  ------------------
 3301|     57|        {   size_t litSize;
 3302|     57|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3303|     57|            switch(lhSize)
 3304|     57|            {
 3305|     40|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3305:13): [True: 23, False: 34]
  |  Branch (3305:21): [True: 17, False: 40]
  |  Branch (3305:29): [True: 0, False: 57]
  ------------------
 3306|     40|                lhSize=1;
 3307|     40|                litSize = istart[0] & 31;
 3308|     40|                break;
 3309|      7|            case 2:
  ------------------
  |  Branch (3309:13): [True: 7, False: 50]
  ------------------
 3310|      7|                litSize = ((istart[0] & 15) << 8) + istart[1];
 3311|      7|                break;
 3312|     10|            case 3:
  ------------------
  |  Branch (3312:13): [True: 10, False: 47]
  ------------------
 3313|     10|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 3314|     10|                break;
 3315|     57|            }
 3316|       |
 3317|     57|            if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */
  ------------------
  |  | 2721|     57|#define WILDCOPY_OVERLENGTH 8
  ------------------
  |  Branch (3317:17): [True: 24, False: 33]
  ------------------
 3318|     24|                if (litSize+lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|     18|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     18|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     18|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3318:21): [True: 18, False: 6]
  ------------------
 3319|      6|                memcpy(dctx->litBuffer, istart+lhSize, litSize);
 3320|      6|                dctx->litPtr = dctx->litBuffer;
 3321|      6|                dctx->litSize = litSize;
 3322|      6|                memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  | 2721|      6|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3323|      6|                return lhSize+litSize;
 3324|     24|            }
 3325|       |            /* direct reference into compressed stream */
 3326|     33|            dctx->litPtr = istart+lhSize;
 3327|     33|            dctx->litSize = litSize;
 3328|     33|            return lhSize+litSize;
 3329|     57|        }
 3330|    386|    case lbt_rle:
  ------------------
  |  Branch (3330:5): [True: 386, False: 474]
  ------------------
 3331|    386|        {   size_t litSize;
 3332|    386|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3333|    386|            switch(lhSize)
 3334|    386|            {
 3335|     12|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3335:13): [True: 3, False: 383]
  |  Branch (3335:21): [True: 9, False: 377]
  |  Branch (3335:29): [True: 0, False: 386]
  ------------------
 3336|     12|                lhSize = 1;
 3337|     12|                litSize = istart[0] & 31;
 3338|     12|                break;
 3339|     25|            case 2:
  ------------------
  |  Branch (3339:13): [True: 25, False: 361]
  ------------------
 3340|     25|                litSize = ((istart[0] & 15) << 8) + istart[1];
 3341|     25|                break;
 3342|    349|            case 3:
  ------------------
  |  Branch (3342:13): [True: 349, False: 37]
  ------------------
 3343|    349|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 3344|    349|                if (srcSize<4) return ERROR(corruption_detected);   /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need lhSize+1 = 4 */
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3344:21): [True: 1, False: 348]
  ------------------
 3345|    348|                break;
 3346|    386|            }
 3347|    385|            if (litSize > ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) return ERROR(corruption_detected);
  ------------------
  |  |  175|    385|#define ZSTDv07_BLOCKSIZE_ABSOLUTEMAX (128 * 1024)   /* define, for static allocation */
  ------------------
                          if (litSize > ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) return ERROR(corruption_detected);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3347:17): [True: 1, False: 384]
  ------------------
 3348|    384|            memset(dctx->litBuffer, istart[lhSize], litSize + WILDCOPY_OVERLENGTH);
  ------------------
  |  | 2721|    384|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3349|    384|            dctx->litPtr = dctx->litBuffer;
 3350|    384|            dctx->litSize = litSize;
 3351|    384|            return lhSize+1;
 3352|    385|        }
 3353|      0|    default:
  ------------------
  |  Branch (3353:5): [True: 0, False: 860]
  ------------------
 3354|      0|        return ERROR(corruption_detected);   /* impossible */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3355|    860|    }
 3356|    860|}
zstd_v07.c:ZSTDv07_decompressSequences:
 3616|    424|{
 3617|    424|    const BYTE* ip = (const BYTE*)seqStart;
 3618|    424|    const BYTE* const iend = ip + seqSize;
 3619|    424|    BYTE* const ostart = (BYTE*)dst;
 3620|    424|    BYTE* const oend = ostart + maxDstSize;
 3621|    424|    BYTE* op = ostart;
 3622|    424|    const BYTE* litPtr = dctx->litPtr;
 3623|    424|    const BYTE* const litEnd = litPtr + dctx->litSize;
 3624|    424|    FSEv07_DTable* DTableLL = dctx->LLTable;
 3625|    424|    FSEv07_DTable* DTableML = dctx->MLTable;
 3626|    424|    FSEv07_DTable* DTableOffb = dctx->OffTable;
 3627|    424|    const BYTE* const base = (const BYTE*) (dctx->base);
 3628|    424|    const BYTE* const vBase = (const BYTE*) (dctx->vBase);
 3629|    424|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 3630|    424|    int nbSeq;
 3631|       |
 3632|       |    /* Build Decoding Tables */
 3633|    424|    {   size_t const seqHSize = ZSTDv07_decodeSeqHeaders(&nbSeq, DTableLL, DTableML, DTableOffb, dctx->fseEntropy, ip, seqSize);
 3634|    424|        if (ZSTDv07_isError(seqHSize)) return seqHSize;
  ------------------
  |  | 2856|    424|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3634:13): [True: 55, False: 369]
  ------------------
 3635|    369|        ip += seqHSize;
 3636|    369|    }
 3637|       |
 3638|       |    /* Regen sequences */
 3639|    369|    if (nbSeq) {
  ------------------
  |  Branch (3639:9): [True: 334, False: 35]
  ------------------
 3640|    334|        seqState_t seqState;
 3641|    334|        dctx->fseEntropy = 1;
 3642|  1.33k|        { U32 i; for (i=0; i<ZSTDv07_REP_INIT; i++) seqState.prevOffset[i] = dctx->rep[i]; }
  ------------------
  |  | 2639|  1.33k|#define ZSTDv07_REP_INIT   ZSTDv07_REP_NUM
  |  |  ------------------
  |  |  |  | 2638|  1.33k|#define ZSTDv07_REP_NUM    3
  |  |  ------------------
  ------------------
  |  Branch (3642:28): [True: 1.00k, False: 334]
  ------------------
 3643|    334|        { size_t const errorCode = BITv07_initDStream(&(seqState.DStream), ip, iend-ip);
 3644|    334|          if (ERR_isError(errorCode)) return ERROR(corruption_detected); }
  ------------------
  |  |   49|     35|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     35|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     35|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3644:15): [True: 35, False: 299]
  ------------------
 3645|    299|        FSEv07_initDState(&(seqState.stateLL), &(seqState.DStream), DTableLL);
 3646|    299|        FSEv07_initDState(&(seqState.stateOffb), &(seqState.DStream), DTableOffb);
 3647|    299|        FSEv07_initDState(&(seqState.stateML), &(seqState.DStream), DTableML);
 3648|       |
 3649|  79.5k|        for ( ; (BITv07_reloadDStream(&(seqState.DStream)) <= BITv07_DStream_completed) && nbSeq ; ) {
  ------------------
  |  Branch (3649:17): [True: 79.4k, False: 104]
  |  Branch (3649:92): [True: 79.3k, False: 35]
  ------------------
 3650|  79.3k|            nbSeq--;
 3651|  79.3k|            {   seq_t const sequence = ZSTDv07_decodeSequence(&seqState);
 3652|  79.3k|                size_t const oneSeqSize = ZSTDv07_execSequence(op, oend, sequence, &litPtr, litEnd, base, vBase, dictEnd);
 3653|  79.3k|                if (ZSTDv07_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  | 2856|  79.3k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3653:21): [True: 160, False: 79.2k]
  ------------------
 3654|  79.2k|                op += oneSeqSize;
 3655|  79.2k|        }   }
 3656|       |
 3657|       |        /* check if reached exact end */
 3658|    139|        if (nbSeq) return ERROR(corruption_detected);
  ------------------
  |  |   49|     93|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     93|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     93|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3658:13): [True: 93, False: 46]
  ------------------
 3659|       |        /* save reps for next block */
 3660|    184|        { U32 i; for (i=0; i<ZSTDv07_REP_INIT; i++) dctx->rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  | 2639|    184|#define ZSTDv07_REP_INIT   ZSTDv07_REP_NUM
  |  |  ------------------
  |  |  |  | 2638|    184|#define ZSTDv07_REP_NUM    3
  |  |  ------------------
  ------------------
  |  Branch (3660:28): [True: 138, False: 46]
  ------------------
 3661|     46|    }
 3662|       |
 3663|       |    /* last literal segment */
 3664|     81|    {   size_t const lastLLSize = litEnd - litPtr;
 3665|       |        /* if (litPtr > litEnd) return ERROR(corruption_detected); */   /* too many literals already used */
 3666|     81|        if (lastLLSize > (size_t)(oend-op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|     12|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     12|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     12|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3666:13): [True: 12, False: 69]
  ------------------
 3667|     69|        if (lastLLSize > 0) {
  ------------------
  |  Branch (3667:13): [True: 65, False: 4]
  ------------------
 3668|     65|            memcpy(op, litPtr, lastLLSize);
 3669|     65|            op += lastLLSize;
 3670|     65|        }
 3671|     69|    }
 3672|       |
 3673|      0|    return op-ostart;
 3674|     81|}
zstd_v07.c:ZSTDv07_decodeSeqHeaders:
 3396|    424|{
 3397|    424|    const BYTE* const istart = (const BYTE*)src;
 3398|    424|    const BYTE* const iend = istart + srcSize;
 3399|    424|    const BYTE* ip = istart;
 3400|       |
 3401|       |    /* check */
 3402|    424|    if (srcSize < MIN_SEQUENCES_SIZE) return ERROR(srcSize_wrong);
  ------------------
  |  | 2662|    424|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  ------------------
                  if (srcSize < MIN_SEQUENCES_SIZE) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3402:9): [True: 1, False: 423]
  ------------------
 3403|       |
 3404|       |    /* SeqHead */
 3405|    423|    {   int nbSeq = *ip++;
 3406|    423|        if (!nbSeq) { *nbSeqPtr=0; return 1; }
  ------------------
  |  Branch (3406:13): [True: 25, False: 398]
  ------------------
 3407|    398|        if (nbSeq > 0x7F) {
  ------------------
  |  Branch (3407:13): [True: 194, False: 204]
  ------------------
 3408|    194|            if (nbSeq == 0xFF) {
  ------------------
  |  Branch (3408:17): [True: 22, False: 172]
  ------------------
 3409|     22|                if (ip+2 > iend) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3409:21): [True: 1, False: 21]
  ------------------
 3410|     21|                nbSeq = MEM_readLE16(ip) + LONGNBSEQ, ip+=2;
  ------------------
  |  | 2668|     21|#define LONGNBSEQ 0x7F00
  ------------------
 3411|    172|            } else {
 3412|    172|                if (ip >= iend) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3412:21): [True: 1, False: 171]
  ------------------
 3413|    171|                nbSeq = ((nbSeq-0x80)<<8) + *ip++;
 3414|    171|            }
 3415|    194|        }
 3416|    396|        *nbSeqPtr = nbSeq;
 3417|    396|    }
 3418|       |
 3419|       |    /* FSE table descriptors */
 3420|    396|    if (ip + 4 > iend) return ERROR(srcSize_wrong); /* min : header byte + all 3 are "raw", hence no header, but at least xxLog bits per type */
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3420:9): [True: 1, False: 395]
  ------------------
 3421|    395|    {   U32 const LLtype  = *ip >> 6;
 3422|    395|        U32 const OFtype = (*ip >> 4) & 3;
 3423|    395|        U32 const MLtype  = (*ip >> 2) & 3;
 3424|    395|        ip++;
 3425|       |
 3426|       |        /* Build DTables */
 3427|    395|        {   size_t const llhSize = ZSTDv07_buildSeqTable(DTableLL, LLtype, MaxLL, LLFSELog, ip, iend-ip, LL_defaultNorm, LL_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2676|    395|#define MaxLL  35
  ------------------
                      {   size_t const llhSize = ZSTDv07_buildSeqTable(DTableLL, LLtype, MaxLL, LLFSELog, ip, iend-ip, LL_defaultNorm, LL_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2680|    395|#define LLFSELog    9
  ------------------
 3428|    395|            if (ZSTDv07_isError(llhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2856|    395|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
                          if (ZSTDv07_isError(llhSize)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3428:17): [True: 10, False: 385]
  ------------------
 3429|    385|            ip += llhSize;
 3430|    385|        }
 3431|    385|        {   size_t const ofhSize = ZSTDv07_buildSeqTable(DTableOffb, OFtype, MaxOff, OffFSELog, ip, iend-ip, OF_defaultNorm, OF_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2677|    385|#define MaxOff 28
  ------------------
                      {   size_t const ofhSize = ZSTDv07_buildSeqTable(DTableOffb, OFtype, MaxOff, OffFSELog, ip, iend-ip, OF_defaultNorm, OF_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2681|    385|#define OffFSELog   8
  ------------------
 3432|    385|            if (ZSTDv07_isError(ofhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2856|    385|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
                          if (ZSTDv07_isError(ofhSize)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     19|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     19|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     19|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3432:17): [True: 19, False: 366]
  ------------------
 3433|    366|            ip += ofhSize;
 3434|    366|        }
 3435|    366|        {   size_t const mlhSize = ZSTDv07_buildSeqTable(DTableML, MLtype, MaxML, MLFSELog, ip, iend-ip, ML_defaultNorm, ML_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2675|    366|#define MaxML  52
  ------------------
                      {   size_t const mlhSize = ZSTDv07_buildSeqTable(DTableML, MLtype, MaxML, MLFSELog, ip, iend-ip, ML_defaultNorm, ML_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2679|    366|#define MLFSELog    9
  ------------------
 3436|    366|            if (ZSTDv07_isError(mlhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2856|    366|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
                          if (ZSTDv07_isError(mlhSize)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     22|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     22|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     22|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3436:17): [True: 22, False: 344]
  ------------------
 3437|    344|            ip += mlhSize;
 3438|    344|    }   }
 3439|       |
 3440|      0|    return ip-istart;
 3441|    366|}
zstd_v07.c:ZSTDv07_buildSeqTable:
 3366|  1.14k|{
 3367|  1.14k|    switch(type)
 3368|  1.14k|    {
 3369|    192|    case FSEv07_ENCODING_RLE :
  ------------------
  |  | 2684|    192|#define FSEv07_ENCODING_RLE     1
  ------------------
  |  Branch (3369:5): [True: 192, False: 954]
  ------------------
 3370|    192|        if (!srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3370:13): [True: 2, False: 190]
  ------------------
 3371|    190|        if ( (*(const BYTE*)src) > max) return ERROR(corruption_detected);
  ------------------
  |  |   49|      5|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      5|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      5|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3371:14): [True: 5, False: 185]
  ------------------
 3372|    185|        FSEv07_buildDTable_rle(DTable, *(const BYTE*)src);   /* if *src > max, data is corrupted */
 3373|    185|        return 1;
 3374|    475|    case FSEv07_ENCODING_RAW :
  ------------------
  |  | 2683|    475|#define FSEv07_ENCODING_RAW     0
  ------------------
  |  Branch (3374:5): [True: 475, False: 671]
  ------------------
 3375|    475|        FSEv07_buildDTable(DTable, defaultNorm, max, defaultLog);
 3376|    475|        return 0;
 3377|     12|    case FSEv07_ENCODING_STATIC:
  ------------------
  |  | 2685|     12|#define FSEv07_ENCODING_STATIC  2
  ------------------
  |  Branch (3377:5): [True: 12, False: 1.13k]
  ------------------
 3378|     12|        if (!flagRepeatTable) return ERROR(corruption_detected);
  ------------------
  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3378:13): [True: 4, False: 8]
  ------------------
 3379|      8|        return 0;
 3380|      0|    default :   /* impossible */
  ------------------
  |  Branch (3380:5): [True: 0, False: 1.14k]
  ------------------
 3381|    467|    case FSEv07_ENCODING_DYNAMIC :
  ------------------
  |  | 2686|    467|#define FSEv07_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3381:5): [True: 467, False: 679]
  ------------------
 3382|    467|        {   U32 tableLog;
 3383|    467|            S16 norm[MaxSeq+1];
 3384|    467|            size_t const headerSize = FSEv07_readNCount(norm, &max, &tableLog, src, srcSize);
 3385|    467|            if (FSEv07_isError(headerSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2857|    467|#define FSEv07_isError  ERR_isError
  ------------------
                          if (FSEv07_isError(headerSize)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     21|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     21|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     21|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3385:17): [True: 21, False: 446]
  ------------------
 3386|    446|            if (tableLog > maxLog) return ERROR(corruption_detected);
  ------------------
  |  |   49|     19|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     19|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     19|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3386:17): [True: 19, False: 427]
  ------------------
 3387|    427|            FSEv07_buildDTable(DTable, norm, max, tableLog);
 3388|    427|            return headerSize;
 3389|    446|    }   }
 3390|  1.14k|}
zstd_v07.c:ZSTDv07_decodeSequence:
 3460|  79.3k|{
 3461|  79.3k|    seq_t seq;
 3462|       |
 3463|  79.3k|    U32 const llCode = FSEv07_peekSymbol(&(seqState->stateLL));
 3464|  79.3k|    U32 const mlCode = FSEv07_peekSymbol(&(seqState->stateML));
 3465|  79.3k|    U32 const ofCode = FSEv07_peekSymbol(&(seqState->stateOffb));   /* <= maxOff, by table construction */
 3466|       |
 3467|  79.3k|    U32 const llBits = LL_bits[llCode];
 3468|  79.3k|    U32 const mlBits = ML_bits[mlCode];
 3469|  79.3k|    U32 const ofBits = ofCode;
 3470|  79.3k|    U32 const totalBits = llBits+mlBits+ofBits;
 3471|       |
 3472|  79.3k|    static const U32 LL_base[MaxLL+1] = {
 3473|  79.3k|                             0,  1,  2,  3,  4,  5,  6,  7,  8,  9,   10,    11,    12,    13,    14,     15,
 3474|  79.3k|                            16, 18, 20, 22, 24, 28, 32, 40, 48, 64, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000,
 3475|  79.3k|                            0x2000, 0x4000, 0x8000, 0x10000 };
 3476|       |
 3477|  79.3k|    static const U32 ML_base[MaxML+1] = {
 3478|  79.3k|                             3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13,   14,    15,    16,    17,    18,
 3479|  79.3k|                            19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,   30,    31,    32,    33,    34,
 3480|  79.3k|                            35, 37, 39, 41, 43, 47, 51, 59, 67, 83, 99, 0x83, 0x103, 0x203, 0x403, 0x803,
 3481|  79.3k|                            0x1003, 0x2003, 0x4003, 0x8003, 0x10003 };
 3482|       |
 3483|  79.3k|    static const U32 OF_base[MaxOff+1] = {
 3484|  79.3k|                 0,        1,       1,       5,     0xD,     0x1D,     0x3D,     0x7D,
 3485|  79.3k|                 0xFD,   0x1FD,   0x3FD,   0x7FD,   0xFFD,   0x1FFD,   0x3FFD,   0x7FFD,
 3486|  79.3k|                 0xFFFD, 0x1FFFD, 0x3FFFD, 0x7FFFD, 0xFFFFD, 0x1FFFFD, 0x3FFFFD, 0x7FFFFD,
 3487|  79.3k|                 0xFFFFFD, 0x1FFFFFD, 0x3FFFFFD, 0x7FFFFFD, 0xFFFFFFD };
 3488|       |
 3489|       |    /* sequence */
 3490|  79.3k|    {   size_t offset;
 3491|  79.3k|        if (!ofCode)
  ------------------
  |  Branch (3491:13): [True: 76.8k, False: 2.54k]
  ------------------
 3492|  76.8k|            offset = 0;
 3493|  2.54k|        else {
 3494|  2.54k|            offset = OF_base[ofCode] + BITv07_readBits(&(seqState->DStream), ofBits);   /* <=  (ZSTDv07_WINDOWLOG_MAX-1) bits */
 3495|  2.54k|            if (MEM_32bits()) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3495:17): [True: 0, False: 2.54k]
  ------------------
 3496|  2.54k|        }
 3497|       |
 3498|  79.3k|        if (ofCode <= 1) {
  ------------------
  |  Branch (3498:13): [True: 78.0k, False: 1.27k]
  ------------------
 3499|  78.0k|            if ((llCode == 0) & (offset <= 1)) offset = 1-offset;
  ------------------
  |  Branch (3499:17): [True: 73.7k, False: 4.30k]
  ------------------
 3500|  78.0k|            if (offset) {
  ------------------
  |  Branch (3500:17): [True: 74.5k, False: 3.52k]
  ------------------
 3501|  74.5k|                size_t const temp = seqState->prevOffset[offset];
 3502|  74.5k|                if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1];
  ------------------
  |  Branch (3502:21): [True: 592, False: 73.9k]
  ------------------
 3503|  74.5k|                seqState->prevOffset[1] = seqState->prevOffset[0];
 3504|  74.5k|                seqState->prevOffset[0] = offset = temp;
 3505|  74.5k|            } else {
 3506|  3.52k|                offset = seqState->prevOffset[0];
 3507|  3.52k|            }
 3508|  78.0k|        } else {
 3509|  1.27k|            seqState->prevOffset[2] = seqState->prevOffset[1];
 3510|  1.27k|            seqState->prevOffset[1] = seqState->prevOffset[0];
 3511|  1.27k|            seqState->prevOffset[0] = offset;
 3512|  1.27k|        }
 3513|  79.3k|        seq.offset = offset;
 3514|  79.3k|    }
 3515|       |
 3516|  79.3k|    seq.matchLength = ML_base[mlCode] + ((mlCode>31) ? BITv07_readBits(&(seqState->DStream), mlBits) : 0);   /* <=  16 bits */
  ------------------
  |  Branch (3516:42): [True: 1.13k, False: 78.2k]
  ------------------
 3517|  79.3k|    if (MEM_32bits() && (mlBits+llBits>24)) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3517:9): [True: 0, False: 79.3k]
  |  Branch (3517:25): [True: 0, False: 0]
  ------------------
 3518|       |
 3519|  79.3k|    seq.litLength = LL_base[llCode] + ((llCode>15) ? BITv07_readBits(&(seqState->DStream), llBits) : 0);   /* <=  16 bits */
  ------------------
  |  Branch (3519:40): [True: 1.31k, False: 78.0k]
  ------------------
 3520|  79.3k|    if (MEM_32bits() ||
  ------------------
  |  Branch (3520:9): [True: 0, False: 79.3k]
  ------------------
 3521|  79.3k|       (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  | 2680|  79.3k|#define LLFSELog    9
  ------------------
                     (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  | 2679|  79.3k|#define MLFSELog    9
  ------------------
                     (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  | 2681|  79.3k|#define OffFSELog   8
  ------------------
  |  Branch (3521:8): [True: 37, False: 79.3k]
  ------------------
 3522|       |
 3523|       |    /* ANS state update */
 3524|  79.3k|    FSEv07_updateState(&(seqState->stateLL), &(seqState->DStream));   /* <=  9 bits */
 3525|  79.3k|    FSEv07_updateState(&(seqState->stateML), &(seqState->DStream));   /* <=  9 bits */
 3526|  79.3k|    if (MEM_32bits()) BITv07_reloadDStream(&(seqState->DStream));     /* <= 18 bits */
  ------------------
  |  Branch (3526:9): [True: 0, False: 79.3k]
  ------------------
 3527|  79.3k|    FSEv07_updateState(&(seqState->stateOffb), &(seqState->DStream)); /* <=  8 bits */
 3528|       |
 3529|  79.3k|    return seq;
 3530|  79.3k|}
zstd_v07.c:FSEv07_peekSymbol:
  827|   238k|{
  828|   238k|    FSEv07_decode_t const DInfo = ((const FSEv07_decode_t*)(DStatePtr->table))[DStatePtr->state];
  829|   238k|    return DInfo.symbol;
  830|   238k|}
zstd_v07.c:FSEv07_updateState:
  833|   238k|{
  834|   238k|    FSEv07_decode_t const DInfo = ((const FSEv07_decode_t*)(DStatePtr->table))[DStatePtr->state];
  835|   238k|    U32 const nbBits = DInfo.nbBits;
  836|   238k|    size_t const lowBits = BITv07_readBits(bitD, nbBits);
  837|   238k|    DStatePtr->state = DInfo.newState + lowBits;
  838|   238k|}
zstd_v07.c:ZSTDv07_execSequence:
 3538|  79.3k|{
 3539|  79.3k|    BYTE* const oLitEnd = op + sequence.litLength;
 3540|  79.3k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 3541|  79.3k|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 3542|  79.3k|    BYTE* const oend_w = oend-WILDCOPY_OVERLENGTH;
  ------------------
  |  | 2721|  79.3k|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3543|  79.3k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 3544|  79.3k|    const BYTE* match = oLitEnd - sequence.offset;
 3545|       |
 3546|       |    /* check */
 3547|  79.3k|    assert(oend >= op);
  ------------------
  |  |   70|  79.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 3548|  79.3k|    if (sequence.litLength + WILDCOPY_OVERLENGTH > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  | 2721|  79.3k|#define WILDCOPY_OVERLENGTH 8
  ------------------
                  if (sequence.litLength + WILDCOPY_OVERLENGTH > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|     46|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     46|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     46|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3548:9): [True: 46, False: 79.3k]
  ------------------
 3549|  79.3k|    if (sequenceLength > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|     20|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     20|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     20|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3549:9): [True: 20, False: 79.3k]
  ------------------
 3550|  79.3k|    assert(litLimit >= *litPtr);
  ------------------
  |  |   70|  79.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 3551|  79.3k|    if (sequence.litLength > (size_t)(litLimit - *litPtr)) return ERROR(corruption_detected);;
  ------------------
  |  |   49|     24|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     24|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     24|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3551:9): [True: 24, False: 79.2k]
  ------------------
 3552|       |
 3553|       |    /* copy Literals */
 3554|  79.2k|    ZSTDv07_wildcopy(op, *litPtr, (ptrdiff_t)sequence.litLength);   /* note : since oLitEnd <= oend-WILDCOPY_OVERLENGTH, no risk of overwrite beyond oend */
 3555|  79.2k|    op = oLitEnd;
 3556|  79.2k|    *litPtr = iLitEnd;   /* update for next sequence */
 3557|       |
 3558|       |    /* copy Match */
 3559|  79.2k|    if (sequence.offset > (size_t)(oLitEnd - base)) {
  ------------------
  |  Branch (3559:9): [True: 148, False: 79.1k]
  ------------------
 3560|       |        /* offset beyond prefix */
 3561|    148|        if (sequence.offset > (size_t)(oLitEnd - vBase)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     70|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     70|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     70|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3561:13): [True: 70, False: 78]
  ------------------
 3562|     78|        match = dictEnd - (base-match);
 3563|     78|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (3563:13): [True: 45, False: 33]
  ------------------
 3564|     45|            memmove(oLitEnd, match, sequence.matchLength);
 3565|     45|            return sequenceLength;
 3566|     45|        }
 3567|       |        /* span extDict & currentPrefixSegment */
 3568|     33|        {   size_t const length1 = (size_t)(dictEnd - match);
 3569|     33|            memmove(oLitEnd, match, length1);
 3570|     33|            op = oLitEnd + length1;
 3571|     33|            sequence.matchLength -= length1;
 3572|     33|            match = base;
 3573|     33|            if (op > oend_w || sequence.matchLength < MINMATCH) {
  ------------------
  |  | 2670|     33|#define MINMATCH 3
  ------------------
  |  Branch (3573:17): [True: 0, False: 33]
  |  Branch (3573:32): [True: 17, False: 16]
  ------------------
 3574|     47|              while (op < oMatchEnd) *op++ = *match++;
  ------------------
  |  Branch (3574:22): [True: 30, False: 17]
  ------------------
 3575|     17|              return sequenceLength;
 3576|     17|            }
 3577|     33|    }   }
 3578|       |    /* Requirement: op <= oend_w */
 3579|       |
 3580|       |    /* match within prefix */
 3581|  79.1k|    if (sequence.offset < 8) {
  ------------------
  |  Branch (3581:9): [True: 77.4k, False: 1.65k]
  ------------------
 3582|       |        /* close range match, overlap */
 3583|  77.4k|        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
 3584|  77.4k|        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
 3585|  77.4k|        int const sub2 = dec64table[sequence.offset];
 3586|  77.4k|        op[0] = match[0];
 3587|  77.4k|        op[1] = match[1];
 3588|  77.4k|        op[2] = match[2];
 3589|  77.4k|        op[3] = match[3];
 3590|  77.4k|        match += dec32table[sequence.offset];
 3591|  77.4k|        ZSTDv07_copy4(op+4, match);
 3592|  77.4k|        match -= sub2;
 3593|  77.4k|    } else {
 3594|  1.65k|        ZSTDv07_copy8(op, match);
 3595|  1.65k|    }
 3596|  79.1k|    op += 8; match += 8;
 3597|       |
 3598|  79.1k|    if (oMatchEnd > oend-(16-MINMATCH)) {
  ------------------
  |  | 2670|  79.1k|#define MINMATCH 3
  ------------------
  |  Branch (3598:9): [True: 39, False: 79.1k]
  ------------------
 3599|     39|        if (op < oend_w) {
  ------------------
  |  Branch (3599:13): [True: 29, False: 10]
  ------------------
 3600|     29|            ZSTDv07_wildcopy(op, match, oend_w - op);
 3601|     29|            match += oend_w - op;
 3602|     29|            op = oend_w;
 3603|     29|        }
 3604|    133|        while (op < oMatchEnd) *op++ = *match++;
  ------------------
  |  Branch (3604:16): [True: 94, False: 39]
  ------------------
 3605|  79.1k|    } else {
 3606|  79.1k|        ZSTDv07_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8);   /* works even if matchLength < 8 */
 3607|  79.1k|    }
 3608|  79.1k|    return sequenceLength;
 3609|  79.2k|}
zstd_v07.c:ZSTDv07_wildcopy:
 2723|   158k|{
 2724|   158k|    const BYTE* ip = (const BYTE*)src;
 2725|   158k|    BYTE* op = (BYTE*)dst;
 2726|   158k|    BYTE* const oend = op + length;
 2727|   158k|    do
 2728|  1.02M|        COPY8(op, ip)
  ------------------
  |  | 2717|  1.02M|#define COPY8(d,s) { ZSTDv07_copy8(d,s); d+=8; s+=8; }
  ------------------
 2729|  1.02M|    while (op < oend);
  ------------------
  |  Branch (2729:12): [True: 864k, False: 158k]
  ------------------
 2730|   158k|}
zstd_v07.c:ZSTDv07_copy4:
 2864|  77.4k|static void ZSTDv07_copy4(void* dst, const void* src) { memcpy(dst, src, 4); }
zstd_v07.c:ZSTDv07_copy8:
 2716|  1.02M|static void ZSTDv07_copy8(void* dst, const void* src) { memcpy(dst, src, 8); }
zstd_v07.c:ZSTDv07_decompressFrame:
 3743|  1.01k|{
 3744|  1.01k|    const BYTE* ip = (const BYTE*)src;
 3745|  1.01k|    const BYTE* const iend = ip + srcSize;
 3746|  1.01k|    BYTE* const ostart = (BYTE*)dst;
 3747|  1.01k|    BYTE* const oend = ostart + dstCapacity;
 3748|  1.01k|    BYTE* op = ostart;
 3749|  1.01k|    size_t remainingSize = srcSize;
 3750|       |
 3751|       |    /* check */
 3752|  1.01k|    if (srcSize < ZSTDv07_frameHeaderSize_min+ZSTDv07_blockHeaderSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3752:9): [True: 0, False: 1.01k]
  ------------------
 3753|       |
 3754|       |    /* Frame Header */
 3755|  1.01k|    {   size_t const frameHeaderSize = ZSTDv07_frameHeaderSize(src, ZSTDv07_frameHeaderSize_min);
 3756|  1.01k|        if (ZSTDv07_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  | 2856|  1.01k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3756:13): [True: 0, False: 1.01k]
  ------------------
 3757|  1.01k|        if (srcSize < frameHeaderSize+ZSTDv07_blockHeaderSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3757:13): [True: 0, False: 1.01k]
  ------------------
 3758|  1.01k|        if (ZSTDv07_decodeFrameHeader(dctx, src, frameHeaderSize)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     74|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     74|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     74|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3758:13): [True: 74, False: 941]
  ------------------
 3759|    941|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3760|    941|    }
 3761|       |
 3762|       |    /* Loop on each block */
 3763|  1.82k|    while (1) {
  ------------------
  |  Branch (3763:12): [True: 1.82k, Folded]
  ------------------
 3764|  1.82k|        size_t decodedSize;
 3765|  1.82k|        blockProperties_t blockProperties;
 3766|  1.82k|        size_t const cBlockSize = ZSTDv07_getcBlockSize(ip, iend-ip, &blockProperties);
 3767|  1.82k|        if (ZSTDv07_isError(cBlockSize)) return cBlockSize;
  ------------------
  |  | 2856|  1.82k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3767:13): [True: 0, False: 1.82k]
  ------------------
 3768|       |
 3769|  1.82k|        ip += ZSTDv07_blockHeaderSize;
 3770|  1.82k|        remainingSize -= ZSTDv07_blockHeaderSize;
 3771|  1.82k|        if (cBlockSize > remainingSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3771:13): [True: 0, False: 1.82k]
  ------------------
 3772|       |
 3773|  1.82k|        switch(blockProperties.blockType)
 3774|  1.82k|        {
 3775|    869|        case bt_compressed:
  ------------------
  |  Branch (3775:9): [True: 869, False: 953]
  ------------------
 3776|    869|            decodedSize = ZSTDv07_decompressBlock_internal(dctx, op, oend-op, ip, cBlockSize);
 3777|    869|            break;
 3778|     13|        case bt_raw :
  ------------------
  |  Branch (3778:9): [True: 13, False: 1.80k]
  ------------------
 3779|     13|            decodedSize = ZSTDv07_copyRawBlock(op, oend-op, ip, cBlockSize);
 3780|     13|            break;
 3781|    804|        case bt_rle :
  ------------------
  |  Branch (3781:9): [True: 804, False: 1.01k]
  ------------------
 3782|    804|            decodedSize = ZSTDv07_generateNxBytes(op, oend-op, *ip, blockProperties.origSize);
 3783|    804|            break;
 3784|    136|        case bt_end :
  ------------------
  |  Branch (3784:9): [True: 136, False: 1.68k]
  ------------------
 3785|       |            /* end of frame */
 3786|    136|            if (remainingSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3786:17): [True: 0, False: 136]
  ------------------
 3787|    136|            decodedSize = 0;
 3788|    136|            break;
 3789|      0|        default:
  ------------------
  |  Branch (3789:9): [True: 0, False: 1.82k]
  ------------------
 3790|      0|            return ERROR(GENERIC);   /* impossible */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3791|  1.82k|        }
 3792|  1.82k|        if (blockProperties.blockType == bt_end) break;   /* bt_end */
  ------------------
  |  Branch (3792:13): [True: 136, False: 1.68k]
  ------------------
 3793|       |
 3794|  1.68k|        if (ZSTDv07_isError(decodedSize)) return decodedSize;
  ------------------
  |  | 2856|  1.68k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3794:13): [True: 805, False: 881]
  ------------------
 3795|    881|        if (dctx->fParams.checksumFlag) XXH64_update(&dctx->xxhState, op, decodedSize);
  ------------------
  |  |  460|     69|#  define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update)
  |  |  ------------------
  |  |  |  |  443|     69|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|     69|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3795:13): [True: 69, False: 812]
  ------------------
 3796|    881|        op += decodedSize;
 3797|    881|        ip += cBlockSize;
 3798|    881|        remainingSize -= cBlockSize;
 3799|    881|    }
 3800|       |
 3801|    136|    return op-ostart;
 3802|    941|}
zstd_v07.c:ZSTDv07_generateNxBytes:
 3729|    804|{
 3730|    804|    if (length > dstCapacity) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      5|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      5|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      5|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3730:9): [True: 5, False: 799]
  ------------------
 3731|    799|    if (length > 0) {
  ------------------
  |  Branch (3731:9): [True: 759, False: 40]
  ------------------
 3732|    759|        memset(dst, byte, length);
 3733|    759|    }
 3734|    799|    return length;
 3735|    804|}
zstd_v07.c:ZSTD_errorFrameSizeInfoLegacy:
 3855|     17|{
 3856|     17|    *cSize = ret;
 3857|     17|    *dBound = ZSTD_CONTENTSIZE_ERROR;
  ------------------
  |  | 2688|     17|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
 3858|     17|}
zstd_v07.c:ZSTDv07_getcBlockSize:
 3201|  4.88k|{
 3202|  4.88k|    const BYTE* const in = (const BYTE*)src;
 3203|  4.88k|    U32 cSize;
 3204|       |
 3205|  4.88k|    if (srcSize < ZSTDv07_blockHeaderSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3205:9): [True: 2, False: 4.87k]
  ------------------
 3206|       |
 3207|  4.87k|    bpPtr->blockType = (blockType_t)((*in) >> 6);
 3208|  4.87k|    cSize = in[2] + (in[1]<<8) + ((in[0] & 7)<<16);
 3209|  4.87k|    bpPtr->origSize = (bpPtr->blockType == bt_rle) ? cSize : 0;
  ------------------
  |  Branch (3209:23): [True: 1.78k, False: 3.09k]
  ------------------
 3210|       |
 3211|  4.87k|    if (bpPtr->blockType == bt_end) return 0;
  ------------------
  |  Branch (3211:9): [True: 1.15k, False: 3.72k]
  ------------------
 3212|  3.72k|    if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (3212:9): [True: 1.78k, False: 1.94k]
  ------------------
 3213|  1.94k|    return cSize;
 3214|  3.72k|}
zstd_v07.c:ZSTDv07_decodeFrameHeader:
 3184|  1.01k|{
 3185|  1.01k|    size_t const result = ZSTDv07_getFrameParams(&(dctx->fParams), src, srcSize);
 3186|  1.01k|    if (dctx->fParams.dictID && (dctx->dictID != dctx->fParams.dictID)) return ERROR(dictionary_wrong);
  ------------------
  |  |   49|     46|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     46|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     46|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3186:9): [True: 46, False: 969]
  |  Branch (3186:33): [True: 46, False: 0]
  ------------------
 3187|    969|    if (dctx->fParams.checksumFlag) XXH64_reset(&dctx->xxhState, 0);
  ------------------
  |  |  459|     87|#  define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset)
  |  |  ------------------
  |  |  |  |  443|     87|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|     87|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3187:9): [True: 87, False: 882]
  ------------------
 3188|    969|    return result;
 3189|  1.01k|}
zstd_v07.c:ZSTDv07_copyRawBlock:
 3218|     13|{
 3219|     13|    if (srcSize > dstCapacity) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3219:9): [True: 0, False: 13]
  ------------------
 3220|     13|    if (srcSize > 0) {
  ------------------
  |  Branch (3220:9): [True: 8, False: 5]
  ------------------
 3221|      8|        memcpy(dst, src, srcSize);
 3222|      8|    }
 3223|     13|    return srcSize;
 3224|     13|}
zstd_v07.c:ZSTDv07_decompress_insertDictionary:
 4092|     42|{
 4093|     42|    if (dictSize < 8) return ZSTDv07_refDictContent(dctx, dict, dictSize);
  ------------------
  |  Branch (4093:9): [True: 2, False: 40]
  ------------------
 4094|     40|    {   U32 const magic = MEM_readLE32(dict);
 4095|     40|        if (magic != ZSTDv07_DICT_MAGIC) {
  ------------------
  |  | 2636|     40|#define ZSTDv07_DICT_MAGIC  0xEC30A437   /* v0.7 */
  ------------------
  |  Branch (4095:13): [True: 40, False: 0]
  ------------------
 4096|     40|            return ZSTDv07_refDictContent(dctx, dict, dictSize);   /* pure content mode */
 4097|     40|    }   }
 4098|      0|    dctx->dictID = MEM_readLE32((const char*)dict + 4);
 4099|       |
 4100|       |    /* load entropy tables */
 4101|      0|    dict = (const char*)dict + 8;
 4102|      0|    dictSize -= 8;
 4103|      0|    {   size_t const eSize = ZSTDv07_loadEntropy(dctx, dict, dictSize);
 4104|      0|        if (ZSTDv07_isError(eSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2856|      0|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
                      if (ZSTDv07_isError(eSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4104:13): [True: 0, False: 0]
  ------------------
 4105|      0|        dict = (const char*)dict + eSize;
 4106|      0|        dictSize -= eSize;
 4107|      0|    }
 4108|       |
 4109|       |    /* reference dictionary content */
 4110|      0|    return ZSTDv07_refDictContent(dctx, dict, dictSize);
 4111|      0|}
zstd_v07.c:ZSTDv07_refDictContent:
 4033|     42|{
 4034|     42|    dctx->dictEnd = dctx->previousDstEnd;
 4035|     42|    dctx->vBase = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 4036|     42|    dctx->base = dict;
 4037|     42|    dctx->previousDstEnd = (const char*)dict + dictSize;
 4038|     42|    return 0;
 4039|     42|}

bshuf_trans_byte_bitrow_AVX:
  117|  48.2k|                                    const size_t elem_size) {
  118|       |
  119|  48.2k|  size_t hh, ii, jj, kk, mm;
  120|  48.2k|  const char* in_b = (const char*) in;
  121|  48.2k|  char* out_b = (char*) out;
  122|       |
  123|  48.2k|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|  48.2k|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 48.2k]
  |  |  ------------------
  ------------------
  124|       |
  125|  48.2k|  size_t nrows = 8 * elem_size;
  126|  48.2k|  size_t nbyte_row = size / 8;
  127|       |
  128|  48.2k|  if (elem_size % 4) return bshuf_trans_byte_bitrow_SSE(in, out, size,
  ------------------
  |  Branch (128:7): [True: 31.5k, False: 16.6k]
  ------------------
  129|  31.5k|                                                        elem_size);
  130|       |
  131|  16.6k|  __m256i ymm_0[8];
  132|  16.6k|  __m256i ymm_1[8];
  133|  16.6k|  __m256i ymm_storeage[8][4];
  134|       |
  135|  5.93M|  for (jj = 0; jj + 31 < nbyte_row; jj += 32) {
  ------------------
  |  Branch (135:16): [True: 5.91M, False: 16.6k]
  ------------------
  136|  20.7M|    for (ii = 0; ii + 3 < elem_size; ii += 4) {
  ------------------
  |  Branch (136:18): [True: 14.8M, False: 5.91M]
  ------------------
  137|  74.3M|      for (hh = 0; hh < 4; hh ++) {
  ------------------
  |  Branch (137:20): [True: 59.4M, False: 14.8M]
  ------------------
  138|       |
  139|   535M|        for (kk = 0; kk < 8; kk ++){
  ------------------
  |  Branch (139:22): [True: 475M, False: 59.4M]
  ------------------
  140|   475M|          ymm_0[kk] = _mm256_loadu_si256((__m256i *) &in_b[
  141|   475M|              (ii * 8 + hh * 8 + kk) * nbyte_row + jj]);
  142|   475M|        }
  143|       |
  144|   297M|        for (kk = 0; kk < 4; kk ++){
  ------------------
  |  Branch (144:22): [True: 237M, False: 59.4M]
  ------------------
  145|   237M|          ymm_1[kk] = _mm256_unpacklo_epi8(ymm_0[kk * 2],
  146|   237M|                                           ymm_0[kk * 2 + 1]);
  147|   237M|          ymm_1[kk + 4] = _mm256_unpackhi_epi8(ymm_0[kk * 2],
  148|   237M|                                               ymm_0[kk * 2 + 1]);
  149|   237M|        }
  150|       |
  151|   178M|        for (kk = 0; kk < 2; kk ++){
  ------------------
  |  Branch (151:22): [True: 118M, False: 59.4M]
  ------------------
  152|   356M|          for (mm = 0; mm < 2; mm ++){
  ------------------
  |  Branch (152:24): [True: 237M, False: 118M]
  ------------------
  153|   237M|            ymm_0[kk * 4 + mm] = _mm256_unpacklo_epi16(
  154|   237M|                ymm_1[kk * 4 + mm * 2],
  155|   237M|                ymm_1[kk * 4 + mm * 2 + 1]);
  156|   237M|            ymm_0[kk * 4 + mm + 2] = _mm256_unpackhi_epi16(
  157|   237M|                ymm_1[kk * 4 + mm * 2],
  158|   237M|                ymm_1[kk * 4 + mm * 2 + 1]);
  159|   237M|          }
  160|   118M|        }
  161|       |
  162|   297M|        for (kk = 0; kk < 4; kk ++){
  ------------------
  |  Branch (162:22): [True: 237M, False: 59.4M]
  ------------------
  163|   237M|          ymm_1[kk * 2] = _mm256_unpacklo_epi32(ymm_0[kk * 2],
  164|   237M|                                                ymm_0[kk * 2 + 1]);
  165|   237M|          ymm_1[kk * 2 + 1] = _mm256_unpackhi_epi32(ymm_0[kk * 2],
  166|   237M|                                                    ymm_0[kk * 2 + 1]);
  167|   237M|        }
  168|       |
  169|   535M|        for (kk = 0; kk < 8; kk ++){
  ------------------
  |  Branch (169:22): [True: 475M, False: 59.4M]
  ------------------
  170|   475M|          ymm_storeage[kk][hh] = ymm_1[kk];
  171|   475M|        }
  172|  59.4M|      }
  173|       |
  174|   133M|      for (mm = 0; mm < 8; mm ++) {
  ------------------
  |  Branch (174:20): [True: 118M, False: 14.8M]
  ------------------
  175|       |
  176|   594M|        for (kk = 0; kk < 4; kk ++){
  ------------------
  |  Branch (176:22): [True: 475M, False: 118M]
  ------------------
  177|   475M|          ymm_0[kk] = ymm_storeage[mm][kk];
  178|   475M|        }
  179|       |
  180|   118M|        ymm_1[0] = _mm256_unpacklo_epi64(ymm_0[0], ymm_0[1]);
  181|   118M|        ymm_1[1] = _mm256_unpacklo_epi64(ymm_0[2], ymm_0[3]);
  182|   118M|        ymm_1[2] = _mm256_unpackhi_epi64(ymm_0[0], ymm_0[1]);
  183|   118M|        ymm_1[3] = _mm256_unpackhi_epi64(ymm_0[2], ymm_0[3]);
  184|       |
  185|   118M|        ymm_0[0] = _mm256_permute2x128_si256(ymm_1[0], ymm_1[1], 32);
  186|   118M|        ymm_0[1] = _mm256_permute2x128_si256(ymm_1[2], ymm_1[3], 32);
  187|   118M|        ymm_0[2] = _mm256_permute2x128_si256(ymm_1[0], ymm_1[1], 49);
  188|   118M|        ymm_0[3] = _mm256_permute2x128_si256(ymm_1[2], ymm_1[3], 49);
  189|       |
  190|   118M|        _mm256_storeu_si256((__m256i *) &out_b[
  191|   118M|            (jj + mm * 2 + 0 * 16) * nrows + ii * 8], ymm_0[0]);
  192|   118M|        _mm256_storeu_si256((__m256i *) &out_b[
  193|   118M|            (jj + mm * 2 + 0 * 16 + 1) * nrows + ii * 8], ymm_0[1]);
  194|   118M|        _mm256_storeu_si256((__m256i *) &out_b[
  195|   118M|            (jj + mm * 2 + 1 * 16) * nrows + ii * 8], ymm_0[2]);
  196|   118M|        _mm256_storeu_si256((__m256i *) &out_b[
  197|   118M|            (jj + mm * 2 + 1 * 16 + 1) * nrows + ii * 8], ymm_0[3]);
  198|   118M|      }
  199|  14.8M|    }
  200|  5.91M|  }
  201|  1.16M|  for (ii = 0; ii < nrows; ii ++ ) {
  ------------------
  |  Branch (201:16): [True: 1.14M, False: 16.6k]
  ------------------
  202|  18.6M|    for (jj = nbyte_row - nbyte_row % 32; jj < nbyte_row; jj ++) {
  ------------------
  |  Branch (202:43): [True: 17.4M, False: 1.14M]
  ------------------
  203|  17.4M|      out_b[jj * nrows + ii] = in_b[ii * nbyte_row + jj];
  204|  17.4M|    }
  205|  1.14M|  }
  206|  16.6k|  return size * elem_size;
  207|  48.2k|}
bshuf_shuffle_bit_eightelem_AVX:
  212|  48.2k|                                        const size_t elem_size) {
  213|       |
  214|  48.2k|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|  48.2k|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 48.2k]
  |  |  ------------------
  ------------------
  215|       |
  216|       |  // With a bit of care, this could be written such that such that it is
  217|       |  // in_buf = out_buf safe.
  218|  48.2k|  const char* in_b = (const char*) in;
  219|  48.2k|  char* out_b = (char*) out;
  220|       |
  221|  48.2k|  size_t ii, jj, kk;
  222|  48.2k|  size_t nbyte = elem_size * size;
  223|       |
  224|  48.2k|  __m256i ymm;
  225|  48.2k|  int32_t bt;
  226|       |
  227|  48.2k|  if (elem_size % 4) {
  ------------------
  |  Branch (227:7): [True: 31.5k, False: 16.6k]
  ------------------
  228|  31.5k|    return bshuf_shuffle_bit_eightelem_SSE(in, out, size, elem_size);
  229|  31.5k|  } else {
  230|  52.4k|    for (jj = 0; jj + 31 < 8 * elem_size; jj += 32) {
  ------------------
  |  Branch (230:18): [True: 35.7k, False: 16.6k]
  ------------------
  231|   476M|      for (ii = 0; ii + 8 * elem_size - 1 < nbyte;
  ------------------
  |  Branch (231:20): [True: 476M, False: 35.7k]
  ------------------
  232|   476M|           ii += 8 * elem_size) {
  233|   476M|        ymm = _mm256_loadu_si256((__m256i *) &in_b[ii + jj]);
  234|  4.28G|        for (kk = 0; kk < 8; kk++) {
  ------------------
  |  Branch (234:22): [True: 3.81G, False: 476M]
  ------------------
  235|  3.81G|          bt = _mm256_movemask_epi8(ymm);
  236|  3.81G|          ymm = _mm256_slli_epi16(ymm, 1);
  237|  3.81G|          size_t ind = (ii + jj / 8 + (7 - kk) * elem_size);
  238|  3.81G|          * (int32_t *) &out_b[ind] = bt;
  239|  3.81G|        }
  240|   476M|      }
  241|  35.7k|    }
  242|  16.6k|  }
  243|  16.6k|  return size * elem_size;
  244|  48.2k|}
bshuf_untrans_bit_elem_AVX:
  249|  48.2k|                                   const size_t elem_size) {
  250|       |
  251|  48.2k|  int64_t count;
  252|       |
  253|  48.2k|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|  48.2k|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 48.2k]
  |  |  ------------------
  ------------------
  254|       |
  255|  48.2k|  void* tmp_buf = malloc(size * elem_size);
  256|  48.2k|  if (tmp_buf == NULL) return -1;
  ------------------
  |  Branch (256:7): [True: 0, False: 48.2k]
  ------------------
  257|       |
  258|  48.2k|  count = bshuf_trans_byte_bitrow_AVX(in, tmp_buf, size, elem_size);
  259|  48.2k|  CHECK_ERR_FREE(count, tmp_buf);
  ------------------
  |  |   45|  48.2k|#define CHECK_ERR_FREE(count, buf) if (count < 0) { free(buf); return count; }
  |  |  ------------------
  |  |  |  Branch (45:40): [True: 0, False: 48.2k]
  |  |  ------------------
  ------------------
  260|  48.2k|  count =  bshuf_shuffle_bit_eightelem_AVX(tmp_buf, out, size, elem_size);
  261|       |
  262|  48.2k|  free(tmp_buf);
  263|  48.2k|  return count;
  264|  48.2k|}

bshuf_shuffle_bit_eightelem_scal:
  200|  15.9k|        const size_t size, const size_t elem_size) {
  201|       |
  202|  15.9k|  const char *in_b;
  203|  15.9k|  char *out_b;
  204|  15.9k|  uint64_t x, t;
  205|  15.9k|  size_t ii, jj, kk;
  206|  15.9k|  size_t nbyte, out_index;
  207|       |
  208|  15.9k|  uint64_t e=1;
  209|  15.9k|  const int little_endian = *(uint8_t *) &e == 1;
  210|  15.9k|  const size_t elem_skip = little_endian ? elem_size : -elem_size;
  ------------------
  |  Branch (210:28): [True: 15.9k, False: 0]
  ------------------
  211|  15.9k|  const uint64_t elem_offset = little_endian ? 0 : 7 * elem_size;
  ------------------
  |  Branch (211:32): [True: 15.9k, False: 0]
  ------------------
  212|       |
  213|  15.9k|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|  15.9k|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 15.9k]
  |  |  ------------------
  ------------------
  214|       |
  215|  15.9k|  in_b = (const char*) in;
  216|  15.9k|  out_b = (char*) out;
  217|       |
  218|  15.9k|  nbyte = elem_size * size;
  219|       |
  220|   132k|  for (jj = 0; jj < 8 * elem_size; jj += 8) {
  ------------------
  |  Branch (220:16): [True: 116k, False: 15.9k]
  ------------------
  221|   464M|    for (ii = 0; ii + 8 * elem_size - 1 < nbyte; ii += 8 * elem_size) {
  ------------------
  |  Branch (221:18): [True: 464M, False: 116k]
  ------------------
  222|   464M|      x = *((uint64_t*) &in_b[ii + jj]);
  223|   464M|      if (little_endian) {
  ------------------
  |  Branch (223:11): [True: 464M, False: 0]
  ------------------
  224|   464M|        TRANS_BIT_8X8(x, t);
  ------------------
  |  |   56|   464M|#define TRANS_BIT_8X8(x, t) {                                               \
  |  |   57|   464M|        t = (x ^ (x >> 7)) & 0x00AA00AA00AA00AALL;                          \
  |  |   58|   464M|        x = x ^ t ^ (t << 7);                                               \
  |  |   59|   464M|        t = (x ^ (x >> 14)) & 0x0000CCCC0000CCCCLL;                         \
  |  |   60|   464M|        x = x ^ t ^ (t << 14);                                              \
  |  |   61|   464M|        t = (x ^ (x >> 28)) & 0x00000000F0F0F0F0LL;                         \
  |  |   62|   464M|        x = x ^ t ^ (t << 28);                                              \
  |  |   63|   464M|    }
  ------------------
  225|   464M|      } else {
  226|      0|        TRANS_BIT_8X8_BE(x, t);
  ------------------
  |  |   67|      0|#define TRANS_BIT_8X8_BE(x, t) {                                            \
  |  |   68|      0|        t = (x ^ (x >> 9)) & 0x0055005500550055LL;                          \
  |  |   69|      0|        x = x ^ t ^ (t << 9);                                               \
  |  |   70|      0|        t = (x ^ (x >> 18)) & 0x0000333300003333LL;                         \
  |  |   71|      0|        x = x ^ t ^ (t << 18);                                              \
  |  |   72|      0|        t = (x ^ (x >> 36)) & 0x000000000F0F0F0FLL;                         \
  |  |   73|      0|        x = x ^ t ^ (t << 36);                                              \
  |  |   74|      0|    }
  ------------------
  227|      0|      }
  228|  4.17G|      for (kk = 0; kk < 8; kk++) {
  ------------------
  |  Branch (228:20): [True: 3.71G, False: 464M]
  ------------------
  229|  3.71G|        out_index = ii + jj / 8 + elem_offset + kk * elem_skip;
  230|  3.71G|        *((uint8_t*) &out_b[out_index]) = x;
  231|  3.71G|        x = x >> 8;
  232|  3.71G|      }
  233|   464M|    }
  234|   116k|  }
  235|  15.9k|  return size * elem_size;
  236|  15.9k|}

bshuf_trans_byte_bitrow_SSE:
  324|  31.5k|                                    const size_t elem_size) {
  325|       |
  326|  31.5k|  size_t ii, jj;
  327|  31.5k|  const char* in_b = (const char*) in;
  328|  31.5k|  char* out_b = (char*) out;
  329|       |
  330|  31.5k|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|  31.5k|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 31.5k]
  |  |  ------------------
  ------------------
  331|       |
  332|  31.5k|  size_t nrows = 8 * elem_size;
  333|  31.5k|  size_t nbyte_row = size / 8;
  334|       |
  335|  31.5k|  __m128i a0, b0, c0, d0, e0, f0, g0, h0;
  336|  31.5k|  __m128i a1, b1, c1, d1, e1, f1, g1, h1;
  337|  31.5k|  __m128 *as, *bs, *cs, *ds, *es, *fs, *gs, *hs;
  338|       |
  339|   245k|  for (ii = 0; ii + 7 < nrows; ii += 8) {
  ------------------
  |  Branch (339:16): [True: 214k, False: 31.5k]
  ------------------
  340|  58.7M|    for (jj = 0; jj + 15 < nbyte_row; jj += 16) {
  ------------------
  |  Branch (340:18): [True: 58.5M, False: 214k]
  ------------------
  341|  58.5M|      a0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 0)*nbyte_row + jj]);
  342|  58.5M|      b0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 1)*nbyte_row + jj]);
  343|  58.5M|      c0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 2)*nbyte_row + jj]);
  344|  58.5M|      d0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 3)*nbyte_row + jj]);
  345|  58.5M|      e0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 4)*nbyte_row + jj]);
  346|  58.5M|      f0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 5)*nbyte_row + jj]);
  347|  58.5M|      g0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 6)*nbyte_row + jj]);
  348|  58.5M|      h0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 7)*nbyte_row + jj]);
  349|       |
  350|       |
  351|  58.5M|      a1 = _mm_unpacklo_epi8(a0, b0);
  352|  58.5M|      b1 = _mm_unpacklo_epi8(c0, d0);
  353|  58.5M|      c1 = _mm_unpacklo_epi8(e0, f0);
  354|  58.5M|      d1 = _mm_unpacklo_epi8(g0, h0);
  355|  58.5M|      e1 = _mm_unpackhi_epi8(a0, b0);
  356|  58.5M|      f1 = _mm_unpackhi_epi8(c0, d0);
  357|  58.5M|      g1 = _mm_unpackhi_epi8(e0, f0);
  358|  58.5M|      h1 = _mm_unpackhi_epi8(g0, h0);
  359|       |
  360|       |
  361|  58.5M|      a0 = _mm_unpacklo_epi16(a1, b1);
  362|  58.5M|      b0 = _mm_unpacklo_epi16(c1, d1);
  363|  58.5M|      c0 = _mm_unpackhi_epi16(a1, b1);
  364|  58.5M|      d0 = _mm_unpackhi_epi16(c1, d1);
  365|       |
  366|  58.5M|      e0 = _mm_unpacklo_epi16(e1, f1);
  367|  58.5M|      f0 = _mm_unpacklo_epi16(g1, h1);
  368|  58.5M|      g0 = _mm_unpackhi_epi16(e1, f1);
  369|  58.5M|      h0 = _mm_unpackhi_epi16(g1, h1);
  370|       |
  371|       |
  372|  58.5M|      a1 = _mm_unpacklo_epi32(a0, b0);
  373|  58.5M|      b1 = _mm_unpackhi_epi32(a0, b0);
  374|       |
  375|  58.5M|      c1 = _mm_unpacklo_epi32(c0, d0);
  376|  58.5M|      d1 = _mm_unpackhi_epi32(c0, d0);
  377|       |
  378|  58.5M|      e1 = _mm_unpacklo_epi32(e0, f0);
  379|  58.5M|      f1 = _mm_unpackhi_epi32(e0, f0);
  380|       |
  381|  58.5M|      g1 = _mm_unpacklo_epi32(g0, h0);
  382|  58.5M|      h1 = _mm_unpackhi_epi32(g0, h0);
  383|       |
  384|       |      // We don't have a storeh instruction for integers, so interpret
  385|       |      // as a float. Have a storel (_mm_storel_epi64).
  386|  58.5M|      as = (__m128 *) &a1;
  387|  58.5M|      bs = (__m128 *) &b1;
  388|  58.5M|      cs = (__m128 *) &c1;
  389|  58.5M|      ds = (__m128 *) &d1;
  390|  58.5M|      es = (__m128 *) &e1;
  391|  58.5M|      fs = (__m128 *) &f1;
  392|  58.5M|      gs = (__m128 *) &g1;
  393|  58.5M|      hs = (__m128 *) &h1;
  394|       |
  395|  58.5M|      _mm_storel_pi((__m64 *) &out_b[(jj + 0) * nrows + ii], *as);
  396|  58.5M|      _mm_storel_pi((__m64 *) &out_b[(jj + 2) * nrows + ii], *bs);
  397|  58.5M|      _mm_storel_pi((__m64 *) &out_b[(jj + 4) * nrows + ii], *cs);
  398|  58.5M|      _mm_storel_pi((__m64 *) &out_b[(jj + 6) * nrows + ii], *ds);
  399|  58.5M|      _mm_storel_pi((__m64 *) &out_b[(jj + 8) * nrows + ii], *es);
  400|  58.5M|      _mm_storel_pi((__m64 *) &out_b[(jj + 10) * nrows + ii], *fs);
  401|  58.5M|      _mm_storel_pi((__m64 *) &out_b[(jj + 12) * nrows + ii], *gs);
  402|  58.5M|      _mm_storel_pi((__m64 *) &out_b[(jj + 14) * nrows + ii], *hs);
  403|       |
  404|  58.5M|      _mm_storeh_pi((__m64 *) &out_b[(jj + 1) * nrows + ii], *as);
  405|  58.5M|      _mm_storeh_pi((__m64 *) &out_b[(jj + 3) * nrows + ii], *bs);
  406|  58.5M|      _mm_storeh_pi((__m64 *) &out_b[(jj + 5) * nrows + ii], *cs);
  407|  58.5M|      _mm_storeh_pi((__m64 *) &out_b[(jj + 7) * nrows + ii], *ds);
  408|  58.5M|      _mm_storeh_pi((__m64 *) &out_b[(jj + 9) * nrows + ii], *es);
  409|  58.5M|      _mm_storeh_pi((__m64 *) &out_b[(jj + 11) * nrows + ii], *fs);
  410|  58.5M|      _mm_storeh_pi((__m64 *) &out_b[(jj + 13) * nrows + ii], *gs);
  411|  58.5M|      _mm_storeh_pi((__m64 *) &out_b[(jj + 15) * nrows + ii], *hs);
  412|  58.5M|    }
  413|  2.06M|    for (jj = nbyte_row - nbyte_row % 16; jj < nbyte_row; jj ++) {
  ------------------
  |  Branch (413:43): [True: 1.85M, False: 214k]
  ------------------
  414|  1.85M|      out_b[jj * nrows + ii + 0] = in_b[(ii + 0)*nbyte_row + jj];
  415|  1.85M|      out_b[jj * nrows + ii + 1] = in_b[(ii + 1)*nbyte_row + jj];
  416|  1.85M|      out_b[jj * nrows + ii + 2] = in_b[(ii + 2)*nbyte_row + jj];
  417|  1.85M|      out_b[jj * nrows + ii + 3] = in_b[(ii + 3)*nbyte_row + jj];
  418|  1.85M|      out_b[jj * nrows + ii + 4] = in_b[(ii + 4)*nbyte_row + jj];
  419|  1.85M|      out_b[jj * nrows + ii + 5] = in_b[(ii + 5)*nbyte_row + jj];
  420|  1.85M|      out_b[jj * nrows + ii + 6] = in_b[(ii + 6)*nbyte_row + jj];
  421|  1.85M|      out_b[jj * nrows + ii + 7] = in_b[(ii + 7)*nbyte_row + jj];
  422|  1.85M|    }
  423|   214k|  }
  424|  31.5k|  return size * elem_size;
  425|  31.5k|}
bshuf_shuffle_bit_eightelem_SSE:
  430|  31.5k|                                        const size_t elem_size) {
  431|       |
  432|  31.5k|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|  31.5k|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 31.5k]
  |  |  ------------------
  ------------------
  433|       |
  434|       |  // With a bit of care, this could be written such that such that it is
  435|       |  // in_buf = out_buf safe.
  436|  31.5k|  const char* in_b = (const char*) in;
  437|  31.5k|  uint16_t* out_ui16 = (uint16_t*) out;
  438|       |
  439|  31.5k|  size_t ii, jj, kk;
  440|  31.5k|  size_t nbyte = elem_size * size;
  441|       |
  442|  31.5k|  __m128i xmm;
  443|  31.5k|  int32_t bt;
  444|       |
  445|  31.5k|  if (elem_size % 2) {
  ------------------
  |  Branch (445:7): [True: 15.9k, False: 15.5k]
  ------------------
  446|  15.9k|    bshuf_shuffle_bit_eightelem_scal(in, out, size, elem_size);
  447|  15.9k|  } else {
  448|   113M|    for (ii = 0; ii + 8 * elem_size - 1 < nbyte;
  ------------------
  |  Branch (448:18): [True: 113M, False: 15.5k]
  ------------------
  449|   113M|         ii += 8 * elem_size) {
  450|   350M|      for (jj = 0; jj + 15 < 8 * elem_size; jj += 16) {
  ------------------
  |  Branch (450:20): [True: 237M, False: 113M]
  ------------------
  451|   237M|        xmm = _mm_loadu_si128((__m128i *) &in_b[ii + jj]);
  452|  2.13G|        for (kk = 0; kk < 8; kk++) {
  ------------------
  |  Branch (452:22): [True: 1.89G, False: 237M]
  ------------------
  453|  1.89G|          bt = _mm_movemask_epi8(xmm);
  454|  1.89G|          xmm = _mm_slli_epi16(xmm, 1);
  455|  1.89G|          size_t ind = (ii + jj / 8 + (7 - kk) * elem_size);
  456|  1.89G|          out_ui16[ind / 2] = bt;
  457|  1.89G|        }
  458|   237M|      }
  459|   113M|    }
  460|  15.5k|  }
  461|  31.5k|  return size * elem_size;
  462|  31.5k|}

blosc2.c:is_little_endian:
   42|  47.6M|static bool is_little_endian(void) {
   43|  47.6M|  static const int i = 1;
   44|  47.6M|  char* p = (char*)&i;
   45|       |
   46|  47.6M|  if (p[0] == 1) {
  ------------------
  |  Branch (46:7): [True: 47.6M, False: 0]
  ------------------
   47|  47.6M|    return true;
   48|  47.6M|  }
   49|      0|  else {
   50|       |    return false;
   51|      0|  }
   52|  47.6M|}
blosc2.c:load_lib:
  317|      5|static inline void* load_lib(char *plugin_name, char *libpath) {
  318|      5|  if (!blosc2_valid_plugin_name(plugin_name)) {
  ------------------
  |  Branch (318:7): [True: 0, False: 5]
  ------------------
  319|      0|    BLOSC_TRACE_ERROR("Invalid plugin name");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  320|      0|    return NULL;
  321|      0|  }
  322|       |    // Attempt to directly load the library by name
  323|       |#if defined(_WIN32)
  324|       |    // Windows dynamic library (DLL) format
  325|       |    snprintf(libpath, PATH_MAX, "blosc2_%s.dll", plugin_name);
  326|       |#else
  327|       |    // Unix/Linux/Mac OS dynamic library (.so) format
  328|      5|    snprintf(libpath, PATH_MAX, "libblosc2_%s.so", plugin_name);
  329|      5|#endif
  330|      5|    void* loaded_lib = dlopen(libpath, RTLD_LAZY);
  331|      5|    if (loaded_lib != NULL) {
  ------------------
  |  Branch (331:9): [True: 0, False: 5]
  ------------------
  332|      0|        BLOSC_TRACE_INFO("Successfully loaded %s directly\n", libpath);
  ------------------
  |  |   95|      0|#define BLOSC_TRACE_INFO(msg, ...) BLOSC_TRACE(info, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  333|      0|        return loaded_lib;
  334|      5|    } else {
  335|       |#if defined(_WIN32)
  336|       |        BLOSC_TRACE_INFO("Failed to load %s directly, error: %lu\n", libpath, GetLastError());
  337|       |#else
  338|      5|        BLOSC_TRACE_INFO("Failed to load %s directly, error: %s\n", libpath, dlerror());
  ------------------
  |  |   95|      5|#define BLOSC_TRACE_INFO(msg, ...) BLOSC_TRACE(info, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  339|      5|#endif
  340|      5|    }
  341|       |    // If direct loading fails, fallback to using Python to find the library path
  342|      5|    if (get_libpath(plugin_name, libpath, "") < 0 && get_libpath(plugin_name, libpath, "3") < 0) {
  ------------------
  |  Branch (342:9): [True: 5, False: 0]
  |  Branch (342:54): [True: 5, False: 0]
  ------------------
  343|      5|        BLOSC_TRACE_ERROR("Problems when running python or python3 for getting plugin path");
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  344|      5|        return NULL;
  345|      5|    }
  346|       |
  347|      0|    if (strlen(libpath) == 0) {
  ------------------
  |  Branch (347:9): [True: 0, False: 0]
  ------------------
  348|      0|        BLOSC_TRACE_ERROR("Could not find plugin libpath");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  349|      0|        return NULL;
  350|      0|    }
  351|       |
  352|       |    // Try to load the library again with the path from Python
  353|      0|    loaded_lib = dlopen(libpath, RTLD_LAZY);
  354|      0|    if (loaded_lib == NULL) {
  ------------------
  |  Branch (354:9): [True: 0, False: 0]
  ------------------
  355|      0|        BLOSC_TRACE_ERROR("Attempt to load plugin in path '%s' failed with error: %s", libpath, dlerror());
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  356|      0|    } else {
  357|      0|        BLOSC_TRACE_INFO("Successfully loaded library with Python path: %s\n", libpath);
  ------------------
  |  |   95|      0|#define BLOSC_TRACE_INFO(msg, ...) BLOSC_TRACE(info, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  358|      0|    }
  359|       |
  360|      0|    return loaded_lib;
  361|      0|}
blosc2.c:blosc2_valid_plugin_name:
  275|     15|static inline bool blosc2_valid_plugin_name(const char *plugin_name) {
  276|     15|  if (plugin_name == NULL || plugin_name[0] == '\0') {
  ------------------
  |  Branch (276:7): [True: 0, False: 15]
  |  Branch (276:30): [True: 0, False: 15]
  ------------------
  277|      0|    return false;
  278|      0|  }
  279|     96|  for (const unsigned char *p = (const unsigned char *)plugin_name; *p != '\0'; ++p) {
  ------------------
  |  Branch (279:69): [True: 81, False: 15]
  ------------------
  280|     81|    if (!isalnum(*p) && *p != '_') {
  ------------------
  |  Branch (280:9): [True: 0, False: 81]
  |  Branch (280:25): [True: 0, False: 0]
  ------------------
  281|      0|      return false;
  282|      0|    }
  283|     81|  }
  284|     15|  return true;
  285|     15|}
blosc2.c:get_libpath:
  288|     10|static inline int get_libpath(char *plugin_name, char *libpath, char *python_version) {
  289|     10|  BLOSC_TRACE_INFO("Trying to get plugin path with python%s\n", python_version);
  ------------------
  |  |   95|     10|#define BLOSC_TRACE_INFO(msg, ...) BLOSC_TRACE(info, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     10|    do {                                            \
  |  |  |  |   98|     10|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     10|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 10, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     10|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  290|     10|  char python_cmd[PATH_MAX] = {0};
  291|     10|  if (!blosc2_valid_plugin_name(plugin_name)) {
  ------------------
  |  Branch (291:7): [True: 0, False: 10]
  ------------------
  292|      0|    BLOSC_TRACE_ERROR("Invalid plugin name");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  293|      0|    return BLOSC2_ERROR_INVALID_PARAM;
  294|      0|  }
  295|     10|  int written = snprintf(python_cmd, sizeof(python_cmd),
  296|     10|                         "python%s -c \"import blosc2_%s; blosc2_%s.print_libpath()\"",
  297|     10|                         python_version, plugin_name, plugin_name);
  298|     10|  if (written < 0 || (size_t)written >= sizeof(python_cmd)) {
  ------------------
  |  Branch (298:7): [True: 0, False: 10]
  |  Branch (298:22): [True: 0, False: 10]
  ------------------
  299|      0|    BLOSC_TRACE_ERROR("Python command is too long");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  300|      0|    return BLOSC2_ERROR_FAILURE;
  301|      0|  }
  302|     10|  FILE *fp = popen(python_cmd, "r");
  303|     10|  if (fp == NULL) {
  ------------------
  |  Branch (303:7): [True: 0, False: 10]
  ------------------
  304|      0|    BLOSC_TRACE_ERROR("Could not run python");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  305|      0|    return BLOSC2_ERROR_FAILURE;
  306|      0|  }
  307|     10|  if (fgets(libpath, PATH_MAX, fp) == NULL) {
  ------------------
  |  Branch (307:7): [True: 10, False: 0]
  ------------------
  308|     10|    BLOSC_TRACE_ERROR("Could not read python output");
  ------------------
  |  |   93|     10|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     10|    do {                                            \
  |  |  |  |   98|     10|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     10|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 10, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     10|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  309|     10|    pclose(fp);
  310|     10|    return BLOSC2_ERROR_FAILURE;
  311|     10|  }
  312|      0|  pclose(fp);
  313|       |
  314|      0|  return BLOSC2_ERROR_SUCCESS;
  315|     10|}
blosc2.c:sw32_:
  115|   221k|static inline int32_t sw32_(const void* pa) {
  116|   221k|  int32_t idest;
  117|       |
  118|   221k|  bool little_endian = is_little_endian();
  119|   221k|  if (little_endian) {
  ------------------
  |  Branch (119:7): [True: 221k, False: 0]
  ------------------
  120|   221k|    memcpy(&idest, pa, sizeof(idest));
  121|   221k|  }
  122|      0|  else {
  123|      0|#if defined (__GNUC__)
  124|      0|    return __builtin_bswap32(*(unsigned int *)pa);
  125|       |#elif defined (_MSC_VER) /* Visual Studio */
  126|       |    return _byteswap_ulong(*(unsigned int *)pa);
  127|       |#else
  128|       |    const uint8_t *pa_ = (const uint8_t *)pa;
  129|       |    uint8_t *dest = (uint8_t *)&idest;
  130|       |    dest[0] = pa_[3];
  131|       |    dest[1] = pa_[2];
  132|       |    dest[2] = pa_[1];
  133|       |    dest[3] = pa_[0];
  134|       |#endif
  135|      0|  }
  136|   221k|  return idest;
  137|   221k|}
frame.c:endian_handler:
   56|   467k|{
   57|   467k|  bool little_endian = is_little_endian();
   58|   467k|  if (little_endian == little) {
  ------------------
  |  Branch (58:7): [True: 0, False: 467k]
  ------------------
   59|      0|    memcpy(dest, pa, size);
   60|      0|  }
   61|   467k|  else {
   62|   467k|    uint8_t* pa_ = (uint8_t*)pa;
   63|   467k|    uint8_t pa2_[8];
   64|   467k|    switch (size) {
   65|   195k|      case 8:
  ------------------
  |  Branch (65:7): [True: 195k, False: 271k]
  ------------------
   66|   195k|        pa2_[0] = pa_[7];
   67|   195k|        pa2_[1] = pa_[6];
   68|   195k|        pa2_[2] = pa_[5];
   69|   195k|        pa2_[3] = pa_[4];
   70|   195k|        pa2_[4] = pa_[3];
   71|   195k|        pa2_[5] = pa_[2];
   72|   195k|        pa2_[6] = pa_[1];
   73|   195k|        pa2_[7] = pa_[0];
   74|   195k|        break;
   75|   255k|      case 4:
  ------------------
  |  Branch (75:7): [True: 255k, False: 211k]
  ------------------
   76|   255k|        pa2_[0] = pa_[3];
   77|   255k|        pa2_[1] = pa_[2];
   78|   255k|        pa2_[2] = pa_[1];
   79|   255k|        pa2_[3] = pa_[0];
   80|   255k|        break;
   81|  3.44k|      case 2:
  ------------------
  |  Branch (81:7): [True: 3.44k, False: 463k]
  ------------------
   82|  3.44k|        pa2_[0] = pa_[1];
   83|  3.44k|        pa2_[1] = pa_[0];
   84|  3.44k|        break;
   85|  12.7k|      case 1:
  ------------------
  |  Branch (85:7): [True: 12.7k, False: 454k]
  ------------------
   86|  12.7k|        pa2_[0] = pa_[0];
   87|  12.7k|        break;
   88|      0|      default:
  ------------------
  |  Branch (88:7): [True: 0, False: 467k]
  ------------------
   89|      0|        BLOSC_TRACE_ERROR("Unhandled size: %d.", size);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   90|   467k|    }
   91|   467k|    memcpy(dest, pa2_, size);
   92|   467k|  }
   93|   467k|}
frame.c:is_little_endian:
   42|   467k|static bool is_little_endian(void) {
   43|   467k|  static const int i = 1;
   44|   467k|  char* p = (char*)&i;
   45|       |
   46|   467k|  if (p[0] == 1) {
  ------------------
  |  Branch (46:7): [True: 467k, False: 0]
  ------------------
   47|   467k|    return true;
   48|   467k|  }
   49|      0|  else {
   50|       |    return false;
   51|      0|  }
   52|   467k|}
frame.c:blosc2_nchunks_to_offsets_nbytes:
  103|   131k|static inline bool blosc2_nchunks_to_offsets_nbytes(int64_t nchunks, int32_t *off_nbytes) {
  104|   131k|  const int64_t max_nchunks = INT32_MAX / (int64_t)sizeof(int64_t);
  105|   131k|  if (nchunks < 0 || nchunks > max_nchunks) {
  ------------------
  |  Branch (105:7): [True: 0, False: 131k]
  |  Branch (105:22): [True: 10, False: 131k]
  ------------------
  106|     10|    return false;
  107|     10|  }
  108|   131k|  if (off_nbytes != NULL) {
  ------------------
  |  Branch (108:7): [True: 131k, False: 0]
  ------------------
  109|   131k|    *off_nbytes = (int32_t)(nchunks * (int64_t)sizeof(int64_t));
  110|   131k|  }
  111|       |  return true;
  112|   131k|}

blosc2_stdio_open:
  137|     40|void *blosc2_stdio_open(const char *urlpath, const char *mode, void *params) {
  138|     40|  BLOSC_UNUSED_PARAM(params);
  ------------------
  |  |   28|     40|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  139|     40|  if (urlpath == NULL || mode == NULL) {
  ------------------
  |  Branch (139:7): [True: 40, False: 0]
  |  Branch (139:26): [True: 0, False: 0]
  ------------------
  140|     40|    BLOSC_TRACE_ERROR("Invalid arguments for stdio open.");
  ------------------
  |  |   93|     40|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     40|    do {                                            \
  |  |  |  |   98|     40|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     40|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 40, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     40|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  141|     40|    return NULL;
  142|     40|  }
  143|      0|  FILE *file = fopen(urlpath, mode);
  144|      0|  if (file == NULL) {
  ------------------
  |  Branch (144:7): [True: 0, False: 0]
  ------------------
  145|      0|    BLOSC_TRACE_ERROR("Cannot open the file %s with mode %s.", urlpath, mode);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  146|      0|    return NULL;
  147|      0|  }
  148|      0|  blosc2_stdio_file *my_fp = malloc(sizeof(blosc2_stdio_file));
  149|      0|  if (my_fp == NULL) {
  ------------------
  |  Branch (149:7): [True: 0, False: 0]
  ------------------
  150|      0|    BLOSC_TRACE_ERROR("Cannot allocate memory for stdio file wrapper.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  151|      0|    fclose(file);
  152|      0|    return NULL;
  153|      0|  }
  154|      0|  my_fp->file = file;
  155|      0|  return my_fp;
  156|      0|}
blosc2_stdio_destroy:
  302|  11.9k|int blosc2_stdio_destroy(void* params) {
  303|  11.9k|  BLOSC_UNUSED_PARAM(params);
  ------------------
  |  |   28|  11.9k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  304|  11.9k|  return 0;
  305|  11.9k|}

do_nothing:
  632|  1.30M|int do_nothing(uint8_t filter, char cmode) {
  633|  1.30M|  if (cmode == 'c') {
  ------------------
  |  Branch (633:7): [True: 0, False: 1.30M]
  ------------------
  634|      0|    return (filter == BLOSC_NOFILTER);
  635|  1.30M|  } else {
  636|       |    // TRUNC_PREC do not have to be applied during decompression
  637|  1.30M|    return ((filter == BLOSC_NOFILTER) || (filter == BLOSC_TRUNC_PREC));
  ------------------
  |  Branch (637:13): [True: 498k, False: 804k]
  |  Branch (637:43): [True: 74.8k, False: 729k]
  ------------------
  638|  1.30M|  }
  639|  1.30M|}
next_filter:
  642|   393k|int next_filter(const uint8_t* filters, int current_filter, char cmode) {
  643|   659k|  for (int i = current_filter - 1; i >= 0; i--) {
  ------------------
  |  Branch (643:36): [True: 659k, False: 0]
  ------------------
  644|   659k|    if (!do_nothing(filters[i], cmode)) {
  ------------------
  |  Branch (644:9): [True: 393k, False: 266k]
  ------------------
  645|   393k|      return filters[i];
  646|   393k|    }
  647|   659k|  }
  648|      0|  return BLOSC_NOFILTER;
  649|   393k|}
last_filter:
  652|   107k|int last_filter(const uint8_t* filters, char cmode) {
  653|   107k|  int last_index = -1;
  654|   750k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (654:40): [True: 643k, False: 107k]
  ------------------
  655|   643k|    if (!do_nothing(filters[i], cmode))  {
  ------------------
  |  Branch (655:9): [True: 335k, False: 307k]
  ------------------
  656|   335k|      last_index = i;
  657|   335k|    }
  658|   643k|  }
  659|   107k|  return last_index;
  660|   107k|}
read_chunk_header:
  739|  47.3M|{
  740|  47.3M|  memset(header, 0, sizeof(blosc_header));
  741|       |
  742|  47.3M|  if (srcsize < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (742:7): [True: 0, False: 47.3M]
  ------------------
  743|      0|    BLOSC_TRACE_ERROR("Not enough space to read Blosc header.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  744|      0|    return BLOSC2_ERROR_READ_BUFFER;
  745|      0|  }
  746|       |
  747|  47.3M|  memcpy(header, src, BLOSC_MIN_HEADER_LENGTH);
  748|       |
  749|  47.3M|  bool little_endian = is_little_endian();
  750|       |
  751|  47.3M|  if (!little_endian) {
  ------------------
  |  Branch (751:7): [True: 0, False: 47.3M]
  ------------------
  752|      0|    header->nbytes = bswap32_(header->nbytes);
  753|      0|    header->blocksize = bswap32_(header->blocksize);
  754|      0|    header->cbytes = bswap32_(header->cbytes);
  755|      0|  }
  756|       |
  757|  47.3M|  if (header->cbytes < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (757:7): [True: 14, False: 47.3M]
  ------------------
  758|     14|    BLOSC_TRACE_ERROR("`cbytes` is too small to read min header.");
  ------------------
  |  |   93|     14|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     14|    do {                                            \
  |  |  |  |   98|     14|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     14|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 14, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     14|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  759|     14|    return BLOSC2_ERROR_INVALID_HEADER;
  760|     14|  }
  761|  47.3M|  if (header->blocksize <= 0) {
  ------------------
  |  Branch (761:7): [True: 28, False: 47.3M]
  ------------------
  762|     28|    BLOSC_TRACE_ERROR("`blocksize` is zero");
  ------------------
  |  |   93|     28|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     28|    do {                                            \
  |  |  |  |   98|     28|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     28|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 28, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     28|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  763|     28|    return BLOSC2_ERROR_INVALID_HEADER;
  764|     28|  }
  765|  47.3M|  if (header->blocksize > BLOSC2_MAXBLOCKSIZE) {
  ------------------
  |  Branch (765:7): [True: 6, False: 47.3M]
  ------------------
  766|      6|    BLOSC_TRACE_ERROR("`blocksize` greater than maximum allowed");
  ------------------
  |  |   93|      6|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      6|    do {                                            \
  |  |  |  |   98|      6|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      6|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      6|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  767|      6|    return BLOSC2_ERROR_INVALID_HEADER;
  768|      6|  }
  769|  47.3M|  if (header->typesize == 0) {
  ------------------
  |  Branch (769:7): [True: 2, False: 47.3M]
  ------------------
  770|      2|    BLOSC_TRACE_ERROR("`typesize` is zero.");
  ------------------
  |  |   93|      2|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      2|    do {                                            \
  |  |  |  |   98|      2|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      2|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      2|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  771|      2|    return BLOSC2_ERROR_INVALID_HEADER;
  772|      2|  }
  773|       |
  774|       |  /* Read extended header if it is wanted */
  775|  47.3M|  if ((extended_header) && (header->flags & BLOSC_DOSHUFFLE) && (header->flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (775:7): [True: 104k, False: 47.2M]
  |  Branch (775:28): [True: 103k, False: 76]
  |  Branch (775:65): [True: 103k, False: 203]
  ------------------
  776|   103k|    if (header->cbytes < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (776:9): [True: 0, False: 103k]
  ------------------
  777|      0|      BLOSC_TRACE_ERROR("`cbytes` is too small to read extended header.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  778|      0|      return BLOSC2_ERROR_INVALID_HEADER;
  779|      0|    }
  780|   103k|    if (srcsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (780:9): [True: 0, False: 103k]
  ------------------
  781|      0|      BLOSC_TRACE_ERROR("Not enough space to read Blosc extended header.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  782|      0|      return BLOSC2_ERROR_READ_BUFFER;
  783|      0|    }
  784|       |
  785|   103k|    memcpy((uint8_t *)header + BLOSC_MIN_HEADER_LENGTH, src + BLOSC_MIN_HEADER_LENGTH,
  786|   103k|      BLOSC_EXTENDED_HEADER_LENGTH - BLOSC_MIN_HEADER_LENGTH);
  787|       |
  788|   103k|    if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) && (header->blosc2_flags != 0)) {
  ------------------
  |  Branch (788:9): [True: 299, False: 103k]
  |  Branch (788:55): [True: 89, False: 210]
  ------------------
  789|     89|      int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  790|     89|      if (special_type != 0) {
  ------------------
  |  Branch (790:11): [True: 1, False: 88]
  ------------------
  791|      1|        BLOSC_TRACE_ERROR("VL-block chunks cannot use special chunk encodings.");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  792|      1|        return BLOSC2_ERROR_INVALID_HEADER;
  793|      1|      }
  794|     89|    }
  795|       |
  796|   103k|    int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  797|   103k|    if (special_type != 0) {
  ------------------
  |  Branch (797:9): [True: 20.7k, False: 82.9k]
  ------------------
  798|  20.7k|      if (special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (798:11): [True: 132, False: 20.6k]
  ------------------
  799|       |        // In this case, the actual type size must be derived from the cbytes
  800|    132|        int32_t typesize = header->cbytes - BLOSC_EXTENDED_HEADER_LENGTH;
  801|    132|        if (typesize <= 0) {
  ------------------
  |  Branch (801:13): [True: 0, False: 132]
  ------------------
  802|      0|          BLOSC_TRACE_ERROR("`typesize` is zero or negative");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  803|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  804|      0|        }
  805|    132|        if (typesize > BLOSC2_MAXTYPESIZE) {
  ------------------
  |  Branch (805:13): [True: 0, False: 132]
  ------------------
  806|      0|          BLOSC_TRACE_ERROR("`typesize` is greater than maximum allowed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  807|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  808|      0|        }
  809|    132|        if (typesize > header->nbytes) {
  ------------------
  |  Branch (809:13): [True: 4, False: 128]
  ------------------
  810|      4|          BLOSC_TRACE_ERROR("`typesize` is greater than `nbytes`");
  ------------------
  |  |   93|      4|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      4|    do {                                            \
  |  |  |  |   98|      4|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      4|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      4|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  811|      4|          return BLOSC2_ERROR_INVALID_HEADER;
  812|      4|        }
  813|    128|        if (header->nbytes % typesize != 0) {
  ------------------
  |  Branch (813:13): [True: 12, False: 116]
  ------------------
  814|     12|          BLOSC_TRACE_ERROR("`nbytes` is not a multiple of typesize");
  ------------------
  |  |   93|     12|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     12|    do {                                            \
  |  |  |  |   98|     12|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     12|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     12|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  815|     12|          return BLOSC2_ERROR_INVALID_HEADER;
  816|     12|        }
  817|    128|      }
  818|  20.6k|      else {
  819|       |        // All-zero chunks fill with memset, which works regardless of element alignment.
  820|  20.6k|        if (special_type != BLOSC2_SPECIAL_ZERO
  ------------------
  |  Branch (820:13): [True: 1.14k, False: 19.4k]
  ------------------
  821|  1.14k|            && header->nbytes % header->typesize != 0) {
  ------------------
  |  Branch (821:16): [True: 4, False: 1.14k]
  ------------------
  822|      4|          BLOSC_TRACE_ERROR("`nbytes` is not a multiple of typesize");
  ------------------
  |  |   93|      4|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      4|    do {                                            \
  |  |  |  |   98|      4|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      4|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      4|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  823|      4|          return BLOSC2_ERROR_INVALID_HEADER;
  824|      4|        }
  825|  20.6k|      }
  826|  20.7k|    }
  827|       |    // The number of filters depends on the version of the header. Blosc2 alpha series
  828|       |    // did not initialize filters to zero beyond the max supported.
  829|   103k|    if (header->version == BLOSC2_VERSION_FORMAT_ALPHA) {
  ------------------
  |  Branch (829:9): [True: 1.16k, False: 102k]
  ------------------
  830|  1.16k|      header->filters[5] = 0;
  831|  1.16k|      header->filters_meta[5] = 0;
  832|  1.16k|    }
  833|   103k|  }
  834|  47.2M|  else {
  835|  47.2M|    flags_to_filters(header->flags, header->filters);
  836|  47.2M|  }
  837|  47.3M|  if (header->version > BLOSC2_VERSION_FORMAT &&
  ------------------
  |  Branch (837:7): [True: 4.87M, False: 42.5M]
  ------------------
  838|  4.87M|      (header->blosc2_flags2 & (uint8_t)~BLOSC2_VL_BLOCKS) != 0) {
  ------------------
  |  Branch (838:7): [True: 1, False: 4.87M]
  ------------------
  839|       |    /* Version from future with unsupported chunk features. */
  840|      1|    return BLOSC2_ERROR_VERSION_SUPPORT;
  841|      1|  }
  842|  47.3M|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0 &&
  ------------------
  |  Branch (842:7): [True: 297, False: 47.3M]
  ------------------
  843|    297|      (header->flags & (uint8_t)BLOSC_MEMCPYED) != 0) {
  ------------------
  |  Branch (843:7): [True: 0, False: 297]
  ------------------
  844|      0|    BLOSC_TRACE_ERROR("VL-block chunks cannot be memcpyed.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  845|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  846|      0|  }
  847|  47.3M|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) == 0 &&
  ------------------
  |  Branch (847:7): [True: 47.3M, False: 297]
  ------------------
  848|  47.3M|      header->nbytes > 0 && header->blocksize > header->nbytes) {
  ------------------
  |  Branch (848:7): [True: 47.3M, False: 20.4k]
  |  Branch (848:29): [True: 84.0k, False: 47.2M]
  ------------------
  849|  84.0k|    header->blocksize = header->nbytes;
  850|  84.0k|  }
  851|  47.3M|  return 0;
  852|  47.3M|}
fill_codec:
  935|      5|int fill_codec(blosc2_codec *codec) {
  936|      5|  char libpath[PATH_MAX];
  937|      5|  void *lib = load_lib(codec->compname, libpath);
  938|      5|  if(lib == NULL) {
  ------------------
  |  Branch (938:6): [True: 5, False: 0]
  ------------------
  939|      5|    BLOSC_TRACE_ERROR("Error while loading the library for codec `%s`", codec->compname);
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  940|      5|    return BLOSC2_ERROR_FAILURE;
  941|      5|  }
  942|       |
  943|      0|  codec_info *info = dlsym(lib, "info");
  944|      0|  if (info == NULL) {
  ------------------
  |  Branch (944:7): [True: 0, False: 0]
  ------------------
  945|      0|    BLOSC_TRACE_ERROR("`info` symbol cannot be loaded from plugin `%s`", codec->compname);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  946|      0|    dlclose(lib);
  947|      0|    return BLOSC2_ERROR_FAILURE;
  948|      0|  }
  949|      0|  codec->encoder = dlsym(lib, info->encoder);
  950|      0|  codec->decoder = dlsym(lib, info->decoder);
  951|       |
  952|      0|  if (codec->encoder == NULL || codec->decoder == NULL) {
  ------------------
  |  Branch (952:7): [True: 0, False: 0]
  |  Branch (952:33): [True: 0, False: 0]
  ------------------
  953|      0|    BLOSC_TRACE_ERROR("encoder or decoder cannot be loaded from plugin `%s`", codec->compname);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  954|      0|    dlclose(lib);
  955|      0|    return BLOSC2_ERROR_FAILURE;
  956|      0|  }
  957|       |
  958|       |  /* If ever add .free function in future for codec params
  959|       |  codecparams_info *info2 = dlsym(lib, "info2");
  960|       |  if (info2 != NULL) {
  961|       |    // New plugin (e.g. openzl) with free function for codec_params defined
  962|       |    // will be used when destroying context in blosc2_free_ctx
  963|       |      codec->free = dlsym(lib, info2->free);
  964|       |  }
  965|       |  else{
  966|       |    codec->free = NULL;
  967|       |  }
  968|       |  */
  969|       |
  970|      0|  return BLOSC2_ERROR_SUCCESS;
  971|      0|}
_cycle_buffers:
 1048|   295k|void _cycle_buffers(uint8_t **src, uint8_t **dest, uint8_t **tmp) {
 1049|   295k|  uint8_t *tmp2 = *src;
 1050|   295k|  *src = *dest;
 1051|   295k|  *dest = *tmp;
 1052|   295k|  *tmp = tmp2;
 1053|   295k|}
pipeline_backward:
 1475|  93.4k|                      uint8_t* tmp2, int last_filter_index, int32_t nblock) {
 1476|  93.4k|  blosc2_context* context = thread_context->parent_context;
 1477|  93.4k|  int32_t typesize = context->typesize;
 1478|  93.4k|  uint8_t* filters = context->filters;
 1479|  93.4k|  uint8_t* filters_meta = context->filters_meta;
 1480|  93.4k|  uint8_t* _src = src;
 1481|  93.4k|  uint8_t* _dest = tmp;
 1482|  93.4k|  uint8_t* _tmp = tmp2;
 1483|  93.4k|  int errcode = 0;
 1484|       |
 1485|   442k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (1485:40): [True: 442k, False: 0]
  ------------------
 1486|       |    // Delta filter requires the whole chunk ready
 1487|   442k|    int last_copy_filter = (last_filter_index == i) || (filters[i] == BLOSC_DELTA) ||
  ------------------
  |  Branch (1487:28): [True: 93.3k, False: 349k]
  |  Branch (1487:56): [True: 57.2k, False: 292k]
  ------------------
 1488|   292k|                           (next_filter(filters, i, 'd') == BLOSC_DELTA);
  ------------------
  |  Branch (1488:28): [True: 76.6k, False: 215k]
  ------------------
 1489|   442k|    if (last_copy_filter && context->postfilter == NULL &&
  ------------------
  |  Branch (1489:9): [True: 227k, False: 215k]
  |  Branch (1489:29): [True: 227k, False: 0]
  ------------------
 1490|   227k|        (filters[i] == BLOSC_DELTA || _src != dest + offset)) {
  ------------------
  |  Branch (1490:10): [True: 77.2k, False: 149k]
  |  Branch (1490:39): [True: 108k, False: 40.9k]
  ------------------
 1491|   186k|      _dest = dest + offset;
 1492|   186k|    }
 1493|   442k|    int rc = BLOSC2_ERROR_SUCCESS;
 1494|   442k|    if (filters[i] <= BLOSC2_DEFINED_FILTERS_STOP) {
  ------------------
  |  Branch (1494:9): [True: 358k, False: 84.8k]
  ------------------
 1495|   358k|      switch (filters[i]) {
 1496|  83.0k|        case BLOSC_SHUFFLE:
  ------------------
  |  Branch (1496:9): [True: 83.0k, False: 275k]
  ------------------
 1497|       |        // if filters_meta is not 0, interpret as number of bytes to be grouped together for shuffle
 1498|  83.0k|          blosc2_unshuffle(filters_meta[i] == 0 ? typesize : filters_meta[i], bsize, _src, _dest);
  ------------------
  |  Branch (1498:28): [True: 13.7k, False: 69.2k]
  ------------------
 1499|  83.0k|          break;
 1500|  50.9k|        case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (1500:9): [True: 50.9k, False: 307k]
  ------------------
 1501|  50.9k|          if (bitunshuffle(typesize, bsize, _src, _dest, context->src[BLOSC2_CHUNK_VERSION]) < 0) {
  ------------------
  |  Branch (1501:15): [True: 0, False: 50.9k]
  ------------------
 1502|      0|            return BLOSC2_ERROR_FILTER_PIPELINE;
 1503|      0|          }
 1504|  50.9k|          break;
 1505|  77.2k|        case BLOSC_DELTA:
  ------------------
  |  Branch (1505:9): [True: 77.2k, False: 280k]
  ------------------
 1506|  77.2k|          if (context->nthreads == 1) {
  ------------------
  |  Branch (1506:15): [True: 77.2k, False: 0]
  ------------------
 1507|       |            /* Serial mode */
 1508|  77.2k|            delta_decoder(dest, offset, bsize, typesize, _dest);
 1509|  77.2k|          } else {
 1510|      0|            struct blosc_job_group *job = context->job;
 1511|      0|            blosc2_pthread_mutex_t *delta_mutex = job != NULL ? &job->delta_mutex : &context->delta_mutex;
  ------------------
  |  |   89|      0|#define blosc2_pthread_mutex_t pthread_mutex_t
  ------------------
  |  Branch (1511:51): [True: 0, False: 0]
  ------------------
 1512|      0|            blosc2_pthread_cond_t *delta_cv = job != NULL ? &job->delta_cv : &context->delta_cv;
  ------------------
  |  |   95|      0|#define blosc2_pthread_cond_t pthread_cond_t
  ------------------
  |  Branch (1512:47): [True: 0, False: 0]
  ------------------
 1513|      0|            int *dref_not_init = job != NULL ? &job->dref_not_init : &context->dref_not_init;
  ------------------
  |  Branch (1513:34): [True: 0, False: 0]
  ------------------
 1514|       |            /* Force the thread in charge of the block 0 to go first */
 1515|      0|            blosc2_pthread_mutex_lock(delta_mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 1516|      0|            if (*dref_not_init) {
  ------------------
  |  Branch (1516:17): [True: 0, False: 0]
  ------------------
 1517|      0|              if (offset != 0) {
  ------------------
  |  Branch (1517:19): [True: 0, False: 0]
  ------------------
 1518|      0|                blosc2_pthread_cond_wait(delta_cv, delta_mutex);
  ------------------
  |  |   98|      0|#define blosc2_pthread_cond_wait(a, b) pthread_cond_wait((a), (b))
  ------------------
 1519|      0|              } else {
 1520|      0|                delta_decoder(dest, offset, bsize, typesize, _dest);
 1521|      0|                *dref_not_init = 0;
 1522|      0|                blosc2_pthread_cond_broadcast(delta_cv);
  ------------------
  |  |  100|      0|#define blosc2_pthread_cond_broadcast(a) pthread_cond_broadcast((a))
  ------------------
 1523|      0|              }
 1524|      0|            }
 1525|      0|            blosc2_pthread_mutex_unlock(delta_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 1526|      0|            if (offset != 0) {
  ------------------
  |  Branch (1526:17): [True: 0, False: 0]
  ------------------
 1527|      0|              delta_decoder(dest, offset, bsize, typesize, _dest);
 1528|      0|            }
 1529|      0|          }
 1530|  77.2k|          break;
 1531|  23.9k|        case BLOSC_TRUNC_PREC:
  ------------------
  |  Branch (1531:9): [True: 23.9k, False: 334k]
  ------------------
 1532|       |          // TRUNC_PREC filter does not need to be undone
 1533|  23.9k|          break;
 1534|   122k|        default:
  ------------------
  |  Branch (1534:9): [True: 122k, False: 235k]
  ------------------
 1535|   122k|          if (filters[i] != BLOSC_NOFILTER) {
  ------------------
  |  Branch (1535:15): [True: 97, False: 122k]
  ------------------
 1536|     97|            BLOSC_TRACE_ERROR("Filter %d not handled during decompression.",
  ------------------
  |  |   93|     97|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     97|    do {                                            \
  |  |  |  |   98|     97|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     97|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 97, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     97|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1537|     97|                              filters[i]);
 1538|     97|            errcode = -1;
 1539|     97|          }
 1540|   358k|      }
 1541|   358k|    } else {
 1542|       |        // Look for the filters_meta in user filters and run it
 1543|   299k|        for (uint64_t j = 0; j < g_nfilters; ++j) {
  ------------------
  |  Branch (1543:30): [True: 299k, False: 181]
  ------------------
 1544|   299k|          if (g_filters[j].id == filters[i]) {
  ------------------
  |  Branch (1544:15): [True: 84.6k, False: 215k]
  ------------------
 1545|  84.6k|            if (g_filters[j].backward == NULL) {
  ------------------
  |  Branch (1545:17): [True: 0, False: 84.6k]
  ------------------
 1546|       |              // Dynamically load filter
 1547|      0|              if (fill_filter(&g_filters[j]) < 0) {
  ------------------
  |  Branch (1547:19): [True: 0, False: 0]
  ------------------
 1548|      0|                BLOSC_TRACE_ERROR("Could not load filter %d.", g_filters[j].id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1549|      0|                return BLOSC2_ERROR_FILTER_PIPELINE;
 1550|      0|              }
 1551|      0|            }
 1552|  84.6k|            if (g_filters[j].backward != NULL) {
  ------------------
  |  Branch (1552:17): [True: 84.6k, False: 0]
  ------------------
 1553|  84.6k|              blosc2_dparams dparams;
 1554|  84.6k|              blosc2_ctx_get_dparams(context, &dparams);
 1555|  84.6k|              rc = g_filters[j].backward(_src, _dest, bsize, filters_meta[i], &dparams, g_filters[j].id);
 1556|  84.6k|            } else {
 1557|      0|              BLOSC_TRACE_ERROR("Backward function is NULL");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1558|      0|              return BLOSC2_ERROR_FILTER_PIPELINE;
 1559|      0|            }
 1560|  84.6k|            if (rc != BLOSC2_ERROR_SUCCESS) {
  ------------------
  |  Branch (1560:17): [True: 20, False: 84.6k]
  ------------------
 1561|     20|              BLOSC_TRACE_ERROR("User-defined filter %d failed during decompression.", filters[i]);
  ------------------
  |  |   93|     20|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     20|    do {                                            \
  |  |  |  |   98|     20|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     20|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 20, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     20|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1562|     20|              return rc;
 1563|     20|            }
 1564|  84.6k|            goto urfiltersuccess;
 1565|  84.6k|          }
 1566|   299k|        }
 1567|    181|      BLOSC_TRACE_ERROR("User-defined filter %d not found during decompression.", filters[i]);
  ------------------
  |  |   93|    181|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    181|    do {                                            \
  |  |  |  |   98|    181|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    181|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 181, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    181|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1568|    181|      return BLOSC2_ERROR_FILTER_PIPELINE;
 1569|  84.6k|      urfiltersuccess:;
 1570|  84.6k|    }
 1571|       |
 1572|       |    // Cycle buffers when required
 1573|   442k|    if ((filters[i] != BLOSC_NOFILTER) && (filters[i] != BLOSC_TRUNC_PREC)) {
  ------------------
  |  Branch (1573:9): [True: 319k, False: 122k]
  |  Branch (1573:43): [True: 295k, False: 23.9k]
  ------------------
 1574|   295k|      _cycle_buffers(&_src, &_dest, &_tmp);
 1575|   295k|    }
 1576|   442k|    if (last_filter_index == i) {
  ------------------
  |  Branch (1576:9): [True: 93.2k, False: 349k]
  ------------------
 1577|  93.2k|      break;
 1578|  93.2k|    }
 1579|   442k|  }
 1580|       |
 1581|  93.2k|  if (context->postfilter == NULL && _src != dest + offset) {
  ------------------
  |  Branch (1581:7): [True: 93.2k, False: 0]
  |  Branch (1581:38): [True: 33.6k, False: 59.6k]
  ------------------
 1582|  33.6k|    memcpy(dest + offset, _src, (unsigned int)bsize);
 1583|  33.6k|  }
 1584|       |
 1585|       |  /* Postfilter function */
 1586|  93.2k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (1586:7): [True: 0, False: 93.2k]
  ------------------
 1587|       |    // Create new postfilter parameters for this block (must be private for each thread)
 1588|      0|    blosc2_postfilter_params postparams;
 1589|      0|    memcpy(&postparams, context->postparams, sizeof(postparams));
 1590|      0|    postparams.input = _src;
 1591|      0|    postparams.output = dest + offset;
 1592|      0|    postparams.size = bsize;
 1593|      0|    postparams.typesize = typesize;
 1594|      0|    postparams.offset = nblock * context->blocksize;
 1595|      0|    postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (1595:25): [True: 0, False: 0]
  ------------------
 1596|      0|    postparams.nblock = nblock;
 1597|      0|    postparams.tid = thread_context->tid;
 1598|      0|    postparams.ttmp = thread_context->tmp;
 1599|      0|    postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 1600|      0|    postparams.ctx = context;
 1601|       |
 1602|      0|    if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (1602:9): [True: 0, False: 0]
  ------------------
 1603|      0|      BLOSC_TRACE_ERROR("Execution of postfilter function failed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1604|      0|      return BLOSC2_ERROR_POSTFILTER;
 1605|      0|    }
 1606|      0|  }
 1607|       |
 1608|  93.2k|  return errcode;
 1609|  93.2k|}
free_thread_context:
 2294|  58.6k|void free_thread_context(struct thread_context* thread_context) {
 2295|  58.6k|  destroy_thread_context(thread_context);
 2296|  58.6k|  my_free(thread_context);
 2297|  58.6k|}
check_nthreads:
 2300|  56.0k|int check_nthreads(blosc2_context* context) {
 2301|  56.0k|  if (context->new_nthreads != context->nthreads && context->new_nthreads <= 0) {
  ------------------
  |  Branch (2301:7): [True: 0, False: 56.0k]
  |  Branch (2301:53): [True: 0, False: 0]
  ------------------
 2302|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2302|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2303|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2304|      0|  }
 2305|  56.0k|  if (context->nthreads <= 0) {
  ------------------
  |  Branch (2305:7): [True: 0, False: 56.0k]
  ------------------
 2306|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2306|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2307|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2308|      0|  }
 2309|       |
 2310|       |  /* Detect a pool that was torn down by blosc2_destroy() while this context
 2311|       |   * was still alive.  The epoch mismatch tells us the pool pointer is dangling;
 2312|       |   * clear it so the re-attach logic below creates a fresh one. */
 2313|  56.0k|  if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL &&
  ------------------
  |  |   33|   112k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (2313:7): [True: 0, False: 56.0k]
  ------------------
 2314|      0|      context->pool_epoch != g_destroy_count) {
  ------------------
  |  Branch (2314:7): [True: 0, False: 0]
  ------------------
 2315|      0|    context->thread_pool = NULL;
 2316|      0|    context->threads_started = 0;
 2317|      0|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2318|      0|  }
 2319|       |
 2320|  56.0k|  if (context->new_nthreads != context->nthreads) {
  ------------------
  |  Branch (2320:7): [True: 0, False: 56.0k]
  ------------------
 2321|      0|    release_thread_backend(context);
 2322|      0|    context->nthreads = context->new_nthreads;
 2323|      0|  }
 2324|  56.0k|  if (context->nthreads > 1 && context->threads_started == 0) {
  ------------------
  |  Branch (2324:7): [True: 0, False: 56.0k]
  |  Branch (2324:32): [True: 0, False: 0]
  ------------------
 2325|      0|    int rc;
 2326|      0|    if (threads_callback) {
  ------------------
  |  Branch (2326:9): [True: 0, False: 0]
  ------------------
 2327|      0|      rc = init_callback_threads(context);
 2328|      0|    }
 2329|      0|    else {
 2330|       |#if defined(_WIN32)
 2331|       |      rc = init_threadpool(context);
 2332|       |#else
 2333|      0|      rc = attach_shared_pool(context);
 2334|      0|#endif
 2335|      0|    }
 2336|      0|    if (rc < 0) {
  ------------------
  |  Branch (2336:9): [True: 0, False: 0]
  ------------------
 2337|      0|      return rc;
 2338|      0|    }
 2339|      0|  }
 2340|  56.0k|  if (context->nthreads <= 1) {
  ------------------
  |  Branch (2340:7): [True: 56.0k, False: 0]
  ------------------
 2341|  56.0k|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|  56.0k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2342|  56.0k|  }
 2343|       |
 2344|  56.0k|  return context->nthreads;
 2345|  56.0k|}
build_filters:
 3687|  23.7k|                   const int32_t typesize, uint8_t* filters) {
 3688|       |
 3689|       |  /* Fill the end part of the filter pipeline */
 3690|  23.7k|  if ((doshuffle == BLOSC_SHUFFLE) && (typesize > 1))
  ------------------
  |  Branch (3690:7): [True: 0, False: 23.7k]
  |  Branch (3690:39): [True: 0, False: 0]
  ------------------
 3691|      0|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_SHUFFLE;
 3692|  23.7k|  if (doshuffle == BLOSC_BITSHUFFLE)
  ------------------
  |  Branch (3692:7): [True: 0, False: 23.7k]
  ------------------
 3693|      0|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_BITSHUFFLE;
 3694|  23.7k|  if (doshuffle == BLOSC_NOSHUFFLE)
  ------------------
  |  Branch (3694:7): [True: 0, False: 23.7k]
  ------------------
 3695|      0|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_NOSHUFFLE;
 3696|  23.7k|  if (delta)
  ------------------
  |  Branch (3696:7): [True: 0, False: 23.7k]
  ------------------
 3697|      0|    filters[BLOSC2_MAX_FILTERS - 2] = BLOSC_DELTA;
 3698|  23.7k|}
blosc2_decompress_ctx:
 3944|  56.8k|                          void* dest, int32_t destsize) {
 3945|  56.8k|  int result;
 3946|       |
 3947|  56.8k|  if (context->do_compress != 0) {
  ------------------
  |  Branch (3947:7): [True: 0, False: 56.8k]
  ------------------
 3948|      0|    BLOSC_TRACE_ERROR("Context is not meant for decompression.  Giving up.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3949|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 3950|      0|  }
 3951|       |
 3952|  56.8k|  result = blosc_run_decompression_with_context(context, src, srcsize, dest, destsize);
 3953|       |
 3954|       |  // Reset a possible block_maskout
 3955|  56.8k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (3955:7): [True: 0, False: 56.8k]
  ------------------
 3956|      0|    free(context->block_maskout);
 3957|      0|    context->block_maskout = NULL;
 3958|      0|  }
 3959|  56.8k|  context->block_maskout_nitems = 0;
 3960|       |
 3961|  56.8k|  return result;
 3962|  56.8k|}
_blosc_getitem:
 4266|  47.2k|                   int start, int nitems, void* dest, int32_t destsize) {
 4267|  47.2k|  uint8_t* _src = (uint8_t*)(src);  /* current pos for source buffer */
 4268|  47.2k|  uint8_t* _dest = (uint8_t*)(dest);
 4269|  47.2k|  int32_t ntbytes = 0;              /* the number of uncompressed bytes */
 4270|  47.2k|  int32_t bsize, bsize2, ebsize, leftoverblock;
 4271|  47.2k|  int32_t startb, stopb;
 4272|  47.2k|  int32_t stop;
 4273|  47.2k|  int32_t nitems_bytes;
 4274|  47.2k|  int64_t start64 = (int64_t)start;
 4275|  47.2k|  int64_t nitems64 = (int64_t)nitems;
 4276|  47.2k|  int64_t typesize64 = (int64_t)header->typesize;
 4277|  47.2k|  int64_t stop64;
 4278|  47.2k|  int64_t nitems_bytes64;
 4279|  47.2k|  int64_t start_bytes64;
 4280|  47.2k|  int64_t stop_bytes64;
 4281|  47.2k|  int j, rc;
 4282|       |
 4283|  47.2k|  if (nitems == 0) {
  ------------------
  |  Branch (4283:7): [True: 0, False: 47.2k]
  ------------------
 4284|       |    // We have nothing to do
 4285|      0|    return 0;
 4286|      0|  }
 4287|  47.2k|  if (nitems < 0) {
  ------------------
  |  Branch (4287:7): [True: 0, False: 47.2k]
  ------------------
 4288|      0|    BLOSC_TRACE_ERROR("`nitems` out of bounds.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4289|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4290|      0|  }
 4291|       |
 4292|  47.2k|  nitems_bytes64 = nitems64 * typesize64;
 4293|  47.2k|  if (nitems_bytes64 < 0 || nitems_bytes64 > INT32_MAX || nitems_bytes64 > destsize) {
  ------------------
  |  Branch (4293:7): [True: 0, False: 47.2k]
  |  Branch (4293:29): [True: 0, False: 47.2k]
  |  Branch (4293:59): [True: 152, False: 47.0k]
  ------------------
 4294|    152|    BLOSC_TRACE_ERROR("`nitems`*`typesize` out of dest bounds.");
  ------------------
  |  |   93|    152|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    152|    do {                                            \
  |  |  |  |   98|    152|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    152|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 152, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    152|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4295|    152|    return BLOSC2_ERROR_WRITE_BUFFER;
 4296|    152|  }
 4297|  47.0k|  nitems_bytes = (int32_t)nitems_bytes64;
 4298|       |
 4299|  47.0k|  int32_t* bstarts = (int32_t*)(_src + context->header_overhead);
 4300|       |
 4301|       |  /* Check region boundaries */
 4302|  47.0k|  start_bytes64 = start64 * typesize64;
 4303|  47.0k|  if ((start < 0) || (start_bytes64 < 0) || (start_bytes64 > header->nbytes)) {
  ------------------
  |  Branch (4303:7): [True: 0, False: 47.0k]
  |  Branch (4303:22): [True: 0, False: 47.0k]
  |  Branch (4303:45): [True: 0, False: 47.0k]
  ------------------
 4304|      0|    BLOSC_TRACE_ERROR("`start` out of bounds.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4305|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4306|      0|  }
 4307|       |
 4308|  47.0k|  stop64 = start64 + nitems64;
 4309|  47.0k|  if ((stop64 < 0) || (stop64 > INT32_MAX)) {
  ------------------
  |  Branch (4309:7): [True: 0, False: 47.0k]
  |  Branch (4309:23): [True: 0, False: 47.0k]
  ------------------
 4310|      0|    BLOSC_TRACE_ERROR("`start`+`nitems` out of bounds.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4311|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4312|      0|  }
 4313|  47.0k|  stop = (int32_t)stop64;
 4314|       |
 4315|  47.0k|  stop_bytes64 = stop64 * typesize64;
 4316|  47.0k|  if ((stop_bytes64 < 0) || (stop_bytes64 > header->nbytes)) {
  ------------------
  |  Branch (4316:7): [True: 0, False: 47.0k]
  |  Branch (4316:29): [True: 0, False: 47.0k]
  ------------------
 4317|      0|    BLOSC_TRACE_ERROR("`start`+`nitems` out of bounds.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4318|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4319|      0|  }
 4320|       |
 4321|  47.0k|  bool chunk_memcpyed = (header->flags & (uint8_t)BLOSC_MEMCPYED) != 0;
 4322|  47.0k|  if (!context->special_type && !chunk_memcpyed &&
  ------------------
  |  Branch (4322:7): [True: 42.4k, False: 4.55k]
  |  Branch (4322:33): [True: 41.3k, False: 1.13k]
  ------------------
 4323|  41.3k|      ((uint8_t *)(_src + srcsize) < (uint8_t *)(bstarts + context->nblocks))) {
  ------------------
  |  Branch (4323:7): [True: 0, False: 41.3k]
  ------------------
 4324|      0|    BLOSC_TRACE_ERROR("`bstarts` out of bounds.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4325|      0|    return BLOSC2_ERROR_READ_BUFFER;
 4326|      0|  }
 4327|       |
 4328|  47.0k|  bool memcpyed = header->flags & (uint8_t)BLOSC_MEMCPYED;
 4329|  47.0k|  if (context->special_type) {
  ------------------
  |  Branch (4329:7): [True: 4.55k, False: 42.4k]
  ------------------
 4330|       |    // Fake a runlen as if its a memcpyed chunk
 4331|  4.55k|    memcpyed = true;
 4332|  4.55k|  }
 4333|       |
 4334|  47.0k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (4334:19): [True: 47.0k, False: 24]
  ------------------
 4335|  47.0k|                  (context->blosc2_flags & 0x08u) && !context->special_type);
  ------------------
  |  Branch (4335:19): [True: 1.11k, False: 45.9k]
  |  Branch (4335:54): [True: 0, False: 1.11k]
  ------------------
 4336|  47.0k|  if (memcpyed && !is_lazy && !context->postfilter) {
  ------------------
  |  Branch (4336:7): [True: 5.69k, False: 41.3k]
  |  Branch (4336:19): [True: 5.69k, False: 0]
  |  Branch (4336:31): [True: 5.69k, False: 0]
  ------------------
 4337|       |    // Short-circuit for (non-lazy) memcpyed or special values
 4338|  5.69k|    ntbytes = nitems_bytes;
 4339|  5.69k|    switch (context->special_type) {
 4340|     34|      case BLOSC2_SPECIAL_VALUE: {
  ------------------
  |  Branch (4340:7): [True: 34, False: 5.65k]
  ------------------
 4341|       |        // The repeated value's width is cbytes minus the header, not the header
 4342|       |        // typesize byte (which is left unconstrained for special-value chunks).
 4343|       |        // Derive it the same way blosc_d() does so a crafted typesize cannot make
 4344|       |        // set_values() read past the end of the chunk.
 4345|     34|        int32_t value_typesize = header->cbytes - context->header_overhead;
 4346|     34|        rc = set_values(value_typesize, _src, _dest, ntbytes);
 4347|     34|        if (rc < 0) {
  ------------------
  |  Branch (4347:13): [True: 19, False: 15]
  ------------------
 4348|     19|          BLOSC_TRACE_ERROR("set_values failed");
  ------------------
  |  |   93|     19|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     19|    do {                                            \
  |  |  |  |   98|     19|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     19|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 19, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     19|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4349|     19|          return BLOSC2_ERROR_DATA;
 4350|     19|        }
 4351|     15|        break;
 4352|     34|      }
 4353|     67|      case BLOSC2_SPECIAL_NAN:
  ------------------
  |  Branch (4353:7): [True: 67, False: 5.62k]
  ------------------
 4354|     67|        rc = set_nans(context->typesize, _dest, ntbytes);
 4355|     67|        if (rc < 0) {
  ------------------
  |  Branch (4355:13): [True: 0, False: 67]
  ------------------
 4356|      0|          BLOSC_TRACE_ERROR("set_nans failed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4357|      0|          return BLOSC2_ERROR_DATA;
 4358|      0|        }
 4359|     67|        break;
 4360|  4.44k|      case BLOSC2_SPECIAL_ZERO:
  ------------------
  |  Branch (4360:7): [True: 4.44k, False: 1.25k]
  ------------------
 4361|  4.44k|        memset(_dest, 0, ntbytes);
 4362|  4.44k|        break;
 4363|     18|      case BLOSC2_SPECIAL_UNINIT:
  ------------------
  |  Branch (4363:7): [True: 18, False: 5.67k]
  ------------------
 4364|       |        // We do nothing here
 4365|     18|        break;
 4366|  1.13k|      case BLOSC2_NO_SPECIAL:
  ------------------
  |  Branch (4366:7): [True: 1.13k, False: 4.55k]
  ------------------
 4367|  1.13k|        {
 4368|  1.13k|          int64_t src_offset64 = (int64_t)context->header_overhead + start_bytes64;
 4369|  1.13k|          int64_t src_stop64 = src_offset64 + nitems_bytes64;
 4370|  1.13k|          if ((src_offset64 < 0) || (src_stop64 < src_offset64) || (src_stop64 > srcsize)) {
  ------------------
  |  Branch (4370:15): [True: 0, False: 1.13k]
  |  Branch (4370:37): [True: 0, False: 1.13k]
  |  Branch (4370:68): [True: 0, False: 1.13k]
  ------------------
 4371|      0|            BLOSC_TRACE_ERROR("getitem memcpy source out of bounds.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4372|      0|            return BLOSC2_ERROR_READ_BUFFER;
 4373|      0|          }
 4374|  1.13k|          _src += (int32_t)src_offset64;
 4375|  1.13k|        }
 4376|      0|        memcpy(_dest, _src, ntbytes);
 4377|  1.13k|        break;
 4378|      0|      default:
  ------------------
  |  Branch (4378:7): [True: 0, False: 5.69k]
  ------------------
 4379|      0|        BLOSC_TRACE_ERROR("Unhandled special value case");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4380|      0|        BLOSC_ERROR(BLOSC2_ERROR_SCHUNK_SPECIAL);
  ------------------
  |  |  111|      0|    do {                                            \
  |  |  112|      0|        int rc_ = (rc);                             \
  |  |  113|      0|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  114|      0|            char *error_msg = print_error(rc_);     \
  |  |  115|      0|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      0|            return rc_;                             \
  |  |  117|      0|        }                                           \
  |  |  118|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4381|  5.69k|    }
 4382|  5.67k|    return ntbytes;
 4383|  5.69k|  }
 4384|       |
 4385|  41.3k|  ebsize = header->blocksize + header->typesize * (signed)sizeof(int32_t);
 4386|  41.3k|  struct thread_context* scontext = context->serial_context;
 4387|       |  /* Resize the temporaries in serial context if needed */
 4388|  41.3k|  if (header->blocksize > scontext->tmp_blocksize) {
  ------------------
  |  Branch (4388:7): [True: 0, False: 41.3k]
  ------------------
 4389|      0|    my_free(scontext->tmp);
 4390|      0|    scontext->tmp_nbytes = (size_t)4 * ebsize;
 4391|      0|    scontext->tmp = my_malloc(scontext->tmp_nbytes);
 4392|      0|    BLOSC_ERROR_NULL(scontext->tmp, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|      0|    do {                                            \
  |  |  105|      0|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4393|      0|    scontext->tmp2 = scontext->tmp + ebsize;
 4394|      0|    scontext->tmp3 = scontext->tmp2 + ebsize;
 4395|      0|    scontext->tmp4 = scontext->tmp3 + ebsize;
 4396|      0|    scontext->tmp_blocksize = (int32_t)header->blocksize;
 4397|      0|  }
 4398|       |
 4399|  84.4k|  for (j = 0; j < context->nblocks; j++) {
  ------------------
  |  Branch (4399:15): [True: 71.3k, False: 13.0k]
  ------------------
 4400|  71.3k|    bsize = header->blocksize;
 4401|  71.3k|    leftoverblock = 0;
 4402|  71.3k|    if ((j == context->nblocks - 1) && (context->leftover > 0)) {
  ------------------
  |  Branch (4402:9): [True: 41.3k, False: 30.0k]
  |  Branch (4402:40): [True: 30.0k, False: 11.3k]
  ------------------
 4403|  30.0k|      bsize = context->leftover;
 4404|  30.0k|      leftoverblock = 1;
 4405|  30.0k|    }
 4406|       |
 4407|       |    /* Compute start & stop for each block */
 4408|  71.3k|    startb = start * header->typesize - j * header->blocksize;
 4409|  71.3k|    stopb = stop * header->typesize - j * header->blocksize;
 4410|  71.3k|    if (stopb <= 0) {
  ------------------
  |  Branch (4410:9): [True: 28.3k, False: 43.0k]
  ------------------
 4411|       |      // We can exit as soon as this block is beyond stop
 4412|  28.3k|      break;
 4413|  28.3k|    }
 4414|  43.0k|    if (startb >= header->blocksize) {
  ------------------
  |  Branch (4414:9): [True: 1.64k, False: 41.4k]
  ------------------
 4415|  1.64k|      continue;
 4416|  1.64k|    }
 4417|  41.4k|    if (startb < 0) {
  ------------------
  |  Branch (4417:9): [True: 59, False: 41.3k]
  ------------------
 4418|     59|      startb = 0;
 4419|     59|    }
 4420|  41.4k|    if (stopb > header->blocksize) {
  ------------------
  |  Branch (4420:9): [True: 59, False: 41.3k]
  ------------------
 4421|     59|      stopb = header->blocksize;
 4422|     59|    }
 4423|  41.4k|    bsize2 = stopb - startb;
 4424|       |
 4425|  41.4k|#if defined(HAVE_ZFP)
 4426|  41.4k|    if (context->compcode == BLOSC_CODEC_ZFP_FIXED_RATE) {
  ------------------
  |  Branch (4426:9): [True: 10.1k, False: 31.3k]
  ------------------
 4427|  10.1k|      scontext->zfp_cell_start = startb / context->typesize;
 4428|  10.1k|      scontext->zfp_cell_nitems = nitems;
 4429|  10.1k|    }
 4430|  41.4k|#endif /* HAVE_ZFP */
 4431|       |
 4432|       |    /* Do the actual data copy */
 4433|       |    // Regular decompression.  Put results in tmp2.
 4434|       |    // If the block is aligned and the worst case fits in destination, let's avoid a copy
 4435|  41.4k|    bool get_single_block = ((startb == 0) && (bsize == nitems_bytes));
  ------------------
  |  Branch (4435:30): [True: 1.33k, False: 40.0k]
  |  Branch (4435:47): [True: 5, False: 1.33k]
  ------------------
 4436|  41.4k|    uint8_t* tmp2 = get_single_block ? dest : scontext->tmp2;
  ------------------
  |  Branch (4436:21): [True: 5, False: 41.4k]
  ------------------
 4437|       |
 4438|       |    // If memcpyed we don't have a bstarts section (because it is not needed)
 4439|  41.4k|    int32_t src_offset = memcpyed ?
  ------------------
  |  Branch (4439:26): [True: 0, False: 41.4k]
  ------------------
 4440|  41.4k|      context->header_overhead + j * header->blocksize : sw32_(bstarts + j);
 4441|       |
 4442|  41.4k|    int32_t cbytes = blosc_d(context->serial_context, bsize, leftoverblock, memcpyed,
 4443|  41.4k|                             src, srcsize, src_offset, j,
 4444|  41.4k|                             tmp2, 0, scontext->tmp, scontext->tmp3);
 4445|  41.4k|    if (cbytes < 0) {
  ------------------
  |  Branch (4445:9): [True: 0, False: 41.4k]
  ------------------
 4446|      0|      ntbytes = cbytes;
 4447|      0|      break;
 4448|      0|    }
 4449|  41.4k|    if (scontext->zfp_cell_nitems > 0) {
  ------------------
  |  Branch (4449:9): [True: 10.1k, False: 31.3k]
  ------------------
 4450|  10.1k|      if (cbytes == bsize2) {
  ------------------
  |  Branch (4450:11): [True: 3, False: 10.1k]
  ------------------
 4451|      3|        memcpy((uint8_t *) dest, tmp2, (unsigned int) bsize2);
 4452|  10.1k|      } else if (cbytes == context->blocksize) {
  ------------------
  |  Branch (4452:18): [True: 10.0k, False: 40]
  ------------------
 4453|  10.0k|        memcpy((uint8_t *) dest, tmp2 + scontext->zfp_cell_start * context->typesize, (unsigned int) bsize2);
 4454|  10.0k|        cbytes = bsize2;
 4455|  10.0k|      }
 4456|  31.3k|    } else if (!get_single_block) {
  ------------------
  |  Branch (4456:16): [True: 31.3k, False: 4]
  ------------------
 4457|       |      /* Copy to destination */
 4458|  31.3k|      memcpy((uint8_t *) dest + ntbytes, tmp2 + startb, (unsigned int) bsize2);
 4459|  31.3k|    }
 4460|  41.4k|    ntbytes += bsize2;
 4461|  41.4k|  }
 4462|       |
 4463|  41.3k|  scontext->zfp_cell_nitems = 0;
 4464|       |
 4465|  41.3k|  if (ntbytes >= 0 && ntbytes != nitems_bytes) {
  ------------------
  |  Branch (4465:7): [True: 41.3k, False: 0]
  |  Branch (4465:23): [True: 0, False: 41.3k]
  ------------------
 4466|       |    // A partial decode must not look like a success: callers that only test for
 4467|       |    // a negative return would silently keep hold of an incompletely filled dest.
 4468|      0|    BLOSC_TRACE_ERROR("Only %d bytes out of the %d requested could be decoded.",
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4469|      0|                      ntbytes, nitems_bytes);
 4470|      0|    return BLOSC2_ERROR_DATA;
 4471|      0|  }
 4472|       |
 4473|  41.3k|  return ntbytes;
 4474|  41.3k|}
blosc2_getitem:
 4476|  47.2k|int blosc2_getitem(const void* src, int32_t srcsize, int start, int nitems, void* dest, int32_t destsize) {
 4477|  47.2k|  blosc2_context context;
 4478|  47.2k|  int result;
 4479|       |
 4480|       |  /* Minimally populate the context */
 4481|  47.2k|  memset(&context, 0, sizeof(blosc2_context));
 4482|       |
 4483|  47.2k|  context.schunk = g_schunk;
 4484|  47.2k|  context.nthreads = 1;  // force a serial decompression; fixes #95
 4485|       |
 4486|       |  /* Call the actual getitem function */
 4487|  47.2k|  result = blosc2_getitem_ctx(&context, src, srcsize, start, nitems, dest, destsize);
 4488|       |
 4489|       |  /* Release resources */
 4490|  47.2k|  if (context.serial_context != NULL) {
  ------------------
  |  Branch (4490:7): [True: 47.2k, False: 0]
  ------------------
 4491|  47.2k|    free_thread_context(context.serial_context);
 4492|  47.2k|  }
 4493|  47.2k|  return result;
 4494|  47.2k|}
blosc2_getitem_ctx:
 4542|  47.2k|    int start, int nitems, void* dest, int32_t destsize) {
 4543|  47.2k|  blosc_header header;
 4544|  47.2k|  int result = getitem_read_header(src, srcsize, &header);
 4545|  47.2k|  if (result < 0) {
  ------------------
  |  Branch (4545:7): [True: 0, False: 47.2k]
  ------------------
 4546|      0|    return result;
 4547|      0|  }
 4548|       |
 4549|  47.2k|  return getitem_with_header(context, &header, src, srcsize, start, nitems, dest, destsize);
 4550|  47.2k|}
blosc2_get_nthreads:
 5608|  23.9k|{
 5609|  23.9k|  int16_t nthreads;
 5610|  23.9k|  if (!g_initlib) {
  ------------------
  |  Branch (5610:7): [True: 0, False: 23.9k]
  ------------------
 5611|      0|    blosc2_init();
 5612|      0|  }
 5613|  23.9k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  23.9k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5614|  23.9k|  nthreads = g_nthreads;
 5615|  23.9k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  23.9k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5616|  23.9k|  return nthreads;
 5617|  23.9k|}
blosc2_set_nthreads:
 5619|  12.2k|int16_t blosc2_set_nthreads(int16_t nthreads) {
 5620|  12.2k|  int16_t ret;          /* the previous number of threads */
 5621|       |
 5622|       |  /* Check whether the library should be initialized */
 5623|  12.2k|  if (!g_initlib) blosc2_init();
  ------------------
  |  Branch (5623:7): [True: 0, False: 12.2k]
  ------------------
 5624|       |
 5625|  12.2k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  12.2k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5626|  12.2k|  ret = g_nthreads;
 5627|  12.2k|  if (nthreads != ret) {
  ------------------
  |  Branch (5627:7): [True: 0, False: 12.2k]
  ------------------
 5628|      0|    int16_t old_new_nthreads = g_global_context->new_nthreads;
 5629|      0|    int16_t old_nthreads = g_global_context->nthreads;
 5630|      0|    g_nthreads = nthreads;
 5631|      0|    g_global_context->new_nthreads = nthreads;
 5632|      0|    int16_t ret2 = check_nthreads(g_global_context);
 5633|      0|    if (ret2 < 0) {
  ------------------
  |  Branch (5633:9): [True: 0, False: 0]
  ------------------
 5634|      0|      g_nthreads = ret;
 5635|      0|      g_global_context->new_nthreads = old_new_nthreads;
 5636|      0|      g_global_context->nthreads = old_nthreads;
 5637|      0|      check_nthreads(g_global_context);
 5638|      0|      blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5639|      0|      return ret2;
 5640|      0|    }
 5641|      0|  }
 5642|  12.2k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  12.2k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5643|       |
 5644|  12.2k|  return ret;
 5645|  12.2k|}
blosc2_cbuffer_sizes:
 5797|  47.2M|int blosc2_cbuffer_sizes(const void* cbuffer, int32_t* nbytes, int32_t* cbytes, int32_t* blocksize) {
 5798|  47.2M|  blosc_header header;
 5799|  47.2M|  int rc = read_chunk_header((uint8_t *) cbuffer, BLOSC_MIN_HEADER_LENGTH, false, &header);
 5800|  47.2M|  if (rc < 0) {
  ------------------
  |  Branch (5800:7): [True: 50, False: 47.2M]
  ------------------
 5801|       |    /* Return zeros if error reading header */
 5802|     50|    memset(&header, 0, sizeof(header));
 5803|     50|  }
 5804|       |
 5805|       |  /* Read the interesting values */
 5806|  47.2M|  if (nbytes != NULL)
  ------------------
  |  Branch (5806:7): [True: 47.2M, False: 34.3k]
  ------------------
 5807|  47.2M|    *nbytes = header.nbytes;
 5808|  47.2M|  if (cbytes != NULL)
  ------------------
  |  Branch (5808:7): [True: 47.2M, False: 0]
  ------------------
 5809|  47.2M|    *cbytes = header.cbytes;
 5810|  47.2M|  if (blocksize != NULL)
  ------------------
  |  Branch (5810:7): [True: 58.9k, False: 47.2M]
  ------------------
 5811|  58.9k|    *blocksize = header.blocksize;
 5812|  47.2M|  return rc;
 5813|  47.2M|}
blosc2_init:
 5948|  12.2k|void blosc2_init(void) {
 5949|       |  /* Return if Blosc is already initialized */
 5950|  12.2k|  if (g_initlib) return;
  ------------------
  |  Branch (5950:7): [True: 0, False: 12.2k]
  ------------------
 5951|       |
 5952|  12.2k|  BLOSC2_IO_CB_DEFAULTS.id = BLOSC2_IO_FILESYSTEM;
 5953|  12.2k|  BLOSC2_IO_CB_DEFAULTS.name = "filesystem";
 5954|  12.2k|  BLOSC2_IO_CB_DEFAULTS.is_allocation_necessary = true;
 5955|  12.2k|  BLOSC2_IO_CB_DEFAULTS.open = (blosc2_open_cb) blosc2_stdio_open;
 5956|  12.2k|  BLOSC2_IO_CB_DEFAULTS.close = (blosc2_close_cb) blosc2_stdio_close;
 5957|  12.2k|  BLOSC2_IO_CB_DEFAULTS.size = (blosc2_size_cb) blosc2_stdio_size;
 5958|  12.2k|  BLOSC2_IO_CB_DEFAULTS.write = (blosc2_write_cb) blosc2_stdio_write;
 5959|  12.2k|  BLOSC2_IO_CB_DEFAULTS.read = (blosc2_read_cb) blosc2_stdio_read;
 5960|  12.2k|  BLOSC2_IO_CB_DEFAULTS.truncate = (blosc2_truncate_cb) blosc2_stdio_truncate;
 5961|  12.2k|  BLOSC2_IO_CB_DEFAULTS.destroy = (blosc2_destroy_cb) blosc2_stdio_destroy;
 5962|       |
 5963|  12.2k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_DEFAULTS);
 5964|       |
 5965|  12.2k|  BLOSC2_IO_CB_MMAP.id = BLOSC2_IO_FILESYSTEM_MMAP;
 5966|  12.2k|  BLOSC2_IO_CB_MMAP.name = "filesystem_mmap";
 5967|  12.2k|  BLOSC2_IO_CB_MMAP.is_allocation_necessary = false;
 5968|  12.2k|  BLOSC2_IO_CB_MMAP.open = (blosc2_open_cb) blosc2_stdio_mmap_open;
 5969|  12.2k|  BLOSC2_IO_CB_MMAP.close = (blosc2_close_cb) blosc2_stdio_mmap_close;
 5970|  12.2k|  BLOSC2_IO_CB_MMAP.read = (blosc2_read_cb) blosc2_stdio_mmap_read;
 5971|  12.2k|  BLOSC2_IO_CB_MMAP.size = (blosc2_size_cb) blosc2_stdio_mmap_size;
 5972|  12.2k|  BLOSC2_IO_CB_MMAP.write = (blosc2_write_cb) blosc2_stdio_mmap_write;
 5973|  12.2k|  BLOSC2_IO_CB_MMAP.truncate = (blosc2_truncate_cb) blosc2_stdio_mmap_truncate;
 5974|  12.2k|  BLOSC2_IO_CB_MMAP.destroy = (blosc2_destroy_cb) blosc2_stdio_mmap_destroy;
 5975|       |
 5976|  12.2k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_MMAP);
 5977|       |
 5978|  12.2k|  g_ncodecs = 0;
 5979|  12.2k|  g_nfilters = 0;
 5980|  12.2k|  g_ntuners = 0;
 5981|       |
 5982|  12.2k|#if defined(HAVE_PLUGINS)
 5983|  12.2k|  #include "blosc2/blosc2-common.h"
 5984|  12.2k|  #include "blosc2/blosc2-stdio.h"
 5985|  12.2k|  register_codecs();
 5986|  12.2k|  register_filters();
 5987|  12.2k|  register_tuners();
 5988|  12.2k|#endif
 5989|  12.2k|  blosc2_pthread_mutex_init(&global_comp_mutex, NULL);
  ------------------
  |  |   90|  12.2k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5990|  12.2k|  blosc2_pthread_mutex_init(&pool_registry_mutex, NULL);
  ------------------
  |  |   90|  12.2k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5991|       |  /* Create a global context */
 5992|  12.2k|  g_global_context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 5993|  12.2k|  memset(g_global_context, 0, sizeof(blosc2_context));
 5994|  12.2k|  g_global_context->nthreads = g_nthreads;
 5995|  12.2k|  g_global_context->new_nthreads = g_nthreads;
 5996|  12.2k|  blosc2_pthread_mutex_init(&g_global_context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  12.2k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5997|  12.2k|  g_initlib = 1;
 5998|  12.2k|}
blosc2_free_resources:
 6001|  12.2k|int blosc2_free_resources(void) {
 6002|       |  /* Return if Blosc is not initialized */
 6003|  12.2k|  if (!g_initlib) return BLOSC2_ERROR_FAILURE;
  ------------------
  |  Branch (6003:7): [True: 0, False: 12.2k]
  ------------------
 6004|       |
 6005|  12.2k|  return release_thread_backend(g_global_context);
 6006|  12.2k|}
blosc2_destroy:
 6009|  12.2k|void blosc2_destroy(void) {
 6010|       |  /* Return if Blosc is not initialized */
 6011|  12.2k|  if (!g_initlib) return;
  ------------------
  |  Branch (6011:7): [True: 0, False: 12.2k]
  ------------------
 6012|       |
 6013|  12.2k|  blosc2_free_resources();
 6014|  12.2k|  g_initlib = 0;
 6015|  12.2k|  blosc2_free_ctx(g_global_context);
 6016|       |
 6017|       |  /* Bump the epoch so any live context can detect its pool is now stale.
 6018|       |   * Do this before freeing the pools so that release_thread_backend callers
 6019|       |   * that race with us will take the "skip" path rather than locking the
 6020|       |   * soon-to-be-destroyed pool_registry_mutex. */
 6021|  12.2k|  g_destroy_count++;
 6022|       |
 6023|       |  /* Tear down any remaining shared pools */
 6024|  12.2k|  struct blosc_shared_pool *pool = shared_pools;
 6025|  12.2k|  while (pool != NULL) {
  ------------------
  |  Branch (6025:10): [True: 0, False: 12.2k]
  ------------------
 6026|      0|    struct blosc_shared_pool *next = pool->next;
 6027|      0|    destroy_shared_pool(pool);
 6028|      0|    pool = next;
 6029|      0|  }
 6030|  12.2k|  shared_pools = NULL;
 6031|  12.2k|  blosc2_pthread_mutex_destroy(&pool_registry_mutex);
  ------------------
  |  |   91|  12.2k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6032|       |
 6033|  12.2k|  blosc2_pthread_mutex_destroy(&global_comp_mutex);
  ------------------
  |  |   91|  12.2k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6034|  12.2k|}
blosc2_create_cctx:
 6040|  23.7k|blosc2_context* blosc2_create_cctx(blosc2_cparams cparams) {
 6041|  23.7k|  blosc2_context* context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 6042|  23.7k|  BLOSC_ERROR_NULL(context, NULL);
  ------------------
  |  |  104|  23.7k|    do {                                            \
  |  |  105|  23.7k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 23.7k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  23.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 23.7k]
  |  |  ------------------
  ------------------
 6043|       |
 6044|       |  /* Populate the context, using zeros as default values */
 6045|  23.7k|  memset(context, 0, sizeof(blosc2_context));
 6046|  23.7k|  context->do_compress = 1;   /* meant for compression */
 6047|  23.7k|  context->use_dict = cparams.use_dict;
 6048|  23.7k|  if (cparams.instr_codec) {
  ------------------
  |  Branch (6048:7): [True: 0, False: 23.7k]
  ------------------
 6049|      0|    context->blosc2_flags = BLOSC2_INSTR_CODEC;
 6050|      0|  }
 6051|       |
 6052|   166k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (6052:19): [True: 142k, False: 23.7k]
  ------------------
 6053|   142k|    context->filters[i] = cparams.filters[i];
 6054|   142k|    context->filters_meta[i] = cparams.filters_meta[i];
 6055|       |
 6056|   142k|    if (context->filters[i] >= BLOSC_LAST_FILTER && context->filters[i] <= BLOSC2_DEFINED_FILTERS_STOP) {
  ------------------
  |  Branch (6056:9): [True: 2.94k, False: 139k]
  |  Branch (6056:53): [True: 10, False: 2.93k]
  ------------------
 6057|     10|      BLOSC_TRACE_ERROR("filter (%d) is not yet defined",
  ------------------
  |  |   93|     10|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     10|    do {                                            \
  |  |  |  |   98|     10|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     10|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 10, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     10|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6058|     10|                        context->filters[i]);
 6059|     10|      free(context);
 6060|     10|      return NULL;
 6061|     10|    }
 6062|   142k|    if (context->filters[i] > BLOSC_LAST_REGISTERED_FILTER && context->filters[i] <= BLOSC2_GLOBAL_REGISTERED_FILTERS_STOP) {
  ------------------
  |  Branch (6062:9): [True: 1.96k, False: 140k]
  |  Branch (6062:63): [True: 11, False: 1.95k]
  ------------------
 6063|     11|      BLOSC_TRACE_ERROR("filter (%d) is not yet defined",
  ------------------
  |  |   93|     11|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     11|    do {                                            \
  |  |  |  |   98|     11|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     11|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 11, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     11|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6064|     11|                        context->filters[i]);
 6065|     11|      free(context);
 6066|     11|      return NULL;
 6067|     11|    }
 6068|   142k|  }
 6069|       |
 6070|  23.7k|#if defined(HAVE_ZFP)
 6071|  23.7k|#include "blosc2/codecs-registry.h"
 6072|  23.7k|  if ((context->compcode >= BLOSC_CODEC_ZFP_FIXED_ACCURACY) && (context->compcode <= BLOSC_CODEC_ZFP_FIXED_RATE)) {
  ------------------
  |  Branch (6072:7): [True: 0, False: 23.7k]
  |  Branch (6072:64): [True: 0, False: 0]
  ------------------
 6073|      0|    for (int i = 0; i < BLOSC2_MAX_FILTERS; ++i) {
  ------------------
  |  Branch (6073:21): [True: 0, False: 0]
  ------------------
 6074|      0|      if ((context->filters[i] == BLOSC_SHUFFLE) || (context->filters[i] == BLOSC_BITSHUFFLE)) {
  ------------------
  |  Branch (6074:11): [True: 0, False: 0]
  |  Branch (6074:53): [True: 0, False: 0]
  ------------------
 6075|      0|        BLOSC_TRACE_ERROR("ZFP cannot be run in presence of SHUFFLE / BITSHUFFLE");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6076|      0|        return NULL;
 6077|      0|      }
 6078|      0|    }
 6079|      0|  }
 6080|  23.7k|#endif /* HAVE_ZFP */
 6081|       |
 6082|       |  /* Check for a BLOSC_SHUFFLE environment variable */
 6083|  23.7k|  int doshuffle = -1;
 6084|  23.7k|  char* envvar = getenv("BLOSC_SHUFFLE");
 6085|  23.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (6085:7): [True: 0, False: 23.7k]
  ------------------
 6086|      0|    if (strcmp(envvar, "NOSHUFFLE") == 0) {
  ------------------
  |  Branch (6086:9): [True: 0, False: 0]
  ------------------
 6087|      0|      doshuffle = BLOSC_NOSHUFFLE;
 6088|      0|    }
 6089|      0|    else if (strcmp(envvar, "SHUFFLE") == 0) {
  ------------------
  |  Branch (6089:14): [True: 0, False: 0]
  ------------------
 6090|      0|      doshuffle = BLOSC_SHUFFLE;
 6091|      0|    }
 6092|      0|    else if (strcmp(envvar, "BITSHUFFLE") == 0) {
  ------------------
  |  Branch (6092:14): [True: 0, False: 0]
  ------------------
 6093|      0|      doshuffle = BLOSC_BITSHUFFLE;
 6094|      0|    }
 6095|      0|    else {
 6096|      0|      BLOSC_TRACE_WARNING("BLOSC_SHUFFLE environment variable '%s' not recognized\n", envvar);
  ------------------
  |  |   94|      0|#define BLOSC_TRACE_WARNING(msg, ...) BLOSC_TRACE(warning, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6097|      0|    }
 6098|      0|  }
 6099|       |  /* Check for a BLOSC_DELTA environment variable */
 6100|  23.7k|  int dodelta = BLOSC_NOFILTER;
 6101|  23.7k|  envvar = getenv("BLOSC_DELTA");
 6102|  23.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (6102:7): [True: 0, False: 23.7k]
  ------------------
 6103|      0|    if (strcmp(envvar, "1") == 0) {
  ------------------
  |  Branch (6103:9): [True: 0, False: 0]
  ------------------
 6104|      0|      dodelta = BLOSC_DELTA;
 6105|      0|    } else if (strcmp(envvar, "0") == 0){
  ------------------
  |  Branch (6105:16): [True: 0, False: 0]
  ------------------
 6106|      0|      dodelta = BLOSC_NOFILTER;
 6107|      0|    }
 6108|      0|    else {
 6109|      0|      BLOSC_TRACE_WARNING("BLOSC_DELTA environment variable '%s' not recognized\n", envvar);
  ------------------
  |  |   94|      0|#define BLOSC_TRACE_WARNING(msg, ...) BLOSC_TRACE(warning, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6110|      0|    }
 6111|      0|  }
 6112|       |  /* Check for a BLOSC_TYPESIZE environment variable */
 6113|  23.7k|  context->typesize = cparams.typesize;
 6114|  23.7k|  envvar = getenv("BLOSC_TYPESIZE");
 6115|  23.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (6115:7): [True: 0, False: 23.7k]
  ------------------
 6116|      0|    int32_t value;
 6117|      0|    errno = 0; /* To distinguish success/failure after call */
 6118|      0|    value = (int32_t) strtol(envvar, NULL, 10);
 6119|      0|    if ((errno != EINVAL) && (value > 0)) {
  ------------------
  |  Branch (6119:9): [True: 0, False: 0]
  |  Branch (6119:30): [True: 0, False: 0]
  ------------------
 6120|      0|      context->typesize = value;
 6121|      0|    }
 6122|      0|    else {
 6123|      0|      BLOSC_TRACE_WARNING("BLOSC_TYPESIZE environment variable '%s' not recognized\n", envvar);
  ------------------
  |  |   94|      0|#define BLOSC_TRACE_WARNING(msg, ...) BLOSC_TRACE(warning, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6124|      0|    }
 6125|      0|  }
 6126|  23.7k|  build_filters(doshuffle, dodelta, context->typesize, context->filters);
 6127|       |
 6128|  23.7k|  context->clevel = cparams.clevel;
 6129|       |  /* Check for a BLOSC_CLEVEL environment variable */
 6130|  23.7k|  envvar = getenv("BLOSC_CLEVEL");
 6131|  23.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (6131:7): [True: 0, False: 23.7k]
  ------------------
 6132|      0|    int value;
 6133|      0|    errno = 0; /* To distinguish success/failure after call */
 6134|      0|    value = (int)strtol(envvar, NULL, 10);
 6135|      0|    if ((errno != EINVAL) && (value >= 0)) {
  ------------------
  |  Branch (6135:9): [True: 0, False: 0]
  |  Branch (6135:30): [True: 0, False: 0]
  ------------------
 6136|      0|      context->clevel = value;
 6137|      0|    }
 6138|      0|    else {
 6139|      0|      BLOSC_TRACE_WARNING("BLOSC_CLEVEL environment variable '%s' not recognized\n", envvar);
  ------------------
  |  |   94|      0|#define BLOSC_TRACE_WARNING(msg, ...) BLOSC_TRACE(warning, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6140|      0|    }
 6141|      0|  }
 6142|       |
 6143|  23.7k|  context->compcode = cparams.compcode;
 6144|       |  /* Check for a BLOSC_COMPRESSOR environment variable */
 6145|  23.7k|  envvar = getenv("BLOSC_COMPRESSOR");
 6146|  23.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (6146:7): [True: 0, False: 23.7k]
  ------------------
 6147|      0|    int codec = blosc2_compname_to_compcode(envvar);
 6148|      0|    if (codec >= BLOSC_LAST_CODEC) {
  ------------------
  |  Branch (6148:9): [True: 0, False: 0]
  ------------------
 6149|      0|      BLOSC_TRACE_ERROR("User defined codecs cannot be set here. Use Blosc2 mechanism instead.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6150|      0|      return NULL;
 6151|      0|    }
 6152|      0|    context->compcode = codec;
 6153|      0|  }
 6154|  23.7k|  context->compcode_meta = cparams.compcode_meta;
 6155|       |
 6156|  23.7k|  context->blocksize = cparams.blocksize;
 6157|       |  /* Check for a BLOSC_BLOCKSIZE environment variable */
 6158|  23.7k|  envvar = getenv("BLOSC_BLOCKSIZE");
 6159|  23.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (6159:7): [True: 0, False: 23.7k]
  ------------------
 6160|      0|    int32_t blocksize;
 6161|      0|    errno = 0; /* To distinguish success/failure after call */
 6162|      0|    blocksize = (int32_t) strtol(envvar, NULL, 10);
 6163|      0|    if ((errno != EINVAL) && (blocksize > 0)) {
  ------------------
  |  Branch (6163:9): [True: 0, False: 0]
  |  Branch (6163:30): [True: 0, False: 0]
  ------------------
 6164|      0|      context->blocksize = blocksize;
 6165|      0|    }
 6166|      0|    else {
 6167|      0|      BLOSC_TRACE_WARNING("BLOSC_BLOCKSIZE environment variable '%s' not recognized\n", envvar);
  ------------------
  |  |   94|      0|#define BLOSC_TRACE_WARNING(msg, ...) BLOSC_TRACE(warning, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6168|      0|    }
 6169|      0|  }
 6170|       |
 6171|  23.7k|  context->nthreads = cparams.nthreads;
 6172|       |  /* Check for a BLOSC_NTHREADS environment variable */
 6173|  23.7k|  envvar = getenv("BLOSC_NTHREADS");
 6174|  23.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (6174:7): [True: 0, False: 23.7k]
  ------------------
 6175|      0|    errno = 0; /* To distinguish success/failure after call */
 6176|      0|    int16_t nthreads = (int16_t) strtol(envvar, NULL, 10);
 6177|      0|    if ((errno != EINVAL) && (nthreads > 0)) {
  ------------------
  |  Branch (6177:9): [True: 0, False: 0]
  |  Branch (6177:30): [True: 0, False: 0]
  ------------------
 6178|      0|      context->nthreads = nthreads;
 6179|      0|    }
 6180|      0|    else {
 6181|      0|      BLOSC_TRACE_WARNING("BLOSC_NTHREADS environment variable '%s' not recognized\n", envvar);
  ------------------
  |  |   94|      0|#define BLOSC_TRACE_WARNING(msg, ...) BLOSC_TRACE(warning, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6182|      0|    }
 6183|      0|  }
 6184|  23.7k|  context->new_nthreads = context->nthreads;
 6185|       |
 6186|  23.7k|  context->splitmode = cparams.splitmode;
 6187|       |  /* Check for a BLOSC_SPLITMODE environment variable */
 6188|  23.7k|  envvar = getenv("BLOSC_SPLITMODE");
 6189|  23.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (6189:7): [True: 0, False: 23.7k]
  ------------------
 6190|      0|    int32_t splitmode = -1;
 6191|      0|    if (strcmp(envvar, "ALWAYS") == 0) {
  ------------------
  |  Branch (6191:9): [True: 0, False: 0]
  ------------------
 6192|      0|      splitmode = BLOSC_ALWAYS_SPLIT;
 6193|      0|    }
 6194|      0|    else if (strcmp(envvar, "NEVER") == 0) {
  ------------------
  |  Branch (6194:14): [True: 0, False: 0]
  ------------------
 6195|      0|      splitmode = BLOSC_NEVER_SPLIT;
 6196|      0|    }
 6197|      0|    else if (strcmp(envvar, "AUTO") == 0) {
  ------------------
  |  Branch (6197:14): [True: 0, False: 0]
  ------------------
 6198|      0|      splitmode = BLOSC_AUTO_SPLIT;
 6199|      0|    }
 6200|      0|    else if (strcmp(envvar, "FORWARD_COMPAT") == 0) {
  ------------------
  |  Branch (6200:14): [True: 0, False: 0]
  ------------------
 6201|      0|      splitmode = BLOSC_FORWARD_COMPAT_SPLIT;
 6202|      0|    }
 6203|      0|    else {
 6204|      0|      BLOSC_TRACE_WARNING("BLOSC_SPLITMODE environment variable '%s' not recognized\n", envvar);
  ------------------
  |  |   94|      0|#define BLOSC_TRACE_WARNING(msg, ...) BLOSC_TRACE(warning, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6205|      0|    }
 6206|      0|    if (splitmode >= 0) {
  ------------------
  |  Branch (6206:9): [True: 0, False: 0]
  ------------------
 6207|      0|      context->splitmode = splitmode;
 6208|      0|    }
 6209|      0|  }
 6210|       |
 6211|  23.7k|  context->threads_started = 0;
 6212|  23.7k|  blosc2_pthread_mutex_init(&context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  23.7k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 6213|  23.7k|  context->schunk = cparams.schunk;
 6214|       |
 6215|  23.7k|  if (cparams.prefilter != NULL) {
  ------------------
  |  Branch (6215:7): [True: 0, False: 23.7k]
  ------------------
 6216|      0|    context->prefilter = cparams.prefilter;
 6217|      0|    context->preparams = (blosc2_prefilter_params*)my_malloc(sizeof(blosc2_prefilter_params));
 6218|      0|    BLOSC_ERROR_NULL(context->preparams, NULL);
  ------------------
  |  |  104|      0|    do {                                            \
  |  |  105|      0|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6219|      0|    memcpy(context->preparams, cparams.preparams, sizeof(blosc2_prefilter_params));
 6220|      0|  }
 6221|       |
 6222|  23.7k|  if (cparams.tuner_id <= 0) {
  ------------------
  |  Branch (6222:7): [True: 23.7k, False: 0]
  ------------------
 6223|  23.7k|    cparams.tuner_id = g_tuner;
 6224|  23.7k|  } else {
 6225|      0|    for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (6225:21): [True: 0, False: 0]
  ------------------
 6226|      0|      if (g_tuners[i].id == cparams.tuner_id) {
  ------------------
  |  Branch (6226:11): [True: 0, False: 0]
  ------------------
 6227|      0|        if (g_tuners[i].init == NULL) {
  ------------------
  |  Branch (6227:13): [True: 0, False: 0]
  ------------------
 6228|      0|          if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (6228:15): [True: 0, False: 0]
  ------------------
 6229|      0|            BLOSC_TRACE_ERROR("Could not load tuner %d.", g_tuners[i].id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6230|      0|            return NULL;
 6231|      0|          }
 6232|      0|        }
 6233|      0|        if (g_tuners[i].init(cparams.tuner_params, context, NULL) < 0) {
  ------------------
  |  Branch (6233:13): [True: 0, False: 0]
  ------------------
 6234|      0|          BLOSC_TRACE_ERROR("Error in user-defined tuner %d init function\n", cparams.tuner_id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6235|      0|          return NULL;
 6236|      0|        }
 6237|      0|        goto urtunersuccess;
 6238|      0|      }
 6239|      0|    }
 6240|      0|    BLOSC_TRACE_ERROR("User-defined tuner %d not found\n", cparams.tuner_id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6241|      0|    return NULL;
 6242|      0|  }
 6243|  23.7k|  urtunersuccess:;
 6244|       |
 6245|  23.7k|  context->tuner_id = cparams.tuner_id;
 6246|       |
 6247|  23.7k|  context->codec_params = cparams.codec_params;
 6248|  23.7k|  memcpy(context->filter_params, cparams.filter_params, BLOSC2_MAX_FILTERS * sizeof(void*));
 6249|       |
 6250|  23.7k|  return context;
 6251|  23.7k|}
blosc2_create_dctx:
 6254|  23.5k|blosc2_context* blosc2_create_dctx(blosc2_dparams dparams) {
 6255|  23.5k|  blosc2_context* context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 6256|  23.5k|  BLOSC_ERROR_NULL(context, NULL);
  ------------------
  |  |  104|  23.5k|    do {                                            \
  |  |  105|  23.5k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 23.5k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  23.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 23.5k]
  |  |  ------------------
  ------------------
 6257|       |
 6258|       |  /* Populate the context, using zeros as default values */
 6259|  23.5k|  memset(context, 0, sizeof(blosc2_context));
 6260|  23.5k|  context->do_compress = 0;   /* Meant for decompression */
 6261|       |
 6262|  23.5k|  context->nthreads = dparams.nthreads;
 6263|  23.5k|  char* envvar = getenv("BLOSC_NTHREADS");
 6264|  23.5k|  if (envvar != NULL) {
  ------------------
  |  Branch (6264:7): [True: 0, False: 23.5k]
  ------------------
 6265|      0|    errno = 0; /* To distinguish success/failure after call */
 6266|      0|    long nthreads = strtol(envvar, NULL, 10);
 6267|      0|    if ((errno != EINVAL) && (nthreads > 0)) {
  ------------------
  |  Branch (6267:9): [True: 0, False: 0]
  |  Branch (6267:30): [True: 0, False: 0]
  ------------------
 6268|      0|      context->nthreads = (int16_t) nthreads;
 6269|      0|    }
 6270|      0|  }
 6271|  23.5k|  context->new_nthreads = context->nthreads;
 6272|       |
 6273|  23.5k|  context->threads_started = 0;
 6274|  23.5k|  context->block_maskout = NULL;
 6275|  23.5k|  context->block_maskout_nitems = 0;
 6276|  23.5k|  blosc2_pthread_mutex_init(&context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  23.5k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 6277|  23.5k|  context->schunk = dparams.schunk;
 6278|       |
 6279|  23.5k|  if (dparams.postfilter != NULL) {
  ------------------
  |  Branch (6279:7): [True: 0, False: 23.5k]
  ------------------
 6280|      0|    context->postfilter = dparams.postfilter;
 6281|      0|    context->postparams = (blosc2_postfilter_params*)my_malloc(sizeof(blosc2_postfilter_params));
 6282|      0|    BLOSC_ERROR_NULL(context->postparams, NULL);
  ------------------
  |  |  104|      0|    do {                                            \
  |  |  105|      0|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 6283|      0|    memcpy(context->postparams, dparams.postparams, sizeof(blosc2_postfilter_params));
 6284|      0|  }
 6285|       |
 6286|  23.5k|  return context;
 6287|  23.5k|}
blosc2_free_ctx:
 6290|  59.4k|void blosc2_free_ctx(blosc2_context* context) {
 6291|  59.4k|  if (g_initlib ||
  ------------------
  |  Branch (6291:7): [True: 47.2k, False: 12.2k]
  ------------------
 6292|  12.2k|      context->thread_backend == BLOSC_BACKEND_PER_CONTEXT ||
  ------------------
  |  |   35|  71.7k|#define BLOSC_BACKEND_PER_CONTEXT 3   /* per-context threads; used on Windows */
  ------------------
  |  Branch (6292:7): [True: 0, False: 12.2k]
  ------------------
 6293|  47.2k|      context->thread_backend == BLOSC_BACKEND_CALLBACK) {
  ------------------
  |  |   34|  12.2k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (6293:7): [True: 0, False: 12.2k]
  ------------------
 6294|  47.2k|    release_thread_backend(context);
 6295|  47.2k|  }
 6296|  59.4k|  if (context->serial_context != NULL) {
  ------------------
  |  Branch (6296:7): [True: 11.3k, False: 48.0k]
  ------------------
 6297|  11.3k|    free_thread_context(context->serial_context);
 6298|  11.3k|  }
 6299|  59.4k|  blosc2_pthread_mutex_destroy(&context->nchunk_mutex);
  ------------------
  |  |   91|  59.4k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6300|  59.4k|  release_context_dict_buffer(context);
 6301|  59.4k|  if (context->dict_cdict != NULL) {
  ------------------
  |  Branch (6301:7): [True: 0, False: 59.4k]
  ------------------
 6302|      0|    if (context->compcode == BLOSC_LZ4) {
  ------------------
  |  Branch (6302:9): [True: 0, False: 0]
  ------------------
 6303|      0|      LZ4_freeStream((LZ4_stream_t*)context->dict_cdict);
 6304|      0|    } else if (context->compcode == BLOSC_LZ4HC) {
  ------------------
  |  Branch (6304:16): [True: 0, False: 0]
  ------------------
 6305|      0|      LZ4_freeStreamHC((LZ4_streamHC_t*)context->dict_cdict);
 6306|      0|    }
 6307|      0|#ifdef HAVE_ZSTD
 6308|      0|    else if (context->compcode == BLOSC_ZSTD) {
  ------------------
  |  Branch (6308:14): [True: 0, False: 0]
  ------------------
 6309|      0|      ZSTD_freeCDict(context->dict_cdict);
 6310|      0|    }
 6311|      0|#endif
 6312|      0|  }
 6313|  59.4k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (6313:7): [True: 2.25k, False: 57.2k]
  ------------------
 6314|  2.25k|#ifdef HAVE_ZSTD
 6315|  2.25k|    ZSTD_freeDDict(context->dict_ddict);
 6316|  2.25k|#endif
 6317|  2.25k|  }
 6318|  59.4k|  if (context->tuner_params != NULL) {
  ------------------
  |  Branch (6318:7): [True: 0, False: 59.4k]
  ------------------
 6319|      0|    int rc;
 6320|      0|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|      0|#define BLOSC_STUNE 0
  ------------------
  |  Branch (6320:9): [True: 0, False: 0]
  |  Branch (6320:49): [True: 0, False: 0]
  ------------------
 6321|      0|      rc = blosc_stune_free(context);
 6322|      0|    } else {
 6323|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (6323:23): [True: 0, False: 0]
  ------------------
 6324|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (6324:13): [True: 0, False: 0]
  ------------------
 6325|      0|          if (g_tuners[i].free == NULL) {
  ------------------
  |  Branch (6325:15): [True: 0, False: 0]
  ------------------
 6326|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (6326:17): [True: 0, False: 0]
  ------------------
 6327|      0|              BLOSC_TRACE_ERROR("Could not load tuner %d.", g_tuners[i].id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6328|      0|              return;
 6329|      0|            }
 6330|      0|          }
 6331|      0|          rc = g_tuners[i].free(context);
 6332|      0|          goto urtunersuccess;
 6333|      0|        }
 6334|      0|      }
 6335|      0|      BLOSC_TRACE_ERROR("User-defined tuner %d not found\n", context->tuner_id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6336|      0|      return;
 6337|      0|      urtunersuccess:;
 6338|      0|    }
 6339|      0|    if (rc < 0) {
  ------------------
  |  Branch (6339:9): [True: 0, False: 0]
  ------------------
 6340|      0|      BLOSC_TRACE_ERROR("Error in user-defined tuner free function\n");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6341|      0|      return;
 6342|      0|    }
 6343|      0|  }
 6344|       |  /* May be needed if codec_params ever contains nested objects
 6345|       |  if (context->codec_params != NULL) {
 6346|       |    int rc;
 6347|       |    for (int i = 0; i < g_ncodecs; ++i) {
 6348|       |      if (g_codecs[i].compcode == context->compcode) {
 6349|       |        if (g_codecs[i].free == NULL) {
 6350|       |          // Dynamically load codec plugin
 6351|       |          if (fill_codec(&g_codecs[i]) < 0) {
 6352|       |            BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
 6353|       |            return BLOSC2_ERROR_CODEC_SUPPORT;
 6354|       |          }
 6355|       |        }
 6356|       |        if (g_codecs[i].free == NULL){
 6357|       |          // no free func, codec_params is simple
 6358|       |          my_free(context->codec_params);
 6359|       |        }
 6360|       |        else{ // has free function for codec_params (e.g. openzl)
 6361|       |        rc = g_codecs[i].free(context->codec_params);
 6362|       |          goto urcodecsuccess;
 6363|       |        }
 6364|       |      }
 6365|       |    }
 6366|       |      BLOSC_TRACE_ERROR("User-defined compressor codec %d not found", context->compcode);
 6367|       |      return BLOSC2_ERROR_CODEC_SUPPORT;
 6368|       |    urcodecsuccess:;
 6369|       |    if (rc < 0) {
 6370|       |      BLOSC_TRACE_ERROR("Error in user-defined codec free function\n");
 6371|       |      return;
 6372|       |    }
 6373|       |  }
 6374|       |  */
 6375|  59.4k|  if (context->prefilter != NULL) {
  ------------------
  |  Branch (6375:7): [True: 0, False: 59.4k]
  ------------------
 6376|      0|    my_free(context->preparams);
 6377|      0|  }
 6378|  59.4k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (6378:7): [True: 0, False: 59.4k]
  ------------------
 6379|      0|    my_free(context->postparams);
 6380|      0|  }
 6381|       |
 6382|  59.4k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (6382:7): [True: 0, False: 59.4k]
  ------------------
 6383|      0|    free(context->block_maskout);
 6384|      0|  }
 6385|  59.4k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (6385:7): [True: 261, False: 59.2k]
  ------------------
 6386|    261|    free(context->blocknbytes);
 6387|    261|  }
 6388|  59.4k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (6388:7): [True: 261, False: 59.2k]
  ------------------
 6389|    261|    free(context->blockoffsets);
 6390|    261|  }
 6391|  59.4k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (6391:7): [True: 261, False: 59.2k]
  ------------------
 6392|    261|    free(context->blockcbytes);
 6393|    261|  }
 6394|  59.4k|  my_free(context);
 6395|  59.4k|}
blosc2_ctx_get_dparams:
 6422|  85.1k|int blosc2_ctx_get_dparams(blosc2_context *ctx, blosc2_dparams *dparams) {
 6423|  85.1k|  dparams->nthreads = ctx->nthreads;
 6424|  85.1k|  dparams->schunk = ctx->schunk;
 6425|  85.1k|  dparams->postfilter = ctx->postfilter;
 6426|  85.1k|  dparams->postparams = ctx->postparams;
 6427|  85.1k|  dparams->typesize = ctx->typesize;
 6428|       |
 6429|  85.1k|  return BLOSC2_ERROR_SUCCESS;
 6430|  85.1k|}
blosc2_chunk_zeros:
 6452|  10.6k|int blosc2_chunk_zeros(blosc2_cparams cparams, const int32_t nbytes, void* dest, int32_t destsize) {
 6453|  10.6k|  if (destsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (6453:7): [True: 0, False: 10.6k]
  ------------------
 6454|      0|    BLOSC_TRACE_ERROR("dest buffer is not long enough");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6455|      0|    return BLOSC2_ERROR_DATA;
 6456|      0|  }
 6457|       |
 6458|  10.6k|  if ((nbytes > 0) && (nbytes % cparams.typesize)) {
  ------------------
  |  Branch (6458:7): [True: 1.17k, False: 9.45k]
  |  Branch (6458:23): [True: 8, False: 1.16k]
  ------------------
 6459|      8|    BLOSC_TRACE_ERROR("nbytes must be a multiple of typesize");
  ------------------
  |  |   93|      8|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      8|    do {                                            \
  |  |  |  |   98|      8|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      8|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      8|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6460|      8|    return BLOSC2_ERROR_DATA;
 6461|      8|  }
 6462|       |
 6463|  10.6k|  blosc_header header;
 6464|  10.6k|  blosc2_context* context = blosc2_create_cctx(cparams);
 6465|  10.6k|  if (context == NULL) {
  ------------------
  |  Branch (6465:7): [True: 0, False: 10.6k]
  ------------------
 6466|      0|    BLOSC_TRACE_ERROR("Error while creating the compression context");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6467|      0|    return BLOSC2_ERROR_NULL_POINTER;
 6468|      0|  }
 6469|       |
 6470|  10.6k|  int error = initialize_context_compression(
 6471|  10.6k|          context, NULL, nbytes, dest, destsize,
 6472|  10.6k|          context->clevel, context->filters, context->filters_meta,
 6473|  10.6k|          context->typesize, context->compcode, context->blocksize,
 6474|  10.6k|          context->new_nthreads, context->nthreads, context->splitmode,
 6475|  10.6k|          context->tuner_id, context->tuner_params, context->schunk);
 6476|  10.6k|  if (error <= 0) {
  ------------------
  |  Branch (6476:7): [True: 6, False: 10.6k]
  ------------------
 6477|      6|    blosc2_free_ctx(context);
 6478|      6|    return error;
 6479|      6|  }
 6480|       |
 6481|  10.6k|  memset(&header, 0, sizeof(header));
 6482|  10.6k|  header.version = BLOSC2_VERSION_FORMAT_STABLE;
 6483|  10.6k|  header.versionlz = BLOSC_BLOSCLZ_VERSION_FORMAT;
 6484|  10.6k|  header.flags = BLOSC_DOSHUFFLE | BLOSC_DOBITSHUFFLE;  // extended header
 6485|  10.6k|  header.typesize = context->typesize;
 6486|  10.6k|  header.nbytes = (int32_t)nbytes;
 6487|  10.6k|  header.blocksize = context->blocksize;
 6488|  10.6k|  header.cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 6489|  10.6k|  header.blosc2_flags = BLOSC2_SPECIAL_ZERO << 4;  // mark chunk as all zeros
 6490|  10.6k|  memcpy((uint8_t *)dest, &header, sizeof(header));
 6491|       |
 6492|  10.6k|  blosc2_free_ctx(context);
 6493|       |
 6494|  10.6k|  return BLOSC_EXTENDED_HEADER_LENGTH;
 6495|  10.6k|}
blosc2_chunk_uninit:
 6499|    965|int blosc2_chunk_uninit(blosc2_cparams cparams, const int32_t nbytes, void* dest, int32_t destsize) {
 6500|    965|  if (destsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (6500:7): [True: 0, False: 965]
  ------------------
 6501|      0|    BLOSC_TRACE_ERROR("dest buffer is not long enough");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6502|      0|    return BLOSC2_ERROR_DATA;
 6503|      0|  }
 6504|       |
 6505|    965|  if (nbytes % cparams.typesize) {
  ------------------
  |  Branch (6505:7): [True: 4, False: 961]
  ------------------
 6506|      4|    BLOSC_TRACE_ERROR("nbytes must be a multiple of typesize");
  ------------------
  |  |   93|      4|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      4|    do {                                            \
  |  |  |  |   98|      4|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      4|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      4|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6507|      4|    return BLOSC2_ERROR_DATA;
 6508|      4|  }
 6509|       |
 6510|    961|  blosc_header header;
 6511|    961|  blosc2_context* context = blosc2_create_cctx(cparams);
 6512|    961|  if (context == NULL) {
  ------------------
  |  Branch (6512:7): [True: 0, False: 961]
  ------------------
 6513|      0|    BLOSC_TRACE_ERROR("Error while creating the compression context");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6514|      0|    return BLOSC2_ERROR_NULL_POINTER;
 6515|      0|  }
 6516|    961|  int error = initialize_context_compression(
 6517|    961|          context, NULL, nbytes, dest, destsize,
 6518|    961|          context->clevel, context->filters, context->filters_meta,
 6519|    961|          context->typesize, context->compcode, context->blocksize,
 6520|    961|          context->new_nthreads, context->nthreads, context->splitmode,
 6521|    961|          context->tuner_id, context->tuner_params, context->schunk);
 6522|    961|  if (error <= 0) {
  ------------------
  |  Branch (6522:7): [True: 3, False: 958]
  ------------------
 6523|      3|    blosc2_free_ctx(context);
 6524|      3|    return error;
 6525|      3|  }
 6526|       |
 6527|    958|  memset(&header, 0, sizeof(header));
 6528|    958|  header.version = BLOSC2_VERSION_FORMAT_STABLE;
 6529|    958|  header.versionlz = BLOSC_BLOSCLZ_VERSION_FORMAT;
 6530|    958|  header.flags = BLOSC_DOSHUFFLE | BLOSC_DOBITSHUFFLE;  // extended header
 6531|    958|  header.typesize = context->typesize;
 6532|    958|  header.nbytes = (int32_t)nbytes;
 6533|    958|  header.blocksize = context->blocksize;
 6534|    958|  header.cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 6535|    958|  header.blosc2_flags = BLOSC2_SPECIAL_UNINIT << 4;  // mark chunk as uninitialized
 6536|    958|  memcpy((uint8_t *)dest, &header, sizeof(header));
 6537|       |
 6538|    958|  blosc2_free_ctx(context);
 6539|       |
 6540|    958|  return BLOSC_EXTENDED_HEADER_LENGTH;
 6541|    961|}
blosc2_chunk_nans:
 6545|    179|int blosc2_chunk_nans(blosc2_cparams cparams, const int32_t nbytes, void* dest, int32_t destsize) {
 6546|    179|  if (destsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (6546:7): [True: 0, False: 179]
  ------------------
 6547|      0|    BLOSC_TRACE_ERROR("dest buffer is not long enough");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6548|      0|    return BLOSC2_ERROR_DATA;
 6549|      0|  }
 6550|       |
 6551|    179|  if (nbytes % cparams.typesize) {
  ------------------
  |  Branch (6551:7): [True: 2, False: 177]
  ------------------
 6552|      2|    BLOSC_TRACE_ERROR("nbytes must be a multiple of typesize");
  ------------------
  |  |   93|      2|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      2|    do {                                            \
  |  |  |  |   98|      2|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      2|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      2|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6553|      2|    return BLOSC2_ERROR_DATA;
 6554|      2|  }
 6555|       |
 6556|    177|  blosc_header header;
 6557|    177|  blosc2_context* context = blosc2_create_cctx(cparams);
 6558|    177|  if (context == NULL) {
  ------------------
  |  Branch (6558:7): [True: 0, False: 177]
  ------------------
 6559|      0|    BLOSC_TRACE_ERROR("Error while creating the compression context");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6560|      0|    return BLOSC2_ERROR_NULL_POINTER;
 6561|      0|  }
 6562|       |
 6563|    177|  int error = initialize_context_compression(
 6564|    177|          context, NULL, nbytes, dest, destsize,
 6565|    177|          context->clevel, context->filters, context->filters_meta,
 6566|    177|          context->typesize, context->compcode, context->blocksize,
 6567|    177|          context->new_nthreads, context->nthreads, context->splitmode,
 6568|    177|          context->tuner_id, context->tuner_params, context->schunk);
 6569|    177|  if (error <= 0) {
  ------------------
  |  Branch (6569:7): [True: 3, False: 174]
  ------------------
 6570|      3|    blosc2_free_ctx(context);
 6571|      3|    return error;
 6572|      3|  }
 6573|       |
 6574|    174|  memset(&header, 0, sizeof(header));
 6575|    174|  header.version = BLOSC2_VERSION_FORMAT_STABLE;
 6576|    174|  header.versionlz = BLOSC_BLOSCLZ_VERSION_FORMAT;
 6577|    174|  header.flags = BLOSC_DOSHUFFLE | BLOSC_DOBITSHUFFLE;  // extended header
 6578|    174|  header.typesize = context->typesize;
 6579|    174|  header.nbytes = (int32_t)nbytes;
 6580|    174|  header.blocksize = context->blocksize;
 6581|    174|  header.cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 6582|    174|  header.blosc2_flags = BLOSC2_SPECIAL_NAN << 4;  // mark chunk as all NaNs
 6583|    174|  memcpy((uint8_t *)dest, &header, sizeof(header));
 6584|       |
 6585|    174|  blosc2_free_ctx(context);
 6586|       |
 6587|    174|  return BLOSC_EXTENDED_HEADER_LENGTH;
 6588|    177|}
register_filter_private:
 6642|  61.0k|int register_filter_private(blosc2_filter *filter) {
 6643|  61.0k|    BLOSC_ERROR_NULL(filter, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  61.0k|    do {                                            \
  |  |  105|  61.0k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 61.0k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  61.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 61.0k]
  |  |  ------------------
  ------------------
 6644|  61.0k|    if (g_nfilters == UINT8_MAX) {
  ------------------
  |  Branch (6644:9): [True: 0, False: 61.0k]
  ------------------
 6645|      0|        BLOSC_TRACE_ERROR("Can not register more filters");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6646|      0|        return BLOSC2_ERROR_CODEC_SUPPORT;
 6647|      0|    }
 6648|  61.0k|    if (filter->id < BLOSC2_GLOBAL_REGISTERED_FILTERS_START) {
  ------------------
  |  Branch (6648:9): [True: 0, False: 61.0k]
  ------------------
 6649|      0|        BLOSC_TRACE_ERROR("The id must be greater or equal than %d", BLOSC2_GLOBAL_REGISTERED_FILTERS_START);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6650|      0|        return BLOSC2_ERROR_FAILURE;
 6651|      0|    }
 6652|       |    /* This condition can never be fulfilled
 6653|       |    if (filter->id > BLOSC2_USER_REGISTERED_FILTERS_STOP) {
 6654|       |        BLOSC_TRACE_ERROR("The id must be less than or equal to %d", BLOSC2_USER_REGISTERED_FILTERS_STOP);
 6655|       |        return BLOSC2_ERROR_FAILURE;
 6656|       |    }
 6657|       |    */
 6658|       |
 6659|   183k|    for (uint64_t i = 0; i < g_nfilters; ++i) {
  ------------------
  |  Branch (6659:26): [True: 122k, False: 61.0k]
  ------------------
 6660|   122k|      if (g_filters[i].id == filter->id) {
  ------------------
  |  Branch (6660:11): [True: 0, False: 122k]
  ------------------
 6661|      0|        if (strcmp(g_filters[i].name, filter->name) != 0) {
  ------------------
  |  Branch (6661:13): [True: 0, False: 0]
  ------------------
 6662|      0|          BLOSC_TRACE_ERROR("The filter (ID: %d) plugin is already registered with name: %s."
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6663|      0|                            "  Choose another one !", filter->id, g_filters[i].name);
 6664|      0|          return BLOSC2_ERROR_FAILURE;
 6665|      0|        }
 6666|      0|        else {
 6667|       |          // Already registered, so no more actions needed
 6668|      0|          return BLOSC2_ERROR_SUCCESS;
 6669|      0|        }
 6670|      0|      }
 6671|   122k|    }
 6672|       |
 6673|  61.0k|    blosc2_filter *filter_new = &g_filters[g_nfilters++];
 6674|  61.0k|    memcpy(filter_new, filter, sizeof(blosc2_filter));
 6675|       |
 6676|  61.0k|    return BLOSC2_ERROR_SUCCESS;
 6677|  61.0k|}
register_codec_private:
 6692|   109k|int register_codec_private(blosc2_codec *codec) {
 6693|   109k|    BLOSC_ERROR_NULL(codec, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|   109k|    do {                                            \
  |  |  105|   109k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 109k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|   109k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 109k]
  |  |  ------------------
  ------------------
 6694|   109k|    if (g_ncodecs == UINT8_MAX) {
  ------------------
  |  Branch (6694:9): [True: 0, False: 109k]
  ------------------
 6695|      0|      BLOSC_TRACE_ERROR("Can not register more codecs");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6696|      0|      return BLOSC2_ERROR_CODEC_SUPPORT;
 6697|      0|    }
 6698|   109k|    if (codec->compcode < BLOSC2_GLOBAL_REGISTERED_CODECS_START) {
  ------------------
  |  Branch (6698:9): [True: 0, False: 109k]
  ------------------
 6699|      0|      BLOSC_TRACE_ERROR("The id must be greater or equal than %d", BLOSC2_GLOBAL_REGISTERED_CODECS_START);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6700|      0|      return BLOSC2_ERROR_FAILURE;
 6701|      0|    }
 6702|       |    /* This condition can never be fulfilled
 6703|       |    if (codec->compcode > BLOSC2_USER_REGISTERED_CODECS_STOP) {
 6704|       |      BLOSC_TRACE_ERROR("The id must be less or equal to %d", BLOSC2_USER_REGISTERED_CODECS_STOP);
 6705|       |      return BLOSC2_ERROR_FAILURE;
 6706|       |    }
 6707|       |     */
 6708|       |
 6709|   549k|    for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (6709:21): [True: 439k, False: 109k]
  ------------------
 6710|   439k|      if (g_codecs[i].compcode == codec->compcode) {
  ------------------
  |  Branch (6710:11): [True: 0, False: 439k]
  ------------------
 6711|      0|        if (strcmp(g_codecs[i].compname, codec->compname) != 0) {
  ------------------
  |  Branch (6711:13): [True: 0, False: 0]
  ------------------
 6712|      0|          BLOSC_TRACE_ERROR("The codec (ID: %d) plugin is already registered with name: %s."
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6713|      0|                            "  Choose another one !", codec->compcode, codec->compname);
 6714|      0|          return BLOSC2_ERROR_CODEC_PARAM;
 6715|      0|        }
 6716|      0|        else {
 6717|       |          // Already registered, so no more actions needed
 6718|      0|          return BLOSC2_ERROR_SUCCESS;
 6719|      0|        }
 6720|      0|      }
 6721|   439k|    }
 6722|       |
 6723|   109k|    blosc2_codec *codec_new = &g_codecs[g_ncodecs++];
 6724|   109k|    memcpy(codec_new, codec, sizeof(blosc2_codec));
 6725|       |
 6726|   109k|    return BLOSC2_ERROR_SUCCESS;
 6727|   109k|}
register_tuner_private:
 6742|  12.2k|int register_tuner_private(blosc2_tuner *tuner) {
 6743|  12.2k|  BLOSC_ERROR_NULL(tuner, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  12.2k|    do {                                            \
  |  |  105|  12.2k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 12.2k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  12.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 12.2k]
  |  |  ------------------
  ------------------
 6744|  12.2k|  if (g_ntuners == UINT8_MAX) {
  ------------------
  |  Branch (6744:7): [True: 0, False: 12.2k]
  ------------------
 6745|      0|    BLOSC_TRACE_ERROR("Can not register more tuners");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6746|      0|    return BLOSC2_ERROR_CODEC_SUPPORT;
 6747|      0|  }
 6748|  12.2k|  if (tuner->id < BLOSC2_GLOBAL_REGISTERED_TUNER_START) {
  ------------------
  |  Branch (6748:7): [True: 0, False: 12.2k]
  ------------------
 6749|      0|    BLOSC_TRACE_ERROR("The id must be greater or equal than %d", BLOSC2_GLOBAL_REGISTERED_TUNER_START);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6750|      0|    return BLOSC2_ERROR_FAILURE;
 6751|      0|  }
 6752|       |
 6753|  12.2k|  for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (6753:19): [True: 0, False: 12.2k]
  ------------------
 6754|      0|    if (g_tuners[i].id == tuner->id) {
  ------------------
  |  Branch (6754:9): [True: 0, False: 0]
  ------------------
 6755|      0|      if (strcmp(g_tuners[i].name, tuner->name) != 0) {
  ------------------
  |  Branch (6755:11): [True: 0, False: 0]
  ------------------
 6756|      0|        BLOSC_TRACE_ERROR("The tuner (ID: %d) plugin is already registered with name: %s."
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6757|      0|                          "  Choose another one !", tuner->id, g_tuners[i].name);
 6758|      0|        return BLOSC2_ERROR_FAILURE;
 6759|      0|      }
 6760|      0|      else {
 6761|       |        // Already registered, so no more actions needed
 6762|      0|        return BLOSC2_ERROR_SUCCESS;
 6763|      0|      }
 6764|      0|    }
 6765|      0|  }
 6766|       |
 6767|  12.2k|  blosc2_tuner *tuner_new = &g_tuners[g_ntuners++];
 6768|  12.2k|  memcpy(tuner_new, tuner, sizeof(blosc2_tuner));
 6769|       |
 6770|  12.2k|  return BLOSC2_ERROR_SUCCESS;
 6771|  12.2k|}
_blosc2_register_io_cb:
 6784|  24.4k|int _blosc2_register_io_cb(const blosc2_io_cb *io) {
 6785|       |
 6786|  36.6k|  for (uint64_t i = 0; i < g_nio; ++i) {
  ------------------
  |  Branch (6786:24): [True: 36.6k, False: 2]
  ------------------
 6787|  36.6k|    if (g_ios[i].id == io->id) {
  ------------------
  |  Branch (6787:9): [True: 24.4k, False: 12.2k]
  ------------------
 6788|  24.4k|      if (strcmp(g_ios[i].name, io->name) != 0) {
  ------------------
  |  Branch (6788:11): [True: 0, False: 24.4k]
  ------------------
 6789|      0|        BLOSC_TRACE_ERROR("The IO (ID: %d) plugin is already registered with name: %s."
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6790|      0|                          "  Choose another one !", io->id, g_ios[i].name);
 6791|      0|        return BLOSC2_ERROR_PLUGIN_IO;
 6792|      0|      }
 6793|  24.4k|      else {
 6794|       |        // Already registered, so no more actions needed
 6795|  24.4k|        return BLOSC2_ERROR_SUCCESS;
 6796|  24.4k|      }
 6797|  24.4k|    }
 6798|  36.6k|  }
 6799|       |
 6800|      2|  blosc2_io_cb *io_new = &g_ios[g_nio++];
 6801|      2|  memcpy(io_new, io, sizeof(blosc2_io_cb));
 6802|       |
 6803|      2|  return BLOSC2_ERROR_SUCCESS;
 6804|  24.4k|}
blosc2_get_io_cb:
 6821|   107k|blosc2_io_cb *blosc2_get_io_cb(uint8_t id) {
 6822|       |  // If g_initlib is not set by blosc2_init() this function will try to read
 6823|       |  // uninitialized memory. We should therefore always return NULL in that case
 6824|   107k|  if (!g_initlib) {
  ------------------
  |  Branch (6824:7): [True: 0, False: 107k]
  ------------------
 6825|      0|    return NULL;
 6826|      0|  }
 6827|   107k|  for (uint64_t i = 0; i < g_nio; ++i) {
  ------------------
  |  Branch (6827:24): [True: 107k, False: 0]
  ------------------
 6828|   107k|    if (g_ios[i].id == id) {
  ------------------
  |  Branch (6828:9): [True: 107k, False: 0]
  ------------------
 6829|   107k|      return &g_ios[i];
 6830|   107k|    }
 6831|   107k|  }
 6832|      0|  if (id == BLOSC2_IO_FILESYSTEM) {
  ------------------
  |  Branch (6832:7): [True: 0, False: 0]
  ------------------
 6833|      0|    if (_blosc2_register_io_cb(&BLOSC2_IO_CB_DEFAULTS) < 0) {
  ------------------
  |  Branch (6833:9): [True: 0, False: 0]
  ------------------
 6834|      0|      BLOSC_TRACE_ERROR("Error registering the default IO API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6835|      0|      return NULL;
 6836|      0|    }
 6837|      0|    return blosc2_get_io_cb(id);
 6838|      0|  }
 6839|      0|  else if (id == BLOSC2_IO_FILESYSTEM_MMAP) {
  ------------------
  |  Branch (6839:12): [True: 0, False: 0]
  ------------------
 6840|      0|    if (_blosc2_register_io_cb(&BLOSC2_IO_CB_MMAP) < 0) {
  ------------------
  |  Branch (6840:9): [True: 0, False: 0]
  ------------------
 6841|      0|      BLOSC_TRACE_ERROR("Error registering the mmap IO API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6842|      0|      return NULL;
 6843|      0|    }
 6844|      0|    return blosc2_get_io_cb(id);
 6845|      0|  }
 6846|      0|  return NULL;
 6847|      0|}
blosc2_error_string:
 6916|     35|const char *blosc2_error_string(int error_code) {
 6917|     35|  switch (error_code) {
 6918|     34|    case BLOSC2_ERROR_FAILURE:
  ------------------
  |  Branch (6918:5): [True: 34, False: 1]
  ------------------
 6919|     34|      return "Generic failure";
 6920|      0|    case BLOSC2_ERROR_STREAM:
  ------------------
  |  Branch (6920:5): [True: 0, False: 35]
  ------------------
 6921|      0|      return "Bad stream";
 6922|      0|    case BLOSC2_ERROR_DATA:
  ------------------
  |  Branch (6922:5): [True: 0, False: 35]
  ------------------
 6923|      0|      return "Invalid data";
 6924|      0|    case BLOSC2_ERROR_MEMORY_ALLOC:
  ------------------
  |  Branch (6924:5): [True: 0, False: 35]
  ------------------
 6925|      0|      return "Memory alloc/realloc failure";
 6926|      0|    case BLOSC2_ERROR_READ_BUFFER:
  ------------------
  |  Branch (6926:5): [True: 0, False: 35]
  ------------------
 6927|      0|      return "Not enough space to read";
 6928|      1|    case BLOSC2_ERROR_WRITE_BUFFER:
  ------------------
  |  Branch (6928:5): [True: 1, False: 34]
  ------------------
 6929|      1|      return "Not enough space to write";
 6930|      0|    case BLOSC2_ERROR_CODEC_SUPPORT:
  ------------------
  |  Branch (6930:5): [True: 0, False: 35]
  ------------------
 6931|      0|      return "Codec not supported";
 6932|      0|    case BLOSC2_ERROR_CODEC_PARAM:
  ------------------
  |  Branch (6932:5): [True: 0, False: 35]
  ------------------
 6933|      0|      return "Invalid parameter supplied to codec";
 6934|      0|    case BLOSC2_ERROR_CODEC_DICT:
  ------------------
  |  Branch (6934:5): [True: 0, False: 35]
  ------------------
 6935|      0|      return "Codec dictionary error";
 6936|      0|    case BLOSC2_ERROR_VERSION_SUPPORT:
  ------------------
  |  Branch (6936:5): [True: 0, False: 35]
  ------------------
 6937|      0|      return "Version not supported";
 6938|      0|    case BLOSC2_ERROR_INVALID_HEADER:
  ------------------
  |  Branch (6938:5): [True: 0, False: 35]
  ------------------
 6939|      0|      return "Invalid value in header";
 6940|      0|    case BLOSC2_ERROR_INVALID_PARAM:
  ------------------
  |  Branch (6940:5): [True: 0, False: 35]
  ------------------
 6941|      0|      return "Invalid parameter supplied to function";
 6942|      0|    case BLOSC2_ERROR_FILE_READ:
  ------------------
  |  Branch (6942:5): [True: 0, False: 35]
  ------------------
 6943|      0|      return "File read failure";
 6944|      0|    case BLOSC2_ERROR_FILE_WRITE:
  ------------------
  |  Branch (6944:5): [True: 0, False: 35]
  ------------------
 6945|      0|      return "File write failure";
 6946|      0|    case BLOSC2_ERROR_FILE_OPEN:
  ------------------
  |  Branch (6946:5): [True: 0, False: 35]
  ------------------
 6947|      0|      return "File open failure";
 6948|      0|    case BLOSC2_ERROR_NOT_FOUND:
  ------------------
  |  Branch (6948:5): [True: 0, False: 35]
  ------------------
 6949|      0|      return "Not found";
 6950|      0|    case BLOSC2_ERROR_RUN_LENGTH:
  ------------------
  |  Branch (6950:5): [True: 0, False: 35]
  ------------------
 6951|      0|      return "Bad run length encoding";
 6952|      0|    case BLOSC2_ERROR_FILTER_PIPELINE:
  ------------------
  |  Branch (6952:5): [True: 0, False: 35]
  ------------------
 6953|      0|      return "Filter pipeline error";
 6954|      0|    case BLOSC2_ERROR_CHUNK_INSERT:
  ------------------
  |  Branch (6954:5): [True: 0, False: 35]
  ------------------
 6955|      0|      return "Chunk insert failure";
 6956|      0|    case BLOSC2_ERROR_CHUNK_APPEND:
  ------------------
  |  Branch (6956:5): [True: 0, False: 35]
  ------------------
 6957|      0|      return "Chunk append failure";
 6958|      0|    case BLOSC2_ERROR_CHUNK_UPDATE:
  ------------------
  |  Branch (6958:5): [True: 0, False: 35]
  ------------------
 6959|      0|      return "Chunk update failure";
 6960|      0|    case BLOSC2_ERROR_2GB_LIMIT:
  ------------------
  |  Branch (6960:5): [True: 0, False: 35]
  ------------------
 6961|      0|      return "Sizes larger than 2gb not supported";
 6962|      0|    case BLOSC2_ERROR_SCHUNK_COPY:
  ------------------
  |  Branch (6962:5): [True: 0, False: 35]
  ------------------
 6963|      0|      return "Super-chunk copy failure";
 6964|      0|    case BLOSC2_ERROR_FRAME_TYPE:
  ------------------
  |  Branch (6964:5): [True: 0, False: 35]
  ------------------
 6965|      0|      return "Wrong type for frame";
 6966|      0|    case BLOSC2_ERROR_FILE_TRUNCATE:
  ------------------
  |  Branch (6966:5): [True: 0, False: 35]
  ------------------
 6967|      0|      return "File truncate failure";
 6968|      0|    case BLOSC2_ERROR_LOCK:
  ------------------
  |  Branch (6968:5): [True: 0, False: 35]
  ------------------
 6969|      0|      return "Frame lock failure";
 6970|      0|    case BLOSC2_ERROR_THREAD_CREATE:
  ------------------
  |  Branch (6970:5): [True: 0, False: 35]
  ------------------
 6971|      0|      return "Thread or thread context creation failure";
 6972|      0|    case BLOSC2_ERROR_POSTFILTER:
  ------------------
  |  Branch (6972:5): [True: 0, False: 35]
  ------------------
 6973|      0|      return "Postfilter failure";
 6974|      0|    case BLOSC2_ERROR_FRAME_SPECIAL:
  ------------------
  |  Branch (6974:5): [True: 0, False: 35]
  ------------------
 6975|      0|      return "Special frame failure";
 6976|      0|    case BLOSC2_ERROR_SCHUNK_SPECIAL:
  ------------------
  |  Branch (6976:5): [True: 0, False: 35]
  ------------------
 6977|      0|      return "Special super-chunk failure";
 6978|      0|    case BLOSC2_ERROR_PLUGIN_IO:
  ------------------
  |  Branch (6978:5): [True: 0, False: 35]
  ------------------
 6979|      0|      return "IO plugin error";
 6980|      0|    case BLOSC2_ERROR_FILE_REMOVE:
  ------------------
  |  Branch (6980:5): [True: 0, False: 35]
  ------------------
 6981|      0|      return "Remove file failure";
 6982|      0|    case BLOSC2_ERROR_NULL_POINTER:
  ------------------
  |  Branch (6982:5): [True: 0, False: 35]
  ------------------
 6983|      0|      return "Pointer is null";
 6984|      0|    case BLOSC2_ERROR_INVALID_INDEX:
  ------------------
  |  Branch (6984:5): [True: 0, False: 35]
  ------------------
 6985|      0|      return "Invalid index";
 6986|      0|    case BLOSC2_ERROR_METALAYER_NOT_FOUND:
  ------------------
  |  Branch (6986:5): [True: 0, False: 35]
  ------------------
 6987|      0|      return "Metalayer has not been found";
 6988|      0|    case BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED:
  ------------------
  |  Branch (6988:5): [True: 0, False: 35]
  ------------------
 6989|      0|      return "Maximum buffersize exceeded";
 6990|      0|    case BLOSC2_ERROR_TUNER:
  ------------------
  |  Branch (6990:5): [True: 0, False: 35]
  ------------------
 6991|      0|      return "Tuner failure";
 6992|      0|    default:
  ------------------
  |  Branch (6992:5): [True: 0, False: 35]
  ------------------
 6993|      0|      return "Unknown error";
 6994|     35|  }
 6995|     35|}
blosc2.c:flags_to_filters:
  687|  47.2M|static void flags_to_filters(const uint8_t flags, uint8_t* filters) {
  688|       |  /* Initialize the filter pipeline */
  689|  47.2M|  memset(filters, 0, BLOSC2_MAX_FILTERS);
  690|       |  /* Fill the filter pipeline */
  691|  47.2M|  if (flags & BLOSC_DOSHUFFLE)
  ------------------
  |  Branch (691:7): [True: 47.2M, False: 404]
  ------------------
  692|  47.2M|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_SHUFFLE;
  693|  47.2M|  if (flags & BLOSC_DOBITSHUFFLE)
  ------------------
  |  Branch (693:7): [True: 47.2M, False: 1.20k]
  ------------------
  694|  47.2M|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_BITSHUFFLE;
  695|  47.2M|  if (flags & BLOSC_DODELTA)
  ------------------
  |  Branch (695:7): [True: 5.36M, False: 41.9M]
  ------------------
  696|  5.36M|    filters[BLOSC2_MAX_FILTERS - 2] = BLOSC_DELTA;
  697|  47.2M|}
blosc2.c:destroy_thread_context:
 2276|  58.6k|static void destroy_thread_context(struct thread_context* thread_context) {
 2277|  58.6k|  my_free(thread_context->tmp);
 2278|  58.6k|#if defined(HAVE_ZSTD)
 2279|  58.6k|  if (thread_context->zstd_cctx != NULL) {
  ------------------
  |  Branch (2279:7): [True: 0, False: 58.6k]
  ------------------
 2280|      0|    ZSTD_freeCCtx(thread_context->zstd_cctx);
 2281|      0|  }
 2282|  58.6k|  if (thread_context->zstd_dctx != NULL) {
  ------------------
  |  Branch (2282:7): [True: 6.74k, False: 51.9k]
  ------------------
 2283|  6.74k|    ZSTD_freeDCtx(thread_context->zstd_dctx);
 2284|  6.74k|  }
 2285|  58.6k|#endif
 2286|  58.6k|  if (thread_context->lz4_cstream != NULL) {
  ------------------
  |  Branch (2286:7): [True: 0, False: 58.6k]
  ------------------
 2287|      0|    LZ4_freeStream((LZ4_stream_t*)thread_context->lz4_cstream);
 2288|      0|  }
 2289|  58.6k|  if (thread_context->lz4hc_cstream != NULL) {
  ------------------
  |  Branch (2289:7): [True: 0, False: 58.6k]
  ------------------
 2290|      0|    LZ4_freeStreamHC((LZ4_streamHC_t*)thread_context->lz4hc_cstream);
 2291|      0|  }
 2292|  58.6k|}
blosc2.c:my_free:
  272|   176k|static void my_free(void* block) {
  273|       |#if defined(_WIN32)
  274|       |  _aligned_free(block);
  275|       |#else
  276|   176k|  free(block);
  277|   176k|#endif  /* _WIN32 */
  278|   176k|}
blosc2.c:initialize_context_compression:
 2392|  11.7k|        blosc2_schunk* schunk) {
 2393|       |
 2394|       |  /* Set parameters */
 2395|  11.7k|  context->do_compress = 1;
 2396|  11.7k|  context->src = (const uint8_t*)src;
 2397|  11.7k|  context->srcsize = srcsize;
 2398|  11.7k|  context->dest = (uint8_t*)dest;
 2399|  11.7k|  context->output_bytes = 0;
 2400|  11.7k|  context->destsize = destsize;
 2401|  11.7k|  context->sourcesize = srcsize;
 2402|  11.7k|  context->typesize = typesize;
 2403|  11.7k|  context->filter_flags = filters_to_flags(filters);
 2404|  82.3k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (2404:19): [True: 70.5k, False: 11.7k]
  ------------------
 2405|  70.5k|    context->filters[i] = filters[i];
 2406|  70.5k|    context->filters_meta[i] = filters_meta[i];
 2407|  70.5k|  }
 2408|  11.7k|  context->compcode = compressor;
 2409|  11.7k|  context->nthreads = nthreads;
 2410|  11.7k|  context->new_nthreads = new_nthreads;
 2411|  11.7k|  context->clevel = clevel;
 2412|  11.7k|  context->schunk = schunk;
 2413|  11.7k|  context->tuner_params = tuner_params;
 2414|  11.7k|  context->tuner_id = tuner_id;
 2415|  11.7k|  context->splitmode = splitmode;
 2416|  11.7k|  context->header_blocksize = (int32_t)blocksize;
 2417|  11.7k|  context->blosc2_flags2 = 0;
 2418|  11.7k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (2418:7): [True: 0, False: 11.7k]
  ------------------
 2419|      0|    free(context->blocknbytes);
 2420|      0|    context->blocknbytes = NULL;
 2421|      0|  }
 2422|  11.7k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (2422:7): [True: 0, False: 11.7k]
  ------------------
 2423|      0|    free(context->blockoffsets);
 2424|      0|    context->blockoffsets = NULL;
 2425|      0|  }
 2426|  11.7k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (2426:7): [True: 0, False: 11.7k]
  ------------------
 2427|      0|    free(context->blockcbytes);
 2428|      0|    context->blockcbytes = NULL;
 2429|      0|  }
 2430|  11.7k|  context->vlblock_sources = NULL;
 2431|  11.7k|  context->vlblock_dests = NULL;
 2432|       |  /* tuner some compression parameters */
 2433|  11.7k|  context->blocksize = (int32_t)blocksize;
 2434|  11.7k|  int rc = 0;
 2435|  11.7k|  if (context->tuner_params != NULL) {
  ------------------
  |  Branch (2435:7): [True: 0, False: 11.7k]
  ------------------
 2436|      0|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|      0|#define BLOSC_STUNE 0
  ------------------
  |  Branch (2436:9): [True: 0, False: 0]
  |  Branch (2436:49): [True: 0, False: 0]
  ------------------
 2437|      0|      if (blosc_stune_next_cparams(context) < 0) {
  ------------------
  |  Branch (2437:11): [True: 0, False: 0]
  ------------------
 2438|      0|        BLOSC_TRACE_ERROR("Error in stune next_cparams func\n");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2439|      0|        return BLOSC2_ERROR_TUNER;
 2440|      0|      }
 2441|      0|    } else {
 2442|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (2442:23): [True: 0, False: 0]
  ------------------
 2443|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (2443:13): [True: 0, False: 0]
  ------------------
 2444|      0|          if (g_tuners[i].next_cparams == NULL) {
  ------------------
  |  Branch (2444:15): [True: 0, False: 0]
  ------------------
 2445|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (2445:17): [True: 0, False: 0]
  ------------------
 2446|      0|              BLOSC_TRACE_ERROR("Could not load tuner %d.", g_tuners[i].id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2447|      0|              return BLOSC2_ERROR_FAILURE;
 2448|      0|            }
 2449|      0|          }
 2450|      0|          if (g_tuners[i].next_cparams(context) < 0) {
  ------------------
  |  Branch (2450:15): [True: 0, False: 0]
  ------------------
 2451|      0|            BLOSC_TRACE_ERROR("Error in tuner %d next_cparams func\n", context->tuner_id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2452|      0|            return BLOSC2_ERROR_TUNER;
 2453|      0|          }
 2454|      0|          if (g_tuners[i].id == BLOSC_BTUNE && context->blocksize == 0) {
  ------------------
  |  Branch (2454:15): [True: 0, False: 0]
  |  Branch (2454:48): [True: 0, False: 0]
  ------------------
 2455|       |            // Call stune for initializing blocksize
 2456|      0|            if (blosc_stune_next_blocksize(context) < 0) {
  ------------------
  |  Branch (2456:17): [True: 0, False: 0]
  ------------------
 2457|      0|              BLOSC_TRACE_ERROR("Error in stune next_blocksize func\n");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2458|      0|              return BLOSC2_ERROR_TUNER;
 2459|      0|            }
 2460|      0|          }
 2461|      0|          goto urtunersuccess;
 2462|      0|        }
 2463|      0|      }
 2464|      0|      BLOSC_TRACE_ERROR("User-defined tuner %d not found\n", context->tuner_id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2465|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 2466|      0|    }
 2467|  11.7k|  } else {
 2468|  11.7k|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|  11.7k|#define BLOSC_STUNE 0
  ------------------
  |  Branch (2468:9): [True: 11.7k, False: 0]
  |  Branch (2468:49): [True: 11.7k, False: 0]
  ------------------
 2469|  11.7k|      rc = blosc_stune_next_blocksize(context);
 2470|  11.7k|    } else {
 2471|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (2471:23): [True: 0, False: 0]
  ------------------
 2472|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (2472:13): [True: 0, False: 0]
  ------------------
 2473|      0|          if (g_tuners[i].next_blocksize == NULL) {
  ------------------
  |  Branch (2473:15): [True: 0, False: 0]
  ------------------
 2474|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (2474:17): [True: 0, False: 0]
  ------------------
 2475|      0|              BLOSC_TRACE_ERROR("Could not load tuner %d.", g_tuners[i].id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2476|      0|              return BLOSC2_ERROR_FAILURE;
 2477|      0|            }
 2478|      0|          }
 2479|      0|          rc = g_tuners[i].next_blocksize(context);
 2480|      0|          goto urtunersuccess;
 2481|      0|        }
 2482|      0|      }
 2483|      0|      BLOSC_TRACE_ERROR("User-defined tuner %d not found\n", context->tuner_id);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2484|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 2485|      0|    }
 2486|  11.7k|  }
 2487|  11.7k|  urtunersuccess:;
 2488|  11.7k|  if (rc < 0) {
  ------------------
  |  Branch (2488:7): [True: 0, False: 11.7k]
  ------------------
 2489|      0|    BLOSC_TRACE_ERROR("Error in tuner next_blocksize func\n");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2490|      0|    return BLOSC2_ERROR_TUNER;
 2491|      0|  }
 2492|       |
 2493|       |
 2494|       |  /* Check buffer size limits */
 2495|  11.7k|  if (srcsize > BLOSC2_MAX_BUFFERSIZE) {
  ------------------
  |  Branch (2495:7): [True: 0, False: 11.7k]
  ------------------
 2496|      0|    BLOSC_TRACE_ERROR("Input buffer size cannot exceed %d bytes.",
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2497|      0|                      BLOSC2_MAX_BUFFERSIZE);
 2498|      0|    return BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED;
 2499|      0|  }
 2500|       |
 2501|  11.7k|  if (destsize < BLOSC2_MAX_OVERHEAD) {
  ------------------
  |  Branch (2501:7): [True: 0, False: 11.7k]
  ------------------
 2502|      0|    BLOSC_TRACE_ERROR("Output buffer size should be larger than %d bytes.",
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2503|      0|                      BLOSC2_MAX_OVERHEAD);
 2504|      0|    return BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED;
 2505|      0|  }
 2506|       |
 2507|       |  /* Compression level */
 2508|  11.7k|  if (clevel < 0 || clevel > 9) {
  ------------------
  |  Branch (2508:7): [True: 0, False: 11.7k]
  |  Branch (2508:21): [True: 0, False: 11.7k]
  ------------------
 2509|       |    /* If clevel not in 0..9, print an error */
 2510|      0|    BLOSC_TRACE_ERROR("`clevel` parameter must be between 0 and 9!.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2511|      0|    return BLOSC2_ERROR_CODEC_PARAM;
 2512|      0|  }
 2513|       |
 2514|       |  /* Dictionary support is only available for ZSTD, LZ4, and LZ4HC.
 2515|       |   * Skip the check when src is NULL (special-value chunks): no compression
 2516|       |   * will actually happen, so codec compatibility is irrelevant. */
 2517|  11.7k|  if (src != NULL && context->use_dict && context->compcode != BLOSC_ZSTD &&
  ------------------
  |  Branch (2517:7): [True: 0, False: 11.7k]
  |  Branch (2517:22): [True: 0, False: 0]
  |  Branch (2517:43): [True: 0, False: 0]
  ------------------
 2518|      0|      context->compcode != BLOSC_LZ4 && context->compcode != BLOSC_LZ4HC) {
  ------------------
  |  Branch (2518:7): [True: 0, False: 0]
  |  Branch (2518:41): [True: 0, False: 0]
  ------------------
 2519|      0|    BLOSC_TRACE_ERROR("`use_dict` is only supported for ZSTD, LZ4, and LZ4HC codecs.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2520|      0|    return BLOSC2_ERROR_CODEC_PARAM;
 2521|      0|  }
 2522|       |
 2523|       |  /* Check typesize limits */
 2524|  11.7k|  if (context->typesize > BLOSC2_MAXTYPESIZE) {
  ------------------
  |  Branch (2524:7): [True: 12, False: 11.7k]
  ------------------
 2525|       |    // If typesize is too large for Blosc2, return an error
 2526|     12|    BLOSC_TRACE_ERROR("Typesize cannot exceed %d bytes.", BLOSC2_MAXTYPESIZE);
  ------------------
  |  |   93|     12|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     12|    do {                                            \
  |  |  |  |   98|     12|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     12|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     12|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2527|     12|    return BLOSC2_ERROR_INVALID_PARAM;
 2528|     12|  }
 2529|       |  /* Now, cap typesize so that blosc2 split machinery can continue to work */
 2530|  11.7k|  if (context->typesize > BLOSC_MAX_TYPESIZE) {
  ------------------
  |  Branch (2530:7): [True: 10.7k, False: 976]
  ------------------
 2531|       |    /* If typesize is too large, treat buffer as an 1-byte stream. */
 2532|  10.7k|    context->typesize = 1;
 2533|  10.7k|  }
 2534|       |
 2535|  11.7k|  blosc2_calculate_blocks(context);
 2536|       |
 2537|  11.7k|  return 1;
 2538|  11.7k|}
blosc2.c:filters_to_flags:
  664|   115k|static uint8_t filters_to_flags(const uint8_t* filters) {
  665|   115k|  uint8_t flags = 0;
  666|       |
  667|   808k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (667:19): [True: 692k, False: 115k]
  ------------------
  668|   692k|    switch (filters[i]) {
  669|  88.0k|      case BLOSC_SHUFFLE:
  ------------------
  |  Branch (669:7): [True: 88.0k, False: 604k]
  ------------------
  670|  88.0k|        flags |= BLOSC_DOSHUFFLE;
  671|  88.0k|        break;
  672|  42.8k|      case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (672:7): [True: 42.8k, False: 650k]
  ------------------
  673|  42.8k|        flags |= BLOSC_DOBITSHUFFLE;
  674|  42.8k|        break;
  675|  64.3k|      case BLOSC_DELTA:
  ------------------
  |  Branch (675:7): [True: 64.3k, False: 628k]
  ------------------
  676|  64.3k|        flags |= BLOSC_DODELTA;
  677|  64.3k|        break;
  678|   497k|      default :
  ------------------
  |  Branch (678:7): [True: 497k, False: 195k]
  ------------------
  679|   497k|        break;
  680|   692k|    }
  681|   692k|  }
  682|   115k|  return flags;
  683|   115k|}
blosc2.c:blosc2_calculate_blocks:
  854|   115k|static inline void blosc2_calculate_blocks(blosc2_context* context) {
  855|       |  /* Compute number of blocks in buffer */
  856|   115k|  context->nblocks = context->sourcesize / context->blocksize;
  857|   115k|  context->leftover = context->sourcesize % context->blocksize;
  858|   115k|  context->nblocks = (context->leftover > 0) ?
  ------------------
  |  Branch (858:22): [True: 67.1k, False: 48.2k]
  ------------------
  859|  67.1k|                     (context->nblocks + 1) : context->nblocks;
  860|   115k|}
blosc2.c:clibcode_to_clibname:
  305|      5|static const char* clibcode_to_clibname(int clibcode) {
  306|      5|  if (clibcode == BLOSC_BLOSCLZ_LIB) return BLOSC_BLOSCLZ_LIBNAME;
  ------------------
  |  |  367|      0|#define BLOSC_BLOSCLZ_LIBNAME   "BloscLZ"
  ------------------
  |  Branch (306:7): [True: 0, False: 5]
  ------------------
  307|      5|  if (clibcode == BLOSC_LZ4_LIB) return BLOSC_LZ4_LIBNAME;
  ------------------
  |  |  368|      0|#define BLOSC_LZ4_LIBNAME       "LZ4"
  ------------------
  |  Branch (307:7): [True: 0, False: 5]
  ------------------
  308|      5|  if (clibcode == BLOSC_ZLIB_LIB) return BLOSC_ZLIB_LIBNAME;
  ------------------
  |  |  369|      0|#define BLOSC_ZLIB_LIBNAME      "Zlib"
  ------------------
  |  Branch (308:7): [True: 0, False: 5]
  ------------------
  309|      5|  if (clibcode == BLOSC_ZSTD_LIB) return BLOSC_ZSTD_LIBNAME;
  ------------------
  |  |  370|      0|#define BLOSC_ZSTD_LIBNAME      "Zstd"
  ------------------
  |  Branch (309:7): [True: 0, False: 5]
  ------------------
  310|     50|  for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (310:19): [True: 45, False: 5]
  ------------------
  311|     45|    if (clibcode == g_codecs[i].complib)
  ------------------
  |  Branch (311:9): [True: 0, False: 45]
  ------------------
  312|      0|      return g_codecs[i].compname;
  313|     45|  }
  314|      5|  return NULL;                  /* should never happen */
  315|      5|}
blosc2.c:blosc_run_decompression_with_context:
 3911|  56.8k|                                                void* dest, int32_t destsize) {
 3912|  56.8k|  blosc_header header;
 3913|  56.8k|  int32_t ntbytes;
 3914|  56.8k|  int rc;
 3915|       |
 3916|  56.8k|  rc = read_chunk_header(src, srcsize, true, &header);
 3917|  56.8k|  if (rc < 0) {
  ------------------
  |  Branch (3917:7): [True: 22, False: 56.7k]
  ------------------
 3918|     22|    return rc;
 3919|     22|  }
 3920|       |
 3921|  56.7k|  if (header.nbytes > destsize) {
  ------------------
  |  Branch (3921:7): [True: 0, False: 56.7k]
  ------------------
 3922|       |    // Not enough space for writing into the destination
 3923|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 3924|      0|  }
 3925|       |
 3926|  56.7k|  rc = initialize_context_decompression(context, &header, src, srcsize, dest, destsize);
 3927|  56.7k|  if (rc < 0) {
  ------------------
  |  Branch (3927:7): [True: 792, False: 56.0k]
  ------------------
 3928|    792|    return rc;
 3929|    792|  }
 3930|       |
 3931|       |  /* Do the actual decompression */
 3932|  56.0k|  ntbytes = do_job(context);
 3933|  56.0k|  if (ntbytes < 0) {
  ------------------
  |  Branch (3933:7): [True: 9.24k, False: 46.7k]
  ------------------
 3934|  9.24k|    return ntbytes;
 3935|  9.24k|  }
 3936|       |
 3937|  56.0k|  assert(ntbytes <= (int32_t)destsize);
 3938|  46.7k|  return ntbytes;
 3939|  56.0k|}
blosc2.c:initialize_context_decompression:
 2689|  56.7k|                                            int32_t srcsize, void* dest, int32_t destsize) {
 2690|  56.7k|  int32_t bstarts_end;
 2691|  56.7k|  bool vlblocks;
 2692|       |
 2693|  56.7k|  context->do_compress = 0;
 2694|  56.7k|  context->src = (const uint8_t*)src;
 2695|  56.7k|  context->srcsize = srcsize;
 2696|  56.7k|  context->dest = (uint8_t*)dest;
 2697|  56.7k|  context->destsize = destsize;
 2698|  56.7k|  context->output_bytes = 0;
 2699|  56.7k|  context->vlblock_sources = NULL;
 2700|  56.7k|  context->vlblock_dests = NULL;
 2701|  56.7k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (2701:7): [True: 0, False: 56.7k]
  ------------------
 2702|      0|    free(context->blocknbytes);
 2703|      0|    context->blocknbytes = NULL;
 2704|      0|  }
 2705|  56.7k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (2705:7): [True: 0, False: 56.7k]
  ------------------
 2706|      0|    free(context->blockoffsets);
 2707|      0|    context->blockoffsets = NULL;
 2708|      0|  }
 2709|  56.7k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (2709:7): [True: 0, False: 56.7k]
  ------------------
 2710|      0|    free(context->blockcbytes);
 2711|      0|    context->blockcbytes = NULL;
 2712|      0|  }
 2713|       |
 2714|  56.7k|  int rc = blosc2_initialize_context_from_header(context, header);
 2715|  56.7k|  if (rc < 0) {
  ------------------
  |  Branch (2715:7): [True: 0, False: 56.7k]
  ------------------
 2716|      0|    return rc;
 2717|      0|  }
 2718|  56.7k|  clear_context_decompression_dict(context);
 2719|  56.7k|  vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2720|  56.7k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (2720:19): [True: 56.5k, False: 255]
  ------------------
 2721|  56.5k|                  (context->blosc2_flags & 0x08u));
  ------------------
  |  Branch (2721:19): [True: 1.23k, False: 55.3k]
  ------------------
 2722|       |
 2723|       |  /* Check that we have enough space to decompress */
 2724|  56.7k|  if (context->sourcesize > (int32_t)context->destsize) {
  ------------------
  |  Branch (2724:7): [True: 0, False: 56.7k]
  ------------------
 2725|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 2726|      0|  }
 2727|       |
 2728|  56.7k|  if (context->block_maskout != NULL && context->block_maskout_nitems != context->nblocks) {
  ------------------
  |  Branch (2728:7): [True: 0, False: 56.7k]
  |  Branch (2728:41): [True: 0, False: 0]
  ------------------
 2729|      0|    BLOSC_TRACE_ERROR("The number of items in block_maskout (%d) must match the number"
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2730|      0|                      " of blocks in chunk (%d).",
 2731|      0|                      context->block_maskout_nitems, context->nblocks);
 2732|      0|    return BLOSC2_ERROR_DATA;
 2733|      0|  }
 2734|       |
 2735|  56.7k|  context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
 2736|  56.7k|  if (context->special_type > BLOSC2_SPECIAL_LASTID) {
  ------------------
  |  Branch (2736:7): [True: 0, False: 56.7k]
  ------------------
 2737|      0|    BLOSC_TRACE_ERROR("Unknown special values ID (%d) ",
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2738|      0|                      context->special_type);
 2739|      0|    return BLOSC2_ERROR_DATA;
 2740|      0|  }
 2741|       |
 2742|  56.7k|  int memcpyed = (context->header_flags & (uint8_t) BLOSC_MEMCPYED);
 2743|  56.7k|  if (memcpyed && (header->cbytes != header->nbytes + context->header_overhead)) {
  ------------------
  |  Branch (2743:7): [True: 414, False: 56.3k]
  |  Branch (2743:19): [True: 13, False: 401]
  ------------------
 2744|     13|    BLOSC_TRACE_ERROR("Wrong header info for this memcpyed chunk");
  ------------------
  |  |   93|     13|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     13|    do {                                            \
  |  |  |  |   98|     13|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     13|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     13|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2745|     13|    return BLOSC2_ERROR_DATA;
 2746|     13|  }
 2747|       |
 2748|  56.7k|  if ((header->nbytes == 0) && (header->cbytes == context->header_overhead) &&
  ------------------
  |  Branch (2748:7): [True: 10.1k, False: 46.6k]
  |  Branch (2748:32): [True: 10.1k, False: 11]
  ------------------
 2749|  10.1k|      !context->special_type) {
  ------------------
  |  Branch (2749:7): [True: 0, False: 10.1k]
  ------------------
 2750|       |    // A compressed buffer with only a header can only contain a zero-length buffer
 2751|      0|    return 0;
 2752|      0|  }
 2753|       |
 2754|  56.7k|  context->bstarts = (int32_t *) (context->src + context->header_overhead);
 2755|  56.7k|  bstarts_end = context->header_overhead;
 2756|  56.7k|  if (!context->special_type && !memcpyed) {
  ------------------
  |  Branch (2756:7): [True: 40.6k, False: 16.1k]
  |  Branch (2756:33): [True: 40.2k, False: 394]
  ------------------
 2757|  40.2k|    size_t bstarts_end_tmp;
 2758|  40.2k|    size_t bstarts_nbytes;
 2759|  40.2k|    if (context->nblocks < 0 ||
  ------------------
  |  Branch (2759:9): [True: 17, False: 40.1k]
  ------------------
 2760|  40.1k|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (2760:9): [True: 0, False: 40.1k]
  ------------------
 2761|  40.1k|        !checked_add_size((size_t)context->header_overhead, bstarts_nbytes, &bstarts_end_tmp) ||
  ------------------
  |  Branch (2761:9): [True: 0, False: 40.1k]
  ------------------
 2762|  40.1k|        bstarts_end_tmp > (size_t)INT32_MAX) {
  ------------------
  |  Branch (2762:9): [True: 2, False: 40.1k]
  ------------------
 2763|     19|      BLOSC_TRACE_ERROR("Invalid bstarts size in chunk header.");
  ------------------
  |  |   93|     19|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     19|    do {                                            \
  |  |  |  |   98|     19|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     19|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 19, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     19|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2764|     19|      return BLOSC2_ERROR_INVALID_HEADER;
 2765|     19|    }
 2766|       |    /* If chunk is not special or a memcpyed, we do have a bstarts section */
 2767|  40.1k|    bstarts_end = (int32_t)bstarts_end_tmp;
 2768|  40.1k|  }
 2769|       |
 2770|  56.7k|  if (srcsize < bstarts_end) {
  ------------------
  |  Branch (2770:7): [True: 39, False: 56.7k]
  ------------------
 2771|     39|    BLOSC_TRACE_ERROR("`bstarts` exceeds length of source buffer.");
  ------------------
  |  |   93|     39|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     39|    do {                                            \
  |  |  |  |   98|     39|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     39|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 39, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     39|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2772|     39|    return BLOSC2_ERROR_READ_BUFFER;
 2773|     39|  }
 2774|       |
 2775|  56.7k|  if (vlblocks && is_lazy && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (2775:7): [True: 265, False: 56.4k]
  |  Branch (2775:19): [True: 62, False: 203]
  |  Branch (2775:30): [True: 62, False: 0]
  |  Branch (2775:56): [True: 62, False: 0]
  ------------------
 2776|     62|    size_t block_csizes_nbytes;
 2777|     62|    size_t trailer_meta_nbytes;
 2778|     62|    size_t lazy_trailer_end;
 2779|     62|    if (context->srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (2779:9): [True: 0, False: 62]
  |  Branch (2779:33): [True: 0, False: 62]
  ------------------
 2780|     62|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (2780:9): [True: 0, False: 62]
  ------------------
 2781|     62|        !checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (2781:9): [True: 0, False: 62]
  ------------------
 2782|     62|        !checked_add_size((size_t)bstarts_end, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (2782:9): [True: 0, False: 62]
  ------------------
 2783|     62|        (size_t)context->srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (2783:9): [True: 3, False: 59]
  ------------------
 2784|      3|      BLOSC_TRACE_ERROR("Lazy trailer exceeds source buffer.");
  ------------------
  |  |   93|      3|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      3|    do {                                            \
  |  |  |  |   98|      3|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      3|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      3|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2785|      3|      return BLOSC2_ERROR_READ_BUFFER;
 2786|      3|    }
 2787|     62|  }
 2788|  56.7k|  srcsize -= bstarts_end;
 2789|       |
 2790|       |  /* Read optional dictionary if flag set */
 2791|  56.7k|  if ((context->blosc2_flags & BLOSC2_USEDICT) && !is_lazy) {
  ------------------
  |  Branch (2791:7): [True: 6.45k, False: 50.2k]
  |  Branch (2791:51): [True: 6.41k, False: 35]
  ------------------
 2792|  6.41k|    context->use_dict = 1;
 2793|       |    // The dictionary section is after the bstarts block: [int32 size | raw bytes]
 2794|  6.41k|    if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2794:9): [True: 0, False: 6.41k]
  ------------------
 2795|      0|      BLOSC_TRACE_ERROR("Not enough space to read size of dictionary.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2796|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2797|      0|    }
 2798|  6.41k|    srcsize -= sizeof(int32_t);
 2799|       |    // Read dictionary size
 2800|  6.41k|    context->dict_size = sw32_(context->src + bstarts_end);
 2801|  6.41k|    if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (2801:9): [True: 9, False: 6.41k]
  |  Branch (2801:36): [True: 16, False: 6.39k]
  ------------------
 2802|     25|      BLOSC_TRACE_ERROR("Dictionary size is smaller than minimum or larger than maximum allowed.");
  ------------------
  |  |   93|     25|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     25|    do {                                            \
  |  |  |  |   98|     25|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     25|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 25, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     25|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2803|     25|      return BLOSC2_ERROR_CODEC_DICT;
 2804|     25|    }
 2805|  6.39k|    if (srcsize < (int32_t)context->dict_size) {
  ------------------
  |  Branch (2805:9): [True: 10, False: 6.38k]
  ------------------
 2806|     10|      BLOSC_TRACE_ERROR("Not enough space to read entire dictionary.");
  ------------------
  |  |   93|     10|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     10|    do {                                            \
  |  |  |  |   98|     10|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     10|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 10, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     10|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2807|     10|      return BLOSC2_ERROR_READ_BUFFER;
 2808|     10|    }
 2809|  6.38k|    srcsize -= context->dict_size;
 2810|       |    // dict_buffer points directly into the source chunk — no copy needed
 2811|  6.38k|    context->dict_buffer = (void*)(context->src + bstarts_end + sizeof(int32_t));
 2812|  6.38k|    context->dict_buffer_owned = false;
 2813|  6.38k|#if defined(HAVE_ZSTD)
 2814|       |    // context->compcode during decompression holds the format code (flags >> 5),
 2815|       |    // so compare against BLOSC_ZSTD_FORMAT (not BLOSC_ZSTD).
 2816|  6.38k|    if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2816:9): [True: 5.70k, False: 681]
  ------------------
 2817|  5.70k|      context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 2818|  5.70k|      if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (2818:11): [True: 393, False: 5.31k]
  ------------------
 2819|    393|        BLOSC_TRACE_ERROR("Cannot create ZSTD dictionary for chunk.");
  ------------------
  |  |   93|    393|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    393|    do {                                            \
  |  |  |  |   98|    393|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    393|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 393, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    393|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2820|    393|        return BLOSC2_ERROR_CODEC_DICT;
 2821|    393|      }
 2822|  5.70k|    }
 2823|  6.38k|#endif   // HAVE_ZSTD
 2824|       |    // For LZ4/LZ4HC: dict_buffer and dict_size are sufficient; no digested object needed.
 2825|  6.38k|  }
 2826|  50.3k|  else if ((context->blosc2_flags & BLOSC2_USEDICT) && is_lazy) {
  ------------------
  |  Branch (2826:12): [True: 35, False: 50.2k]
  |  Branch (2826:56): [True: 35, False: 0]
  ------------------
 2827|     35|    rc = load_lazy_chunk_dict(context, header, bstarts_end);
 2828|     35|    if (rc < 0) {
  ------------------
  |  Branch (2828:9): [True: 35, False: 0]
  ------------------
 2829|     35|      return rc;
 2830|     35|    }
 2831|     35|  }
 2832|       |
 2833|  56.2k|  if (vlblocks && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (2833:7): [True: 261, False: 55.9k]
  |  Branch (2833:19): [True: 261, False: 0]
  |  Branch (2833:45): [True: 261, False: 0]
  ------------------
 2834|    261|    context->blocknbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 2835|    261|    BLOSC_ERROR_NULL(context->blocknbytes, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    261|    do {                                            \
  |  |  105|    261|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 261]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|    261|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 261]
  |  |  ------------------
  ------------------
 2836|    261|    context->blockoffsets = malloc((size_t)context->nblocks * sizeof(int32_t));
 2837|    261|    BLOSC_ERROR_NULL(context->blockoffsets, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    261|    do {                                            \
  |  |  105|    261|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 261]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|    261|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 261]
  |  |  ------------------
  ------------------
 2838|    261|    context->blockcbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 2839|    261|    BLOSC_ERROR_NULL(context->blockcbytes, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    261|    do {                                            \
  |  |  105|    261|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 261]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|    261|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 261]
  |  |  ------------------
  ------------------
 2840|       |
 2841|    261|    if (is_lazy) {
  ------------------
  |  Branch (2841:9): [True: 59, False: 202]
  ------------------
 2842|       |      // Lazy VL: block data is on disk, so blocknbytes is unknown at this point.
 2843|       |      // Populate blockcbytes from bstarts differences; blocksize gets max(blockcbytes)
 2844|       |      // as a safe upper bound so tmp buffers are large enough for the lazy block read.
 2845|     59|      int32_t max_csize = 0;
 2846|     69|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (2846:27): [True: 66, False: 3]
  ------------------
 2847|     66|        int32_t bstart = sw32_(context->bstarts + i);
 2848|     66|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (2848:31): [True: 35, False: 31]
  ------------------
 2849|     35|            sw32_(context->bstarts + i + 1) : header->cbytes;
 2850|     66|        if (bstart < bstarts_end || next_bstart <= bstart ||
  ------------------
  |  Branch (2850:13): [True: 9, False: 57]
  |  Branch (2850:37): [True: 29, False: 28]
  ------------------
 2851|     56|            next_bstart > header->cbytes) {
  ------------------
  |  Branch (2851:13): [True: 18, False: 10]
  ------------------
 2852|     56|          BLOSC_TRACE_ERROR("Invalid VL-block offsets in lazy chunk.");
  ------------------
  |  |   93|     56|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     56|    do {                                            \
  |  |  |  |   98|     56|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     56|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 56, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     56|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2853|     56|          return BLOSC2_ERROR_INVALID_HEADER;
 2854|     56|        }
 2855|     10|        context->blocknbytes[i] = 0;   // unknown until block is read from disk
 2856|     10|        context->blockoffsets[i] = 0;  // unknown
 2857|     10|        context->blockcbytes[i] = next_bstart - bstart;
 2858|     10|        if (context->blockcbytes[i] > max_csize) {
  ------------------
  |  Branch (2858:13): [True: 9, False: 1]
  ------------------
 2859|      9|          max_csize = context->blockcbytes[i];
 2860|      9|        }
 2861|     10|      }
 2862|      3|      context->blocksize = max_csize;
 2863|      3|      context->leftover = 0;
 2864|      3|    }
 2865|    202|    else {
 2866|    202|      int32_t max_blocksize = 0;
 2867|    202|      int64_t total_nbytes = 0;
 2868|    202|      int32_t prev_bstart = 0;
 2869|    245|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (2869:27): [True: 205, False: 40]
  ------------------
 2870|    205|        int32_t bstart = sw32_(context->bstarts + i);
 2871|    205|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (2871:31): [True: 50, False: 155]
  ------------------
 2872|    155|            sw32_(context->bstarts + i + 1) : header->cbytes;
 2873|    205|        if (bstart < bstarts_end || bstart <= prev_bstart || next_bstart <= bstart ||
  ------------------
  |  Branch (2873:13): [True: 7, False: 198]
  |  Branch (2873:37): [True: 0, False: 198]
  |  Branch (2873:62): [True: 43, False: 155]
  ------------------
 2874|    155|            next_bstart > header->cbytes || bstart > context->srcsize - (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (2874:13): [True: 36, False: 119]
  |  Branch (2874:45): [True: 2, False: 117]
  ------------------
 2875|     88|          BLOSC_TRACE_ERROR("Invalid VL-block offsets in chunk.");
  ------------------
  |  |   93|     88|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     88|    do {                                            \
  |  |  |  |   98|     88|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     88|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 88, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     88|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2876|     88|          return BLOSC2_ERROR_INVALID_HEADER;
 2877|     88|        }
 2878|    117|        context->blocknbytes[i] = sw32_(context->src + bstart);
 2879|    117|        context->blockcbytes[i] = next_bstart - bstart;
 2880|    117|        if (context->blocknbytes[i] <= 0) {
  ------------------
  |  Branch (2880:13): [True: 35, False: 82]
  ------------------
 2881|     35|          BLOSC_TRACE_ERROR("Invalid VL-block uncompressed size in chunk.");
  ------------------
  |  |   93|     35|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     35|    do {                                            \
  |  |  |  |   98|     35|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     35|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 35, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     35|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2882|     35|          return BLOSC2_ERROR_INVALID_HEADER;
 2883|     35|        }
 2884|     82|        if (total_nbytes > INT32_MAX) {
  ------------------
  |  Branch (2884:13): [True: 0, False: 82]
  ------------------
 2885|      0|          BLOSC_TRACE_ERROR("Invalid VL-block cumulative size in chunk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2886|      0|          return BLOSC2_ERROR_INVALID_HEADER;
 2887|      0|        }
 2888|     82|        context->blockoffsets[i] = (int32_t)total_nbytes;
 2889|     82|        total_nbytes += context->blocknbytes[i];
 2890|     82|        if (total_nbytes > context->sourcesize) {
  ------------------
  |  Branch (2890:13): [True: 39, False: 43]
  ------------------
 2891|     39|          BLOSC_TRACE_ERROR("VL-block sizes exceed chunk nbytes.");
  ------------------
  |  |   93|     39|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     39|    do {                                            \
  |  |  |  |   98|     39|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     39|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 39, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     39|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2892|     39|          return BLOSC2_ERROR_INVALID_HEADER;
 2893|     39|        }
 2894|     43|        if (context->blocknbytes[i] > max_blocksize) {
  ------------------
  |  Branch (2894:13): [True: 42, False: 1]
  ------------------
 2895|     42|          max_blocksize = context->blocknbytes[i];
 2896|     42|        }
 2897|     43|        prev_bstart = bstart;
 2898|     43|      }
 2899|     40|      if (total_nbytes != context->sourcesize) {
  ------------------
  |  Branch (2899:11): [True: 37, False: 3]
  ------------------
 2900|     37|        BLOSC_TRACE_ERROR("VL-block sizes do not add up to chunk nbytes.");
  ------------------
  |  |   93|     37|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     37|    do {                                            \
  |  |  |  |   98|     37|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     37|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 37, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     37|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2901|     37|        return BLOSC2_ERROR_INVALID_HEADER;
 2902|     37|      }
 2903|      3|      context->blocksize = max_blocksize;
 2904|      3|      context->leftover = 0;
 2905|      3|    }
 2906|    261|  }
 2907|       |
 2908|  56.0k|  return 0;
 2909|  56.2k|}
blosc2.c:load_lazy_chunk_dict:
 2635|     35|static int load_lazy_chunk_dict(blosc2_context* context, blosc_header* header, int32_t bstarts_end) {
 2636|     35|  int32_t dict_offset = bstarts_end;
 2637|     35|  if (header->cbytes < dict_offset + (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (2637:7): [True: 1, False: 34]
  ------------------
 2638|      1|    BLOSC_TRACE_ERROR("Lazy chunk dictionary header exceeds chunk length.");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2639|      1|    return BLOSC2_ERROR_INVALID_HEADER;
 2640|      1|  }
 2641|       |
 2642|     34|  uint8_t dict_size_buf[sizeof(int32_t)];
 2643|     34|  int rc = read_lazy_chunk_bytes(context, dict_offset, dict_size_buf, (int32_t)sizeof(dict_size_buf),
 2644|     34|                                 "Cannot open frame file for lazy chunk dictionary read.",
 2645|     34|                                 "Cannot read lazy chunk dictionary size from disk.");
 2646|     34|  if (rc < 0) {
  ------------------
  |  Branch (2646:7): [True: 34, False: 0]
  ------------------
 2647|     34|    return rc;
 2648|     34|  }
 2649|       |
 2650|      0|  context->dict_size = sw32_(dict_size_buf);
 2651|      0|  if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (2651:7): [True: 0, False: 0]
  |  Branch (2651:34): [True: 0, False: 0]
  ------------------
 2652|      0|    BLOSC_TRACE_ERROR("Dictionary size is smaller than minimum or larger than maximum allowed.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2653|      0|    return BLOSC2_ERROR_CODEC_DICT;
 2654|      0|  }
 2655|      0|  if (header->cbytes < dict_offset + (int32_t)sizeof(int32_t) + context->dict_size) {
  ------------------
  |  Branch (2655:7): [True: 0, False: 0]
  ------------------
 2656|      0|    BLOSC_TRACE_ERROR("Lazy chunk dictionary exceeds chunk length.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2657|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 2658|      0|  }
 2659|       |
 2660|      0|  context->dict_buffer = malloc((size_t)context->dict_size);
 2661|      0|  BLOSC_ERROR_NULL(context->dict_buffer, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|      0|    do {                                            \
  |  |  105|      0|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2662|      0|  context->dict_buffer_owned = true;
 2663|      0|  rc = read_lazy_chunk_bytes(context, dict_offset + (int32_t)sizeof(int32_t),
 2664|      0|                             context->dict_buffer, context->dict_size,
 2665|      0|                             "Cannot open frame file for lazy chunk dictionary read.",
 2666|      0|                             "Cannot read lazy chunk dictionary from disk.");
 2667|      0|  if (rc < 0) {
  ------------------
  |  Branch (2667:7): [True: 0, False: 0]
  ------------------
 2668|      0|    release_context_dict_buffer(context);
 2669|      0|    return rc;
 2670|      0|  }
 2671|       |
 2672|      0|  context->use_dict = 1;
 2673|      0|#if defined(HAVE_ZSTD)
 2674|      0|  if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2674:7): [True: 0, False: 0]
  ------------------
 2675|      0|    context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 2676|      0|    if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (2676:9): [True: 0, False: 0]
  ------------------
 2677|      0|      release_context_dict_buffer(context);
 2678|      0|      BLOSC_TRACE_ERROR("Cannot create ZSTD dictionary for lazy chunk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2679|      0|      return BLOSC2_ERROR_CODEC_DICT;
 2680|      0|    }
 2681|      0|  }
 2682|      0|#endif
 2683|       |
 2684|      0|  return 0;
 2685|      0|}
blosc2.c:read_lazy_chunk_bytes:
 2565|     34|                                 const char* open_error, const char* read_error) {
 2566|     34|  if (context->schunk == NULL || context->schunk->frame == NULL) {
  ------------------
  |  Branch (2566:7): [True: 10, False: 24]
  |  Branch (2566:34): [True: 0, False: 24]
  ------------------
 2567|     10|    BLOSC_TRACE_ERROR("Lazy chunk needs an associated super-chunk with a frame.");
  ------------------
  |  |   93|     10|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     10|    do {                                            \
  |  |  |  |   98|     10|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     10|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 10, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     10|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2568|     10|    return BLOSC2_ERROR_INVALID_PARAM;
 2569|     10|  }
 2570|       |
 2571|     24|  blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 2572|     24|  blosc2_io_cb* io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 2573|     24|  if (io_cb == NULL) {
  ------------------
  |  Branch (2573:7): [True: 0, False: 24]
  ------------------
 2574|      0|    BLOSC_TRACE_ERROR("Error getting the input/output API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2575|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 2576|      0|  }
 2577|       |
 2578|     24|  int32_t trailer_offset = BLOSC_EXTENDED_HEADER_LENGTH +
 2579|     24|                           context->nblocks * (int32_t)sizeof(int32_t);
 2580|     24|  int32_t nchunk_lazy;
 2581|     24|  int64_t chunk_offset;
 2582|     24|  memcpy(&nchunk_lazy, context->src + trailer_offset, sizeof(nchunk_lazy));
 2583|     24|  memcpy(&chunk_offset, context->src + trailer_offset + (int32_t)sizeof(int32_t), sizeof(chunk_offset));
 2584|       |
 2585|     24|  void* fp = NULL;
 2586|     24|  int64_t io_pos;
 2587|     24|  if (frame->sframe) {
  ------------------
  |  Branch (2587:7): [True: 0, False: 24]
  ------------------
 2588|      0|    fp = sframe_open_chunk(frame->urlpath, nchunk_lazy, "rb", context->schunk->storage->io);
 2589|      0|    io_pos = offset;
 2590|      0|  }
 2591|     24|  else {
 2592|     24|    if (chunk_offset < 0 || offset < 0) {
  ------------------
  |  Branch (2592:9): [True: 5, False: 19]
  |  Branch (2592:29): [True: 0, False: 19]
  ------------------
 2593|      5|      BLOSC_TRACE_ERROR("Lazy chunk offset cannot be negative.");
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2594|      5|      return BLOSC2_ERROR_INVALID_HEADER;
 2595|      5|    }
 2596|     19|    fp = frame_reader_acquire(frame, context->schunk->storage->io);
 2597|     19|    if (frame->file_offset > INT64_MAX - chunk_offset) {
  ------------------
  |  Branch (2597:9): [True: 0, False: 19]
  ------------------
 2598|      0|      BLOSC_TRACE_ERROR("Lazy chunk offset overflows file position.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2599|      0|      if (fp != NULL) {
  ------------------
  |  Branch (2599:11): [True: 0, False: 0]
  ------------------
 2600|      0|        frame_reader_release(frame, io_cb, fp);
 2601|      0|      }
 2602|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2603|      0|    }
 2604|     19|    io_pos = frame->file_offset + chunk_offset;
 2605|     19|    if (io_pos > INT64_MAX - offset) {
  ------------------
  |  Branch (2605:9): [True: 1, False: 18]
  ------------------
 2606|      1|      BLOSC_TRACE_ERROR("Lazy block offset overflows file position.");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2607|      1|      if (fp != NULL) {
  ------------------
  |  Branch (2607:11): [True: 0, False: 1]
  ------------------
 2608|      0|        frame_reader_release(frame, io_cb, fp);
 2609|      0|      }
 2610|      1|      return BLOSC2_ERROR_INVALID_HEADER;
 2611|      1|    }
 2612|     18|    io_pos += offset;
 2613|     18|  }
 2614|     18|  if (fp == NULL) {
  ------------------
  |  Branch (2614:7): [True: 18, False: 0]
  ------------------
 2615|     18|    BLOSC_TRACE_ERROR("%s", open_error);
  ------------------
  |  |   93|     18|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     18|    do {                                            \
  |  |  |  |   98|     18|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     18|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 18, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     18|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2616|     18|    return BLOSC2_ERROR_FILE_OPEN;
 2617|     18|  }
 2618|       |
 2619|      0|  uint8_t* read_buffer = buffer;
 2620|      0|  int64_t rbytes = io_cb->read((void**)&read_buffer, 1, nbytes, io_pos, fp);
 2621|      0|  frame_reader_release(frame, io_cb, fp);
 2622|      0|  if (read_buffer != buffer) {
  ------------------
  |  Branch (2622:7): [True: 0, False: 0]
  ------------------
 2623|      0|    memcpy(buffer, read_buffer, (size_t)nbytes);
 2624|      0|    free(read_buffer);
 2625|      0|  }
 2626|      0|  if (rbytes != nbytes) {
  ------------------
  |  Branch (2626:7): [True: 0, False: 0]
  ------------------
 2627|      0|    BLOSC_TRACE_ERROR("%s", read_error);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2628|      0|    return BLOSC2_ERROR_FILE_READ;
 2629|      0|  }
 2630|       |
 2631|      0|  return 0;
 2632|      0|}
blosc2.c:do_job:
 2349|  56.0k|static int do_job(blosc2_context* context) {
 2350|  56.0k|  int32_t ntbytes;
 2351|       |
 2352|       |  /* Set sentinels */
 2353|  56.0k|  context->dref_not_init = 1;
 2354|       |
 2355|       |  /* Check whether we need to restart threads.  If the thread backend could
 2356|       |     not be set up (e.g. shared-pool creation failed under thread/resource
 2357|       |     exhaustion), rc < 0 and context->thread_pool stays NULL; fall back to the
 2358|       |     serial path below instead of dereferencing a NULL pool in parallel_blosc.
 2359|       |     The failed pool creation already emitted a TRACE_ERROR, and the next
 2360|       |     do_job() re-attempts the attach, so the fallback is self-healing. */
 2361|  56.0k|  int rc = check_nthreads(context);
 2362|       |
 2363|       |  /* Run the serial version when nthreads is 1, when the buffers are not larger
 2364|       |     than blocksize, or when the parallel backend failed to start */
 2365|  56.0k|  if (context->nthreads == 1 || (context->sourcesize / context->blocksize) <= 1 || rc < 0) {
  ------------------
  |  Branch (2365:7): [True: 56.0k, False: 0]
  |  Branch (2365:33): [True: 0, False: 0]
  |  Branch (2365:84): [True: 0, False: 0]
  ------------------
 2366|       |    /* The context for this 'thread' has no been initialized yet */
 2367|  56.0k|    if (context->serial_context == NULL) {
  ------------------
  |  Branch (2367:9): [True: 11.3k, False: 44.6k]
  ------------------
 2368|  11.3k|      context->serial_context = create_thread_context(context, 0);
 2369|  11.3k|    }
 2370|  44.6k|    else if (context->blocksize != context->serial_context->tmp_blocksize) {
  ------------------
  |  Branch (2370:14): [True: 72, False: 44.5k]
  ------------------
 2371|     72|      free_thread_context(context->serial_context);
 2372|     72|      context->serial_context = create_thread_context(context, 0);
 2373|     72|    }
 2374|  56.0k|    BLOSC_ERROR_NULL(context->serial_context, BLOSC2_ERROR_THREAD_CREATE);
  ------------------
  |  |  104|  56.0k|    do {                                            \
  |  |  105|  56.0k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 56.0k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  56.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 56.0k]
  |  |  ------------------
  ------------------
 2375|  56.0k|    ntbytes = serial_blosc(context->serial_context);
 2376|  56.0k|  }
 2377|      0|  else {
 2378|      0|    ntbytes = parallel_blosc(context);
 2379|      0|  }
 2380|       |
 2381|  56.0k|  return ntbytes;
 2382|  56.0k|}
blosc2.c:serial_blosc:
 2161|  56.0k|static int serial_blosc(struct thread_context* thread_context) {
 2162|  56.0k|  blosc2_context* context = thread_context->parent_context;
 2163|  56.0k|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2164|  56.0k|  int32_t j, bsize, leftoverblock;
 2165|  56.0k|  int32_t cbytes;
 2166|  56.0k|  int32_t ntbytes = context->output_bytes;
 2167|  56.0k|  int32_t* bstarts = context->bstarts;
 2168|  56.0k|  uint8_t* tmp = thread_context->tmp;
 2169|  56.0k|  uint8_t* tmp2 = thread_context->tmp2;
 2170|  56.0k|  int dict_training = context->use_dict && (context->dict_cdict == NULL);
  ------------------
  |  Branch (2170:23): [True: 5.99k, False: 50.0k]
  |  Branch (2170:44): [True: 5.99k, False: 0]
  ------------------
 2171|  56.0k|  bool memcpyed = context->header_flags & (uint8_t)BLOSC_MEMCPYED;
 2172|  56.0k|  if (!context->do_compress && context->special_type) {
  ------------------
  |  Branch (2172:7): [True: 56.0k, False: 0]
  |  Branch (2172:32): [True: 15.8k, False: 40.1k]
  ------------------
 2173|       |    // Fake a runlen as if it was a memcpyed chunk
 2174|  15.8k|    memcpyed = true;
 2175|  15.8k|  }
 2176|       |
 2177|  47.1M|  for (j = 0; j < context->nblocks; j++) {
  ------------------
  |  Branch (2177:15): [True: 47.0M, False: 46.7k]
  ------------------
 2178|  47.0M|    if (context->do_compress && !memcpyed && !dict_training) {
  ------------------
  |  Branch (2178:9): [True: 0, False: 47.0M]
  |  Branch (2178:33): [True: 0, False: 0]
  |  Branch (2178:46): [True: 0, False: 0]
  ------------------
 2179|      0|      _sw32(bstarts + j, ntbytes);
 2180|      0|    }
 2181|  47.0M|    bsize = vlblocks ? context->blocknbytes[j] : context->blocksize;
  ------------------
  |  Branch (2181:13): [True: 6, False: 47.0M]
  ------------------
 2182|  47.0M|    leftoverblock = 0;
 2183|  47.0M|    if (!vlblocks && (j == context->nblocks - 1) && (context->leftover > 0)) {
  ------------------
  |  Branch (2183:9): [True: 47.0M, False: 6]
  |  Branch (2183:22): [True: 39.4k, False: 47.0M]
  |  Branch (2183:53): [True: 28.2k, False: 11.2k]
  ------------------
 2184|  28.2k|      bsize = context->leftover;
 2185|  28.2k|      leftoverblock = 1;
 2186|  28.2k|    }
 2187|  47.0M|    if (context->do_compress) {
  ------------------
  |  Branch (2187:9): [True: 0, False: 47.0M]
  ------------------
 2188|      0|      if (memcpyed && !context->prefilter) {
  ------------------
  |  Branch (2188:11): [True: 0, False: 0]
  |  Branch (2188:23): [True: 0, False: 0]
  ------------------
 2189|       |        /* We want to memcpy only */
 2190|      0|        memcpy(context->dest + context->header_overhead + j * context->blocksize,
 2191|      0|               context->src + j * context->blocksize, (unsigned int)bsize);
 2192|      0|        cbytes = (int32_t)bsize;
 2193|      0|      }
 2194|      0|      else {
 2195|       |        /* Regular compression */
 2196|      0|        cbytes = blosc_c(thread_context, bsize, leftoverblock, ntbytes,
 2197|      0|                         context->destsize,
 2198|      0|                         vlblocks ? context->vlblock_sources[j] : context->src,
  ------------------
  |  Branch (2198:26): [True: 0, False: 0]
  ------------------
 2199|      0|                         vlblocks ? 0 : j * context->blocksize,
  ------------------
  |  Branch (2199:26): [True: 0, False: 0]
  ------------------
 2200|      0|                         context->dest + ntbytes, tmp, tmp2);
 2201|      0|        if (cbytes == 0) {
  ------------------
  |  Branch (2201:13): [True: 0, False: 0]
  ------------------
 2202|      0|          ntbytes = 0;              /* incompressible data */
 2203|      0|          break;
 2204|      0|        }
 2205|      0|      }
 2206|      0|    }
 2207|  47.0M|    else {
 2208|       |      /* Regular decompression */
 2209|       |      // If memcpyed we don't have a bstarts section (because it is not needed)
 2210|  47.0M|      int32_t src_offset = memcpyed ?
  ------------------
  |  Branch (2210:28): [True: 47.0M, False: 65.9k]
  ------------------
 2211|  47.0M|          context->header_overhead + j * context->blocksize : sw32_(bstarts + j);
 2212|  47.0M|      uint8_t *dest_block = (vlblocks && context->vlblock_dests != NULL) ? context->vlblock_dests[j] : context->dest;
  ------------------
  |  Branch (2212:30): [True: 6, False: 47.0M]
  |  Branch (2212:42): [True: 0, False: 6]
  ------------------
 2213|  47.0M|      int32_t dest_offset = (vlblocks && context->vlblock_dests != NULL) ? 0 :
  ------------------
  |  Branch (2213:30): [True: 6, False: 47.0M]
  |  Branch (2213:42): [True: 0, False: 6]
  ------------------
 2214|  47.0M|                            (vlblocks ? context->blockoffsets[j] : j * context->blocksize);
  ------------------
  |  Branch (2214:30): [True: 6, False: 47.0M]
  ------------------
 2215|  47.0M|      cbytes = blosc_d(thread_context, bsize, leftoverblock, memcpyed,
 2216|  47.0M|                       context->src, context->srcsize, src_offset, j,
 2217|  47.0M|                       dest_block, dest_offset, tmp, tmp2);
 2218|  47.0M|    }
 2219|       |
 2220|  47.0M|    if (cbytes < 0) {
  ------------------
  |  Branch (2220:9): [True: 9.24k, False: 47.0M]
  ------------------
 2221|  9.24k|      ntbytes = cbytes;         /* error in blosc_c or blosc_d */
 2222|  9.24k|      break;
 2223|  9.24k|    }
 2224|  47.0M|    ntbytes += cbytes;
 2225|  47.0M|  }
 2226|       |
 2227|  56.0k|  return ntbytes;
 2228|  56.0k|}
blosc2.c:set_values:
 1644|  5.49M|static int32_t set_values(int32_t typesize, const uint8_t* src, uint8_t* dest, int32_t destsize) {
 1645|       |#if defined(BLOSC_STRICT_ALIGN)
 1646|       |  if (destsize % typesize != 0) {
 1647|       |    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
 1648|       |  }
 1649|       |  int32_t nitems = destsize / typesize;
 1650|       |  if (nitems == 0) {
 1651|       |    return 0;
 1652|       |  }
 1653|       |  for (int i = 0; i < nitems; i++) {
 1654|       |    memcpy(dest + i * typesize, src + BLOSC_EXTENDED_HEADER_LENGTH, typesize);
 1655|       |  }
 1656|       |#else
 1657|  5.49M|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (1657:7): [True: 20, False: 5.49M]
  ------------------
 1658|     20|    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  111|     20|    do {                                            \
  |  |  112|     20|        int rc_ = (rc);                             \
  |  |  113|     20|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 20, False: 0]
  |  |  ------------------
  |  |  114|     20|            char *error_msg = print_error(rc_);     \
  |  |  115|     20|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|     20|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     20|    do {                                            \
  |  |  |  |  |  |   98|     20|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     20|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 20, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     20|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|     20|            return rc_;                             \
  |  |  117|     20|        }                                           \
  |  |  118|     20|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1659|     20|  }
 1660|  5.49M|  int32_t nitems = destsize / typesize;
 1661|  5.49M|  if (nitems == 0) {
  ------------------
  |  Branch (1661:7): [True: 0, False: 5.49M]
  ------------------
 1662|      0|    return 0;
 1663|      0|  }
 1664|       |
 1665|  5.49M|  switch (typesize) {
 1666|   660k|    case 8: {
  ------------------
  |  Branch (1666:5): [True: 660k, False: 4.83M]
  ------------------
 1667|   660k|      int64_t val8 = ((int64_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1668|   660k|      int64_t* dest8 = (int64_t*)dest;
 1669|   213M|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1669:23): [True: 213M, False: 660k]
  ------------------
 1670|   213M|        dest8[i] = val8;
 1671|   213M|      }
 1672|   660k|      break;
 1673|      0|    }
 1674|     30|    case 4: {
  ------------------
  |  Branch (1674:5): [True: 30, False: 5.49M]
  ------------------
 1675|     30|      int32_t val4 = ((int32_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1676|     30|      int32_t* dest4 = (int32_t*)dest;
 1677|  8.93M|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1677:23): [True: 8.93M, False: 30]
  ------------------
 1678|  8.93M|        dest4[i] = val4;
 1679|  8.93M|      }
 1680|     30|      break;
 1681|      0|    }
 1682|  4.52M|    case 2: {
  ------------------
  |  Branch (1682:5): [True: 4.52M, False: 974k]
  ------------------
 1683|  4.52M|      int16_t val2 = ((int16_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1684|  4.52M|      int16_t* dest2 = (int16_t*)dest;
 1685|  2.11G|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1685:23): [True: 2.10G, False: 4.52M]
  ------------------
 1686|  2.10G|        dest2[i] = val2;
 1687|  2.10G|      }
 1688|  4.52M|      break;
 1689|      0|    }
 1690|      0|    case 1: {
  ------------------
  |  Branch (1690:5): [True: 0, False: 5.49M]
  ------------------
 1691|      0|      int8_t val1 = ((int8_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1692|      0|      int8_t* dest1 = (int8_t*)dest;
 1693|      0|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1693:23): [True: 0, False: 0]
  ------------------
 1694|      0|        dest1[i] = val1;
 1695|      0|      }
 1696|      0|      break;
 1697|      0|    }
 1698|   314k|    default:
  ------------------
  |  Branch (1698:5): [True: 314k, False: 5.18M]
  ------------------
 1699|   543M|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1699:23): [True: 542M, False: 314k]
  ------------------
 1700|   542M|        memcpy(dest + i * typesize, src + BLOSC_EXTENDED_HEADER_LENGTH, typesize);
 1701|   542M|      }
 1702|  5.49M|  }
 1703|  5.49M|#endif
 1704|       |
 1705|  5.49M|  return nitems;
 1706|  5.49M|}
blosc2.c:set_nans:
 1612|  24.8M|static int32_t set_nans(int32_t typesize, uint8_t* dest, int32_t destsize) {
 1613|  24.8M|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (1613:7): [True: 3, False: 24.8M]
  ------------------
 1614|      3|    BLOSC_TRACE_ERROR("destsize can only be a multiple of typesize");
  ------------------
  |  |   93|      3|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      3|    do {                                            \
  |  |  |  |   98|      3|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      3|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      3|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1615|      3|    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  111|      3|    do {                                            \
  |  |  112|      3|        int rc_ = (rc);                             \
  |  |  113|      3|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 3, False: 0]
  |  |  ------------------
  |  |  114|      3|            char *error_msg = print_error(rc_);     \
  |  |  115|      3|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|      3|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      3|    do {                                            \
  |  |  |  |  |  |   98|      3|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      3|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 3, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      3|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      3|            return rc_;                             \
  |  |  117|      3|        }                                           \
  |  |  118|      3|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1616|      3|  }
 1617|  24.8M|  int32_t nitems = destsize / typesize;
 1618|  24.8M|  if (nitems == 0) {
  ------------------
  |  Branch (1618:7): [True: 0, False: 24.8M]
  ------------------
 1619|      0|    return 0;
 1620|      0|  }
 1621|       |
 1622|  24.8M|  if (typesize == 4) {
  ------------------
  |  Branch (1622:7): [True: 83.6k, False: 24.7M]
  ------------------
 1623|  83.6k|    float* dest_ = (float*)dest;
 1624|  83.6k|    float val = nanf("");
 1625|  2.80G|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1625:21): [True: 2.80G, False: 83.6k]
  ------------------
 1626|  2.80G|      dest_[i] = val;
 1627|  2.80G|    }
 1628|  83.6k|    return nitems;
 1629|  83.6k|  }
 1630|  24.7M|  else if (typesize == 8) {
  ------------------
  |  Branch (1630:12): [True: 24.7M, False: 9]
  ------------------
 1631|  24.7M|    double* dest_ = (double*)dest;
 1632|  24.7M|    double val = nan("");
 1633|  1.61G|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1633:21): [True: 1.58G, False: 24.7M]
  ------------------
 1634|  1.58G|      dest_[i] = val;
 1635|  1.58G|    }
 1636|  24.7M|    return nitems;
 1637|  24.7M|  }
 1638|       |
 1639|      9|  BLOSC_TRACE_ERROR("Unsupported typesize for NaN");
  ------------------
  |  |   93|      9|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      9|    do {                                            \
  |  |  |  |   98|      9|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      9|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      9|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1640|      9|  return BLOSC2_ERROR_DATA;
 1641|  24.8M|}
blosc2.c:my_malloc:
  243|   176k|static uint8_t* my_malloc(size_t size) {
  244|   176k|  void* block = NULL;
  245|   176k|  int res = 0;
  246|       |  /* Keep aligned allocations valid under Valgrind and POSIX wrappers. */
  247|   176k|  if (size == 0) {
  ------------------
  |  Branch (247:7): [True: 0, False: 176k]
  ------------------
  248|      0|    size = 1;
  249|      0|  }
  250|       |
  251|       |/* Do an alignment to 32 bytes because AVX2 is supported */
  252|       |#if defined(_WIN32)
  253|       |  /* A (void *) cast needed for avoiding a warning with MINGW :-/ */
  254|       |  block = (void *)_aligned_malloc(size, 32);
  255|       |#elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600
  256|       |  /* Platform does have an implementation of posix_memalign */
  257|   176k|  res = posix_memalign(&block, 32, size);
  258|       |#else
  259|       |  block = malloc(size);
  260|       |#endif  /* _WIN32 */
  261|       |
  262|   176k|  if (block == NULL || res != 0) {
  ------------------
  |  Branch (262:7): [True: 0, False: 176k]
  |  Branch (262:24): [True: 0, False: 176k]
  ------------------
  263|      0|    BLOSC_TRACE_ERROR("Error allocating memory!");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  264|      0|    return NULL;
  265|      0|  }
  266|       |
  267|   176k|  return (uint8_t*)block;
  268|   176k|}
blosc2.c:blosc_d:
 1713|  47.1M|    int32_t nblock, uint8_t* dest, int32_t dest_offset, uint8_t* tmp, uint8_t* tmp2) {
 1714|  47.1M|  blosc2_context* context = thread_context->parent_context;
 1715|  47.1M|  uint8_t* filters = context->filters;
 1716|  47.1M|  uint8_t *tmp3 = thread_context->tmp4;
 1717|  47.1M|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 1718|  47.1M|  int32_t compformat = (context->header_flags & (uint8_t)0xe0) >> 5u;
 1719|  47.1M|  int dont_split = (context->header_flags & 0x10) >> 4;
 1720|  47.1M|  int32_t chunk_nbytes;
 1721|  47.1M|  int32_t chunk_cbytes;
 1722|  47.1M|  int nstreams;
 1723|  47.1M|  int32_t neblock;
 1724|  47.1M|  int32_t nbytes;                /* number of decompressed bytes in split */
 1725|  47.1M|  int32_t cbytes;                /* number of compressed bytes in split */
 1726|       |  // int32_t ctbytes = 0;           /* number of compressed bytes in block */
 1727|  47.1M|  int32_t ntbytes = 0;           /* number of uncompressed bytes in block */
 1728|  47.1M|  uint8_t* _dest;
 1729|  47.1M|  int32_t typesize = context->typesize;
 1730|  47.1M|  bool instr_codec = context->blosc2_flags & BLOSC2_INSTR_CODEC;
 1731|  47.1M|  const char* compname;
 1732|  47.1M|  int rc;
 1733|       |
 1734|  47.1M|  if (context->block_maskout != NULL && context->block_maskout[nblock]) {
  ------------------
  |  Branch (1734:7): [True: 0, False: 47.1M]
  |  Branch (1734:41): [True: 0, False: 0]
  ------------------
 1735|       |    // Do not decompress, but act as if we successfully decompressed everything
 1736|      0|    return bsize;
 1737|      0|  }
 1738|       |
 1739|  47.1M|  rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 1740|  47.1M|  if (rc < 0) {
  ------------------
  |  Branch (1740:7): [True: 0, False: 47.1M]
  ------------------
 1741|      0|    return rc;
 1742|      0|  }
 1743|  47.1M|  if (context->special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (1743:7): [True: 5.49M, False: 41.6M]
  ------------------
 1744|       |    // We need the actual typesize in this case, but it cannot be encoded in the header, so derive it from cbytes
 1745|  5.49M|    typesize = chunk_cbytes - context->header_overhead;
 1746|  5.49M|  }
 1747|       |
 1748|       |  // In some situations (lazychunks) the context can arrive uninitialized
 1749|       |  // (but BITSHUFFLE needs it for accessing the format of the chunk)
 1750|  47.1M|  if (context->src == NULL) {
  ------------------
  |  Branch (1750:7): [True: 0, False: 47.1M]
  ------------------
 1751|      0|    context->src = src;
 1752|      0|  }
 1753|       |
 1754|       |  // Chunks with special values cannot be lazy
 1755|  47.1M|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (1755:19): [True: 47.1M, False: 262]
  ------------------
 1756|  47.1M|          (context->blosc2_flags & 0x08u) && !context->special_type);
  ------------------
  |  Branch (1756:11): [True: 28.8M, False: 18.2M]
  |  Branch (1756:46): [True: 14, False: 28.8M]
  ------------------
 1757|  47.1M|  if (is_lazy) {
  ------------------
  |  Branch (1757:7): [True: 14, False: 47.1M]
  ------------------
 1758|       |    // The chunk is on disk, so just lazily load the block
 1759|     14|    if (context->schunk == NULL) {
  ------------------
  |  Branch (1759:9): [True: 4, False: 10]
  ------------------
 1760|      4|      BLOSC_TRACE_ERROR("Lazy chunk needs an associated super-chunk.");
  ------------------
  |  |   93|      4|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      4|    do {                                            \
  |  |  |  |   98|      4|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      4|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      4|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1761|      4|      return BLOSC2_ERROR_INVALID_PARAM;
 1762|      4|    }
 1763|     10|    if (context->schunk->frame == NULL) {
  ------------------
  |  Branch (1763:9): [True: 0, False: 10]
  ------------------
 1764|      0|      BLOSC_TRACE_ERROR("Lazy chunk needs an associated frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1765|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 1766|      0|    }
 1767|     10|    blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 1768|     10|    size_t bstarts_nbytes;
 1769|     10|    size_t trailer_offset;
 1770|     10|    size_t block_csizes_nbytes;
 1771|     10|    size_t trailer_meta_nbytes;
 1772|     10|    size_t lazy_trailer_end;
 1773|     10|    if (srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (1773:9): [True: 0, False: 10]
  |  Branch (1773:24): [True: 0, False: 10]
  ------------------
 1774|     10|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (1774:9): [True: 0, False: 10]
  ------------------
 1775|     10|        !checked_add_size((size_t)BLOSC_EXTENDED_HEADER_LENGTH, bstarts_nbytes, &trailer_offset) ||
  ------------------
  |  Branch (1775:9): [True: 0, False: 10]
  ------------------
 1776|     10|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (1776:9): [True: 0, False: 10]
  ------------------
 1777|     10|        !checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (1777:9): [True: 0, False: 10]
  ------------------
 1778|     10|        !checked_add_size(trailer_offset, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (1778:9): [True: 0, False: 10]
  ------------------
 1779|     10|        (size_t)srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (1779:9): [True: 1, False: 9]
  ------------------
 1780|      1|      BLOSC_TRACE_ERROR("Lazy trailer exceeds source buffer.");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1781|      1|      return BLOSC2_ERROR_READ_BUFFER;
 1782|      1|    }
 1783|      9|    int32_t nchunk;
 1784|      9|    int64_t chunk_offset;
 1785|       |    // The nchunk and the offset of the current chunk are in the trailer
 1786|      9|    memcpy(&nchunk, src + trailer_offset, sizeof(nchunk));
 1787|      9|    memcpy(&chunk_offset, src + trailer_offset + sizeof(int32_t), sizeof(chunk_offset));
 1788|       |    // Get the csize of the nblock
 1789|      9|    if (nblock < 0 || nblock >= context->nblocks) {
  ------------------
  |  Branch (1789:9): [True: 0, False: 9]
  |  Branch (1789:23): [True: 0, False: 9]
  ------------------
 1790|      0|      BLOSC_TRACE_ERROR("Invalid block index in lazy trailer.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1791|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1792|      0|    }
 1793|      9|    int32_t *block_csizes = (int32_t *)(src + trailer_offset + sizeof(int32_t) + sizeof(int64_t));
 1794|      9|    int32_t block_csize = block_csizes[nblock];
 1795|      9|    int32_t max_lazy_block_csize = context->blocksize + context->typesize * (signed)sizeof(int32_t);
 1796|      9|    if (block_csize <= 0 || block_csize > max_lazy_block_csize) {
  ------------------
  |  Branch (1796:9): [True: 1, False: 8]
  |  Branch (1796:29): [True: 7, False: 1]
  ------------------
 1797|      8|      BLOSC_TRACE_ERROR("Invalid lazy block size in trailer.");
  ------------------
  |  |   93|      8|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      8|    do {                                            \
  |  |  |  |   98|      8|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      8|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      8|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1798|      8|      return BLOSC2_ERROR_INVALID_HEADER;
 1799|      8|    }
 1800|      1|    if (vlblocks && block_csize <= (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (1800:9): [True: 0, False: 1]
  |  Branch (1800:21): [True: 0, False: 0]
  ------------------
 1801|      0|      BLOSC_TRACE_ERROR("Lazy VL block compressed size is too small.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1802|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1803|      0|    }
 1804|       |    // Read the lazy block on disk
 1805|      1|    void* fp = NULL;
 1806|      1|    blosc2_io_cb *io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 1807|      1|    if (io_cb == NULL) {
  ------------------
  |  Branch (1807:9): [True: 0, False: 1]
  ------------------
 1808|      0|      BLOSC_TRACE_ERROR("Error getting the input/output API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1809|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 1810|      0|    }
 1811|       |
 1812|      1|    int64_t io_pos = 0;
 1813|      1|    if (frame->sframe) {
  ------------------
  |  Branch (1813:9): [True: 0, False: 1]
  ------------------
 1814|       |      // The chunk is not in the frame
 1815|      0|      fp = sframe_open_chunk(frame->urlpath, nchunk, "rb", context->schunk->storage->io);
 1816|      0|      BLOSC_ERROR_NULL(fp, BLOSC2_ERROR_FILE_OPEN);
  ------------------
  |  |  104|      0|    do {                                            \
  |  |  105|      0|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1817|       |      // The offset of the block is src_offset
 1818|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (1818:11): [True: 0, False: 0]
  ------------------
 1819|      0|        frame_reader_release(frame, io_cb, fp);
 1820|      0|        BLOSC_TRACE_ERROR("Lazy block offset cannot be negative.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1821|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1822|      0|      }
 1823|      0|      io_pos = src_offset;
 1824|      0|    }
 1825|      1|    else {
 1826|      1|      fp = frame_reader_acquire(frame, context->schunk->storage->io);
 1827|      1|      BLOSC_ERROR_NULL(fp, BLOSC2_ERROR_FILE_OPEN);
  ------------------
  |  |  104|      1|    do {                                            \
  |  |  105|      1|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 1, False: 0]
  |  |  ------------------
  |  |  106|      1|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      1|            return (rc);                            \
  |  |  108|      1|        }                                           \
  |  |  109|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1828|       |      // The offset of the block is src_offset
 1829|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (1829:11): [True: 0, False: 0]
  ------------------
 1830|      0|        frame_reader_release(frame, io_cb, fp);
 1831|      0|        BLOSC_TRACE_ERROR("Lazy block offset cannot be negative.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1832|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1833|      0|      }
 1834|      0|      if (chunk_offset < 0) {
  ------------------
  |  Branch (1834:11): [True: 0, False: 0]
  ------------------
 1835|      0|        frame_reader_release(frame, io_cb, fp);
 1836|      0|        BLOSC_TRACE_ERROR("Lazy chunk offset cannot be negative.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1837|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1838|      0|      }
 1839|      0|      if (frame->file_offset > INT64_MAX - chunk_offset) {
  ------------------
  |  Branch (1839:11): [True: 0, False: 0]
  ------------------
 1840|      0|        frame_reader_release(frame, io_cb, fp);
 1841|      0|        BLOSC_TRACE_ERROR("Lazy chunk offset overflows file position.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1842|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1843|      0|      }
 1844|      0|      io_pos = frame->file_offset + chunk_offset;
 1845|      0|      if (io_pos > INT64_MAX - src_offset) {
  ------------------
  |  Branch (1845:11): [True: 0, False: 0]
  ------------------
 1846|      0|        frame_reader_release(frame, io_cb, fp);
 1847|      0|        BLOSC_TRACE_ERROR("Lazy block offset overflows file position.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1848|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1849|      0|      }
 1850|      0|      io_pos += src_offset;
 1851|      0|    }
 1852|       |    // We can make use of tmp3 because it will be used after src is not needed anymore
 1853|      0|    int64_t rbytes = io_cb->read((void**)&tmp3, 1, block_csize, io_pos, fp);
 1854|      0|    frame_reader_release(frame, io_cb, fp);
 1855|      0|    if ((int32_t)rbytes != block_csize) {
  ------------------
  |  Branch (1855:9): [True: 0, False: 0]
  ------------------
 1856|      0|      BLOSC_TRACE_ERROR("Cannot read the (lazy) block out of the fileframe.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1857|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1858|      0|    }
 1859|      0|    src = tmp3;
 1860|      0|    src_offset = 0;
 1861|      0|    srcsize = block_csize;
 1862|      0|  }
 1863|       |
 1864|       |  // If the chunk is memcpyed, we just have to copy the block to dest and return
 1865|  47.1M|  if (memcpyed) {
  ------------------
  |  Branch (1865:7): [True: 47.0M, False: 107k]
  ------------------
 1866|  47.0M|    int bsize_ = leftoverblock ? chunk_nbytes % context->blocksize : bsize;
  ------------------
  |  Branch (1866:18): [True: 2.17k, False: 47.0M]
  ------------------
 1867|  47.0M|    if (!context->special_type) {
  ------------------
  |  Branch (1867:9): [True: 1.55k, False: 47.0M]
  ------------------
 1868|  1.55k|      if (chunk_nbytes + context->header_overhead != chunk_cbytes) {
  ------------------
  |  Branch (1868:11): [True: 0, False: 1.55k]
  ------------------
 1869|      0|        return BLOSC2_ERROR_WRITE_BUFFER;
 1870|      0|      }
 1871|  1.55k|      if (chunk_cbytes < context->header_overhead + (nblock * context->blocksize) + bsize_) {
  ------------------
  |  Branch (1871:11): [True: 0, False: 1.55k]
  ------------------
 1872|       |        /* Not enough input to copy block */
 1873|      0|        return BLOSC2_ERROR_READ_BUFFER;
 1874|      0|      }
 1875|  1.55k|    }
 1876|  47.0M|    if (!is_lazy) {
  ------------------
  |  Branch (1876:9): [True: 47.0M, False: 0]
  ------------------
 1877|  47.0M|      src += context->header_overhead + nblock * context->blocksize;
 1878|  47.0M|    }
 1879|  47.0M|    _dest = dest + dest_offset;
 1880|  47.0M|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (1880:9): [True: 0, False: 47.0M]
  ------------------
 1881|       |      // We are making use of a postfilter, so use a temp for destination
 1882|      0|      _dest = tmp;
 1883|      0|    }
 1884|  47.0M|    rc = 0;
 1885|  47.0M|    switch (context->special_type) {
 1886|  5.49M|      case BLOSC2_SPECIAL_VALUE:
  ------------------
  |  Branch (1886:7): [True: 5.49M, False: 41.5M]
  ------------------
 1887|       |        // All repeated values
 1888|  5.49M|        rc = set_values(typesize, context->src, _dest, bsize_);
 1889|  5.49M|        if (rc < 0) {
  ------------------
  |  Branch (1889:13): [True: 1, False: 5.49M]
  ------------------
 1890|      1|          BLOSC_TRACE_ERROR("set_values failed");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1891|      1|          return BLOSC2_ERROR_DATA;
 1892|      1|        }
 1893|  5.49M|        break;
 1894|  24.8M|      case BLOSC2_SPECIAL_NAN:
  ------------------
  |  Branch (1894:7): [True: 24.8M, False: 22.1M]
  ------------------
 1895|  24.8M|        rc = set_nans(context->typesize, _dest, bsize_);
 1896|  24.8M|        if (rc < 0) {
  ------------------
  |  Branch (1896:13): [True: 12, False: 24.8M]
  ------------------
 1897|     12|          BLOSC_TRACE_ERROR("set_nans failed");
  ------------------
  |  |   93|     12|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     12|    do {                                            \
  |  |  |  |   98|     12|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     12|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     12|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1898|     12|          return BLOSC2_ERROR_DATA;
 1899|     12|        }
 1900|  24.8M|        break;
 1901|  24.8M|      case BLOSC2_SPECIAL_ZERO:
  ------------------
  |  Branch (1901:7): [True: 16.3M, False: 30.6M]
  ------------------
 1902|  16.3M|        memset(_dest, 0, bsize_);
 1903|  16.3M|        break;
 1904|   343k|      case BLOSC2_SPECIAL_UNINIT:
  ------------------
  |  Branch (1904:7): [True: 343k, False: 46.6M]
  ------------------
 1905|       |        // We do nothing here
 1906|   343k|        break;
 1907|  1.55k|      default:
  ------------------
  |  Branch (1907:7): [True: 1.55k, False: 47.0M]
  ------------------
 1908|  1.55k|        memcpy(_dest, src, bsize_);
 1909|  47.0M|    }
 1910|  47.0M|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (1910:9): [True: 0, False: 47.0M]
  ------------------
 1911|       |      // Create new postfilter parameters for this block (must be private for each thread)
 1912|      0|      blosc2_postfilter_params postparams;
 1913|      0|      memcpy(&postparams, context->postparams, sizeof(postparams));
 1914|      0|      postparams.input = tmp;
 1915|      0|      postparams.output = dest + dest_offset;
 1916|      0|      postparams.size = bsize;
 1917|      0|      postparams.typesize = typesize;
 1918|      0|      postparams.offset = nblock * context->blocksize;
 1919|      0|      postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (1919:27): [True: 0, False: 0]
  ------------------
 1920|      0|      postparams.nblock = nblock;
 1921|      0|      postparams.tid = thread_context->tid;
 1922|      0|      postparams.ttmp = thread_context->tmp;
 1923|      0|      postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 1924|      0|      postparams.ctx = context;
 1925|       |
 1926|       |      // Execute the postfilter (the processed block will be copied to dest)
 1927|      0|      if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (1927:11): [True: 0, False: 0]
  ------------------
 1928|      0|        BLOSC_TRACE_ERROR("Execution of postfilter function failed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1929|      0|        return BLOSC2_ERROR_POSTFILTER;
 1930|      0|      }
 1931|      0|    }
 1932|  47.0M|    thread_context->zfp_cell_nitems = 0;
 1933|       |
 1934|  47.0M|    return bsize_;
 1935|  47.0M|  }
 1936|       |
 1937|   107k|  if (!is_lazy && (src_offset <= 0 || src_offset >= srcsize)) {
  ------------------
  |  Branch (1937:7): [True: 107k, False: 0]
  |  Branch (1937:20): [True: 48, False: 107k]
  |  Branch (1937:39): [True: 111, False: 107k]
  ------------------
 1938|       |    /* Invalid block src offset encountered */
 1939|    159|    return BLOSC2_ERROR_DATA;
 1940|    159|  }
 1941|       |
 1942|   107k|  src += src_offset;
 1943|   107k|  if (vlblocks) {
  ------------------
  |  Branch (1943:7): [True: 3, False: 107k]
  ------------------
 1944|      3|    if (context->blockcbytes == NULL || nblock >= context->nblocks ||
  ------------------
  |  Branch (1944:9): [True: 0, False: 3]
  |  Branch (1944:41): [True: 0, False: 3]
  ------------------
 1945|      3|        context->blockcbytes[nblock] <= (int32_t)sizeof(int32_t) ||
  ------------------
  |  Branch (1945:9): [True: 0, False: 3]
  ------------------
 1946|      3|        src_offset > srcsize - context->blockcbytes[nblock]) {
  ------------------
  |  Branch (1946:9): [True: 0, False: 3]
  ------------------
 1947|      0|      return BLOSC2_ERROR_DATA;
 1948|      0|    }
 1949|      3|    srcsize = context->blockcbytes[nblock];
 1950|      3|  }
 1951|   107k|  else {
 1952|   107k|    srcsize -= src_offset;
 1953|   107k|  }
 1954|       |
 1955|   107k|  int last_filter_index = last_filter(filters, 'd');
 1956|   107k|  if (instr_codec) {
  ------------------
  |  Branch (1956:7): [True: 1.21k, False: 105k]
  ------------------
 1957|       |    // If instrumented, we don't want to run the filters
 1958|  1.21k|    _dest = dest + dest_offset;
 1959|  1.21k|  }
 1960|   105k|  else if (((last_filter_index >= 0) &&
  ------------------
  |  Branch (1960:13): [True: 101k, False: 4.98k]
  ------------------
 1961|   101k|       (next_filter(filters, BLOSC2_MAX_FILTERS, 'd') != BLOSC_DELTA)) ||
  ------------------
  |  Branch (1961:8): [True: 76.8k, False: 24.1k]
  ------------------
 1962|  76.8k|    context->postfilter != NULL) {
  ------------------
  |  Branch (1962:5): [True: 0, False: 29.1k]
  ------------------
 1963|       |    // We are making use of some filter, so use a temp for destination
 1964|  76.8k|    _dest = tmp;
 1965|  76.8k|  }
 1966|  29.1k|  else {
 1967|       |    // If no filters, or only DELTA in pipeline
 1968|  29.1k|    _dest = dest + dest_offset;
 1969|  29.1k|  }
 1970|       |
 1971|       |  /* The number of compressed data streams for this block */
 1972|   107k|  if (vlblocks) {
  ------------------
  |  Branch (1972:7): [True: 3, False: 107k]
  ------------------
 1973|      3|    nstreams = 1;
 1974|      3|  }
 1975|   107k|  else if (!dont_split && !leftoverblock) {
  ------------------
  |  Branch (1975:12): [True: 1.50k, False: 105k]
  |  Branch (1975:27): [True: 1.46k, False: 39]
  ------------------
 1976|  1.46k|    nstreams = context->typesize;
 1977|  1.46k|  }
 1978|   105k|  else {
 1979|   105k|    nstreams = 1;
 1980|   105k|  }
 1981|       |
 1982|   107k|  neblock = bsize / nstreams;
 1983|   107k|  if (neblock == 0) {
  ------------------
  |  Branch (1983:7): [True: 1, False: 107k]
  ------------------
 1984|       |    /* Not enough space to output bytes */
 1985|      1|    BLOSC_ERROR(BLOSC2_ERROR_WRITE_BUFFER);
  ------------------
  |  |  111|      1|    do {                                            \
  |  |  112|      1|        int rc_ = (rc);                             \
  |  |  113|      1|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 1, False: 0]
  |  |  ------------------
  |  |  114|      1|            char *error_msg = print_error(rc_);     \
  |  |  115|      1|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      1|            return rc_;                             \
  |  |  117|      1|        }                                           \
  |  |  118|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1986|      1|  }
 1987|   205k|  for (int j = 0; j < nstreams; j++) {
  ------------------
  |  Branch (1987:19): [True: 107k, False: 98.4k]
  ------------------
 1988|   107k|    if (vlblocks) {
  ------------------
  |  Branch (1988:9): [True: 3, False: 107k]
  ------------------
 1989|      3|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (1989:11): [True: 0, False: 3]
  ------------------
 1990|       |        /* Not enough input to read compressed bytes */
 1991|      0|        return BLOSC2_ERROR_READ_BUFFER;
 1992|      0|      }
 1993|      3|      neblock = sw32_(src);
 1994|      3|      if (neblock != bsize) {
  ------------------
  |  Branch (1994:11): [True: 0, False: 3]
  ------------------
 1995|      0|        return BLOSC2_ERROR_DATA;
 1996|      0|      }
 1997|      3|      src += sizeof(int32_t);
 1998|      3|      cbytes = srcsize - (int32_t)sizeof(int32_t);
 1999|      3|      srcsize = 0;
 2000|      3|    }
 2001|   107k|    else {
 2002|   107k|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2002:11): [True: 2, False: 107k]
  ------------------
 2003|       |        /* Not enough input to read compressed size */
 2004|      2|        return BLOSC2_ERROR_READ_BUFFER;
 2005|      2|      }
 2006|   107k|      srcsize -= sizeof(int32_t);
 2007|   107k|      cbytes = sw32_(src);      /* amount of compressed bytes */
 2008|   107k|      if (cbytes > 0) {
  ------------------
  |  Branch (2008:11): [True: 9.58k, False: 97.7k]
  ------------------
 2009|  9.58k|        if (srcsize < cbytes) {
  ------------------
  |  Branch (2009:13): [True: 21, False: 9.56k]
  ------------------
 2010|       |          /* Not enough input to read compressed bytes */
 2011|     21|          return BLOSC2_ERROR_READ_BUFFER;
 2012|     21|        }
 2013|  9.56k|        srcsize -= cbytes;
 2014|  9.56k|      }
 2015|   107k|      src += sizeof(int32_t);
 2016|   107k|    }
 2017|       |    // ctbytes += (signed)sizeof(int32_t);
 2018|       |
 2019|       |    /* Uncompress */
 2020|   107k|    if (!vlblocks && cbytes == 0) {
  ------------------
  |  Branch (2020:9): [True: 107k, False: 3]
  |  Branch (2020:22): [True: 60.7k, False: 46.5k]
  ------------------
 2021|       |      // A run of 0's
 2022|  60.7k|      memset(_dest, 0, (unsigned int)neblock);
 2023|  60.7k|      nbytes = neblock;
 2024|  60.7k|    }
 2025|  46.5k|    else if (!vlblocks && cbytes < 0) {
  ------------------
  |  Branch (2025:14): [True: 46.5k, False: 3]
  |  Branch (2025:27): [True: 36.9k, False: 9.56k]
  ------------------
 2026|       |      // A negative number means some encoding depending on the token that comes next
 2027|  36.9k|      uint8_t token;
 2028|       |
 2029|  36.9k|      if (srcsize < (signed)sizeof(uint8_t)) {
  ------------------
  |  Branch (2029:11): [True: 1, False: 36.9k]
  ------------------
 2030|       |        // Not enough input to read token */
 2031|      1|        return BLOSC2_ERROR_READ_BUFFER;
 2032|      1|      }
 2033|  36.9k|      srcsize -= sizeof(uint8_t);
 2034|       |
 2035|  36.9k|      token = src[0];
 2036|  36.9k|      src += 1;
 2037|       |      // ctbytes += 1;
 2038|       |
 2039|  36.9k|      if (token & 0x1) {
  ------------------
  |  Branch (2039:11): [True: 36.9k, False: 11]
  ------------------
 2040|       |        // A run of bytes that are different than 0
 2041|  36.9k|        if (cbytes < -255) {
  ------------------
  |  Branch (2041:13): [True: 26, False: 36.9k]
  ------------------
 2042|       |          // Runs can only encode a byte
 2043|     26|          return BLOSC2_ERROR_RUN_LENGTH;
 2044|     26|        }
 2045|  36.9k|        uint8_t value = -cbytes;
 2046|  36.9k|        memset(_dest, value, (unsigned int)neblock);
 2047|  36.9k|      } else {
 2048|     11|        BLOSC_TRACE_ERROR("Invalid or unsupported compressed stream token value - %d", token);
  ------------------
  |  |   93|     11|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     11|    do {                                            \
  |  |  |  |   98|     11|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     11|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 11, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     11|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2049|     11|        return BLOSC2_ERROR_RUN_LENGTH;
 2050|     11|      }
 2051|  36.9k|      nbytes = neblock;
 2052|  36.9k|      cbytes = 0;  // everything is encoded in the cbytes token
 2053|  36.9k|    }
 2054|  9.56k|    else if (cbytes == neblock) {
  ------------------
  |  Branch (2054:14): [True: 526, False: 9.04k]
  ------------------
 2055|    526|      memcpy(_dest, src, (unsigned int)neblock);
 2056|    526|      nbytes = (int32_t)neblock;
 2057|    526|    }
 2058|  9.04k|    else {
 2059|  9.04k|      if (compformat == BLOSC_BLOSCLZ_FORMAT) {
  ------------------
  |  Branch (2059:11): [True: 235, False: 8.80k]
  ------------------
 2060|    235|        nbytes = blosclz_decompress(src, cbytes, _dest, (int)neblock);
 2061|    235|      }
 2062|  8.80k|      else if (compformat == BLOSC_LZ4_FORMAT) {
  ------------------
  |  Branch (2062:16): [True: 778, False: 8.02k]
  ------------------
 2063|    778|        nbytes = lz4_wrap_decompress((char*)src, (size_t)cbytes,
 2064|    778|                                     (char*)_dest, (size_t)neblock,
 2065|    778|                                     thread_context);
 2066|    778|      }
 2067|  8.02k|  #if defined(HAVE_ZLIB)
 2068|  8.02k|      else if (compformat == BLOSC_ZLIB_FORMAT) {
  ------------------
  |  Branch (2068:16): [True: 671, False: 7.35k]
  ------------------
 2069|    671|        nbytes = zlib_wrap_decompress((char*)src, (size_t)cbytes,
 2070|    671|                                      (char*)_dest, (size_t)neblock);
 2071|    671|      }
 2072|  7.35k|  #endif /*  HAVE_ZLIB */
 2073|  7.35k|  #if defined(HAVE_ZSTD)
 2074|  7.35k|      else if (compformat == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2074:16): [True: 6.79k, False: 560]
  ------------------
 2075|  6.79k|        nbytes = zstd_wrap_decompress(thread_context,
 2076|  6.79k|                                      (char*)src, (size_t)cbytes,
 2077|  6.79k|                                      (char*)_dest, (size_t)neblock);
 2078|  6.79k|      }
 2079|    560|  #endif /*  HAVE_ZSTD */
 2080|    560|      else if (compformat == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (2080:16): [True: 555, False: 5]
  ------------------
 2081|    555|        bool getcell = false;
 2082|       |
 2083|    555|#if defined(HAVE_ZFP)
 2084|    555|        if ((context->compcode == BLOSC_CODEC_ZFP_FIXED_RATE) &&
  ------------------
  |  Branch (2084:13): [True: 1, False: 554]
  ------------------
 2085|      1|            (thread_context->zfp_cell_nitems > 0)) {
  ------------------
  |  Branch (2085:13): [True: 0, False: 1]
  ------------------
 2086|      0|          nbytes = zfp_getcell(thread_context, src, cbytes, _dest, neblock);
 2087|      0|          if (nbytes < 0) {
  ------------------
  |  Branch (2087:15): [True: 0, False: 0]
  ------------------
 2088|      0|            return BLOSC2_ERROR_DATA;
 2089|      0|          }
 2090|      0|          if (nbytes == thread_context->zfp_cell_nitems * typesize) {
  ------------------
  |  Branch (2090:15): [True: 0, False: 0]
  ------------------
 2091|      0|            getcell = true;
 2092|      0|          }
 2093|      0|        }
 2094|    555|#endif /* HAVE_ZFP */
 2095|    555|        if (!getcell) {
  ------------------
  |  Branch (2095:13): [True: 555, False: 0]
  ------------------
 2096|    555|          thread_context->zfp_cell_nitems = 0;
 2097|    647|          for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (2097:27): [True: 641, False: 6]
  ------------------
 2098|    641|            if (g_codecs[i].compcode == context->compcode) {
  ------------------
  |  Branch (2098:17): [True: 549, False: 92]
  ------------------
 2099|    549|              if (g_codecs[i].decoder == NULL) {
  ------------------
  |  Branch (2099:19): [True: 5, False: 544]
  ------------------
 2100|       |                // Dynamically load codec plugin
 2101|      5|                if (fill_codec(&g_codecs[i]) < 0) {
  ------------------
  |  Branch (2101:21): [True: 5, False: 0]
  ------------------
 2102|      5|                  BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2103|      5|                  return BLOSC2_ERROR_CODEC_SUPPORT;
 2104|      5|                }
 2105|      5|              }
 2106|    544|              blosc2_dparams dparams;
 2107|    544|              blosc2_ctx_get_dparams(context, &dparams);
 2108|    544|              nbytes = g_codecs[i].decoder(src,
 2109|    544|                                           cbytes,
 2110|    544|                                           _dest,
 2111|    544|                                           neblock,
 2112|    544|                                           context->compcode_meta,
 2113|    544|                                           &dparams,
 2114|    544|                                           context->src);
 2115|    544|              goto urcodecsuccess;
 2116|    549|            }
 2117|    641|          }
 2118|      6|          BLOSC_TRACE_ERROR("User-defined compressor codec %d not found during decompression", context->compcode);
  ------------------
  |  |   93|      6|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      6|    do {                                            \
  |  |  |  |   98|      6|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      6|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      6|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2119|      6|          return BLOSC2_ERROR_CODEC_SUPPORT;
 2120|    555|        }
 2121|    544|      urcodecsuccess:
 2122|    544|        ;
 2123|    544|      }
 2124|      5|      else {
 2125|      5|        compname = clibcode_to_clibname(compformat);
 2126|      5|        BLOSC_TRACE_ERROR(
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2127|      5|                "Blosc has not been compiled with decompression "
 2128|      5|                "support for '%s' format.  "
 2129|      5|                "Please recompile for adding this support.", compname);
 2130|      5|        return BLOSC2_ERROR_CODEC_SUPPORT;
 2131|      5|      }
 2132|       |
 2133|       |      /* Check that decompressed bytes number is correct */
 2134|  9.02k|      if ((nbytes != neblock) && (thread_context->zfp_cell_nitems == 0)) {
  ------------------
  |  Branch (2134:11): [True: 8.72k, False: 306]
  |  Branch (2134:34): [True: 8.72k, False: 0]
  ------------------
 2135|  8.72k|        return BLOSC2_ERROR_DATA;
 2136|  8.72k|      }
 2137|       |
 2138|  9.02k|    }
 2139|  98.5k|    src += cbytes;
 2140|       |    // ctbytes += cbytes;
 2141|  98.5k|    _dest += nbytes;
 2142|  98.5k|    ntbytes += nbytes;
 2143|  98.5k|  } /* Closes j < nstreams */
 2144|       |
 2145|  98.4k|  if (!instr_codec) {
  ------------------
  |  Branch (2145:7): [True: 98.3k, False: 23]
  ------------------
 2146|  98.3k|    if (last_filter_index >= 0 || context->postfilter != NULL) {
  ------------------
  |  Branch (2146:9): [True: 93.4k, False: 4.89k]
  |  Branch (2146:35): [True: 0, False: 4.89k]
  ------------------
 2147|       |      /* Apply regular filter pipeline */
 2148|  93.4k|      int errcode = pipeline_backward(thread_context, bsize, dest, dest_offset, tmp, tmp2, tmp3,
 2149|  93.4k|                                      last_filter_index, nblock);
 2150|  93.4k|      if (errcode < 0)
  ------------------
  |  Branch (2150:11): [True: 259, False: 93.2k]
  ------------------
 2151|    259|        return errcode;
 2152|  93.4k|    }
 2153|  98.3k|  }
 2154|       |
 2155|       |  /* Return the number of uncompressed bytes */
 2156|  98.1k|  return (int)ntbytes;
 2157|  98.4k|}
blosc2.c:lz4_wrap_decompress:
  501|    778|                               struct thread_context* thread_context) {
  502|    778|  int nbytes;
  503|    778|  blosc2_context* context = thread_context->parent_context;
  504|    778|  if (context->use_dict && context->dict_buffer != NULL && context->dict_size > 0) {
  ------------------
  |  Branch (504:7): [True: 334, False: 444]
  |  Branch (504:28): [True: 334, False: 0]
  |  Branch (504:60): [True: 334, False: 0]
  ------------------
  505|    334|    nbytes = LZ4_decompress_safe_usingDict(input, output,
  506|    334|                                           (int)compressed_length, (int)maxout,
  507|    334|                                           (const char*)context->dict_buffer,
  508|    334|                                           (int)context->dict_size);
  509|    444|  } else {
  510|    444|    nbytes = LZ4_decompress_safe(input, output, (int)compressed_length, (int)maxout);
  511|    444|  }
  512|    778|  if (nbytes != (int)maxout) {
  ------------------
  |  Branch (512:7): [True: 667, False: 111]
  ------------------
  513|    667|    return 0;
  514|    667|  }
  515|    111|  return (int)maxout;
  516|    778|}
blosc2.c:zlib_wrap_decompress:
  540|    671|                                char* output, size_t maxout) {
  541|    671|  int status;
  542|    671|#if defined(HAVE_ZLIB_NG) && ! defined(ZLIB_COMPAT)
  543|    671|  size_t ul = maxout;
  544|    671|  status = zng_uncompress(
  545|    671|      (uint8_t*)output, &ul, (uint8_t*)input, compressed_length);
  546|       |#else
  547|       |  uLongf ul = (uLongf)maxout;
  548|       |  status = uncompress(
  549|       |      (Bytef*)output, &ul, (Bytef*)input, (uLong)compressed_length);
  550|       |#endif
  551|    671|  if (status != Z_OK) {
  ------------------
  |  |  180|    671|#define Z_OK            0
  ------------------
  |  Branch (551:7): [True: 616, False: 55]
  ------------------
  552|    616|    return 0;
  553|    616|  }
  554|     55|  return (int)ul;
  555|    671|}
blosc2.c:zstd_wrap_decompress:
  592|  6.79k|                                char* output, size_t maxout) {
  593|  6.79k|  size_t code;
  594|  6.79k|  blosc2_context* context = thread_context->parent_context;
  595|       |
  596|  6.79k|  if (thread_context->zstd_dctx == NULL) {
  ------------------
  |  Branch (596:7): [True: 6.74k, False: 51]
  ------------------
  597|  6.74k|    thread_context->zstd_dctx = ZSTD_createDCtx();
  598|  6.74k|  }
  599|       |
  600|  6.79k|  if (context->use_dict) {
  ------------------
  |  Branch (600:7): [True: 2.17k, False: 4.61k]
  ------------------
  601|  2.17k|    assert(context->dict_ddict != NULL);
  602|  2.17k|    code = ZSTD_decompress_usingDDict(
  603|  2.17k|            thread_context->zstd_dctx, (void*)output, maxout, (void*)input,
  604|  2.17k|            compressed_length, context->dict_ddict);
  605|  4.61k|  } else {
  606|  4.61k|    code = ZSTD_decompressDCtx(thread_context->zstd_dctx,
  607|  4.61k|        (void*)output, maxout, (void*)input, compressed_length);
  608|  4.61k|  }
  609|  6.79k|  if (ZSTD_isError(code) != ZSTD_error_no_error) {
  ------------------
  |  Branch (609:7): [True: 6.69k, False: 103]
  ------------------
  610|  6.69k|    BLOSC_TRACE_ERROR("Error in ZSTD decompression: '%s'.  Giving up.",
  ------------------
  |  |   93|  6.69k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  6.69k|    do {                                            \
  |  |  |  |   98|  6.69k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  6.69k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 6.69k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  6.69k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  611|  6.69k|                      ZDICT_getErrorName(code));
  612|  6.69k|    return 0;
  613|  6.69k|  }
  614|    103|  return (int)code;
  615|  6.79k|}
blosc2.c:getitem_read_header:
 4505|  47.2k|static int getitem_read_header(const void* src, int32_t srcsize, blosc_header* header) {
 4506|  47.2k|  int result = read_chunk_header((uint8_t *) src, srcsize, true, header);
 4507|  47.2k|  if (result < 0) {
  ------------------
  |  Branch (4507:7): [True: 0, False: 47.2k]
  ------------------
 4508|      0|    return result;
 4509|      0|  }
 4510|  47.2k|  if (header->blosc2_flags2 & BLOSC2_VL_BLOCKS) {
  ------------------
  |  Branch (4510:7): [True: 0, False: 47.2k]
  ------------------
 4511|      0|    BLOSC_TRACE_ERROR("getitem is not supported for VL-block chunks.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4512|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 4513|      0|  }
 4514|  47.2k|  return 0;
 4515|  47.2k|}
blosc2.c:getitem_with_header:
 4521|  47.2k|                               int start, int nitems, void* dest, int32_t destsize) {
 4522|       |  /* Minimally populate the context */
 4523|  47.2k|  context->src = src;
 4524|  47.2k|  context->srcsize = srcsize;
 4525|  47.2k|  context->dest = dest;
 4526|  47.2k|  context->destsize = destsize;
 4527|       |
 4528|  47.2k|  int result = blosc2_initialize_context_from_header(context, header);
 4529|  47.2k|  if (result < 0) {
  ------------------
  |  Branch (4529:7): [True: 0, False: 47.2k]
  ------------------
 4530|      0|    return result;
 4531|      0|  }
 4532|       |
 4533|  47.2k|  if (context->serial_context == NULL) {
  ------------------
  |  Branch (4533:7): [True: 47.2k, False: 0]
  ------------------
 4534|  47.2k|    context->serial_context = create_thread_context(context, 0);
 4535|  47.2k|  }
 4536|  47.2k|  BLOSC_ERROR_NULL(context->serial_context, BLOSC2_ERROR_THREAD_CREATE);
  ------------------
  |  |  104|  47.2k|    do {                                            \
  |  |  105|  47.2k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 47.2k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  47.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 47.2k]
  |  |  ------------------
  ------------------
 4537|       |  /* Call the actual getitem function */
 4538|  47.2k|  return _blosc_getitem(context, header, src, srcsize, start, nitems, dest, destsize);
 4539|  47.2k|}
blosc2.c:blosc2_initialize_context_from_header:
  862|   103k|static int blosc2_initialize_context_from_header(blosc2_context* context, blosc_header* header) {
  863|   103k|  context->header_flags = header->flags;
  864|   103k|  context->typesize = header->typesize;
  865|   103k|  context->sourcesize = header->nbytes;
  866|   103k|  context->header_blocksize = header->blocksize;
  867|   103k|  context->blocksize = header->blocksize;
  868|   103k|  context->blosc2_flags2 = header->blosc2_flags2;
  869|   103k|  context->blosc2_flags = header->blosc2_flags;
  870|   103k|  context->compcode = header->flags >> 5;
  871|   103k|  if (context->compcode == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (871:7): [True: 56.5k, False: 47.4k]
  ------------------
  872|  56.5k|    context->compcode = header->udcompcode;
  873|  56.5k|  }
  874|   103k|  if (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) {
  ------------------
  |  Branch (874:7): [True: 297, False: 103k]
  ------------------
  875|    297|    context->nblocks = header->blocksize;
  876|    297|    context->leftover = 0;
  877|    297|    context->blocksize = 0;
  878|    297|  }
  879|   103k|  else {
  880|   103k|    blosc2_calculate_blocks(context);
  881|   103k|  }
  882|       |
  883|   103k|  bool is_lazy = false;
  884|   103k|  if ((context->header_flags & BLOSC_DOSHUFFLE) &&
  ------------------
  |  Branch (884:7): [True: 103k, False: 76]
  ------------------
  885|   103k|      (context->header_flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (885:7): [True: 103k, False: 203]
  ------------------
  886|       |    /* Extended header */
  887|   103k|    context->header_overhead = BLOSC_EXTENDED_HEADER_LENGTH;
  888|       |
  889|   103k|    memcpy(context->filters, header->filters, BLOSC2_MAX_FILTERS);
  890|   103k|    memcpy(context->filters_meta, header->filters_meta, BLOSC2_MAX_FILTERS);
  891|   103k|    context->compcode_meta = header->compcode_meta;
  892|       |
  893|   103k|    context->filter_flags = filters_to_flags(header->filters);
  894|   103k|    context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  895|       |
  896|   103k|    is_lazy = (context->blosc2_flags & 0x08u);
  897|   103k|  }
  898|    279|  else {
  899|    279|    context->header_overhead = BLOSC_MIN_HEADER_LENGTH;
  900|    279|    context->filter_flags = get_filter_flags(context->header_flags, context->typesize);
  901|    279|    flags_to_filters(context->header_flags, context->filters);
  902|    279|  }
  903|       |
  904|       |  // Some checks for malformed headers
  905|   103k|  if (!is_lazy && header->cbytes > context->srcsize) {
  ------------------
  |  Branch (905:7): [True: 101k, False: 2.35k]
  |  Branch (905:19): [True: 0, False: 101k]
  ------------------
  906|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  907|      0|  }
  908|       |
  909|   103k|  return 0;
  910|   103k|}
blosc2.c:get_filter_flags:
  702|    279|                                const int32_t typesize) {
  703|    279|  uint8_t flags = 0;
  704|       |
  705|    279|  if ((header_flags & BLOSC_DOSHUFFLE) && (typesize > 1)) {
  ------------------
  |  Branch (705:7): [True: 203, False: 76]
  |  Branch (705:43): [True: 159, False: 44]
  ------------------
  706|    159|    flags |= BLOSC_DOSHUFFLE;
  707|    159|  }
  708|    279|  if (header_flags & BLOSC_DOBITSHUFFLE) {
  ------------------
  |  Branch (708:7): [True: 20, False: 259]
  ------------------
  709|     20|    flags |= BLOSC_DOBITSHUFFLE;
  710|     20|  }
  711|    279|  if (header_flags & BLOSC_DODELTA) {
  ------------------
  |  Branch (711:7): [True: 210, False: 69]
  ------------------
  712|    210|    flags |= BLOSC_DODELTA;
  713|    210|  }
  714|    279|  if (header_flags & BLOSC_MEMCPYED) {
  ------------------
  |  Branch (714:7): [True: 8, False: 271]
  ------------------
  715|      8|    flags |= BLOSC_MEMCPYED;
  716|      8|  }
  717|    279|  return flags;
  718|    279|}
blosc2.c:clear_context_decompression_dict:
 2550|  56.7k|static void clear_context_decompression_dict(blosc2_context* context) {
 2551|  56.7k|  context->use_dict = 0;
 2552|  56.7k|  release_context_dict_buffer(context);
 2553|  56.7k|#if defined(HAVE_ZSTD)
 2554|  56.7k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (2554:7): [True: 3.05k, False: 53.7k]
  ------------------
 2555|  3.05k|    ZSTD_freeDDict(context->dict_ddict);
 2556|  3.05k|    context->dict_ddict = NULL;
 2557|  3.05k|  }
 2558|       |#else
 2559|       |  context->dict_ddict = NULL;
 2560|       |#endif
 2561|  56.7k|}
blosc2.c:checked_mul_size:
  152|  40.2k|static inline bool checked_mul_size(size_t a, size_t b, size_t* out) {
  153|  40.2k|  if (a != 0 && b > SIZE_MAX / a) {
  ------------------
  |  Branch (153:7): [True: 40.2k, False: 35]
  |  Branch (153:17): [True: 0, False: 40.2k]
  ------------------
  154|      0|    return false;
  155|      0|  }
  156|  40.2k|  *out = a * b;
  157|       |  return true;
  158|  40.2k|}
blosc2.c:checked_add_size:
  160|  40.3k|static inline bool checked_add_size(size_t a, size_t b, size_t* out) {
  161|  40.3k|  if (a > SIZE_MAX - b) {
  ------------------
  |  Branch (161:7): [True: 0, False: 40.3k]
  ------------------
  162|      0|    return false;
  163|      0|  }
  164|  40.3k|  *out = a + b;
  165|       |  return true;
  166|  40.3k|}
blosc2.c:create_thread_context:
 2264|  58.6k|create_thread_context(blosc2_context* context, int32_t tid) {
 2265|  58.6k|  struct thread_context* thread_context;
 2266|  58.6k|  thread_context = (struct thread_context*)my_malloc(sizeof(struct thread_context));
 2267|  58.6k|  BLOSC_ERROR_NULL(thread_context, NULL);
  ------------------
  |  |  104|  58.6k|    do {                                            \
  |  |  105|  58.6k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 58.6k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  58.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 58.6k]
  |  |  ------------------
  ------------------
 2268|  58.6k|  int rc = init_thread_context(thread_context, context, tid);
 2269|  58.6k|  if (rc < 0) {
  ------------------
  |  Branch (2269:7): [True: 0, False: 58.6k]
  ------------------
 2270|      0|    return NULL;
 2271|      0|  }
 2272|  58.6k|  return thread_context;
 2273|  58.6k|}
blosc2.c:init_thread_context:
 2234|  58.6k|{
 2235|  58.6k|  int32_t ebsize;
 2236|       |
 2237|  58.6k|  thread_context->parent_context = context;
 2238|  58.6k|  thread_context->owner_pool = NULL;
 2239|  58.6k|  thread_context->tid = tid;
 2240|       |
 2241|  58.6k|  int32_t blocksize = context != NULL ? context->blocksize : 0;
  ------------------
  |  Branch (2241:23): [True: 58.6k, False: 0]
  ------------------
 2242|  58.6k|  int32_t typesize = context != NULL ? context->typesize : 0;
  ------------------
  |  Branch (2242:22): [True: 58.6k, False: 0]
  ------------------
 2243|  58.6k|  ebsize = blocksize + typesize * (signed)sizeof(int32_t);
 2244|  58.6k|  thread_context->tmp_nbytes = (size_t)4 * ebsize;
 2245|  58.6k|  thread_context->tmp = my_malloc(thread_context->tmp_nbytes);
 2246|  58.6k|  BLOSC_ERROR_NULL(thread_context->tmp, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|  58.6k|    do {                                            \
  |  |  105|  58.6k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 58.6k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  58.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 58.6k]
  |  |  ------------------
  ------------------
 2247|  58.6k|  thread_context->tmp2 = thread_context->tmp + ebsize;
 2248|  58.6k|  thread_context->tmp3 = thread_context->tmp2 + ebsize;
 2249|  58.6k|  thread_context->tmp4 = thread_context->tmp3 + ebsize;
 2250|  58.6k|  thread_context->tmp_blocksize = blocksize;
 2251|  58.6k|  thread_context->zfp_cell_nitems = 0;
 2252|  58.6k|  thread_context->zfp_cell_start = 0;
 2253|  58.6k|  #if defined(HAVE_ZSTD)
 2254|  58.6k|  thread_context->zstd_cctx = NULL;
 2255|  58.6k|  thread_context->zstd_dctx = NULL;
 2256|  58.6k|  #endif
 2257|  58.6k|  thread_context->lz4_cstream = NULL;
 2258|  58.6k|  thread_context->lz4hc_cstream = NULL;
 2259|       |
 2260|  58.6k|  return 0;
 2261|  58.6k|}
blosc2.c:release_thread_backend:
 5416|  59.4k|static int release_thread_backend(blosc2_context *context) {
 5417|  59.4k|  if (context->thread_backend == BLOSC_BACKEND_CALLBACK && context->threads_started > 0) {
  ------------------
  |  |   34|   118k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (5417:7): [True: 0, False: 59.4k]
  |  Branch (5417:60): [True: 0, False: 0]
  ------------------
 5418|      0|    for (int32_t t = 0; t < context->threads_started; t++) {
  ------------------
  |  Branch (5418:25): [True: 0, False: 0]
  ------------------
 5419|      0|      destroy_thread_context(context->thread_contexts + t);
 5420|      0|    }
 5421|      0|    my_free(context->thread_contexts);
 5422|      0|    context->thread_contexts = NULL;
 5423|      0|    blosc2_pthread_mutex_destroy(&context->count_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5424|      0|    blosc2_pthread_mutex_destroy(&context->delta_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5425|      0|    blosc2_pthread_cond_destroy(&context->delta_cv);
  ------------------
  |  |   97|      0|#define blosc2_pthread_cond_destroy(a) pthread_cond_destroy((a))
  ------------------
 5426|      0|  }
 5427|       |#if defined(_WIN32)
 5428|       |  else if (context->thread_backend == BLOSC_BACKEND_PER_CONTEXT && context->threads_started > 0) {
 5429|       |    /* Signal all workers to exit. */
 5430|       |    blosc2_pthread_mutex_lock(&context->jobs_mutex);
 5431|       |    context->end_threads = 1;
 5432|       |    blosc2_pthread_cond_broadcast(&context->jobs_ready);
 5433|       |    blosc2_pthread_mutex_unlock(&context->jobs_mutex);
 5434|       |
 5435|       |    for (int32_t t = 0; t < context->threads_started; t++) {
 5436|       |      blosc2_pthread_join(context->threads[t], NULL);
 5437|       |    }
 5438|       |    my_free(context->threads);
 5439|       |    context->threads = NULL;
 5440|       |    blosc2_pthread_cond_destroy(&context->jobs_done);
 5441|       |    blosc2_pthread_cond_destroy(&context->jobs_ready);
 5442|       |    blosc2_pthread_mutex_destroy(&context->jobs_mutex);
 5443|       |    blosc2_pthread_cond_destroy(&context->delta_cv);
 5444|       |    blosc2_pthread_mutex_destroy(&context->delta_mutex);
 5445|       |    blosc2_pthread_mutex_destroy(&context->count_mutex);
 5446|       |  }
 5447|       |#endif  /* _WIN32 */
 5448|  59.4k|  else if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL && context->thread_pool != NULL) {
  ------------------
  |  |   33|   118k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (5448:12): [True: 0, False: 59.4k]
  |  Branch (5448:68): [True: 0, False: 0]
  ------------------
 5449|      0|    struct blosc_shared_pool *pool = context->thread_pool;
 5450|      0|    struct blosc_shared_pool **prev;
 5451|      0|    bool destroy_pool = false;
 5452|       |
 5453|      0|    if (context->pool_epoch != g_destroy_count) {
  ------------------
  |  Branch (5453:9): [True: 0, False: 0]
  ------------------
 5454|       |      /* blosc2_destroy() already freed this pool and tore down pool_registry_mutex.
 5455|       |       * Just clear the dangling pointer; nothing else to do. */
 5456|      0|      context->thread_pool = NULL;
 5457|      0|      context->threads_started = 0;
 5458|      0|      context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 5459|      0|      return 0;
 5460|      0|    }
 5461|       |
 5462|      0|    blosc2_pthread_mutex_lock(&pool_registry_mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5463|      0|    pool->context_refs--;
 5464|      0|    if (pool->context_refs == 0) {
  ------------------
  |  Branch (5464:9): [True: 0, False: 0]
  ------------------
 5465|       |      /* Check pool-internal state under the pool's own mutex */
 5466|      0|      blosc2_pthread_mutex_lock(&pool->mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5467|      0|      bool idle = (pool->active_jobs == 0 && pool->job_queue_head == NULL);
  ------------------
  |  Branch (5467:20): [True: 0, False: 0]
  |  Branch (5467:46): [True: 0, False: 0]
  ------------------
 5468|      0|      blosc2_pthread_mutex_unlock(&pool->mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5469|      0|      if (idle) {
  ------------------
  |  Branch (5469:11): [True: 0, False: 0]
  ------------------
 5470|      0|        prev = &shared_pools;
 5471|      0|        while (*prev != NULL && *prev != pool) {
  ------------------
  |  Branch (5471:16): [True: 0, False: 0]
  |  Branch (5471:33): [True: 0, False: 0]
  ------------------
 5472|      0|          prev = &(*prev)->next;
 5473|      0|        }
 5474|      0|        if (*prev == pool) {
  ------------------
  |  Branch (5474:13): [True: 0, False: 0]
  ------------------
 5475|      0|          *prev = pool->next;
 5476|      0|        }
 5477|      0|        destroy_pool = true;
 5478|      0|      }
 5479|      0|    }
 5480|      0|    blosc2_pthread_mutex_unlock(&pool_registry_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5481|      0|    if (destroy_pool) {
  ------------------
  |  Branch (5481:9): [True: 0, False: 0]
  ------------------
 5482|      0|      destroy_shared_pool(pool);
 5483|      0|    }
 5484|      0|    context->thread_pool = NULL;
 5485|      0|  }
 5486|       |
 5487|  59.4k|  context->threads_started = 0;
 5488|  59.4k|  context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|  59.4k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 5489|  59.4k|  return 0;
 5490|  59.4k|}
blosc2.c:release_context_dict_buffer:
 2540|   116k|static void release_context_dict_buffer(blosc2_context* context) {
 2541|   116k|  if (context->dict_buffer_owned && context->dict_buffer != NULL) {
  ------------------
  |  Branch (2541:7): [True: 0, False: 116k]
  |  Branch (2541:37): [True: 0, False: 0]
  ------------------
 2542|      0|    free(context->dict_buffer);
 2543|      0|  }
 2544|   116k|  context->dict_buffer = NULL;
 2545|       |  context->dict_buffer_owned = false;
 2546|   116k|  context->dict_size = 0;
 2547|   116k|}

blosclz_decompress:
  685|    235|int blosclz_decompress(const void* input, int length, void* output, int maxout) {
  686|    235|  const uint8_t* ip = (const uint8_t*)input;
  687|    235|  const uint8_t* ip_limit = ip + length;
  688|    235|  uint8_t* op = (uint8_t*)output;
  689|    235|  uint32_t ctrl;
  690|    235|  uint8_t* op_limit = op + maxout;
  691|    235|  if (BLOSCLZ_UNLIKELY(length == 0)) {
  ------------------
  |  |   35|    235|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 0, False: 235]
  |  |  ------------------
  ------------------
  692|      0|    return 0;
  693|      0|  }
  694|    235|  ctrl = (*ip++) & 31U;
  695|       |
  696|  35.0k|  while (1) {
  ------------------
  |  Branch (696:10): [True: 35.0k, Folded]
  ------------------
  697|  35.0k|    if (ctrl >= 32) {
  ------------------
  |  Branch (697:9): [True: 18.5k, False: 16.4k]
  ------------------
  698|       |      // match
  699|  18.5k|      int32_t len = (int32_t)(ctrl >> 5U) - 1 ;
  700|  18.5k|      int32_t ofs = (int32_t)(ctrl & 31U) << 8U;
  701|  18.5k|      uint8_t code;
  702|  18.5k|      const uint8_t* ref = op - ofs;
  703|       |
  704|  18.5k|      if (len == 7 - 1) {
  ------------------
  |  Branch (704:11): [True: 13.0k, False: 5.51k]
  ------------------
  705|  31.9k|        do {
  706|  31.9k|          if (BLOSCLZ_UNLIKELY(ip + 1 >= ip_limit)) {
  ------------------
  |  |   35|  31.9k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 5, False: 31.9k]
  |  |  ------------------
  ------------------
  707|      5|            return 0;
  708|      5|          }
  709|  31.9k|          code = *ip++;
  710|  31.9k|          len += code;
  711|  31.9k|        } while (code == 255);
  ------------------
  |  Branch (711:18): [True: 18.9k, False: 13.0k]
  ------------------
  712|  13.0k|      }
  713|  5.51k|      else {
  714|  5.51k|        if (BLOSCLZ_UNLIKELY(ip + 1 >= ip_limit)) {
  ------------------
  |  |   35|  5.51k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 9, False: 5.50k]
  |  |  ------------------
  ------------------
  715|      9|          return 0;
  716|      9|        }
  717|  5.51k|      }
  718|  18.5k|      code = *ip++;
  719|  18.5k|      len += 3;
  720|  18.5k|      ref -= code;
  721|       |
  722|       |      /* match from 16-bit distance */
  723|  18.5k|      if (BLOSCLZ_UNLIKELY(code == 255)) {
  ------------------
  |  |   35|  18.5k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 3.69k, False: 14.8k]
  |  |  ------------------
  ------------------
  724|  3.69k|        if (ofs == (31U << 8U)) {
  ------------------
  |  Branch (724:13): [True: 3.16k, False: 530]
  ------------------
  725|  3.16k|          if (ip + 1 >= ip_limit) {
  ------------------
  |  Branch (725:15): [True: 6, False: 3.16k]
  ------------------
  726|      6|            return 0;
  727|      6|          }
  728|  3.16k|          ofs = (*ip++) << 8U;
  729|  3.16k|          ofs += *ip++;
  730|  3.16k|          ref = op - ofs - MAX_DISTANCE;
  ------------------
  |  |   46|  3.16k|#define MAX_DISTANCE 8191
  ------------------
  731|  3.16k|        }
  732|  3.69k|      }
  733|       |
  734|  18.5k|      if (BLOSCLZ_UNLIKELY(op + len > op_limit)) {
  ------------------
  |  |   35|  18.5k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 32, False: 18.5k]
  |  |  ------------------
  ------------------
  735|     32|        return 0;
  736|     32|      }
  737|       |
  738|  18.5k|      if (BLOSCLZ_UNLIKELY(ref - 1 < (uint8_t*)output)) {
  ------------------
  |  |   35|  18.5k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 60, False: 18.4k]
  |  |  ------------------
  ------------------
  739|     60|        return 0;
  740|     60|      }
  741|       |
  742|  18.4k|      if (BLOSCLZ_UNLIKELY(ip >= ip_limit)) break;
  ------------------
  |  |   35|  18.4k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 4, False: 18.4k]
  |  |  ------------------
  ------------------
  743|  18.4k|      ctrl = *ip++;
  744|       |
  745|  18.4k|      ref--;
  746|  18.4k|      if (ref == op - 1) {
  ------------------
  |  Branch (746:11): [True: 6.78k, False: 11.6k]
  ------------------
  747|       |        /* optimized copy for a run */
  748|  6.78k|        memset(op, *ref, len);
  749|  6.78k|        op += len;
  750|  6.78k|      }
  751|  11.6k|      else if ((op - ref >= 8) && (op_limit - op >= len + 8)) {
  ------------------
  |  Branch (751:16): [True: 10.3k, False: 1.31k]
  |  Branch (751:35): [True: 10.2k, False: 98]
  ------------------
  752|       |        // copy with an overlap not larger than 8
  753|  10.2k|        wild_copy(op, ref, op + len);
  754|  10.2k|        op += len;
  755|  10.2k|      }
  756|  1.41k|      else {
  757|       |        // general copy with any overlap
  758|       |#if 0 && defined(__AVX2__)
  759|       |        if (op - ref <= 16) {
  760|       |          // This is not faster on a combination of compilers (clang, gcc, icc) or machines, but
  761|       |          // it is not too slower either.
  762|       |          op = copy_match_16(op, ref, len);
  763|       |        }
  764|       |        else {
  765|       |#endif
  766|  1.41k|          op = copy_match(op, ref, (unsigned) len);
  767|       |#if 0 && defined(__AVX2__)
  768|       |        }
  769|       |#endif
  770|  1.41k|      }
  771|  18.4k|    }
  772|  16.4k|    else {
  773|       |      // literal
  774|  16.4k|      ctrl++;
  775|  16.4k|      if (BLOSCLZ_UNLIKELY(op + ctrl > op_limit)) {
  ------------------
  |  |   35|  16.4k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 17, False: 16.4k]
  |  |  ------------------
  ------------------
  776|     17|        return 0;
  777|     17|      }
  778|  16.4k|      if (BLOSCLZ_UNLIKELY(ip + ctrl > ip_limit)) {
  ------------------
  |  |   35|  16.4k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 27, False: 16.4k]
  |  |  ------------------
  ------------------
  779|     27|        return 0;
  780|     27|      }
  781|       |
  782|  16.4k|      memcpy(op, ip, ctrl); op += ctrl; ip += ctrl;
  783|       |      // On GCC-6, fastcopy this is still faster than plain memcpy
  784|       |      // However, using recent CLANG/LLVM 9.0, there is almost no difference
  785|       |      // in performance.
  786|       |      // And starting on CLANG/LLVM 10 and GCC 9, memcpy is generally faster.
  787|       |      // op = fastcopy(op, ip, (unsigned) ctrl); ip += ctrl;
  788|       |
  789|  16.4k|      if (BLOSCLZ_UNLIKELY(ip >= ip_limit)) break;
  ------------------
  |  |   35|  16.4k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 75, False: 16.3k]
  |  |  ------------------
  ------------------
  790|  16.3k|      ctrl = *ip++;
  791|  16.3k|    }
  792|  35.0k|  }
  793|       |
  794|     79|  return (int)(op - (uint8_t*)output);
  795|    235|}
blosclz.c:wild_copy:
  677|  10.2k|static inline void wild_copy(uint8_t *out, const uint8_t* from, uint8_t* end) {
  678|  10.2k|  uint8_t* d = out;
  679|  10.2k|  const uint8_t* s = from;
  680|  10.2k|  uint8_t* const e = end;
  681|       |
  682|   228k|  do { memcpy(d,s,8); d+=8; s+=8; } while (d<e);
  ------------------
  |  Branch (682:44): [True: 218k, False: 10.2k]
  ------------------
  683|  10.2k|}

delta_decoder:
   97|   122k|                   int32_t typesize, uint8_t* dest) {
   98|   122k|  int32_t i;
   99|       |
  100|   122k|  if (offset == 0) {
  ------------------
  |  Branch (100:7): [True: 83.7k, False: 38.9k]
  ------------------
  101|       |    /* Decode delta for the reference block */
  102|  83.7k|    switch (typesize) {
  103|  31.1k|      case 1:
  ------------------
  |  Branch (103:7): [True: 31.1k, False: 52.6k]
  ------------------
  104|  7.94G|        for (i = 1; i < nbytes; i++) {
  ------------------
  |  Branch (104:21): [True: 7.94G, False: 31.1k]
  ------------------
  105|  7.94G|          dest[i] ^= dref[i-1];
  106|  7.94G|        }
  107|  31.1k|        break;
  108|    329|      case 2:
  ------------------
  |  Branch (108:7): [True: 329, False: 83.4k]
  ------------------
  109|   623M|        for (i = 1; i < nbytes / 2; i++) {
  ------------------
  |  Branch (109:21): [True: 623M, False: 329]
  ------------------
  110|   623M|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i-1];
  111|   623M|        }
  112|    329|        break;
  113|    310|      case 4:
  ------------------
  |  Branch (113:7): [True: 310, False: 83.4k]
  ------------------
  114|   695M|        for (i = 1; i < nbytes / 4; i++) {
  ------------------
  |  Branch (114:21): [True: 695M, False: 310]
  ------------------
  115|   695M|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i-1];
  116|   695M|        }
  117|    310|        break;
  118|  20.9k|      case 8:
  ------------------
  |  Branch (118:7): [True: 20.9k, False: 62.7k]
  ------------------
  119|   925M|        for (i = 1; i < nbytes / 8; i++) {
  ------------------
  |  Branch (119:21): [True: 925M, False: 20.9k]
  ------------------
  120|   925M|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i-1];
  121|   925M|        }
  122|  20.9k|        break;
  123|  31.0k|      default:
  ------------------
  |  Branch (123:7): [True: 31.0k, False: 52.7k]
  ------------------
  124|  31.0k|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (124:13): [True: 166, False: 30.8k]
  ------------------
  125|    166|          delta_decoder(dref, offset, nbytes, 8, dest);
  126|  30.8k|        } else {
  127|  30.8k|          delta_decoder(dref, offset, nbytes, 1, dest);
  128|  30.8k|        }
  129|  83.7k|    }
  130|  83.7k|  } else {
  131|       |    /* Decode delta for the non-reference blocks */
  132|  38.9k|    switch (typesize) {
  133|  14.3k|      case 1:
  ------------------
  |  Branch (133:7): [True: 14.3k, False: 24.5k]
  ------------------
  134|  1.05G|        for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (134:21): [True: 1.05G, False: 14.3k]
  ------------------
  135|  1.05G|          dest[i] ^= dref[i];
  136|  1.05G|        }
  137|  14.3k|        break;
  138|    122|      case 2:
  ------------------
  |  Branch (138:7): [True: 122, False: 38.7k]
  ------------------
  139|  27.2M|        for (i = 0; i < nbytes / 2; i++) {
  ------------------
  |  Branch (139:21): [True: 27.2M, False: 122]
  ------------------
  140|  27.2M|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i];
  141|  27.2M|        }
  142|    122|        break;
  143|    126|      case 4:
  ------------------
  |  Branch (143:7): [True: 126, False: 38.7k]
  ------------------
  144|   174M|        for (i = 0; i < nbytes / 4; i++) {
  ------------------
  |  Branch (144:21): [True: 174M, False: 126]
  ------------------
  145|   174M|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i];
  146|   174M|        }
  147|    126|        break;
  148|  9.90k|      case 8:
  ------------------
  |  Branch (148:7): [True: 9.90k, False: 29.0k]
  ------------------
  149|   269M|        for (i = 0; i < nbytes / 8; i++) {
  ------------------
  |  Branch (149:21): [True: 269M, False: 9.90k]
  ------------------
  150|   269M|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i];
  151|   269M|        }
  152|  9.90k|        break;
  153|  14.3k|      default:
  ------------------
  |  Branch (153:7): [True: 14.3k, False: 24.5k]
  ------------------
  154|  14.3k|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (154:13): [True: 101, False: 14.2k]
  ------------------
  155|    101|          delta_decoder(dref, offset, nbytes, 8, dest);
  156|  14.2k|        } else {
  157|  14.2k|          delta_decoder(dref, offset, nbytes, 1, dest);
  158|  14.2k|        }
  159|  38.9k|    }
  160|  38.9k|  }
  161|   122k|}

fastcopy:
  504|     90|unsigned char *fastcopy(unsigned char *out, const unsigned char *from, unsigned len) {
  505|     90|  switch (len) {
  506|      1|    case 32:
  ------------------
  |  Branch (506:5): [True: 1, False: 89]
  ------------------
  507|      1|      return copy_32_bytes(out, from);
  508|      1|    case 16:
  ------------------
  |  Branch (508:5): [True: 1, False: 89]
  ------------------
  509|      1|      return copy_16_bytes(out, from);
  510|      1|    case 8:
  ------------------
  |  Branch (510:5): [True: 1, False: 89]
  ------------------
  511|      1|      return copy_8_bytes(out, from);
  512|     87|    default: {
  ------------------
  |  Branch (512:5): [True: 87, False: 3]
  ------------------
  513|     87|    }
  514|     90|  }
  515|     87|  if (len < 8) {
  ------------------
  |  Branch (515:7): [True: 30, False: 57]
  ------------------
  516|     30|    return copy_bytes(out, from, len);
  517|     30|  }
  518|     57|#if defined(__SSE2__)
  519|     57|  if (len < 16) {
  ------------------
  |  Branch (519:7): [True: 2, False: 55]
  ------------------
  520|      2|    return chunk_memcpy(out, from, len);
  521|      2|  }
  522|     55|#if !defined(__AVX2__)
  523|     55|  return chunk_memcpy_unaligned(out, from, len);
  524|       |#else
  525|       |  if (len < 32) {
  526|       |    return chunk_memcpy_16(out, from, len);
  527|       |  }
  528|       |  return chunk_memcpy_unaligned(out, from, len);
  529|       |#endif  // !__AVX2__
  530|       |#else
  531|       |  return chunk_memcpy(out, from, len);
  532|       |#endif  // __SSE2__
  533|     57|}
copy_match:
  537|  1.41k|unsigned char* copy_match(unsigned char *out, const unsigned char *from, unsigned len) {
  538|       |#if defined(__AVX2__)
  539|       |  unsigned sz = sizeof(__m256i);
  540|       |#elif defined(__SSE2__)
  541|       |  unsigned sz = sizeof(__m128i);
  542|       |#else
  543|       |  unsigned sz = sizeof(uint64_t);
  544|       |#endif
  545|       |
  546|       |#if ((defined(__GNUC__) && BLOSC_GCC_VERSION < 800) && !defined(__clang__) && !defined(__ICC) && !defined(__ICL))
  547|       |  // GCC < 8 in fully optimization mode seems to have problems with the code further below so stop here
  548|       |  for (; len > 0; len--) {
  549|       |    *out++ = *from++;
  550|       |  }
  551|       |  return out;
  552|       |#endif
  553|       |
  554|       |  // If out and from are away more than the size of the copy, then a fastcopy is safe
  555|  1.41k|  unsigned overlap_dist = (unsigned) (out - from);
  556|  1.41k|  if (overlap_dist > sz) {
  ------------------
  |  Branch (556:7): [True: 90, False: 1.32k]
  ------------------
  557|     90|    return fastcopy(out, from, len);
  558|     90|  }
  559|       |
  560|       |  // Otherwise we need to be more careful so as not to overwrite destination
  561|  1.32k|  switch (overlap_dist) {
  562|      0|    case 32:
  ------------------
  |  Branch (562:5): [True: 0, False: 1.32k]
  ------------------
  563|      0|      for (; len >= 32; len -= 32) {
  ------------------
  |  Branch (563:14): [True: 0, False: 0]
  ------------------
  564|      0|        out = copy_32_bytes(out, from);
  565|      0|      }
  566|      0|      break;
  567|      0|    case 30:
  ------------------
  |  Branch (567:5): [True: 0, False: 1.32k]
  ------------------
  568|      0|      for (; len >= 30; len -= 30) {
  ------------------
  |  Branch (568:14): [True: 0, False: 0]
  ------------------
  569|      0|        out = copy_16_bytes(out, from);
  570|      0|        out = copy_8_bytes(out, from + 16);
  571|      0|        out = copy_4_bytes(out, from + 24);
  572|      0|        out = copy_2_bytes(out, from + 28);
  573|      0|      }
  574|      0|      break;
  575|      0|    case 28:
  ------------------
  |  Branch (575:5): [True: 0, False: 1.32k]
  ------------------
  576|      0|      for (; len >= 28; len -= 28) {
  ------------------
  |  Branch (576:14): [True: 0, False: 0]
  ------------------
  577|      0|        out = copy_16_bytes(out, from);
  578|      0|        out = copy_8_bytes(out, from + 16);
  579|      0|        out = copy_4_bytes(out, from + 24);
  580|      0|      }
  581|      0|      break;
  582|      0|    case 26:
  ------------------
  |  Branch (582:5): [True: 0, False: 1.32k]
  ------------------
  583|      0|      for (; len >= 26; len -= 26) {
  ------------------
  |  Branch (583:14): [True: 0, False: 0]
  ------------------
  584|      0|        out = copy_16_bytes(out, from);
  585|      0|        out = copy_8_bytes(out, from + 16);
  586|      0|        out = copy_2_bytes(out, from + 24);
  587|      0|      }
  588|      0|      break;
  589|      0|    case 24:
  ------------------
  |  Branch (589:5): [True: 0, False: 1.32k]
  ------------------
  590|      0|      for (; len >= 24; len -= 24) {
  ------------------
  |  Branch (590:14): [True: 0, False: 0]
  ------------------
  591|      0|        out = copy_16_bytes(out, from);
  592|      0|        out = copy_8_bytes(out, from + 16);
  593|      0|      }
  594|      0|      break;
  595|      0|    case 22:
  ------------------
  |  Branch (595:5): [True: 0, False: 1.32k]
  ------------------
  596|      0|      for (; len >= 22; len -= 22) {
  ------------------
  |  Branch (596:14): [True: 0, False: 0]
  ------------------
  597|      0|        out = copy_16_bytes(out, from);
  598|      0|        out = copy_4_bytes(out, from + 16);
  599|      0|        out = copy_2_bytes(out, from + 20);
  600|      0|      }
  601|      0|      break;
  602|      0|    case 20:
  ------------------
  |  Branch (602:5): [True: 0, False: 1.32k]
  ------------------
  603|      0|      for (; len >= 20; len -= 20) {
  ------------------
  |  Branch (603:14): [True: 0, False: 0]
  ------------------
  604|      0|        out = copy_16_bytes(out, from);
  605|      0|        out = copy_4_bytes(out, from + 16);
  606|      0|      }
  607|      0|      break;
  608|      0|    case 18:
  ------------------
  |  Branch (608:5): [True: 0, False: 1.32k]
  ------------------
  609|      0|      for (; len >= 18; len -= 18) {
  ------------------
  |  Branch (609:14): [True: 0, False: 0]
  ------------------
  610|      0|        out = copy_16_bytes(out, from);
  611|      0|        out = copy_2_bytes(out, from + 16);
  612|      0|      }
  613|      0|      break;
  614|      3|    case 16:
  ------------------
  |  Branch (614:5): [True: 3, False: 1.31k]
  ------------------
  615|    341|      for (; len >= 16; len -= 16) {
  ------------------
  |  Branch (615:14): [True: 338, False: 3]
  ------------------
  616|    338|        out = copy_16_bytes(out, from);
  617|    338|      }
  618|      3|      break;
  619|      4|    case 8:
  ------------------
  |  Branch (619:5): [True: 4, False: 1.31k]
  ------------------
  620|    328|      for (; len >= 8; len -= 8) {
  ------------------
  |  Branch (620:14): [True: 324, False: 4]
  ------------------
  621|    324|        out = copy_8_bytes(out, from);
  622|    324|      }
  623|      4|      break;
  624|    461|    case 4:
  ------------------
  |  Branch (624:5): [True: 461, False: 861]
  ------------------
  625|   150k|      for (; len >= 4; len -= 4) {
  ------------------
  |  Branch (625:14): [True: 149k, False: 461]
  ------------------
  626|   149k|        out = copy_4_bytes(out, from);
  627|   149k|      }
  628|    461|      break;
  629|    441|    case 2:
  ------------------
  |  Branch (629:5): [True: 441, False: 881]
  ------------------
  630|   118k|      for (; len >= 2; len -= 2) {
  ------------------
  |  Branch (630:14): [True: 118k, False: 441]
  ------------------
  631|   118k|        out = copy_2_bytes(out, from);
  632|   118k|      }
  633|    441|      break;
  634|    413|    default:
  ------------------
  |  Branch (634:5): [True: 413, False: 909]
  ------------------
  635|   286k|      for (; len > 0; len--) {
  ------------------
  |  Branch (635:14): [True: 285k, False: 413]
  ------------------
  636|   285k|        *out++ = *from++;
  637|   285k|      }
  638|  1.32k|  }
  639|       |
  640|       |  // Copy the leftovers
  641|  2.02k|  for (; len > 0; len--) {
  ------------------
  |  Branch (641:10): [True: 707, False: 1.32k]
  ------------------
  642|    707|    *out++ = *from++;
  643|    707|  }
  644|       |
  645|  1.32k|  return out;
  646|  1.32k|}
fastcopy.c:copy_32_bytes:
  118|      1|static inline unsigned char *copy_32_bytes(unsigned char *out, const unsigned char *from) {
  119|       |#if defined(__AVX2__)
  120|       |  __m256i chunk;
  121|       |  chunk = _mm256_loadu_si256((__m256i*)from);
  122|       |  _mm256_storeu_si256((__m256i*)out, chunk);
  123|       |  out += 32;
  124|       |#elif defined(__SSE2__)
  125|       |  __m128i chunk;
  126|      1|  chunk = _mm_loadu_si128((__m128i*)from);
  127|      1|  _mm_storeu_si128((__m128i*)out, chunk);
  128|      1|  from += 16; out += 16;
  129|      1|  chunk = _mm_loadu_si128((__m128i*)from);
  130|      1|  _mm_storeu_si128((__m128i*)out, chunk);
  131|      1|  out += 16;
  132|       |#elif !defined(BLOSC_STRICT_ALIGN)
  133|       |  *(uint64_t*)out = *(uint64_t*)from;
  134|       |  from += 8; out += 8;
  135|       |  *(uint64_t*)out = *(uint64_t*)from;
  136|       |  from += 8; out += 8;
  137|       |  *(uint64_t*)out = *(uint64_t*)from;
  138|       |  from += 8; out += 8;
  139|       |  *(uint64_t*)out = *(uint64_t*)from;
  140|       |  from += 8; out += 8;
  141|       |#else
  142|       |  int i;
  143|       |  for (i = 0; i < 32; i++) {
  144|       |    *out++ = *from++;
  145|       |  }
  146|       |#endif
  147|      1|  return out;
  148|      1|}
fastcopy.c:copy_16_bytes:
   98|  95.9k|static inline unsigned char *copy_16_bytes(unsigned char *out, const unsigned char *from) {
   99|  95.9k|#if defined(__SSE2__)
  100|  95.9k|  __m128i chunk;
  101|  95.9k|  chunk = _mm_loadu_si128((__m128i*)from);
  102|  95.9k|  _mm_storeu_si128((__m128i*)out, chunk);
  103|  95.9k|  out += 16;
  104|       |#elif !defined(BLOSC_STRICT_ALIGN)
  105|       |  *(uint64_t*)out = *(uint64_t*)from;
  106|       |   from += 8; out += 8;
  107|       |   *(uint64_t*)out = *(uint64_t*)from;
  108|       |   from += 8; out += 8;
  109|       |#else
  110|       |   int i;
  111|       |   for (i = 0; i < 16; i++) {
  112|       |     *out++ = *from++;
  113|       |   }
  114|       |#endif
  115|  95.9k|  return out;
  116|  95.9k|}
fastcopy.c:copy_8_bytes:
   86|    329|static inline unsigned char *copy_8_bytes(unsigned char *out, const unsigned char *from) {
   87|       |#if defined(BLOSC_STRICT_ALIGN)
   88|       |  uint64_t chunk;
   89|       |  memcpy(&chunk, from, 8);
   90|       |  memcpy(out, &chunk, 8);
   91|       |#else
   92|    329|  *(uint64_t *) out = *(uint64_t *) from;
   93|    329|#endif
   94|    329|  return out + 8;
   95|    329|}
fastcopy.c:copy_bytes:
  161|     30|static inline unsigned char *copy_bytes(unsigned char *out, const unsigned char *from, unsigned len) {
  162|     30|  assert(len < 8);
  163|       |
  164|       |#ifdef BLOSC_STRICT_ALIGN
  165|       |  while (len--) {
  166|       |    *out++ = *from++;
  167|       |  }
  168|       |#else
  169|     30|  switch (len) {
  170|      4|    case 7:
  ------------------
  |  Branch (170:5): [True: 4, False: 26]
  ------------------
  171|      4|      return copy_7_bytes(out, from);
  172|      4|    case 6:
  ------------------
  |  Branch (172:5): [True: 4, False: 26]
  ------------------
  173|      4|      return copy_6_bytes(out, from);
  174|      7|    case 5:
  ------------------
  |  Branch (174:5): [True: 7, False: 23]
  ------------------
  175|      7|      return copy_5_bytes(out, from);
  176|      5|    case 4:
  ------------------
  |  Branch (176:5): [True: 5, False: 25]
  ------------------
  177|      5|      return copy_4_bytes(out, from);
  178|     10|    case 3:
  ------------------
  |  Branch (178:5): [True: 10, False: 20]
  ------------------
  179|     10|      return copy_3_bytes(out, from);
  180|      0|    case 2:
  ------------------
  |  Branch (180:5): [True: 0, False: 30]
  ------------------
  181|      0|      return copy_2_bytes(out, from);
  182|      0|    case 1:
  ------------------
  |  Branch (182:5): [True: 0, False: 30]
  ------------------
  183|      0|      return copy_1_bytes(out, from);
  184|      0|    case 0:
  ------------------
  |  Branch (184:5): [True: 0, False: 30]
  ------------------
  185|      0|      return out;
  186|      0|    default:
  ------------------
  |  Branch (186:5): [True: 0, False: 30]
  ------------------
  187|      0|      assert(0);
  188|     30|  }
  189|      0|#endif /* BLOSC_STRICT_ALIGN */
  190|      0|  return out;
  191|     30|}
fastcopy.c:copy_7_bytes:
   80|      4|static inline unsigned char *copy_7_bytes(unsigned char *out, const unsigned char *from) {
   81|      4|  out = copy_3_bytes(out, from);
   82|      4|  return copy_4_bytes(out, from + 3);
   83|      4|}
fastcopy.c:copy_6_bytes:
   75|      4|static inline unsigned char *copy_6_bytes(unsigned char *out, const unsigned char *from) {
   76|      4|  out = copy_2_bytes(out, from);
   77|      4|  return copy_4_bytes(out, from + 2);
   78|      4|}
fastcopy.c:copy_5_bytes:
   70|      7|static inline unsigned char *copy_5_bytes(unsigned char *out, const unsigned char *from) {
   71|      7|  out = copy_1_bytes(out, from);
   72|      7|  return copy_4_bytes(out, from + 1);
   73|      7|}
fastcopy.c:copy_3_bytes:
   65|     14|static inline unsigned char *copy_3_bytes(unsigned char *out, const unsigned char *from) {
   66|     14|  out = copy_1_bytes(out, from);
   67|     14|  return copy_2_bytes(out, from + 1);
   68|     14|}
fastcopy.c:copy_1_bytes:
   60|     21|static inline unsigned char *copy_1_bytes(unsigned char *out, const unsigned char *from) {
   61|     21|  *out++ = *from;
   62|     21|  return out;
   63|     21|}
fastcopy.c:chunk_memcpy:
  200|      2|static inline unsigned char *chunk_memcpy(unsigned char *out, const unsigned char *from, unsigned len) {
  201|      2|  unsigned sz = sizeof(uint64_t);
  202|      2|  unsigned rem = len % sz;
  203|      2|  unsigned by8;
  204|       |
  205|      2|  assert(len >= sz);
  206|       |
  207|       |  /* Copy a few bytes to make sure the loop below has a multiple of SZ bytes to be copied. */
  208|      2|  copy_8_bytes(out, from);
  209|       |
  210|      2|  len /= sz;
  211|      2|  out += rem;
  212|      2|  from += rem;
  213|       |
  214|      2|  by8 = len % 8;
  215|      2|  len -= by8;
  216|      2|  switch (by8) {
  217|      0|    case 7:
  ------------------
  |  Branch (217:5): [True: 0, False: 2]
  ------------------
  218|      0|      out = copy_8_bytes(out, from);
  219|      0|      from += sz;
  220|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  221|       |      __attribute__ ((fallthrough));  // Shut-up -Wimplicit-fallthrough warning in GCC
  222|       |      #endif
  223|      0|    case 6:
  ------------------
  |  Branch (223:5): [True: 0, False: 2]
  ------------------
  224|      0|      out = copy_8_bytes(out, from);
  225|      0|      from += sz;
  226|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  227|       |      __attribute__ ((fallthrough));
  228|       |      #endif
  229|      0|    case 5:
  ------------------
  |  Branch (229:5): [True: 0, False: 2]
  ------------------
  230|      0|      out = copy_8_bytes(out, from);
  231|      0|      from += sz;
  232|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  233|       |      __attribute__ ((fallthrough));
  234|       |      #endif
  235|      0|    case 4:
  ------------------
  |  Branch (235:5): [True: 0, False: 2]
  ------------------
  236|      0|      out = copy_8_bytes(out, from);
  237|      0|      from += sz;
  238|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  239|       |      __attribute__ ((fallthrough));
  240|       |      #endif
  241|      0|    case 3:
  ------------------
  |  Branch (241:5): [True: 0, False: 2]
  ------------------
  242|      0|      out = copy_8_bytes(out, from);
  243|      0|      from += sz;
  244|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  245|       |      __attribute__ ((fallthrough));
  246|       |      #endif
  247|      0|    case 2:
  ------------------
  |  Branch (247:5): [True: 0, False: 2]
  ------------------
  248|      0|      out = copy_8_bytes(out, from);
  249|      0|      from += sz;
  250|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  251|       |      __attribute__ ((fallthrough));
  252|       |      #endif
  253|      2|    case 1:
  ------------------
  |  Branch (253:5): [True: 2, False: 0]
  ------------------
  254|      2|      out = copy_8_bytes(out, from);
  255|      2|      from += sz;
  256|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  257|       |      __attribute__ ((fallthrough));
  258|       |      #endif
  259|      2|    default:
  ------------------
  |  Branch (259:5): [True: 0, False: 2]
  ------------------
  260|      2|      break;
  261|      2|  }
  262|       |
  263|      2|  while (len) {
  ------------------
  |  Branch (263:10): [True: 0, False: 2]
  ------------------
  264|      0|    out = copy_8_bytes(out, from);
  265|      0|    from += sz;
  266|      0|    out = copy_8_bytes(out, from);
  267|      0|    from += sz;
  268|      0|    out = copy_8_bytes(out, from);
  269|      0|    from += sz;
  270|      0|    out = copy_8_bytes(out, from);
  271|      0|    from += sz;
  272|      0|    out = copy_8_bytes(out, from);
  273|      0|    from += sz;
  274|      0|    out = copy_8_bytes(out, from);
  275|      0|    from += sz;
  276|      0|    out = copy_8_bytes(out, from);
  277|      0|    from += sz;
  278|      0|    out = copy_8_bytes(out, from);
  279|      0|    from += sz;
  280|       |
  281|      0|    len -= 8;
  282|      0|  }
  283|       |
  284|      2|  return out;
  285|      2|}
fastcopy.c:chunk_memcpy_unaligned:
  410|     55|static inline unsigned char *chunk_memcpy_unaligned(unsigned char *out, const unsigned char *from, unsigned len) {
  411|       |#if defined(__AVX2__)
  412|       |  unsigned sz = sizeof(__m256i);
  413|       |#elif defined(__SSE2__)
  414|       |  unsigned sz = sizeof(__m128i);
  415|     55|#endif
  416|     55|  unsigned rem = len % sz;
  417|     55|  unsigned ilen;
  418|       |
  419|     55|  assert(len >= sz);
  420|       |
  421|       |  /* Copy a few bytes to make sure the loop below has a multiple of SZ bytes to be copied. */
  422|       |#if defined(__AVX2__)
  423|       |  copy_32_bytes(out, from);
  424|       |#elif defined(__SSE2__)
  425|       |  copy_16_bytes(out, from);
  426|     55|#endif
  427|       |
  428|     55|  len /= sz;
  429|     55|  out += rem;
  430|     55|  from += rem;
  431|       |
  432|  95.6k|  for (ilen = 0; ilen < len; ilen++) {
  ------------------
  |  Branch (432:18): [True: 95.5k, False: 55]
  ------------------
  433|       |#if defined(__AVX2__)
  434|       |    copy_32_bytes(out, from);
  435|       |#elif defined(__SSE2__)
  436|       |    copy_16_bytes(out, from);
  437|  95.5k|#endif
  438|  95.5k|    out += sz;
  439|  95.5k|    from += sz;
  440|  95.5k|  }
  441|       |
  442|     55|  return out;
  443|     55|}
fastcopy.c:copy_4_bytes:
   48|   150k|static inline unsigned char *copy_4_bytes(unsigned char *out, const unsigned char *from) {
   49|       |#if defined(BLOSC_STRICT_ALIGN)
   50|       |  uint32_t chunk;
   51|       |  memcpy(&chunk, from, 4);
   52|       |  memcpy(out, &chunk, 4);
   53|       |#else
   54|   150k|  *(uint32_t *) out = *(uint32_t *) from;
   55|   150k|#endif
   56|   150k|  return out + 4;
   57|   150k|}
fastcopy.c:copy_2_bytes:
   37|   118k|static inline unsigned char *copy_2_bytes(unsigned char *out, const unsigned char *from) {
   38|       |#if defined(BLOSC_STRICT_ALIGN)
   39|       |  uint16_t chunk;
   40|       |  memcpy(&chunk, from, 2);
   41|       |  memcpy(out, &chunk, 2);
   42|       |#else
   43|   118k|  *(uint16_t *) out = *(uint16_t *) from;
   44|   118k|#endif
   45|   118k|  return out + 2;
   46|   118k|}

frame_reader_acquire:
  157|     20|void* frame_reader_acquire(blosc2_frame_s* frame, const blosc2_io* io) {
  158|     20|  blosc2_io_cb *io_cb = blosc2_get_io_cb(io->id);
  159|     20|  if (io_cb == NULL) {
  ------------------
  |  Branch (159:7): [True: 0, False: 20]
  ------------------
  160|      0|    BLOSC_TRACE_ERROR("Error getting the input/output API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  161|      0|    return NULL;
  162|      0|  }
  163|     20|  if (io->id != BLOSC2_IO_FILESYSTEM) {
  ------------------
  |  Branch (163:7): [True: 0, False: 20]
  ------------------
  164|       |    // Third-party backends keep the documented one-handle-per-reader contract
  165|       |    // (and the mmap one already makes open() a cheap pointer return).
  166|      0|    return io_cb->open(frame->urlpath, "rb", io->params);
  167|      0|  }
  168|       |#if defined(_WIN32)
  169|       |  // No handle caching on Windows.  The CRT opens files without
  170|       |  // FILE_SHARE_DELETE, so a cached handle turns every unlink or rename of the
  171|       |  // frame file into a sharing violation.  Callers that replace a frame rather
  172|       |  // than rewrite it in place -- python-blosc2 does, both via os.replace and via
  173|       |  // remove-then-recreate for mode="w" -- would get hard errors instead of the
  174|       |  // stale read that frame_reader_revalidate() handles elsewhere.  Caching here
  175|       |  // needs CreateFileW(..., FILE_SHARE_DELETE) plus POSIX-semantics deletion
  176|       |  // (Win10 1709+), which is only worth its cost once measured on Windows.
  177|       |  return io_cb->open(frame->urlpath, "rb", io->params);
  178|       |#else
  179|       |  // The cached handle pins the inode it was opened on, so a frame file that is
  180|       |  // replaced instead of rewritten in place would keep serving the old bytes.
  181|       |  // frame_reader_revalidate() catches that ahead of each header read.
  182|       |  //
  183|       |  // No unlocked fast path on read_fp: reading it outside the mutex races the
  184|       |  // store below (C11 data race, and TSan says so).  An uncontended lock is a
  185|       |  // handful of ns against the ~600 ns pread this hands a handle to.
  186|     20|  blosc2_pthread_mutex_lock(&frame->read_fp_mutex);
  ------------------
  |  |   92|     20|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
  187|     20|  if (frame->read_fp == NULL && !frame->read_fp_nocache) {
  ------------------
  |  Branch (187:7): [True: 20, False: 0]
  |  Branch (187:33): [True: 20, False: 0]
  ------------------
  188|     20|    if (reader_cache_claim()) {
  ------------------
  |  Branch (188:9): [True: 20, False: 0]
  ------------------
  189|     20|      frame->read_fp = io_cb->open(frame->urlpath, "rb", io->params);
  190|     20|      if (frame->read_fp == NULL) {
  ------------------
  |  Branch (190:11): [True: 20, False: 0]
  ------------------
  191|     20|        reader_cache_return();
  192|     20|      }
  193|     20|    }
  194|      0|    else {
  195|       |      // Remember that this frame goes uncached, so the process-wide cache mutex
  196|       |      // is asked once rather than on every read for the rest of its life
  197|      0|      frame->read_fp_nocache = true;
  198|      0|    }
  199|     20|  }
  200|     20|  void* fp = frame->read_fp;
  201|     20|  if (fp != NULL) {
  ------------------
  |  Branch (201:7): [True: 0, False: 20]
  ------------------
  202|       |    // Held until the matching release, so nothing can close it underneath a
  203|       |    // caller that keeps it across several reads (frame_to_schunk does)
  204|      0|    frame->read_fp_refs++;
  205|      0|  }
  206|     20|  blosc2_pthread_mutex_unlock(&frame->read_fp_mutex);
  ------------------
  |  |   93|     20|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
  207|     20|  if (fp == NULL) {
  ------------------
  |  Branch (207:7): [True: 20, False: 0]
  ------------------
  208|       |    // Cache full (or the cached open failed): hand out a private handle, which
  209|       |    // the matching frame_reader_release() closes since it is not frame->read_fp
  210|     20|    fp = io_cb->open(frame->urlpath, "rb", io->params);
  211|     20|  }
  212|     20|  return fp;
  213|     20|#endif
  214|     20|}
frame_reader_invalidate:
  265|  12.1k|void frame_reader_invalidate(blosc2_frame_s* frame) {
  266|  12.1k|  blosc2_pthread_mutex_lock(&frame->read_fp_mutex);
  ------------------
  |  |   92|  12.1k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
  267|  12.1k|  frame_reader_close_locked(frame, true);
  268|  12.1k|  blosc2_pthread_mutex_unlock(&frame->read_fp_mutex);
  ------------------
  |  |   93|  12.1k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
  269|  12.1k|}
frame_lock:
  481|  45.5k|int frame_lock(blosc2_frame_s* frame, bool exclusive) {
  482|  45.5k|  if (frame == NULL || !frame->locking) {
  ------------------
  |  Branch (482:7): [True: 0, False: 45.5k]
  |  Branch (482:24): [True: 45.5k, False: 0]
  ------------------
  483|  45.5k|    return BLOSC2_ERROR_SUCCESS;
  484|  45.5k|  }
  485|      0|  if (frame->lock_depth > 0) {
  ------------------
  |  Branch (485:7): [True: 0, False: 0]
  ------------------
  486|       |    // Already held by this handle (a nested call); the outer lock covers us
  487|      0|    frame->lock_depth++;
  488|      0|    return BLOSC2_ERROR_SUCCESS;
  489|      0|  }
  490|      0|  if (frame->lock_fd == -1) {
  ------------------
  |  Branch (490:7): [True: 0, False: 0]
  ------------------
  491|       |    // Lazily open the sidecar, kept for the frame's lifetime
  492|      0|    char* path = frame_lock_path(frame);
  493|      0|    if (path == NULL) {
  ------------------
  |  Branch (493:9): [True: 0, False: 0]
  ------------------
  494|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
  495|      0|    }
  496|       |#if defined(_WIN32)
  497|       |    HANDLE h = CreateFileA(path, GENERIC_READ | GENERIC_WRITE,
  498|       |                           FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
  499|       |                           NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
  500|       |    if (h == INVALID_HANDLE_VALUE) {
  501|       |      BLOSC_TRACE_ERROR("Cannot open the lock file in: %s", path);
  502|       |      free(path);
  503|       |      return BLOSC2_ERROR_LOCK;
  504|       |    }
  505|       |    frame->lock_fd = (intptr_t)h;
  506|       |#else
  507|      0|    int fd = open(path, O_CREAT | O_RDWR | O_CLOEXEC, 0666);
  508|      0|    if (fd < 0) {
  ------------------
  |  Branch (508:9): [True: 0, False: 0]
  ------------------
  509|      0|      BLOSC_TRACE_ERROR("Cannot open the lock file in: %s", path);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  510|      0|      free(path);
  511|      0|      return BLOSC2_ERROR_LOCK;
  512|      0|    }
  513|      0|    frame->lock_fd = fd;
  514|      0|#endif
  515|      0|    free(path);
  516|      0|  }
  517|      0|  if (frame_os_lock(frame, exclusive) < 0) {
  ------------------
  |  Branch (517:7): [True: 0, False: 0]
  ------------------
  518|      0|    BLOSC_TRACE_ERROR("Cannot lock the frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  519|      0|    return BLOSC2_ERROR_LOCK;
  520|      0|  }
  521|       |  // Generation counter: writers bump it, everyone compares it with the last
  522|       |  // value it saw.  This detects mutations by other handles exactly, even when
  523|       |  // the frame length on disk ends up unchanged (which the length-based
  524|       |  // staleness check in frame_refresh_if_stale() cannot see).
  525|      0|  uint64_t seq;
  526|      0|  if (frame_lock_read_seq(frame, &seq) < 0 ||
  ------------------
  |  Branch (526:7): [True: 0, False: 0]
  ------------------
  527|      0|      (exclusive && frame_lock_write_seq(frame, seq + 1) < 0)) {
  ------------------
  |  Branch (527:8): [True: 0, False: 0]
  |  Branch (527:21): [True: 0, False: 0]
  ------------------
  528|      0|    BLOSC_TRACE_ERROR("Cannot access the frame lock generation counter.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  529|      0|    frame_os_unlock(frame);
  530|      0|    return BLOSC2_ERROR_LOCK;
  531|      0|  }
  532|      0|  if (seq != frame->lock_seq) {
  ------------------
  |  Branch (532:7): [True: 0, False: 0]
  ------------------
  533|      0|    frame->force_refresh = true;
  534|      0|  }
  535|      0|  if (exclusive) {
  ------------------
  |  Branch (535:7): [True: 0, False: 0]
  ------------------
  536|      0|    seq++;
  537|      0|  }
  538|      0|  frame->lock_seq = seq;
  539|      0|  frame->lock_depth = 1;
  540|      0|  return BLOSC2_ERROR_SUCCESS;
  541|      0|}
frame_unlock:
  544|  45.5k|int frame_unlock(blosc2_frame_s* frame) {
  545|  45.5k|  if (frame == NULL || !frame->locking || frame->lock_depth == 0) {
  ------------------
  |  Branch (545:7): [True: 0, False: 45.5k]
  |  Branch (545:24): [True: 45.5k, False: 0]
  |  Branch (545:43): [True: 0, False: 0]
  ------------------
  546|  45.5k|    return BLOSC2_ERROR_SUCCESS;
  547|  45.5k|  }
  548|      0|  if (--frame->lock_depth > 0) {
  ------------------
  |  Branch (548:7): [True: 0, False: 0]
  ------------------
  549|      0|    return BLOSC2_ERROR_SUCCESS;
  550|      0|  }
  551|      0|  if (frame_os_unlock(frame) < 0) {
  ------------------
  |  Branch (551:7): [True: 0, False: 0]
  ------------------
  552|      0|    BLOSC_TRACE_ERROR("Cannot unlock the frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  553|      0|    return BLOSC2_ERROR_LOCK;
  554|      0|  }
  555|      0|  return BLOSC2_ERROR_SUCCESS;
  556|      0|}
frame_free:
  560|  12.1k|int frame_free(blosc2_frame_s* frame) {
  561|       |
  562|  12.1k|  frame_reader_invalidate(frame);
  563|  12.1k|  blosc2_pthread_mutex_destroy(&frame->read_fp_mutex);
  ------------------
  |  |   91|  12.1k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
  564|       |
  565|  12.1k|  if (frame->locking && frame->lock_fd != -1) {
  ------------------
  |  Branch (565:7): [True: 0, False: 12.1k]
  |  Branch (565:25): [True: 0, False: 0]
  ------------------
  566|       |#if defined(_WIN32)
  567|       |    CloseHandle((HANDLE)frame->lock_fd);
  568|       |#else
  569|      0|    close((int)frame->lock_fd);
  570|      0|#endif
  571|      0|  }
  572|       |
  573|  12.1k|  if (frame->cframe != NULL && !frame->avoid_cframe_free) {
  ------------------
  |  Branch (573:7): [True: 12.1k, False: 0]
  |  Branch (573:32): [True: 0, False: 12.1k]
  ------------------
  574|      0|    free(frame->cframe);
  575|      0|  }
  576|       |
  577|  12.1k|  if (frame->coffsets != NULL && frame->coffsets_needs_free) {
  ------------------
  |  Branch (577:7): [True: 0, False: 12.1k]
  |  Branch (577:34): [True: 0, False: 0]
  ------------------
  578|      0|    free(frame->coffsets);
  579|      0|  }
  580|       |
  581|  12.1k|  if (frame->urlpath != NULL) {
  ------------------
  |  Branch (581:7): [True: 0, False: 12.1k]
  ------------------
  582|      0|    free(frame->urlpath);
  583|      0|  }
  584|       |
  585|  12.1k|  free(frame);
  586|       |
  587|  12.1k|  return 0;
  588|  12.1k|}
get_header_info:
  898|  61.1k|                    uint8_t *splitmode, uint8_t *use_dict, const blosc2_io *io) {
  899|  61.1k|  uint8_t* framep = frame->cframe;
  900|  61.1k|  uint8_t* header_ptr;
  901|  61.1k|  uint8_t header[FRAME_HEADER_MINLEN];
  902|       |
  903|  61.1k|  blosc2_io_cb *io_cb = blosc2_get_io_cb(io->id);
  904|  61.1k|  if (io_cb == NULL) {
  ------------------
  |  Branch (904:7): [True: 0, False: 61.1k]
  ------------------
  905|      0|    BLOSC_TRACE_ERROR("Error getting the input/output API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  906|      0|    return BLOSC2_ERROR_PLUGIN_IO;
  907|      0|  }
  908|       |
  909|  61.1k|  if (frame->len <= 0) {
  ------------------
  |  Branch (909:7): [True: 0, False: 61.1k]
  ------------------
  910|      0|    return BLOSC2_ERROR_READ_BUFFER;
  911|      0|  }
  912|       |
  913|  61.1k|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (913:7): [True: 0, False: 61.1k]
  ------------------
  914|      0|    int64_t rbytes = 0;
  915|      0|    void* fp = NULL;
  916|      0|    int64_t io_pos = 0;
  917|      0|    if (frame->sframe) {
  ------------------
  |  Branch (917:9): [True: 0, False: 0]
  ------------------
  918|      0|      fp = sframe_open_index(frame->urlpath, "rb", io);
  919|      0|      if (fp == NULL) {
  ------------------
  |  Branch (919:11): [True: 0, False: 0]
  ------------------
  920|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  921|      0|        return BLOSC2_ERROR_FILE_OPEN;
  922|      0|      }
  923|      0|    }
  924|      0|    else {
  925|       |      /* Ahead of the header read, not after it: everything downstream (and
  926|       |         frame_refresh_if_stale in particular) trusts the length this read
  927|       |         returns, so a stale handle here would pair old metadata with the
  928|       |         replacement's bytes. */
  929|      0|      frame_reader_revalidate(frame);
  930|      0|      fp = frame_reader_acquire(frame, io);
  931|      0|      if (fp == NULL) {
  ------------------
  |  Branch (931:11): [True: 0, False: 0]
  ------------------
  932|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  933|      0|        return BLOSC2_ERROR_FILE_OPEN;
  934|      0|      }
  935|      0|      io_pos = frame->file_offset;
  936|      0|    }
  937|      0|    if (io_cb->is_allocation_necessary)
  ------------------
  |  Branch (937:9): [True: 0, False: 0]
  ------------------
  938|      0|      header_ptr = header;
  939|      0|    rbytes = io_cb->read((void**)&header_ptr, 1, FRAME_HEADER_MINLEN, io_pos, fp);
  ------------------
  |  |   49|      0|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|      0|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|      0|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|      0|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|      0|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|      0|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|      0|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|      0|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|      0|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|      0|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|      0|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|      0|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|      0|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  940|      0|    frame_reader_release(frame, io_cb, fp);
  941|      0|    if (rbytes != FRAME_HEADER_MINLEN) {
  ------------------
  |  |   49|      0|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|      0|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|      0|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|      0|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|      0|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|      0|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|      0|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|      0|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|      0|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|      0|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|      0|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|      0|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|      0|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (941:9): [True: 0, False: 0]
  ------------------
  942|      0|      return BLOSC2_ERROR_FILE_READ;
  943|      0|    }
  944|      0|    framep = header_ptr;
  945|      0|  }
  946|       |
  947|       |  // Consistency check for frame type
  948|  61.1k|  uint8_t frame_type = framep[FRAME_TYPE];
  ------------------
  |  |   33|  61.1k|#define FRAME_TYPE (FRAME_FLAGS + 1)  // 26
  |  |  ------------------
  |  |  |  |   32|  61.1k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  61.1k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   30|  61.1k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   29|  61.1k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  949|  61.1k|  uint8_t frame_version = framep[FRAME_FLAGS] & 0x0fu;
  ------------------
  |  |   32|  61.1k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  ------------------
  |  |  |  |   31|  61.1k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  61.1k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   29|  61.1k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  950|  61.1k|  if (frame_version > BLOSC2_VERSION_FRAME_FORMAT) {
  ------------------
  |  Branch (950:7): [True: 0, False: 61.1k]
  ------------------
  951|      0|    BLOSC_TRACE_ERROR("Unsupported cframe version: %u", frame_version);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  952|      0|    return BLOSC2_ERROR_VERSION_SUPPORT;
  953|      0|  }
  954|  61.1k|  if (frame->sframe) {
  ------------------
  |  Branch (954:7): [True: 0, False: 61.1k]
  ------------------
  955|      0|    if (frame_type != FRAME_DIRECTORY_TYPE) {
  ------------------
  |  |   22|      0|#define FRAME_DIRECTORY_TYPE 1
  ------------------
  |  Branch (955:9): [True: 0, False: 0]
  ------------------
  956|      0|      return BLOSC2_ERROR_FRAME_TYPE;
  957|      0|    }
  958|  61.1k|  } else {
  959|  61.1k|    if (frame_type != FRAME_CONTIGUOUS_TYPE) {
  ------------------
  |  |   21|  61.1k|#define FRAME_CONTIGUOUS_TYPE 0
  ------------------
  |  Branch (959:9): [True: 0, False: 61.1k]
  ------------------
  960|      0|      return BLOSC2_ERROR_FRAME_TYPE;
  961|      0|    }
  962|  61.1k|  }
  963|       |
  964|       |  // Fetch some internal lengths
  965|  61.1k|  from_big(header_len, framep + FRAME_HEADER_LEN, sizeof(*header_len));
  ------------------
  |  |   38|  61.1k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  966|  61.1k|  if (*header_len < FRAME_HEADER_MINLEN) {
  ------------------
  |  |   49|  61.1k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|  61.1k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  61.1k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  61.1k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|  61.1k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|  61.1k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|  61.1k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  61.1k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  61.1k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  61.1k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  61.1k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  61.1k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  61.1k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  61.1k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (966:7): [True: 1, False: 61.1k]
  ------------------
  967|      1|    BLOSC_TRACE_ERROR("Header length is zero or smaller than min allowed.");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  968|      1|    return BLOSC2_ERROR_INVALID_HEADER;
  969|      1|  }
  970|  61.1k|  from_big(frame_len, framep + FRAME_LEN, sizeof(*frame_len));
  ------------------
  |  |   38|  61.1k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  971|  61.1k|  if (*header_len > *frame_len) {
  ------------------
  |  Branch (971:7): [True: 12, False: 61.1k]
  ------------------
  972|     12|    BLOSC_TRACE_ERROR("Header length exceeds length of the frame.");
  ------------------
  |  |   93|     12|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     12|    do {                                            \
  |  |  |  |   98|     12|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     12|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     12|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  973|     12|    return BLOSC2_ERROR_INVALID_HEADER;
  974|     12|  }
  975|  61.1k|  from_big(nbytes, framep + FRAME_NBYTES, sizeof(*nbytes));
  ------------------
  |  |   38|  61.1k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  976|  61.1k|  from_big(cbytes, framep + FRAME_CBYTES, sizeof(*cbytes));
  ------------------
  |  |   38|  61.1k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  977|  61.1k|  from_big(blocksize, framep + FRAME_BLOCKSIZE, sizeof(*blocksize));
  ------------------
  |  |   38|  61.1k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  978|  61.1k|  if (chunksize != NULL) {
  ------------------
  |  Branch (978:7): [True: 61.1k, False: 0]
  ------------------
  979|  61.1k|    from_big(chunksize, framep + FRAME_CHUNKSIZE, sizeof(*chunksize));
  ------------------
  |  |   38|  61.1k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  980|  61.1k|  }
  981|  61.1k|  if (typesize != NULL) {
  ------------------
  |  Branch (981:7): [True: 59.3k, False: 1.81k]
  ------------------
  982|  59.3k|    from_big(typesize, framep + FRAME_TYPESIZE, sizeof(*typesize));
  ------------------
  |  |   38|  59.3k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  983|  59.3k|    if (*typesize <= 0) {
  ------------------
  |  Branch (983:9): [True: 13, False: 59.2k]
  ------------------
  984|     13|      BLOSC_TRACE_ERROR("`typesize` cannot be zero or negative.");
  ------------------
  |  |   93|     13|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     13|    do {                                            \
  |  |  |  |   98|     13|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     13|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     13|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  985|     13|      return BLOSC2_ERROR_INVALID_HEADER;
  986|     13|    }
  987|  59.3k|  }
  988|       |
  989|       |  // Codecs
  990|  61.1k|  uint8_t frame_codecs = framep[FRAME_CODECS];
  ------------------
  |  |   34|  61.1k|#define FRAME_CODECS (FRAME_FLAGS + 2)  // 27
  |  |  ------------------
  |  |  |  |   32|  61.1k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  61.1k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   30|  61.1k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   29|  61.1k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  991|  61.1k|  if (clevel != NULL) {
  ------------------
  |  Branch (991:7): [True: 12.0k, False: 49.0k]
  ------------------
  992|  12.0k|    *clevel = frame_codecs >> 4u;
  993|  12.0k|  }
  994|  61.1k|  if (compcode != NULL) {
  ------------------
  |  Branch (994:7): [True: 12.0k, False: 49.0k]
  ------------------
  995|  12.0k|    *compcode = frame_codecs & 0xFu;
  996|  12.0k|    if (*compcode == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (996:9): [True: 641, False: 11.4k]
  ------------------
  997|    641|      from_big(compcode, framep + FRAME_UDCODEC, sizeof(*compcode));
  ------------------
  |  |   38|    641|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
  998|    641|    }
  999|  12.0k|  }
 1000|       |
 1001|       |  // Other flags
 1002|  61.1k|  uint8_t other_flags = framep[FRAME_OTHER_FLAGS];
  ------------------
  |  |   35|  61.1k|#define FRAME_OTHER_FLAGS (FRAME_FLAGS + 3)  // 28
  |  |  ------------------
  |  |  |  |   32|  61.1k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  ------------------
  |  |  |  |  |  |   31|  61.1k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   30|  61.1k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   29|  61.1k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1003|  61.1k|  if (splitmode != NULL) {
  ------------------
  |  Branch (1003:7): [True: 12.0k, False: 49.0k]
  ------------------
 1004|  12.0k|    *splitmode = (other_flags & 0x03u) + 1;
 1005|  12.0k|  }
 1006|       |
 1007|       |  // Other flags 2: bit 0 = use_dict
 1008|  61.1k|  if (use_dict != NULL) {
  ------------------
  |  Branch (1008:7): [True: 12.0k, False: 49.0k]
  ------------------
 1009|  12.0k|    *use_dict = (framep[FRAME_OTHER_FLAGS2] & FRAME_USE_DICT) ? 1 : 0;
  ------------------
  |  |   47|  12.0k|#define FRAME_OTHER_FLAGS2 (FRAME_FILTER_PIPELINE + 1 + 14)  // 85
  |  |  ------------------
  |  |  |  |   44|  12.0k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  12.0k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  12.0k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|  12.0k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|  12.0k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|  12.0k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  12.0k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  12.0k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  12.0k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  12.0k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  12.0k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  12.0k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  12.0k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  *use_dict = (framep[FRAME_OTHER_FLAGS2] & FRAME_USE_DICT) ? 1 : 0;
  ------------------
  |  |   48|  12.0k|#define FRAME_USE_DICT (1U << 0)   //!< bit 0 of other_flags2: use dictionary compression
  ------------------
  |  Branch (1009:17): [True: 4.78k, False: 7.30k]
  ------------------
 1010|  12.0k|  }
 1011|       |
 1012|  61.1k|  if (compcode_meta != NULL) {
  ------------------
  |  Branch (1012:7): [True: 12.0k, False: 49.0k]
  ------------------
 1013|  12.0k|    from_big(compcode_meta, framep + FRAME_CODEC_META, sizeof(*compcode_meta));
  ------------------
  |  |   38|  12.0k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1014|  12.0k|  }
 1015|       |
 1016|       |  // Filters
 1017|  61.1k|  if (filters != NULL && filters_meta != NULL) {
  ------------------
  |  Branch (1017:7): [True: 12.0k, False: 49.0k]
  |  Branch (1017:26): [True: 12.0k, False: 0]
  ------------------
 1018|  12.0k|    uint8_t nfilters = framep[FRAME_FILTER_PIPELINE];
  ------------------
  |  |   44|  12.0k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  ------------------
  |  |  |  |   43|  12.0k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  12.0k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|  12.0k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|  12.0k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   39|  12.0k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  12.0k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  12.0k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  12.0k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  12.0k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  12.0k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  12.0k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  12.0k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1019|  12.0k|    if (nfilters > BLOSC2_MAX_FILTERS) {
  ------------------
  |  Branch (1019:9): [True: 2, False: 12.0k]
  ------------------
 1020|      2|      BLOSC_TRACE_ERROR("The number of filters in frame header are too large for Blosc2.");
  ------------------
  |  |   93|      2|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      2|    do {                                            \
  |  |  |  |   98|      2|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      2|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      2|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1021|      2|      return BLOSC2_ERROR_INVALID_HEADER;
 1022|      2|    }
 1023|  12.0k|    uint8_t *filters_ = framep + FRAME_FILTER_PIPELINE + 1;
  ------------------
  |  |   44|  12.0k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  ------------------
  |  |  |  |   43|  12.0k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  12.0k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|  12.0k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|  12.0k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   39|  12.0k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  12.0k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  12.0k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  12.0k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  12.0k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  12.0k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  12.0k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  12.0k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1024|  12.0k|    uint8_t *filters_meta_ = framep + FRAME_FILTER_PIPELINE + 1 + FRAME_FILTER_PIPELINE_MAX;
  ------------------
  |  |   44|  12.0k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  ------------------
  |  |  |  |   43|  12.0k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  12.0k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   41|  12.0k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   40|  12.0k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   39|  12.0k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  12.0k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  12.0k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  12.0k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  12.0k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  12.0k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  12.0k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  12.0k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  uint8_t *filters_meta_ = framep + FRAME_FILTER_PIPELINE + 1 + FRAME_FILTER_PIPELINE_MAX;
  ------------------
  |  |   53|  12.0k|#define FRAME_FILTER_PIPELINE_MAX (8)  // the maximum number of filters that can be stored in header
  ------------------
 1025|  20.1k|    for (int i = 0; i < nfilters; i++) {
  ------------------
  |  Branch (1025:21): [True: 8.07k, False: 12.0k]
  ------------------
 1026|  8.07k|      filters[i] = filters_[i];
 1027|  8.07k|      filters_meta[i] = filters_meta_[i];
 1028|  8.07k|    }
 1029|  12.0k|  }
 1030|       |
 1031|  61.1k|  if (*nbytes > 0) {
  ------------------
  |  Branch (1031:7): [True: 60.6k, False: 462]
  ------------------
 1032|  60.6k|    if (*chunksize > 0) {
  ------------------
  |  Branch (1032:9): [True: 45.7k, False: 14.9k]
  ------------------
 1033|       |      // We can compute the number of chunks directly when there is a fixed chunk size.
 1034|  45.7k|      *nchunks = *nbytes / *chunksize;
 1035|  45.7k|      if (*nbytes % *chunksize > 0) {
  ------------------
  |  Branch (1035:11): [True: 39.5k, False: 6.19k]
  ------------------
 1036|  39.5k|        *nchunks += 1;
 1037|  39.5k|      }
 1038|       |
 1039|       |      // Sanity check for compressed sizes
 1040|  45.7k|      if ((*cbytes < 0) || ((int64_t)*nchunks * *chunksize < *nbytes)) {
  ------------------
  |  Branch (1040:11): [True: 6, False: 45.7k]
  |  Branch (1040:28): [True: 0, False: 45.7k]
  ------------------
 1041|      6|        BLOSC_TRACE_ERROR("Invalid compressed size in frame header.");
  ------------------
  |  |   93|      6|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      6|    do {                                            \
  |  |  |  |   98|      6|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      6|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      6|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1042|      6|        return BLOSC2_ERROR_INVALID_HEADER;
 1043|      6|      }
 1044|  45.7k|    }
 1045|  14.9k|    else if (*chunksize == 0) {
  ------------------
  |  Branch (1045:14): [True: 14.9k, False: 0]
  ------------------
 1046|  14.9k|      int32_t coffsets_nbytes;
 1047|  14.9k|      int rc2 = get_coffsets_nbytes(frame, *header_len, *cbytes, &coffsets_nbytes, io);
 1048|  14.9k|      if (rc2 < 0) {
  ------------------
  |  Branch (1048:11): [True: 100, False: 14.8k]
  ------------------
 1049|    100|        return rc2;
 1050|    100|      }
 1051|  14.8k|      if (coffsets_nbytes < 0 || coffsets_nbytes % (int32_t)sizeof(int64_t) != 0) {
  ------------------
  |  Branch (1051:11): [True: 4, False: 14.8k]
  |  Branch (1051:34): [True: 2, False: 14.8k]
  ------------------
 1052|      6|        BLOSC_TRACE_ERROR("Invalid offsets chunk in frame header.");
  ------------------
  |  |   93|      6|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      6|    do {                                            \
  |  |  |  |   98|      6|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      6|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      6|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1053|      6|        return BLOSC2_ERROR_INVALID_HEADER;
 1054|      6|      }
 1055|  14.8k|      *nchunks = coffsets_nbytes / (int32_t)sizeof(int64_t);
 1056|  14.8k|    }
 1057|      0|    else {
 1058|      0|      BLOSC_TRACE_ERROR("Invalid chunk size in frame header.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1059|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1060|      0|    }
 1061|  60.6k|  } else {
 1062|    462|    *nchunks = 0;
 1063|    462|  }
 1064|       |
 1065|  60.9k|  if (*nchunks > 0) {
  ------------------
  |  Branch (1065:7): [True: 60.5k, False: 473]
  ------------------
 1066|  60.5k|    int32_t off_nbytes;
 1067|  60.5k|    if (!blosc2_nchunks_to_offsets_nbytes(*nchunks, &off_nbytes)) {
  ------------------
  |  Branch (1067:9): [True: 10, False: 60.5k]
  ------------------
 1068|     10|      BLOSC_TRACE_ERROR("Invalid number of chunks in frame header.");
  ------------------
  |  |   93|     10|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     10|    do {                                            \
  |  |  |  |   98|     10|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     10|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 10, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     10|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1069|     10|      return BLOSC2_ERROR_INVALID_HEADER;
 1070|     10|    }
 1071|  60.5k|  }
 1072|       |
 1073|  60.9k|  return 0;
 1074|  60.9k|}
get_trailer_offset:
 1077|    863|int64_t get_trailer_offset(blosc2_frame_s *frame, int32_t header_len, bool has_coffsets) {
 1078|    863|  if (!has_coffsets) {
  ------------------
  |  Branch (1078:7): [True: 125, False: 738]
  ------------------
 1079|       |    // No data chunks yet
 1080|    125|    return header_len;
 1081|    125|  }
 1082|    738|  return frame->len - frame->trailer_len;
 1083|    863|}
frame_from_cframe:
 1873|  12.1k|blosc2_frame_s* frame_from_cframe(uint8_t *cframe, int64_t len, bool copy) {
 1874|       |  // Get the length of the frame
 1875|  12.1k|  const uint8_t* header = cframe;
 1876|  12.1k|  int64_t frame_len;
 1877|  12.1k|  if (len < FRAME_HEADER_MINLEN) {
  ------------------
  |  |   49|  12.1k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|  12.1k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  12.1k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  12.1k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|  12.1k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|  12.1k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|  12.1k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  12.1k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  12.1k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  12.1k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  12.1k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  12.1k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  12.1k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  12.1k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1877:7): [True: 0, False: 12.1k]
  ------------------
 1878|      0|    return NULL;
 1879|      0|  }
 1880|       |
 1881|  12.1k|  from_big(&frame_len, header + FRAME_LEN, sizeof(frame_len));
  ------------------
  |  |   38|  12.1k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1882|  12.1k|  if (frame_len != len) {   // sanity check
  ------------------
  |  Branch (1882:7): [True: 2, False: 12.1k]
  ------------------
 1883|      2|    return NULL;
 1884|      2|  }
 1885|       |
 1886|  12.1k|  blosc2_frame_s* frame = frame_alloc();
 1887|  12.1k|  if (frame == NULL) {
  ------------------
  |  Branch (1887:7): [True: 0, False: 12.1k]
  ------------------
 1888|      0|    return NULL;
 1889|      0|  }
 1890|  12.1k|  frame->len = frame_len;
 1891|  12.1k|  frame->file_offset = 0;
 1892|       |
 1893|       |  // Now, the trailer length
 1894|  12.1k|  const uint8_t* trailer = cframe + frame_len - FRAME_TRAILER_MINLEN;
  ------------------
  |  |   58|  12.1k|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
 1895|  12.1k|  int trailer_offset = FRAME_TRAILER_MINLEN - FRAME_TRAILER_LEN_OFFSET;
  ------------------
  |  |   58|  12.1k|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
                int trailer_offset = FRAME_TRAILER_MINLEN - FRAME_TRAILER_LEN_OFFSET;
  ------------------
  |  |   59|  12.1k|#define FRAME_TRAILER_LEN_OFFSET (22)  // offset to trailer length (counting from the end)
  ------------------
 1896|  12.1k|  if (trailer[trailer_offset - 1] != 0xce) {
  ------------------
  |  Branch (1896:7): [True: 1, False: 12.1k]
  ------------------
 1897|      1|    blosc2_pthread_mutex_destroy(&frame->read_fp_mutex);
  ------------------
  |  |   91|      1|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 1898|      1|    free(frame);
 1899|      1|    return NULL;
 1900|      1|  }
 1901|  12.1k|  uint32_t trailer_len;
 1902|  12.1k|  from_big(&trailer_len, trailer + trailer_offset, sizeof(trailer_len));
  ------------------
  |  |   38|  12.1k|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1903|  12.1k|  if (trailer_len < FRAME_TRAILER_MINLEN || trailer_len > INT32_MAX ||
  ------------------
  |  |   58|  24.2k|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
  |  Branch (1903:7): [True: 0, False: 12.1k]
  |  Branch (1903:45): [True: 3, False: 12.1k]
  ------------------
 1904|  12.1k|      (int64_t)trailer_len > frame_len ||
  ------------------
  |  Branch (1904:7): [True: 9, False: 12.1k]
  ------------------
 1905|  12.1k|      (int64_t)trailer_len > frame_len - FRAME_HEADER_MINLEN) {
  ------------------
  |  |   49|  12.1k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|  12.1k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  12.1k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  12.1k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|  12.1k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|  12.1k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|  12.1k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  12.1k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  12.1k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  12.1k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  12.1k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  12.1k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  12.1k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  12.1k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1905:7): [True: 4, False: 12.1k]
  ------------------
 1906|     16|    blosc2_pthread_mutex_destroy(&frame->read_fp_mutex);
  ------------------
  |  |   91|     16|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 1907|     16|    free(frame);
 1908|     16|    return NULL;
 1909|     16|  }
 1910|  12.1k|  frame->trailer_len = trailer_len;
 1911|       |
 1912|  12.1k|  if (copy) {
  ------------------
  |  Branch (1912:7): [True: 0, False: 12.1k]
  ------------------
 1913|      0|    frame->cframe = malloc((size_t)len);
 1914|      0|    memcpy(frame->cframe, cframe, (size_t)len);
 1915|      0|  }
 1916|  12.1k|  else {
 1917|  12.1k|    frame->cframe = cframe;
 1918|  12.1k|    frame->avoid_cframe_free = true;
 1919|  12.1k|  }
 1920|       |
 1921|  12.1k|  return frame;
 1922|  12.1k|}
get_coffsets:
 2103|  58.9k|                      int64_t nchunks, int32_t *off_cbytes) {
 2104|  58.9k|  int32_t chunk_cbytes;
 2105|  58.9k|  int rc;
 2106|       |
 2107|  58.9k|  if (frame->coffsets != NULL) {
  ------------------
  |  Branch (2107:7): [True: 0, False: 58.9k]
  ------------------
 2108|      0|    if (off_cbytes != NULL) {
  ------------------
  |  Branch (2108:9): [True: 0, False: 0]
  ------------------
 2109|      0|      rc = blosc2_cbuffer_sizes(frame->coffsets, NULL, &chunk_cbytes, NULL);
 2110|      0|      if (rc < 0) {
  ------------------
  |  Branch (2110:11): [True: 0, False: 0]
  ------------------
 2111|      0|        return NULL;
 2112|      0|      }
 2113|      0|      *off_cbytes = (int32_t)chunk_cbytes;
 2114|      0|    }
 2115|      0|    return frame->coffsets;
 2116|      0|  }
 2117|  58.9k|  if (frame->cframe != NULL) {
  ------------------
  |  Branch (2117:7): [True: 58.9k, False: 0]
  ------------------
 2118|  58.9k|    int64_t off_pos = header_len;
 2119|  58.9k|    if (cbytes < INT64_MAX - header_len) {
  ------------------
  |  Branch (2119:9): [True: 1.71k, False: 57.2k]
  ------------------
 2120|  1.71k|      off_pos += cbytes;
 2121|  1.71k|    }
 2122|       |    // Check that there is enough room to read Blosc header
 2123|  58.9k|    if (off_pos < 0 || off_pos > INT64_MAX - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (2123:9): [True: 0, False: 58.9k]
  |  Branch (2123:24): [True: 1, False: 58.9k]
  ------------------
 2124|  58.9k|        off_pos + BLOSC_EXTENDED_HEADER_LENGTH > frame->len) {
  ------------------
  |  Branch (2124:9): [True: 72, False: 58.9k]
  ------------------
 2125|     73|      BLOSC_TRACE_ERROR("Cannot read the offsets outside of frame boundary.");
  ------------------
  |  |   93|     73|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     73|    do {                                            \
  |  |  |  |   98|     73|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     73|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 73, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     73|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2126|     73|      return NULL;
 2127|     73|    }
 2128|       |    // For in-memory frames, the coffset is just one pointer away
 2129|  58.9k|    uint8_t* off_start = frame->cframe + off_pos;
 2130|  58.9k|    if (off_cbytes != NULL) {
  ------------------
  |  Branch (2130:9): [True: 58.9k, False: 0]
  ------------------
 2131|  58.9k|      int32_t chunk_nbytes;
 2132|  58.9k|      int32_t chunk_blocksize;
 2133|  58.9k|      rc = blosc2_cbuffer_sizes(off_start, &chunk_nbytes, &chunk_cbytes, &chunk_blocksize);
 2134|  58.9k|      if (rc < 0) {
  ------------------
  |  Branch (2134:11): [True: 11, False: 58.8k]
  ------------------
 2135|     11|        return NULL;
 2136|     11|      }
 2137|  58.8k|      *off_cbytes = (int32_t)chunk_cbytes;
 2138|  58.8k|      if (*off_cbytes < 0 || off_pos + *off_cbytes > frame->len) {
  ------------------
  |  Branch (2138:11): [True: 0, False: 58.8k]
  |  Branch (2138:30): [True: 26, False: 58.8k]
  ------------------
 2139|     26|        BLOSC_TRACE_ERROR("Cannot read the cbytes outside of frame boundary.");
  ------------------
  |  |   93|     26|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     26|    do {                                            \
  |  |  |  |   98|     26|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     26|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 26, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     26|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2140|     26|        return NULL;
 2141|     26|      }
 2142|  58.8k|      int32_t expected_off_nbytes;
 2143|  58.8k|      if (!blosc2_nchunks_to_offsets_nbytes(nchunks, &expected_off_nbytes)) {
  ------------------
  |  Branch (2143:11): [True: 0, False: 58.8k]
  ------------------
 2144|      0|        BLOSC_TRACE_ERROR("Too many chunks for offsets representation.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2145|      0|        return NULL;
 2146|      0|      }
 2147|  58.8k|      if (chunk_nbytes != expected_off_nbytes) {
  ------------------
  |  Branch (2147:11): [True: 49, False: 58.8k]
  ------------------
 2148|     49|        BLOSC_TRACE_ERROR("The number of chunks in offset idx "
  ------------------
  |  |   93|     49|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     49|    do {                                            \
  |  |  |  |   98|     49|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     49|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 49, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     49|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2149|     49|                          "does not match the ones in the header frame.");
 2150|     49|        return NULL;
 2151|     49|      }
 2152|       |
 2153|  58.8k|    }
 2154|  58.8k|    return off_start;
 2155|  58.9k|  }
 2156|       |
 2157|      0|  int64_t trailer_offset = get_trailer_offset(frame, header_len, true);
 2158|       |
 2159|      0|  if (trailer_offset < BLOSC_EXTENDED_HEADER_LENGTH || trailer_offset + FRAME_TRAILER_MINLEN > frame->len) {
  ------------------
  |  |   58|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
  |  Branch (2159:7): [True: 0, False: 0]
  |  Branch (2159:56): [True: 0, False: 0]
  ------------------
 2160|      0|    BLOSC_TRACE_ERROR("Cannot read the trailer out of the frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2161|      0|    return NULL;
 2162|      0|  }
 2163|       |
 2164|      0|  int64_t coffsets_cbytes64;
 2165|      0|  if (frame->sframe) {
  ------------------
  |  Branch (2165:7): [True: 0, False: 0]
  ------------------
 2166|      0|    coffsets_cbytes64 = trailer_offset - header_len;
 2167|      0|  }
 2168|      0|  else {
 2169|      0|    coffsets_cbytes64 = trailer_offset - (header_len + cbytes);
 2170|      0|  }
 2171|      0|  if (coffsets_cbytes64 <= 0 || coffsets_cbytes64 > INT32_MAX) {
  ------------------
  |  Branch (2171:7): [True: 0, False: 0]
  |  Branch (2171:33): [True: 0, False: 0]
  ------------------
 2172|      0|    BLOSC_TRACE_ERROR("Offsets chunk size is out of bounds.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2173|      0|    return NULL;
 2174|      0|  }
 2175|      0|  int32_t coffsets_cbytes = (int32_t)coffsets_cbytes64;
 2176|       |
 2177|      0|  if (off_cbytes != NULL) {
  ------------------
  |  Branch (2177:7): [True: 0, False: 0]
  ------------------
 2178|      0|    *off_cbytes = coffsets_cbytes;
 2179|      0|  }
 2180|       |
 2181|      0|  blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 2182|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (2182:7): [True: 0, False: 0]
  ------------------
 2183|      0|    BLOSC_TRACE_ERROR("Error getting the input/output API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2184|      0|    return NULL;
 2185|      0|  }
 2186|       |
 2187|      0|  void* fp = NULL;
 2188|      0|  uint8_t* coffsets;
 2189|      0|  if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (2189:7): [True: 0, False: 0]
  ------------------
 2190|      0|    coffsets = malloc((size_t)coffsets_cbytes);
 2191|      0|    frame->coffsets_needs_free = true;
 2192|      0|  }
 2193|      0|  else {
 2194|      0|    frame->coffsets_needs_free = false;
 2195|      0|  }
 2196|       |
 2197|      0|  int64_t io_pos = 0;
 2198|      0|  if (frame->sframe) {
  ------------------
  |  Branch (2198:7): [True: 0, False: 0]
  ------------------
 2199|      0|    fp = sframe_open_index(frame->urlpath, "rb",
 2200|      0|                           frame->schunk->storage->io);
 2201|      0|    if (fp == NULL) {
  ------------------
  |  Branch (2201:9): [True: 0, False: 0]
  ------------------
 2202|      0|      BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2203|      0|      return NULL;
 2204|      0|    }
 2205|      0|    io_pos = header_len + 0;
 2206|      0|  }
 2207|      0|  else {
 2208|      0|    fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 2209|      0|    if (fp == NULL) {
  ------------------
  |  Branch (2209:9): [True: 0, False: 0]
  ------------------
 2210|      0|      BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2211|      0|      return NULL;
 2212|      0|    }
 2213|      0|    io_pos = frame->file_offset + header_len + cbytes;
 2214|      0|  }
 2215|      0|  int64_t rbytes = io_cb->read((void**)&coffsets, 1, coffsets_cbytes, io_pos, fp);
 2216|      0|  frame_reader_release(frame, io_cb, fp);
 2217|      0|  if (rbytes != coffsets_cbytes) {
  ------------------
  |  Branch (2217:7): [True: 0, False: 0]
  ------------------
 2218|      0|    BLOSC_TRACE_ERROR("Cannot read the offsets out of the frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2219|      0|    if (frame->coffsets_needs_free)
  ------------------
  |  Branch (2219:9): [True: 0, False: 0]
  ------------------
 2220|      0|      free(coffsets);
 2221|      0|    return NULL;
 2222|      0|  }
 2223|      0|  frame->coffsets = coffsets;
 2224|      0|  return coffsets;
 2225|      0|}
frame_get_metalayers:
 2514|    951|int frame_get_metalayers(blosc2_frame_s* frame, blosc2_schunk* schunk) {
 2515|    951|  int32_t header_len;
 2516|    951|  int64_t frame_len;
 2517|    951|  int64_t nbytes;
 2518|    951|  int64_t cbytes;
 2519|    951|  int32_t blocksize;
 2520|    951|  int32_t chunksize;
 2521|    951|  int64_t nchunks;
 2522|    951|  int ret = get_header_info(frame, &header_len, &frame_len, &nbytes, &cbytes,
 2523|    951|                            &blocksize, &chunksize, &nchunks,
 2524|    951|                            NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 2525|    951|                            schunk->storage->io);
 2526|    951|  if (ret < 0) {
  ------------------
  |  Branch (2526:7): [True: 0, False: 951]
  ------------------
 2527|      0|    BLOSC_TRACE_ERROR("Unable to get the header info from frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2528|      0|    return ret;
 2529|      0|  }
 2530|       |
 2531|       |  // Get the header
 2532|    951|  uint8_t* header = NULL;
 2533|    951|  bool needs_free = false;
 2534|    951|  if (frame->cframe != NULL) {
  ------------------
  |  Branch (2534:7): [True: 951, False: 0]
  ------------------
 2535|    951|    header = frame->cframe;
 2536|    951|  } else {
 2537|      0|    int64_t rbytes = 0;
 2538|      0|    blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 2539|      0|    if (io_cb == NULL) {
  ------------------
  |  Branch (2539:9): [True: 0, False: 0]
  ------------------
 2540|      0|      BLOSC_TRACE_ERROR("Error getting the input/output API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2541|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 2542|      0|    }
 2543|       |
 2544|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (2544:9): [True: 0, False: 0]
  ------------------
 2545|      0|      header = malloc(header_len);
 2546|      0|      needs_free = true;
 2547|      0|    }
 2548|      0|    else {
 2549|      0|      needs_free = false;
 2550|      0|    }
 2551|       |
 2552|      0|    void* fp = NULL;
 2553|      0|    int64_t io_pos = 0;
 2554|      0|    if (frame->sframe) {
  ------------------
  |  Branch (2554:9): [True: 0, False: 0]
  ------------------
 2555|      0|      fp = sframe_open_index(frame->urlpath, "rb",
 2556|      0|                             frame->schunk->storage->io);
 2557|      0|      if (fp == NULL) {
  ------------------
  |  Branch (2557:11): [True: 0, False: 0]
  ------------------
 2558|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2559|      0|        return BLOSC2_ERROR_FILE_OPEN;
 2560|      0|      }
 2561|      0|    }
 2562|      0|    else {
 2563|      0|      fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 2564|      0|      if (fp == NULL) {
  ------------------
  |  Branch (2564:11): [True: 0, False: 0]
  ------------------
 2565|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2566|      0|        return BLOSC2_ERROR_FILE_OPEN;
 2567|      0|      }
 2568|      0|      io_pos = frame->file_offset;
 2569|      0|    }
 2570|      0|    if (fp != NULL) {
  ------------------
  |  Branch (2570:9): [True: 0, False: 0]
  ------------------
 2571|      0|      rbytes = io_cb->read((void**)&header, 1, header_len, io_pos, fp);
 2572|      0|      frame_reader_release(frame, io_cb, fp);
 2573|      0|    }
 2574|      0|    if (rbytes != header_len) {
  ------------------
  |  Branch (2574:9): [True: 0, False: 0]
  ------------------
 2575|      0|      BLOSC_TRACE_ERROR("Cannot access the header out of the frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2576|      0|      if (needs_free)
  ------------------
  |  Branch (2576:11): [True: 0, False: 0]
  ------------------
 2577|      0|        free(header);
 2578|      0|      return BLOSC2_ERROR_FILE_READ;
 2579|      0|    }
 2580|      0|  }
 2581|       |
 2582|    951|  ret = get_meta_from_header(frame, schunk, header, header_len);
 2583|       |
 2584|    951|  if (frame->cframe == NULL && needs_free) {
  ------------------
  |  Branch (2584:7): [True: 0, False: 951]
  |  Branch (2584:32): [True: 0, False: 0]
  ------------------
 2585|      0|    free(header);
 2586|      0|  }
 2587|       |
 2588|    951|  return ret;
 2589|    951|}
frame_get_vlmetalayers:
 2725|    863|int frame_get_vlmetalayers(blosc2_frame_s* frame, blosc2_schunk* schunk) {
 2726|    863|  int32_t header_len;
 2727|    863|  int64_t frame_len;
 2728|    863|  int64_t nbytes;
 2729|    863|  int64_t cbytes;
 2730|    863|  int32_t blocksize;
 2731|    863|  int32_t chunksize;
 2732|    863|  int64_t nchunks;
 2733|    863|  int ret = get_header_info(frame, &header_len, &frame_len, &nbytes, &cbytes,
 2734|    863|                            &blocksize, &chunksize, &nchunks,
 2735|    863|                            NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 2736|    863|                            schunk->storage->io);
 2737|    863|  if (ret < 0) {
  ------------------
  |  Branch (2737:7): [True: 0, False: 863]
  ------------------
 2738|      0|    BLOSC_TRACE_ERROR("Unable to get the trailer info from frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2739|      0|    return ret;
 2740|      0|  }
 2741|       |
 2742|    863|  int64_t trailer_offset = get_trailer_offset(frame, header_len, nbytes > 0);
 2743|    863|  int32_t trailer_len = (int32_t) frame->trailer_len;
 2744|       |
 2745|    863|  if (trailer_offset < BLOSC_EXTENDED_HEADER_LENGTH || trailer_offset + trailer_len > frame->len) {
  ------------------
  |  Branch (2745:7): [True: 0, False: 863]
  |  Branch (2745:56): [True: 20, False: 843]
  ------------------
 2746|     20|    BLOSC_TRACE_ERROR("Cannot access the trailer out of the frame.");
  ------------------
  |  |   93|     20|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     20|    do {                                            \
  |  |  |  |   98|     20|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     20|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 20, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     20|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2747|     20|    return BLOSC2_ERROR_READ_BUFFER;
 2748|     20|  }
 2749|       |
 2750|       |  // Get the trailer
 2751|    843|  uint8_t* trailer = NULL;
 2752|    843|  bool needs_free = false;
 2753|    843|  if (frame->cframe != NULL) {
  ------------------
  |  Branch (2753:7): [True: 843, False: 0]
  ------------------
 2754|    843|    trailer = frame->cframe + trailer_offset;
 2755|    843|  } else {
 2756|      0|    int64_t rbytes = 0;
 2757|       |
 2758|      0|    blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 2759|      0|    if (io_cb == NULL) {
  ------------------
  |  Branch (2759:9): [True: 0, False: 0]
  ------------------
 2760|      0|      BLOSC_TRACE_ERROR("Error getting the input/output API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2761|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 2762|      0|    }
 2763|       |
 2764|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (2764:9): [True: 0, False: 0]
  ------------------
 2765|      0|      trailer = malloc(trailer_len);
 2766|      0|      needs_free = true;
 2767|      0|    }
 2768|      0|    else {
 2769|      0|      needs_free = false;
 2770|      0|    }
 2771|       |
 2772|      0|    void* fp = NULL;
 2773|      0|    int64_t io_pos = 0;
 2774|      0|    if (frame->sframe) {
  ------------------
  |  Branch (2774:9): [True: 0, False: 0]
  ------------------
 2775|       |      // Check for overflow before calculating length
 2776|      0|      if (strlen(frame->urlpath) > SIZE_MAX - strlen("/chunks.b2frame") - 1) {
  ------------------
  |  Branch (2776:11): [True: 0, False: 0]
  ------------------
 2777|      0|        BLOSC_TRACE_ERROR("Path too long for frame filename.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2778|      0|        if (needs_free) free(trailer);
  ------------------
  |  Branch (2778:13): [True: 0, False: 0]
  ------------------
 2779|      0|        return BLOSC2_ERROR_INVALID_PARAM;
 2780|      0|      }
 2781|      0|      size_t _len = strlen(frame->urlpath) + strlen("/chunks.b2frame") + 1;
 2782|      0|      char* eframe_name = malloc(_len);
 2783|      0|      if (eframe_name == NULL) {
  ------------------
  |  Branch (2783:11): [True: 0, False: 0]
  ------------------
 2784|      0|        BLOSC_TRACE_ERROR("Unable to allocate memory for frame filename.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2785|      0|        if (needs_free) free(trailer);
  ------------------
  |  Branch (2785:13): [True: 0, False: 0]
  ------------------
 2786|      0|        return BLOSC2_ERROR_MEMORY_ALLOC;
 2787|      0|      }
 2788|      0|      int _w = snprintf(eframe_name, _len, "%s/chunks.b2frame", frame->urlpath);
 2789|      0|      if (_w < 0 || (size_t)_w >= _len) {
  ------------------
  |  Branch (2789:11): [True: 0, False: 0]
  |  Branch (2789:21): [True: 0, False: 0]
  ------------------
 2790|      0|        BLOSC_TRACE_ERROR("Error building frame filename");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2791|      0|        free(eframe_name);
 2792|      0|        if (needs_free) free(trailer);
  ------------------
  |  Branch (2792:13): [True: 0, False: 0]
  ------------------
 2793|      0|        return BLOSC2_ERROR_INVALID_PARAM;
 2794|      0|      }
 2795|      0|      fp = io_cb->open(eframe_name, "rb", frame->schunk->storage->io->params);
 2796|      0|      if (fp == NULL) {
  ------------------
  |  Branch (2796:11): [True: 0, False: 0]
  ------------------
 2797|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", eframe_name);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2798|      0|        free(eframe_name);
 2799|      0|        return BLOSC2_ERROR_FILE_OPEN;
 2800|      0|      }
 2801|      0|      free(eframe_name);
 2802|      0|      io_pos = trailer_offset;
 2803|      0|    }
 2804|      0|    else {
 2805|      0|      fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 2806|      0|      if (fp == NULL) {
  ------------------
  |  Branch (2806:11): [True: 0, False: 0]
  ------------------
 2807|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2808|      0|        return BLOSC2_ERROR_FILE_OPEN;
 2809|      0|      }
 2810|      0|      io_pos = frame->file_offset + trailer_offset;
 2811|      0|    }
 2812|      0|    if (fp != NULL) {
  ------------------
  |  Branch (2812:9): [True: 0, False: 0]
  ------------------
 2813|      0|      rbytes = io_cb->read((void**)&trailer, 1, trailer_len, io_pos, fp);
 2814|      0|      frame_reader_release(frame, io_cb, fp);
 2815|      0|    }
 2816|      0|    if (rbytes != trailer_len) {
  ------------------
  |  Branch (2816:9): [True: 0, False: 0]
  ------------------
 2817|      0|      BLOSC_TRACE_ERROR("Cannot access the trailer out of the fileframe.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2818|      0|      if (needs_free)
  ------------------
  |  Branch (2818:11): [True: 0, False: 0]
  ------------------
 2819|      0|        free(trailer);
 2820|      0|      return BLOSC2_ERROR_FILE_READ;
 2821|      0|    }
 2822|      0|  }
 2823|       |
 2824|    843|  ret = get_vlmeta_from_trailer(frame, schunk, trailer, trailer_len);
 2825|       |
 2826|    843|  if (frame->cframe == NULL && needs_free) {
  ------------------
  |  Branch (2826:7): [True: 0, False: 843]
  |  Branch (2826:32): [True: 0, False: 0]
  ------------------
 2827|      0|    free(trailer);
 2828|      0|  }
 2829|       |
 2830|    843|  return ret;
 2831|    843|}
get_new_storage:
 2837|  11.9k|                                const blosc2_io* iodefaults) {
 2838|       |
 2839|  11.9k|  blosc2_storage* new_storage = (blosc2_storage*)calloc(1, sizeof(blosc2_storage));
 2840|  11.9k|  memcpy(new_storage, storage, sizeof(blosc2_storage));
 2841|  11.9k|  if (storage->urlpath != NULL) {
  ------------------
  |  Branch (2841:7): [True: 0, False: 11.9k]
  ------------------
 2842|      0|    char* urlpath = normalize_urlpath(storage->urlpath);
 2843|      0|    new_storage->urlpath = malloc(strlen(urlpath) + 1);
 2844|      0|    strcpy(new_storage->urlpath, urlpath);
 2845|      0|  }
 2846|       |
 2847|       |  // cparams
 2848|  11.9k|  blosc2_cparams* cparams = malloc(sizeof(blosc2_cparams));
 2849|  11.9k|  if (storage->cparams != NULL) {
  ------------------
  |  Branch (2849:7): [True: 0, False: 11.9k]
  ------------------
 2850|      0|    memcpy(cparams, storage->cparams, sizeof(blosc2_cparams));
 2851|  11.9k|  } else {
 2852|  11.9k|    memcpy(cparams, cdefaults, sizeof(blosc2_cparams));
 2853|  11.9k|  }
 2854|  11.9k|  new_storage->cparams = cparams;
 2855|       |
 2856|       |  // dparams
 2857|  11.9k|  blosc2_dparams* dparams = malloc(sizeof(blosc2_dparams));
 2858|  11.9k|  if (storage->dparams != NULL) {
  ------------------
  |  Branch (2858:7): [True: 0, False: 11.9k]
  ------------------
 2859|      0|    memcpy(dparams, storage->dparams, sizeof(blosc2_dparams));
 2860|      0|  }
 2861|  11.9k|  else {
 2862|  11.9k|    memcpy(dparams, ddefaults, sizeof(blosc2_dparams));
 2863|  11.9k|  }
 2864|  11.9k|  new_storage->dparams = dparams;
 2865|       |
 2866|       |  // iodefaults
 2867|  11.9k|  blosc2_io* udio = malloc(sizeof(blosc2_io));
 2868|  11.9k|  if (storage->io != NULL) {
  ------------------
  |  Branch (2868:7): [True: 0, False: 11.9k]
  ------------------
 2869|      0|    memcpy(udio, storage->io, sizeof(blosc2_io));
 2870|      0|  }
 2871|  11.9k|  else {
 2872|  11.9k|    memcpy(udio, iodefaults, sizeof(blosc2_io));
 2873|  11.9k|  }
 2874|  11.9k|  new_storage->io = udio;
 2875|       |
 2876|  11.9k|  return new_storage;
 2877|  11.9k|}
frame_to_schunk:
 2941|  12.1k|blosc2_schunk* frame_to_schunk(blosc2_frame_s* frame, bool copy, const blosc2_io *udio) {
 2942|  12.1k|  int32_t header_len;
 2943|  12.1k|  int64_t frame_len;
 2944|  12.1k|  int rc;
 2945|  12.1k|  bool frame_attached = true;
 2946|  12.1k|  blosc2_schunk* schunk = calloc(1, sizeof(blosc2_schunk));
 2947|  12.1k|  blosc2_cparams *cparams = NULL;
 2948|  12.1k|  blosc2_dparams *dparams = NULL;
 2949|  12.1k|  int64_t *offsets = NULL;
 2950|  12.1k|  if (schunk == NULL) {
  ------------------
  |  Branch (2950:7): [True: 0, False: 12.1k]
  ------------------
 2951|      0|    return NULL;
 2952|      0|  }
 2953|  12.1k|  schunk->frame = (blosc2_frame*)frame;
 2954|  12.1k|  frame->schunk = schunk;
 2955|       |
 2956|  12.1k|  rc = get_header_info(frame, &header_len, &frame_len, &schunk->nbytes,
 2957|  12.1k|                       &schunk->cbytes, &schunk->blocksize,
 2958|  12.1k|                       &schunk->chunksize, &schunk->nchunks, &schunk->typesize,
 2959|  12.1k|                       &schunk->compcode, &schunk->compcode_meta, &schunk->clevel, schunk->filters,
 2960|  12.1k|                       schunk->filters_meta, &schunk->splitmode, &schunk->use_dict, udio);
 2961|  12.1k|  if (rc < 0) {
  ------------------
  |  Branch (2961:7): [True: 150, False: 11.9k]
  ------------------
 2962|    150|    BLOSC_TRACE_ERROR("Unable to get meta info from frame.");
  ------------------
  |  |   93|    150|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    150|    do {                                            \
  |  |  |  |   98|    150|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    150|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 150, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    150|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2963|    150|    goto error;
 2964|    150|  }
 2965|  11.9k|  int64_t nchunks = schunk->nchunks;
 2966|  11.9k|  int64_t nbytes = schunk->nbytes;
 2967|  11.9k|  (void) nbytes;
 2968|  11.9k|  int64_t cbytes = schunk->cbytes;
 2969|       |
 2970|       |  // Compression and decompression contexts
 2971|  11.9k|  blosc2_schunk_get_cparams(schunk, &cparams);
 2972|  11.9k|  schunk->cctx = blosc2_create_cctx(*cparams);
 2973|  11.9k|  if (schunk->cctx == NULL) {
  ------------------
  |  Branch (2973:7): [True: 21, False: 11.9k]
  ------------------
 2974|     21|    BLOSC_TRACE_ERROR("Error while creating the compression context");
  ------------------
  |  |   93|     21|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     21|    do {                                            \
  |  |  |  |   98|     21|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     21|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 21, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     21|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2975|     21|    goto error;
 2976|     21|  }
 2977|  11.9k|  blosc2_schunk_get_dparams(schunk, &dparams);
 2978|  11.9k|  schunk->dctx = blosc2_create_dctx(*dparams);
 2979|  11.9k|  if (schunk->dctx == NULL) {
  ------------------
  |  Branch (2979:7): [True: 0, False: 11.9k]
  ------------------
 2980|      0|    BLOSC_TRACE_ERROR("Error while creating the decompression context");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2981|      0|    goto error;
 2982|      0|  }
 2983|  11.9k|  blosc2_storage storage = {.contiguous = copy ? false : true};
  ------------------
  |  Branch (2983:43): [True: 0, False: 11.9k]
  ------------------
 2984|  11.9k|  schunk->storage = get_new_storage(&storage, cparams, dparams, udio);
 2985|  11.9k|  free(cparams);
 2986|  11.9k|  cparams = NULL;
 2987|  11.9k|  free(dparams);
 2988|  11.9k|  dparams = NULL;
 2989|  11.9k|  if (nchunks > 0) {
  ------------------
  |  Branch (2989:7): [True: 11.7k, False: 171]
  ------------------
 2990|  11.7k|    rc = validate_offsets_chunk(frame, header_len, cbytes, nchunks);
 2991|  11.7k|    if (rc < 0) {
  ------------------
  |  Branch (2991:9): [True: 10.0k, False: 1.67k]
  ------------------
 2992|  10.0k|      BLOSC_TRACE_ERROR("Cannot validate frame offsets.");
  ------------------
  |  |   93|  10.0k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  10.0k|    do {                                            \
  |  |  |  |   98|  10.0k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  10.0k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 10.0k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  10.0k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2993|  10.0k|      goto error;
 2994|  10.0k|    }
 2995|  11.7k|  }
 2996|  1.85k|  if (nchunks > 0) {
  ------------------
  |  Branch (2996:7): [True: 1.67k, False: 171]
  ------------------
 2997|  1.67k|    uint8_t *chunk;
 2998|  1.67k|    bool needs_free;
 2999|       |    // A lazy chunk is enough here: only the header is needed for the flags2 byte
 3000|  1.67k|    rc = frame_get_lazychunk(frame, 0, &chunk, &needs_free);
 3001|  1.67k|    if (rc < 0) {
  ------------------
  |  Branch (3001:9): [True: 899, False: 780]
  ------------------
 3002|    899|      BLOSC_TRACE_ERROR("Cannot inspect the first chunk in frame.");
  ------------------
  |  |   93|    899|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    899|    do {                                            \
  |  |  |  |   98|    899|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    899|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 899, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    899|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3003|    899|      goto error;
 3004|    899|    }
 3005|    780|    schunk->flags2 = chunk[BLOSC2_CHUNK_BLOSC2_FLAGS2];
 3006|    780|    if (needs_free) {
  ------------------
  |  Branch (3006:9): [True: 473, False: 307]
  ------------------
 3007|    473|      free(chunk);
 3008|    473|    }
 3009|    780|  }
 3010|    951|  if (!copy) {
  ------------------
  |  Branch (3010:7): [True: 951, False: 0]
  ------------------
 3011|    951|    goto out;
 3012|    951|  }
 3013|       |
 3014|       |  // We are not attached to a frame anymore
 3015|      0|  schunk->frame = NULL;
 3016|      0|  frame_attached = false;
 3017|       |
 3018|      0|  if (nchunks == 0) {
  ------------------
  |  Branch (3018:7): [True: 0, False: 0]
  ------------------
 3019|      0|    frame->schunk = NULL;
 3020|      0|    goto out;
 3021|      0|  }
 3022|       |
 3023|       |  // Get the compressed offsets
 3024|      0|  int32_t coffsets_cbytes = 0;
 3025|      0|  uint8_t* coffsets = get_coffsets(frame, header_len, cbytes, nchunks, &coffsets_cbytes);
 3026|      0|  if (coffsets == NULL) {
  ------------------
  |  Branch (3026:7): [True: 0, False: 0]
  ------------------
 3027|      0|    BLOSC_TRACE_ERROR("Cannot get the offsets for the frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3028|      0|    goto error;
 3029|      0|  }
 3030|       |
 3031|       |  // Decompress offsets
 3032|      0|  blosc2_dparams off_dparams = BLOSC2_DPARAMS_DEFAULTS;
 3033|      0|  blosc2_context *dctx = blosc2_create_dctx(off_dparams);
 3034|      0|  if (dctx == NULL) {
  ------------------
  |  Branch (3034:7): [True: 0, False: 0]
  ------------------
 3035|      0|    BLOSC_TRACE_ERROR("Error while creating the decompression context");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3036|      0|    goto error;
 3037|      0|  }
 3038|      0|  int32_t offsets_nbytes;
 3039|      0|  if (!blosc2_nchunks_to_offsets_nbytes(nchunks, &offsets_nbytes)) {
  ------------------
  |  Branch (3039:7): [True: 0, False: 0]
  ------------------
 3040|      0|    blosc2_free_ctx(dctx);
 3041|      0|    BLOSC_TRACE_ERROR("Too many chunks for offsets representation.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3042|      0|    goto error;
 3043|      0|  }
 3044|      0|  offsets = (int64_t *) malloc((size_t)offsets_nbytes);
 3045|      0|  if (offsets == NULL) {
  ------------------
  |  Branch (3045:7): [True: 0, False: 0]
  ------------------
 3046|      0|    blosc2_free_ctx(dctx);
 3047|      0|    BLOSC_TRACE_ERROR("Cannot allocate memory for offsets.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3048|      0|    goto error;
 3049|      0|  }
 3050|      0|  int32_t off_nbytes = blosc2_decompress_ctx(dctx, coffsets, coffsets_cbytes,
 3051|      0|                                             offsets, offsets_nbytes);
 3052|      0|  blosc2_free_ctx(dctx);
 3053|      0|  if (off_nbytes < 0) {
  ------------------
  |  Branch (3053:7): [True: 0, False: 0]
  ------------------
 3054|      0|    BLOSC_TRACE_ERROR("Cannot decompress the offsets chunk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3055|      0|    goto error;
 3056|      0|  }
 3057|       |
 3058|       |  // We want the contiguous schunk, so create the actual data chunks (and, while doing this,
 3059|       |  // get a guess at the blocksize used in this frame)
 3060|      0|  int64_t acc_nbytes = 0;
 3061|      0|  int64_t acc_cbytes = 0;
 3062|      0|  int32_t blocksize = 0;
 3063|      0|  int32_t chunk_nbytes;
 3064|      0|  int32_t chunk_cbytes;
 3065|      0|  int32_t chunk_blocksize;
 3066|      0|  size_t prev_alloc = BLOSC_EXTENDED_HEADER_LENGTH;
 3067|      0|  uint8_t* data_chunk = NULL;
 3068|      0|  bool needs_free = false;
 3069|      0|  const blosc2_io_cb *io_cb = blosc2_get_io_cb(udio->id);
 3070|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (3070:7): [True: 0, False: 0]
  ------------------
 3071|      0|    blosc2_schunk_free(schunk);
 3072|      0|    BLOSC_TRACE_ERROR("Error getting the input/output API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3073|      0|    return NULL;
 3074|      0|  }
 3075|       |
 3076|      0|  void* fp = NULL;
 3077|      0|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (3077:7): [True: 0, False: 0]
  ------------------
 3078|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (3078:9): [True: 0, False: 0]
  ------------------
 3079|      0|      data_chunk = malloc((size_t)prev_alloc);
 3080|      0|      needs_free = true;
 3081|      0|    }
 3082|      0|    else {
 3083|      0|      needs_free = false;
 3084|      0|    }
 3085|       |
 3086|      0|    if (!frame->sframe) {
  ------------------
  |  Branch (3086:9): [True: 0, False: 0]
  ------------------
 3087|       |      // If not the chunks won't be in the frame
 3088|      0|      fp = frame_reader_acquire(frame, udio);
 3089|      0|      if (fp == NULL) {
  ------------------
  |  Branch (3089:11): [True: 0, False: 0]
  ------------------
 3090|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3091|      0|        rc = BLOSC2_ERROR_FILE_OPEN;
 3092|      0|        goto end;
 3093|      0|      }
 3094|      0|    }
 3095|      0|  }
 3096|      0|  schunk->data = malloc(nchunks * sizeof(void*));
 3097|      0|  for (int64_t i = 0; i < nchunks; i++) {
  ------------------
  |  Branch (3097:23): [True: 0, False: 0]
  ------------------
 3098|      0|    if (frame->cframe != NULL) {
  ------------------
  |  Branch (3098:9): [True: 0, False: 0]
  ------------------
 3099|      0|      if (needs_free) {
  ------------------
  |  Branch (3099:11): [True: 0, False: 0]
  ------------------
 3100|      0|        free(data_chunk);
 3101|      0|      }
 3102|      0|      if (offsets[i] < 0) {
  ------------------
  |  Branch (3102:11): [True: 0, False: 0]
  ------------------
 3103|      0|        int64_t rbytes = frame_get_chunk(frame, i, &data_chunk, &needs_free);
 3104|      0|        if (rbytes < 0) {
  ------------------
  |  Branch (3104:13): [True: 0, False: 0]
  ------------------
 3105|      0|          break;
 3106|      0|        }
 3107|      0|      }
 3108|      0|      else {
 3109|      0|        if (offsets[i] > INT64_MAX - header_len ||
  ------------------
  |  Branch (3109:13): [True: 0, False: 0]
  ------------------
 3110|      0|            header_len + offsets[i] > frame->len - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3110:13): [True: 0, False: 0]
  ------------------
 3111|      0|            offsets[i] > cbytes - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3111:13): [True: 0, False: 0]
  ------------------
 3112|      0|          rc = BLOSC2_ERROR_INVALID_HEADER;
 3113|      0|          break;
 3114|      0|        }
 3115|      0|        data_chunk = frame->cframe + header_len + offsets[i];
 3116|      0|        needs_free = false;
 3117|      0|      }
 3118|      0|      rc = blosc2_cbuffer_sizes(data_chunk, NULL, &chunk_cbytes, NULL);
 3119|      0|      if (rc < 0) {
  ------------------
  |  Branch (3119:11): [True: 0, False: 0]
  ------------------
 3120|      0|        break;
 3121|      0|      }
 3122|      0|      if (offsets[i] >= 0 &&
  ------------------
  |  Branch (3122:11): [True: 0, False: 0]
  ------------------
 3123|      0|          (chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3123:12): [True: 0, False: 0]
  ------------------
 3124|      0|           offsets[i] > INT64_MAX - chunk_cbytes ||
  ------------------
  |  Branch (3124:12): [True: 0, False: 0]
  ------------------
 3125|      0|           offsets[i] + chunk_cbytes > cbytes)) {
  ------------------
  |  Branch (3125:12): [True: 0, False: 0]
  ------------------
 3126|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3127|      0|        break;
 3128|      0|      }
 3129|      0|    }
 3130|      0|    else {
 3131|      0|      int64_t rbytes;
 3132|      0|      if (offsets[i] < 0 || frame->sframe) {
  ------------------
  |  Branch (3132:11): [True: 0, False: 0]
  |  Branch (3132:29): [True: 0, False: 0]
  ------------------
 3133|      0|        if (needs_free) {
  ------------------
  |  Branch (3133:13): [True: 0, False: 0]
  ------------------
 3134|      0|          free(data_chunk);
 3135|      0|        }
 3136|      0|        rbytes = frame_get_chunk(frame, i, &data_chunk, &needs_free);
 3137|      0|        if (rbytes < 0) {
  ------------------
  |  Branch (3137:13): [True: 0, False: 0]
  ------------------
 3138|      0|          break;
 3139|      0|        }
 3140|      0|      }
 3141|      0|      else {
 3142|      0|        if (offsets[i] > INT64_MAX - header_len ||
  ------------------
  |  Branch (3142:13): [True: 0, False: 0]
  ------------------
 3143|      0|            header_len + offsets[i] > frame->len - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3143:13): [True: 0, False: 0]
  ------------------
 3144|      0|            offsets[i] > cbytes - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3144:13): [True: 0, False: 0]
  ------------------
 3145|      0|          rc = BLOSC2_ERROR_INVALID_HEADER;
 3146|      0|          break;
 3147|      0|        }
 3148|      0|        int64_t io_pos = frame->file_offset + header_len + offsets[i];
 3149|      0|        rbytes = io_cb->read((void**)&data_chunk, 1, BLOSC_EXTENDED_HEADER_LENGTH, io_pos, fp);
 3150|      0|      }
 3151|      0|      if (rbytes != BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3151:11): [True: 0, False: 0]
  ------------------
 3152|      0|        rc = BLOSC2_ERROR_READ_BUFFER;
 3153|      0|        break;
 3154|      0|      }
 3155|      0|      rc = blosc2_cbuffer_sizes(data_chunk, NULL, &chunk_cbytes, NULL);
 3156|      0|      if (rc < 0) {
  ------------------
  |  Branch (3156:11): [True: 0, False: 0]
  ------------------
 3157|      0|        break;
 3158|      0|      }
 3159|      0|      if (offsets[i] >= 0 &&
  ------------------
  |  Branch (3159:11): [True: 0, False: 0]
  ------------------
 3160|      0|          (chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3160:12): [True: 0, False: 0]
  ------------------
 3161|      0|           offsets[i] > INT64_MAX - chunk_cbytes ||
  ------------------
  |  Branch (3161:12): [True: 0, False: 0]
  ------------------
 3162|      0|           offsets[i] + chunk_cbytes > cbytes)) {
  ------------------
  |  Branch (3162:12): [True: 0, False: 0]
  ------------------
 3163|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3164|      0|        break;
 3165|      0|      }
 3166|      0|      if (chunk_cbytes > (int32_t)prev_alloc) {
  ------------------
  |  Branch (3166:11): [True: 0, False: 0]
  ------------------
 3167|      0|        if (io_cb->is_allocation_necessary)
  ------------------
  |  Branch (3167:13): [True: 0, False: 0]
  ------------------
 3168|      0|          data_chunk = realloc(data_chunk, chunk_cbytes);
 3169|      0|        if (data_chunk == NULL) {
  ------------------
  |  Branch (3169:13): [True: 0, False: 0]
  ------------------
 3170|      0|          BLOSC_TRACE_ERROR("Cannot realloc space for the data_chunk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3171|      0|          rc = BLOSC2_ERROR_MEMORY_ALLOC;
 3172|      0|          break;
 3173|      0|        }
 3174|      0|        prev_alloc = chunk_cbytes;
 3175|      0|      }
 3176|      0|      if (!frame->sframe) {
  ------------------
  |  Branch (3176:11): [True: 0, False: 0]
  ------------------
 3177|      0|        int64_t io_pos = frame->file_offset + header_len + offsets[i];
 3178|      0|        rbytes = io_cb->read((void**)&data_chunk, 1, chunk_cbytes, io_pos, fp);
 3179|      0|        if (rbytes != chunk_cbytes) {
  ------------------
  |  Branch (3179:13): [True: 0, False: 0]
  ------------------
 3180|      0|          rc = BLOSC2_ERROR_READ_BUFFER;
 3181|      0|          break;
 3182|      0|        }
 3183|      0|      }
 3184|      0|    }
 3185|      0|    uint8_t* new_chunk = malloc(chunk_cbytes);
 3186|      0|    memcpy(new_chunk, data_chunk, chunk_cbytes);
 3187|      0|    schunk->data[i] = new_chunk;
 3188|      0|    rc = blosc2_cbuffer_sizes(data_chunk, &chunk_nbytes, NULL, &chunk_blocksize);
 3189|      0|    if (rc < 0) {
  ------------------
  |  Branch (3189:9): [True: 0, False: 0]
  ------------------
 3190|      0|      break;
 3191|      0|    }
 3192|      0|    acc_nbytes += chunk_nbytes;
 3193|      0|    acc_cbytes += chunk_cbytes;
 3194|      0|    if (i == 0) {
  ------------------
  |  Branch (3194:9): [True: 0, False: 0]
  ------------------
 3195|      0|      blocksize = chunk_blocksize;
 3196|      0|    }
 3197|      0|    else if (blocksize != chunk_blocksize) {
  ------------------
  |  Branch (3197:14): [True: 0, False: 0]
  ------------------
 3198|       |      // Blocksize varies
 3199|      0|      blocksize = 0;
 3200|      0|    }
 3201|      0|  }
 3202|       |
 3203|       |  // We are not attached to a schunk anymore
 3204|      0|  frame->schunk = NULL;
 3205|       |
 3206|      0|  end:
 3207|      0|  if (needs_free) {
  ------------------
  |  Branch (3207:7): [True: 0, False: 0]
  ------------------
 3208|      0|    free(data_chunk);
 3209|      0|  }
 3210|      0|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (3210:7): [True: 0, False: 0]
  ------------------
 3211|      0|    if (!frame->sframe) {
  ------------------
  |  Branch (3211:9): [True: 0, False: 0]
  ------------------
 3212|      0|      frame_reader_release(frame, io_cb, fp);
 3213|      0|    }
 3214|      0|  }
 3215|      0|  free(offsets);
 3216|       |  // Avoid a double-free in the `error:` cleanup below, which is reached
 3217|       |  // when frame_get_metalayers / frame_get_vlmetalayers reject a malformed
 3218|       |  // metalayer index after we've already freed `offsets` here.
 3219|      0|  offsets = NULL;
 3220|       |
 3221|       |  // cframes and sframes have different ways to store chunks with special values:
 3222|       |  // 1) cframes represent special chunks as negative offsets
 3223|       |  // 2) sframes does not have the concept of offsets, but rather of data pointers (.data)
 3224|       |  //    so they always have a pointer to a special chunk
 3225|       |  // This is why cframes and sframes have different cbytes and hence, we cannot enforce acc_bytes == schunk->cbytes
 3226|       |  // In the future, maybe we could provide special meanings for .data[i] > 0x7FFFFFFF, but not there yet
 3227|       |  // if (rc < 0 || acc_nbytes != nbytes || acc_cbytes != cbytes) {
 3228|      0|  if (rc < 0 || acc_nbytes != nbytes) {
  ------------------
  |  Branch (3228:7): [True: 0, False: 0]
  |  Branch (3228:17): [True: 0, False: 0]
  ------------------
 3229|      0|    goto error;
 3230|      0|  }
 3231|       |  // Update counters
 3232|      0|  schunk->cbytes = acc_cbytes;
 3233|      0|  schunk->blocksize = blocksize;
 3234|       |
 3235|    951|  out:
 3236|    951|  rc = frame_get_metalayers(frame, schunk);
 3237|    951|  if (rc < 0) {
  ------------------
  |  Branch (3237:7): [True: 88, False: 863]
  ------------------
 3238|     88|    BLOSC_TRACE_ERROR("Cannot access the metalayers.");
  ------------------
  |  |   93|     88|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     88|    do {                                            \
  |  |  |  |   98|     88|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     88|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 88, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     88|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3239|     88|    goto error;
 3240|     88|  }
 3241|       |
 3242|    863|  rc = frame_get_vlmetalayers(frame, schunk);
 3243|    863|  if (rc < 0) {
  ------------------
  |  Branch (3243:7): [True: 209, False: 654]
  ------------------
 3244|    209|    BLOSC_TRACE_ERROR("Cannot access the vlmetalayers.");
  ------------------
  |  |   93|    209|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    209|    do {                                            \
  |  |  |  |   98|    209|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    209|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 209, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    209|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3245|    209|    goto error;
 3246|    209|  }
 3247|       |
 3248|    654|  return schunk;
 3249|       |
 3250|  11.4k|error:
 3251|  11.4k|  free(cparams);
 3252|  11.4k|  free(dparams);
 3253|  11.4k|  free(offsets);
 3254|  11.4k|  if (schunk != NULL) {
  ------------------
  |  Branch (3254:7): [True: 11.4k, False: 0]
  ------------------
 3255|  11.4k|    blosc2_schunk_free(schunk);
 3256|  11.4k|  }
 3257|  11.4k|  if (!frame_attached) {
  ------------------
  |  Branch (3257:7): [True: 0, False: 11.4k]
  ------------------
 3258|      0|    frame->schunk = NULL;
 3259|      0|    frame_free(frame);
 3260|      0|  }
 3261|       |  return NULL;
 3262|    863|}
get_coffset:
 3284|  47.2k|                int64_t nchunk, int64_t nchunks, int64_t *offset) {
 3285|  47.2k|  int32_t off_cbytes;
 3286|       |  // Get the offset to nchunk
 3287|  47.2k|  uint8_t *coffsets = get_coffsets(frame, header_len, cbytes, nchunks, &off_cbytes);
 3288|  47.2k|  if (coffsets == NULL) {
  ------------------
  |  Branch (3288:7): [True: 0, False: 47.2k]
  ------------------
 3289|      0|    BLOSC_TRACE_ERROR("Cannot get the offset for chunk %" PRId64 " for the frame.", nchunk);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3290|      0|    return BLOSC2_ERROR_DATA;
 3291|      0|  }
 3292|       |
 3293|       |  // Get the 64-bit offset
 3294|  47.2k|  int rc = blosc2_getitem(coffsets, off_cbytes, (int32_t)nchunk, 1, offset, (int32_t)sizeof(int64_t));
 3295|  47.2k|  if (rc < 0) {
  ------------------
  |  Branch (3295:7): [True: 171, False: 47.0k]
  ------------------
 3296|    171|    BLOSC_TRACE_ERROR("Problems retrieving a chunk offset.");
  ------------------
  |  |   93|    171|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    171|    do {                                            \
  |  |  |  |   98|    171|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    171|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 171, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    171|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3297|  47.0k|  } else if (!frame->sframe && *offset >= 0) {
  ------------------
  |  Branch (3297:14): [True: 47.0k, False: 0]
  |  Branch (3297:32): [True: 35.2k, False: 11.7k]
  ------------------
 3298|  35.2k|    if (cbytes < 0 || cbytes > INT64_MAX - header_len) {
  ------------------
  |  Branch (3298:9): [True: 0, False: 35.2k]
  |  Branch (3298:23): [True: 262, False: 34.9k]
  ------------------
 3299|    262|      BLOSC_TRACE_ERROR("Invalid compressed size in frame header.");
  ------------------
  |  |   93|    262|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    262|    do {                                            \
  |  |  |  |   98|    262|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    262|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 262, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    262|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3300|    262|      return BLOSC2_ERROR_INVALID_HEADER;
 3301|    262|    }
 3302|  34.9k|    if (*offset > INT64_MAX - header_len) {
  ------------------
  |  Branch (3302:9): [True: 0, False: 34.9k]
  ------------------
 3303|      0|      BLOSC_TRACE_ERROR("Offset for chunk %" PRId64 " overflows frame position.", nchunk);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3304|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 3305|      0|    }
 3306|  34.9k|    int64_t chunk_pos = header_len + *offset;
 3307|  34.9k|    int64_t data_limit = header_len + cbytes;
 3308|  34.9k|    if (chunk_pos < header_len ||
  ------------------
  |  Branch (3308:9): [True: 0, False: 34.9k]
  ------------------
 3309|  34.9k|        chunk_pos > data_limit - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3309:9): [True: 82, False: 34.8k]
  ------------------
 3310|  34.8k|        chunk_pos > frame->len - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3310:9): [True: 542, False: 34.3k]
  ------------------
 3311|    624|      BLOSC_TRACE_ERROR("Cannot read chunk %" PRId64 " outside of frame boundary.", nchunk);
  ------------------
  |  |   93|    624|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    624|    do {                                            \
  |  |  |  |   98|    624|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    624|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 624, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    624|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3312|    624|      return BLOSC2_ERROR_INVALID_HEADER;
 3313|    624|    }
 3314|  34.9k|  }
 3315|       |
 3316|  46.3k|  return rc;
 3317|  47.2k|}
frame_special_chunk:
 3322|  11.7k|                        uint8_t** chunk, int32_t cbytes, bool *needs_free) {
 3323|  11.7k|  int rc = 0;
 3324|  11.7k|  *chunk = malloc(cbytes);
 3325|  11.7k|  *needs_free = true;
 3326|       |
 3327|       |  // Detect the kind of special value
 3328|  11.7k|  uint64_t zeros_mask = (uint64_t) BLOSC2_SPECIAL_ZERO << (8 * 7);  // chunk of zeros
 3329|  11.7k|  uint64_t nans_mask = (uint64_t) BLOSC2_SPECIAL_NAN << (8 * 7);  // chunk of NaNs
 3330|  11.7k|  uint64_t uninit_mask = (uint64_t) BLOSC2_SPECIAL_UNINIT << (8 * 7);  // chunk of uninit values
 3331|       |
 3332|  11.7k|  blosc2_cparams cparams = BLOSC2_CPARAMS_DEFAULTS;
 3333|  11.7k|  cparams.typesize = typesize;
 3334|  11.7k|  cparams.blocksize = blocksize;
 3335|  11.7k|  if (special_value & zeros_mask) {
  ------------------
  |  Branch (3335:7): [True: 10.6k, False: 1.16k]
  ------------------
 3336|  10.6k|    rc = blosc2_chunk_zeros(cparams, nbytes, *chunk, cbytes);
 3337|  10.6k|    if (rc < 0) {
  ------------------
  |  Branch (3337:9): [True: 14, False: 10.6k]
  ------------------
 3338|     14|      BLOSC_TRACE_ERROR("Error creating a zero chunk");
  ------------------
  |  |   93|     14|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     14|    do {                                            \
  |  |  |  |   98|     14|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     14|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 14, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     14|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3339|     14|    }
 3340|  10.6k|  }
 3341|  1.16k|  else if (special_value & uninit_mask) {
  ------------------
  |  Branch (3341:12): [True: 965, False: 202]
  ------------------
 3342|    965|    rc = blosc2_chunk_uninit(cparams, nbytes, *chunk, cbytes);
 3343|    965|    if (rc < 0) {
  ------------------
  |  Branch (3343:9): [True: 7, False: 958]
  ------------------
 3344|      7|      BLOSC_TRACE_ERROR("Error creating a non initialized chunk");
  ------------------
  |  |   93|      7|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      7|    do {                                            \
  |  |  |  |   98|      7|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      7|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      7|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3345|      7|    }
 3346|    965|  }
 3347|    202|  else if (special_value & nans_mask) {
  ------------------
  |  Branch (3347:12): [True: 179, False: 23]
  ------------------
 3348|    179|    rc = blosc2_chunk_nans(cparams, nbytes, *chunk, cbytes);
 3349|    179|    if (rc < 0) {
  ------------------
  |  Branch (3349:9): [True: 5, False: 174]
  ------------------
 3350|      5|      BLOSC_TRACE_ERROR("Error creating a nan chunk");
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3351|      5|    }
 3352|    179|  }
 3353|     23|  else {
 3354|     23|    BLOSC_TRACE_ERROR("Special value not recognized: %" PRId64 "", special_value);
  ------------------
  |  |   93|     23|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     23|    do {                                            \
  |  |  |  |   98|     23|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     23|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 23, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     23|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3355|     23|    rc = BLOSC2_ERROR_DATA;
 3356|     23|  }
 3357|       |
 3358|  11.7k|  if (rc < 0) {
  ------------------
  |  Branch (3358:7): [True: 49, False: 11.7k]
  ------------------
 3359|     49|    free(*chunk);
 3360|     49|    *needs_free = false;
 3361|     49|    *chunk = NULL;
 3362|     49|  }
 3363|       |
 3364|  11.7k|  return rc;
 3365|  11.7k|}
frame_get_chunk:
 3378|  45.5k|int frame_get_chunk(blosc2_frame_s *frame, int64_t nchunk, uint8_t **chunk, bool *needs_free) {
 3379|  45.5k|  int32_t header_len;
 3380|  45.5k|  int64_t frame_len;
 3381|  45.5k|  int64_t nbytes;
 3382|  45.5k|  int64_t cbytes;
 3383|  45.5k|  int32_t blocksize;
 3384|  45.5k|  int32_t chunksize;
 3385|  45.5k|  int64_t nchunks;
 3386|  45.5k|  int32_t typesize;
 3387|  45.5k|  int64_t offset;
 3388|  45.5k|  int32_t chunk_cbytes;
 3389|  45.5k|  int rc;
 3390|       |
 3391|  45.5k|  *chunk = NULL;
 3392|  45.5k|  *needs_free = false;
 3393|  45.5k|  rc = get_header_info(frame, &header_len, &frame_len, &nbytes, &cbytes,
 3394|  45.5k|                       &blocksize, &chunksize, &nchunks,
 3395|  45.5k|                       &typesize, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 3396|  45.5k|                       frame->schunk->storage->io);
 3397|  45.5k|  if (rc < 0) {
  ------------------
  |  Branch (3397:7): [True: 0, False: 45.5k]
  ------------------
 3398|      0|    BLOSC_TRACE_ERROR("Unable to get meta info from frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3399|      0|    return rc;
 3400|      0|  }
 3401|  45.5k|  rc = frame_refresh_if_stale(frame, frame_len);
 3402|  45.5k|  if (rc < 0) {
  ------------------
  |  Branch (3402:7): [True: 0, False: 45.5k]
  ------------------
 3403|      0|    BLOSC_TRACE_ERROR("Unable to refresh the frame state from disk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3404|      0|    return rc;
 3405|      0|  }
 3406|  45.5k|  if (rc > 0) {
  ------------------
  |  Branch (3406:7): [True: 0, False: 45.5k]
  ------------------
 3407|       |    // Keep the schunk-level counters in sync with the refreshed on-disk state.
 3408|       |    // Mutating ops (update/delete) read a chunk before adjusting the counters,
 3409|       |    // so this also gives them a fresh base to apply their deltas on.
 3410|      0|    frame->schunk->nbytes = nbytes;
 3411|      0|    frame->schunk->cbytes = cbytes;
 3412|      0|    frame->schunk->nchunks = nchunks;
 3413|      0|  }
 3414|       |
 3415|  45.5k|  if ((nchunks > 0) && (nchunk >= nchunks)) {
  ------------------
  |  Branch (3415:7): [True: 45.5k, False: 0]
  |  Branch (3415:24): [True: 0, False: 45.5k]
  ------------------
 3416|      0|    BLOSC_TRACE_ERROR("nchunk ('%" PRId64 "') exceeds the number of chunks "
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3417|      0|                    "('%" PRId64 "') in frame.", nchunk, nchunks);
 3418|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 3419|      0|  }
 3420|       |
 3421|       |  // Get the offset to nchunk
 3422|  45.5k|  rc = get_coffset(frame, header_len, cbytes, nchunk, nchunks, &offset);
 3423|  45.5k|  if (rc < 0) {
  ------------------
  |  Branch (3423:7): [True: 199, False: 45.3k]
  ------------------
 3424|    199|    BLOSC_TRACE_ERROR("Unable to get offset to chunk %" PRId64 ".", nchunk);
  ------------------
  |  |   93|    199|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    199|    do {                                            \
  |  |  |  |   98|    199|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    199|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 199, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    199|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3425|    199|    return rc;
 3426|    199|  }
 3427|       |
 3428|  45.3k|  if (offset < 0) {
  ------------------
  |  Branch (3428:7): [True: 11.2k, False: 34.0k]
  ------------------
 3429|       |    // Special value
 3430|  11.2k|    chunk_cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 3431|  11.2k|    int32_t chunksize_ = chunksize;
 3432|  11.2k|    if ((nchunk == nchunks - 1) && (nbytes % chunksize)) {
  ------------------
  |  Branch (3432:9): [True: 0, False: 11.2k]
  |  Branch (3432:36): [True: 0, False: 0]
  ------------------
 3433|       |      // Last chunk is incomplete.  Compute its actual size.
 3434|      0|      chunksize_ = (int32_t) (nbytes % chunksize);
 3435|      0|    }
 3436|  11.2k|    rc = frame_special_chunk(offset, chunksize_, typesize, blocksize, chunk, chunk_cbytes, needs_free);
 3437|  11.2k|    if (rc < 0) {
  ------------------
  |  Branch (3437:9): [True: 16, False: 11.2k]
  ------------------
 3438|     16|      return rc;
 3439|     16|    }
 3440|  11.2k|    goto end;
 3441|  11.2k|  }
 3442|       |
 3443|  34.0k|  if (frame->sframe) {
  ------------------
  |  Branch (3443:7): [True: 0, False: 34.0k]
  ------------------
 3444|       |    // Sparse on-disk
 3445|      0|    nchunk = offset;
 3446|      0|    return sframe_get_chunk(frame, nchunk, chunk, needs_free);
 3447|      0|  }
 3448|       |
 3449|  34.0k|  blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 3450|  34.0k|  if (io_cb == NULL) {
  ------------------
  |  Branch (3450:7): [True: 0, False: 34.0k]
  ------------------
 3451|      0|    BLOSC_TRACE_ERROR("Error getting the input/output API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3452|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 3453|      0|  }
 3454|       |
 3455|  34.0k|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (3455:7): [True: 0, False: 34.0k]
  ------------------
 3456|      0|    uint8_t* header_ptr;
 3457|      0|    uint8_t header[BLOSC_EXTENDED_HEADER_LENGTH];
 3458|      0|    void* fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 3459|      0|    if (fp == NULL) {
  ------------------
  |  Branch (3459:9): [True: 0, False: 0]
  ------------------
 3460|      0|      BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3461|      0|      return BLOSC2_ERROR_FILE_OPEN;
 3462|      0|    }
 3463|      0|    if (io_cb->is_allocation_necessary)
  ------------------
  |  Branch (3463:9): [True: 0, False: 0]
  ------------------
 3464|      0|      header_ptr = header;
 3465|      0|    int64_t io_pos = frame->file_offset + header_len + offset;
 3466|      0|    int64_t rbytes = io_cb->read((void**)&header_ptr, 1, sizeof(header), io_pos, fp);
 3467|      0|    if (rbytes != BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3467:9): [True: 0, False: 0]
  ------------------
 3468|      0|      BLOSC_TRACE_ERROR("Cannot read the cbytes for chunk in the frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3469|      0|      frame_reader_release(frame, io_cb, fp);
 3470|      0|      return BLOSC2_ERROR_FILE_READ;
 3471|      0|    }
 3472|      0|    rc = blosc2_cbuffer_sizes(header_ptr, NULL, &chunk_cbytes, NULL);
 3473|      0|    if (rc < 0) {
  ------------------
  |  Branch (3473:9): [True: 0, False: 0]
  ------------------
 3474|      0|      BLOSC_TRACE_ERROR("Cannot read the cbytes for chunk in the frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3475|      0|      frame_reader_release(frame, io_cb, fp);
 3476|      0|      return rc;
 3477|      0|    }
 3478|      0|    if (chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3478:9): [True: 0, False: 0]
  ------------------
 3479|      0|        offset > INT64_MAX - chunk_cbytes ||
  ------------------
  |  Branch (3479:9): [True: 0, False: 0]
  ------------------
 3480|      0|        offset + chunk_cbytes > cbytes) {
  ------------------
  |  Branch (3480:9): [True: 0, False: 0]
  ------------------
 3481|      0|      BLOSC_TRACE_ERROR("Invalid chunk size in frame for chunk %" PRId64 ".", nchunk);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3482|      0|      frame_reader_release(frame, io_cb, fp);
 3483|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 3484|      0|    }
 3485|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (3485:9): [True: 0, False: 0]
  ------------------
 3486|      0|      *chunk = malloc(chunk_cbytes);
 3487|      0|      *needs_free = true;
 3488|      0|    }
 3489|      0|    else {
 3490|      0|      *needs_free = false;
 3491|      0|    }
 3492|       |
 3493|      0|    io_pos = frame->file_offset + header_len + offset;
 3494|      0|    rbytes = io_cb->read((void**)chunk, 1, chunk_cbytes, io_pos, fp);
 3495|      0|    frame_reader_release(frame, io_cb, fp);
 3496|      0|    if (rbytes != chunk_cbytes) {
  ------------------
  |  Branch (3496:9): [True: 0, False: 0]
  ------------------
 3497|      0|      BLOSC_TRACE_ERROR("Cannot read the chunk out of the frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3498|      0|      return BLOSC2_ERROR_FILE_READ;
 3499|      0|    }
 3500|       |
 3501|  34.0k|  } else {
 3502|       |    // The chunk is in memory and just one pointer away
 3503|  34.0k|    *chunk = frame->cframe + header_len + offset;
 3504|  34.0k|    rc = blosc2_cbuffer_sizes(*chunk, NULL, &chunk_cbytes, NULL);
 3505|  34.0k|    if (rc < 0) {
  ------------------
  |  Branch (3505:9): [True: 9, False: 34.0k]
  ------------------
 3506|      9|      return rc;
 3507|      9|    }
 3508|  34.0k|    if (chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3508:9): [True: 1, False: 34.0k]
  ------------------
 3509|  34.0k|        offset > INT64_MAX - chunk_cbytes ||
  ------------------
  |  Branch (3509:9): [True: 0, False: 34.0k]
  ------------------
 3510|  34.0k|        offset + chunk_cbytes > cbytes) {
  ------------------
  |  Branch (3510:9): [True: 44, False: 33.9k]
  ------------------
 3511|     45|      BLOSC_TRACE_ERROR("Invalid chunk size in frame for chunk %" PRId64 ".", nchunk);
  ------------------
  |  |   93|     45|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     45|    do {                                            \
  |  |  |  |   98|     45|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     45|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 45, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     45|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3512|     45|      return BLOSC2_ERROR_INVALID_HEADER;
 3513|     45|    }
 3514|  34.0k|  }
 3515|       |
 3516|  45.2k|  end:
 3517|  45.2k|  return (int32_t)chunk_cbytes;
 3518|  34.0k|}
frame_get_lazychunk:
 3531|  1.67k|int frame_get_lazychunk(blosc2_frame_s *frame, int64_t nchunk, uint8_t **chunk, bool *needs_free) {
 3532|  1.67k|  int32_t header_len;
 3533|  1.67k|  int64_t frame_len;
 3534|  1.67k|  int64_t nbytes;
 3535|  1.67k|  int64_t cbytes;
 3536|  1.67k|  int32_t blocksize;
 3537|  1.67k|  int32_t chunksize;
 3538|  1.67k|  int64_t nchunks;
 3539|  1.67k|  int32_t typesize;
 3540|  1.67k|  int32_t lazychunk_cbytes;
 3541|  1.67k|  int64_t offset;
 3542|  1.67k|  void* fp = NULL;
 3543|  1.67k|  int32_t* block_csizes = NULL;
 3544|  1.67k|  struct csize_idx *csize_idx = NULL;
 3545|       |
 3546|  1.67k|  *chunk = NULL;
 3547|  1.67k|  *needs_free = false;
 3548|  1.67k|  int rc = get_header_info(frame, &header_len, &frame_len, &nbytes, &cbytes,
 3549|  1.67k|                           &blocksize, &chunksize, &nchunks,
 3550|  1.67k|                           &typesize, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 3551|  1.67k|                           frame->schunk->storage->io);
 3552|  1.67k|  if (rc < 0) {
  ------------------
  |  Branch (3552:7): [True: 0, False: 1.67k]
  ------------------
 3553|      0|    BLOSC_TRACE_ERROR("Unable to get meta info from frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3554|      0|    return rc;
 3555|      0|  }
 3556|  1.67k|  rc = frame_refresh_if_stale(frame, frame_len);
 3557|  1.67k|  if (rc < 0) {
  ------------------
  |  Branch (3557:7): [True: 0, False: 1.67k]
  ------------------
 3558|      0|    BLOSC_TRACE_ERROR("Unable to refresh the frame state from disk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3559|      0|    return rc;
 3560|      0|  }
 3561|  1.67k|  if (rc > 0) {
  ------------------
  |  Branch (3561:7): [True: 0, False: 1.67k]
  ------------------
 3562|       |    // Keep the schunk-level counters in sync with the refreshed on-disk state
 3563|       |    // (see frame_get_chunk).
 3564|      0|    frame->schunk->nbytes = nbytes;
 3565|      0|    frame->schunk->cbytes = cbytes;
 3566|      0|    frame->schunk->nchunks = nchunks;
 3567|      0|  }
 3568|       |
 3569|  1.67k|  if (nchunk >= nchunks) {
  ------------------
  |  Branch (3569:7): [True: 0, False: 1.67k]
  ------------------
 3570|      0|    BLOSC_TRACE_ERROR("nchunk ('%" PRId64 "') exceeds the number of chunks "
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3571|      0|                      "('%" PRId64 "') in frame.", nchunk, nchunks);
 3572|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 3573|      0|  }
 3574|       |
 3575|       |  // Get the offset to nchunk
 3576|  1.67k|  rc = get_coffset(frame, header_len, cbytes, nchunk, nchunks, &offset);
 3577|  1.67k|  if (rc < 0) {
  ------------------
  |  Branch (3577:7): [True: 858, False: 821]
  ------------------
 3578|    858|    BLOSC_TRACE_ERROR("Unable to get offset to chunk %" PRId64 ".", nchunk);
  ------------------
  |  |   93|    858|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    858|    do {                                            \
  |  |  |  |   98|    858|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    858|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 858, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    858|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3579|    858|    return rc;
 3580|    858|  }
 3581|       |
 3582|    821|  if (offset < 0) {
  ------------------
  |  Branch (3582:7): [True: 506, False: 315]
  ------------------
 3583|       |    // Special value
 3584|    506|    lazychunk_cbytes = BLOSC_EXTENDED_HEADER_LENGTH;
 3585|    506|    int32_t chunksize_ = chunksize;
 3586|    506|    if ((nchunk == nchunks - 1) && (nbytes % chunksize)) {
  ------------------
  |  Branch (3586:9): [True: 1, False: 505]
  |  Branch (3586:36): [True: 1, False: 0]
  ------------------
 3587|       |      // Last chunk is incomplete.  Compute its actual size.
 3588|      1|      chunksize_ = (int32_t) (nbytes % chunksize);
 3589|      1|    }
 3590|    506|    rc = frame_special_chunk(offset, chunksize_, typesize, blocksize, chunk,
 3591|    506|                             (int32_t)lazychunk_cbytes, needs_free);
 3592|    506|    goto end;
 3593|    506|  }
 3594|       |
 3595|    315|  blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 3596|    315|  if (io_cb == NULL) {
  ------------------
  |  Branch (3596:7): [True: 0, False: 315]
  ------------------
 3597|      0|    BLOSC_TRACE_ERROR("Error getting the input/output API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3598|      0|    rc = BLOSC2_ERROR_PLUGIN_IO;
 3599|      0|    goto end;
 3600|      0|  }
 3601|       |
 3602|    315|  if (frame->cframe == NULL) {
  ------------------
  |  Branch (3602:7): [True: 0, False: 315]
  ------------------
 3603|       |    // TODO: make this portable across different endianness
 3604|       |    // Get info for building a lazy chunk
 3605|      0|    int32_t chunk_nbytes;
 3606|      0|    int32_t chunk_cbytes;
 3607|      0|    int32_t chunk_blocksize;
 3608|      0|    uint8_t* header_ptr;
 3609|      0|    uint8_t header[BLOSC_EXTENDED_HEADER_LENGTH];
 3610|      0|    int64_t io_pos = 0;
 3611|      0|    if (frame->sframe) {
  ------------------
  |  Branch (3611:9): [True: 0, False: 0]
  ------------------
 3612|       |      // The chunk is not in the frame
 3613|      0|      fp = sframe_open_chunk(frame->urlpath, offset, "rb",
 3614|      0|                             frame->schunk->storage->io);
 3615|      0|      if (fp == NULL) {
  ------------------
  |  Branch (3615:11): [True: 0, False: 0]
  ------------------
 3616|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3617|      0|        return BLOSC2_ERROR_FILE_OPEN;
 3618|      0|      }
 3619|      0|    }
 3620|      0|    else {
 3621|      0|      fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 3622|      0|      if (fp == NULL) {
  ------------------
  |  Branch (3622:11): [True: 0, False: 0]
  ------------------
 3623|      0|        BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3624|      0|        return BLOSC2_ERROR_FILE_OPEN;
 3625|      0|      }
 3626|      0|      io_pos = frame->file_offset + header_len + offset;
 3627|      0|    }
 3628|      0|    if (io_cb->is_allocation_necessary)
  ------------------
  |  Branch (3628:9): [True: 0, False: 0]
  ------------------
 3629|      0|      header_ptr = header;
 3630|      0|    int64_t rbytes = io_cb->read((void**)&header_ptr, 1, BLOSC_EXTENDED_HEADER_LENGTH, io_pos, fp);
 3631|      0|    if (rbytes != BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3631:9): [True: 0, False: 0]
  ------------------
 3632|      0|      BLOSC_TRACE_ERROR("Cannot read the header for chunk in the frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3633|      0|      rc = BLOSC2_ERROR_FILE_READ;
 3634|      0|      goto end;
 3635|      0|    }
 3636|      0|    rc = blosc2_cbuffer_sizes(header_ptr, &chunk_nbytes, &chunk_cbytes, &chunk_blocksize);
 3637|      0|    if (rc < 0) {
  ------------------
  |  Branch (3637:9): [True: 0, False: 0]
  ------------------
 3638|      0|      goto end;
 3639|      0|    }
 3640|      0|    if (chunk_nbytes < 0 || chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH || chunk_blocksize <= 0) {
  ------------------
  |  Branch (3640:9): [True: 0, False: 0]
  |  Branch (3640:29): [True: 0, False: 0]
  |  Branch (3640:76): [True: 0, False: 0]
  ------------------
 3641|      0|      rc = BLOSC2_ERROR_INVALID_HEADER;
 3642|      0|      goto end;
 3643|      0|    }
 3644|      0|    bool vlblocks = (header_ptr[BLOSC2_CHUNK_BLOSC2_FLAGS2] & BLOSC2_VL_BLOCKS) != 0;
 3645|      0|    size_t nblocks;
 3646|      0|    size_t leftover_block = 0;
 3647|      0|    if (vlblocks) {
  ------------------
  |  Branch (3647:9): [True: 0, False: 0]
  ------------------
 3648|      0|      nblocks = (size_t)chunk_blocksize;
 3649|      0|    }
 3650|      0|    else {
 3651|      0|      nblocks = (size_t)chunk_nbytes / (size_t)chunk_blocksize;
 3652|      0|      leftover_block = (size_t)chunk_nbytes % (size_t)chunk_blocksize;
 3653|      0|      if (leftover_block) {
  ------------------
  |  Branch (3653:11): [True: 0, False: 0]
  ------------------
 3654|      0|        if (nblocks == SIZE_MAX) {
  ------------------
  |  Branch (3654:13): [True: 0, False: 0]
  ------------------
 3655|      0|          rc = BLOSC2_ERROR_INVALID_HEADER;
 3656|      0|          goto end;
 3657|      0|        }
 3658|      0|        nblocks += 1;
 3659|      0|      }
 3660|      0|    }
 3661|      0|    if (nblocks == 0 || nblocks > (size_t)INT_MAX) {
  ------------------
  |  Branch (3661:9): [True: 0, False: 0]
  |  Branch (3661:25): [True: 0, False: 0]
  ------------------
 3662|      0|      rc = BLOSC2_ERROR_INVALID_HEADER;
 3663|      0|      goto end;
 3664|      0|    }
 3665|       |    // Allocate space for the lazy chunk
 3666|      0|    int32_t special_type = (header_ptr[BLOSC2_CHUNK_BLOSC2_FLAGS] >> 4) & BLOSC2_SPECIAL_MASK;
 3667|      0|    int memcpyed = header_ptr[BLOSC2_CHUNK_FLAGS] & (uint8_t) BLOSC_MEMCPYED;
 3668|       |
 3669|      0|    int32_t trailer_offset;
 3670|      0|    size_t streams_offset = BLOSC_EXTENDED_HEADER_LENGTH;
 3671|      0|    size_t trailer_offset_sz = BLOSC_EXTENDED_HEADER_LENGTH;
 3672|      0|    size_t trailer_len_sz = 0;
 3673|      0|    size_t lazychunk_cbytes_sz = 0;
 3674|      0|    size_t bstarts_nbytes = 0;
 3675|      0|    if (special_type == 0) {
  ------------------
  |  Branch (3675:9): [True: 0, False: 0]
  ------------------
 3676|      0|      if (nblocks > SIZE_MAX / sizeof(int32_t)) {
  ------------------
  |  Branch (3676:11): [True: 0, False: 0]
  ------------------
 3677|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3678|      0|        goto end;
 3679|      0|      }
 3680|      0|      bstarts_nbytes = nblocks * sizeof(int32_t);
 3681|       |
 3682|      0|      if (!memcpyed) {
  ------------------
  |  Branch (3682:11): [True: 0, False: 0]
  ------------------
 3683|      0|        if ((size_t)chunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3683:13): [True: 0, False: 0]
  ------------------
 3684|      0|            bstarts_nbytes > (size_t)chunk_cbytes - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (3684:13): [True: 0, False: 0]
  ------------------
 3685|      0|          rc = BLOSC2_ERROR_INVALID_HEADER;
 3686|      0|          goto end;
 3687|      0|        }
 3688|      0|      }
 3689|       |
 3690|      0|      if (bstarts_nbytes > SIZE_MAX - trailer_offset_sz) {
  ------------------
  |  Branch (3690:11): [True: 0, False: 0]
  ------------------
 3691|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3692|      0|        goto end;
 3693|      0|      }
 3694|      0|      trailer_offset_sz += bstarts_nbytes;
 3695|       |      // Regular values have offsets for blocks
 3696|      0|      if (!memcpyed) {
  ------------------
  |  Branch (3696:11): [True: 0, False: 0]
  ------------------
 3697|      0|        if (bstarts_nbytes > SIZE_MAX - streams_offset) {
  ------------------
  |  Branch (3697:13): [True: 0, False: 0]
  ------------------
 3698|      0|          rc = BLOSC2_ERROR_INVALID_HEADER;
 3699|      0|          goto end;
 3700|      0|        }
 3701|      0|        streams_offset += bstarts_nbytes;
 3702|      0|      }
 3703|       |
 3704|      0|      if (bstarts_nbytes > SIZE_MAX - (sizeof(int32_t) + sizeof(int64_t))) {
  ------------------
  |  Branch (3704:11): [True: 0, False: 0]
  ------------------
 3705|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3706|      0|        goto end;
 3707|      0|      }
 3708|      0|      trailer_len_sz = sizeof(int32_t) + sizeof(int64_t) + bstarts_nbytes;
 3709|      0|      if (trailer_len_sz > SIZE_MAX - trailer_offset_sz) {
  ------------------
  |  Branch (3709:11): [True: 0, False: 0]
  ------------------
 3710|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3711|      0|        goto end;
 3712|      0|      }
 3713|      0|      lazychunk_cbytes_sz = trailer_offset_sz + trailer_len_sz;
 3714|      0|    }
 3715|      0|    else if (special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (3715:14): [True: 0, False: 0]
  ------------------
 3716|      0|      if (typesize <= 0) {
  ------------------
  |  Branch (3716:11): [True: 0, False: 0]
  ------------------
 3717|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3718|      0|        goto end;
 3719|      0|      }
 3720|      0|      if ((size_t)typesize > SIZE_MAX - trailer_offset_sz ||
  ------------------
  |  Branch (3720:11): [True: 0, False: 0]
  ------------------
 3721|      0|          (size_t)typesize > SIZE_MAX - streams_offset) {
  ------------------
  |  Branch (3721:11): [True: 0, False: 0]
  ------------------
 3722|      0|        rc = BLOSC2_ERROR_INVALID_HEADER;
 3723|      0|        goto end;
 3724|      0|      }
 3725|      0|      trailer_offset_sz += (size_t)typesize;
 3726|      0|      streams_offset += (size_t)typesize;
 3727|      0|      lazychunk_cbytes_sz = trailer_offset_sz;
 3728|      0|    }
 3729|      0|    else {
 3730|      0|      rc = BLOSC2_ERROR_INVALID_HEADER;
 3731|      0|      goto end;
 3732|      0|    }
 3733|       |
 3734|      0|    if (streams_offset > (size_t)chunk_cbytes ||
  ------------------
  |  Branch (3734:9): [True: 0, False: 0]
  ------------------
 3735|      0|        trailer_offset_sz > INT32_MAX ||
  ------------------
  |  Branch (3735:9): [True: 0, False: 0]
  ------------------
 3736|      0|        trailer_len_sz > INT32_MAX ||
  ------------------
  |  Branch (3736:9): [True: 0, False: 0]
  ------------------
 3737|      0|        lazychunk_cbytes_sz > INT32_MAX) {
  ------------------
  |  Branch (3737:9): [True: 0, False: 0]
  ------------------
 3738|      0|      rc = BLOSC2_ERROR_INVALID_HEADER;
 3739|      0|      goto end;
 3740|      0|    }
 3741|       |
 3742|      0|    trailer_offset = (int32_t)trailer_offset_sz;
 3743|      0|    lazychunk_cbytes = (int32_t)lazychunk_cbytes_sz;
 3744|       |
 3745|       |    // Read just the full header and bstarts section too (lazy partial length)
 3746|      0|    if (frame->sframe) {
  ------------------
  |  Branch (3746:9): [True: 0, False: 0]
  ------------------
 3747|      0|      io_pos = 0;
 3748|      0|    }
 3749|      0|    else {
 3750|      0|      io_pos = frame->file_offset + header_len + offset;
 3751|      0|    }
 3752|       |
 3753|       |    // The case here is a bit special because more memory is allocated than read from the file
 3754|       |    // and the chunk is modified after reading. Due to the modification, we cannot directly use
 3755|       |    // the memory provided by the io
 3756|      0|    *chunk = malloc((size_t)lazychunk_cbytes);
 3757|      0|    if (*chunk == NULL) {
  ------------------
  |  Branch (3757:9): [True: 0, False: 0]
  ------------------
 3758|      0|      rc = BLOSC2_ERROR_MEMORY_ALLOC;
 3759|      0|      goto end;
 3760|      0|    }
 3761|      0|    *needs_free = true;
 3762|       |
 3763|      0|    if (io_cb->is_allocation_necessary) {
  ------------------
  |  Branch (3763:9): [True: 0, False: 0]
  ------------------
 3764|      0|      rbytes = io_cb->read((void**)chunk, 1, (int64_t)streams_offset, io_pos, fp);
 3765|      0|    }
 3766|      0|    else {
 3767|      0|      uint8_t* chunk_ptr;
 3768|      0|      rbytes = io_cb->read((void**)&chunk_ptr, 1, (int64_t)streams_offset, io_pos, fp);
 3769|      0|      memcpy(*chunk, chunk_ptr, streams_offset);
 3770|      0|    }
 3771|       |
 3772|      0|    if (rbytes != (int64_t)streams_offset) {
  ------------------
  |  Branch (3772:9): [True: 0, False: 0]
  ------------------
 3773|      0|      BLOSC_TRACE_ERROR("Cannot read the (lazy) chunk out of the frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3774|      0|      rc = BLOSC2_ERROR_FILE_READ;
 3775|      0|      goto end;
 3776|      0|    }
 3777|      0|    if (special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (3777:9): [True: 0, False: 0]
  ------------------
 3778|       |      // Value runlen is not returning a lazy chunk.  We are done.
 3779|      0|      goto end;
 3780|      0|    }
 3781|       |
 3782|       |    // Mark chunk as lazy
 3783|      0|    uint8_t* blosc2_flags = *chunk + BLOSC2_CHUNK_BLOSC2_FLAGS;
 3784|      0|    *blosc2_flags |= 0x08U;
 3785|       |
 3786|       |    // Add the trailer (currently, nchunk + offset + block_csizes)
 3787|      0|    if (frame->sframe) {
  ------------------
  |  Branch (3787:9): [True: 0, False: 0]
  ------------------
 3788|      0|      *(int32_t*)(*chunk + trailer_offset) = (int32_t)offset;   // offset is nchunk for sframes
 3789|      0|      *(int64_t*)(*chunk + trailer_offset + sizeof(int32_t)) = offset;
 3790|      0|    }
 3791|      0|    else {
 3792|      0|      *(int32_t*)(*chunk + trailer_offset) = (int32_t)nchunk;
 3793|      0|      *(int64_t*)(*chunk + trailer_offset + sizeof(int32_t)) = header_len + offset;
 3794|      0|    }
 3795|       |
 3796|      0|    block_csizes = malloc(nblocks * sizeof(int32_t));
 3797|      0|    if (block_csizes == NULL) {
  ------------------
  |  Branch (3797:9): [True: 0, False: 0]
  ------------------
 3798|      0|      rc = BLOSC2_ERROR_MEMORY_ALLOC;
 3799|      0|      goto end;
 3800|      0|    }
 3801|       |
 3802|      0|    if (memcpyed) {
  ------------------
  |  Branch (3802:9): [True: 0, False: 0]
  ------------------
 3803|       |      // When memcpyed the blocksizes are trivial to compute
 3804|      0|      for (size_t i = 0; i + 1 < nblocks; i++) {
  ------------------
  |  Branch (3804:26): [True: 0, False: 0]
  ------------------
 3805|      0|        block_csizes[i] = (int)chunk_blocksize;
 3806|      0|      }
 3807|       |      // The last block could be incomplete, mainly due to the fact that the block size is not divisible
 3808|       |      // by the typesize
 3809|      0|      block_csizes[nblocks - 1] = (int32_t)leftover_block ? (int32_t)leftover_block : chunk_blocksize;
  ------------------
  |  Branch (3809:35): [True: 0, False: 0]
  ------------------
 3810|      0|    }
 3811|      0|    else {
 3812|       |      // In regular, compressed chunks, we need to sort the bstarts (they can be out
 3813|       |      // of order because of multi-threading), and get a reverse index too.
 3814|      0|      memcpy(block_csizes, *chunk + BLOSC_EXTENDED_HEADER_LENGTH, nblocks * sizeof(int32_t));
 3815|       |      // Helper structure to keep track of original indexes
 3816|      0|      csize_idx = malloc(nblocks * sizeof(struct csize_idx));
 3817|      0|      if (csize_idx == NULL) {
  ------------------
  |  Branch (3817:11): [True: 0, False: 0]
  ------------------
 3818|      0|        rc = BLOSC2_ERROR_MEMORY_ALLOC;
 3819|      0|        goto end;
 3820|      0|      }
 3821|      0|      for (size_t n = 0; n < nblocks; n++) {
  ------------------
  |  Branch (3821:26): [True: 0, False: 0]
  ------------------
 3822|      0|        csize_idx[n].val = block_csizes[n];
 3823|      0|        csize_idx[n].idx = (int)n;
 3824|      0|      }
 3825|      0|      qsort(csize_idx, nblocks, sizeof(struct csize_idx), &sort_offset);
 3826|       |      // Compute the actual csizes
 3827|      0|      int idx;
 3828|      0|      for (size_t n = 0; n + 1 < nblocks; n++) {
  ------------------
  |  Branch (3828:26): [True: 0, False: 0]
  ------------------
 3829|      0|        idx = csize_idx[n].idx;
 3830|      0|        block_csizes[idx] = csize_idx[n + 1].val - csize_idx[n].val;
 3831|      0|      }
 3832|      0|      idx = csize_idx[nblocks - 1].idx;
 3833|      0|      block_csizes[idx] = chunk_cbytes - csize_idx[nblocks - 1].val;
 3834|      0|      free(csize_idx);
 3835|      0|      csize_idx = NULL;
 3836|      0|    }
 3837|       |    // Copy the csizes at the end of the trailer
 3838|      0|    void *trailer_csizes = *chunk + lazychunk_cbytes - nblocks * sizeof(int32_t);
 3839|      0|    memcpy(trailer_csizes, block_csizes, nblocks * sizeof(int32_t));
 3840|      0|    free(block_csizes);
 3841|      0|    block_csizes = NULL;
 3842|    315|  } else {
 3843|       |    // The chunk is in memory and just one pointer away
 3844|    315|    int64_t chunk_header_offset = header_len + offset;
 3845|    315|    int64_t chunk_cbytes_offset = chunk_header_offset + BLOSC_MIN_HEADER_LENGTH;
 3846|       |
 3847|    315|    *chunk = frame->cframe + chunk_header_offset;
 3848|       |
 3849|    315|    if (chunk_header_offset < 0 ||
  ------------------
  |  Branch (3849:9): [True: 0, False: 315]
  ------------------
 3850|    315|        chunk_cbytes_offset < chunk_header_offset ||
  ------------------
  |  Branch (3850:9): [True: 0, False: 315]
  ------------------
 3851|    315|        chunk_cbytes_offset > frame->len) {
  ------------------
  |  Branch (3851:9): [True: 0, False: 315]
  ------------------
 3852|      0|      BLOSC_TRACE_ERROR("Cannot read the header for chunk in the (contiguous) frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3853|      0|      rc = BLOSC2_ERROR_READ_BUFFER;
 3854|    315|    } else {
 3855|    315|      rc = blosc2_cbuffer_sizes(*chunk, NULL, &lazychunk_cbytes, NULL);
 3856|    315|      if (rc < 0) {
  ------------------
  |  Branch (3856:11): [True: 0, False: 315]
  ------------------
 3857|      0|        BLOSC_TRACE_ERROR("Cannot read the chunk header.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3858|      0|        rc = BLOSC2_ERROR_READ_BUFFER;
 3859|      0|      }
 3860|    315|      else if (lazychunk_cbytes < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3860:16): [True: 1, False: 314]
  ------------------
 3861|    314|               chunk_header_offset > INT64_MAX - lazychunk_cbytes ||
  ------------------
  |  Branch (3861:16): [True: 0, False: 314]
  ------------------
 3862|    314|               chunk_header_offset + lazychunk_cbytes > frame_len) {
  ------------------
  |  Branch (3862:16): [True: 7, False: 307]
  ------------------
 3863|      8|        BLOSC_TRACE_ERROR("Compressed bytes exceed beyond frame length.");
  ------------------
  |  |   93|      8|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      8|    do {                                            \
  |  |  |  |   98|      8|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      8|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      8|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3864|      8|        rc = BLOSC2_ERROR_READ_BUFFER;
 3865|      8|      }
 3866|    315|    }
 3867|    315|  }
 3868|       |
 3869|    821|  end:
 3870|    821|  if (csize_idx != NULL) {
  ------------------
  |  Branch (3870:7): [True: 0, False: 821]
  ------------------
 3871|      0|    free(csize_idx);
 3872|      0|  }
 3873|    821|  if (block_csizes != NULL) {
  ------------------
  |  Branch (3873:7): [True: 0, False: 821]
  ------------------
 3874|      0|    free(block_csizes);
 3875|      0|  }
 3876|    821|  if (fp != NULL) {
  ------------------
  |  Branch (3876:7): [True: 0, False: 821]
  ------------------
 3877|      0|    frame_reader_release(frame, io_cb, fp);
 3878|      0|  }
 3879|    821|  if (rc < 0) {
  ------------------
  |  Branch (3879:7): [True: 41, False: 780]
  ------------------
 3880|     41|    if (*needs_free) {
  ------------------
  |  Branch (3880:9): [True: 0, False: 41]
  ------------------
 3881|      0|      free(*chunk);
 3882|      0|      *chunk = NULL;
 3883|      0|      *needs_free = false;
 3884|      0|    }
 3885|     41|    return rc;
 3886|     41|  }
 3887|       |
 3888|    780|  return (int)lazychunk_cbytes;
 3889|    821|}
frame_decompress_chunk:
 5248|  45.5k|int frame_decompress_chunk(blosc2_context *dctx, blosc2_frame_s* frame, int64_t nchunk, void *dest, int32_t nbytes) {
 5249|  45.5k|  uint8_t* src;
 5250|  45.5k|  bool needs_free;
 5251|  45.5k|  int32_t chunk_nbytes;
 5252|  45.5k|  int32_t chunk_cbytes;
 5253|  45.5k|  int rc;
 5254|       |
 5255|  45.5k|  rc = frame_get_chunk(frame, nchunk, &src, &needs_free);
 5256|  45.5k|  if (rc < 0) {
  ------------------
  |  Branch (5256:7): [True: 269, False: 45.2k]
  ------------------
 5257|    269|    BLOSC_TRACE_ERROR("Cannot get the chunk in position %" PRId64 ".", nchunk);
  ------------------
  |  |   93|    269|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    269|    do {                                            \
  |  |  |  |   98|    269|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    269|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 269, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    269|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5258|    269|    goto end;
 5259|    269|  }
 5260|  45.2k|  chunk_cbytes = rc;
 5261|  45.2k|  if (chunk_cbytes < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (5261:7): [True: 0, False: 45.2k]
  ------------------
 5262|       |    /* Not enough input to read `nbytes` */
 5263|      0|    rc = BLOSC2_ERROR_READ_BUFFER;
 5264|      0|  }
 5265|       |
 5266|  45.2k|  rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 5267|  45.2k|  if (rc < 0) {
  ------------------
  |  Branch (5267:7): [True: 21, False: 45.2k]
  ------------------
 5268|     21|    goto end;
 5269|     21|  }
 5270|       |
 5271|       |  /* Create a buffer for destination */
 5272|  45.2k|  if (chunk_nbytes > nbytes) {
  ------------------
  |  Branch (5272:7): [True: 40, False: 45.1k]
  ------------------
 5273|     40|    BLOSC_TRACE_ERROR("Not enough space for decompressing in dest.");
  ------------------
  |  |   93|     40|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     40|    do {                                            \
  |  |  |  |   98|     40|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     40|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 40, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     40|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5274|     40|    rc = BLOSC2_ERROR_WRITE_BUFFER;
 5275|     40|    goto end;
 5276|     40|  }
 5277|       |  /* And decompress it */
 5278|  45.1k|  dctx->header_overhead = BLOSC_EXTENDED_HEADER_LENGTH;
 5279|  45.1k|  int chunksize = rc = blosc2_decompress_ctx(dctx, src, chunk_cbytes, dest, nbytes);
 5280|  45.1k|  if (chunksize < 0 || chunksize != chunk_nbytes) {
  ------------------
  |  Branch (5280:7): [True: 165, False: 45.0k]
  |  Branch (5280:24): [True: 30, False: 45.0k]
  ------------------
 5281|    195|    BLOSC_TRACE_ERROR("Error in decompressing chunk.");
  ------------------
  |  |   93|    195|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    195|    do {                                            \
  |  |  |  |   98|    195|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    195|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 195, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    195|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5282|    195|    if (chunksize >= 0)
  ------------------
  |  Branch (5282:9): [True: 30, False: 165]
  ------------------
 5283|     30|      rc = BLOSC2_ERROR_FAILURE;
 5284|    195|  }
 5285|  45.5k|  end:
 5286|  45.5k|  if (needs_free) {
  ------------------
  |  Branch (5286:7): [True: 11.2k, False: 34.2k]
  ------------------
 5287|  11.2k|    free(src);
 5288|  11.2k|  }
 5289|  45.5k|  return rc;
 5290|  45.1k|}
frame.c:reader_cache_claim:
  125|     20|static bool reader_cache_claim(void) {
  126|     20|  bool claimed = false;
  127|     20|  blosc2_pthread_mutex_lock(&reader_cache_mutex);
  ------------------
  |  |   92|     20|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
  128|     20|  if (reader_cache_count < reader_cache_max()) {
  ------------------
  |  Branch (128:7): [True: 20, False: 0]
  ------------------
  129|     20|    reader_cache_count++;
  130|     20|    claimed = true;
  131|     20|  }
  132|     20|  blosc2_pthread_mutex_unlock(&reader_cache_mutex);
  ------------------
  |  |   93|     20|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
  133|     20|  return claimed;
  134|     20|}
frame.c:reader_cache_max:
   97|     20|static int reader_cache_max(void) {
   98|     20|  static int cached_max = -1;
   99|     20|  if (cached_max >= 0) {
  ------------------
  |  Branch (99:7): [True: 19, False: 1]
  ------------------
  100|     19|    return cached_max;
  101|     19|  }
  102|      1|  char* envvar = getenv("BLOSC_MAX_CACHED_READERS");
  103|      1|  if (envvar != NULL && envvar[0] != '\0') {
  ------------------
  |  Branch (103:7): [True: 0, False: 1]
  |  Branch (103:25): [True: 0, False: 0]
  ------------------
  104|      0|    long value = strtol(envvar, NULL, 10);
  105|      0|    if (value >= 0 && value <= INT_MAX) {
  ------------------
  |  Branch (105:9): [True: 0, False: 0]
  |  Branch (105:23): [True: 0, False: 0]
  ------------------
  106|      0|      cached_max = (int)value;
  107|      0|      return cached_max;
  108|      0|    }
  109|      0|  }
  110|      1|  cached_max = FRAME_READER_CACHE_MAX;
  ------------------
  |  |   86|      1|#define FRAME_READER_CACHE_MAX 96
  ------------------
  111|      1|  struct rlimit rl;
  112|      1|  if (getrlimit(RLIMIT_NOFILE, &rl) == 0 && rl.rlim_cur != RLIM_INFINITY) {
  ------------------
  |  Branch (112:7): [True: 1, False: 0]
  |  Branch (112:45): [True: 1, False: 0]
  ------------------
  113|      1|    rlim_t share = rl.rlim_cur / FRAME_READER_CACHE_SHARE;
  ------------------
  |  |   87|      1|#define FRAME_READER_CACHE_SHARE 16
  ------------------
  114|      1|    if (share < (rlim_t)cached_max) {
  ------------------
  |  Branch (114:9): [True: 1, False: 0]
  ------------------
  115|      1|      cached_max = (int)share;
  116|      1|    }
  117|      1|  }
  118|       |  /* A budget below FRAME_READER_CACHE_SHARE lands on 0, i.e. no caching at all;
  119|       |     that is the right answer there -- a descriptor held for a frame's lifetime
  120|       |     is exactly what such a process cannot spare. */
  121|      1|  return cached_max;
  122|      1|}
frame.c:reader_cache_return:
  136|     20|static void reader_cache_return(void) {
  137|     20|  blosc2_pthread_mutex_lock(&reader_cache_mutex);
  ------------------
  |  |   92|     20|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
  138|     20|  if (reader_cache_count > 0) {
  ------------------
  |  Branch (138:7): [True: 20, False: 0]
  ------------------
  139|     20|    reader_cache_count--;
  140|     20|  }
  141|     20|  blosc2_pthread_mutex_unlock(&reader_cache_mutex);
  ------------------
  |  |   93|     20|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
  142|     20|}
frame.c:frame_reader_close_locked:
  238|  12.1k|static bool frame_reader_close_locked(blosc2_frame_s* frame, bool force) {
  239|  12.1k|  if (frame->read_fp == NULL) {
  ------------------
  |  Branch (239:7): [True: 12.1k, False: 0]
  ------------------
  240|  12.1k|    return true;
  241|  12.1k|  }
  242|      0|  if (frame->read_fp_refs > 0 && !force) {
  ------------------
  |  Branch (242:7): [True: 0, False: 0]
  |  Branch (242:34): [True: 0, False: 0]
  ------------------
  243|       |    /* A caller up the stack is reading through it (frame_to_schunk holds it
  244|       |       across its whole chunk loop, and that loop re-enters get_header_info).
  245|       |       Closing it here would hand that caller a dangling handle, and its own
  246|       |       release would then close it a second time.  Leave it: the operation in
  247|       |       flight finishes on the file it started on, and the next revalidate --
  248|       |       past that release -- drops it. */
  249|      0|    return false;
  250|      0|  }
  251|       |  /* read_fp only ever comes from the filesystem backend, so close it directly:
  252|       |     blosc2_get_io_cb() would return NULL after a blosc2_destroy(), and then the
  253|       |     descriptor would leak while its cache slot got handed back anyway. */
  254|      0|  blosc2_stdio_close(frame->read_fp);
  255|      0|  frame->read_fp = NULL;
  256|      0|  frame->read_fp_refs = 0;
  257|      0|#if !defined(_WIN32)
  258|      0|  reader_cache_return();
  259|      0|#endif
  260|       |  return true;
  261|      0|}
frame.c:frame_alloc:
  147|  12.1k|static blosc2_frame_s* frame_alloc(void) {
  148|  12.1k|  blosc2_frame_s* frame = calloc(1, sizeof(blosc2_frame_s));
  149|  12.1k|  if (frame != NULL) {
  ------------------
  |  Branch (149:7): [True: 12.1k, False: 0]
  ------------------
  150|  12.1k|    blosc2_pthread_mutex_init(&frame->read_fp_mutex, NULL);
  ------------------
  |  |   90|  12.1k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
  151|  12.1k|  }
  152|  12.1k|  return frame;
  153|  12.1k|}
frame.c:frame_refresh_if_stale:
 1092|  47.2k|static int frame_refresh_if_stale(blosc2_frame_s *frame, int64_t frame_len_on_disk) {
 1093|  47.2k|  if (frame->cframe != NULL || frame->schunk == NULL ||
  ------------------
  |  Branch (1093:7): [True: 47.2k, False: 0]
  |  Branch (1093:32): [True: 0, False: 0]
  ------------------
 1094|  47.2k|      (!frame->force_refresh && frame_len_on_disk == frame->len)) {
  ------------------
  |  Branch (1094:8): [True: 0, False: 0]
  |  Branch (1094:33): [True: 0, False: 0]
  ------------------
 1095|  47.2k|    return 0;
 1096|  47.2k|  }
 1097|       |  // Saved so the metalayer-reload retry loop below can roll back to a fully
 1098|       |  // consistent state on exhaustion, rather than leaving frame->len/trailer_len
 1099|       |  // committed to the new value with no metalayers to match it.
 1100|      0|  int64_t old_len = frame->len;
 1101|      0|  uint32_t old_trailer_len = frame->trailer_len;
 1102|       |
 1103|      0|  if (frame_len_on_disk < FRAME_HEADER_MINLEN + FRAME_TRAILER_MINLEN) {
  ------------------
  |  |   49|      0|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|      0|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|      0|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|      0|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|      0|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|      0|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|      0|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|      0|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|      0|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|      0|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|      0|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|      0|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|      0|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                if (frame_len_on_disk < FRAME_HEADER_MINLEN + FRAME_TRAILER_MINLEN) {
  ------------------
  |  |   58|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
  |  Branch (1103:7): [True: 0, False: 0]
  ------------------
 1104|      0|    BLOSC_TRACE_ERROR("Invalid on-disk frame length (%" PRId64 ").", frame_len_on_disk);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1105|      0|    return BLOSC2_ERROR_FILE_READ;
 1106|      0|  }
 1107|       |
 1108|       |  // Read and validate the trailer *before* mutating any frame state below,
 1109|       |  // so a transient torn read (a writer without locking has no coordination
 1110|       |  // preventing a reader from landing mid-rewrite here -- the documented
 1111|       |  // SWMR-without-locking tradeoff) can be handled opportunistically: keep
 1112|       |  // the old cached view and let the next access retry, the same way
 1113|       |  // frame_check_stale()'s header read already does a few lines up in the
 1114|       |  // caller. Once frame->len/coffsets are overwritten below, a failure
 1115|       |  // partway through would leave the frame in a self-inconsistent state
 1116|       |  // (new length, stale trailer/offsets), so those mutations only happen
 1117|       |  // after the trailer is confirmed good.
 1118|      0|  blosc2_io_cb *io_cb = blosc2_get_io_cb(frame->schunk->storage->io->id);
 1119|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (1119:7): [True: 0, False: 0]
  ------------------
 1120|      0|    BLOSC_TRACE_ERROR("Error getting the input/output API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1121|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 1122|      0|  }
 1123|      0|  void* fp;
 1124|      0|  if (frame->sframe) {
  ------------------
  |  Branch (1124:7): [True: 0, False: 0]
  ------------------
 1125|      0|    fp = sframe_open_index(frame->urlpath, "rb", frame->schunk->storage->io);
 1126|      0|  }
 1127|      0|  else {
 1128|      0|    fp = frame_reader_acquire(frame, frame->schunk->storage->io);
 1129|      0|  }
 1130|      0|  if (fp == NULL) {
  ------------------
  |  Branch (1130:7): [True: 0, False: 0]
  ------------------
 1131|      0|    BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1132|      0|    return BLOSC2_ERROR_FILE_OPEN;
 1133|      0|  }
 1134|      0|  uint8_t trailer[FRAME_TRAILER_MINLEN];
 1135|      0|  uint8_t* trailer_ptr = trailer;
 1136|      0|  int64_t io_pos = frame->file_offset + frame_len_on_disk - FRAME_TRAILER_MINLEN;
  ------------------
  |  |   58|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
 1137|      0|  int64_t rbytes = io_cb->read((void**)&trailer_ptr, 1, FRAME_TRAILER_MINLEN, io_pos, fp);
  ------------------
  |  |   58|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
 1138|      0|  frame_reader_release(frame, io_cb, fp);
 1139|      0|  if (rbytes != FRAME_TRAILER_MINLEN) {
  ------------------
  |  |   58|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
  |  Branch (1139:7): [True: 0, False: 0]
  ------------------
 1140|      0|    BLOSC_TRACE_ERROR("Cannot read the trailer out of the frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1141|      0|    return 0;  // opportunistic: transient, keep the cached view, retry later
 1142|      0|  }
 1143|      0|  int trailer_offset = FRAME_TRAILER_MINLEN - FRAME_TRAILER_LEN_OFFSET;
  ------------------
  |  |   58|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
                int trailer_offset = FRAME_TRAILER_MINLEN - FRAME_TRAILER_LEN_OFFSET;
  ------------------
  |  |   59|      0|#define FRAME_TRAILER_LEN_OFFSET (22)  // offset to trailer length (counting from the end)
  ------------------
 1144|      0|  if (trailer_ptr[trailer_offset - 1] != 0xce) {
  ------------------
  |  Branch (1144:7): [True: 0, False: 0]
  ------------------
 1145|       |    // Not a valid trailer; most likely we are reading a frame in the middle of
 1146|       |    // being rewritten by another handle without locking (locked handles
 1147|       |    // fully serialize, so this only happens under the no-locking contract).
 1148|      0|    BLOSC_TRACE_ERROR("Invalid trailer in frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1149|      0|    return 0;  // opportunistic, same reasoning as above
 1150|      0|  }
 1151|      0|  uint32_t trailer_len;
 1152|      0|  from_big(&trailer_len, trailer_ptr + trailer_offset, sizeof(trailer_len));
  ------------------
  |  |   38|      0|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 1153|      0|  if (trailer_len < FRAME_TRAILER_MINLEN || trailer_len > INT32_MAX ||
  ------------------
  |  |   58|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
  |  Branch (1153:7): [True: 0, False: 0]
  |  Branch (1153:45): [True: 0, False: 0]
  ------------------
 1154|      0|      (int64_t)trailer_len > frame_len_on_disk - FRAME_HEADER_MINLEN) {
  ------------------
  |  |   49|      0|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|      0|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|      0|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|      0|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|      0|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|      0|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|      0|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|      0|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|      0|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|      0|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|      0|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|      0|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|      0|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1154:7): [True: 0, False: 0]
  ------------------
 1155|      0|    BLOSC_TRACE_ERROR("Invalid trailer length (%" PRIu32 ") in frame.", trailer_len);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1156|      0|    return 0;  // opportunistic, same reasoning as above
 1157|      0|  }
 1158|       |
 1159|       |  // Trailer confirmed good: now safe to commit the new length. The lock
 1160|       |  // generation counter (see frame_lock) may have flagged a mutation that
 1161|       |  // left the frame length unchanged; only clear that flag here, once a
 1162|       |  // refresh has actually happened -- clearing it earlier and then bailing
 1163|       |  // out opportunistically above would permanently lose a same-length
 1164|       |  // mutation notification on a torn-read retry. The cached offsets index is
 1165|       |  // dropped further down, only once the metalayer/vlmetalayer reload below
 1166|       |  // has actually succeeded -- neither of those touches frame->coffsets, so
 1167|       |  // deferring this keeps the old view of it fully intact for the
 1168|       |  // opportunistic rollback path below, exactly as strong as the trailer
 1169|       |  // read's own bail-outs above.
 1170|      0|  frame->force_refresh = false;
 1171|      0|  frame->len = frame_len_on_disk;
 1172|      0|  frame->trailer_len = trailer_len;
 1173|       |
 1174|       |  // The header metalayers and trailer vlmetalayers were cached at open time;
 1175|       |  // reload them so metadata changes made by another handle (e.g. a b2nd shape
 1176|       |  // update) become visible too.  The guard protects against re-entering from
 1177|       |  // the reload path itself (get_header_info does not refresh, but cheap
 1178|       |  // insurance against future changes there).
 1179|       |  //
 1180|       |  // frame_get_metalayers()/frame_get_vlmetalayers() each do their own fully
 1181|       |  // independent header/trailer re-read (separate from the trailer read
 1182|       |  // above), so without locking they can hit the same transient torn-read
 1183|       |  // window. Unlike that trailer read, there's no way to validate first and
 1184|       |  // commit after: schunk_free_metalayers()/schunk_free_vlmetalayers() must
 1185|       |  // run before a reload attempt (the parsers write straight into
 1186|       |  // schunk->metalayers[]/vlmetalayers[] as they go), so a single failed
 1187|       |  // attempt already discards the old cached set. Retry a bounded number of
 1188|       |  // times -- both free helpers are NULL-safe and re-run cleanly against a
 1189|       |  // partial prior attempt, and each attempt is a fresh independent read, so
 1190|       |  // this self-heals once the writer's rewrite stabilizes.
 1191|       |  //
 1192|       |  // This reasoning only holds without locking, though: frame_check_stale()
 1193|       |  // (the only caller) holds the shared frame lock across this entire call
 1194|       |  // when frame->locking is set, which fully excludes writers for its
 1195|       |  // duration -- so under locking a reload failure here cannot be a torn
 1196|       |  // read, it is a genuine problem (corruption or a real I/O error), and
 1197|       |  // retrying 50 times would just waste ~50ms holding that shared lock
 1198|       |  // before silently masking it. Retry once (i.e. don't retry) and propagate
 1199|       |  // the error under locking; keep the opportunistic bounded retry + silent
 1200|       |  // rollback for the no-locking case only.
 1201|       |  //
 1202|       |  // On exhaustion in the no-locking case, roll back frame->len/trailer_len
 1203|       |  // to what they were before this call and force a full retry on the next
 1204|       |  // poll (frame->force_refresh = true) -- otherwise frame_len_on_disk ==
 1205|       |  // frame->len would short-circuit every subsequent call at the top of this
 1206|       |  // function, permanently stranding this handle with an empty metalayer set.
 1207|      0|  if (!frame->refreshing) {
  ------------------
  |  Branch (1207:7): [True: 0, False: 0]
  ------------------
 1208|      0|    frame->refreshing = true;
 1209|      0|    int rc = -1;
 1210|      0|    const int max_attempts = frame->locking ? 1 : 50;
  ------------------
  |  Branch (1210:30): [True: 0, False: 0]
  ------------------
 1211|      0|    for (int attempt = 0; attempt < max_attempts; attempt++) {
  ------------------
  |  Branch (1211:27): [True: 0, False: 0]
  ------------------
 1212|      0|      schunk_free_metalayers(frame->schunk);
 1213|      0|      rc = frame_get_metalayers(frame, frame->schunk);
 1214|      0|      if (rc >= 0) {
  ------------------
  |  Branch (1214:11): [True: 0, False: 0]
  ------------------
 1215|      0|        schunk_free_vlmetalayers(frame->schunk);
 1216|      0|        rc = frame_get_vlmetalayers(frame, frame->schunk);
 1217|      0|      }
 1218|      0|      if (rc >= 0 || attempt + 1 == max_attempts) {
  ------------------
  |  Branch (1218:11): [True: 0, False: 0]
  |  Branch (1218:22): [True: 0, False: 0]
  ------------------
 1219|      0|        break;
 1220|      0|      }
 1221|       |#if defined(_WIN32)
 1222|       |      Sleep(1);
 1223|       |#else
 1224|      0|      usleep(1000);
 1225|      0|#endif
 1226|      0|    }
 1227|      0|    frame->refreshing = false;
 1228|      0|    if (rc < 0) {
  ------------------
  |  Branch (1228:9): [True: 0, False: 0]
  ------------------
 1229|      0|      if (frame->locking) {
  ------------------
  |  Branch (1229:11): [True: 0, False: 0]
  ------------------
 1230|      0|        BLOSC_TRACE_ERROR("Cannot reload the metalayers from the refreshed frame "
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1231|      0|                          "(locked handle: this is not a transient race).");
 1232|      0|        return rc;
 1233|      0|      }
 1234|      0|      BLOSC_TRACE_ERROR("Cannot reload the metalayers from the refreshed frame "
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1235|      0|                        "after retries; rolling back to the previous cached view.");
 1236|      0|      frame->len = old_len;
 1237|      0|      frame->trailer_len = old_trailer_len;
 1238|      0|      frame->force_refresh = true;
 1239|      0|      return 0;
 1240|      0|    }
 1241|      0|  }
 1242|      0|  frame->schunk->change_tick++;
 1243|       |
 1244|       |  // Cached offsets index invalidated only now, after a fully successful
 1245|       |  // refresh: recomputed lazily from the fresh trailer on demand.
 1246|      0|  if (frame->coffsets != NULL) {
  ------------------
  |  Branch (1246:7): [True: 0, False: 0]
  ------------------
 1247|      0|    if (frame->coffsets_needs_free) {
  ------------------
  |  Branch (1247:9): [True: 0, False: 0]
  ------------------
 1248|      0|      free(frame->coffsets);
 1249|      0|    }
 1250|      0|    frame->coffsets = NULL;
 1251|      0|  }
 1252|       |
 1253|      0|  return 1;
 1254|      0|}
frame.c:get_coffsets_nbytes:
 1301|  14.9k|                               int32_t *coffsets_nbytes, const blosc2_io *io) {
 1302|  14.9k|  int32_t chunk_cbytes;
 1303|  14.9k|  int rc;
 1304|  14.9k|  int64_t off_pos = header_len;
 1305|  14.9k|  if (!frame->sframe) {
  ------------------
  |  Branch (1305:7): [True: 14.9k, False: 0]
  ------------------
 1306|  14.9k|    if (cbytes < INT64_MAX - header_len) {
  ------------------
  |  Branch (1306:9): [True: 175, False: 14.7k]
  ------------------
 1307|    175|      off_pos += cbytes;
 1308|    175|    }
 1309|  14.9k|  }
 1310|       |
 1311|  14.9k|  if (off_pos < 0 || off_pos > INT64_MAX - BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (1311:7): [True: 30, False: 14.9k]
  |  Branch (1311:22): [True: 0, False: 14.9k]
  ------------------
 1312|  14.9k|      off_pos + BLOSC_EXTENDED_HEADER_LENGTH > frame->len) {
  ------------------
  |  Branch (1312:7): [True: 47, False: 14.8k]
  ------------------
 1313|     77|    BLOSC_TRACE_ERROR("Cannot read the offsets outside of frame boundary.");
  ------------------
  |  |   93|     77|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     77|    do {                                            \
  |  |  |  |   98|     77|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     77|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 77, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     77|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1314|     77|    return BLOSC2_ERROR_INVALID_HEADER;
 1315|     77|  }
 1316|       |
 1317|  14.8k|  if (frame->cframe != NULL) {
  ------------------
  |  Branch (1317:7): [True: 14.8k, False: 0]
  ------------------
 1318|  14.8k|    uint8_t *off_start = frame->cframe + off_pos;
 1319|  14.8k|    rc = blosc2_cbuffer_sizes(off_start, coffsets_nbytes, &chunk_cbytes, NULL);
 1320|  14.8k|    if (rc < 0) {
  ------------------
  |  Branch (1320:9): [True: 9, False: 14.8k]
  ------------------
 1321|      9|      return rc;
 1322|      9|    }
 1323|  14.8k|    if (chunk_cbytes < 0 || off_pos + chunk_cbytes > frame->len) {
  ------------------
  |  Branch (1323:9): [True: 0, False: 14.8k]
  |  Branch (1323:29): [True: 14, False: 14.8k]
  ------------------
 1324|     14|      BLOSC_TRACE_ERROR("Cannot read the cbytes outside of frame boundary.");
  ------------------
  |  |   93|     14|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     14|    do {                                            \
  |  |  |  |   98|     14|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     14|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 14, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     14|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1325|     14|      return BLOSC2_ERROR_INVALID_HEADER;
 1326|     14|    }
 1327|  14.8k|    return 0;
 1328|  14.8k|  }
 1329|       |
 1330|      0|  int64_t trailer_offset = get_trailer_offset(frame, header_len, true);
 1331|      0|  if (trailer_offset < BLOSC_EXTENDED_HEADER_LENGTH || trailer_offset + FRAME_TRAILER_MINLEN > frame->len) {
  ------------------
  |  |   58|      0|#define FRAME_TRAILER_MINLEN (25)  // minimum length for the trailer (msgpack overhead)
  ------------------
  |  Branch (1331:7): [True: 0, False: 0]
  |  Branch (1331:56): [True: 0, False: 0]
  ------------------
 1332|      0|    BLOSC_TRACE_ERROR("Cannot read the trailer out of the frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1333|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 1334|      0|  }
 1335|       |
 1336|      0|  blosc2_io_cb *io_cb = blosc2_get_io_cb(io->id);
 1337|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (1337:7): [True: 0, False: 0]
  ------------------
 1338|      0|    BLOSC_TRACE_ERROR("Error getting the input/output API");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1339|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 1340|      0|  }
 1341|       |
 1342|      0|  uint8_t header[BLOSC_EXTENDED_HEADER_LENGTH];
 1343|      0|  uint8_t *header_ptr = header;
 1344|      0|  void *fp = NULL;
 1345|      0|  int64_t io_pos = 0;
 1346|      0|  if (frame->sframe) {
  ------------------
  |  Branch (1346:7): [True: 0, False: 0]
  ------------------
 1347|      0|    fp = sframe_open_index(frame->urlpath, "rb", io);
 1348|      0|    if (fp == NULL) {
  ------------------
  |  Branch (1348:9): [True: 0, False: 0]
  ------------------
 1349|      0|      BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1350|      0|      return BLOSC2_ERROR_FILE_OPEN;
 1351|      0|    }
 1352|      0|    io_pos = off_pos;
 1353|      0|  }
 1354|      0|  else {
 1355|      0|    fp = frame_reader_acquire(frame, io);
 1356|      0|    if (fp == NULL) {
  ------------------
  |  Branch (1356:9): [True: 0, False: 0]
  ------------------
 1357|      0|      BLOSC_TRACE_ERROR("Error opening file in: %s", frame->urlpath);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1358|      0|      return BLOSC2_ERROR_FILE_OPEN;
 1359|      0|    }
 1360|      0|    io_pos = frame->file_offset + off_pos;
 1361|      0|  }
 1362|      0|  int64_t rbytes = io_cb->read((void**)&header_ptr, 1, BLOSC_EXTENDED_HEADER_LENGTH, io_pos, fp);
 1363|      0|  frame_reader_release(frame, io_cb, fp);
 1364|      0|  if (rbytes != BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (1364:7): [True: 0, False: 0]
  ------------------
 1365|      0|    BLOSC_TRACE_ERROR("Cannot read the offsets header out of the frame.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1366|      0|    return BLOSC2_ERROR_FILE_READ;
 1367|      0|  }
 1368|       |
 1369|      0|  rc = blosc2_cbuffer_sizes(header_ptr, coffsets_nbytes, &chunk_cbytes, NULL);
 1370|      0|  if (rc < 0) {
  ------------------
  |  Branch (1370:7): [True: 0, False: 0]
  ------------------
 1371|      0|    return rc;
 1372|      0|  }
 1373|       |
 1374|      0|  if (chunk_cbytes < 0 || off_pos + chunk_cbytes > trailer_offset) {
  ------------------
  |  Branch (1374:7): [True: 0, False: 0]
  |  Branch (1374:27): [True: 0, False: 0]
  ------------------
 1375|      0|    BLOSC_TRACE_ERROR("Cannot read the offsets outside of frame boundary.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1376|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 1377|      0|  }
 1378|       |
 1379|      0|  return 0;
 1380|      0|}
frame.c:get_meta_from_header:
 2389|    951|                                int32_t header_len) {
 2390|    951|  BLOSC_UNUSED_PARAM(frame);
  ------------------
  |  |   28|    951|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
 2391|    951|  int64_t header_pos = FRAME_IDX_SIZE;
  ------------------
  |  |   51|    951|#define FRAME_IDX_SIZE (FRAME_METALAYERS + 1 + 1)  // 89
  |  |  ------------------
  |  |  |  |   50|    951|#define FRAME_METALAYERS (FRAME_HEADER_MINLEN)  // 87
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|    951|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   44|    951|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   43|    951|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   42|    951|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   41|    951|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   40|    951|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|    951|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|    951|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|    951|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|    951|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|    951|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|    951|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|    951|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|    951|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2392|       |
 2393|       |  // Get the size for the index of metalayers
 2394|    951|  uint16_t idx_size;
 2395|    951|  header_pos += sizeof(idx_size);
 2396|    951|  if (header_len < header_pos) {
  ------------------
  |  Branch (2396:7): [True: 0, False: 951]
  ------------------
 2397|      0|    return BLOSC2_ERROR_READ_BUFFER;
 2398|      0|  }
 2399|    951|  from_big(&idx_size, header + FRAME_IDX_SIZE, sizeof(idx_size));
  ------------------
  |  |   38|    951|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2400|       |
 2401|       |  // Get the actual index of metalayers
 2402|    951|  uint8_t* metalayers_idx = header + FRAME_IDX_SIZE + 2;
  ------------------
  |  |   51|    951|#define FRAME_IDX_SIZE (FRAME_METALAYERS + 1 + 1)  // 89
  |  |  ------------------
  |  |  |  |   50|    951|#define FRAME_METALAYERS (FRAME_HEADER_MINLEN)  // 87
  |  |  |  |  ------------------
  |  |  |  |  |  |   49|    951|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   44|    951|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   43|    951|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   42|    951|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   41|    951|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   40|    951|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|    951|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|    951|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|    951|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|    951|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|    951|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|    951|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|    951|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|    951|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2403|    951|  header_pos += 1;
 2404|    951|  if (header_len < header_pos) {
  ------------------
  |  Branch (2404:7): [True: 0, False: 951]
  ------------------
 2405|      0|    return BLOSC2_ERROR_READ_BUFFER;
 2406|      0|  }
 2407|    951|  if (metalayers_idx[0] != 0xde) {   // sanity check
  ------------------
  |  Branch (2407:7): [True: 39, False: 912]
  ------------------
 2408|     39|    return BLOSC2_ERROR_DATA;
 2409|     39|  }
 2410|    912|  uint8_t* idxp = metalayers_idx + 1;
 2411|    912|  uint16_t nmetalayers;
 2412|    912|  header_pos += sizeof(nmetalayers);
 2413|    912|  if (header_len < header_pos) {
  ------------------
  |  Branch (2413:7): [True: 2, False: 910]
  ------------------
 2414|      2|    return BLOSC2_ERROR_READ_BUFFER;
 2415|      2|  }
 2416|    910|  from_big(&nmetalayers, idxp, sizeof(uint16_t));
  ------------------
  |  |   38|    910|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2417|    910|  idxp += 2;
 2418|    910|  if (nmetalayers > BLOSC2_MAX_METALAYERS) {
  ------------------
  |  | 1744|    910|#define BLOSC2_MAX_METALAYERS 16
  ------------------
  |  Branch (2418:7): [True: 16, False: 894]
  ------------------
 2419|     16|    return BLOSC2_ERROR_DATA;
 2420|     16|  }
 2421|    894|  schunk->nmetalayers = nmetalayers;
 2422|       |
 2423|       |  // Populate the metalayers and its serialized values
 2424|    894|  for (int nmetalayer = 0; nmetalayer < nmetalayers; nmetalayer++) {
  ------------------
  |  Branch (2424:28): [True: 31, False: 863]
  ------------------
 2425|     31|    header_pos += 1;
 2426|     31|    if (header_len < header_pos) {
  ------------------
  |  Branch (2426:9): [True: 1, False: 30]
  ------------------
 2427|      1|      return BLOSC2_ERROR_READ_BUFFER;
 2428|      1|    }
 2429|     30|    if ((*idxp & 0xe0u) != 0xa0u) {   // sanity check
  ------------------
  |  Branch (2429:9): [True: 15, False: 15]
  ------------------
 2430|     15|      return BLOSC2_ERROR_DATA;
 2431|     15|    }
 2432|     15|    blosc2_metalayer* metalayer = calloc(1, sizeof(blosc2_metalayer));
 2433|     15|    if (metalayer == NULL) {
  ------------------
  |  Branch (2433:9): [True: 0, False: 15]
  ------------------
 2434|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2435|      0|    }
 2436|     15|    schunk->metalayers[nmetalayer] = metalayer;
 2437|       |
 2438|       |    // Populate the metalayer string
 2439|     15|    uint8_t nslen = *idxp & (uint8_t)0x1F;
 2440|     15|    idxp += 1;
 2441|     15|    header_pos += nslen;
 2442|     15|    if (header_len < header_pos) {
  ------------------
  |  Branch (2442:9): [True: 1, False: 14]
  ------------------
 2443|      1|      return BLOSC2_ERROR_READ_BUFFER;
 2444|      1|    }
 2445|     14|    char* ns = malloc((size_t)nslen + 1);
 2446|     14|    if (ns == NULL) {
  ------------------
  |  Branch (2446:9): [True: 0, False: 14]
  ------------------
 2447|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2448|      0|    }
 2449|     14|    memcpy(ns, idxp, nslen);
 2450|     14|    ns[nslen] = '\0';
 2451|     14|    idxp += nslen;
 2452|     14|    metalayer->name = ns;
 2453|       |
 2454|       |    // Populate the serialized value for this metalayer
 2455|       |    // Get the offset
 2456|     14|    header_pos += 1;
 2457|     14|    if (header_len < header_pos) {
  ------------------
  |  Branch (2457:9): [True: 1, False: 13]
  ------------------
 2458|      1|      return BLOSC2_ERROR_READ_BUFFER;
 2459|      1|    }
 2460|     13|    if ((*idxp & 0xffu) != 0xd2u) {   // sanity check
  ------------------
  |  Branch (2460:9): [True: 2, False: 11]
  ------------------
 2461|      2|      return BLOSC2_ERROR_DATA;
 2462|      2|    }
 2463|     11|    idxp += 1;
 2464|     11|    int32_t offset;
 2465|     11|    header_pos += sizeof(offset);
 2466|     11|    if (header_len < header_pos) {
  ------------------
  |  Branch (2466:9): [True: 1, False: 10]
  ------------------
 2467|      1|      return BLOSC2_ERROR_READ_BUFFER;
 2468|      1|    }
 2469|     10|    from_big(&offset, idxp, sizeof(offset));
  ------------------
  |  |   38|     10|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2470|     10|    idxp += 4;
 2471|     10|    if (offset < 0 || offset >= header_len) {
  ------------------
  |  Branch (2471:9): [True: 3, False: 7]
  |  Branch (2471:23): [True: 5, False: 2]
  ------------------
 2472|       |      // Offset is less than zero or exceeds header length
 2473|      8|      return BLOSC2_ERROR_DATA;
 2474|      8|    }
 2475|       |    // Go to offset and see if we have the correct marker
 2476|      2|    uint8_t* content_marker = header + offset;
 2477|      2|    if ((int64_t)header_len < (int64_t)offset + 1 + 4) {
  ------------------
  |  Branch (2477:9): [True: 0, False: 2]
  ------------------
 2478|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2479|      0|    }
 2480|      2|    if (*content_marker != 0xc6) {
  ------------------
  |  Branch (2480:9): [True: 2, False: 0]
  ------------------
 2481|      2|      return BLOSC2_ERROR_DATA;
 2482|      2|    }
 2483|       |
 2484|       |    // Read the size of the content
 2485|      0|    int32_t content_len;
 2486|      0|    from_big(&content_len, content_marker + 1, sizeof(content_len));
  ------------------
  |  |   38|      0|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2487|      0|    if (content_len < 0) {
  ------------------
  |  Branch (2487:9): [True: 0, False: 0]
  ------------------
 2488|      0|      return BLOSC2_ERROR_DATA;
 2489|      0|    }
 2490|      0|    metalayer->content_len = content_len;
 2491|       |
 2492|       |    // Finally, read the content. Use 64-bit arithmetic so a malicious
 2493|       |    // (offset, content_len) pair near INT32_MAX cannot wrap and bypass the
 2494|       |    // bounds check, which would let memcpy below read past the header buffer.
 2495|      0|    if ((int64_t)header_len < (int64_t)offset + 1 + 4 + (int64_t)content_len) {
  ------------------
  |  Branch (2495:9): [True: 0, False: 0]
  ------------------
 2496|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2497|      0|    }
 2498|      0|    char* content = malloc((size_t)content_len);
 2499|       |    // malloc(0) is allowed to return NULL, and blosc2_meta_add accepts
 2500|       |    // content_len == 0, so only treat NULL as an allocation failure when
 2501|       |    // a non-zero allocation was requested.
 2502|      0|    if (content_len > 0 && content == NULL) {
  ------------------
  |  Branch (2502:9): [True: 0, False: 0]
  |  Branch (2502:28): [True: 0, False: 0]
  ------------------
 2503|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2504|      0|    }
 2505|      0|    if (content_len > 0) {
  ------------------
  |  Branch (2505:9): [True: 0, False: 0]
  ------------------
 2506|      0|      memcpy(content, content_marker + 1 + 4, (size_t)content_len);
 2507|      0|    }
 2508|      0|    metalayer->content = (uint8_t*)content;
 2509|      0|  }
 2510|       |
 2511|    863|  return 1;
 2512|    894|}
frame.c:get_vlmeta_from_trailer:
 2592|    843|                                   int32_t trailer_len) {
 2593|       |
 2594|    843|  BLOSC_UNUSED_PARAM(frame);
  ------------------
  |  |   28|    843|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
 2595|    843|  int64_t trailer_pos = FRAME_TRAILER_VLMETALAYERS + 2;
  ------------------
  |  |   60|    843|#define FRAME_TRAILER_VLMETALAYERS (2)
  ------------------
 2596|    843|  uint8_t* idxp = trailer + trailer_pos;
 2597|       |
 2598|       |  // Get the size for the index of metalayers
 2599|    843|  trailer_pos += 2;
 2600|    843|  if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2600:7): [True: 0, False: 843]
  ------------------
 2601|      0|    return BLOSC2_ERROR_READ_BUFFER;
 2602|      0|  }
 2603|    843|  uint16_t idx_size;
 2604|    843|  from_big(&idx_size, idxp, sizeof(idx_size));
  ------------------
  |  |   38|    843|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2605|    843|  idxp += 2;
 2606|       |
 2607|    843|  trailer_pos += 1;
 2608|       |  // Get the actual index of metalayers
 2609|    843|  if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2609:7): [True: 0, False: 843]
  ------------------
 2610|      0|    return BLOSC2_ERROR_READ_BUFFER;
 2611|      0|  }
 2612|    843|  if (idxp[0] != 0xde) {   // sanity check
  ------------------
  |  Branch (2612:7): [True: 101, False: 742]
  ------------------
 2613|    101|    return BLOSC2_ERROR_DATA;
 2614|    101|  }
 2615|    742|  idxp += 1;
 2616|       |
 2617|       |  // The on-wire encoding is unsigned (uint16 follows the msgpack `0xde`
 2618|       |  // map16 marker), but `schunk->nvlmetalayers` is int16_t. Decoding into a
 2619|       |  // signed local would let raw bytes like 0xff 0xff slip past the
 2620|       |  // `> BLOSC2_MAX_VLMETALAYERS` ceiling as a negative count, after which
 2621|       |  // a later `blosc2_vlmeta_add` would write through `vlmetalayers[-1]`
 2622|       |  // and corrupt adjacent schunk fields. Decode unsigned, then narrow.
 2623|    742|  uint16_t nmetalayers;
 2624|    742|  trailer_pos += sizeof(nmetalayers);
 2625|    742|  if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2625:7): [True: 0, False: 742]
  ------------------
 2626|      0|    return BLOSC2_ERROR_READ_BUFFER;
 2627|      0|  }
 2628|    742|  from_big(&nmetalayers, idxp, sizeof(uint16_t));
  ------------------
  |  |   38|    742|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2629|    742|  idxp += 2;
 2630|    742|  if (nmetalayers > BLOSC2_MAX_VLMETALAYERS) {
  ------------------
  |  | 1750|    742|#define BLOSC2_MAX_VLMETALAYERS (8 * 1024)
  ------------------
  |  Branch (2630:7): [True: 18, False: 724]
  ------------------
 2631|     18|    return BLOSC2_ERROR_DATA;
 2632|     18|  }
 2633|    724|  schunk->nvlmetalayers = (int16_t)nmetalayers;
 2634|       |
 2635|       |  // Populate the metalayers and its serialized values
 2636|    987|  for (int nmetalayer = 0; nmetalayer < nmetalayers; nmetalayer++) {
  ------------------
  |  Branch (2636:28): [True: 333, False: 654]
  ------------------
 2637|    333|    trailer_pos += 1;
 2638|    333|    if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2638:9): [True: 0, False: 333]
  ------------------
 2639|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2640|      0|    }
 2641|    333|    if ((*idxp & 0xe0u) != 0xa0u) {   // sanity check
  ------------------
  |  Branch (2641:9): [True: 16, False: 317]
  ------------------
 2642|     16|      return BLOSC2_ERROR_DATA;
 2643|     16|    }
 2644|    317|    blosc2_metalayer* metalayer = calloc(1, sizeof(blosc2_metalayer));
 2645|    317|    if (metalayer == NULL) {
  ------------------
  |  Branch (2645:9): [True: 0, False: 317]
  ------------------
 2646|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2647|      0|    }
 2648|    317|    schunk->vlmetalayers[nmetalayer] = metalayer;
 2649|       |
 2650|       |    // Populate the metalayer string
 2651|    317|    uint8_t nslen = *idxp & (uint8_t)0x1F;
 2652|    317|    idxp += 1;
 2653|    317|    trailer_pos += nslen;
 2654|    317|    if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2654:9): [True: 0, False: 317]
  ------------------
 2655|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2656|      0|    }
 2657|    317|    char* ns = malloc((size_t)nslen + 1);
 2658|    317|    if (ns == NULL) {
  ------------------
  |  Branch (2658:9): [True: 0, False: 317]
  ------------------
 2659|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2660|      0|    }
 2661|    317|    memcpy(ns, idxp, nslen);
 2662|    317|    ns[nslen] = '\0';
 2663|    317|    idxp += nslen;
 2664|    317|    metalayer->name = ns;
 2665|       |
 2666|       |    // Populate the serialized value for this metalayer
 2667|       |    // Get the offset
 2668|    317|    trailer_pos += 1;
 2669|    317|    if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2669:9): [True: 0, False: 317]
  ------------------
 2670|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2671|      0|    }
 2672|    317|    if ((*idxp & 0xffu) != 0xd2u) {   // sanity check
  ------------------
  |  Branch (2672:9): [True: 1, False: 316]
  ------------------
 2673|      1|      return BLOSC2_ERROR_DATA;
 2674|      1|    }
 2675|    316|    idxp += 1;
 2676|    316|    int32_t offset;
 2677|    316|    trailer_pos += sizeof(offset);
 2678|    316|    if (trailer_len < trailer_pos) {
  ------------------
  |  Branch (2678:9): [True: 0, False: 316]
  ------------------
 2679|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2680|      0|    }
 2681|    316|    from_big(&offset, idxp, sizeof(offset));
  ------------------
  |  |   38|    316|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2682|    316|    idxp += 4;
 2683|    316|    if (offset < 0 || offset >= trailer_len) {
  ------------------
  |  Branch (2683:9): [True: 8, False: 308]
  |  Branch (2683:23): [True: 5, False: 303]
  ------------------
 2684|       |      // Offset is less than zero or exceeds trailer length
 2685|     13|      return BLOSC2_ERROR_DATA;
 2686|     13|    }
 2687|       |    // Go to offset and see if we have the correct marker
 2688|    303|    uint8_t* content_marker = trailer + offset;
 2689|    303|    if ((int64_t)trailer_len < (int64_t)offset + 1 + 4) {
  ------------------
  |  Branch (2689:9): [True: 1, False: 302]
  ------------------
 2690|      1|      return BLOSC2_ERROR_READ_BUFFER;
 2691|      1|    }
 2692|    302|    if (*content_marker != 0xc6) {
  ------------------
  |  Branch (2692:9): [True: 4, False: 298]
  ------------------
 2693|      4|      return BLOSC2_ERROR_DATA;
 2694|      4|    }
 2695|       |
 2696|       |    // Read the size of the content
 2697|    298|    int32_t content_len;
 2698|    298|    from_big(&content_len, content_marker + 1, sizeof(content_len));
  ------------------
  |  |   38|    298|#define from_big(dest, src, itemsize)     endian_handler(false, dest, src, itemsize)
  ------------------
 2699|    298|    if (content_len < 0) {
  ------------------
  |  Branch (2699:9): [True: 5, False: 293]
  ------------------
 2700|      5|      return BLOSC2_ERROR_DATA;
 2701|      5|    }
 2702|    293|    metalayer->content_len = content_len;
 2703|       |
 2704|       |    // Finally, read the content. Use 64-bit arithmetic so a malicious
 2705|       |    // (offset, content_len) pair near INT32_MAX cannot wrap and bypass the
 2706|       |    // bounds check, which would let memcpy below read past the trailer buffer.
 2707|    293|    if ((int64_t)trailer_len < (int64_t)offset + 1 + 4 + (int64_t)content_len) {
  ------------------
  |  Branch (2707:9): [True: 30, False: 263]
  ------------------
 2708|     30|      return BLOSC2_ERROR_READ_BUFFER;
 2709|     30|    }
 2710|    263|    char* content = malloc((size_t)content_len);
 2711|       |    // Same zero-length carve-out as in get_meta_from_header: malloc(0) may
 2712|       |    // return NULL on some platforms, and the public API allows
 2713|       |    // content_len == 0, so don't reject a valid empty vlmetalayer.
 2714|    263|    if (content_len > 0 && content == NULL) {
  ------------------
  |  Branch (2714:9): [True: 261, False: 2]
  |  Branch (2714:28): [True: 0, False: 261]
  ------------------
 2715|      0|      return BLOSC2_ERROR_MEMORY_ALLOC;
 2716|      0|    }
 2717|    263|    if (content_len > 0) {
  ------------------
  |  Branch (2717:9): [True: 261, False: 2]
  ------------------
 2718|    261|      memcpy(content, content_marker + 1 + 4, (size_t)content_len);
 2719|    261|    }
 2720|    263|    metalayer->content = (uint8_t*)content;
 2721|    263|  }
 2722|    654|  return 1;
 2723|    724|}
frame.c:validate_offsets_chunk:
 2881|  11.7k|                                  int64_t nchunks) {
 2882|  11.7k|  int32_t coffsets_cbytes = 0;
 2883|  11.7k|  uint8_t* coffsets = get_coffsets(frame, header_len, cbytes, nchunks, &coffsets_cbytes);
 2884|  11.7k|  if (coffsets == NULL) {
  ------------------
  |  Branch (2884:7): [True: 159, False: 11.6k]
  ------------------
 2885|    159|    BLOSC_TRACE_ERROR("Cannot get compressed offsets from frame.");
  ------------------
  |  |   93|    159|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    159|    do {                                            \
  |  |  |  |   98|    159|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    159|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 159, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    159|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2886|    159|    return BLOSC2_ERROR_DATA;
 2887|    159|  }
 2888|       |
 2889|  11.6k|  int32_t offsets_nbytes;
 2890|  11.6k|  if (!blosc2_nchunks_to_offsets_nbytes(nchunks, &offsets_nbytes)) {
  ------------------
  |  Branch (2890:7): [True: 0, False: 11.6k]
  ------------------
 2891|      0|    BLOSC_TRACE_ERROR("Too many chunks for offsets representation.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2892|      0|    return BLOSC2_ERROR_FAILURE;
 2893|      0|  }
 2894|       |
 2895|  11.6k|  int64_t* offsets = (int64_t*)malloc((size_t)offsets_nbytes);
 2896|  11.6k|  if (offsets == NULL) {
  ------------------
  |  Branch (2896:7): [True: 0, False: 11.6k]
  ------------------
 2897|      0|    BLOSC_TRACE_ERROR("Cannot allocate memory for offsets validation.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2898|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2899|      0|  }
 2900|       |
 2901|  11.6k|  blosc2_dparams off_dparams = BLOSC2_DPARAMS_DEFAULTS;
 2902|  11.6k|  blosc2_context* dctx = blosc2_create_dctx(off_dparams);
 2903|  11.6k|  if (dctx == NULL) {
  ------------------
  |  Branch (2903:7): [True: 0, False: 11.6k]
  ------------------
 2904|      0|    free(offsets);
 2905|      0|    BLOSC_TRACE_ERROR("Error while creating the decompression context.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2906|      0|    return BLOSC2_ERROR_FAILURE;
 2907|      0|  }
 2908|       |
 2909|  11.6k|  int32_t off_nbytes = blosc2_decompress_ctx(dctx, coffsets, coffsets_cbytes,
 2910|  11.6k|                                             offsets, offsets_nbytes);
 2911|  11.6k|  blosc2_free_ctx(dctx);
 2912|  11.6k|  if (off_nbytes != offsets_nbytes) {
  ------------------
  |  Branch (2912:7): [True: 9.89k, False: 1.72k]
  ------------------
 2913|  9.89k|    free(offsets);
 2914|  9.89k|    BLOSC_TRACE_ERROR("Cannot decompress offsets chunk.");
  ------------------
  |  |   93|  9.89k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  9.89k|    do {                                            \
  |  |  |  |   98|  9.89k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  9.89k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 9.89k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  9.89k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2915|  9.89k|    return BLOSC2_ERROR_DATA;
 2916|  9.89k|  }
 2917|       |
 2918|  6.69G|  for (int64_t i = 0; i < nchunks; ++i) {
  ------------------
  |  Branch (2918:23): [True: 6.69G, False: 1.67k]
  ------------------
 2919|  6.69G|    int64_t offset = offsets[i];
 2920|  6.69G|    if (offset < 0) {
  ------------------
  |  Branch (2920:9): [True: 704M, False: 5.99G]
  ------------------
 2921|   704M|      continue;
 2922|   704M|    }
 2923|  5.99G|    if (offset > INT64_MAX - header_len || offset > cbytes - BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (2923:9): [True: 7, False: 5.99G]
  |  Branch (2923:44): [True: 40, False: 5.99G]
  ------------------
 2924|     47|      free(offsets);
 2925|     47|      BLOSC_TRACE_ERROR("Offset for chunk %" PRId64 " is out of bounds.", i);
  ------------------
  |  |   93|     47|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     47|    do {                                            \
  |  |  |  |   98|     47|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     47|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 47, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     47|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2926|     47|      return BLOSC2_ERROR_INVALID_HEADER;
 2927|     47|    }
 2928|       |    /* Offsets do not need to be monotonic.  Frame mutations like insert can append
 2929|       |     * chunk payloads at the end of the cframe while updating the logical chunk order
 2930|       |     * only in the offsets table, so a valid frame may legitimately contain
 2931|       |     * non-monotonic non-negative offsets.
 2932|       |     */
 2933|  5.99G|  }
 2934|       |
 2935|  1.67k|  free(offsets);
 2936|  1.67k|  return 0;
 2937|  1.72k|}

blosc2_schunk_get_cparams:
   70|  11.9k|int blosc2_schunk_get_cparams(blosc2_schunk *schunk, blosc2_cparams **cparams) {
   71|  11.9k|  *cparams = calloc(1, sizeof(blosc2_cparams));
   72|  11.9k|  (*cparams)->schunk = schunk;
   73|  83.7k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (73:19): [True: 71.8k, False: 11.9k]
  ------------------
   74|  71.8k|    (*cparams)->filters[i] = schunk->filters[i];
   75|  71.8k|    (*cparams)->filters_meta[i] = schunk->filters_meta[i];
   76|  71.8k|  }
   77|  11.9k|  (*cparams)->compcode = schunk->compcode;
   78|  11.9k|  (*cparams)->compcode_meta = schunk->compcode_meta;
   79|  11.9k|  (*cparams)->clevel = schunk->clevel;
   80|  11.9k|  (*cparams)->typesize = schunk->typesize;
   81|  11.9k|  (*cparams)->blocksize = schunk->blocksize;
   82|  11.9k|  (*cparams)->splitmode = schunk->splitmode;
   83|  11.9k|  (*cparams)->use_dict = schunk->use_dict;
   84|  11.9k|  if (schunk->cctx == NULL) {
  ------------------
  |  Branch (84:7): [True: 11.9k, False: 0]
  ------------------
   85|  11.9k|    (*cparams)->nthreads = blosc2_get_nthreads();
   86|  11.9k|  }
   87|      0|  else {
   88|      0|    (*cparams)->nthreads = (int16_t)schunk->cctx->nthreads;
   89|      0|  }
   90|  11.9k|  return 0;
   91|  11.9k|}
blosc2_schunk_get_dparams:
   95|  11.9k|int blosc2_schunk_get_dparams(blosc2_schunk *schunk, blosc2_dparams **dparams) {
   96|  11.9k|  *dparams = calloc(1, sizeof(blosc2_dparams));
   97|  11.9k|  (*dparams)->schunk = schunk;
   98|  11.9k|  if (schunk->dctx == NULL) {
  ------------------
  |  Branch (98:7): [True: 11.9k, False: 0]
  ------------------
   99|  11.9k|    (*dparams)->nthreads = blosc2_get_nthreads();
  100|  11.9k|  }
  101|      0|  else {
  102|      0|    (*dparams)->nthreads = schunk->dctx->nthreads;
  103|      0|  }
  104|  11.9k|  return 0;
  105|  11.9k|}
schunk_free_metalayers:
  653|  12.1k|void schunk_free_metalayers(blosc2_schunk *schunk) {
  654|  12.2k|  for (int i = 0; i < schunk->nmetalayers; i++) {
  ------------------
  |  Branch (654:19): [True: 169, False: 12.1k]
  ------------------
  655|    169|    if (schunk->metalayers[i] != NULL) {
  ------------------
  |  Branch (655:9): [True: 15, False: 154]
  ------------------
  656|     15|      free(schunk->metalayers[i]->name);
  657|     15|      free(schunk->metalayers[i]->content);
  658|     15|      free(schunk->metalayers[i]);
  659|       |      schunk->metalayers[i] = NULL;
  660|     15|    }
  661|    169|  }
  662|  12.1k|  schunk->nmetalayers = 0;
  663|  12.1k|}
schunk_free_vlmetalayers:
  666|  12.1k|void schunk_free_vlmetalayers(blosc2_schunk *schunk) {
  667|  42.1k|  for (int i = 0; i < schunk->nvlmetalayers; i++) {
  ------------------
  |  Branch (667:19): [True: 30.0k, False: 12.1k]
  ------------------
  668|  30.0k|    if (schunk->vlmetalayers[i] != NULL) {
  ------------------
  |  Branch (668:9): [True: 317, False: 29.7k]
  ------------------
  669|    317|      free(schunk->vlmetalayers[i]->name);
  670|    317|      free(schunk->vlmetalayers[i]->content);
  671|    317|      free(schunk->vlmetalayers[i]);
  672|       |      schunk->vlmetalayers[i] = NULL;
  673|    317|    }
  674|  30.0k|  }
  675|  12.1k|  schunk->nvlmetalayers = 0;
  676|  12.1k|}
blosc2_schunk_free:
  679|  12.1k|int blosc2_schunk_free(blosc2_schunk *schunk) {
  680|  12.1k|  int err = 0;
  681|       |
  682|       |  // If it is a view, the data belongs to original array and should not be freed
  683|  12.1k|  if (schunk->data != NULL && !schunk->view) {
  ------------------
  |  Branch (683:7): [True: 0, False: 12.1k]
  |  Branch (683:31): [True: 0, False: 0]
  ------------------
  684|      0|    for (int i = 0; i < schunk->nchunks; i++) {
  ------------------
  |  Branch (684:21): [True: 0, False: 0]
  ------------------
  685|      0|      free(schunk->data[i]);
  686|      0|    }
  687|      0|    free(schunk->data);
  688|      0|  }
  689|  12.1k|  if (schunk->cctx != NULL)
  ------------------
  |  Branch (689:7): [True: 11.9k, False: 171]
  ------------------
  690|  11.9k|    blosc2_free_ctx(schunk->cctx);
  691|  12.1k|  if (schunk->dctx != NULL)
  ------------------
  |  Branch (691:7): [True: 11.9k, False: 171]
  ------------------
  692|  11.9k|    blosc2_free_ctx(schunk->dctx);
  693|  12.1k|  if (schunk->blockshape != NULL)
  ------------------
  |  Branch (693:7): [True: 0, False: 12.1k]
  ------------------
  694|      0|    free(schunk->blockshape);
  695|       |
  696|  12.1k|  schunk_free_metalayers(schunk);
  697|       |
  698|  12.1k|  if (schunk->storage != NULL) {
  ------------------
  |  Branch (698:7): [True: 11.9k, False: 171]
  ------------------
  699|  11.9k|    blosc2_io_cb *io_cb = blosc2_get_io_cb(schunk->storage->io->id);
  700|  11.9k|    if (io_cb != NULL) {
  ------------------
  |  Branch (700:9): [True: 11.9k, False: 0]
  ------------------
  701|  11.9k|      int rc = io_cb->destroy(schunk->storage->io->params);
  702|  11.9k|      if (rc < 0) {
  ------------------
  |  Branch (702:11): [True: 0, False: 11.9k]
  ------------------
  703|      0|        BLOSC_TRACE_ERROR("Could not free the I/O resources.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  704|      0|        err = 1;
  705|      0|      }
  706|  11.9k|    }
  707|       |
  708|  11.9k|    if (schunk->storage->urlpath != NULL) {
  ------------------
  |  Branch (708:9): [True: 0, False: 11.9k]
  ------------------
  709|      0|      free(schunk->storage->urlpath);
  710|      0|    }
  711|  11.9k|    free(schunk->storage->cparams);
  712|  11.9k|    free(schunk->storage->dparams);
  713|  11.9k|    free(schunk->storage->io);
  714|  11.9k|    free(schunk->storage);
  715|  11.9k|  }
  716|       |
  717|       |  // If it is a view, the frame belongs to original array and should not be freed
  718|  12.1k|  if (schunk->frame != NULL && !schunk->view) {
  ------------------
  |  Branch (718:7): [True: 12.1k, False: 0]
  |  Branch (718:32): [True: 12.1k, False: 0]
  ------------------
  719|  12.1k|    frame_free((blosc2_frame_s *) schunk->frame);
  720|  12.1k|  }
  721|       |
  722|  12.1k|  schunk_free_vlmetalayers(schunk);
  723|       |
  724|  12.1k|  free(schunk);
  725|       |
  726|  12.1k|  return err;
  727|  12.1k|}
blosc2_schunk_from_buffer:
  731|  12.2k|blosc2_schunk* blosc2_schunk_from_buffer(uint8_t *cframe, int64_t len, bool copy) {
  732|       |  // Check that the buffer actually comes from a cframe
  733|  12.2k|  if (cframe == NULL || len < FRAME_HEADER_MINLEN) {
  ------------------
  |  |   49|  12.2k|#define FRAME_HEADER_MINLEN (FRAME_FILTER_PIPELINE + 1 + 16)  // 87 <- minimum length
  |  |  ------------------
  |  |  |  |   44|  12.2k|#define FRAME_FILTER_PIPELINE (FRAME_HAS_VLMETALAYERS + 1 + 1) // 70
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  12.2k|#define FRAME_HAS_VLMETALAYERS (FRAME_NTHREADS_D + 2)  // 68
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  12.2k|#define FRAME_NTHREADS_D (FRAME_NTHREADS_C + 2 + 1)  // 66
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   41|  12.2k|#define FRAME_NTHREADS_C (FRAME_CHUNKSIZE + 4 + 1)  // 63
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   40|  12.2k|#define FRAME_CHUNKSIZE (FRAME_BLOCKSIZE + 4 + 1)  // 58
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   39|  12.2k|#define FRAME_BLOCKSIZE (FRAME_TYPESIZE + 4 + 1)  // 53
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   38|  12.2k|#define FRAME_TYPESIZE (FRAME_CBYTES + 8 + 1) // 48
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   37|  12.2k|#define FRAME_CBYTES (FRAME_NBYTES + 8 + 1)  // 39
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   36|  12.2k|#define FRAME_NBYTES (FRAME_FLAGS + 4 + 1)  // 30
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   32|  12.2k|#define FRAME_FLAGS (FRAME_LEN + 8 + 1)  // 25
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   31|  12.2k|#define FRAME_LEN (FRAME_HEADER_LEN + 4 + 1)  // 16
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   30|  12.2k|#define FRAME_HEADER_LEN (FRAME_HEADER_MAGIC + 8 + 1)  // 11
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   29|  12.2k|#define FRAME_HEADER_MAGIC 2
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (733:7): [True: 0, False: 12.2k]
  |  Branch (733:25): [True: 0, False: 12.2k]
  ------------------
  734|      0|    return NULL;
  735|      0|  }
  736|  12.2k|  char *magic_number = (char *)cframe + FRAME_HEADER_MAGIC;
  ------------------
  |  |   29|  12.2k|#define FRAME_HEADER_MAGIC 2
  ------------------
  737|  12.2k|  if (memcmp(magic_number, "b2frame", sizeof("b2frame")) != 0) {
  ------------------
  |  Branch (737:7): [True: 75, False: 12.1k]
  ------------------
  738|     75|    return NULL;
  739|     75|  }
  740|  12.1k|  blosc2_frame_s* frame = frame_from_cframe(cframe, len, false);
  741|  12.1k|  if (frame == NULL) {
  ------------------
  |  Branch (741:7): [True: 19, False: 12.1k]
  ------------------
  742|     19|    return NULL;
  743|     19|  }
  744|  12.1k|  blosc2_schunk* schunk = frame_to_schunk(frame, copy, &BLOSC2_IO_DEFAULTS);
  745|  12.1k|  if (schunk && copy) {
  ------------------
  |  Branch (745:7): [True: 654, False: 11.4k]
  |  Branch (745:17): [True: 0, False: 654]
  ------------------
  746|       |    // Super-chunk has its own copy of frame
  747|      0|    frame_free(frame);
  748|      0|  }
  749|  12.1k|  return schunk;
  750|  12.1k|}
blosc2_schunk_decompress_chunk:
 1482|  45.5k|                                   void *dest, int32_t nbytes) {
 1483|  45.5k|  int rc = validate_nchunk(schunk, nchunk, false, "blosc2_schunk_decompress_chunk");
 1484|  45.5k|  if (rc < 0) {
  ------------------
  |  Branch (1484:7): [True: 0, False: 45.5k]
  ------------------
 1485|      0|    return rc;
 1486|      0|  }
 1487|       |
 1488|  45.5k|  int32_t chunk_nbytes;
 1489|  45.5k|  int32_t chunk_cbytes;
 1490|  45.5k|  int chunksize;
 1491|  45.5k|  blosc2_frame_s* frame = (blosc2_frame_s*)schunk->frame;
 1492|       |
 1493|  45.5k|  schunk->current_nchunk = nchunk;
 1494|  45.5k|  if (frame == NULL) {
  ------------------
  |  Branch (1494:7): [True: 0, False: 45.5k]
  ------------------
 1495|      0|    uint8_t* src = schunk->data[nchunk];
 1496|      0|    if (src == 0) {
  ------------------
  |  Branch (1496:9): [True: 0, False: 0]
  ------------------
 1497|      0|      return 0;
 1498|      0|    }
 1499|       |
 1500|      0|    rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 1501|      0|    if (rc < 0) {
  ------------------
  |  Branch (1501:9): [True: 0, False: 0]
  ------------------
 1502|      0|      return rc;
 1503|      0|    }
 1504|       |
 1505|      0|    if (nbytes < chunk_nbytes) {
  ------------------
  |  Branch (1505:9): [True: 0, False: 0]
  ------------------
 1506|      0|      BLOSC_TRACE_ERROR("Buffer size is too small for the decompressed buffer "
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1507|      0|                        "('%d' bytes, but '%d' are needed).", nbytes, chunk_nbytes);
 1508|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 1509|      0|    }
 1510|       |
 1511|      0|    chunksize = blosc2_decompress_ctx(schunk->dctx, src, chunk_cbytes, dest, nbytes);
 1512|      0|    if (chunksize < 0 || chunksize != chunk_nbytes) {
  ------------------
  |  Branch (1512:9): [True: 0, False: 0]
  |  Branch (1512:26): [True: 0, False: 0]
  ------------------
 1513|      0|      BLOSC_TRACE_ERROR("Error in decompressing chunk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1514|      0|      if (chunksize < 0)
  ------------------
  |  Branch (1514:11): [True: 0, False: 0]
  ------------------
 1515|      0|        return chunksize;
 1516|      0|      return BLOSC2_ERROR_FAILURE;
 1517|      0|    }
 1518|  45.5k|  } else {
 1519|  45.5k|    rc = frame_lock(frame, false);
 1520|  45.5k|    if (rc < 0) {
  ------------------
  |  Branch (1520:9): [True: 0, False: 45.5k]
  ------------------
 1521|      0|      return rc;
 1522|      0|    }
 1523|  45.5k|    chunksize = frame_decompress_chunk(schunk->dctx, frame, nchunk, dest, nbytes);
 1524|  45.5k|    frame_unlock(frame);
 1525|  45.5k|    if (chunksize < 0) {
  ------------------
  |  Branch (1525:9): [True: 525, False: 45.0k]
  ------------------
 1526|    525|      return chunksize;
 1527|    525|    }
 1528|  45.5k|  }
 1529|  45.0k|  return chunksize;
 1530|  45.5k|}
schunk.c:validate_nchunk:
   44|  45.5k|static int validate_nchunk(blosc2_schunk *schunk, int64_t nchunk, bool allow_end, const char *func_name) {
   45|  45.5k|  if (nchunk < 0) {
  ------------------
  |  Branch (45:7): [True: 0, False: 45.5k]
  ------------------
   46|      0|    BLOSC_TRACE_ERROR("nchunk ('%" PRId64 "') is negative in %s.", nchunk, func_name);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   47|      0|    return BLOSC2_ERROR_INVALID_PARAM;
   48|      0|  }
   49|       |
   50|  45.5k|  if (allow_end) {
  ------------------
  |  Branch (50:7): [True: 0, False: 45.5k]
  ------------------
   51|      0|    if (nchunk > schunk->nchunks) {
  ------------------
  |  Branch (51:9): [True: 0, False: 0]
  ------------------
   52|      0|      BLOSC_TRACE_ERROR("nchunk ('%" PRId64 "') is out of range [0, %" PRId64 "] in %s.",
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   53|      0|                        nchunk, schunk->nchunks, func_name);
   54|      0|      return BLOSC2_ERROR_INVALID_PARAM;
   55|      0|    }
   56|      0|  }
   57|  45.5k|  else {
   58|  45.5k|    if (nchunk >= schunk->nchunks) {
  ------------------
  |  Branch (58:9): [True: 0, False: 45.5k]
  ------------------
   59|      0|      BLOSC_TRACE_ERROR("nchunk ('%" PRId64 "') exceeds the number of chunks "
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   60|      0|                        "('%" PRId64 "') in %s.", nchunk, schunk->nchunks, func_name);
   61|      0|      return BLOSC2_ERROR_INVALID_PARAM;
   62|      0|    }
   63|  45.5k|  }
   64|       |
   65|  45.5k|  return BLOSC2_ERROR_SUCCESS;
   66|  45.5k|}

unshuffle_avx2:
  784|  83.0k|               const uint8_t *_src, uint8_t *_dest) {
  785|  83.0k|  const int32_t vectorized_chunk_size = bytesoftype * (int32_t)sizeof(__m256i);
  786|       |
  787|       |  /* If the block size is too small to be vectorized,
  788|       |     use the generic implementation. */
  789|  83.0k|  if (blocksize < vectorized_chunk_size) {
  ------------------
  |  Branch (789:7): [True: 40.8k, False: 42.1k]
  ------------------
  790|  40.8k|    unshuffle_generic(bytesoftype, blocksize, _src, _dest);
  791|  40.8k|    return;
  792|  40.8k|  }
  793|       |
  794|       |  /* If the blocksize is not a multiple of both the typesize and
  795|       |     the vector size, round the blocksize down to the next value
  796|       |     which is a multiple of both. The vectorized unshuffle can be
  797|       |     used for that portion of the data, and the naive implementation
  798|       |     can be used for the remaining portion. */
  799|  42.1k|  const int32_t vectorizable_bytes = blocksize - (blocksize % vectorized_chunk_size);
  800|       |
  801|  42.1k|  const int32_t vectorizable_elements = vectorizable_bytes / bytesoftype;
  802|  42.1k|  const int32_t total_elements = blocksize / bytesoftype;
  803|       |
  804|       |  /* Optimized unshuffle implementations */
  805|  42.1k|  switch (bytesoftype) {
  806|  4.88k|    case 2:
  ------------------
  |  Branch (806:5): [True: 4.88k, False: 37.2k]
  ------------------
  807|  4.88k|      unshuffle2_avx2(_dest, _src, vectorizable_elements, total_elements);
  808|  4.88k|      break;
  809|    918|    case 4:
  ------------------
  |  Branch (809:5): [True: 918, False: 41.2k]
  ------------------
  810|    918|      unshuffle4_avx2(_dest, _src, vectorizable_elements, total_elements);
  811|    918|      break;
  812|  12.6k|    case 8:
  ------------------
  |  Branch (812:5): [True: 12.6k, False: 29.5k]
  ------------------
  813|  12.6k|      unshuffle8_avx2(_dest, _src, vectorizable_elements, total_elements);
  814|  12.6k|      break;
  815|    721|    case 12:
  ------------------
  |  Branch (815:5): [True: 721, False: 41.4k]
  ------------------
  816|    721|      unshuffle12_avx2(_dest, _src, vectorizable_elements, total_elements);
  817|    721|      break;
  818|    581|    case 16:
  ------------------
  |  Branch (818:5): [True: 581, False: 41.5k]
  ------------------
  819|    581|      unshuffle16_avx2(_dest, _src, vectorizable_elements, total_elements);
  820|    581|      break;
  821|  22.4k|    default:
  ------------------
  |  Branch (821:5): [True: 22.4k, False: 19.7k]
  ------------------
  822|       |      /* For types larger than 16 bytes, use the AVX2 tiled unshuffle. */
  823|  22.4k|      if (bytesoftype > (int32_t)sizeof(__m128i)) {
  ------------------
  |  Branch (823:11): [True: 17.3k, False: 5.09k]
  ------------------
  824|  17.3k|        unshuffle16_tiled_avx2(_dest, _src, vectorizable_elements, total_elements, bytesoftype);
  825|  17.3k|      }
  826|  5.09k|      else {
  827|       |        /* Non-optimized unshuffle */
  828|  5.09k|        unshuffle_generic(bytesoftype, blocksize, _src, _dest);
  829|       |        /* The non-optimized function covers the whole buffer,
  830|       |           so we're done processing here. */
  831|  5.09k|        return;
  832|  5.09k|      }
  833|  42.1k|  }
  834|       |
  835|       |  /* If the buffer had any bytes at the end which couldn't be handled
  836|       |     by the vectorized implementations, use the non-optimized version
  837|       |     to finish them up. */
  838|  37.0k|  if (vectorizable_bytes < blocksize) {
  ------------------
  |  Branch (838:7): [True: 31.5k, False: 5.48k]
  ------------------
  839|  31.5k|    unshuffle_generic_inline(bytesoftype, vectorizable_bytes, blocksize, _src, _dest);
  840|  31.5k|  }
  841|  37.0k|}
shuffle-avx2.c:unshuffle2_avx2:
  338|  4.88k|                const int32_t vectorizable_elements, const int32_t total_elements) {
  339|  4.88k|  static const int32_t bytesoftype = 2;
  340|  4.88k|  int32_t i;
  341|  4.88k|  int j;
  342|  4.88k|  __m256i ymm0[2], ymm1[2];
  343|       |
  344|  17.9M|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (344:15): [True: 17.9M, False: 4.88k]
  ------------------
  345|       |    /* Load 32 elements (64 bytes) into 2 YMM registers. */
  346|  17.9M|    const uint8_t* const src_for_ith_element = src + i;
  347|  53.9M|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (347:17): [True: 35.9M, False: 17.9M]
  ------------------
  348|  35.9M|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  349|  35.9M|    }
  350|       |    /* Shuffle bytes */
  351|  53.9M|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (351:17): [True: 35.9M, False: 17.9M]
  ------------------
  352|  35.9M|      ymm0[j] = _mm256_permute4x64_epi64(ymm0[j], 0xd8);
  353|  35.9M|    }
  354|       |    /* Compute the low 64 bytes */
  355|  17.9M|    ymm1[0] = _mm256_unpacklo_epi8(ymm0[0], ymm0[1]);
  356|       |    /* Compute the hi 64 bytes */
  357|  17.9M|    ymm1[1] = _mm256_unpackhi_epi8(ymm0[0], ymm0[1]);
  358|       |    /* Store the result vectors in proper order */
  359|  17.9M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * sizeof(__m256i))), ymm1[0]);
  360|  17.9M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * sizeof(__m256i))), ymm1[1]);
  361|  17.9M|  }
  362|  4.88k|}
shuffle-avx2.c:unshuffle4_avx2:
  367|    918|                const int32_t vectorizable_elements, const int32_t total_elements) {
  368|    918|  static const int32_t bytesoftype = 4;
  369|    918|  int32_t i;
  370|    918|  int j;
  371|    918|  __m256i ymm0[4], ymm1[4];
  372|       |
  373|  11.4M|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (373:15): [True: 11.4M, False: 918]
  ------------------
  374|       |    /* Load 32 elements (128 bytes) into 4 YMM registers. */
  375|  11.4M|    const uint8_t* const src_for_ith_element = src + i;
  376|  57.0M|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (376:17): [True: 45.6M, False: 11.4M]
  ------------------
  377|  45.6M|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  378|  45.6M|    }
  379|       |    /* Shuffle bytes */
  380|  34.2M|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (380:17): [True: 22.8M, False: 11.4M]
  ------------------
  381|       |      /* Compute the low 64 bytes */
  382|  22.8M|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  383|       |      /* Compute the hi 64 bytes */
  384|  22.8M|      ymm1[2 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  385|  22.8M|    }
  386|       |    /* Shuffle 2-byte words */
  387|  34.2M|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (387:17): [True: 22.8M, False: 11.4M]
  ------------------
  388|       |      /* Compute the low 64 bytes */
  389|  22.8M|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  390|       |      /* Compute the hi 64 bytes */
  391|  22.8M|      ymm0[2 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  392|  22.8M|    }
  393|  11.4M|    ymm1[0] = _mm256_permute2x128_si256(ymm0[0], ymm0[2], 0x20);
  394|  11.4M|    ymm1[1] = _mm256_permute2x128_si256(ymm0[1], ymm0[3], 0x20);
  395|  11.4M|    ymm1[2] = _mm256_permute2x128_si256(ymm0[0], ymm0[2], 0x31);
  396|  11.4M|    ymm1[3] = _mm256_permute2x128_si256(ymm0[1], ymm0[3], 0x31);
  397|       |
  398|       |    /* Store the result vectors in proper order */
  399|  57.0M|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (399:17): [True: 45.6M, False: 11.4M]
  ------------------
  400|  45.6M|      _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (j * sizeof(__m256i))), ymm1[j]);
  401|  45.6M|    }
  402|  11.4M|  }
  403|    918|}
shuffle-avx2.c:unshuffle8_avx2:
  408|  12.6k|                const int32_t vectorizable_elements, const int32_t total_elements) {
  409|  12.6k|  static const int32_t bytesoftype = 8;
  410|  12.6k|  int32_t i;
  411|  12.6k|  int j;
  412|  12.6k|  __m256i ymm0[8], ymm1[8];
  413|       |
  414|  14.8M|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (414:15): [True: 14.8M, False: 12.6k]
  ------------------
  415|       |    /* Fetch 32 elements (256 bytes) into 8 YMM registers. */
  416|  14.8M|    const uint8_t* const src_for_ith_element = src + i;
  417|   133M|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (417:17): [True: 118M, False: 14.8M]
  ------------------
  418|   118M|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  419|   118M|    }
  420|       |    /* Shuffle bytes */
  421|  74.1M|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (421:17): [True: 59.2M, False: 14.8M]
  ------------------
  422|       |      /* Compute the low 32 bytes */
  423|  59.2M|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  424|       |      /* Compute the hi 32 bytes */
  425|  59.2M|      ymm1[4 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  426|  59.2M|    }
  427|       |    /* Shuffle words */
  428|  74.1M|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (428:17): [True: 59.2M, False: 14.8M]
  ------------------
  429|       |      /* Compute the low 32 bytes */
  430|  59.2M|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  431|       |      /* Compute the hi 32 bytes */
  432|  59.2M|      ymm0[4 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  433|  59.2M|    }
  434|   133M|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (434:17): [True: 118M, False: 14.8M]
  ------------------
  435|   118M|      ymm0[j] = _mm256_permute4x64_epi64(ymm0[j], 0xd8);
  436|   118M|    }
  437|       |
  438|       |    /* Shuffle 4-byte dwords */
  439|  74.1M|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (439:17): [True: 59.2M, False: 14.8M]
  ------------------
  440|       |      /* Compute the low 32 bytes */
  441|  59.2M|      ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  442|       |      /* Compute the hi 32 bytes */
  443|  59.2M|      ymm1[4 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  444|  59.2M|    }
  445|       |
  446|       |    /* Store the result vectors in proper order */
  447|  14.8M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * sizeof(__m256i))), ymm1[0]);
  448|  14.8M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * sizeof(__m256i))), ymm1[2]);
  449|  14.8M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (2 * sizeof(__m256i))), ymm1[1]);
  450|  14.8M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (3 * sizeof(__m256i))), ymm1[3]);
  451|  14.8M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (4 * sizeof(__m256i))), ymm1[4]);
  452|  14.8M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (5 * sizeof(__m256i))), ymm1[6]);
  453|  14.8M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (6 * sizeof(__m256i))), ymm1[5]);
  454|  14.8M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (7 * sizeof(__m256i))), ymm1[7]);
  455|  14.8M|  }
  456|  12.6k|}
shuffle-avx2.c:unshuffle12_avx2:
  533|    721|    const int32_t vectorizable_elements, const int32_t total_elements) {
  534|    721|  static const int32_t bytesoftype = 12;
  535|    721|  int32_t i;
  536|    721|  int j;
  537|    721|  __m256i ymm0[16], ymm1[16];
  538|       |
  539|    721|  __m256i permute = _mm256_set_epi32(0,0,6,5,4,2,1,0);
  540|    721|  __m256i store_mask = _mm256_set_epi32(0x0, 0x0, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
  541|    721|  int32_t jump = 2*bytesoftype;
  542|   414k|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (542:15): [True: 414k, False: 721]
  ------------------
  543|       |    /* Fetch 24 elements (384 bytes) into 12 YMM registers. */
  544|   414k|    const uint8_t* const src_for_ith_element = src + i;
  545|  5.38M|    for (j = 0; j < bytesoftype; j++) {
  ------------------
  |  Branch (545:17): [True: 4.96M, False: 414k]
  ------------------
  546|  4.96M|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  547|  4.96M|    }
  548|       |    /* Initialize the last 4 registers (128 bytes) to null */
  549|  2.07M|    for (j = bytesoftype; j < 16; j++) {
  ------------------
  |  Branch (549:27): [True: 1.65M, False: 414k]
  ------------------
  550|  1.65M|      ymm0[j] = _mm256_setzero_si256();
  551|  1.65M|    }
  552|       |
  553|       |    /* Shuffle bytes */
  554|  3.72M|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (554:17): [True: 3.31M, False: 414k]
  ------------------
  555|       |      /* Compute the low 32 bytes */
  556|  3.31M|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  557|       |      /* Compute the hi 32 bytes */
  558|  3.31M|      ymm1[8 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  559|  3.31M|    }
  560|       |    /* Shuffle 2-byte words */
  561|  3.72M|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (561:17): [True: 3.31M, False: 414k]
  ------------------
  562|       |      /* Compute the low 32 bytes */
  563|  3.31M|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  564|       |      /* Compute the hi 32 bytes */
  565|  3.31M|      ymm0[8 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  566|  3.31M|    }
  567|       |    /* Shuffle 4-byte dwords */
  568|  3.72M|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (568:17): [True: 3.31M, False: 414k]
  ------------------
  569|       |      /* Compute the low 32 bytes */
  570|  3.31M|      ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  571|       |      /* Compute the hi 32 bytes */
  572|  3.31M|      ymm1[8 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  573|  3.31M|    }
  574|       |
  575|       |    /* Shuffle 8-byte qwords */
  576|  3.72M|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (576:17): [True: 3.31M, False: 414k]
  ------------------
  577|       |      /* Compute the low 32 bytes */
  578|  3.31M|      ymm0[j] = _mm256_unpacklo_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  579|       |      /* Compute the hi 32 bytes */
  580|  3.31M|      ymm0[8 + j] = _mm256_unpackhi_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  581|  3.31M|    }
  582|       |
  583|       |
  584|  3.72M|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (584:17): [True: 3.31M, False: 414k]
  ------------------
  585|  3.31M|      ymm1[j] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x20);
  586|  3.31M|      ymm1[j + 8] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x31);
  587|  3.31M|      ymm1[j] = _mm256_permutevar8x32_epi32(ymm1[j], permute);
  588|  3.31M|      ymm1[j+8] = _mm256_permutevar8x32_epi32(ymm1[j+8], permute);
  589|       |
  590|       |
  591|  3.31M|    }
  592|   414k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * jump)), ymm1[0]);
  593|   414k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * jump)), ymm1[4]);
  594|   414k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (2 * jump)), ymm1[2]);
  595|   414k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (3 * jump)), ymm1[6]);
  596|   414k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (4 * jump)), ymm1[1]);
  597|   414k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (5 * jump)), ymm1[5]);
  598|   414k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (6 * jump)), ymm1[3]);
  599|   414k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (7 * jump)), ymm1[7]);
  600|   414k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (8 * jump)), ymm1[8]);
  601|   414k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (9 * jump)), ymm1[12]);
  602|   414k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (10 * jump)), ymm1[10]);
  603|   414k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (11 * jump)), ymm1[14]);
  604|   414k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (12 * jump)), ymm1[9]);
  605|   414k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (13 * jump)), ymm1[13]);
  606|   414k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (14 * jump)), ymm1[11]);
  607|   414k|    _mm256_maskstore_epi32((int *)(dest + (i * bytesoftype) + (15 * jump)), store_mask, ymm1[15]);
  608|   414k|  }
  609|    721|}
shuffle-avx2.c:unshuffle16_avx2:
  461|    581|                 const int32_t vectorizable_elements, const int32_t total_elements) {
  462|    581|  static const int32_t bytesoftype = 16;
  463|    581|  int32_t i;
  464|    581|  int j;
  465|    581|  __m256i ymm0[16], ymm1[16];
  466|       |
  467|  6.72M|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (467:15): [True: 6.72M, False: 581]
  ------------------
  468|       |    /* Fetch 32 elements (512 bytes) into 16 YMM registers. */
  469|  6.72M|    const uint8_t* const src_for_ith_element = src + i;
  470|   114M|    for (j = 0; j < 16; j++) {
  ------------------
  |  Branch (470:17): [True: 107M, False: 6.72M]
  ------------------
  471|   107M|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  472|   107M|    }
  473|       |
  474|       |    /* Shuffle bytes */
  475|  60.5M|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (475:17): [True: 53.7M, False: 6.72M]
  ------------------
  476|       |      /* Compute the low 32 bytes */
  477|  53.7M|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  478|       |      /* Compute the hi 32 bytes */
  479|  53.7M|      ymm1[8 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  480|  53.7M|    }
  481|       |    /* Shuffle 2-byte words */
  482|  60.5M|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (482:17): [True: 53.7M, False: 6.72M]
  ------------------
  483|       |      /* Compute the low 32 bytes */
  484|  53.7M|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  485|       |      /* Compute the hi 32 bytes */
  486|  53.7M|      ymm0[8 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  487|  53.7M|    }
  488|       |    /* Shuffle 4-byte dwords */
  489|  60.5M|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (489:17): [True: 53.7M, False: 6.72M]
  ------------------
  490|       |      /* Compute the low 32 bytes */
  491|  53.7M|      ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  492|       |      /* Compute the hi 32 bytes */
  493|  53.7M|      ymm1[8 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  494|  53.7M|    }
  495|       |
  496|       |    /* Shuffle 8-byte qwords */
  497|  60.5M|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (497:17): [True: 53.7M, False: 6.72M]
  ------------------
  498|       |      /* Compute the low 32 bytes */
  499|  53.7M|      ymm0[j] = _mm256_unpacklo_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  500|       |      /* Compute the hi 32 bytes */
  501|  53.7M|      ymm0[8 + j] = _mm256_unpackhi_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  502|  53.7M|    }
  503|       |
  504|  60.5M|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (504:17): [True: 53.7M, False: 6.72M]
  ------------------
  505|  53.7M|      ymm1[j] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x20);
  506|  53.7M|      ymm1[j + 8] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x31);
  507|  53.7M|    }
  508|       |
  509|       |    /* Store the result vectors in proper order */
  510|  6.72M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * sizeof(__m256i))), ymm1[0]);
  511|  6.72M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * sizeof(__m256i))), ymm1[4]);
  512|  6.72M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (2 * sizeof(__m256i))), ymm1[2]);
  513|  6.72M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (3 * sizeof(__m256i))), ymm1[6]);
  514|  6.72M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (4 * sizeof(__m256i))), ymm1[1]);
  515|  6.72M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (5 * sizeof(__m256i))), ymm1[5]);
  516|  6.72M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (6 * sizeof(__m256i))), ymm1[3]);
  517|  6.72M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (7 * sizeof(__m256i))), ymm1[7]);
  518|  6.72M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (8 * sizeof(__m256i))), ymm1[8]);
  519|  6.72M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (9 * sizeof(__m256i))), ymm1[12]);
  520|  6.72M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (10 * sizeof(__m256i))), ymm1[10]);
  521|  6.72M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (11 * sizeof(__m256i))), ymm1[14]);
  522|  6.72M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (12 * sizeof(__m256i))), ymm1[9]);
  523|  6.72M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (13 * sizeof(__m256i))), ymm1[13]);
  524|  6.72M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (14 * sizeof(__m256i))), ymm1[11]);
  525|  6.72M|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (15 * sizeof(__m256i))), ymm1[15]);
  526|  6.72M|  }
  527|    581|}
shuffle-avx2.c:unshuffle16_tiled_avx2:
  613|  17.3k|                       const int32_t vectorizable_elements, const int32_t total_elements, const int32_t bytesoftype) {
  614|  17.3k|  int32_t i;
  615|  17.3k|  int j;
  616|  17.3k|  __m256i ymm0[16], ymm1[16];
  617|       |
  618|  17.3k|  const lldiv_t vecs_per_el = lldiv(bytesoftype, sizeof(__m128i));
  619|  17.3k|  const int32_t vecs_rem = (int32_t)vecs_per_el.rem;
  620|       |
  621|       |  /* The unshuffle loops are inverted (compared to shuffle_tiled16_avx2)
  622|       |     to optimize cache utilization. */
  623|  17.3k|  int32_t offset_into_type;
  624|  73.2k|  for (offset_into_type = 0; offset_into_type < bytesoftype;
  ------------------
  |  Branch (624:30): [True: 55.9k, False: 17.3k]
  ------------------
  625|  55.9k|       offset_into_type += (offset_into_type == 0 && vecs_rem > 0 ? vecs_rem : (int32_t)sizeof(__m128i))) {
  ------------------
  |  Branch (625:29): [True: 17.3k, False: 38.6k]
  |  Branch (625:54): [True: 14.3k, False: 2.95k]
  ------------------
  626|  40.8M|    for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (626:17): [True: 40.7M, False: 55.9k]
  ------------------
  627|       |      /* Load the first 16 bytes of 32 adjacent elements (512 bytes) into 16 YMM registers */
  628|  40.7M|      const uint8_t* const src_for_ith_element = src + i;
  629|   693M|      for (j = 0; j < 16; j++) {
  ------------------
  |  Branch (629:19): [True: 652M, False: 40.7M]
  ------------------
  630|   652M|        ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (total_elements * (offset_into_type + j))));
  631|   652M|      }
  632|       |
  633|       |      /* Shuffle bytes */
  634|   367M|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (634:19): [True: 326M, False: 40.7M]
  ------------------
  635|       |        /* Compute the low 32 bytes */
  636|   326M|        ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  637|       |        /* Compute the hi 32 bytes */
  638|   326M|        ymm1[8 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  639|   326M|      }
  640|       |      /* Shuffle 2-byte words */
  641|   367M|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (641:19): [True: 326M, False: 40.7M]
  ------------------
  642|       |        /* Compute the low 32 bytes */
  643|   326M|        ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  644|       |        /* Compute the hi 32 bytes */
  645|   326M|        ymm0[8 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  646|   326M|      }
  647|       |      /* Shuffle 4-byte dwords */
  648|   367M|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (648:19): [True: 326M, False: 40.7M]
  ------------------
  649|       |        /* Compute the low 32 bytes */
  650|   326M|        ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  651|       |        /* Compute the hi 32 bytes */
  652|   326M|        ymm1[8 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  653|   326M|      }
  654|       |
  655|       |      /* Shuffle 8-byte qwords */
  656|   367M|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (656:19): [True: 326M, False: 40.7M]
  ------------------
  657|       |        /* Compute the low 32 bytes */
  658|   326M|        ymm0[j] = _mm256_unpacklo_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  659|       |        /* Compute the hi 32 bytes */
  660|   326M|        ymm0[8 + j] = _mm256_unpackhi_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  661|   326M|      }
  662|       |
  663|   367M|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (663:19): [True: 326M, False: 40.7M]
  ------------------
  664|   326M|        ymm1[j] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x20);
  665|   326M|        ymm1[j + 8] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x31);
  666|   326M|      }
  667|       |
  668|       |      /* Store the result vectors in proper order */
  669|  40.7M|      const uint8_t* const dest_with_offset = dest + offset_into_type;
  670|  40.7M|      _mm256_storeu2_m128i(
  671|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x01) * bytesoftype),
  672|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x00) * bytesoftype), ymm1[0]);
  673|  40.7M|      _mm256_storeu2_m128i(
  674|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x03) * bytesoftype),
  675|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x02) * bytesoftype), ymm1[4]);
  676|  40.7M|      _mm256_storeu2_m128i(
  677|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x05) * bytesoftype),
  678|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x04) * bytesoftype), ymm1[2]);
  679|  40.7M|      _mm256_storeu2_m128i(
  680|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x07) * bytesoftype),
  681|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x06) * bytesoftype), ymm1[6]);
  682|  40.7M|      _mm256_storeu2_m128i(
  683|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x09) * bytesoftype),
  684|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x08) * bytesoftype), ymm1[1]);
  685|  40.7M|      _mm256_storeu2_m128i(
  686|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x0b) * bytesoftype),
  687|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x0a) * bytesoftype), ymm1[5]);
  688|  40.7M|      _mm256_storeu2_m128i(
  689|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x0d) * bytesoftype),
  690|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x0c) * bytesoftype), ymm1[3]);
  691|  40.7M|      _mm256_storeu2_m128i(
  692|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x0f) * bytesoftype),
  693|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x0e) * bytesoftype), ymm1[7]);
  694|  40.7M|      _mm256_storeu2_m128i(
  695|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x11) * bytesoftype),
  696|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x10) * bytesoftype), ymm1[8]);
  697|  40.7M|      _mm256_storeu2_m128i(
  698|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x13) * bytesoftype),
  699|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x12) * bytesoftype), ymm1[12]);
  700|  40.7M|      _mm256_storeu2_m128i(
  701|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x15) * bytesoftype),
  702|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x14) * bytesoftype), ymm1[10]);
  703|  40.7M|      _mm256_storeu2_m128i(
  704|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x17) * bytesoftype),
  705|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x16) * bytesoftype), ymm1[14]);
  706|  40.7M|      _mm256_storeu2_m128i(
  707|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x19) * bytesoftype),
  708|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x18) * bytesoftype), ymm1[9]);
  709|  40.7M|      _mm256_storeu2_m128i(
  710|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x1b) * bytesoftype),
  711|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x1a) * bytesoftype), ymm1[13]);
  712|  40.7M|      _mm256_storeu2_m128i(
  713|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x1d) * bytesoftype),
  714|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x1c) * bytesoftype), ymm1[11]);
  715|  40.7M|      _mm256_storeu2_m128i(
  716|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x1f) * bytesoftype),
  717|  40.7M|          (__m128i*)(dest_with_offset + (i + 0x1e) * bytesoftype), ymm1[15]);
  718|  40.7M|    }
  719|  55.9k|  }
  720|  17.3k|}

unshuffle_generic:
   22|  45.9k|                       const uint8_t *_src, uint8_t *_dest) {
   23|       |  /* Non-optimized unshuffle */
   24|  45.9k|  unshuffle_generic_inline(bytesoftype, 0, blocksize, _src, _dest);
   25|  45.9k|}

shuffle-generic.c:unshuffle_generic_inline:
   64|  45.9k|                                     const uint8_t *_src, uint8_t *_dest) {
   65|  45.9k|  int32_t i, j;
   66|       |
   67|       |  /* Calculate the number of elements in the block. */
   68|  45.9k|  const int32_t neblock_quot = blocksize / type_size;
   69|  45.9k|  const int32_t neblock_rem = blocksize % type_size;
   70|  45.9k|  const int32_t vectorizable_elements = vectorizable_blocksize / type_size;
   71|       |
   72|       |  /* Non-optimized unshuffle */
   73|  1.75G|  for (i = vectorizable_elements; i < (int32_t)neblock_quot; i++) {
  ------------------
  |  Branch (73:35): [True: 1.75G, False: 45.9k]
  ------------------
   74|  6.63G|    for (j = 0; j < type_size; j++) {
  ------------------
  |  Branch (74:17): [True: 4.87G, False: 1.75G]
  ------------------
   75|  4.87G|      _dest[i * type_size + j] = _src[j * neblock_quot + i];
   76|  4.87G|    }
   77|  1.75G|  }
   78|       |
   79|       |  /* Copy any leftover bytes in the block without unshuffling them. */
   80|  45.9k|  memcpy(_dest + (blocksize - neblock_rem), _src + (blocksize - neblock_rem), neblock_rem);
   81|  45.9k|}
shuffle-avx2.c:unshuffle_generic_inline:
   64|  31.5k|                                     const uint8_t *_src, uint8_t *_dest) {
   65|  31.5k|  int32_t i, j;
   66|       |
   67|       |  /* Calculate the number of elements in the block. */
   68|  31.5k|  const int32_t neblock_quot = blocksize / type_size;
   69|  31.5k|  const int32_t neblock_rem = blocksize % type_size;
   70|  31.5k|  const int32_t vectorizable_elements = vectorizable_blocksize / type_size;
   71|       |
   72|       |  /* Non-optimized unshuffle */
   73|   513k|  for (i = vectorizable_elements; i < (int32_t)neblock_quot; i++) {
  ------------------
  |  Branch (73:35): [True: 481k, False: 31.5k]
  ------------------
   74|  12.3M|    for (j = 0; j < type_size; j++) {
  ------------------
  |  Branch (74:17): [True: 11.8M, False: 481k]
  ------------------
   75|  11.8M|      _dest[i * type_size + j] = _src[j * neblock_quot + i];
   76|  11.8M|    }
   77|   481k|  }
   78|       |
   79|       |  /* Copy any leftover bytes in the block without unshuffling them. */
   80|  31.5k|  memcpy(_dest + (blocksize - neblock_rem), _src + (blocksize - neblock_rem), neblock_rem);
   81|  31.5k|}

blosc2_unshuffle:
  436|  83.0k|                 const void* src, void* dest) {
  437|       |  /* Initialize the shuffle implementation if necessary. */
  438|  83.0k|  init_shuffle_implementation();
  439|       |
  440|  83.0k|  if (typesize < 1 || typesize > 256 || blocksize < 0) {
  ------------------
  |  Branch (440:7): [True: 0, False: 83.0k]
  |  Branch (440:23): [True: 0, False: 83.0k]
  |  Branch (440:41): [True: 0, False: 83.0k]
  ------------------
  441|      0|    return BLOSC2_ERROR_INVALID_PARAM;
  442|      0|  }
  443|       |
  444|       |  /* The implementation is initialized.
  445|       |     Dispatch to it's unshuffle routine. */
  446|  83.0k|  (host_implementation.unshuffle)(typesize, blocksize, src, dest);
  447|       |
  448|  83.0k|  return blocksize;
  449|  83.0k|}
bitunshuffle:
  484|  50.9k|                     const uint8_t format_version) {
  485|       |  /* Initialize the shuffle implementation if necessary. */
  486|  50.9k|  init_shuffle_implementation();
  487|  50.9k|  size_t size = blocksize / typesize;
  488|       |
  489|  50.9k|  if (format_version == 2) {
  ------------------
  |  Branch (489:7): [True: 4.06k, False: 46.8k]
  ------------------
  490|       |    /* Starting from version 3, bitshuffle() works differently */
  491|  4.06k|    if ((size % 8) == 0) {
  ------------------
  |  Branch (491:9): [True: 1.34k, False: 2.71k]
  ------------------
  492|       |      /* The number of elems is a multiple of 8 which is supported by
  493|       |         bitshuffle. */
  494|  1.34k|      int ret = (int) (host_implementation.bitunshuffle)
  495|  1.34k|          ((const void *) src, (void *) dest, blocksize / typesize, typesize);
  496|  1.34k|      if (ret < 0) {
  ------------------
  |  Branch (496:11): [True: 0, False: 1.34k]
  ------------------
  497|       |        // Some error in bitshuffle (should not happen)
  498|      0|        BLOSC_TRACE_ERROR("the impossible happened: the bitunshuffle filter failed!");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  499|      0|        return ret;
  500|      0|      }
  501|  1.34k|    }
  502|  2.71k|    else {
  503|  2.71k|      memcpy(dest, src, blocksize);
  504|  2.71k|    }
  505|  4.06k|  }
  506|  46.8k|  else {
  507|       |    /* bitshuffle only supports a number of bytes that is a multiple of 8. */
  508|  46.8k|    size -= size % 8;
  509|  46.8k|    int ret = (int) (host_implementation.bitunshuffle)(src, dest, size, typesize);
  510|  46.8k|    if (ret < 0) {
  ------------------
  |  Branch (510:9): [True: 0, False: 46.8k]
  ------------------
  511|      0|      BLOSC_TRACE_ERROR("the impossible happened: the bitunshuffle filter failed!");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  512|      0|      return ret;
  513|      0|    }
  514|       |
  515|       |    /* Copy the leftovers */
  516|  46.8k|    size_t offset = size * typesize;
  517|  46.8k|    memcpy((uint8_t *) dest + offset, (const uint8_t *) src + offset, blocksize - offset);
  518|  46.8k|  }
  519|       |
  520|  50.9k|  return blocksize;
  521|  50.9k|}
shuffle.c:init_shuffle_implementation:
  391|   133k|void init_shuffle_implementation(void) {
  392|       |  /* Initialization could (in rare cases) take place concurrently on
  393|       |     multiple threads, but it shouldn't matter because the
  394|       |     initialization should return the same result on each thread (so
  395|       |     the implementation will be the same). Since that's the case we
  396|       |     can avoid complicated synchronization here and get a small
  397|       |     performance benefit because we don't need to perform a volatile
  398|       |     load on the initialization variable each time this function is
  399|       |     called. */
  400|   133k|#if defined(__GNUC__) || defined(__clang__)
  401|   133k|  if (__builtin_expect(!implementation_initialized, 0)) {
  ------------------
  |  Branch (401:7): [True: 1, False: 133k]
  ------------------
  402|       |#else
  403|       |    if (!implementation_initialized) {
  404|       |#endif
  405|       |    /* Initialize the implementation. */
  406|      1|    host_implementation = get_shuffle_implementation();
  407|       |
  408|       |    /* Set the flag indicating the implementation has been initialized. */
  409|      1|    implementation_initialized = 1;
  410|      1|  }
  411|   133k|}
shuffle.c:get_shuffle_implementation:
  290|      1|static shuffle_implementation_t get_shuffle_implementation(void) {
  291|      1|#if defined(SHUFFLE_AVX512_ENABLED) || defined(SHUFFLE_AVX2_ENABLED) || defined(SHUFFLE_SSE2_ENABLED) || defined(SHUFFLE_NEON_ENABLED) || defined(SHUFFLE_ALTIVEC_ENABLED)
  292|      1|  blosc_cpu_features cpu_features = blosc_get_cpu_features();
  293|      1|#endif
  294|      1|#if defined(SHUFFLE_AVX512_ENABLED)
  295|      1|  if (cpu_features & BLOSC_HAVE_AVX512 && is_shuffle_avx2 && is_bshuf_AVX512) {
  ------------------
  |  Branch (295:7): [True: 0, False: 1]
  |  Branch (295:43): [True: 0, False: 0]
  |  Branch (295:62): [True: 0, False: 0]
  ------------------
  296|      0|    shuffle_implementation_t impl_avx512;
  297|      0|    impl_avx512.name = "avx512";
  298|      0|    impl_avx512.shuffle = (shuffle_func)shuffle_avx2;
  299|      0|    impl_avx512.unshuffle = (unshuffle_func)unshuffle_avx2;
  300|      0|    impl_avx512.bitshuffle = (bitshuffle_func) bshuf_trans_bit_elem_AVX512;
  301|      0|    impl_avx512.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_AVX512;
  302|      0|    return impl_avx512;
  303|      0|  }
  304|      1|#endif  /* defined(SHUFFLE_AVX512_ENABLED) */
  305|       |
  306|      1|#if defined(SHUFFLE_AVX2_ENABLED)
  307|      1|  if (cpu_features & BLOSC_HAVE_AVX2 && is_shuffle_avx2 && is_bshuf_AVX) {
  ------------------
  |  Branch (307:7): [True: 1, False: 0]
  |  Branch (307:41): [True: 1, False: 0]
  |  Branch (307:60): [True: 1, False: 0]
  ------------------
  308|      1|    shuffle_implementation_t impl_avx2;
  309|      1|    impl_avx2.name = "avx2";
  310|      1|    impl_avx2.shuffle = (shuffle_func)shuffle_avx2;
  311|      1|    impl_avx2.unshuffle = (unshuffle_func)unshuffle_avx2;
  312|      1|    impl_avx2.bitshuffle = (bitshuffle_func) bshuf_trans_bit_elem_AVX;
  313|      1|    impl_avx2.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_AVX;
  314|      1|    return impl_avx2;
  315|      1|  }
  316|      0|#endif  /* defined(SHUFFLE_AVX2_ENABLED) */
  317|       |
  318|      0|#if defined(SHUFFLE_SSE2_ENABLED)
  319|      0|  if (cpu_features & BLOSC_HAVE_SSE2 && is_shuffle_sse2 && is_bshuf_SSE) {
  ------------------
  |  Branch (319:7): [True: 0, False: 0]
  |  Branch (319:41): [True: 0, False: 0]
  |  Branch (319:60): [True: 0, False: 0]
  ------------------
  320|      0|    shuffle_implementation_t impl_sse2;
  321|      0|    impl_sse2.name = "sse2";
  322|      0|    impl_sse2.shuffle = (shuffle_func)shuffle_sse2;
  323|      0|    impl_sse2.unshuffle = (unshuffle_func)unshuffle_sse2;
  324|      0|    impl_sse2.bitshuffle = (bitshuffle_func)bshuf_trans_bit_elem_SSE;
  325|      0|    impl_sse2.bitunshuffle = (bitunshuffle_func) bshuf_untrans_bit_elem_SSE;
  326|      0|    return impl_sse2;
  327|      0|  }
  328|      0|#endif  /* defined(SHUFFLE_SSE2_ENABLED) */
  329|       |
  330|       |#if defined(SHUFFLE_NEON_ENABLED)
  331|       |  if (cpu_features & BLOSC_HAVE_NEON && is_shuffle_neon) { // && is_bshuf_NEON if using NEON bitshuffle
  332|       |    shuffle_implementation_t impl_neon;
  333|       |    impl_neon.name = "neon";
  334|       |    impl_neon.shuffle = (shuffle_func)shuffle_neon;
  335|       |    impl_neon.unshuffle = (unshuffle_func)unshuffle_neon;
  336|       |    //impl_neon.shuffle = (shuffle_func)shuffle_generic;
  337|       |    //impl_neon.unshuffle = (unshuffle_func)unshuffle_generic;
  338|       |    //impl_neon.bitshuffle = (bitshuffle_func)bshuf_trans_bit_elem_NEON;
  339|       |    //impl_neon.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_NEON;
  340|       |    // The current bitshuffle optimized for NEON is not any faster
  341|       |    // (in fact, it is pretty much slower) than the scalar implementation.
  342|       |    // So, let's use the scalar one, which is pretty fast, at least on a M1 CPU.
  343|       |    impl_neon.bitshuffle = (bitshuffle_func)bshuf_trans_bit_elem_scal;
  344|       |    impl_neon.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_scal;
  345|       |    return impl_neon;
  346|       |  }
  347|       |#endif  /* defined(SHUFFLE_NEON_ENABLED) */
  348|       |
  349|       |#if defined(SHUFFLE_ALTIVEC_ENABLED)
  350|       |  if (cpu_features & BLOSC_HAVE_ALTIVEC && is_shuffle_altivec && is_bshuf_altivec) {
  351|       |    shuffle_implementation_t impl_altivec;
  352|       |    impl_altivec.name = "altivec";
  353|       |    impl_altivec.shuffle = (shuffle_func)shuffle_altivec;
  354|       |    impl_altivec.unshuffle = (unshuffle_func)unshuffle_altivec;
  355|       |    impl_altivec.bitshuffle = (bitshuffle_func)bshuf_trans_bit_elem_altivec;
  356|       |    impl_altivec.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_altivec;
  357|       |    return impl_altivec;
  358|       |  }
  359|       |#endif  /* defined(SHUFFLE_ALTIVEC_ENABLED) */
  360|       |
  361|       |  /* Processor doesn't support any of the hardware-accelerated implementations,
  362|       |     so use the generic implementation. */
  363|      0|  shuffle_implementation_t impl_generic;
  364|      0|  impl_generic.name = "generic";
  365|      0|  impl_generic.shuffle = (shuffle_func)shuffle_generic;
  366|      0|  impl_generic.unshuffle = (unshuffle_func)unshuffle_generic;
  367|      0|  impl_generic.bitshuffle = (bitshuffle_func)bshuf_trans_bit_elem_scal;
  368|      0|  impl_generic.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_scal;
  369|      0|  return impl_generic;
  370|      0|}
shuffle.c:blosc_get_cpu_features:
  100|      1|static blosc_cpu_features blosc_get_cpu_features(void) {
  101|      1|  blosc_cpu_features cpu_features = BLOSC_HAVE_NOTHING;
  102|      1|  if (__builtin_cpu_supports("sse2")) {
  ------------------
  |  Branch (102:7): [True: 1, False: 0]
  ------------------
  103|      1|    cpu_features |= BLOSC_HAVE_SSE2;
  104|      1|  }
  105|      1|  if (__builtin_cpu_supports("avx2")) {
  ------------------
  |  Branch (105:7): [True: 1, False: 0]
  ------------------
  106|      1|    cpu_features |= BLOSC_HAVE_AVX2;
  107|      1|  }
  108|      1|  if (__builtin_cpu_supports("avx512f") && __builtin_cpu_supports("avx512bw")) {
  ------------------
  |  Branch (108:7): [True: 0, False: 1]
  |  Branch (108:44): [True: 0, False: 0]
  ------------------
  109|      0|    cpu_features |= BLOSC_HAVE_AVX512;
  110|      0|  }
  111|      1|  return cpu_features;
  112|      1|}

blosc_stune_next_blocksize:
   47|  11.7k|int blosc_stune_next_blocksize(blosc2_context *context) {
   48|  11.7k|  int32_t clevel = context->clevel;
   49|  11.7k|  int32_t typesize = context->typesize;
   50|  11.7k|  int32_t nbytes = context->sourcesize;
   51|  11.7k|  int32_t user_blocksize = context->blocksize;
   52|  11.7k|  int32_t blocksize = nbytes;
   53|       |
   54|       |  // Protection against very small buffers
   55|  11.7k|  if (nbytes < typesize) {
  ------------------
  |  Branch (55:7): [True: 10.2k, False: 1.51k]
  ------------------
   56|  10.2k|    context->blocksize = 1;
   57|  10.2k|    return BLOSC2_ERROR_SUCCESS;
   58|  10.2k|  }
   59|       |
   60|  1.51k|  int splitmode = split_block(context, typesize, blocksize);
   61|  1.51k|  if (user_blocksize) {
  ------------------
  |  Branch (61:7): [True: 1.06k, False: 452]
  ------------------
   62|  1.06k|    blocksize = user_blocksize;
   63|  1.06k|    goto last;
   64|  1.06k|  }
   65|       |
   66|    452|  if (nbytes >= L1) {
  ------------------
  |  |   19|    452|#define L1 (32 * 1024)
  ------------------
  |  Branch (66:7): [True: 451, False: 1]
  ------------------
   67|    451|    blocksize = L1;
  ------------------
  |  |   19|    451|#define L1 (32 * 1024)
  ------------------
   68|       |
   69|       |    /* For HCR codecs, increase the block sizes by a factor of 2 because they
   70|       |        are meant for compressing large blocks (i.e. they show a big overhead
   71|       |        when compressing small ones). */
   72|    451|    if (is_HCR(context)) {
  ------------------
  |  Branch (72:9): [True: 0, False: 451]
  ------------------
   73|      0|      blocksize *= 2;
   74|      0|    }
   75|       |
   76|       |    // Choose a different blocksize depending on the compression level
   77|    451|    switch (clevel) {
   78|      0|      case 0:
  ------------------
  |  Branch (78:7): [True: 0, False: 451]
  ------------------
   79|       |        // Case of plain copy
   80|      0|        blocksize /= 4;
   81|      0|        break;
   82|      0|      case 1:
  ------------------
  |  Branch (82:7): [True: 0, False: 451]
  ------------------
   83|      0|        blocksize /= 2;
   84|      0|        break;
   85|      0|      case 2:
  ------------------
  |  Branch (85:7): [True: 0, False: 451]
  ------------------
   86|      0|        blocksize *= 1;
   87|      0|        break;
   88|      0|      case 3:
  ------------------
  |  Branch (88:7): [True: 0, False: 451]
  ------------------
   89|      0|        blocksize *= 2;
   90|      0|        break;
   91|      0|      case 4:
  ------------------
  |  Branch (91:7): [True: 0, False: 451]
  ------------------
   92|    451|      case 5:
  ------------------
  |  Branch (92:7): [True: 451, False: 0]
  ------------------
   93|    451|        blocksize *= 4;
   94|    451|        break;
   95|      0|      case 6:
  ------------------
  |  Branch (95:7): [True: 0, False: 451]
  ------------------
   96|      0|      case 7:
  ------------------
  |  Branch (96:7): [True: 0, False: 451]
  ------------------
   97|      0|      case 8:
  ------------------
  |  Branch (97:7): [True: 0, False: 451]
  ------------------
   98|      0|        blocksize *= 8;
   99|      0|        break;
  100|      0|      case 9:
  ------------------
  |  Branch (100:7): [True: 0, False: 451]
  ------------------
  101|       |        // Do not exceed 256 KB for non HCR codecs
  102|      0|        blocksize *= 8;
  103|      0|        if (is_HCR(context)) {
  ------------------
  |  Branch (103:13): [True: 0, False: 0]
  ------------------
  104|      0|          blocksize *= 2;
  105|      0|        }
  106|      0|        break;
  107|      0|      default:
  ------------------
  |  Branch (107:7): [True: 0, False: 451]
  ------------------
  108|      0|        break;
  109|    451|    }
  110|    451|  }
  111|       |
  112|       |  /* Now the blocksize for splittable codecs */
  113|    452|  if (clevel > 0 && splitmode) {
  ------------------
  |  Branch (113:7): [True: 452, False: 0]
  |  Branch (113:21): [True: 382, False: 70]
  ------------------
  114|       |    // For performance reasons, do not exceed 256 KB (it must fit in L2 cache)
  115|    382|    switch (clevel) {
  116|      0|      case 1:
  ------------------
  |  Branch (116:7): [True: 0, False: 382]
  ------------------
  117|      0|      case 2:
  ------------------
  |  Branch (117:7): [True: 0, False: 382]
  ------------------
  118|      0|      case 3:
  ------------------
  |  Branch (118:7): [True: 0, False: 382]
  ------------------
  119|      0|        blocksize = 32 * 1024;
  120|      0|        break;
  121|      0|      case 4:
  ------------------
  |  Branch (121:7): [True: 0, False: 382]
  ------------------
  122|    382|      case 5:
  ------------------
  |  Branch (122:7): [True: 382, False: 0]
  ------------------
  123|    382|      case 6:
  ------------------
  |  Branch (123:7): [True: 0, False: 382]
  ------------------
  124|    382|        blocksize = 64 * 1024;
  125|    382|        break;
  126|      0|      case 7:
  ------------------
  |  Branch (126:7): [True: 0, False: 382]
  ------------------
  127|      0|        blocksize = 128 * 1024;
  128|      0|        break;
  129|      0|      case 8:
  ------------------
  |  Branch (129:7): [True: 0, False: 382]
  ------------------
  130|      0|        blocksize = 256 * 1024;
  131|      0|        break;
  132|      0|      case 9:
  ------------------
  |  Branch (132:7): [True: 0, False: 382]
  ------------------
  133|      0|      default:
  ------------------
  |  Branch (133:7): [True: 0, False: 382]
  ------------------
  134|      0|        blocksize = 512 * 1024;
  135|      0|        break;
  136|    382|    }
  137|       |    // Multiply by typesize to get proper split sizes
  138|    382|    blocksize *= typesize;
  139|       |    // But do not exceed 4 MB per thread (having this capacity in L3 is normal in modern CPUs)
  140|    382|    if (blocksize > 4 * 1024 * 1024) {
  ------------------
  |  Branch (140:9): [True: 0, False: 382]
  ------------------
  141|      0|      blocksize = 4 * 1024 * 1024;
  142|      0|    }
  143|    382|    if (blocksize < 32 * 1024) {
  ------------------
  |  Branch (143:9): [True: 0, False: 382]
  ------------------
  144|       |      /* Do not use a too small blocksize (< 32 KB) when typesize is small */
  145|      0|      blocksize = 32 * 1024;
  146|      0|    }
  147|    382|  }
  148|       |
  149|  1.51k|  last:
  150|       |  /* Check that blocksize is not too large */
  151|  1.51k|  if (blocksize > nbytes) {
  ------------------
  |  Branch (151:7): [True: 1.18k, False: 328]
  ------------------
  152|  1.18k|    blocksize = nbytes;
  153|  1.18k|  }
  154|       |
  155|       |  // blocksize *must absolutely* be a multiple of the typesize
  156|  1.51k|  if (blocksize > typesize) {
  ------------------
  |  Branch (156:7): [True: 636, False: 881]
  ------------------
  157|    636|    blocksize = blocksize / typesize * typesize;
  158|    636|  }
  159|       |
  160|  1.51k|  context->blocksize = blocksize;
  161|  1.51k|  BLOSC_INFO("compcode: %d, clevel: %d, blocksize: %d, splitmode: %d, typesize: %d",
  ------------------
  |  |  121|  1.51k|    do {                                            \
  |  |  122|  1.51k|        const char *__e = getenv("BLOSC_INFO");     \
  |  |  123|  1.51k|        if (!__e) { break; }                        \
  |  |  ------------------
  |  |  |  Branch (123:13): [True: 1.51k, False: 0]
  |  |  ------------------
  |  |  124|  1.51k|        fprintf(stderr, "[INFO] - " msg "\n", ##__VA_ARGS__); \
  |  |  125|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (125:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  162|  1.51k|             context->compcode, context->clevel, blocksize, splitmode, typesize);
  163|       |
  164|  1.51k|  return BLOSC2_ERROR_SUCCESS;
  165|    452|}
split_block:
  186|  1.51k|int split_block(blosc2_context *context, int32_t typesize, int32_t blocksize) {
  187|  1.51k|  switch (context->splitmode) {
  188|      0|    case BLOSC_ALWAYS_SPLIT:
  ------------------
  |  Branch (188:5): [True: 0, False: 1.51k]
  ------------------
  189|      0|      return 1;
  190|      0|    case BLOSC_NEVER_SPLIT:
  ------------------
  |  Branch (190:5): [True: 0, False: 1.51k]
  ------------------
  191|      0|      return 0;
  192|  1.51k|    case BLOSC_FORWARD_COMPAT_SPLIT:
  ------------------
  |  Branch (192:5): [True: 1.51k, False: 0]
  ------------------
  193|  1.51k|    case BLOSC_AUTO_SPLIT:
  ------------------
  |  Branch (193:5): [True: 0, False: 1.51k]
  ------------------
  194|       |      // These cases will be handled later
  195|  1.51k|      break;
  196|      0|    default:
  ------------------
  |  Branch (196:5): [True: 0, False: 1.51k]
  ------------------
  197|      0|      BLOSC_TRACE_WARNING("Unrecognized split mode.  Default to BLOSC_FORWARD_COMPAT_SPLIT");
  ------------------
  |  |   94|      0|#define BLOSC_TRACE_WARNING(msg, ...) BLOSC_TRACE(warning, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  198|  1.51k|  }
  199|       |
  200|  1.51k|  int compcode = context->compcode;
  201|  1.51k|  if (compcode == BLOSC_CODEC_OPENZL) {
  ------------------
  |  Branch (201:7): [True: 0, False: 1.51k]
  ------------------
  202|       |    // Never split blocks for OpenZL, as it has its own block mechanisms
  203|      0|    return 0;
  204|      0|  }
  205|  1.51k|  return (
  206|       |          // Fast codecs like blosclz, lz4 seems to prefer to split
  207|  1.51k|          ((compcode == BLOSC_BLOSCLZ) || (compcode == BLOSC_LZ4)
  ------------------
  |  Branch (207:12): [True: 1.51k, False: 0]
  |  Branch (207:43): [True: 0, False: 0]
  ------------------
  208|       |            // and low levels of zstd too
  209|      0|            || ((compcode == BLOSC_ZSTD) && (context->clevel <= 5))
  ------------------
  |  Branch (209:17): [True: 0, False: 0]
  |  Branch (209:45): [True: 0, False: 0]
  ------------------
  210|  1.51k|            ) &&
  211|       |          // ...but split seems to harm cratio too much when not using shuffle
  212|  1.51k|          (context->filter_flags & BLOSC_DOSHUFFLE) &&
  ------------------
  |  Branch (212:11): [True: 1.51k, False: 0]
  ------------------
  213|  1.51k|          (typesize <= MAX_STREAMS) &&
  ------------------
  |  |   24|  1.51k|#define MAX_STREAMS 16 /* Cannot be larger than 128 */
  ------------------
  |  Branch (213:11): [True: 552, False: 965]
  ------------------
  214|    552|          (blocksize / typesize) >= BLOSC_MIN_BUFFERSIZE);
  ------------------
  |  Branch (214:11): [True: 547, False: 5]
  ------------------
  215|  1.51k|}
stune.c:is_HCR:
   21|    451|static bool is_HCR(blosc2_context * context) {
   22|    451|  switch (context->compcode) {
   23|    451|    case BLOSC_BLOSCLZ :
  ------------------
  |  Branch (23:5): [True: 451, False: 0]
  ------------------
   24|    451|      return false;
   25|      0|    case BLOSC_LZ4 :
  ------------------
  |  Branch (25:5): [True: 0, False: 451]
  ------------------
   26|       |      // return (context->filter_flags & BLOSC_DOBITSHUFFLE) ? true : false;
   27|       |      // Do not treat LZ4 differently than BloscLZ here
   28|      0|      return false;
   29|      0|    case BLOSC_LZ4HC :
  ------------------
  |  Branch (29:5): [True: 0, False: 451]
  ------------------
   30|      0|    case BLOSC_ZLIB :
  ------------------
  |  Branch (30:5): [True: 0, False: 451]
  ------------------
   31|      0|    case BLOSC_ZSTD :
  ------------------
  |  Branch (31:5): [True: 0, False: 451]
  ------------------
   32|      0|      return true;
   33|      0|    default :
  ------------------
  |  Branch (33:5): [True: 0, False: 451]
  ------------------
   34|       |      return false;
   35|    451|  }
   36|    451|}

blosc2.c:print_error:
  525|     24|static char *print_error(int rc) {
  526|       |  // TODO: remove this function, use blosc2_error_string only
  527|     24|  return (char *) blosc2_error_string(rc);
  528|     24|}
ndcell.c:blosc2_meta_get:
 2447|      4|                                  int32_t *content_len) {
 2448|      4|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2448:7): [True: 3, False: 1]
  |  Branch (2448:25): [True: 0, False: 1]
  |  Branch (2448:41): [True: 0, False: 1]
  |  Branch (2448:60): [True: 0, False: 1]
  ------------------
 2449|      3|    BLOSC_TRACE_ERROR("Invalid parameters.");
  ------------------
  |  |   93|      3|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      3|    do {                                            \
  |  |  |  |   98|      3|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      3|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      3|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2450|      3|    return BLOSC2_ERROR_INVALID_PARAM;
 2451|      3|  }
 2452|       |
 2453|      1|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2454|      1|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2454:7): [True: 1, False: 0]
  ------------------
 2455|      1|    BLOSC_TRACE_WARNING("Metalayer \"%s\" not found.", name);
  ------------------
  |  |   94|      1|#define BLOSC_TRACE_WARNING(msg, ...) BLOSC_TRACE(warning, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2456|      1|    return nmetalayer;
 2457|      1|  }
 2458|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2459|      0|  if (len < 0) {
  ------------------
  |  Branch (2459:7): [True: 0, False: 0]
  ------------------
 2460|      0|    BLOSC_TRACE_ERROR("Metalayer \"%s\" has corrupted content length %d.", name, len);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2461|      0|    return BLOSC2_ERROR_DATA;
 2462|      0|  }
 2463|      0|  *content_len = len;
 2464|      0|  if (len == 0) {
  ------------------
  |  Branch (2464:7): [True: 0, False: 0]
  ------------------
 2465|      0|    *content = NULL;
 2466|      0|    return nmetalayer;
 2467|      0|  }
 2468|      0|  *content = (uint8_t*)malloc((size_t)len);
 2469|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2469:7): [True: 0, False: 0]
  ------------------
 2470|      0|    BLOSC_TRACE_ERROR("Unable to allocate metalayer content buffer.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2471|      0|    *content_len = 0;
 2472|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2473|      0|  }
 2474|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2474:7): [True: 0, False: 0]
  |  Branch (2474:18): [True: 0, False: 0]
  ------------------
 2475|      0|    free(*content);
 2476|      0|    *content = NULL;
 2477|      0|    *content_len = 0;
 2478|      0|    BLOSC_TRACE_ERROR("Metalayer \"%s\" has corrupted content pointer.", name);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2479|      0|    return BLOSC2_ERROR_DATA;
 2480|      0|  }
 2481|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2482|      0|  return nmetalayer;
 2483|      0|}
ndcell.c:blosc2_meta_exists:
 2378|      1|static inline int blosc2_meta_exists(blosc2_schunk *schunk, const char *name) {
 2379|      1|  if (strlen(name) > BLOSC2_METALAYER_NAME_MAXLEN) {
  ------------------
  |  | 1745|      1|#define BLOSC2_METALAYER_NAME_MAXLEN 31
  ------------------
  |  Branch (2379:7): [True: 0, False: 1]
  ------------------
 2380|      0|    BLOSC_TRACE_ERROR("Metalayers cannot be larger than %d chars.", BLOSC2_METALAYER_NAME_MAXLEN);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2380|      0|    BLOSC_TRACE_ERROR("Metalayers cannot be larger than %d chars.", BLOSC2_METALAYER_NAME_MAXLEN);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 1745|      0|#define BLOSC2_METALAYER_NAME_MAXLEN 31
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2381|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2382|      0|  }
 2383|       |
 2384|      1|  if (schunk == NULL) {
  ------------------
  |  Branch (2384:7): [True: 0, False: 1]
  ------------------
 2385|      0|    BLOSC_TRACE_ERROR("Schunk must not be NUll.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2386|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2387|      0|  }
 2388|       |
 2389|      1|  for (int nmetalayer = 0; nmetalayer < schunk->nmetalayers; nmetalayer++) {
  ------------------
  |  Branch (2389:28): [True: 0, False: 1]
  ------------------
 2390|      0|    if (strcmp(name, schunk->metalayers[nmetalayer]->name) == 0) {
  ------------------
  |  Branch (2390:9): [True: 0, False: 0]
  ------------------
 2391|      0|      return nmetalayer;
 2392|      0|    }
 2393|      0|  }
 2394|      1|  return BLOSC2_ERROR_NOT_FOUND;
 2395|      1|}
ndmean.c:blosc2_meta_get:
 2447|      5|                                  int32_t *content_len) {
 2448|      5|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2448:7): [True: 5, False: 0]
  |  Branch (2448:25): [True: 0, False: 0]
  |  Branch (2448:41): [True: 0, False: 0]
  |  Branch (2448:60): [True: 0, False: 0]
  ------------------
 2449|      5|    BLOSC_TRACE_ERROR("Invalid parameters.");
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2450|      5|    return BLOSC2_ERROR_INVALID_PARAM;
 2451|      5|  }
 2452|       |
 2453|      0|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2454|      0|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2454:7): [True: 0, False: 0]
  ------------------
 2455|      0|    BLOSC_TRACE_WARNING("Metalayer \"%s\" not found.", name);
  ------------------
  |  |   94|      0|#define BLOSC_TRACE_WARNING(msg, ...) BLOSC_TRACE(warning, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2456|      0|    return nmetalayer;
 2457|      0|  }
 2458|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2459|      0|  if (len < 0) {
  ------------------
  |  Branch (2459:7): [True: 0, False: 0]
  ------------------
 2460|      0|    BLOSC_TRACE_ERROR("Metalayer \"%s\" has corrupted content length %d.", name, len);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2461|      0|    return BLOSC2_ERROR_DATA;
 2462|      0|  }
 2463|      0|  *content_len = len;
 2464|      0|  if (len == 0) {
  ------------------
  |  Branch (2464:7): [True: 0, False: 0]
  ------------------
 2465|      0|    *content = NULL;
 2466|      0|    return nmetalayer;
 2467|      0|  }
 2468|      0|  *content = (uint8_t*)malloc((size_t)len);
 2469|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2469:7): [True: 0, False: 0]
  ------------------
 2470|      0|    BLOSC_TRACE_ERROR("Unable to allocate metalayer content buffer.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2471|      0|    *content_len = 0;
 2472|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2473|      0|  }
 2474|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2474:7): [True: 0, False: 0]
  |  Branch (2474:18): [True: 0, False: 0]
  ------------------
 2475|      0|    free(*content);
 2476|      0|    *content = NULL;
 2477|      0|    *content_len = 0;
 2478|      0|    BLOSC_TRACE_ERROR("Metalayer \"%s\" has corrupted content pointer.", name);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2479|      0|    return BLOSC2_ERROR_DATA;
 2480|      0|  }
 2481|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2482|      0|  return nmetalayer;
 2483|      0|}
bytedelta.c:print_error:
  525|     11|static char *print_error(int rc) {
  526|       |  // TODO: remove this function, use blosc2_error_string only
  527|     11|  return (char *) blosc2_error_string(rc);
  528|     11|}

register_codecs:
   18|  12.2k|void register_codecs(void) {
   19|       |  // May add .free func in future
   20|       |
   21|  12.2k|  blosc2_codec ndlz;
   22|  12.2k|  ndlz.compcode = BLOSC_CODEC_NDLZ;
   23|  12.2k|  ndlz.version = 1;
   24|  12.2k|  ndlz.complib = BLOSC_CODEC_NDLZ;
   25|  12.2k|  ndlz.encoder = &ndlz_compress;
   26|  12.2k|  ndlz.decoder = &ndlz_decompress;
   27|  12.2k|  ndlz.compname = "ndlz";
   28|       |  // ndlz.free = NULL; 
   29|  12.2k|  register_codec_private(&ndlz);
   30|       |
   31|  12.2k|#if defined(HAVE_ZFP)
   32|  12.2k|  blosc2_codec zfp_acc;
   33|  12.2k|  zfp_acc.compcode = BLOSC_CODEC_ZFP_FIXED_ACCURACY;
   34|  12.2k|  zfp_acc.version = 1;
   35|  12.2k|  zfp_acc.complib = BLOSC_CODEC_ZFP_FIXED_ACCURACY;
   36|  12.2k|  zfp_acc.encoder = &zfp_acc_compress;
   37|  12.2k|  zfp_acc.decoder = &zfp_acc_decompress;
   38|       |  // zfp_acc.free = NULL;
   39|  12.2k|  zfp_acc.compname = "zfp_acc";
   40|  12.2k|  register_codec_private(&zfp_acc);
   41|       |
   42|  12.2k|  blosc2_codec zfp_prec;
   43|  12.2k|  zfp_prec.compcode = BLOSC_CODEC_ZFP_FIXED_PRECISION;
   44|  12.2k|  zfp_prec.version = 1;
   45|  12.2k|  zfp_prec.complib = BLOSC_CODEC_ZFP_FIXED_PRECISION;
   46|  12.2k|  zfp_prec.encoder = &zfp_prec_compress;
   47|  12.2k|  zfp_prec.decoder = &zfp_prec_decompress;
   48|       |  // zfp_prec.free = NULL;
   49|  12.2k|  zfp_prec.compname = "zfp_prec";
   50|  12.2k|  register_codec_private(&zfp_prec);
   51|       |
   52|  12.2k|  blosc2_codec zfp_rate;
   53|  12.2k|  zfp_rate.compcode = BLOSC_CODEC_ZFP_FIXED_RATE;
   54|  12.2k|  zfp_rate.version = 1;
   55|  12.2k|  zfp_rate.complib = BLOSC_CODEC_ZFP_FIXED_RATE;
   56|  12.2k|  zfp_rate.encoder = &zfp_rate_compress;
   57|  12.2k|  zfp_rate.decoder = &zfp_rate_decompress;
   58|  12.2k|  zfp_rate.compname = "zfp_rate";
   59|       |  // zfp_rate.free = NULL;
   60|  12.2k|  register_codec_private(&zfp_rate);
   61|  12.2k|#endif
   62|       |
   63|  12.2k|  blosc2_codec openhtj2k;
   64|  12.2k|  openhtj2k.compcode = BLOSC_CODEC_OPENHTJ2K;
   65|  12.2k|  openhtj2k.version = 1;
   66|  12.2k|  openhtj2k.complib = BLOSC_CODEC_OPENHTJ2K;
   67|  12.2k|  openhtj2k.encoder = NULL;
   68|  12.2k|  openhtj2k.decoder = NULL;
   69|       |  // openhtj2k.free = NULL;
   70|  12.2k|  openhtj2k.compname = "openhtj2k";
   71|  12.2k|  register_codec_private(&openhtj2k);
   72|       |
   73|  12.2k|  blosc2_codec grok;
   74|  12.2k|  grok.compcode = BLOSC_CODEC_GROK;
   75|  12.2k|  grok.version = 1;
   76|  12.2k|  grok.complib = BLOSC_CODEC_GROK;
   77|  12.2k|  grok.encoder = NULL;
   78|  12.2k|  grok.decoder = NULL;
   79|       |  // grok.free = NULL;
   80|  12.2k|  grok.compname = "grok";
   81|  12.2k|  register_codec_private(&grok);
   82|       |
   83|  12.2k|  blosc2_codec openzl;
   84|  12.2k|  openzl.compcode = BLOSC_CODEC_OPENZL;
   85|  12.2k|  openzl.version = 1;
   86|  12.2k|  openzl.complib = BLOSC_CODEC_OPENZL;
   87|  12.2k|  openzl.encoder = NULL;
   88|  12.2k|  openzl.decoder = NULL;
   89|       |  // openzl.free = NULL;
   90|  12.2k|  openzl.compname = "openzl";
   91|  12.2k|  register_codec_private(&openzl);
   92|       |
   93|  12.2k|  blosc2_codec j2k;
   94|  12.2k|  j2k.compcode = BLOSC_CODEC_J2K;
   95|  12.2k|  j2k.version = 1;
   96|  12.2k|  j2k.complib = BLOSC_CODEC_J2K;
   97|  12.2k|  j2k.encoder = NULL;
   98|  12.2k|  j2k.decoder = NULL;
   99|       |  // j2k.free = NULL;
  100|  12.2k|  j2k.compname = "j2k";
  101|  12.2k|  register_codec_private(&j2k);
  102|       |
  103|  12.2k|  blosc2_codec htj2k;
  104|  12.2k|  htj2k.compcode = BLOSC_CODEC_HTJ2K;
  105|  12.2k|  htj2k.version = 1;
  106|  12.2k|  htj2k.complib = BLOSC_CODEC_HTJ2K;
  107|  12.2k|  htj2k.encoder = NULL;
  108|  12.2k|  htj2k.decoder = NULL;
  109|       |  // htj2k.free = NULL;
  110|  12.2k|  htj2k.compname = "htj2k";
  111|  12.2k|  register_codec_private(&htj2k);
  112|  12.2k|}

ndlz_decompress:
   42|    540|                    uint8_t meta, blosc2_dparams *dparams, const void *chunk) {
   43|    540|  NDLZ_ERROR_NULL(input);
  ------------------
  |  |   19|    540|  do {                           \
  |  |   20|    540|    if ((pointer) == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (20:9): [True: 0, False: 540]
  |  |  ------------------
  |  |   21|      0|      return 0;                  \
  |  |   22|      0|    }                            \
  |  |   23|    540|  } while (0)
  |  |  ------------------
  |  |  |  Branch (23:12): [Folded, False: 540]
  |  |  ------------------
  ------------------
   44|    540|  NDLZ_ERROR_NULL(output);
  ------------------
  |  |   19|    540|  do {                           \
  |  |   20|    540|    if ((pointer) == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (20:9): [True: 0, False: 540]
  |  |  ------------------
  |  |   21|      0|      return 0;                  \
  |  |   22|      0|    }                            \
  |  |   23|    540|  } while (0)
  |  |  ------------------
  |  |  |  Branch (23:12): [Folded, False: 540]
  |  |  ------------------
  ------------------
   45|    540|  NDLZ_ERROR_NULL(dparams);
  ------------------
  |  |   19|    540|  do {                           \
  |  |   20|    540|    if ((pointer) == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (20:9): [True: 0, False: 540]
  |  |  ------------------
  |  |   21|      0|      return 0;                  \
  |  |   22|      0|    }                            \
  |  |   23|    540|  } while (0)
  |  |  ------------------
  |  |  |  Branch (23:12): [Folded, False: 540]
  |  |  ------------------
  ------------------
   46|    540|  BLOSC_UNUSED_PARAM(chunk);
  ------------------
  |  |   28|    540|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
   47|       |
   48|    540|  switch (meta) {
   49|    317|    case 4:
  ------------------
  |  Branch (49:5): [True: 317, False: 223]
  ------------------
   50|    317|      return ndlz4_decompress(input, input_len, output, output_len, meta, dparams);
   51|    221|    case 8:
  ------------------
  |  Branch (51:5): [True: 221, False: 319]
  ------------------
   52|    221|      return ndlz8_decompress(input, input_len, output, output_len, meta, dparams);
   53|      2|    default:
  ------------------
  |  Branch (53:5): [True: 2, False: 538]
  ------------------
   54|      2|      BLOSC_TRACE_ERROR("NDLZ is not available for this cellsize: %d", meta);
  ------------------
  |  |   93|      2|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      2|    do {                                            \
  |  |  |  |   98|      2|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      2|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      2|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   55|    540|  }
   56|      2|  return BLOSC2_ERROR_FAILURE;
   57|    540|}

ndlz4_decompress:
  526|    317|                     uint8_t meta, blosc2_dparams *dparams) {
  527|    317|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|    317|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  528|    317|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|    317|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  529|    317|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    317|    do {                                            \
  |  |  105|    317|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 317]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|    317|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 317]
  |  |  ------------------
  ------------------
  530|    317|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    317|    do {                                            \
  |  |  105|    317|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 317]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|    317|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 317]
  |  |  ------------------
  ------------------
  531|       |
  532|    317|  uint8_t *ip = (uint8_t *) input;
  533|    317|  uint8_t *op = (uint8_t *) output;
  534|    317|  uint8_t ndim;
  535|    317|  int32_t blockshape[2];
  536|    317|  int32_t eshape[2];
  537|    317|  uint8_t *buffercpy;
  538|    317|  uint8_t local_buffer[16];
  539|    317|  uint8_t token;
  540|       |  // The fixed header is 1 (ndim) + 2 * int32 (blockshape) = 9 bytes.  Reject any
  541|       |  // input too short to hold it -- the previous `< 8` check let an 8-byte input
  542|       |  // through and the header parse below then read a 9th byte.  The cast keeps the
  543|       |  // comparison signed so a negative `input_len` is rejected here, before the
  544|       |  // `ip + input_len` pointer arithmetic (which would otherwise be UB) is reached.
  545|    317|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < (int32_t) (1 + 2 * sizeof(int32_t)))) {
  ------------------
  |  |   30|    317|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 1, False: 316]
  |  |  ------------------
  ------------------
  546|      1|    return 0;
  547|      1|  }
  548|    316|  uint8_t *ip_limit = ip + input_len;
  549|       |
  550|       |  // Validate that a read of `len` bytes starting at byte offset `pos` (measured
  551|       |  // from the start of `input`) lies fully within the compressed buffer.  A
  552|       |  // crafted token `offset` otherwise makes a back-reference point before
  553|       |  // `input`, and the cell-fill memcpy then leaks out-of-bounds heap memory into
  554|       |  // the (attacker-visible) output buffer -- CWE-125.  The per-cell `ip > ip_limit`
  555|       |  // check is not enough because each cell reads a 2-byte offset and literal bytes
  556|       |  // past that point.  All arithmetic is done on integer offsets so we never form
  557|       |  // an out-of-bounds pointer (which is undefined behaviour in C, even when the
  558|       |  // pointer is only compared and not dereferenced).
  559|    316|#define NDLZ4_CHECK_RANGE(pos, len)                                              \
  560|    316|  do {                                                                           \
  561|    316|    int64_t _pos = (int64_t) (pos);                                              \
  562|    316|    int64_t _len = (int64_t) (len);                                              \
  563|    316|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  564|    316|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  565|    316|      return BLOSC2_ERROR_FAILURE;                                               \
  566|    316|    }                                                                            \
  567|    316|  } while (0)
  568|       |
  569|       |  /* we start with literal copy */
  570|    316|  ndim = *ip;
  571|    316|  ip++;
  572|    316|  if (ndim != 2) {
  ------------------
  |  Branch (572:7): [True: 1, False: 315]
  ------------------
  573|      1|    BLOSC_TRACE_ERROR("This codec only works for ndim = 2");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  574|      1|    return BLOSC2_ERROR_FAILURE;
  575|      1|  }
  576|    315|  memcpy(&blockshape[0], ip, 4);
  577|    315|  ip += 4;
  578|    315|  memcpy(&blockshape[1], ip, 4);
  579|    315|  ip += 4;
  580|       |
  581|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3204
  582|    315|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (582:7): [True: 0, False: 315]
  |  Branch (582:25): [True: 28, False: 287]
  |  Branch (582:46): [True: 20, False: 267]
  ------------------
  583|     48|    BLOSC_TRACE_ERROR("Output length or blockshape is negative");
  ------------------
  |  |   93|     48|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     48|    do {                                            \
  |  |  |  |   98|     48|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     48|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 48, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     48|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  584|     48|    return BLOSC2_ERROR_FAILURE;
  585|     48|  }
  586|       |
  587|    267|  eshape[0] = ((blockshape[0] + 3) / 4) * 4;
  588|    267|  eshape[1] = ((blockshape[1] + 3) / 4) * 4;
  589|       |
  590|    267|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|    267|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 69, False: 198]
  |  |  ------------------
  ------------------
  591|     69|    BLOSC_TRACE_ERROR("The blockshape is bigger than the output buffer");
  ------------------
  |  |   93|     69|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     69|    do {                                            \
  |  |  |  |   98|     69|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     69|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 69, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     69|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  592|     69|    return 0;
  593|     69|  }
  594|    198|  memset(op, 0, blockshape[0] * blockshape[1]);
  595|       |
  596|    198|  uint32_t i_stop[2];
  597|    594|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (597:19): [True: 396, False: 198]
  ------------------
  598|    396|    i_stop[i] = eshape[i] / 4;
  599|    396|  }
  600|       |
  601|       |  /* main loop */
  602|    198|  uint32_t ii[2];
  603|    198|  uint32_t padding[2] = {0};
  604|    198|  uint32_t ind = 0;
  605|    198|  uint8_t cell_aux[16];
  606|  1.53G|  for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
  ------------------
  |  Branch (606:19): [True: 1.53G, False: 26]
  ------------------
  607|  1.53G|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (607:21): [True: 2.25k, False: 1.53G]
  ------------------
  608|  2.25k|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|  2.25k|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 2.25k]
  |  |  ------------------
  ------------------
  609|      0|        BLOSC_TRACE_ERROR("Exceeding input length");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  610|      0|        return BLOSC2_ERROR_FAILURE;
  611|      0|      }
  612|  2.25k|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (612:11): [True: 345, False: 1.91k]
  ------------------
  613|    345|        padding[0] = (blockshape[0] % 4 == 0) ? 4 : blockshape[0] % 4;
  ------------------
  |  Branch (613:22): [True: 38, False: 307]
  ------------------
  614|  1.91k|      } else {
  615|  1.91k|        padding[0] = 4;
  616|  1.91k|      }
  617|  2.25k|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (617:11): [True: 1.85k, False: 403]
  ------------------
  618|  1.85k|        padding[1] = (blockshape[1] % 4 == 0) ? 4 : blockshape[1] % 4;
  ------------------
  |  Branch (618:22): [True: 24, False: 1.83k]
  ------------------
  619|  1.85k|      } else {
  620|    403|        padding[1] = 4;
  621|    403|      }
  622|  2.25k|      int64_t cur = ip - (const uint8_t *) input;   // in-range: ip is within [input, ip_limit]
  623|  2.25k|      NDLZ4_CHECK_RANGE(cur, 1);
  ------------------
  |  |  560|  2.25k|  do {                                                                           \
  |  |  561|  2.25k|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|  2.25k|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|  2.25k|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 2.25k]
  |  |  |  Branch (563:21): [True: 0, False: 2.25k]
  |  |  |  Branch (563:33): [True: 3, False: 2.25k]
  |  |  ------------------
  |  |  564|      3|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      3|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      3|    do {                                            \
  |  |  |  |  |  |   98|      3|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      3|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 3, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      3|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      3|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      3|    }                                                                            \
  |  |  567|  2.25k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 2.25k]
  |  |  ------------------
  ------------------
  624|  2.25k|      token = *ip++;
  625|  2.25k|      if (token == 0) {    // no match
  ------------------
  |  Branch (625:11): [True: 1.13k, False: 1.12k]
  ------------------
  626|  1.13k|        NDLZ4_CHECK_RANGE(cur + 1, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  560|  1.13k|  do {                                                                           \
  |  |  561|  1.13k|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|  1.13k|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|  1.13k|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 1.13k]
  |  |  |  Branch (563:21): [True: 0, False: 1.13k]
  |  |  |  Branch (563:33): [True: 1, False: 1.13k]
  |  |  ------------------
  |  |  564|      1|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      1|    }                                                                            \
  |  |  567|  1.13k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 1.13k]
  |  |  ------------------
  ------------------
  627|  1.13k|        buffercpy = ip;
  628|  1.13k|        ip += padding[0] * padding[1];
  629|  1.13k|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (629:18): [True: 154, False: 970]
  ------------------
  630|    154|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    154|  do {                                                                           \
  |  |  561|    154|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    154|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    154|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 154]
  |  |  |  Branch (563:21): [True: 0, False: 154]
  |  |  |  Branch (563:33): [True: 1, False: 153]
  |  |  ------------------
  |  |  564|      1|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      1|    }                                                                            \
  |  |  567|    154|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 153]
  |  |  ------------------
  ------------------
  631|    153|        uint16_t offset;
  632|    153|        memcpy(&offset, ip, sizeof(offset));
  633|    153|        int64_t bpos = (cur + 1) - (int64_t) offset - 1;   // back-reference start offset
  634|    153|        NDLZ4_CHECK_RANGE(bpos, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  560|    153|  do {                                                                           \
  |  |  561|    153|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    153|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    153|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 22, False: 131]
  |  |  |  Branch (563:21): [True: 0, False: 131]
  |  |  |  Branch (563:33): [True: 1, False: 130]
  |  |  ------------------
  |  |  564|     23|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     23|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     23|    do {                                            \
  |  |  |  |  |  |   98|     23|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     23|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 23, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     23|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     23|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     23|    }                                                                            \
  |  |  567|    153|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 130]
  |  |  ------------------
  ------------------
  635|    130|        buffercpy = (uint8_t *) input + bpos;
  636|    130|        ip += 2;
  637|    970|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (637:18): [True: 100, False: 870]
  ------------------
  638|    100|        NDLZ4_CHECK_RANGE(cur + 1, 1);
  ------------------
  |  |  560|    100|  do {                                                                           \
  |  |  561|    100|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    100|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    100|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 100]
  |  |  |  Branch (563:21): [True: 0, False: 100]
  |  |  |  Branch (563:33): [True: 1, False: 99]
  |  |  ------------------
  |  |  564|      1|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      1|    }                                                                            \
  |  |  567|    100|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 99]
  |  |  ------------------
  ------------------
  639|     99|        buffercpy = cell_aux;
  640|     99|        memset(buffercpy, *ip, 16);
  641|     99|        ip++;
  642|    870|      } else if (token >= 224) { // three rows match
  ------------------
  |  Branch (642:18): [True: 252, False: 618]
  ------------------
  643|    252|        buffercpy = local_buffer;
  644|    252|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    252|  do {                                                                           \
  |  |  561|    252|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    252|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    252|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 252]
  |  |  |  Branch (563:21): [True: 0, False: 252]
  |  |  |  Branch (563:33): [True: 1, False: 251]
  |  |  ------------------
  |  |  564|      1|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      1|    }                                                                            \
  |  |  567|    252|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 251]
  |  |  ------------------
  ------------------
  645|    251|        uint16_t offset;
  646|    251|        memcpy(&offset, ip, sizeof(offset));
  647|    251|        offset += 3;
  648|    251|        ip += 2;
  649|    251|        int i, j, k;
  650|    251|        if ((token >> 3U) == 28) {
  ------------------
  |  Branch (650:13): [True: 24, False: 227]
  ------------------
  651|     24|          i = 1;
  652|     24|          j = 2;
  653|     24|          k = 3;
  654|    227|        } else {
  655|    227|          i = 0;
  656|    227|          if ((token >> 3U) < 30) {
  ------------------
  |  Branch (656:15): [True: 41, False: 186]
  ------------------
  657|     41|            j = 1;
  658|     41|            k = 2;
  659|    186|          } else {
  660|    186|            k = 3;
  661|    186|            if ((token >> 3U) == 30) {
  ------------------
  |  Branch (661:17): [True: 38, False: 148]
  ------------------
  662|     38|              j = 1;
  663|    148|            } else {
  664|    148|              j = 2;
  665|    148|            }
  666|    186|          }
  667|    227|        }
  668|    251|        int64_t bpos = (cur + 3) - (int64_t) offset;   // == (ip - offset) as an offset
  669|    251|        NDLZ4_CHECK_RANGE(bpos, 12);
  ------------------
  |  |  560|    251|  do {                                                                           \
  |  |  561|    251|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    251|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    251|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 24, False: 227]
  |  |  |  Branch (563:21): [True: 0, False: 227]
  |  |  |  Branch (563:33): [True: 4, False: 223]
  |  |  ------------------
  |  |  564|     28|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     28|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     28|    do {                                            \
  |  |  |  |  |  |   98|     28|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     28|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 28, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     28|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     28|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     28|    }                                                                            \
  |  |  567|    251|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 223]
  |  |  ------------------
  ------------------
  670|    223|        const uint8_t *ref = (const uint8_t *) input + bpos;
  671|    223|        memcpy(&buffercpy[i * 4], ref, 4);
  672|    223|        memcpy(&buffercpy[j * 4], ref + 4, 4);
  673|    223|        memcpy(&buffercpy[k * 4], ref + 8, 4);
  674|    530|        for (int l = 0; l < 4; l++) {
  ------------------
  |  Branch (674:25): [True: 530, False: 0]
  ------------------
  675|    530|          if ((l != i) && (l != j) && (l != k)) {
  ------------------
  |  Branch (675:15): [True: 331, False: 199]
  |  Branch (675:27): [True: 260, False: 71]
  |  Branch (675:39): [True: 223, False: 37]
  ------------------
  676|    223|            NDLZ4_CHECK_RANGE(ip - (const uint8_t *) input, 4);
  ------------------
  |  |  560|    223|  do {                                                                           \
  |  |  561|    223|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    223|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    223|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 223]
  |  |  |  Branch (563:21): [True: 0, False: 223]
  |  |  |  Branch (563:33): [True: 1, False: 222]
  |  |  ------------------
  |  |  564|      1|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      1|    }                                                                            \
  |  |  567|    223|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 222]
  |  |  ------------------
  ------------------
  677|    222|            memcpy(&buffercpy[l * 4], ip, 4);
  678|    222|            ip += 4;
  679|    222|            break;
  680|    223|          }
  681|    530|        }
  682|       |
  683|    618|      } else if ((token >= 128) && (token <= 191)) { // rows pair match
  ------------------
  |  Branch (683:18): [True: 477, False: 141]
  |  Branch (683:36): [True: 472, False: 5]
  ------------------
  684|    472|        buffercpy = local_buffer;
  685|    472|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    472|  do {                                                                           \
  |  |  561|    472|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    472|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    472|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 472]
  |  |  |  Branch (563:21): [True: 0, False: 472]
  |  |  |  Branch (563:33): [True: 2, False: 470]
  |  |  ------------------
  |  |  564|      2|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      2|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      2|    do {                                            \
  |  |  |  |  |  |   98|      2|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      2|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 2, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      2|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      2|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      2|    }                                                                            \
  |  |  567|    472|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 470]
  |  |  ------------------
  ------------------
  686|    470|        uint16_t offset;
  687|    470|        memcpy(&offset, ip, sizeof(offset));
  688|    470|        offset += 3;
  689|    470|        ip += 2;
  690|    470|        int i, j;
  691|    470|        if (token == 128) {
  ------------------
  |  Branch (691:13): [True: 100, False: 370]
  ------------------
  692|    100|          i = 2;
  693|    100|          j = 3;
  694|    370|        } else {
  695|    370|          i = (token - 128) >> 5U;
  696|    370|          j = ((token - 128) >> 3U) - (i << 2U);
  697|    370|        }
  698|    470|        int64_t bpos = (cur + 3) - (int64_t) offset;
  699|    470|        NDLZ4_CHECK_RANGE(bpos, 8);
  ------------------
  |  |  560|    470|  do {                                                                           \
  |  |  561|    470|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    470|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    470|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 25, False: 445]
  |  |  |  Branch (563:21): [True: 0, False: 445]
  |  |  |  Branch (563:33): [True: 1, False: 444]
  |  |  ------------------
  |  |  564|     26|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     26|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     26|    do {                                            \
  |  |  |  |  |  |   98|     26|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     26|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 26, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     26|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     26|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     26|    }                                                                            \
  |  |  567|    470|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 444]
  |  |  ------------------
  ------------------
  700|    444|        const uint8_t *ref = (const uint8_t *) input + bpos;
  701|    444|        memcpy(&buffercpy[i * 4], ref, 4);
  702|    444|        memcpy(&buffercpy[j * 4], ref + 4, 4);
  703|  2.20k|        for (int k = 0; k < 4; k++) {
  ------------------
  |  Branch (703:25): [True: 1.76k, False: 439]
  ------------------
  704|  1.76k|          if ((k != i) && (k != j)) {
  ------------------
  |  Branch (704:15): [True: 1.32k, False: 441]
  |  Branch (704:27): [True: 1.03k, False: 296]
  ------------------
  705|  1.03k|            NDLZ4_CHECK_RANGE(ip - (const uint8_t *) input, 4);
  ------------------
  |  |  560|  1.03k|  do {                                                                           \
  |  |  561|  1.03k|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|  1.03k|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|  1.03k|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 1.03k]
  |  |  |  Branch (563:21): [True: 0, False: 1.03k]
  |  |  |  Branch (563:33): [True: 5, False: 1.02k]
  |  |  ------------------
  |  |  564|      5|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      5|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      5|    }                                                                            \
  |  |  567|  1.03k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 1.02k]
  |  |  ------------------
  ------------------
  706|  1.02k|            memcpy(&buffercpy[k * 4], ip, 4);
  707|  1.02k|            ip += 4;
  708|  1.02k|          }
  709|  1.76k|        }
  710|    444|      } else if ((token >= 40) && (token <= 63)) {  // 2 rows pair matches
  ------------------
  |  Branch (710:18): [True: 134, False: 12]
  |  Branch (710:35): [True: 117, False: 17]
  ------------------
  711|    117|        buffercpy = local_buffer;
  712|    117|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    117|  do {                                                                           \
  |  |  561|    117|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    117|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    117|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 117]
  |  |  |  Branch (563:21): [True: 0, False: 117]
  |  |  |  Branch (563:33): [True: 1, False: 116]
  |  |  ------------------
  |  |  564|      1|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      1|    }                                                                            \
  |  |  567|    117|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 116]
  |  |  ------------------
  ------------------
  713|    116|        uint16_t offset_1;
  714|    116|        memcpy(&offset_1, ip, sizeof(offset_1));
  715|    116|        offset_1 += 5;
  716|    116|        ip += 2;
  717|    116|        NDLZ4_CHECK_RANGE(cur + 3, 2);
  ------------------
  |  |  560|    116|  do {                                                                           \
  |  |  561|    116|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    116|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    116|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 116]
  |  |  |  Branch (563:21): [True: 0, False: 116]
  |  |  |  Branch (563:33): [True: 1, False: 115]
  |  |  ------------------
  |  |  564|      1|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      1|    }                                                                            \
  |  |  567|    116|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 115]
  |  |  ------------------
  ------------------
  718|    115|        uint16_t offset_2;
  719|    115|        memcpy(&offset_2, ip, sizeof(offset_2));
  720|    115|        offset_2 += 5;
  721|    115|        ip += 2;
  722|    115|        int i, j, k, l, m;
  723|    115|        i = 0;
  724|    115|        j = ((token - 32) >> 3U);
  725|    115|        l = -1;
  726|    460|        for (k = 1; k < 4; k++) {
  ------------------
  |  Branch (726:21): [True: 345, False: 115]
  ------------------
  727|    345|          if ((k != i) && (k != j)) {
  ------------------
  |  Branch (727:15): [True: 345, False: 0]
  |  Branch (727:27): [True: 230, False: 115]
  ------------------
  728|    230|            if (l == -1) {
  ------------------
  |  Branch (728:17): [True: 115, False: 115]
  ------------------
  729|    115|              l = k;
  730|    115|            } else {
  731|    115|              m = k;
  732|    115|            }
  733|    230|          }
  734|    345|        }
  735|    115|        int64_t bpos1 = (cur + 5) - (int64_t) offset_1;
  736|    115|        NDLZ4_CHECK_RANGE(bpos1, 8);
  ------------------
  |  |  560|    115|  do {                                                                           \
  |  |  561|    115|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    115|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    115|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 28, False: 87]
  |  |  |  Branch (563:21): [True: 0, False: 87]
  |  |  |  Branch (563:33): [True: 1, False: 86]
  |  |  ------------------
  |  |  564|     29|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     29|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     29|    do {                                            \
  |  |  |  |  |  |   98|     29|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     29|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 29, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     29|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     29|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     29|    }                                                                            \
  |  |  567|    115|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 86]
  |  |  ------------------
  ------------------
  737|     86|        const uint8_t *ref1 = (const uint8_t *) input + bpos1;
  738|     86|        memcpy(&buffercpy[i * 4], ref1, 4);
  739|     86|        memcpy(&buffercpy[j * 4], ref1 + 4, 4);
  740|     86|        int64_t bpos2 = (cur + 5) - (int64_t) offset_2;
  741|     86|        NDLZ4_CHECK_RANGE(bpos2, 8);
  ------------------
  |  |  560|     86|  do {                                                                           \
  |  |  561|     86|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|     86|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|     86|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 19, False: 67]
  |  |  |  Branch (563:21): [True: 0, False: 67]
  |  |  |  Branch (563:33): [True: 1, False: 66]
  |  |  ------------------
  |  |  564|     20|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     20|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     20|    do {                                            \
  |  |  |  |  |  |   98|     20|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     20|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 20, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     20|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     20|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     20|    }                                                                            \
  |  |  567|     86|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 66]
  |  |  ------------------
  ------------------
  742|     66|        const uint8_t *ref2 = (const uint8_t *) input + bpos2;
  743|     66|        memcpy(&buffercpy[l * 4], ref2, 4);
  744|     66|        memcpy(&buffercpy[m * 4], ref2 + 4, 4);
  745|       |
  746|     66|      } else {
  747|     29|        BLOSC_TRACE_ERROR("Invalid token: %u at cell [%d, %d]\n", token, ii[0], ii[1]);
  ------------------
  |  |   93|     29|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     29|    do {                                            \
  |  |  |  |   98|     29|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     29|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 29, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     29|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  748|     29|        return BLOSC2_ERROR_FAILURE;
  749|     29|      }
  750|       |      // fill op with buffercpy
  751|  2.08k|      uint32_t orig = ii[0] * 4 * blockshape[1] + ii[1] * 4;
  752|  10.4k|      for (uint32_t i = 0; i < 4; i++) {
  ------------------
  |  Branch (752:28): [True: 8.34k, False: 2.08k]
  ------------------
  753|  8.34k|        if (i < padding[0]) {
  ------------------
  |  Branch (753:13): [True: 7.71k, False: 634]
  ------------------
  754|  7.71k|          ind = orig + i * blockshape[1];
  755|  7.71k|          memcpy(&op[ind], buffercpy, padding[1]);
  756|       |          // Only advance over rows we actually consume.  For a literal cell
  757|       |          // (token == 0) buffercpy points into the input and only holds
  758|       |          // padding[0] * padding[1] bytes; advancing unconditionally for the
  759|       |          // trailing padding rows would form an out-of-bounds pointer (UB)
  760|       |          // for the block's last cell.  The skipped rows are never read.
  761|  7.71k|          buffercpy += padding[1];
  762|  7.71k|        }
  763|  8.34k|      }
  764|  2.08k|      if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (764:11): [True: 0, False: 2.08k]
  ------------------
  765|      0|        BLOSC_TRACE_ERROR("Exceeding output size");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  766|      0|        return BLOSC2_ERROR_FAILURE;
  767|      0|      }
  768|  2.08k|    }
  769|  1.53G|  }
  770|     26|  ind += padding[1];
  771|       |
  772|     26|  if ((int32_t)ind != (blockshape[0] * blockshape[1])) {
  ------------------
  |  Branch (772:7): [True: 0, False: 26]
  ------------------
  773|      0|    BLOSC_TRACE_ERROR("Output size is not compatible with embedded blockshape");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  774|      0|    return BLOSC2_ERROR_FAILURE;
  775|      0|  }
  776|     26|  if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (776:7): [True: 0, False: 26]
  ------------------
  777|      0|    BLOSC_TRACE_ERROR("Exceeding output size");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  778|      0|    return BLOSC2_ERROR_FAILURE;
  779|      0|  }
  780|       |
  781|     26|  return (int) ind;
  782|     26|#undef NDLZ4_CHECK_RANGE
  783|     26|}

ndlz8_decompress:
  444|    221|                     uint8_t meta, blosc2_dparams *dparams) {
  445|    221|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|    221|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  446|    221|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|    221|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  447|    221|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    221|    do {                                            \
  |  |  105|    221|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 221]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|    221|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 221]
  |  |  ------------------
  ------------------
  448|    221|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    221|    do {                                            \
  |  |  105|    221|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 221]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|    221|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 221]
  |  |  ------------------
  ------------------
  449|       |
  450|    221|  const int cell_shape = 8;
  451|    221|  const int cell_size = 64;
  452|    221|  uint8_t *ip = (uint8_t *) input;
  453|    221|  uint8_t *op = (uint8_t *) output;
  454|    221|  uint8_t ndim;
  455|    221|  int32_t blockshape[2];
  456|    221|  int32_t eshape[2];
  457|    221|  uint8_t *buffercpy;
  458|    221|  uint8_t token;
  459|       |  // The fixed header is 1 (ndim) + 2 * int32 (blockshape) = 9 bytes.  Reject any
  460|       |  // input too short to hold it -- the previous `< 8` check let an 8-byte input
  461|       |  // through and the header parse below then read a 9th byte.  The cast keeps the
  462|       |  // comparison signed so a negative `input_len` is rejected here, before the
  463|       |  // `ip + input_len` pointer arithmetic (which would otherwise be UB) is reached.
  464|    221|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < (int32_t) (1 + 2 * sizeof(int32_t)))) {
  ------------------
  |  |   30|    221|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 1, False: 220]
  |  |  ------------------
  ------------------
  465|      1|    return 0;
  466|      1|  }
  467|    220|  uint8_t *ip_limit = ip + input_len;
  468|       |
  469|       |  /* we start with literal copy */
  470|    220|  ndim = *ip;
  471|    220|  ip++;
  472|    220|  if (ndim != 2) {
  ------------------
  |  Branch (472:7): [True: 1, False: 219]
  ------------------
  473|      1|    BLOSC_TRACE_ERROR("This codec only works for ndim = 2");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  474|      1|    return BLOSC2_ERROR_FAILURE;
  475|      1|  }
  476|    219|  memcpy(&blockshape[0], ip, 4);
  477|    219|  ip += 4;
  478|    219|  memcpy(&blockshape[1], ip, 4);
  479|    219|  ip += 4;
  480|       |
  481|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3203
  482|    219|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (482:7): [True: 0, False: 219]
  |  Branch (482:25): [True: 16, False: 203]
  |  Branch (482:46): [True: 16, False: 187]
  ------------------
  483|     32|    BLOSC_TRACE_ERROR("Output length or blockshape is negative");
  ------------------
  |  |   93|     32|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     32|    do {                                            \
  |  |  |  |   98|     32|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     32|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 32, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     32|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  484|     32|    return BLOSC2_ERROR_FAILURE;
  485|     32|  }
  486|       |
  487|    187|  eshape[0] = ((blockshape[0] + 7) / cell_shape) * cell_shape;
  488|    187|  eshape[1] = ((blockshape[1] + 7) / cell_shape) * cell_shape;
  489|       |
  490|    187|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|    187|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 41, False: 146]
  |  |  ------------------
  ------------------
  491|     41|    BLOSC_TRACE_ERROR("The blockshape is bigger than the output buffer");
  ------------------
  |  |   93|     41|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     41|    do {                                            \
  |  |  |  |   98|     41|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     41|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 41, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     41|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  492|     41|    return 0;
  493|     41|  }
  494|    146|  memset(op, 0, blockshape[0] * blockshape[1]);
  495|       |
  496|    146|  int32_t i_stop[2];
  497|    438|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (497:19): [True: 292, False: 146]
  ------------------
  498|    292|    i_stop[i] = eshape[i] / cell_shape;
  499|    292|  }
  500|       |
  501|       |  /* main loop */
  502|    146|  int32_t ii[2];
  503|    146|  int32_t padding[2] = {0};
  504|    146|  int32_t ind = 0;
  505|    146|  uint8_t *local_buffer = malloc(cell_size);
  506|    146|  uint8_t *cell_aux = malloc(cell_size);
  507|       |
  508|       |  // Validate that a read of `len` bytes starting at byte offset `pos` (measured
  509|       |  // from the start of `input`) lies fully within the compressed buffer.  A
  510|       |  // crafted token `offset` otherwise makes a back-reference point before
  511|       |  // `input`, and the cell-fill memcpy then leaks out-of-bounds heap memory into
  512|       |  // the (attacker-visible) output -- CWE-125.  The per-cell `ip > ip_limit`
  513|       |  // check is not enough because each cell reads a 2-byte offset and literal
  514|       |  // bytes past that point.  All arithmetic is done on integer offsets so we
  515|       |  // never form an out-of-bounds pointer (undefined behaviour in C, even when the
  516|       |  // pointer is only compared and not dereferenced).
  517|    146|#define NDLZ8_CHECK_RANGE(pos, len)                                              \
  518|    146|  do {                                                                           \
  519|    146|    int64_t _pos = (int64_t) (pos);                                              \
  520|    146|    int64_t _len = (int64_t) (len);                                              \
  521|    146|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  522|    146|      free(local_buffer);                                                        \
  523|    146|      free(cell_aux);                                                            \
  524|    146|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  525|    146|      return BLOSC2_ERROR_FAILURE;                                               \
  526|    146|    }                                                                            \
  527|    146|  } while (0)
  528|       |
  529|   766M|  for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
  ------------------
  |  Branch (529:19): [True: 766M, False: 16]
  ------------------
  530|   766M|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (530:21): [True: 1.05k, False: 766M]
  ------------------
  531|  1.05k|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|  1.05k|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 1.05k]
  |  |  ------------------
  ------------------
  532|      0|        free(local_buffer);
  533|      0|        free(cell_aux);
  534|      0|        BLOSC_TRACE_ERROR("Exceeding input length");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  535|      0|        return BLOSC2_ERROR_FAILURE;
  536|      0|      }
  537|  1.05k|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (537:11): [True: 926, False: 131]
  ------------------
  538|    926|        padding[0] = (blockshape[0] % cell_shape == 0) ? cell_shape : blockshape[0] % cell_shape;
  ------------------
  |  Branch (538:22): [True: 9, False: 917]
  ------------------
  539|    926|      } else {
  540|    131|        padding[0] = cell_shape;
  541|    131|      }
  542|  1.05k|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (542:11): [True: 102, False: 955]
  ------------------
  543|    102|        padding[1] = (blockshape[1] % cell_shape == 0) ? cell_shape : blockshape[1] % cell_shape;
  ------------------
  |  Branch (543:22): [True: 91, False: 11]
  ------------------
  544|    955|      } else {
  545|    955|        padding[1] = cell_shape;
  546|    955|      }
  547|  1.05k|      int64_t cur = ip - (const uint8_t *) input;   // in-range: ip is within [input, ip_limit]
  548|  1.05k|      NDLZ8_CHECK_RANGE(cur, 1);
  ------------------
  |  |  518|  1.05k|  do {                                                                           \
  |  |  519|  1.05k|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|  1.05k|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|  1.05k|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 1.05k]
  |  |  |  Branch (521:21): [True: 0, False: 1.05k]
  |  |  |  Branch (521:33): [True: 8, False: 1.04k]
  |  |  ------------------
  |  |  522|      8|      free(local_buffer);                                                        \
  |  |  523|      8|      free(cell_aux);                                                            \
  |  |  524|      8|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      8|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      8|    do {                                            \
  |  |  |  |  |  |   98|      8|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      8|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 8, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      8|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      8|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      8|    }                                                                            \
  |  |  527|  1.05k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 1.04k]
  |  |  ------------------
  ------------------
  549|  1.04k|      token = *ip++;
  550|  1.04k|      uint8_t match_type = (token >> 3U);
  551|  1.04k|      if (token == 0) {    // no match
  ------------------
  |  Branch (551:11): [True: 187, False: 862]
  ------------------
  552|    187|        NDLZ8_CHECK_RANGE(cur + 1, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  518|    187|  do {                                                                           \
  |  |  519|    187|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    187|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    187|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 187]
  |  |  |  Branch (521:21): [True: 0, False: 187]
  |  |  |  Branch (521:33): [True: 6, False: 181]
  |  |  ------------------
  |  |  522|      6|      free(local_buffer);                                                        \
  |  |  523|      6|      free(cell_aux);                                                            \
  |  |  524|      6|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      6|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      6|    do {                                            \
  |  |  |  |  |  |   98|      6|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      6|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 6, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      6|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      6|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      6|    }                                                                            \
  |  |  527|    187|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 181]
  |  |  ------------------
  ------------------
  553|    181|        buffercpy = ip;
  554|    181|        ip += padding[0] * padding[1];
  555|    862|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (555:18): [True: 18, False: 844]
  ------------------
  556|     18|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     18|  do {                                                                           \
  |  |  519|     18|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     18|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     18|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 18]
  |  |  |  Branch (521:21): [True: 0, False: 18]
  |  |  |  Branch (521:33): [True: 1, False: 17]
  |  |  ------------------
  |  |  522|      1|      free(local_buffer);                                                        \
  |  |  523|      1|      free(cell_aux);                                                            \
  |  |  524|      1|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      1|    }                                                                            \
  |  |  527|     18|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 17]
  |  |  ------------------
  ------------------
  557|     17|        uint16_t offset;
  558|     17|        memcpy(&offset, ip, sizeof(offset));
  559|     17|        int64_t bpos = (cur + 1) - (int64_t) offset - 1;
  560|     17|        NDLZ8_CHECK_RANGE(bpos, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  518|     17|  do {                                                                           \
  |  |  519|     17|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     17|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     17|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 14, False: 3]
  |  |  |  Branch (521:21): [True: 0, False: 3]
  |  |  |  Branch (521:33): [True: 1, False: 2]
  |  |  ------------------
  |  |  522|     15|      free(local_buffer);                                                        \
  |  |  523|     15|      free(cell_aux);                                                            \
  |  |  524|     15|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     15|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     15|    do {                                            \
  |  |  |  |  |  |   98|     15|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     15|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 15, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     15|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     15|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     15|    }                                                                            \
  |  |  527|     17|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
  561|      2|        buffercpy = (uint8_t *) input + bpos;
  562|      2|        ip += 2;
  563|    844|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (563:18): [True: 627, False: 217]
  ------------------
  564|    627|        NDLZ8_CHECK_RANGE(cur + 1, 1);
  ------------------
  |  |  518|    627|  do {                                                                           \
  |  |  519|    627|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    627|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    627|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 627]
  |  |  |  Branch (521:21): [True: 0, False: 627]
  |  |  |  Branch (521:33): [True: 1, False: 626]
  |  |  ------------------
  |  |  522|      1|      free(local_buffer);                                                        \
  |  |  523|      1|      free(cell_aux);                                                            \
  |  |  524|      1|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      1|    }                                                                            \
  |  |  527|    627|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 626]
  |  |  ------------------
  ------------------
  565|    626|        buffercpy = cell_aux;
  566|    626|        memset(buffercpy, *ip, cell_size);
  567|    626|        ip++;
  568|    626|      } else if (match_type == 21) {    // triple match
  ------------------
  |  Branch (568:18): [True: 84, False: 133]
  ------------------
  569|     84|        buffercpy = local_buffer;
  570|     84|        int row = (int) (token & 7);
  571|     84|        if (row + 2 >= cell_shape) {
  ------------------
  |  Branch (571:13): [True: 1, False: 83]
  ------------------
  572|      1|          free(local_buffer);
  573|      1|          free(cell_aux);
  574|      1|          BLOSC_TRACE_ERROR("Triple match row out of bounds");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  575|      1|          return BLOSC2_ERROR_FAILURE;
  576|      1|        }
  577|     83|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     83|  do {                                                                           \
  |  |  519|     83|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     83|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     83|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 83]
  |  |  |  Branch (521:21): [True: 0, False: 83]
  |  |  |  Branch (521:33): [True: 1, False: 82]
  |  |  ------------------
  |  |  522|      1|      free(local_buffer);                                                        \
  |  |  523|      1|      free(cell_aux);                                                            \
  |  |  524|      1|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      1|    }                                                                            \
  |  |  527|     83|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 82]
  |  |  ------------------
  ------------------
  578|     82|        uint16_t offset;
  579|     82|        memcpy(&offset, ip, sizeof(offset));
  580|     82|        ip += 2;
  581|       |        // back-reference base == ip - sizeof(token) - sizeof(offset) - offset,
  582|       |        // i.e. (cur + 3) - 3 - offset == cur - offset, expressed as an offset.
  583|     82|        int64_t bpos = cur - (int64_t) offset;
  584|     82|        NDLZ8_CHECK_RANGE(bpos, 3 * cell_shape);
  ------------------
  |  |  518|     82|  do {                                                                           \
  |  |  519|     82|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     82|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     82|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 13, False: 69]
  |  |  |  Branch (521:21): [True: 0, False: 69]
  |  |  |  Branch (521:33): [True: 1, False: 68]
  |  |  ------------------
  |  |  522|     14|      free(local_buffer);                                                        \
  |  |  523|     14|      free(cell_aux);                                                            \
  |  |  524|     14|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     14|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     14|    do {                                            \
  |  |  |  |  |  |   98|     14|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     14|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 14, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     14|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     14|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     14|    }                                                                            \
  |  |  527|     82|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 68]
  |  |  ------------------
  ------------------
  585|     68|        const uint8_t *ref = (const uint8_t *) input + bpos;
  586|    272|        for (int l = 0; l < 3; l++) {
  ------------------
  |  Branch (586:25): [True: 204, False: 68]
  ------------------
  587|    204|          memcpy(&buffercpy[(row + l) * cell_shape], ref + l * cell_shape, cell_shape);
  588|    204|        }
  589|    576|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (589:25): [True: 516, False: 60]
  ------------------
  590|    516|          if ((l < row) || (l > row + 2)) {
  ------------------
  |  Branch (590:15): [True: 223, False: 293]
  |  Branch (590:28): [True: 104, False: 189]
  ------------------
  591|    327|            NDLZ8_CHECK_RANGE(ip - (const uint8_t *) input, cell_shape);
  ------------------
  |  |  518|    327|  do {                                                                           \
  |  |  519|    327|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    327|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    327|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 327]
  |  |  |  Branch (521:21): [True: 0, False: 327]
  |  |  |  Branch (521:33): [True: 8, False: 319]
  |  |  ------------------
  |  |  522|      8|      free(local_buffer);                                                        \
  |  |  523|      8|      free(cell_aux);                                                            \
  |  |  524|      8|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      8|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      8|    do {                                            \
  |  |  |  |  |  |   98|      8|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      8|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 8, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      8|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      8|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      8|    }                                                                            \
  |  |  527|    327|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 319]
  |  |  ------------------
  ------------------
  592|    319|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  593|    319|            ip += cell_shape;
  594|    319|          }
  595|    516|        }
  596|    133|      } else if (match_type == 17) {    // pair match
  ------------------
  |  Branch (596:18): [True: 89, False: 44]
  ------------------
  597|     89|        buffercpy = local_buffer;
  598|     89|        int row = (int) (token & 7);
  599|     89|        if (row + 1 >= cell_shape) {
  ------------------
  |  Branch (599:13): [True: 1, False: 88]
  ------------------
  600|      1|          free(local_buffer);
  601|      1|          free(cell_aux);
  602|      1|          BLOSC_TRACE_ERROR("Pair match row out of bounds");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  603|      1|          return BLOSC2_ERROR_FAILURE;
  604|      1|        }
  605|     88|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     88|  do {                                                                           \
  |  |  519|     88|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     88|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     88|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 88]
  |  |  |  Branch (521:21): [True: 0, False: 88]
  |  |  |  Branch (521:33): [True: 1, False: 87]
  |  |  ------------------
  |  |  522|      1|      free(local_buffer);                                                        \
  |  |  523|      1|      free(cell_aux);                                                            \
  |  |  524|      1|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      1|    }                                                                            \
  |  |  527|     88|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 87]
  |  |  ------------------
  ------------------
  606|     87|        uint16_t offset;
  607|     87|        memcpy(&offset, ip, sizeof(offset));
  608|     87|        ip += 2;
  609|       |        // back-reference base == cur - offset (see triple-match note above).
  610|     87|        int64_t bpos = cur - (int64_t) offset;
  611|     87|        NDLZ8_CHECK_RANGE(bpos, 2 * cell_shape);
  ------------------
  |  |  518|     87|  do {                                                                           \
  |  |  519|     87|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     87|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     87|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 18, False: 69]
  |  |  |  Branch (521:21): [True: 0, False: 69]
  |  |  |  Branch (521:33): [True: 3, False: 66]
  |  |  ------------------
  |  |  522|     21|      free(local_buffer);                                                        \
  |  |  523|     21|      free(cell_aux);                                                            \
  |  |  524|     21|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     21|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     21|    do {                                            \
  |  |  |  |  |  |   98|     21|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     21|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 21, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     21|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     21|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     21|    }                                                                            \
  |  |  527|     87|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 66]
  |  |  ------------------
  ------------------
  612|     66|        const uint8_t *ref = (const uint8_t *) input + bpos;
  613|    198|        for (int l = 0; l < 2; l++) {
  ------------------
  |  Branch (613:25): [True: 132, False: 66]
  ------------------
  614|    132|          memcpy(&buffercpy[(row + l) * cell_shape], ref + l * cell_shape, cell_shape);
  615|    132|        }
  616|    558|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (616:25): [True: 500, False: 58]
  ------------------
  617|    500|          if ((l < row) || (l > row + 1)) {
  ------------------
  |  Branch (617:15): [True: 248, False: 252]
  |  Branch (617:28): [True: 128, False: 124]
  ------------------
  618|    376|            NDLZ8_CHECK_RANGE(ip - (const uint8_t *) input, cell_shape);
  ------------------
  |  |  518|    376|  do {                                                                           \
  |  |  519|    376|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    376|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    376|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 376]
  |  |  |  Branch (521:21): [True: 0, False: 376]
  |  |  |  Branch (521:33): [True: 8, False: 368]
  |  |  ------------------
  |  |  522|      8|      free(local_buffer);                                                        \
  |  |  523|      8|      free(cell_aux);                                                            \
  |  |  524|      8|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      8|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      8|    do {                                            \
  |  |  |  |  |  |   98|      8|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      8|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 8, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      8|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      8|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      8|    }                                                                            \
  |  |  527|    376|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 368]
  |  |  ------------------
  ------------------
  619|    368|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  620|    368|            ip += cell_shape;
  621|    368|          }
  622|    500|        }
  623|     66|      } else {
  624|     44|        free(local_buffer);
  625|     44|        free(cell_aux);
  626|     44|        BLOSC_TRACE_ERROR("Invalid token: %u at cell [%d, %d]\n", token, ii[0], ii[1]);
  ------------------
  |  |   93|     44|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     44|    do {                                            \
  |  |  |  |   98|     44|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     44|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 44, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     44|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  627|     44|        return BLOSC2_ERROR_FAILURE;
  628|     44|      }
  629|       |
  630|    927|      int32_t orig = ii[0] * cell_shape * blockshape[1] + ii[1] * cell_shape;
  631|  8.34k|      for (int32_t i = 0; i < (int32_t) cell_shape; i++) {
  ------------------
  |  Branch (631:27): [True: 7.41k, False: 927]
  ------------------
  632|  7.41k|        if (i < padding[0]) {
  ------------------
  |  Branch (632:13): [True: 3.14k, False: 4.26k]
  ------------------
  633|  3.14k|          ind = orig + i * blockshape[1];
  634|  3.14k|          memcpy(&op[ind], buffercpy, padding[1]);
  635|       |          // Only advance over rows we actually consume.  For a literal cell
  636|       |          // (token == 0) buffercpy points into the input and only holds
  637|       |          // padding[0] * padding[1] bytes; advancing unconditionally for the
  638|       |          // trailing padding rows would form an out-of-bounds pointer (UB)
  639|       |          // for the block's last cell.  The skipped rows are never read.
  640|  3.14k|          buffercpy += padding[1];
  641|  3.14k|        }
  642|  7.41k|      }
  643|    927|      if (ind > output_len) {
  ------------------
  |  Branch (643:11): [True: 0, False: 927]
  ------------------
  644|      0|        free(local_buffer);
  645|      0|        free(cell_aux);
  646|      0|        BLOSC_TRACE_ERROR("Exceeding output size");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  647|      0|        return BLOSC2_ERROR_FAILURE;
  648|      0|      }
  649|    927|    }
  650|   766M|  }
  651|     16|  ind += padding[1];
  652|       |
  653|     16|  free(cell_aux);
  654|     16|  free(local_buffer);
  655|       |
  656|     16|  if (ind != (blockshape[0] * blockshape[1])) {
  ------------------
  |  Branch (656:7): [True: 0, False: 16]
  ------------------
  657|      0|    BLOSC_TRACE_ERROR("Output size is not compatible with embedded blockshape");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  658|      0|    return BLOSC2_ERROR_FAILURE;
  659|      0|  }
  660|     16|  if (ind > output_len) {
  ------------------
  |  Branch (660:7): [True: 0, False: 16]
  ------------------
  661|      0|    BLOSC_TRACE_ERROR("Exceeding output size");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  662|      0|    return BLOSC2_ERROR_FAILURE;
  663|      0|  }
  664|       |
  665|     16|  return (int) ind;
  666|     16|#undef NDLZ8_CHECK_RANGE
  667|     16|}

zfp_acc_decompress:
  233|      1|                       int32_t output_len, uint8_t meta, blosc2_dparams *dparams, const void *chunk) {
  234|      1|  ZFP_ERROR_NULL(input);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
  235|      1|  ZFP_ERROR_NULL(output);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
  236|      1|  ZFP_ERROR_NULL(dparams);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
  237|      1|  ZFP_ERROR_NULL(dparams->schunk);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 1, False: 0]
  |  |  ------------------
  |  |   24|      1|      return 0;                 \
  |  |   25|      1|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  238|      0|  BLOSC_UNUSED_PARAM(chunk);
  ------------------
  |  |   28|      0|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  239|       |
  240|      0|  blosc2_schunk *sc = dparams->schunk;
  241|      0|  int32_t typesize = sc->typesize;
  242|       |
  243|      0|  double tol = (int8_t) meta;
  244|      0|  int8_t ndim;
  245|      0|  int64_t *shape = malloc(B2ND_MAX_DIM * sizeof(int64_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  246|      0|  int32_t *chunkshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  247|      0|  int32_t *blockshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  248|      0|  uint8_t *smeta;
  249|      0|  int32_t smeta_len;
  250|      0|  if (blosc2_meta_get(sc, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (250:7): [True: 0, False: 0]
  ------------------
  251|      0|    BLOSC_TRACE_ERROR("Cannot access b2nd meta info");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|      0|    free(shape);
  253|      0|    free(chunkshape);
  254|      0|    free(blockshape);
  255|      0|    return BLOSC2_ERROR_FAILURE;
  256|      0|  }
  257|      0|  int deserialize_rc = b2nd_deserialize_meta(smeta, smeta_len, &ndim, shape, chunkshape, blockshape, NULL, NULL);
  258|      0|  free(smeta);
  259|       |
  260|      0|  if (zfp_check_output_size(deserialize_rc, ndim, blockshape, typesize, output_len) < 0) {
  ------------------
  |  Branch (260:7): [True: 0, False: 0]
  ------------------
  261|      0|    free(shape);
  262|      0|    free(chunkshape);
  263|      0|    free(blockshape);
  264|      0|    return BLOSC2_ERROR_FAILURE;
  265|      0|  }
  266|       |
  267|      0|  zfp_type type;     /* array scalar type */
  268|      0|  zfp_field *field;  /* array meta data */
  269|      0|  zfp_stream *zfp;   /* compressed stream */
  270|      0|  bitstream *stream; /* bit stream to write to or read from */
  271|      0|  size_t zfpsize;    /* byte size of compressed stream */
  272|      0|  double tolerance = pow(10, tol);
  273|       |
  274|      0|  switch (typesize) {
  275|      0|    case sizeof(float):
  ------------------
  |  Branch (275:5): [True: 0, False: 0]
  ------------------
  276|      0|      type = zfp_type_float;
  277|      0|      break;
  278|      0|    case sizeof(double):
  ------------------
  |  Branch (278:5): [True: 0, False: 0]
  ------------------
  279|      0|      type = zfp_type_double;
  280|      0|      break;
  281|      0|    default:
  ------------------
  |  Branch (281:5): [True: 0, False: 0]
  ------------------
  282|      0|      free(shape);
  283|      0|      free(chunkshape);
  284|      0|      free(blockshape);
  285|      0|      BLOSC_TRACE_ERROR("ZFP is not available for typesize: %d", typesize);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  286|      0|      return BLOSC2_ERROR_FAILURE;
  287|      0|  }
  288|       |
  289|      0|  zfp = zfp_stream_open(NULL);
  290|      0|  zfp_stream_set_accuracy(zfp, tolerance);
  291|      0|  stream = stream_open((void *) input, input_len);
  292|      0|  zfp_stream_set_bit_stream(zfp, stream);
  293|      0|  zfp_stream_rewind(zfp);
  294|       |
  295|      0|  switch (ndim) {
  296|      0|    case 1:
  ------------------
  |  Branch (296:5): [True: 0, False: 0]
  ------------------
  297|      0|      field = zfp_field_1d((void *) output, type, blockshape[0]);
  298|      0|      break;
  299|      0|    case 2:
  ------------------
  |  Branch (299:5): [True: 0, False: 0]
  ------------------
  300|      0|      field = zfp_field_2d((void *) output, type, blockshape[1], blockshape[0]);
  301|      0|      break;
  302|      0|    case 3:
  ------------------
  |  Branch (302:5): [True: 0, False: 0]
  ------------------
  303|      0|      field = zfp_field_3d((void *) output, type, blockshape[2], blockshape[1], blockshape[0]);
  304|      0|      break;
  305|      0|    case 4:
  ------------------
  |  Branch (305:5): [True: 0, False: 0]
  ------------------
  306|      0|      field = zfp_field_4d((void *) output, type, blockshape[3], blockshape[2], blockshape[1], blockshape[0]);
  307|      0|      break;
  308|      0|    default:
  ------------------
  |  Branch (308:5): [True: 0, False: 0]
  ------------------
  309|      0|      free(shape);
  310|      0|      free(chunkshape);
  311|      0|      free(blockshape);
  312|      0|      BLOSC_TRACE_ERROR("ZFP is not available for ndims: %d", ndim);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  313|      0|      return BLOSC2_ERROR_FAILURE;
  314|      0|  }
  315|       |
  316|      0|  zfpsize = zfp_decompress(zfp, field);
  317|       |
  318|       |  /* clean up */
  319|      0|  zfp_field_free(field);
  320|      0|  zfp_stream_close(zfp);
  321|      0|  stream_close(stream);
  322|      0|  free(shape);
  323|      0|  free(chunkshape);
  324|      0|  free(blockshape);
  325|       |
  326|      0|  if (zfpsize == 0) {
  ------------------
  |  Branch (326:7): [True: 0, False: 0]
  ------------------
  327|      0|    BLOSC_TRACE_ERROR("\n ZFP: Decompression failed\n");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  328|      0|    return (int) zfpsize;
  329|      0|  }
  330|       |
  331|      0|  return (int) output_len;
  332|      0|}
zfp_prec_decompress:
  509|      2|                        int32_t output_len, uint8_t meta, blosc2_dparams *dparams, const void *chunk) {
  510|      2|  ZFP_ERROR_NULL(input);
  ------------------
  |  |   22|      2|  do {                          \
  |  |   23|      2|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
  511|      2|  ZFP_ERROR_NULL(output);
  ------------------
  |  |   22|      2|  do {                          \
  |  |   23|      2|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
  512|      2|  ZFP_ERROR_NULL(dparams);
  ------------------
  |  |   22|      2|  do {                          \
  |  |   23|      2|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
  513|      2|  ZFP_ERROR_NULL(dparams->schunk);
  ------------------
  |  |   22|      2|  do {                          \
  |  |   23|      2|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 2, False: 0]
  |  |  ------------------
  |  |   24|      2|      return 0;                 \
  |  |   25|      2|    }                           \
  |  |   26|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  514|      0|  BLOSC_UNUSED_PARAM(chunk);
  ------------------
  |  |   28|      0|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  515|       |
  516|      0|  blosc2_schunk *sc = dparams->schunk;
  517|      0|  int32_t typesize = sc->typesize;
  518|      0|  int8_t ndim;
  519|      0|  int64_t *shape = malloc(B2ND_MAX_DIM * sizeof(int64_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  520|      0|  int32_t *chunkshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  521|      0|  int32_t *blockshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  522|      0|  uint8_t *smeta;
  523|      0|  int32_t smeta_len;
  524|      0|  if (blosc2_meta_get(sc, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (524:7): [True: 0, False: 0]
  ------------------
  525|      0|    BLOSC_TRACE_ERROR("Cannot access b2nd meta info");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  526|      0|    free(shape);
  527|      0|    free(chunkshape);
  528|      0|    free(blockshape);
  529|      0|    return BLOSC2_ERROR_FAILURE;
  530|      0|  }
  531|      0|  int deserialize_rc = b2nd_deserialize_meta(smeta, smeta_len, &ndim, shape, chunkshape, blockshape, NULL, NULL);
  532|      0|  free(smeta);
  533|       |
  534|      0|  if (zfp_check_output_size(deserialize_rc, ndim, blockshape, typesize, output_len) < 0) {
  ------------------
  |  Branch (534:7): [True: 0, False: 0]
  ------------------
  535|      0|    free(shape);
  536|      0|    free(chunkshape);
  537|      0|    free(blockshape);
  538|      0|    return BLOSC2_ERROR_FAILURE;
  539|      0|  }
  540|       |
  541|      0|  zfp_type type;     /* array scalar type */
  542|      0|  zfp_field *field;  /* array meta data */
  543|      0|  zfp_stream *zfp;   /* compressed stream */
  544|      0|  bitstream *stream; /* bit stream to write to or read from */
  545|      0|  size_t zfpsize;    /* byte size of compressed stream */
  546|       |
  547|      0|  uint prec;
  548|      0|  switch (ndim) {
  549|      0|    case 1:
  ------------------
  |  Branch (549:5): [True: 0, False: 0]
  ------------------
  550|      0|      prec = meta + 5;
  551|      0|      break;
  552|      0|    case 2:
  ------------------
  |  Branch (552:5): [True: 0, False: 0]
  ------------------
  553|      0|      prec = meta + 7;
  554|      0|      break;
  555|      0|    case 3:
  ------------------
  |  Branch (555:5): [True: 0, False: 0]
  ------------------
  556|      0|      prec = meta + 9;
  557|      0|      break;
  558|      0|    case 4:
  ------------------
  |  Branch (558:5): [True: 0, False: 0]
  ------------------
  559|      0|      prec = meta + 11;
  560|      0|      break;
  561|      0|    default:
  ------------------
  |  Branch (561:5): [True: 0, False: 0]
  ------------------
  562|      0|      free(shape);
  563|      0|      free(chunkshape);
  564|      0|      free(blockshape);
  565|      0|      BLOSC_TRACE_ERROR("ZFP is not available for ndims: %d", ndim);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  566|      0|      return BLOSC2_ERROR_FAILURE;
  567|      0|  }
  568|       |
  569|      0|  if (prec > ZFP_MAX_PREC) {
  ------------------
  |  |   20|      0|#define ZFP_MAX_PREC    64 /* maximum precision supported */
  ------------------
  |  Branch (569:7): [True: 0, False: 0]
  ------------------
  570|      0|    BLOSC_TRACE_ERROR("Max precision for this codecs is %d", ZFP_MAX_PREC);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  570|      0|    BLOSC_TRACE_ERROR("Max precision for this codecs is %d", ZFP_MAX_PREC);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   20|      0|#define ZFP_MAX_PREC    64 /* maximum precision supported */
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  571|      0|    prec = ZFP_MAX_PREC;
  ------------------
  |  |   20|      0|#define ZFP_MAX_PREC    64 /* maximum precision supported */
  ------------------
  572|      0|  }
  573|       |
  574|      0|  switch (typesize) {
  575|      0|    case sizeof(float):
  ------------------
  |  Branch (575:5): [True: 0, False: 0]
  ------------------
  576|      0|      type = zfp_type_float;
  577|      0|      break;
  578|      0|    case sizeof(double):
  ------------------
  |  Branch (578:5): [True: 0, False: 0]
  ------------------
  579|      0|      type = zfp_type_double;
  580|      0|      break;
  581|      0|    default:
  ------------------
  |  Branch (581:5): [True: 0, False: 0]
  ------------------
  582|      0|      free(shape);
  583|      0|      free(chunkshape);
  584|      0|      free(blockshape);
  585|      0|      BLOSC_TRACE_ERROR("ZFP is not available for typesize: %d", typesize);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  586|      0|      return BLOSC2_ERROR_FAILURE;
  587|      0|  }
  588|       |
  589|      0|  zfp = zfp_stream_open(NULL);
  590|      0|  zfp_stream_set_precision(zfp, prec);
  591|      0|  stream = stream_open((void *) input, input_len);
  592|      0|  zfp_stream_set_bit_stream(zfp, stream);
  593|      0|  zfp_stream_rewind(zfp);
  594|       |
  595|      0|  switch (ndim) {
  596|      0|    case 1:
  ------------------
  |  Branch (596:5): [True: 0, False: 0]
  ------------------
  597|      0|      field = zfp_field_1d((void *) output, type, blockshape[0]);
  598|      0|      break;
  599|      0|    case 2:
  ------------------
  |  Branch (599:5): [True: 0, False: 0]
  ------------------
  600|      0|      field = zfp_field_2d((void *) output, type, blockshape[1], blockshape[0]);
  601|      0|      break;
  602|      0|    case 3:
  ------------------
  |  Branch (602:5): [True: 0, False: 0]
  ------------------
  603|      0|      field = zfp_field_3d((void *) output, type, blockshape[2], blockshape[1], blockshape[0]);
  604|      0|      break;
  605|      0|    case 4:
  ------------------
  |  Branch (605:5): [True: 0, False: 0]
  ------------------
  606|      0|      field = zfp_field_4d((void *) output, type, blockshape[3], blockshape[2], blockshape[1], blockshape[0]);
  607|      0|      break;
  608|      0|    default:
  ------------------
  |  Branch (608:5): [True: 0, False: 0]
  ------------------
  609|      0|      free(shape);
  610|      0|      free(chunkshape);
  611|      0|      free(blockshape);
  612|      0|      BLOSC_TRACE_ERROR("ZFP is not available for ndims: %d", ndim);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  613|      0|      return BLOSC2_ERROR_FAILURE;
  614|      0|  }
  615|       |
  616|      0|  zfpsize = zfp_decompress(zfp, field);
  617|       |
  618|       |  /* clean up */
  619|      0|  zfp_field_free(field);
  620|      0|  zfp_stream_close(zfp);
  621|      0|  stream_close(stream);
  622|      0|  free(shape);
  623|      0|  free(chunkshape);
  624|      0|  free(blockshape);
  625|       |
  626|      0|  if (zfpsize == 0) {
  ------------------
  |  Branch (626:7): [True: 0, False: 0]
  ------------------
  627|      0|    BLOSC_TRACE_ERROR("\n ZFP: Decompression failed\n");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  628|      0|    return (int) zfpsize;
  629|      0|  }
  630|       |
  631|      0|  return (int) output_len;
  632|      0|}
zfp_rate_decompress:
  796|      1|                        int32_t output_len, uint8_t meta, blosc2_dparams *dparams, const void *chunk) {
  797|      1|  ZFP_ERROR_NULL(input);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
  798|      1|  ZFP_ERROR_NULL(output);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
  799|      1|  ZFP_ERROR_NULL(dparams);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      0|      return 0;                 \
  |  |   25|      0|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 1]
  |  |  ------------------
  ------------------
  800|      1|  ZFP_ERROR_NULL(dparams->schunk);
  ------------------
  |  |   22|      1|  do {                          \
  |  |   23|      1|    if ((pointer) == NULL) {    \
  |  |  ------------------
  |  |  |  Branch (23:9): [True: 1, False: 0]
  |  |  ------------------
  |  |   24|      1|      return 0;                 \
  |  |   25|      1|    }                           \
  |  |   26|      1|  } while (0)
  |  |  ------------------
  |  |  |  Branch (26:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
  801|      0|  BLOSC_UNUSED_PARAM(chunk);
  ------------------
  |  |   28|      0|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  802|       |
  803|      0|  blosc2_schunk *sc = dparams->schunk;
  804|      0|  int32_t typesize = sc->typesize;
  805|       |
  806|      0|  double ratio = (double) meta / 100.0;
  807|      0|  int8_t ndim;
  808|      0|  int64_t *shape = malloc(B2ND_MAX_DIM * sizeof(int64_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  809|      0|  int32_t *chunkshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  810|      0|  int32_t *blockshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  811|      0|  uint8_t *smeta;
  812|      0|  int32_t smeta_len;
  813|      0|  if (blosc2_meta_get(sc, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (813:7): [True: 0, False: 0]
  ------------------
  814|      0|    BLOSC_TRACE_ERROR("Cannot access b2nd meta info");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  815|      0|    free(shape);
  816|      0|    free(chunkshape);
  817|      0|    free(blockshape);
  818|      0|    return BLOSC2_ERROR_FAILURE;
  819|      0|  }
  820|      0|  int deserialize_rc = b2nd_deserialize_meta(smeta, smeta_len, &ndim, shape, chunkshape, blockshape, NULL, NULL);
  821|      0|  free(smeta);
  822|       |
  823|      0|  if (zfp_check_output_size(deserialize_rc, ndim, blockshape, typesize, output_len) < 0) {
  ------------------
  |  Branch (823:7): [True: 0, False: 0]
  ------------------
  824|      0|    free(shape);
  825|      0|    free(chunkshape);
  826|      0|    free(blockshape);
  827|      0|    return BLOSC2_ERROR_FAILURE;
  828|      0|  }
  829|       |
  830|      0|  zfp_type type;     /* array scalar type */
  831|      0|  zfp_field *field;  /* array meta data */
  832|      0|  zfp_stream *zfp;   /* compressed stream */
  833|      0|  bitstream *stream; /* bit stream to write to or read from */
  834|      0|  size_t zfpsize;    /* byte size of compressed stream */
  835|       |
  836|      0|  switch (typesize) {
  837|      0|    case sizeof(float):
  ------------------
  |  Branch (837:5): [True: 0, False: 0]
  ------------------
  838|      0|      type = zfp_type_float;
  839|      0|      break;
  840|      0|    case sizeof(double):
  ------------------
  |  Branch (840:5): [True: 0, False: 0]
  ------------------
  841|      0|      type = zfp_type_double;
  842|      0|      break;
  843|      0|    default:
  ------------------
  |  Branch (843:5): [True: 0, False: 0]
  ------------------
  844|      0|      free(shape);
  845|      0|      free(chunkshape);
  846|      0|      free(blockshape);
  847|      0|      BLOSC_TRACE_ERROR("ZFP is not available for typesize: %d", typesize);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  848|      0|      return BLOSC2_ERROR_FAILURE;
  849|      0|  }
  850|      0|  double rate =
  851|      0|      ratio * (double) typesize * 8;     // convert from output size / input size to output bits per input value
  852|      0|  zfp = zfp_stream_open(NULL);
  853|      0|  zfp_stream_set_rate(zfp, rate, type, ndim, zfp_false);
  854|       |
  855|      0|  stream = stream_open((void *) input, input_len);
  856|      0|  zfp_stream_set_bit_stream(zfp, stream);
  857|      0|  zfp_stream_rewind(zfp);
  858|       |
  859|      0|  switch (ndim) {
  860|      0|    case 1:
  ------------------
  |  Branch (860:5): [True: 0, False: 0]
  ------------------
  861|      0|      field = zfp_field_1d((void *) output, type, blockshape[0]);
  862|      0|      break;
  863|      0|    case 2:
  ------------------
  |  Branch (863:5): [True: 0, False: 0]
  ------------------
  864|      0|      field = zfp_field_2d((void *) output, type, blockshape[1], blockshape[0]);
  865|      0|      break;
  866|      0|    case 3:
  ------------------
  |  Branch (866:5): [True: 0, False: 0]
  ------------------
  867|      0|      field = zfp_field_3d((void *) output, type, blockshape[2], blockshape[1], blockshape[0]);
  868|      0|      break;
  869|      0|    case 4:
  ------------------
  |  Branch (869:5): [True: 0, False: 0]
  ------------------
  870|      0|      field = zfp_field_4d((void *) output, type, blockshape[3], blockshape[2], blockshape[1], blockshape[0]);
  871|      0|      break;
  872|      0|    default:
  ------------------
  |  Branch (872:5): [True: 0, False: 0]
  ------------------
  873|      0|      free(shape);
  874|      0|      free(chunkshape);
  875|      0|      free(blockshape);
  876|      0|      BLOSC_TRACE_ERROR("ZFP is not available for ndims: %d", ndim);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  877|      0|      return BLOSC2_ERROR_FAILURE;
  878|      0|  }
  879|       |
  880|      0|  zfpsize = zfp_decompress(zfp, field);
  881|       |
  882|       |  /* clean up */
  883|      0|  zfp_field_free(field);
  884|      0|  zfp_stream_close(zfp);
  885|      0|  stream_close(stream);
  886|      0|  free(shape);
  887|      0|  free(chunkshape);
  888|      0|  free(blockshape);
  889|       |
  890|      0|  if (zfpsize == 0) {
  ------------------
  |  Branch (890:7): [True: 0, False: 0]
  ------------------
  891|      0|    BLOSC_TRACE_ERROR("\n ZFP: Decompression failed\n");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  892|      0|    return (int) zfpsize;
  893|      0|  }
  894|       |
  895|      0|  return (int) output_len;
  896|      0|}

simd_load:
   34|  1.37G|bytes16 simd_load(const void* ptr) { return _mm_loadu_si128((const __m128i*)ptr); }
simd_store:
   35|  1.37G|void simd_store(void* ptr, bytes16 x) { _mm_storeu_si128((__m128i*)ptr, x); }
simd_add:
   38|  1.37G|bytes16 simd_add(bytes16 a, bytes16 b) { return _mm_add_epi8(a, b); }
simd_duplane15:
   40|  1.37G|bytes16 simd_duplane15(bytes16 x) { return _mm_shuffle_epi8(x, _mm_set1_epi8(15)); }
simd_prefix_sum:
   43|  1.37G|{
   44|       |  // Sklansky-style sum from https://gist.github.com/rygorous/4212be0cd009584e4184e641ca210528
   45|  1.37G|  x = _mm_add_epi8(x, _mm_slli_epi64(x, 8));
   46|  1.37G|  x = _mm_add_epi8(x, _mm_slli_epi64(x, 16));
   47|  1.37G|  x = _mm_add_epi8(x, _mm_slli_epi64(x, 32));
   48|  1.37G|  x = _mm_add_epi8(x, _mm_shuffle_epi8(x, _mm_setr_epi8(-1,-1,-1,-1,-1,-1,-1,-1,7,7,7,7,7,7,7,7)));
   49|  1.37G|  return x;
   50|  1.37G|}
simd_get_last:
   52|   222k|uint8_t simd_get_last(bytes16 x) { return (_mm_extract_epi16(x, 7) >> 8) & 0xFF; }
bytedelta_backward:
  139|  34.3k|                       blosc2_dparams *dparams, uint8_t id) {
  140|  34.3k|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|  34.3k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  141|       |
  142|  34.3k|  int typesize = meta;
  143|  34.3k|  if (typesize == 0) {
  ------------------
  |  Branch (143:7): [True: 14, False: 34.3k]
  ------------------
  144|     14|    if (dparams->schunk == NULL) {
  ------------------
  |  Branch (144:9): [True: 8, False: 6]
  ------------------
  145|      8|      BLOSC_TRACE_ERROR("When meta is 0, you need to be on a schunk!");
  ------------------
  |  |   93|      8|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      8|    do {                                            \
  |  |  |  |   98|      8|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      8|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      8|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  146|      8|      BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  111|      8|    do {                                            \
  |  |  112|      8|        int rc_ = (rc);                             \
  |  |  113|      8|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 8, False: 0]
  |  |  ------------------
  |  |  114|      8|            char *error_msg = print_error(rc_);     \
  |  |  115|      8|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|      8|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      8|    do {                                            \
  |  |  |  |  |  |   98|      8|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      8|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 8, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      8|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      8|            return rc_;                             \
  |  |  117|      8|        }                                           \
  |  |  118|      8|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  147|      8|    }
  148|      6|    blosc2_schunk* schunk = (blosc2_schunk*)(dparams->schunk);
  149|      6|    typesize = schunk->typesize;
  150|      6|  }
  151|       |
  152|  34.3k|  const int stream_len = length / typesize;
  153|  85.2M|  for (int ich = 0; ich < typesize; ++ich) {
  ------------------
  |  Branch (153:21): [True: 85.1M, False: 34.3k]
  ------------------
  154|  85.1M|    int ip = 0;
  155|  85.1M|    uint8_t _v2 = 0;
  156|       |    // SIMD fetch 16 bytes from each channel, prefix-sum un-delta
  157|  85.1M|#if defined(CPU_HAS_SIMD)
  158|  85.1M|    bytes16 v2 = {0};
  159|  1.08G|    for (; ip < stream_len - 15; ip += 16) {
  ------------------
  |  Branch (159:12): [True: 994M, False: 85.1M]
  ------------------
  160|   994M|      bytes16 v = simd_load(input);
  161|   994M|      input += 16;
  162|       |      // un-delta via prefix sum
  163|   994M|      v2 = simd_add(simd_prefix_sum(v), simd_duplane15(v2));
  164|   994M|      simd_store(output, v2);
  165|   994M|      output += 16;
  166|   994M|    }
  167|  85.1M|    if (stream_len > 15) {
  ------------------
  |  Branch (167:9): [True: 222k, False: 84.9M]
  ------------------
  168|   222k|      _v2 = simd_get_last(v2);
  169|   222k|    }
  170|  85.1M|#endif // #if defined(CPU_HAS_SIMD)
  171|       |    // scalar leftover
  172|   115M|    for (; ip < stream_len; ip++) {
  ------------------
  |  Branch (172:12): [True: 29.8M, False: 85.1M]
  ------------------
  173|  29.8M|      uint8_t v = *input + _v2;
  174|  29.8M|      input++;
  175|  29.8M|      *output = v;
  176|  29.8M|      output++;
  177|  29.8M|      _v2 = v;
  178|  29.8M|    }
  179|  85.1M|  }
  180|       |
  181|       |  // Mirror of the forward pass: restore the trailing bytes verbatim.
  182|  34.3k|  memcpy(output, input, (size_t)(length - stream_len * typesize));
  183|       |
  184|  34.3k|  return BLOSC2_ERROR_SUCCESS;
  185|  34.3k|}
bytedelta_backward_buggy:
  235|  44.9k|                             uint8_t meta, blosc2_dparams *dparams, uint8_t id) {
  236|  44.9k|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|  44.9k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  237|       |
  238|  44.9k|  int typesize = meta;
  239|  44.9k|  if (typesize == 0) {
  ------------------
  |  Branch (239:7): [True: 4, False: 44.9k]
  ------------------
  240|      4|    if (dparams->schunk == NULL) {
  ------------------
  |  Branch (240:9): [True: 3, False: 1]
  ------------------
  241|      3|      BLOSC_TRACE_ERROR("When meta is 0, you need to be on a schunk!");
  ------------------
  |  |   93|      3|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      3|    do {                                            \
  |  |  |  |   98|      3|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      3|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      3|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  242|      3|      BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  111|      3|    do {                                            \
  |  |  112|      3|        int rc_ = (rc);                             \
  |  |  113|      3|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 3, False: 0]
  |  |  ------------------
  |  |  114|      3|            char *error_msg = print_error(rc_);     \
  |  |  115|      3|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|      3|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      3|    do {                                            \
  |  |  |  |  |  |   98|      3|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      3|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 3, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      3|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      3|            return rc_;                             \
  |  |  117|      3|        }                                           \
  |  |  118|      3|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  243|      3|    }
  244|      1|    blosc2_schunk* schunk = (blosc2_schunk*)(dparams->schunk);
  245|      1|    typesize = schunk->typesize;
  246|      1|  }
  247|       |
  248|  44.9k|  const int stream_len = length / typesize;
  249|  5.47M|  for (int ich = 0; ich < typesize; ++ich) {
  ------------------
  |  Branch (249:21): [True: 5.43M, False: 44.9k]
  ------------------
  250|  5.43M|    int ip = 0;
  251|       |    // SIMD fetch 16 bytes from each channel, prefix-sum un-delta
  252|  5.43M|#if defined(CPU_HAS_SIMD)
  253|  5.43M|    bytes16 v2 = {0};
  254|   382M|    for (; ip < stream_len - 15; ip += 16) {
  ------------------
  |  Branch (254:12): [True: 376M, False: 5.43M]
  ------------------
  255|   376M|      bytes16 v = simd_load(input);
  256|   376M|      input += 16;
  257|       |      // un-delta via prefix sum
  258|   376M|      v2 = simd_add(simd_prefix_sum(v), simd_duplane15(v2));
  259|   376M|      simd_store(output, v2);
  260|   376M|      output += 16;
  261|   376M|    }
  262|  5.43M|#endif // #if defined(CPU_HAS_SIMD)
  263|       |    // scalar leftover
  264|  5.43M|    uint8_t _v2 = 0;
  265|  36.1M|    for (; ip < stream_len; ip++) {
  ------------------
  |  Branch (265:12): [True: 30.7M, False: 5.43M]
  ------------------
  266|  30.7M|      uint8_t v = *input + _v2;
  267|  30.7M|      input++;
  268|  30.7M|      *output = v;
  269|  30.7M|      output++;
  270|  30.7M|      _v2 = v;
  271|  30.7M|    }
  272|  5.43M|  }
  273|       |
  274|  44.9k|  return BLOSC2_ERROR_SUCCESS;
  275|  44.9k|}

register_filters:
   15|  12.2k|void register_filters(void) {
   16|       |
   17|  12.2k|  blosc2_filter ndcell;
   18|  12.2k|  ndcell.id = BLOSC_FILTER_NDCELL;
   19|  12.2k|  ndcell.name = "ndcell";
   20|  12.2k|  ndcell.version = 1;
   21|  12.2k|  ndcell.forward = &ndcell_forward;
   22|  12.2k|  ndcell.backward = &ndcell_backward;
   23|  12.2k|  register_filter_private(&ndcell);
   24|       |
   25|  12.2k|  blosc2_filter ndmean;
   26|  12.2k|  ndmean.id = BLOSC_FILTER_NDMEAN;
   27|  12.2k|  ndmean.name = "ndmean";
   28|  12.2k|  ndmean.version = 1;
   29|  12.2k|  ndmean.forward = &ndmean_forward;
   30|  12.2k|  ndmean.backward = &ndmean_backward;
   31|  12.2k|  register_filter_private(&ndmean);
   32|       |
   33|       |  // Buggy version. See #524
   34|  12.2k|  blosc2_filter bytedelta_buggy;
   35|  12.2k|  bytedelta_buggy.id = BLOSC_FILTER_BYTEDELTA_BUGGY;
   36|  12.2k|  bytedelta_buggy.name = "bytedelta_buggy";
   37|  12.2k|  bytedelta_buggy.version = 1;
   38|  12.2k|  bytedelta_buggy.forward = &bytedelta_forward_buggy;
   39|  12.2k|  bytedelta_buggy.backward = &bytedelta_backward_buggy;
   40|  12.2k|  register_filter_private(&bytedelta_buggy);
   41|       |
   42|       |  // Fixed version. See #524
   43|  12.2k|  blosc2_filter bytedelta;
   44|  12.2k|  bytedelta.id = BLOSC_FILTER_BYTEDELTA;
   45|  12.2k|  bytedelta.name = "bytedelta";
   46|  12.2k|  bytedelta.version = 1;
   47|  12.2k|  bytedelta.forward = &bytedelta_forward;
   48|  12.2k|  bytedelta.backward = &bytedelta_backward;
   49|  12.2k|  register_filter_private(&bytedelta);
   50|       |
   51|  12.2k|  blosc2_filter int_trunc;
   52|  12.2k|  int_trunc.id = BLOSC_FILTER_INT_TRUNC;
   53|  12.2k|  int_trunc.name = "int_trunc";
   54|  12.2k|  int_trunc.version = 1;
   55|  12.2k|  int_trunc.forward = &int_trunc_forward;
   56|  12.2k|  int_trunc.backward = &int_trunc_backward;
   57|  12.2k|  register_filter_private(&int_trunc);
   58|       |
   59|  12.2k|}

int_trunc_backward:
  117|  5.26k|                       blosc2_dparams *dparams, uint8_t id) {
  118|  5.26k|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|  5.26k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  119|  5.26k|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|  5.26k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  120|  5.26k|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|  5.26k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  121|       |
  122|       |  // Do a copy of the input buffer (truncation is lossy and cannot be reversed)
  123|  5.26k|  memcpy(output, input, length);
  124|  5.26k|  return BLOSC2_ERROR_SUCCESS;
  125|  5.26k|}

ndcell_backward:
  205|      4|                   uint8_t id) {
  206|      4|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|      4|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  207|      4|  blosc2_schunk *schunk = dparams->schunk;
  208|      4|  int8_t ndim;
  209|      4|  int64_t *shape = malloc(B2ND_MAX_DIM * sizeof(int64_t));
  ------------------
  |  |   50|      4|#define B2ND_MAX_DIM 16
  ------------------
  210|      4|  int32_t *chunkshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      4|#define B2ND_MAX_DIM 16
  ------------------
  211|      4|  int32_t *blockshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      4|#define B2ND_MAX_DIM 16
  ------------------
  212|      4|  uint8_t *smeta;
  213|      4|  int32_t smeta_len;
  214|      4|  if (blosc2_meta_get(schunk, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (214:7): [True: 4, False: 0]
  ------------------
  215|      4|    free(shape);
  216|      4|    free(chunkshape);
  217|      4|    free(blockshape);
  218|      4|    BLOSC_TRACE_ERROR("b2nd layer not found!");
  ------------------
  |  |   93|      4|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      4|    do {                                            \
  |  |  |  |   98|      4|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      4|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      4|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  219|      4|    return BLOSC2_ERROR_FAILURE;
  220|      4|  }
  221|      0|  if (b2nd_deserialize_meta(smeta, smeta_len, &ndim, shape, chunkshape, blockshape, NULL, NULL) < 0) {
  ------------------
  |  Branch (221:7): [True: 0, False: 0]
  ------------------
  222|      0|    free(smeta);
  223|      0|    free(shape);
  224|      0|    free(chunkshape);
  225|      0|    free(blockshape);
  226|      0|    return BLOSC2_ERROR_FAILURE;
  227|      0|  }
  228|      0|  free(smeta);
  229|      0|  if (ndim <= 0 || ndim > NDCELL_MAX_DIM) {
  ------------------
  |  |   16|      0|#define NDCELL_MAX_DIM 8
  ------------------
  |  Branch (229:7): [True: 0, False: 0]
  |  Branch (229:20): [True: 0, False: 0]
  ------------------
  230|      0|    free(shape);
  231|      0|    free(chunkshape);
  232|      0|    free(blockshape);
  233|      0|    BLOSC_TRACE_ERROR("ndim %d is out of range", ndim);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|      0|    return BLOSC2_ERROR_FAILURE;
  235|      0|  }
  236|       |
  237|       |  // `meta` is attacker-controlled in a crafted frame.  Interpret it as unsigned
  238|       |  // and reject 0: an (int8_t) cast would turn 128..255 into negative values and
  239|       |  // 0 would later divide by zero in `(blockshape[i] + cell_shape - 1) / cell_shape`.
  240|      0|  int cell_shape = (int) meta;
  241|      0|  if (cell_shape <= 0) {
  ------------------
  |  Branch (241:7): [True: 0, False: 0]
  ------------------
  242|      0|    free(shape);
  243|      0|    free(chunkshape);
  244|      0|    free(blockshape);
  245|      0|    BLOSC_TRACE_ERROR("Invalid cell_shape %d", cell_shape);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  246|      0|    return BLOSC2_ERROR_FAILURE;
  247|      0|  }
  248|       |  // See ndcell_forward(): compute cell_shape^ndim with checked 64-bit
  249|       |  // multiplication so an overflowing (int) pow() cannot bypass the
  250|       |  // "buffer smaller than cell" check below.
  251|      0|  int64_t cell_size = 1;
  252|      0|  for (int i = 0; i < ndim; i++) {
  ------------------
  |  Branch (252:19): [True: 0, False: 0]
  ------------------
  253|      0|    if (cell_size > INT64_MAX / cell_shape) {
  ------------------
  |  Branch (253:9): [True: 0, False: 0]
  ------------------
  254|      0|      free(shape);
  255|      0|      free(chunkshape);
  256|      0|      free(blockshape);
  257|      0|      BLOSC_TRACE_ERROR("cell_shape %d too large for ndim %d", cell_shape, ndim);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  258|      0|      return BLOSC2_ERROR_FAILURE;
  259|      0|    }
  260|      0|    cell_size *= cell_shape;
  261|      0|  }
  262|      0|  int32_t typesize = schunk->typesize;
  263|      0|  uint8_t *ip = (uint8_t *) input;
  264|      0|  uint8_t *ip_limit = ip + length;
  265|      0|  uint8_t *op = (uint8_t *) output;
  266|      0|  if (typesize <= 0) {
  ------------------
  |  Branch (266:7): [True: 0, False: 0]
  ------------------
  267|      0|    free(shape);
  268|      0|    free(chunkshape);
  269|      0|    free(blockshape);
  270|      0|    BLOSC_TRACE_ERROR("Invalid typesize %d", typesize);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  271|      0|    return BLOSC2_ERROR_FAILURE;
  272|      0|  }
  273|       |  // The block geometry (blockshape) comes from the attacker-controlled "b2nd"
  274|       |  // metalayer and is NOT validated by b2nd_deserialize_meta().  Compute the
  275|       |  // block size in 64-bit and reject non-positive dimensions.  Otherwise a
  276|       |  // crafted blockshape whose 32-bit product wraps back onto `length` would pass
  277|       |  // the check below, while the scatter-write index arithmetic further down uses
  278|       |  // the true (huge) dimensions, writing past the `length`-sized output buffer
  279|       |  // (heap overflow).  Bailing as soon as the running product exceeds `length`
  280|       |  // also keeps the 64-bit multiply from overflowing (it stays
  281|       |  // <= length * INT32_MAX < INT64_MAX).
  282|      0|  int64_t blocksize = (int64_t) typesize;
  283|      0|  for (int i = 0; i < ndim; i++) {
  ------------------
  |  Branch (283:19): [True: 0, False: 0]
  ------------------
  284|      0|    if (blockshape[i] <= 0) {
  ------------------
  |  Branch (284:9): [True: 0, False: 0]
  ------------------
  285|      0|      free(shape);
  286|      0|      free(chunkshape);
  287|      0|      free(blockshape);
  288|      0|      BLOSC_TRACE_ERROR("Invalid blockshape[%d] = %d", i, blockshape[i]);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  289|      0|      return BLOSC2_ERROR_FAILURE;
  290|      0|    }
  291|      0|    blocksize *= blockshape[i];
  292|      0|    if (blocksize > (int64_t) length) {
  ------------------
  |  Branch (292:9): [True: 0, False: 0]
  ------------------
  293|      0|      free(shape);
  294|      0|      free(chunkshape);
  295|      0|      free(blockshape);
  296|      0|      BLOSC_TRACE_ERROR("blockshape too large for block of %d bytes", length);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  297|      0|      return BLOSC2_ERROR_FAILURE;
  298|      0|    }
  299|      0|  }
  300|       |
  301|      0|  if ((int64_t) length != blocksize) {
  ------------------
  |  Branch (301:7): [True: 0, False: 0]
  ------------------
  302|      0|    free(shape);
  303|      0|    free(chunkshape);
  304|      0|    free(blockshape);
  305|      0|    BLOSC_TRACE_ERROR("Length not equal to blocksize %d %lld", length, (long long) blocksize);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  306|      0|    return BLOSC2_ERROR_FAILURE;
  307|      0|  }
  308|       |
  309|       |  // length is a multiple of typesize here (length == blocksize, checked above),
  310|       |  // so the division is exact; phrasing the check this way avoids overflowing the
  311|       |  // cell_size * typesize product.
  312|      0|  if (cell_size > (int64_t) length / typesize) {
  ------------------
  |  Branch (312:7): [True: 0, False: 0]
  ------------------
  313|      0|    free(shape);
  314|      0|    free(chunkshape);
  315|      0|    free(blockshape);
  316|      0|    BLOSC_TRACE_ERROR("input and output buffer cannot be smaller than cell size");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  317|      0|    return BLOSC2_ERROR_FAILURE;
  318|      0|  }
  319|       |
  320|      0|  int64_t i_shape[NDCELL_MAX_DIM];
  321|      0|  for (int i = 0; i < ndim; ++i) {
  ------------------
  |  Branch (321:19): [True: 0, False: 0]
  ------------------
  322|      0|    i_shape[i] = (blockshape[i] + cell_shape - 1) / cell_shape;
  323|      0|  }
  324|       |
  325|      0|  int64_t ncells = 1;
  326|      0|  for (int i = 0; i < ndim; ++i) {
  ------------------
  |  Branch (326:19): [True: 0, False: 0]
  ------------------
  327|      0|    ncells *= i_shape[i];
  328|      0|  }
  329|       |
  330|       |  /* main loop */
  331|      0|  int64_t pad_shape[NDCELL_MAX_DIM] = {0};
  332|      0|  int64_t ii[NDCELL_MAX_DIM];
  333|      0|  int32_t ind = 0;
  334|      0|  for (int cell_ind = 0; cell_ind < ncells; cell_ind++) {      // for each cell
  ------------------
  |  Branch (334:26): [True: 0, False: 0]
  ------------------
  335|       |
  336|      0|    if (ip > ip_limit) {
  ------------------
  |  Branch (336:9): [True: 0, False: 0]
  ------------------
  337|      0|      free(shape);
  338|      0|      free(chunkshape);
  339|      0|      free(blockshape);
  340|      0|      BLOSC_TRACE_ERROR("Exceeding input length!");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  341|      0|      return BLOSC2_ERROR_FAILURE;
  342|      0|    }
  343|      0|    blosc2_unidim_to_multidim(ndim, i_shape, cell_ind, ii);
  344|      0|    uint32_t orig = 0;
  345|      0|    int64_t nd_aux = (int64_t) cell_shape;
  346|      0|    for (int i = ndim - 1; i >= 0; i--) {
  ------------------
  |  Branch (346:28): [True: 0, False: 0]
  ------------------
  347|      0|      orig += ii[i] * nd_aux;
  348|      0|      nd_aux *= blockshape[i];
  349|      0|    }
  350|       |
  351|      0|    for (int dim_ind = 0; dim_ind < ndim; dim_ind++) {
  ------------------
  |  Branch (351:27): [True: 0, False: 0]
  ------------------
  352|      0|      if ((blockshape[dim_ind] % cell_shape != 0) && (ii[dim_ind] == i_shape[dim_ind] - 1)) {
  ------------------
  |  Branch (352:11): [True: 0, False: 0]
  |  Branch (352:54): [True: 0, False: 0]
  ------------------
  353|      0|        pad_shape[dim_ind] = blockshape[dim_ind] % cell_shape;
  354|      0|      } else {
  355|      0|        pad_shape[dim_ind] = (int64_t) cell_shape;
  356|      0|      }
  357|      0|    }
  358|       |
  359|      0|    int64_t ncopies = 1;
  360|      0|    for (int i = 0; i < ndim - 1; ++i) {
  ------------------
  |  Branch (360:21): [True: 0, False: 0]
  ------------------
  361|      0|      ncopies *= pad_shape[i];
  362|      0|    }
  363|      0|    int64_t kk[NDCELL_MAX_DIM];
  364|      0|    for (int copy_ind = 0; copy_ind < ncopies; ++copy_ind) {
  ------------------
  |  Branch (364:28): [True: 0, False: 0]
  ------------------
  365|      0|      blosc2_unidim_to_multidim(ndim - 1, pad_shape, copy_ind, kk);
  366|      0|      nd_aux = blockshape[ndim - 1];
  367|      0|      ind = (int32_t) orig;
  368|      0|      for (int i = ndim - 2; i >= 0; i--) {
  ------------------
  |  Branch (368:30): [True: 0, False: 0]
  ------------------
  369|      0|        ind += (int32_t) (kk[i] * nd_aux);
  370|      0|        nd_aux *= blockshape[i];
  371|      0|      }
  372|      0|      memcpy(&op[ind * typesize], ip, pad_shape[ndim - 1] * typesize);
  373|      0|      ip += pad_shape[ndim - 1] * typesize;
  374|      0|    }
  375|      0|  }
  376|      0|  ind += (int32_t) pad_shape[ndim - 1];
  377|       |
  378|       |
  379|      0|  if (ind != (int32_t) (blocksize / typesize)) {
  ------------------
  |  Branch (379:7): [True: 0, False: 0]
  ------------------
  380|      0|    free(shape);
  381|      0|    free(chunkshape);
  382|      0|    free(blockshape);
  383|      0|    BLOSC_TRACE_ERROR("Output size is not compatible with embedded blockshape ind %d %lld \n",
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  384|      0|                      ind, (long long) (blocksize / typesize));
  385|      0|    return BLOSC2_ERROR_FAILURE;
  386|      0|  }
  387|       |
  388|      0|  free(shape);
  389|      0|  free(chunkshape);
  390|      0|  free(blockshape);
  391|       |
  392|      0|  return BLOSC2_ERROR_SUCCESS;
  393|      0|}

ndmean_backward:
  243|      5|                   uint8_t id) {
  244|      5|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|      5|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  245|      5|  blosc2_schunk *schunk = dparams->schunk;
  246|      5|  int8_t ndim;
  247|       |  // b2nd_deserialize_meta() writes up to B2ND_MAX_DIM entries (it only validates
  248|       |  // ndim <= B2ND_MAX_DIM), so the destination buffers must be sized accordingly,
  249|       |  // not for NDMEAN_MAX_DIM.  Otherwise a crafted b2nd metalayer with
  250|       |  // NDMEAN_MAX_DIM < ndim <= B2ND_MAX_DIM overflows these allocations.
  251|      5|  int64_t *shape = malloc(B2ND_MAX_DIM * sizeof(int64_t));
  ------------------
  |  |   50|      5|#define B2ND_MAX_DIM 16
  ------------------
  252|      5|  int32_t *chunkshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      5|#define B2ND_MAX_DIM 16
  ------------------
  253|      5|  int32_t *blockshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      5|#define B2ND_MAX_DIM 16
  ------------------
  254|      5|  uint8_t *smeta;
  255|      5|  int32_t smeta_len;
  256|      5|  if (blosc2_meta_get(schunk, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (256:7): [True: 5, False: 0]
  ------------------
  257|      5|    free(shape);
  258|      5|    free(chunkshape);
  259|      5|    free(blockshape);
  260|      5|    BLOSC_TRACE_ERROR("b2nd layer not found!");
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  261|      5|    return BLOSC2_ERROR_FAILURE;
  262|      5|  }
  263|      0|  if (b2nd_deserialize_meta(smeta, smeta_len, &ndim, shape, chunkshape, blockshape, NULL, NULL) < 0) {
  ------------------
  |  Branch (263:7): [True: 0, False: 0]
  ------------------
  264|      0|    free(smeta);
  265|      0|    free(shape);
  266|      0|    free(chunkshape);
  267|      0|    free(blockshape);
  268|      0|    BLOSC_TRACE_ERROR("Cannot deserialize b2nd metalayer");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  269|      0|    return BLOSC2_ERROR_FAILURE;
  270|      0|  }
  271|      0|  free(smeta);
  272|       |  // Guard the fixed-size (NDMEAN_MAX_DIM) stack arrays used below.
  273|      0|  if (ndim <= 0 || ndim > NDMEAN_MAX_DIM) {
  ------------------
  |  |   16|      0|#define NDMEAN_MAX_DIM 8
  ------------------
  |  Branch (273:7): [True: 0, False: 0]
  |  Branch (273:20): [True: 0, False: 0]
  ------------------
  274|      0|    free(shape);
  275|      0|    free(chunkshape);
  276|      0|    free(blockshape);
  277|      0|    BLOSC_TRACE_ERROR("ndim %d is out of range", ndim);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  278|      0|    return BLOSC2_ERROR_FAILURE;
  279|      0|  }
  280|       |
  281|       |  // `meta` carries the NDMEAN cell shape and is attacker-controlled (it is the
  282|       |  // chunk-header filters_meta byte).  It is cast to int8_t and used as the
  283|       |  // divisor when building i_shape[] below, so a value of 0 (divide-by-zero) or
  284|       |  // one that becomes negative after the cast (meta > INT8_MAX) would crash or
  285|       |  // produce bogus, out-of-range geometry (e.g. a negative pad_shape feeding a
  286|       |  // huge memcpy).  Require a positive cell shape.
  287|      0|  if ((int8_t) meta <= 0) {
  ------------------
  |  Branch (287:7): [True: 0, False: 0]
  ------------------
  288|      0|    free(shape);
  289|      0|    free(chunkshape);
  290|      0|    free(blockshape);
  291|      0|    BLOSC_TRACE_ERROR("Invalid cell shape (meta) %d", (int) meta);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  292|      0|    return BLOSC2_ERROR_FAILURE;
  293|      0|  }
  294|       |
  295|      0|  int8_t cellshape[8];
  296|      0|  int64_t cell_size = 1;  // 64-bit: prod(cellshape) can reach 127^ndim, which overflows int
  297|      0|  for (int i = 0; i < 8; ++i) {
  ------------------
  |  Branch (297:19): [True: 0, False: 0]
  ------------------
  298|      0|    if (i < ndim) {
  ------------------
  |  Branch (298:9): [True: 0, False: 0]
  ------------------
  299|      0|      cellshape[i] = (int8_t) meta;
  300|      0|      if (cellshape[i] > blockshape[i]) {
  ------------------
  |  Branch (300:11): [True: 0, False: 0]
  ------------------
  301|      0|        cellshape[i] = (int8_t) blockshape[i];
  302|      0|      }
  303|      0|      cell_size *= cellshape[i];
  304|      0|    } else {
  305|      0|      cellshape[i] = 1;
  306|      0|    }
  307|      0|  }
  308|       |
  309|      0|  int8_t typesize = (int8_t) schunk->typesize;
  310|      0|  uint8_t *ip = (uint8_t *) input;
  311|      0|  uint8_t *ip_limit = ip + length;
  312|      0|  uint8_t *op = (uint8_t *) output;
  313|      0|  if (typesize <= 0) {
  ------------------
  |  Branch (313:7): [True: 0, False: 0]
  ------------------
  314|      0|    free(shape);
  315|      0|    free(chunkshape);
  316|      0|    free(blockshape);
  317|      0|    BLOSC_TRACE_ERROR("Invalid typesize %d", typesize);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|      0|    return BLOSC2_ERROR_FAILURE;
  319|      0|  }
  320|       |  // The block geometry (blockshape) comes from the attacker-controlled "b2nd"
  321|       |  // metalayer and is NOT validated by b2nd_deserialize_meta().  Compute the
  322|       |  // block size in 64-bit and reject non-positive dimensions.  Otherwise a
  323|       |  // crafted blockshape whose 32-bit product wraps back onto `length` would pass
  324|       |  // the check below, while the scatter-write index arithmetic further down uses
  325|       |  // the true (huge) dimensions, writing past the `length`-sized output buffer
  326|       |  // (heap overflow).  Bailing as soon as the running product exceeds `length`
  327|       |  // also keeps the 64-bit multiply from overflowing.
  328|      0|  int64_t blocksize = (int64_t) typesize;
  329|      0|  for (int i = 0; i < ndim; i++) {
  ------------------
  |  Branch (329:19): [True: 0, False: 0]
  ------------------
  330|      0|    if (blockshape[i] <= 0) {
  ------------------
  |  Branch (330:9): [True: 0, False: 0]
  ------------------
  331|      0|      free(shape);
  332|      0|      free(chunkshape);
  333|      0|      free(blockshape);
  334|      0|      BLOSC_TRACE_ERROR("Invalid blockshape[%d] = %d", i, blockshape[i]);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  335|      0|      return BLOSC2_ERROR_FAILURE;
  336|      0|    }
  337|      0|    blocksize *= blockshape[i];
  338|      0|    if (blocksize > (int64_t) length) {
  ------------------
  |  Branch (338:9): [True: 0, False: 0]
  ------------------
  339|      0|      free(shape);
  340|      0|      free(chunkshape);
  341|      0|      free(blockshape);
  342|      0|      BLOSC_TRACE_ERROR("blockshape too large for block of %d bytes", length);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  343|      0|      return BLOSC2_ERROR_FAILURE;
  344|      0|    }
  345|      0|  }
  346|       |
  347|      0|  if ((int64_t) length != blocksize) {
  ------------------
  |  Branch (347:7): [True: 0, False: 0]
  ------------------
  348|      0|    free(shape);
  349|      0|    free(chunkshape);
  350|      0|    free(blockshape);
  351|      0|    BLOSC_TRACE_ERROR("Length not equal to blocksize");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  352|      0|    return BLOSC2_ERROR_FAILURE;
  353|      0|  }
  354|       |
  355|      0|  if (length < cell_size * typesize) {
  ------------------
  |  Branch (355:7): [True: 0, False: 0]
  ------------------
  356|      0|    free(shape);
  357|      0|    free(chunkshape);
  358|      0|    free(blockshape);
  359|      0|    BLOSC_TRACE_ERROR("input and output buffer cannot be smaller than cell size");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  360|      0|    return BLOSC2_ERROR_FAILURE;
  361|      0|  }
  362|       |
  363|      0|  int64_t i_shape[NDMEAN_MAX_DIM];
  364|      0|  for (int i = 0; i < ndim; ++i) {
  ------------------
  |  Branch (364:19): [True: 0, False: 0]
  ------------------
  365|      0|    i_shape[i] = (blockshape[i] + cellshape[i] - 1) / cellshape[i];
  366|      0|  }
  367|       |
  368|      0|  int64_t ncells = 1;
  369|      0|  for (int i = 0; i < ndim; ++i) {
  ------------------
  |  Branch (369:19): [True: 0, False: 0]
  ------------------
  370|      0|    ncells *= i_shape[i];
  371|      0|  }
  372|       |
  373|       |  /* main loop */
  374|      0|  int64_t pad_shape[NDMEAN_MAX_DIM] = {0};
  375|      0|  int64_t ii[NDMEAN_MAX_DIM];
  376|      0|  int32_t ind = 0;
  377|      0|  for (int cell_ind = 0; cell_ind < ncells; cell_ind++) {      // for each cell
  ------------------
  |  Branch (377:26): [True: 0, False: 0]
  ------------------
  378|       |
  379|      0|    if (ip > ip_limit) {
  ------------------
  |  Branch (379:9): [True: 0, False: 0]
  ------------------
  380|      0|      free(shape);
  381|      0|      free(chunkshape);
  382|      0|      free(blockshape);
  383|      0|      BLOSC_TRACE_ERROR("Exceeding input length!");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  384|      0|      return BLOSC2_ERROR_FAILURE;
  385|      0|    }
  386|      0|    blosc2_unidim_to_multidim(ndim, i_shape, cell_ind, ii);
  387|      0|    uint32_t orig = 0;
  388|      0|    int64_t nd_aux = (int64_t) (cellshape[0]);
  389|      0|    for (int i = ndim - 1; i >= 0; i--) {
  ------------------
  |  Branch (389:28): [True: 0, False: 0]
  ------------------
  390|      0|      orig += ii[i] * nd_aux;
  391|      0|      nd_aux *= blockshape[i];
  392|      0|    }
  393|       |
  394|      0|    for (int dim_ind = 0; dim_ind < ndim; dim_ind++) {
  ------------------
  |  Branch (394:27): [True: 0, False: 0]
  ------------------
  395|      0|      if ((blockshape[dim_ind] % cellshape[dim_ind] != 0) && (ii[dim_ind] == i_shape[dim_ind] - 1)) {
  ------------------
  |  Branch (395:11): [True: 0, False: 0]
  |  Branch (395:62): [True: 0, False: 0]
  ------------------
  396|      0|        pad_shape[dim_ind] = blockshape[dim_ind] % cellshape[dim_ind];
  397|      0|      } else {
  398|      0|        pad_shape[dim_ind] = (int64_t) cellshape[dim_ind];
  399|      0|      }
  400|      0|    }
  401|       |
  402|      0|    int64_t ncopies = 1;
  403|      0|    for (int i = 0; i < ndim - 1; ++i) {
  ------------------
  |  Branch (403:21): [True: 0, False: 0]
  ------------------
  404|      0|      ncopies *= pad_shape[i];
  405|      0|    }
  406|      0|    int64_t kk[NDMEAN_MAX_DIM];
  407|      0|    for (int copy_ind = 0; copy_ind < ncopies; ++copy_ind) {
  ------------------
  |  Branch (407:28): [True: 0, False: 0]
  ------------------
  408|      0|      blosc2_unidim_to_multidim((int8_t) (ndim - 1), pad_shape, copy_ind, kk);
  409|      0|      nd_aux = blockshape[ndim - 1];
  410|      0|      ind = (int32_t) orig;
  411|      0|      for (int i = ndim - 2; i >= 0; i--) {
  ------------------
  |  Branch (411:30): [True: 0, False: 0]
  ------------------
  412|      0|        ind += (int32_t) (kk[i] * nd_aux);
  413|      0|        nd_aux *= blockshape[i];
  414|      0|      }
  415|      0|      memcpy(&op[ind * typesize], ip, pad_shape[ndim - 1] * typesize);
  416|      0|      ip += pad_shape[ndim - 1] * typesize;
  417|      0|    }
  418|      0|  }
  419|      0|  ind += (int32_t) pad_shape[ndim - 1];
  420|       |
  421|      0|  free(shape);
  422|      0|  free(chunkshape);
  423|      0|  free(blockshape);
  424|       |
  425|      0|  if (ind != (int32_t) (blocksize / typesize)) {
  ------------------
  |  Branch (425:7): [True: 0, False: 0]
  ------------------
  426|      0|    BLOSC_TRACE_ERROR("Output size is not compatible with embedded blockshape ind %d %lld \n",
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  427|      0|                      ind, (long long) (blocksize / typesize));
  428|      0|    return BLOSC2_ERROR_FAILURE;
  429|      0|  }
  430|       |
  431|      0|  return BLOSC2_ERROR_SUCCESS;
  432|      0|}

register_tuners:
   13|  12.2k|void register_tuners(void) {
   14|       |
   15|  12.2k|  blosc2_tuner btune;
   16|  12.2k|  btune.id = BLOSC_BTUNE;
   17|  12.2k|  btune.name = "btune";
   18|  12.2k|  btune.init = NULL;
   19|  12.2k|  btune.next_cparams = NULL;
   20|  12.2k|  btune.next_blocksize = NULL;
   21|  12.2k|  btune.update = NULL;
   22|  12.2k|  btune.free = NULL;
   23|       |
   24|  12.2k|  register_tuner_private(&btune);
   25|  12.2k|}

LLVMFuzzerTestOneInput:
   11|  12.2k|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   12|  12.2k|  int32_t i = 0, dsize = 0;
   13|  12.2k|  int32_t nchunk = 0;
   14|       |
   15|  12.2k|  blosc2_init();
   16|  12.2k|  blosc2_set_nthreads(1);
   17|       |
   18|       |  /* Create a super-chunk backed by an in-memory frame */
   19|  12.2k|  blosc2_schunk* schunk = blosc2_schunk_from_buffer((uint8_t *) data, (int64_t)size, false);
   20|  12.2k|  if (schunk == NULL) {
  ------------------
  |  Branch (20:7): [True: 11.5k, False: 654]
  ------------------
   21|  11.5k|    blosc2_destroy();
   22|  11.5k|    return 0;
   23|  11.5k|  }
   24|       |  /* Don't allow address sanitizer to allocate more than INT32_MAX */
   25|    654|  if (schunk->nbytes >= INT32_MAX) {
  ------------------
  |  Branch (25:7): [True: 19, False: 635]
  ------------------
   26|     19|    blosc2_schunk_free(schunk);
   27|     19|    blosc2_destroy();
   28|     19|    return 0;
   29|     19|  }
   30|       |  /* Decompress data */
   31|    635|  uint8_t *uncompressed_data = (uint8_t *)malloc((size_t)schunk->nbytes+1);
   32|    635|  if (uncompressed_data != NULL) {
  ------------------
  |  Branch (32:7): [True: 603, False: 32]
  ------------------
   33|  45.6k|    for (i = 0, nchunk = 0; nchunk < schunk->nchunks-1; nchunk++) {
  ------------------
  |  Branch (33:29): [True: 45.5k, False: 78]
  ------------------
   34|  45.5k|      dsize = blosc2_schunk_decompress_chunk(schunk, nchunk, uncompressed_data + i, schunk->chunksize);
   35|  45.5k|      if (dsize < 0) {
  ------------------
  |  Branch (35:11): [True: 525, False: 45.0k]
  ------------------
   36|    525|        printf("Decompression error.  Error code: %d\n", dsize);
   37|    525|        break;
   38|    525|      }
   39|  45.0k|      i += dsize;
   40|  45.0k|    }
   41|       |
   42|    603|    free(uncompressed_data);
   43|    603|  }
   44|       |
   45|    635|  blosc2_schunk_free(schunk);
   46|    635|  blosc2_destroy();
   47|    635|  return 0;
   48|    654|}

