LZ4_decompress_safe:
 2570|    611|{
 2571|    611|    return LZ4_decompress_generic(source, dest, compressedSize, maxDecompressedSize,
 2572|    611|                                  decode_full_block, noDict,
 2573|       |                                  (BYTE*)dest, NULL, 0);
 2574|    611|}
LZ4_decompress_safe_forceExtDict:
 2644|    436|{
 2645|    436|    DEBUGLOG(5, "LZ4_decompress_safe_forceExtDict");
  ------------------
  |  |  289|    436|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2646|    436|    return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize,
 2647|    436|                                  decode_full_block, usingExtDict,
 2648|    436|                                  (BYTE*)dest, (const BYTE*)dictStart, dictSize);
 2649|    436|}
LZ4_decompress_safe_usingDict:
 2843|    436|{
 2844|    436|    if (dictSize < 0) return -1;
  ------------------
  |  Branch (2844:9): [True: 0, False: 436]
  ------------------
 2845|    436|    if (dictSize==0)
  ------------------
  |  Branch (2845:9): [True: 0, False: 436]
  ------------------
 2846|      0|        return LZ4_decompress_safe(source, dest, compressedSize, maxOutputSize);
 2847|    436|    if (dictStart+dictSize == dest) {
  ------------------
  |  Branch (2847:9): [True: 0, False: 436]
  ------------------
 2848|      0|        if (dictSize >= 64 KB - 1) {
  ------------------
  |  |  251|      0|#define KB *(1 <<10)
  ------------------
  |  Branch (2848:13): [True: 0, False: 0]
  ------------------
 2849|      0|            return LZ4_decompress_safe_withPrefix64k(source, dest, compressedSize, maxOutputSize);
 2850|      0|        }
 2851|      0|        assert(dictSize >= 0);
  ------------------
  |  |  273|      0|#    define assert(condition) ((void)0)
  ------------------
 2852|      0|        return LZ4_decompress_safe_withSmallPrefix(source, dest, compressedSize, maxOutputSize, (size_t)dictSize);
 2853|      0|    }
 2854|    436|    assert(dictSize >= 0);
  ------------------
  |  |  273|    436|#    define assert(condition) ((void)0)
  ------------------
 2855|    436|    return LZ4_decompress_safe_forceExtDict(source, dest, compressedSize, maxOutputSize, dictStart, (size_t)dictSize);
 2856|    436|}
lz4.c:LZ4_isLittleEndian:
  364|   119k|{
  365|   119k|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental */
  366|   119k|    return one.c[0];
  367|   119k|}
lz4.c:LZ4_wildCopy8:
  466|  5.91k|{
  467|  5.91k|    BYTE* d = (BYTE*)dstPtr;
  468|  5.91k|    const BYTE* s = (const BYTE*)srcPtr;
  469|  5.91k|    BYTE* const e = (BYTE*)dstEnd;
  470|       |
  471|  29.7k|    do { LZ4_memcpy(d,s,8); d+=8; s+=8; } while (d<e);
  ------------------
  |  |  349|  29.7k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (471:50): [True: 23.7k, False: 5.91k]
  ------------------
  472|  5.91k|}
lz4.c:LZ4_read16:
  393|   119k|static U16 LZ4_read16(const void* ptr) { return ((const LZ4_unalign16*)ptr)->u16; }
lz4.c:LZ4_write32:
  398|  43.4k|static void LZ4_write32(void* memPtr, U32 value) { ((LZ4_unalign32*)memPtr)->u32 = value; }
lz4.c:LZ4_decompress_generic:
 2225|  1.04k|{
 2226|  1.04k|    if ((src == NULL) || (outputSize < 0)) { return -1; }
  ------------------
  |  Branch (2226:9): [True: 0, False: 1.04k]
  |  Branch (2226:26): [True: 0, False: 1.04k]
  ------------------
 2227|       |
 2228|  1.04k|    {   const BYTE* ip = (const BYTE*) src;
 2229|  1.04k|        const BYTE* const iend = ip + srcSize;
 2230|       |
 2231|  1.04k|        BYTE* op = (BYTE*) dst;
 2232|  1.04k|        BYTE* const oend = op + outputSize;
 2233|       |
 2234|  1.04k|        const BYTE* const dictEnd = (dictStart == NULL) ? NULL : dictStart + dictSize;
  ------------------
  |  Branch (2234:37): [True: 611, False: 436]
  ------------------
 2235|       |
 2236|       |        /* withPrefix64k : offset <= 65535 can't reach beyond the 64 KB prefix */
 2237|  1.04k|        const int checkOffset = (dict != withPrefix64k) && (dictSize < (int)(64 KB));
  ------------------
  |  |  251|  1.04k|#define KB *(1 <<10)
  ------------------
  |  Branch (2237:33): [True: 1.04k, False: 0]
  |  Branch (2237:60): [True: 1.04k, False: 0]
  ------------------
 2238|       |
 2239|       |
 2240|       |        /* Set up the "end" pointers for the shortcut. */
 2241|  1.04k|        const BYTE* const shortiend = iend - 14 /*maxLL*/ - 2 /*offset*/;
 2242|  1.04k|        const BYTE* const shortoend = oend - 14 /*maxLL*/ - 18 /*maxML*/;
 2243|       |
 2244|       |        /* shared by both loops : the fast loop can hand over a decoded match (safe_match_copy) */
 2245|  1.04k|        const BYTE* match;
 2246|  1.04k|        size_t offset;
 2247|  1.04k|        size_t ml;   /* match length */
 2248|       |
 2249|       |
 2250|  1.04k|        DEBUGLOG(5, "LZ4_decompress_generic (srcSize:%i, dstSize:%i)", srcSize, outputSize);
  ------------------
  |  |  289|  1.04k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2251|       |
 2252|       |        /* Special cases */
 2253|  1.04k|        assert(lowPrefix <= op);
  ------------------
  |  |  273|  1.04k|#    define assert(condition) ((void)0)
  ------------------
 2254|  1.04k|        if (unlikely(outputSize==0)) {
  ------------------
  |  |  180|  1.04k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.04k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 1.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2255|       |            /* Empty output buffer */
 2256|      0|            if (partialDecoding) return 0;
  ------------------
  |  Branch (2256:17): [True: 0, False: 0]
  ------------------
 2257|      0|            if ((srcSize==1) && (*ip==0)) return 0;   /* empty block */
  ------------------
  |  Branch (2257:17): [True: 0, False: 0]
  |  Branch (2257:33): [True: 0, False: 0]
  ------------------
 2258|      0|            return (srcSize > 1) ? -2 : -1;   /* -2 : output buffer too small */
  ------------------
  |  Branch (2258:20): [True: 0, False: 0]
  ------------------
 2259|      0|        }
 2260|  1.04k|        if (unlikely(srcSize<=0)) { return -1; }
  ------------------
  |  |  180|  1.04k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.04k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 1.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2261|       |
 2262|       |    /* LZ4_FAST_DEC_LOOP:
 2263|       |     * designed for modern OoO performance cpus,
 2264|       |     * where copying reliably 32-bytes is preferable to an unpredictable branch.
 2265|       |     * note : fast loop may show a regression for some client arm chips. */
 2266|  1.04k|#if LZ4_FAST_DEC_LOOP
 2267|  1.04k|        if ((oend - op) < FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|  1.04k|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2267:13): [True: 295, False: 752]
  ------------------
 2268|    295|            DEBUGLOG(6, "move to safe decode loop");
  ------------------
  |  |  289|    295|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2269|    295|            goto safe_decode;
 2270|    295|        }
 2271|       |        /* Ring buffer restarting at its beginning : the oldest referenced history (max distance behind op)
 2272|       |         * lies in the external dictionary, ahead of op, always at the same distance.
 2273|       |         * Rings sized with the former LZ4_DECODER_RING_BUFFER_SIZE() (margin 14, up to v1.10.0)
 2274|       |         * still work, but leave as little as 16 bytes :
 2275|       |         * the fast loop's wide copies could overwrite it, the safe loop's can't. */
 2276|    752|        if ( (dict==usingExtDict)
  ------------------
  |  Branch (2276:14): [True: 306, False: 446]
  ------------------
 2277|    306|          && ((uptrval)dictEnd - (uptrval)lowPrefix - LZ4_DISTANCE_ABSOLUTE_MAX < FASTLOOP_SAFE_DISTANCE) ) {
  ------------------
  |  |  255|    306|#define LZ4_DISTANCE_ABSOLUTE_MAX 65535
  ------------------
                        && ((uptrval)dictEnd - (uptrval)lowPrefix - LZ4_DISTANCE_ABSOLUTE_MAX < FASTLOOP_SAFE_DISTANCE) ) {
  ------------------
  |  |  248|    306|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2277:14): [True: 0, False: 306]
  ------------------
 2278|      0|            DEBUGLOG(6, "history just ahead : move to safe decode loop");
  ------------------
  |  |  289|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2279|      0|            goto safe_decode;
 2280|      0|        }
 2281|       |
 2282|       |        /* Fast loop : decode sequences as long as output < oend-FASTLOOP_SAFE_DISTANCE,
 2283|       |         * and input is not too close to iend.
 2284|       |         * It hands over to the safe loop either at a sequence start (break),
 2285|       |         * or once a match is fully decoded (goto safe_match_copy). */
 2286|    752|        DEBUGLOG(6, "using fast decode loop");
  ------------------
  |  |  289|    752|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2287|   117k|        while (1) {
  ------------------
  |  Branch (2287:16): [True: 117k, Folded]
  ------------------
 2288|   117k|            unsigned token;
 2289|   117k|            size_t ll;   /* literal length */
 2290|   117k|            BYTE* cpy;
 2291|       |            /* Main fastloop assertion: We can always wildcopy FASTLOOP_SAFE_DISTANCE */
 2292|   117k|            assert(oend - op >= FASTLOOP_SAFE_DISTANCE);
  ------------------
  |  |  273|   117k|#    define assert(condition) ((void)0)
  ------------------
 2293|   117k|            assert(ip < iend);
  ------------------
  |  |  273|   117k|#    define assert(condition) ((void)0)
  ------------------
 2294|   117k|            token = *ip++;
 2295|   117k|            ll = token >> ML_BITS;
  ------------------
  |  |  260|   117k|#define ML_BITS  4
  ------------------
 2296|   117k|            DEBUGLOG(7, "blockPos%6u: litLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)ll);
  ------------------
  |  |  289|   117k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2297|       |
 2298|       |            /* too close to input end : the safe loop restarts this sequence */
 2299|   117k|            if (ip > iend-(16 + 1/*max lit + offset + nextToken*/)) { ip--; break; }
  ------------------
  |  Branch (2299:17): [True: 14, False: 117k]
  ------------------
 2300|       |
 2301|       |            /* decode literal length */
 2302|   117k|            if (ll == RUN_MASK) {
  ------------------
  |  |  263|   117k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|   117k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|   117k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2302:17): [True: 9.07k, False: 108k]
  ------------------
 2303|       |                /* literal length >= RUN_MASK means >= RUN_MASK literal bytes follow the extension bytes,
 2304|       |                 * so extension bytes cannot reach the last RUN_MASK bytes of input */
 2305|  9.07k|                const BYTE* const tokenPos = ip-1;
 2306|  9.07k|                size_t const addl = read_variable_length(&ip, iend - RUN_MASK);
  ------------------
  |  |  263|  9.07k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|  9.07k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|  9.07k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2307|  9.07k|                if (addl == rvl_error) {
  ------------------
  |  Branch (2307:21): [True: 6, False: 9.06k]
  ------------------
 2308|      6|                    DEBUGLOG(6, "error reading long literal length");
  ------------------
  |  |  289|      6|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2309|      6|                    goto _output_error;
 2310|      6|                }
 2311|  9.06k|                ll += addl;
 2312|  9.06k|                if (unlikely((uptrval)(op)+ll<(uptrval)(op))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  9.06k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  9.06k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 9.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2313|  9.06k|                if (unlikely((uptrval)(ip)+ll<(uptrval)(ip))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  9.06k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  9.06k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 9.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2314|       |
 2315|       |                /* copy literals, unless too close to the end for a wild copy :
 2316|       |                 * nothing is written yet, so the safe loop can restart this sequence */
 2317|  9.06k|                cpy = op+ll;
 2318|  9.06k|                LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH);
  ------------------
  |  |  277|  9.06k|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
 2319|  9.06k|              #if LZ4_WILDCOPY64
 2320|  9.06k|                if ((cpy>oend-64) || (ip+ll>iend-64)) { ip = tokenPos; break; }
  ------------------
  |  Branch (2320:21): [True: 168, False: 8.90k]
  |  Branch (2320:38): [True: 55, False: 8.84k]
  ------------------
 2321|  8.84k|                LZ4_wildCopy64(op, ip, cpy);
 2322|       |              #else
 2323|       |                if ((cpy>oend-32) || (ip+ll>iend-32)) { ip = tokenPos; break; }
 2324|       |                LZ4_wildCopy32(op, ip, cpy);
 2325|       |              #endif
 2326|  8.84k|                ip += ll; op = cpy;
 2327|   108k|            } else {
 2328|   108k|                DEBUGLOG(7, "copy %u bytes in a 16-bytes stripe", (unsigned)ll);
  ------------------
  |  |  289|   108k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2329|       |                /* Literals can only be <= 14, but hope compilers optimize better when copy by a register size */
 2330|   108k|                LZ4_memcpy(op, ip, 16);
  ------------------
  |  |  349|   108k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2331|   108k|                ip += ll; op += ll;
 2332|   108k|            }
 2333|       |
 2334|       |            /* get offset */
 2335|   117k|            offset = LZ4_readLE16(ip); ip+=2;
 2336|   117k|            DEBUGLOG(6, "blockPos%6u: offset = %u", (unsigned)(op-(BYTE*)dst), (unsigned)offset);
  ------------------
  |  |  289|   117k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2337|   117k|            match = op - offset;
 2338|   117k|            assert(match <= op);  /* overflow check */
  ------------------
  |  |  273|   117k|#    define assert(condition) ((void)0)
  ------------------
 2339|       |
 2340|       |            /* get matchlength */
 2341|   117k|            ml = token & ML_MASK;
  ------------------
  |  |  261|   117k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|   117k|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2342|   117k|            DEBUGLOG(7, "  match length token = %u (len==%u)", (unsigned)ml, (unsigned)ml+MINMATCH);
  ------------------
  |  |  289|   117k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2343|       |
 2344|   117k|            if (ml == ML_MASK) {
  ------------------
  |  |  261|   117k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|   117k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2344:17): [True: 10.5k, False: 106k]
  ------------------
 2345|       |                /* after match length extension bytes, at least 1 token + LASTLITERALS literals must remain */
 2346|  10.5k|                size_t const addl = read_variable_length(&ip, iend - (1 + LASTLITERALS));
  ------------------
  |  |  245|  10.5k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2347|  10.5k|                if (addl == rvl_error) {
  ------------------
  |  Branch (2347:21): [True: 10, False: 10.5k]
  ------------------
 2348|     10|                    DEBUGLOG(5, "error reading long match length");
  ------------------
  |  |  289|     10|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2349|     10|                    goto _output_error;
 2350|     10|                }
 2351|  10.5k|                ml += addl;
 2352|  10.5k|                DEBUGLOG(7, "  long match length == %u", (unsigned)ml + MINMATCH);
  ------------------
  |  |  289|  10.5k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2353|  10.5k|                if (unlikely((uptrval)(op)+ml<(uptrval)op)) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  10.5k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  10.5k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 10.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2354|  10.5k|            }
 2355|   117k|            ml += MINMATCH;
  ------------------
  |  |  242|   117k|#define MINMATCH 4
  ------------------
 2356|       |
 2357|   117k|            if (op + ml >= oend - FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|   117k|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2357:17): [True: 409, False: 116k]
  ------------------
 2358|    409|                DEBUGLOG(7, "moving to safe_match_copy (ml==%u)", (unsigned)ml);
  ------------------
  |  |  289|    409|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2359|    409|                goto safe_match_copy;
 2360|    409|            }
 2361|       |
 2362|       |            /* match length from token only (<= 18), no overlap, within prefix : copy 18 bytes */
 2363|   116k|            if ( ((token & ML_MASK) != ML_MASK) && (offset >= 8)
  ------------------
  |  |  261|   116k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|   116k|#define ML_BITS  4
  |  |  ------------------
  ------------------
                          if ( ((token & ML_MASK) != ML_MASK) && (offset >= 8)
  ------------------
  |  |  261|   116k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|   116k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2363:18): [True: 106k, False: 10.4k]
  |  Branch (2363:52): [True: 61.5k, False: 44.7k]
  ------------------
 2364|  61.5k|              && ((dict == withPrefix64k) || (match >= lowPrefix)) ) {
  ------------------
  |  Branch (2364:19): [True: 0, False: 61.5k]
  |  Branch (2364:46): [True: 61.2k, False: 337]
  ------------------
 2365|  61.2k|                assert(match >= lowPrefix);
  ------------------
  |  |  273|  61.2k|#    define assert(condition) ((void)0)
  ------------------
 2366|  61.2k|                assert(match <= op);
  ------------------
  |  |  273|  61.2k|#    define assert(condition) ((void)0)
  ------------------
 2367|  61.2k|                assert(op + 18 <= oend);
  ------------------
  |  |  273|  61.2k|#    define assert(condition) ((void)0)
  ------------------
 2368|  61.2k|                LZ4_memcpy(op, match, 8);
  ------------------
  |  |  349|  61.2k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2369|  61.2k|                LZ4_memcpy(op+8, match+8, 8);
  ------------------
  |  |  349|  61.2k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2370|  61.2k|                LZ4_memcpy(op+16, match+16, 2);
  ------------------
  |  |  349|  61.2k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2371|  61.2k|                op += ml;
 2372|  61.2k|                continue;
 2373|  61.2k|            }
 2374|       |
 2375|       |            /* match ends far from oend : no end-of-block condition to check */
 2376|  55.4k|            assert(op + ml < oend - FASTLOOP_SAFE_DISTANCE);
  ------------------
  |  |  273|  55.4k|#    define assert(condition) ((void)0)
  ------------------
 2377|       |
 2378|  55.4k|            if ( checkOffset && (unlikely(match + dictSize < lowPrefix)) ) {
  ------------------
  |  |  180|  55.4k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  55.4k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  ------------------
  ------------------
  |  Branch (2378:18): [True: 55.4k, False: 0]
  |  Branch (2378:33): [True: 90, False: 55.3k]
  ------------------
 2379|     90|                DEBUGLOG(5, "Error : pos=%zi, offset=%zi => outside buffers", op-lowPrefix, op-match);
  ------------------
  |  |  289|     90|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2380|     90|                goto _offset_error;
 2381|     90|            }
 2382|       |            /* match starting within external dictionary */
 2383|  55.3k|            if ((dict==usingExtDict) && (match < lowPrefix)) {
  ------------------
  |  Branch (2383:17): [True: 3.11k, False: 52.2k]
  |  Branch (2383:41): [True: 304, False: 2.81k]
  ------------------
 2384|    304|                assert(dictEnd != NULL);
  ------------------
  |  |  273|    304|#    define assert(condition) ((void)0)
  ------------------
 2385|    304|                op = LZ4_copyExtDictMatch(op, match, ml, lowPrefix, dictEnd);
 2386|    304|                continue;
 2387|    304|            }
 2388|       |
 2389|       |            /* copy match within block */
 2390|  55.0k|            cpy = op + ml;
 2391|       |
 2392|  55.0k|            assert((op <= oend) && (oend-op >= 64));
  ------------------
  |  |  273|  55.0k|#    define assert(condition) ((void)0)
  ------------------
 2393|  55.0k|            if (unlikely(offset<16)) {
  ------------------
  |  |  180|  55.0k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  55.0k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 52.4k, False: 2.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2394|  52.4k|                LZ4_memcpy_using_offset(op, match, cpy, offset);
 2395|  52.4k|    #if LZ4_WILDCOPY64
 2396|  52.4k|            } else if (offset >= 64) {
  ------------------
  |  Branch (2396:24): [True: 1.96k, False: 665]
  ------------------
 2397|  1.96k|                LZ4_wildCopy64(op, match, cpy);
 2398|  1.96k|    #endif
 2399|  1.96k|            } else {
 2400|    665|                LZ4_wildCopy32(op, match, cpy);
 2401|    665|            }
 2402|       |
 2403|  55.0k|            op = cpy;   /* wildcopy correction */
 2404|  55.0k|        }
 2405|    532|    safe_decode:
 2406|    532|#endif
 2407|       |
 2408|       |        /* Safe loop : decode remaining sequences, without writing beyond oend nor reading beyond iend.
 2409|       |         * With LZ4_FAST_DEC_LOOP, that's the end of the block (or a block too small for the fast loop),
 2410|       |         * entered at a sequence start, or at safe_match_copy with a decoded match.
 2411|       |         * Without it, that's the whole block. */
 2412|    532|        DEBUGLOG(6, "using safe decode loop");
  ------------------
  |  |  289|    532|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2413|  2.66k|        while (1) {
  ------------------
  |  Branch (2413:16): [True: 2.66k, Folded]
  ------------------
 2414|  2.66k|            unsigned token;
 2415|  2.66k|            size_t ll;   /* literal length */
 2416|  2.66k|            BYTE* cpy;
 2417|  2.66k|            assert(ip < iend);
  ------------------
  |  |  273|  2.66k|#    define assert(condition) ((void)0)
  ------------------
 2418|  2.66k|            token = *ip++;
 2419|  2.66k|            ll = token >> ML_BITS;
  ------------------
  |  |  260|  2.66k|#define ML_BITS  4
  ------------------
 2420|  2.66k|            DEBUGLOG(7, "blockPos%6u: litLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)ll);
  ------------------
  |  |  289|  2.66k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2421|       |
 2422|       |            /* A two-stage shortcut for the most common case:
 2423|       |             * 1) If the literal length is 0..14, and there is enough space,
 2424|       |             * enter the shortcut and copy 16 bytes on behalf of the literals.
 2425|       |             * 2) Further if the match length is 4..18, copy 18 bytes in a similar
 2426|       |             * manner; but we ensure that there's enough space in the output for
 2427|       |             * those 18 bytes earlier, upon entering the shortcut (in other words,
 2428|       |             * there is a combined check for both stages).
 2429|       |             */
 2430|  2.66k|            if ( (ll != RUN_MASK)
  ------------------
  |  |  263|  2.66k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|  2.66k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|  2.66k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2430:18): [True: 2.11k, False: 549]
  ------------------
 2431|       |                /* strictly "less than" on input, to re-enter the loop with at least one byte */
 2432|  2.11k|              && likely((ip < shortiend) & (op <= shortoend)) ) {
  ------------------
  |  |  177|  2.11k|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|  2.11k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 1.11k, False: 1.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2433|       |                /* Copy the literals */
 2434|  1.11k|                LZ4_memcpy(op, ip, 16);
  ------------------
  |  |  349|  1.11k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2435|  1.11k|                op += ll; ip += ll;
 2436|       |
 2437|       |                /* The second stage: prepare for match copying, decode full info.
 2438|       |                 * If it doesn't work out, the info won't be wasted. */
 2439|  1.11k|                offset = LZ4_readLE16(ip); ip += 2;
 2440|  1.11k|                match = op - offset;
 2441|  1.11k|                assert(match <= op); /* check overflow */
  ------------------
  |  |  273|  1.11k|#    define assert(condition) ((void)0)
  ------------------
 2442|  1.11k|                ml = token & ML_MASK;
  ------------------
  |  |  261|  1.11k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|  1.11k|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2443|  1.11k|                DEBUGLOG(7, "blockPos%6u: matchLength token = %u (len=%u)", (unsigned)(op-(BYTE*)dst), (unsigned)ml, (unsigned)ml + 4);
  ------------------
  |  |  289|  1.11k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2444|       |
 2445|       |                /* Do not deal with overlapping matches. */
 2446|  1.11k|                if ( (ml != ML_MASK)
  ------------------
  |  |  261|  1.11k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|  1.11k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2446:22): [True: 897, False: 216]
  ------------------
 2447|    897|                  && (offset >= 8)
  ------------------
  |  Branch (2447:22): [True: 426, False: 471]
  ------------------
 2448|    426|                  && (dict==withPrefix64k || match >= lowPrefix) ) {
  ------------------
  |  Branch (2448:23): [True: 0, False: 426]
  |  Branch (2448:46): [True: 325, False: 101]
  ------------------
 2449|       |                    /* Copy the match. */
 2450|    325|                    LZ4_memcpy(op + 0, match + 0, 8);
  ------------------
  |  |  349|    325|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2451|    325|                    LZ4_memcpy(op + 8, match + 8, 8);
  ------------------
  |  |  349|    325|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2452|    325|                    LZ4_memcpy(op +16, match +16, 2);
  ------------------
  |  |  349|    325|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2453|    325|                    op += ml + MINMATCH;
  ------------------
  |  |  242|    325|#define MINMATCH 4
  ------------------
 2454|       |                    /* Both stages worked, load the next token. */
 2455|    325|                    continue;
 2456|    325|                }
 2457|       |                /* The second stage didn't work out, but the info is ready for the match copy below. */
 2458|  1.55k|            } else {
 2459|       |                /* decode literal length */
 2460|  1.55k|                if (ll == RUN_MASK) {
  ------------------
  |  |  263|  1.55k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|  1.55k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|  1.55k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2460:21): [True: 549, False: 1.00k]
  ------------------
 2461|       |                    /* literal length >= RUN_MASK means >= RUN_MASK literal bytes follow the extension bytes,
 2462|       |                     * so extension bytes cannot reach the last RUN_MASK bytes of input */
 2463|    549|                    size_t const addl = read_variable_length(&ip, iend-RUN_MASK);
  ------------------
  |  |  263|    549|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|    549|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|    549|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2464|    549|                    if (addl == rvl_error) { goto _output_error; }
  ------------------
  |  Branch (2464:25): [True: 33, False: 516]
  ------------------
 2465|    516|                    ll += addl;
 2466|    516|                    if (unlikely((uptrval)(op)+ll<(uptrval)(op))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|    516|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    516|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 516]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2467|    516|                    if (unlikely((uptrval)(ip)+ll<(uptrval)(ip))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|    516|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    516|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 516]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2468|    516|                }
 2469|       |
 2470|       |                /* copy literals */
 2471|  1.52k|                cpy = op+ll;
 2472|  1.52k|                LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH);
  ------------------
  |  |  277|  1.52k|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
 2473|  1.52k|                if ((cpy>oend-MFLIMIT) || (ip+ll>iend-(2+1+LASTLITERALS))) {
  ------------------
  |  |  246|  1.52k|#define MFLIMIT       12   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
                              if ((cpy>oend-MFLIMIT) || (ip+ll>iend-(2+1+LASTLITERALS))) {
  ------------------
  |  |  245|  1.04k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (2473:21): [True: 474, False: 1.04k]
  |  Branch (2473:43): [True: 69, False: 977]
  ------------------
 2474|       |                    /* close to input or output end : these must be the last literals of the block,
 2475|       |                     * except with partialDecoding, which can also stop within them */
 2476|    543|                    if (partialDecoding) {
  ------------------
  |  Branch (2476:25): [True: 0, False: 543]
  ------------------
 2477|       |                        /* stop at input end, or when output is full */
 2478|      0|                        ll = MIN(ll, (size_t)(iend-ip));
  ------------------
  |  | 1997|      0|#define MIN(a,b)    ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (1997:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2479|      0|                        ll = MIN(ll, (size_t)(oend-op));
  ------------------
  |  | 1997|      0|#define MIN(a,b)    ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (1997:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2480|    543|                    } else if ((ip+ll != iend) || (cpy > oend)) {
  ------------------
  |  Branch (2480:32): [True: 295, False: 248]
  |  Branch (2480:51): [True: 3, False: 245]
  ------------------
 2481|       |                        /* last literals must end exactly at input end, within output */
 2482|    298|                        DEBUGLOG(5, "invalid last literals : they end at iend%+zi and oend%+zi", (ip+ll)-iend, cpy-oend);
  ------------------
  |  |  289|    298|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2483|    298|                        if ((ip+ll <= iend) && (cpy > oend-MFLIMIT)) goto _dst_too_small;   /* output full, input left */
  ------------------
  |  |  246|    166|#define MFLIMIT       12   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (2483:29): [True: 166, False: 132]
  |  Branch (2483:48): [True: 116, False: 50]
  ------------------
 2484|    182|                        goto _output_error;
 2485|    298|                    }
 2486|    245|                    LZ4_memmove(op, ip, ll);  /* supports overlapping memory regions, for in-place decompression scenarios */
  ------------------
  |  |  357|    245|#    define LZ4_memmove __builtin_memmove
  ------------------
 2487|    245|                    ip += ll;
 2488|    245|                    op += ll;
 2489|       |                    /* end of block, unless partialDecoding can go on : output not full, input left for a match */
 2490|    245|                    if (!partialDecoding || (op == oend) || (ip >= (iend-2))) {
  ------------------
  |  Branch (2490:25): [True: 245, False: 0]
  |  Branch (2490:45): [True: 0, False: 0]
  |  Branch (2490:61): [True: 0, False: 0]
  ------------------
 2491|    245|                        break;
 2492|    245|                    }
 2493|    977|                } else {
 2494|    977|                    LZ4_wildCopy8(op, ip, cpy);   /* can overwrite up to 8 bytes beyond cpy */
 2495|    977|                    ip += ll; op = cpy;
 2496|    977|                }
 2497|       |
 2498|       |                /* get offset */
 2499|    977|                offset = LZ4_readLE16(ip); ip+=2;
 2500|    977|                match = op - offset;
 2501|       |
 2502|       |                /* get matchlength */
 2503|    977|                ml = token & ML_MASK;
  ------------------
  |  |  261|    977|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    977|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2504|    977|                DEBUGLOG(7, "blockPos%6u: matchLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)ml);
  ------------------
  |  |  289|    977|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2505|    977|            }
 2506|       |
 2507|       |            /* literals copied, offset decoded, ml == match length token */
 2508|  1.76k|            if (ml == ML_MASK) {
  ------------------
  |  |  261|  1.76k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|  1.76k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2508:17): [True: 412, False: 1.35k]
  ------------------
 2509|       |                /* after match length extension bytes, at least 1 token + LASTLITERALS literals must remain */
 2510|    412|                size_t const addl = read_variable_length(&ip, iend - (1 + LASTLITERALS));
  ------------------
  |  |  245|    412|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2511|    412|                if (addl == rvl_error) { goto _output_error; }
  ------------------
  |  Branch (2511:21): [True: 26, False: 386]
  ------------------
 2512|    386|                ml += addl;
 2513|    386|                if (unlikely((uptrval)(op)+ml<(uptrval)op)) goto _output_error;   /* overflow detection */
  ------------------
  |  |  180|    386|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    386|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 386]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2514|    386|            }
 2515|  1.73k|            ml += MINMATCH;
  ------------------
  |  |  242|  1.73k|#define MINMATCH 4
  ------------------
 2516|       |
 2517|  1.73k|#if LZ4_FAST_DEC_LOOP
 2518|  2.14k|        safe_match_copy:
 2519|  2.14k|#endif
 2520|       |            /* literals copied, match fully decoded (ml includes MINMATCH), offset not validated yet */
 2521|  2.14k|            if ((checkOffset) && (unlikely(match + dictSize < lowPrefix))) goto _offset_error;   /* Error : offset outside buffers */
  ------------------
  |  |  180|  2.14k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  2.14k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  ------------------
  ------------------
  |  Branch (2521:17): [True: 2.14k, False: 0]
  |  Branch (2521:34): [True: 297, False: 1.85k]
  ------------------
 2522|       |
 2523|       |            /* end of block : the last LASTLITERALS bytes must be literals */
 2524|  1.85k|            assert(op <= oend);
  ------------------
  |  |  273|  1.85k|#    define assert(condition) ((void)0)
  ------------------
 2525|  1.85k|            if (unlikely(op+ml > oend-LASTLITERALS)) {
  ------------------
  |  |  180|  1.85k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.85k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 42, False: 1.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2526|     42|                if (partialDecoding) ml = MIN(ml, (size_t)(oend-op));   /* partialDecoding : may end anywhere */
  ------------------
  |  | 1997|      0|#define MIN(a,b)    ( (a) < (b) ? (a) : (b) )
  |  |  ------------------
  |  |  |  Branch (1997:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2526:21): [True: 0, False: 42]
  ------------------
 2527|     42|                else goto _dst_too_small;
 2528|     42|            }
 2529|       |
 2530|       |            /* match starting within external dictionary */
 2531|  1.80k|            if ((dict==usingExtDict) && (match < lowPrefix)) {
  ------------------
  |  Branch (2531:17): [True: 534, False: 1.27k]
  |  Branch (2531:41): [True: 95, False: 439]
  ------------------
 2532|     95|                assert(dictEnd != NULL);
  ------------------
  |  |  273|     95|#    define assert(condition) ((void)0)
  ------------------
 2533|     95|                op = LZ4_copyExtDictMatch(op, match, ml, lowPrefix, dictEnd);
 2534|     95|                continue;
 2535|     95|            }
 2536|  1.71k|            assert(match >= lowPrefix);
  ------------------
  |  |  273|  1.71k|#    define assert(condition) ((void)0)
  ------------------
 2537|       |
 2538|       |            /* close to block end : no wild copy */
 2539|  1.71k|            if (unlikely(op+ml > oend-MATCH_SAFEGUARD_DISTANCE)) {
  ------------------
  |  |  180|  1.71k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.71k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 87, False: 1.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2540|     87|                op = LZ4_copyMatchExact(op, match, ml);
 2541|     87|                if (op == oend) { break; }   /* partialDecoding : output buffer full */
  ------------------
  |  Branch (2541:21): [True: 0, False: 87]
  ------------------
 2542|     87|                continue;
 2543|     87|            }
 2544|       |
 2545|       |            /* copy match within block */
 2546|  1.62k|            cpy = op + ml;
 2547|  1.62k|            LZ4_memcpy_using_offset_base(op, match, cpy, offset);
 2548|  1.62k|            op = cpy;   /* wildcopy correction */
 2549|  1.62k|        }
 2550|       |
 2551|       |        /* end of decoding */
 2552|    245|        DEBUGLOG(5, "decoded %i bytes", (int) (((char*)op)-dst));
  ------------------
  |  |  289|    245|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2553|    245|        return (int) (((char*)op)-dst);     /* Nb of output bytes decoded */
 2554|       |
 2555|       |        /* errors : see LZ4_decompress_safe() in lz4.h */
 2556|    257|    _output_error:
 2557|    257|        return -1;
 2558|    158|    _dst_too_small:
 2559|    158|        return -2;
 2560|    387|    _offset_error:
 2561|    387|        return -3;
 2562|    532|    }
 2563|    532|}
lz4.c:read_variable_length:
 2132|  20.5k|{
 2133|  20.5k|    Rvl_t s, length = 0;
 2134|  20.5k|    assert(ipPtr != NULL);
  ------------------
  |  |  273|  20.5k|#    define assert(condition) ((void)0)
  ------------------
 2135|  20.5k|    assert(*ipPtr !=  NULL);
  ------------------
  |  |  273|  20.5k|#    define assert(condition) ((void)0)
  ------------------
 2136|  20.5k|    assert(ilimit != NULL);
  ------------------
  |  |  273|  20.5k|#    define assert(condition) ((void)0)
  ------------------
 2137|  20.5k|    if (unlikely((*ipPtr) >= ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  20.5k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  20.5k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 46, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2138|     46|        return rvl_error;
 2139|     46|    }
 2140|  20.5k|    s = **ipPtr;
 2141|  20.5k|    (*ipPtr)++;
 2142|  20.5k|    length += s;
 2143|  20.5k|    if (likely(s != 255)) return length;
  ------------------
  |  |  177|  20.5k|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|  20.5k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 19.0k, False: 1.46k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2144|  7.39k|    do {
 2145|  7.39k|        if (unlikely((*ipPtr) >= ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  7.39k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  7.39k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 29, False: 7.36k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2146|     29|            return rvl_error;
 2147|     29|        }
 2148|  7.36k|        s = **ipPtr;
 2149|  7.36k|        (*ipPtr)++;
 2150|  7.36k|        length += s;
 2151|       |        /* accumulator overflow detection (32-bit mode only) */
 2152|  7.36k|        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 (2152:13): [Folded, False: 7.36k]
  ------------------
 2153|      0|            return rvl_error;
 2154|      0|        }
 2155|  7.36k|    } while (s == 255);
  ------------------
  |  Branch (2155:14): [True: 5.93k, False: 1.43k]
  ------------------
 2156|       |
 2157|  1.43k|    return length;
 2158|  1.46k|}
lz4.c:LZ4_wildCopy64:
  537|  10.8k|{
  538|  10.8k|    BYTE* d = (BYTE*)dstPtr;
  539|  10.8k|    const BYTE* s = (const BYTE*)srcPtr;
  540|  10.8k|    BYTE* const e = (BYTE*)dstEnd;
  541|       |
  542|  27.2k|    do { LZ4_memcpy(d,s,64); d+=64; s+=64; } while (d<e);
  ------------------
  |  |  349|  27.2k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (542:53): [True: 16.4k, False: 10.8k]
  ------------------
  543|  10.8k|}
lz4.c:LZ4_readLE16:
  431|   119k|{
  432|   119k|    if (LZ4_isLittleEndian()) {
  ------------------
  |  Branch (432:9): [True: 119k, False: 0]
  ------------------
  433|   119k|        return LZ4_read16(memPtr);
  434|   119k|    } else {
  435|      0|        const BYTE* p = (const BYTE*)memPtr;
  436|      0|        return (U16)((U16)p[0] | (p[1]<<8));
  437|      0|    }
  438|   119k|}
lz4.c:LZ4_copyExtDictMatch:
 2193|    399|{
 2194|    399|    if (length <= (size_t)(lowPrefix-match)) {
  ------------------
  |  Branch (2194:9): [True: 305, False: 94]
  ------------------
 2195|       |        /* match fits entirely within external dictionary : just copy */
 2196|    305|        LZ4_memmove(op, dictEnd - (lowPrefix-match), length);
  ------------------
  |  |  357|    305|#    define LZ4_memmove __builtin_memmove
  ------------------
 2197|    305|        return op + length;
 2198|    305|    } else {
 2199|       |        /* match stretches into both external dictionary and current block */
 2200|     94|        size_t const copySize = (size_t)(lowPrefix - match);
 2201|     94|        LZ4_memcpy(op, dictEnd - copySize, copySize);
  ------------------
  |  |  349|     94|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2202|     94|        return LZ4_copyMatchExact(op + copySize, lowPrefix, length - copySize);
 2203|     94|    }
 2204|    399|}
lz4.c:LZ4_memcpy_using_offset:
  564|  52.4k|{
  565|  52.4k|    BYTE v[8];
  566|       |
  567|  52.4k|    assert(dstEnd >= dstPtr + MINMATCH);
  ------------------
  |  |  273|  52.4k|#    define assert(condition) ((void)0)
  ------------------
  568|       |
  569|  52.4k|    switch(offset) {
  570|  5.77k|    case 1:
  ------------------
  |  Branch (570:5): [True: 5.77k, False: 46.6k]
  ------------------
  571|  5.77k|        MEM_INIT(v, *srcPtr, 8);
  ------------------
  |  |  236|  5.77k|#define MEM_INIT(p,v,s)   LZ4_memset((p),(v),(s))
  |  |  ------------------
  |  |  |  |  234|  5.77k|#  define LZ4_memset(p,v,s) memset((p),(v),(s))
  |  |  ------------------
  ------------------
  572|  5.77k|        break;
  573|  1.70k|    case 2:
  ------------------
  |  Branch (573:5): [True: 1.70k, False: 50.7k]
  ------------------
  574|  1.70k|        LZ4_memcpy(v, srcPtr, 2);
  ------------------
  |  |  349|  1.70k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  575|  1.70k|        LZ4_memcpy(&v[2], srcPtr, 2);
  ------------------
  |  |  349|  1.70k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  576|       |#if defined(_MSC_VER) && (_MSC_VER <= 1937) /* MSVC 2022 ver 17.7 or earlier */
  577|       |#  pragma warning(push)
  578|       |#  pragma warning(disable : 6385) /* warning C6385: Reading invalid data from 'v'. */
  579|       |#endif
  580|  1.70k|        LZ4_memcpy(&v[4], v, 4);
  ------------------
  |  |  349|  1.70k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  581|       |#if defined(_MSC_VER) && (_MSC_VER <= 1937) /* MSVC 2022 ver 17.7 or earlier */
  582|       |#  pragma warning(pop)
  583|       |#endif
  584|  1.70k|        break;
  585|  2.00k|    case 4:
  ------------------
  |  Branch (585:5): [True: 2.00k, False: 50.4k]
  ------------------
  586|  2.00k|        LZ4_memcpy(v, srcPtr, 4);
  ------------------
  |  |  349|  2.00k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  587|  2.00k|        LZ4_memcpy(&v[4], srcPtr, 4);
  ------------------
  |  |  349|  2.00k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  588|  2.00k|        break;
  589|  42.9k|    default:
  ------------------
  |  Branch (589:5): [True: 42.9k, False: 9.47k]
  ------------------
  590|  42.9k|        LZ4_memcpy_using_offset_base(dstPtr, srcPtr, dstEnd, offset);
  591|  42.9k|        return;
  592|  52.4k|    }
  593|       |
  594|  9.47k|    LZ4_memcpy(dstPtr, v, 8);
  ------------------
  |  |  349|  9.47k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  595|  9.47k|    dstPtr += 8;
  596|  30.1k|    while (dstPtr < dstEnd) {
  ------------------
  |  Branch (596:12): [True: 20.6k, False: 9.47k]
  ------------------
  597|  20.6k|        LZ4_memcpy(dstPtr, v, 8);
  ------------------
  |  |  349|  20.6k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  598|  20.6k|        dstPtr += 8;
  599|  20.6k|    }
  600|  9.47k|}
lz4.c:LZ4_wildCopy32:
  551|    665|{
  552|    665|    BYTE* d = (BYTE*)dstPtr;
  553|    665|    const BYTE* s = (const BYTE*)srcPtr;
  554|    665|    BYTE* const e = (BYTE*)dstEnd;
  555|       |
  556|  1.02k|    do { LZ4_memcpy(d,s,16); LZ4_memcpy(d+16,s+16,16); d+=32; s+=32; } while (d<e);
  ------------------
  |  |  349|  1.02k|#    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|  1.02k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (556:79): [True: 356, False: 665]
  ------------------
  557|    665|}
lz4.c:LZ4_copyMatchExact:
 2167|    181|{
 2168|    181|    if (unlikely(match == op)) {   /* invalid offset 0 : clear the match segment, see doc/lz4_Block_format.md */
  ------------------
  |  |  180|    181|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    181|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 46, False: 135]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2169|     46|        MEM_INIT(op, 0, length);
  ------------------
  |  |  236|     46|#define MEM_INIT(p,v,s)   LZ4_memset((p),(v),(s))
  |  |  ------------------
  |  |  |  |  234|     46|#  define LZ4_memset(p,v,s) memset((p),(v),(s))
  |  |  ------------------
  ------------------
 2170|     46|        return op + length;
 2171|     46|    }
 2172|       |    /* bytes from match to op repeat with period (op-match) :
 2173|       |     * copy all of them, so the distance doubles at each round.
 2174|       |     * Beyond 2 KB, keep the distance : larger copies of just written data are slower */
 2175|    292|    while (length > (size_t)(op - match)) {
  ------------------
  |  Branch (2175:12): [True: 157, False: 135]
  ------------------
 2176|    157|        size_t const available = (size_t)(op - match);
 2177|    157|        LZ4_memcpy(op, match, available);
  ------------------
  |  |  349|    157|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2178|    157|        op += available;
 2179|    157|        length -= available;
 2180|    157|        if (available >= 2048) match += available;
  ------------------
  |  Branch (2180:13): [True: 1, False: 156]
  ------------------
 2181|    157|    }
 2182|    135|    LZ4_memcpy(op, match, length);
  ------------------
  |  |  349|    135|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2183|    135|    return op + length;
 2184|    181|}
lz4.c:LZ4_memcpy_using_offset_base:
  497|  44.5k|{
  498|  44.5k|    assert(srcPtr + offset == dstPtr);
  ------------------
  |  |  273|  44.5k|#    define assert(condition) ((void)0)
  ------------------
  499|  44.5k|    if (unlikely(offset < 8)) {
  ------------------
  |  |  180|  44.5k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  44.5k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 43.4k, False: 1.16k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  500|  43.4k|        LZ4_write32(dstPtr, 0);   /* silence an msan warning when offset==0 */
  501|  43.4k|        dstPtr[0] = srcPtr[0];
  502|  43.4k|        dstPtr[1] = srcPtr[1];
  503|  43.4k|        dstPtr[2] = srcPtr[2];
  504|  43.4k|        dstPtr[3] = srcPtr[3];
  505|  43.4k|        srcPtr += inc32table[offset];
  506|  43.4k|        LZ4_memcpy(dstPtr+4, srcPtr, 4);
  ------------------
  |  |  349|  43.4k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  507|  43.4k|        srcPtr -= dec64table[offset];
  508|  43.4k|    } else {
  509|  1.16k|        LZ4_memcpy(dstPtr, srcPtr, 8);
  ------------------
  |  |  349|  1.16k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  510|  1.16k|        srcPtr += 8;
  511|  1.16k|    }
  512|  44.5k|    dstPtr += 8;
  513|       |
  514|       |    /* srcPtr is now at least 8 bytes behind dstPtr */
  515|  44.5k|    LZ4_memcpy(dstPtr, srcPtr, 8);
  ------------------
  |  |  349|  44.5k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  516|  44.5k|    if (dstEnd > dstPtr + 8) { LZ4_wildCopy8(dstPtr + 8, srcPtr + 8, dstEnd); }
  ------------------
  |  Branch (516:9): [True: 4.93k, False: 39.6k]
  ------------------
  517|  44.5k|}

adler32_ssse3.c:adler32_len_16:
   29|     58|static inline uint32_t adler32_len_16(uint32_t adler, const uint8_t *buf, size_t len, uint32_t sum2) {
   30|    545|    while (len) {
  ------------------
  |  Branch (30:12): [True: 487, False: 58]
  ------------------
   31|    487|        --len;
   32|    487|        adler += *buf++;
   33|    487|        sum2 += adler;
   34|    487|    }
   35|     58|    adler %= BASE;
  ------------------
  |  |   11|     58|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   36|     58|    sum2 %= BASE;            /* only added so many BASE's */
  ------------------
  |  |   11|     58|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   37|       |    /* return recombined sums */
   38|     58|    return adler | (sum2 << 16);
   39|     58|}
adler32_sse42.c:adler32_copy_len_16:
   41|    144|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.32k|    while (len--) {
  ------------------
  |  Branch (42:12): [True: 1.18k, False: 144]
  ------------------
   43|  1.18k|        *dst = *buf++;
   44|  1.18k|        adler += *dst++;
   45|  1.18k|        sum2 += adler;
   46|  1.18k|    }
   47|    144|    adler %= BASE;
  ------------------
  |  |   11|    144|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   48|    144|    sum2 %= BASE;            /* only added so many BASE's */
  ------------------
  |  |   11|    144|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   49|       |    /* return recombined sums */
   50|    144|    return adler | (sum2 << 16);
   51|    144|}
adler32_avx2.c:adler32_copy_len_16:
   41|    191|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.25k|    while (len--) {
  ------------------
  |  Branch (42:12): [True: 1.06k, False: 191]
  ------------------
   43|  1.06k|        *dst = *buf++;
   44|  1.06k|        adler += *dst++;
   45|  1.06k|        sum2 += adler;
   46|  1.06k|    }
   47|    191|    adler %= BASE;
  ------------------
  |  |   11|    191|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   48|    191|    sum2 %= BASE;            /* only added so many BASE's */
  ------------------
  |  |   11|    191|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   49|       |    /* return recombined sums */
   50|    191|    return adler | (sum2 << 16);
   51|    191|}
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|    517|    while (len) {
  ------------------
  |  Branch (30:12): [True: 458, False: 59]
  ------------------
   31|    458|        --len;
   32|    458|        adler += *buf++;
   33|    458|        sum2 += adler;
   34|    458|    }
   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|    131|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|    131|}
adler32_fold_copy_avx2:
  176|    398|Z_INTERNAL uint32_t adler32_fold_copy_avx2(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len) {
  177|    398|    return adler32_fold_copy_impl(adler, dst, src, len, 1);
  178|    398|}
adler32_avx2.c:adler32_fold_copy_impl:
   21|    529|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|    529|    if (src == NULL) return 1L;
  ------------------
  |  Branch (22:9): [True: 0, False: 529]
  ------------------
   23|    529|    if (len == 0) return adler;
  ------------------
  |  Branch (23:9): [True: 0, False: 529]
  ------------------
   24|       |
   25|    529|    uint32_t adler0, adler1;
   26|    529|    adler1 = (adler >> 16) & 0xffff;
   27|    529|    adler0 = adler & 0xffff;
   28|       |
   29|    846|rem_peel:
   30|    846|    if (len < 16) {
  ------------------
  |  Branch (30:9): [True: 250, False: 596]
  ------------------
   31|    250|        if (COPY) {
  ------------------
  |  Branch (31:13): [True: 191, False: 59]
  ------------------
   32|    191|            return adler32_copy_len_16(adler0, src, dst, len, adler1);
   33|    191|        } else {
   34|     59|            return adler32_len_16(adler0, src, len, adler1);
   35|     59|        }
   36|    596|    } else if (len < 32) {
  ------------------
  |  Branch (36:16): [True: 208, False: 388]
  ------------------
   37|    208|        if (COPY) {
  ------------------
  |  Branch (37:13): [True: 150, False: 58]
  ------------------
   38|    150|            return adler32_fold_copy_sse42(adler, dst, src, len);
   39|    150|        } else {
   40|     58|            return adler32_ssse3(adler, src, len);
   41|     58|        }
   42|    208|    }
   43|       |
   44|    388|    __m256i vs1, vs2, vs2_0;
   45|       |
   46|    388|    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|    388|                                           46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33);
   48|    388|    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|    388|                                             14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
   50|    388|    const __m256i dot3v = _mm256_set1_epi16(1);
   51|    388|    const __m256i zero = _mm256_setzero_si256();
   52|       |
   53|  2.05k|    while (len >= 32) {
  ------------------
  |  Branch (53:12): [True: 1.66k, False: 388]
  ------------------
   54|  1.66k|        vs1 = _mm256_zextsi128_si256(_mm_cvtsi32_si128(adler0));
   55|  1.66k|        vs2 = _mm256_zextsi128_si256(_mm_cvtsi32_si128(adler1));
   56|  1.66k|        __m256i vs1_0 = vs1;
   57|  1.66k|        __m256i vs3 = _mm256_setzero_si256();
   58|  1.66k|        vs2_0 = vs3;
   59|       |
   60|  1.66k|        size_t k = MIN(len, NMAX);
  ------------------
  |  |  124|  1.66k|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 1.27k, False: 388]
  |  |  ------------------
  ------------------
   61|  1.66k|        k -= k % 32;
   62|  1.66k|        len -= k;
   63|       |
   64|   120k|        while (k >= 64) {
  ------------------
  |  Branch (64:16): [True: 118k, False: 1.66k]
  ------------------
   65|   118k|            __m256i vbuf = _mm256_loadu_si256((__m256i*)src);
   66|   118k|            __m256i vbuf_0 = _mm256_loadu_si256((__m256i*)(src + 32));
   67|   118k|            src += 64;
   68|   118k|            k -= 64;
   69|       |
   70|   118k|            __m256i vs1_sad = _mm256_sad_epu8(vbuf, zero);
   71|   118k|            __m256i vs1_sad2 = _mm256_sad_epu8(vbuf_0, zero);
   72|       |
   73|   118k|            if (COPY) {
  ------------------
  |  Branch (73:17): [True: 31.1k, False: 87.8k]
  ------------------
   74|  31.1k|                _mm256_storeu_si256((__m256i*)dst, vbuf);
   75|  31.1k|                _mm256_storeu_si256((__m256i*)(dst + 32), vbuf_0);
   76|  31.1k|                dst += 64;
   77|  31.1k|            }
   78|       |
   79|   118k|            vs1 = _mm256_add_epi32(vs1, vs1_sad);
   80|   118k|            vs3 = _mm256_add_epi32(vs3, vs1_0);
   81|   118k|            __m256i v_short_sum2 = _mm256_maddubs_epi16(vbuf, dot2v); // sum 32 uint8s to 16 shorts
   82|   118k|            __m256i v_short_sum2_0 = _mm256_maddubs_epi16(vbuf_0, dot2v_0); // sum 32 uint8s to 16 shorts
   83|   118k|            __m256i vsum2 = _mm256_madd_epi16(v_short_sum2, dot3v); // sum 16 shorts to 8 uint32s
   84|   118k|            __m256i vsum2_0 = _mm256_madd_epi16(v_short_sum2_0, dot3v); // sum 16 shorts to 8 uint32s
   85|   118k|            vs1 = _mm256_add_epi32(vs1_sad2, vs1);
   86|   118k|            vs2 = _mm256_add_epi32(vsum2, vs2);
   87|   118k|            vs2_0 = _mm256_add_epi32(vsum2_0, vs2_0);
   88|   118k|            vs1_0 = vs1;
   89|   118k|        }
   90|       |
   91|  1.66k|        vs2 = _mm256_add_epi32(vs2_0, vs2);
   92|  1.66k|        vs3 = _mm256_slli_epi32(vs3, 6);
   93|  1.66k|        vs2 = _mm256_add_epi32(vs3, vs2);
   94|  1.66k|        vs3 = _mm256_setzero_si256();
   95|       |
   96|  3.16k|        while (k >= 32) {
  ------------------
  |  Branch (96:16): [True: 1.50k, False: 1.66k]
  ------------------
   97|       |            /*
   98|       |               vs1 = adler + sum(c[i])
   99|       |               vs2 = sum2 + 32 vs1 + sum( (32-i+1) c[i] )
  100|       |            */
  101|  1.50k|            __m256i vbuf = _mm256_loadu_si256((__m256i*)src);
  102|  1.50k|            src += 32;
  103|  1.50k|            k -= 32;
  104|       |
  105|  1.50k|            __m256i vs1_sad = _mm256_sad_epu8(vbuf, zero); // Sum of abs diff, resulting in 2 x int32's
  106|       |
  107|  1.50k|            if (COPY) {
  ------------------
  |  Branch (107:17): [True: 465, False: 1.03k]
  ------------------
  108|    465|                _mm256_storeu_si256((__m256i*)dst, vbuf);
  109|    465|                dst += 32;
  110|    465|            }
  111|       | 
  112|  1.50k|            vs1 = _mm256_add_epi32(vs1, vs1_sad);
  113|  1.50k|            vs3 = _mm256_add_epi32(vs3, vs1_0);
  114|  1.50k|            __m256i v_short_sum2 = _mm256_maddubs_epi16(vbuf, dot2v_0); // sum 32 uint8s to 16 shorts
  115|  1.50k|            __m256i vsum2 = _mm256_madd_epi16(v_short_sum2, dot3v); // sum 16 shorts to 8 uint32s
  116|  1.50k|            vs2 = _mm256_add_epi32(vsum2, vs2);
  117|  1.50k|            vs1_0 = vs1;
  118|  1.50k|        }
  119|       |
  120|       |        /* Defer the multiplication with 32 to outside of the loop */
  121|  1.66k|        vs3 = _mm256_slli_epi32(vs3, 5);
  122|  1.66k|        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|  1.66k|         adler0 = partial_hsum256(vs1) % BASE;
  ------------------
  |  |   11|  1.66k|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  160|  1.66k|         adler1 = hsum256(vs2) % BASE;
  ------------------
  |  |   11|  1.66k|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  161|  1.66k|    }
  162|       |
  163|    388|    adler = adler0 | (adler1 << 16);
  164|       |
  165|    388|    if (len) {
  ------------------
  |  Branch (165:9): [True: 317, False: 71]
  ------------------
  166|    317|        goto rem_peel;
  167|    317|    }
  168|       |
  169|     71|    return adler;
  170|    388|}

adler32_avx2.c:partial_hsum256:
   20|  1.66k|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|  1.66k|    const __m256i perm_vec = _mm256_setr_epi32(0, 2, 4, 6, 1, 1, 1, 1);
   24|  1.66k|    __m256i non_zero = _mm256_permutevar8x32_epi32(x, perm_vec);
   25|  1.66k|    __m128i non_zero_sse = _mm256_castsi256_si128(non_zero);
   26|  1.66k|    __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|  1.66k|    return (uint32_t)_mm_cvtsi128_si32(sum3);
   29|  1.66k|}
adler32_avx2.c:hsum256:
   12|  1.66k|static inline uint32_t hsum256(__m256i x) {
   13|  1.66k|    __m128i sum1  = _mm_add_epi32(_mm256_extracti128_si256(x, 1),
   14|  1.66k|                                  _mm256_castsi256_si128(x));
   15|  1.66k|    __m128i sum2  = _mm_add_epi32(sum1, _mm_unpackhi_epi64(sum1, sum1));
   16|       |    __m128i sum3  = _mm_add_epi32(sum2, _mm_shuffle_epi32(sum2, 1));
   17|  1.66k|    return (uint32_t)_mm_cvtsi128_si32(sum3);
   18|  1.66k|}

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

adler32_ssse3:
   17|     58|Z_INTERNAL uint32_t adler32_ssse3(uint32_t adler, const uint8_t *buf, size_t len) {
   18|     58|    uint32_t sum2;
   19|       |
   20|       |     /* split Adler-32 into component sums */
   21|     58|    sum2 = (adler >> 16) & 0xffff;
   22|     58|    adler &= 0xffff;
   23|       |
   24|       |    /* in case user likes doing a byte at a time, keep it fast */
   25|     58|    if (UNLIKELY(len == 1))
  ------------------
  |  |  214|     58|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 0, False: 58]
  |  |  ------------------
  ------------------
   26|      0|        return adler32_len_1(adler, buf, sum2);
   27|       |
   28|       |    /* initial Adler-32 value (deferred check for len == 1 speed) */
   29|     58|    if (UNLIKELY(buf == NULL))
  ------------------
  |  |  214|     58|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 0, False: 58]
  |  |  ------------------
  ------------------
   30|      0|        return 1L;
   31|       |
   32|       |    /* in case short lengths are provided, keep it somewhat fast */
   33|     58|    if (UNLIKELY(len < 16))
  ------------------
  |  |  214|     58|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 0, False: 58]
  |  |  ------------------
  ------------------
   34|      0|        return adler32_len_16(adler, buf, len, sum2);
   35|       |
   36|     58|    const __m128i dot2v = _mm_setr_epi8(32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17);
   37|     58|    const __m128i dot2v_0 = _mm_setr_epi8(16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
   38|     58|    const __m128i dot3v = _mm_set1_epi16(1);
   39|     58|    const __m128i zero = _mm_setzero_si128();
   40|       |
   41|     58|    __m128i vbuf, vs1_0, vs3, vs1, vs2, vs2_0, v_sad_sum1, v_short_sum2, v_short_sum2_0,
   42|     58|            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|     58|    size_t max_iters = NMAX;
  ------------------
  |  |   12|     58|#define NMAX 5552
  ------------------
   50|     58|    size_t rem = (uintptr_t)buf & 15;
   51|     58|    size_t align_offset = 16 - rem;
   52|     58|    size_t k = 0;
   53|     58|    if (rem) {
  ------------------
  |  Branch (53:9): [True: 4, False: 54]
  ------------------
   54|      4|        if (len < 16 + align_offset) {
  ------------------
  |  Branch (54:13): [True: 1, False: 3]
  ------------------
   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|      1|            vbuf = _mm_loadu_si128((__m128i*)buf);
   60|      1|            len -= 16;
   61|      1|            buf += 16;
   62|      1|            vs1 = _mm_cvtsi32_si128(adler);
   63|      1|            vs2 = _mm_cvtsi32_si128(sum2);
   64|      1|            vs3 = _mm_setzero_si128();
   65|      1|            vs1_0 = vs1;
   66|      1|            goto unaligned_jmp;
   67|      1|        }
   68|       |
   69|     28|        for (size_t i = 0; i < align_offset; ++i) {
  ------------------
  |  Branch (69:28): [True: 25, False: 3]
  ------------------
   70|     25|            adler += *(buf++);
   71|     25|            sum2 += adler;
   72|     25|        }
   73|       |
   74|       |        /* lop off the max number of sums based on the scalar sums done
   75|       |         * above */
   76|      3|        len -= align_offset;
   77|      3|        max_iters -= align_offset;
   78|      3|    }
   79|       |
   80|       |
   81|    115|    while (len >= 16) {
  ------------------
  |  Branch (81:12): [True: 57, False: 58]
  ------------------
   82|     57|        vs1 = _mm_cvtsi32_si128(adler);
   83|     57|        vs2 = _mm_cvtsi32_si128(sum2);
   84|     57|        vs3 = _mm_setzero_si128();
   85|     57|        vs2_0 = _mm_setzero_si128();
   86|     57|        vs1_0 = vs1;
   87|       |
   88|     57|        k = (len < max_iters ? len : max_iters);
  ------------------
  |  Branch (88:14): [True: 57, False: 0]
  ------------------
   89|     57|        k -= k % 16;
   90|     57|        len -= k;
   91|       |
   92|     57|        while (k >= 32) {
  ------------------
  |  Branch (92:16): [True: 0, False: 57]
  ------------------
   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|     57|        vs2 = _mm_add_epi32(vs2_0, vs2);
  118|     57|        vs3 = _mm_slli_epi32(vs3, 5);
  119|     57|        vs2 = _mm_add_epi32(vs3, vs2);
  120|     57|        vs3 = _mm_setzero_si128();
  121|       |
  122|    115|        while (k >= 16) {
  ------------------
  |  Branch (122:16): [True: 57, False: 58]
  ------------------
  123|       |            /*
  124|       |               vs1 = adler + sum(c[i])
  125|       |               vs2 = sum2 + 16 vs1 + sum( (16-i+1) c[i] )
  126|       |            */
  127|     57|            vbuf = _mm_load_si128((__m128i*)buf);
  128|     57|            buf += 16;
  129|     57|            k -= 16;
  130|       |
  131|     58|unaligned_jmp:
  132|     58|            v_sad_sum1 = _mm_sad_epu8(vbuf, zero);
  133|     58|            vs1 = _mm_add_epi32(v_sad_sum1, vs1);
  134|     58|            vs3 = _mm_add_epi32(vs1_0, vs3);
  135|     58|            v_short_sum2 = _mm_maddubs_epi16(vbuf, dot2v_0);
  136|     58|            vsum2 = _mm_madd_epi16(v_short_sum2, dot3v);
  137|     58|            vs2 = _mm_add_epi32(vsum2, vs2);
  138|     58|            vs1_0 = vs1;
  139|     58|        }
  140|       |
  141|     58|        vs3 = _mm_slli_epi32(vs3, 4);
  142|     58|        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|     58|        adler = partial_hsum(vs1) % BASE;
  ------------------
  |  |   11|     58|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  148|     58|        sum2 = hsum(vs2) % BASE;
  ------------------
  |  |   11|     58|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  149|     58|        max_iters = NMAX;
  ------------------
  |  |   12|     58|#define NMAX 5552
  ------------------
  150|     58|    }
  151|       |
  152|       |    /* Process tail (len < 16).  */
  153|     58|    return adler32_len_16(adler, buf, len, sum2);
  154|     57|}

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

chunkset_avx2.c:loadhalfchunk:
   91|    152|static inline void loadhalfchunk(uint8_t const *s, halfchunk_t *chunk) {
   92|    152|    *chunk = _mm_loadu_si128((__m128i *)s);
   93|    152|}
chunkset_avx2.c:GET_HALFCHUNK_MAG:
  105|  7.48k|static inline halfchunk_t GET_HALFCHUNK_MAG(uint8_t *buf, uint32_t *chunk_rem, uint32_t dist) {
  106|  7.48k|    lut_rem_pair lut_rem = perm_idx_lut[dist - 3];
  107|  7.48k|    __m128i perm_vec, ret_vec;
  108|  7.48k|    __msan_unpoison(buf + dist, 16 - dist);
  ------------------
  |  |  338|  7.48k|#  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  7.48k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |               #  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  7.48k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |  |  Branch (338:79): [Folded, False: 7.48k]
  |  |  ------------------
  ------------------
  109|  7.48k|    ret_vec = _mm_loadu_si128((__m128i*)buf);
  110|  7.48k|    *chunk_rem = half_rem_vals[dist - 3];
  111|       |
  112|  7.48k|    perm_vec = _mm_load_si128((__m128i*)(permute_table + lut_rem.idx));
  113|  7.48k|    ret_vec = _mm_shuffle_epi8(ret_vec, perm_vec);
  114|       |
  115|  7.48k|    return ret_vec;
  116|  7.48k|}
chunkset_avx2.c:storehalfchunk:
   95|    663|static inline void storehalfchunk(uint8_t *out, halfchunk_t *chunk) {
   96|    663|    _mm_storeu_si128((__m128i *)out, *chunk);
   97|    663|}
chunkset_avx2.c:halfchunk2whole:
   99|  7.48k|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|  7.48k|    return _mm256_zextsi128_si256(*chunk);
  103|  7.48k|}
chunkset_avx2.c:chunkmemset_2:
   22|  9.80k|static inline void chunkmemset_2(uint8_t *from, chunk_t *chunk) {
   23|  9.80k|    *chunk = _mm256_set1_epi16(zng_memread_2(from));
   24|  9.80k|}
chunkset_avx2.c:chunkmemset_4:
   26|  12.6k|static inline void chunkmemset_4(uint8_t *from, chunk_t *chunk) {
   27|  12.6k|    *chunk = _mm256_set1_epi32(zng_memread_4(from));
   28|  12.6k|}
chunkset_avx2.c:chunkmemset_8:
   30|  3.03k|static inline void chunkmemset_8(uint8_t *from, chunk_t *chunk) {
   31|  3.03k|    *chunk = _mm256_set1_epi64x(zng_memread_8(from));
   32|  3.03k|}
chunkset_avx2.c:chunkmemset_16:
   34|  1.51k|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.51k|    *chunk = _mm256_broadcastsi128_si256(_mm_loadu_si128((__m128i*)from));
   41|  1.51k|#endif
   42|  1.51k|}
chunkset_avx2.c:GET_CHUNK_MAG:
   52|  1.62k|static inline chunk_t GET_CHUNK_MAG(uint8_t *buf, uint32_t *chunk_rem, uint32_t dist) {
   53|  1.62k|    lut_rem_pair lut_rem = perm_idx_lut[dist - 3];
   54|  1.62k|    __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|  1.62k|    *chunk_rem = lut_rem.remval;
   59|       |
   60|       |    /* See note in chunkset_ssse3.c for why this is ok */
   61|  1.62k|    __msan_unpoison(buf + dist, 32 - dist);
  ------------------
  |  |  338|  1.62k|#  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  1.62k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |               #  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  1.62k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |  |  Branch (338:79): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
   62|       |
   63|  1.62k|    if (dist < 16) {
  ------------------
  |  Branch (63:9): [True: 1.18k, False: 436]
  ------------------
   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|  1.18k|        const __m256i permute_xform =
   68|  1.18k|            _mm256_setr_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   69|  1.18k|                             16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16);
   70|  1.18k|        __m256i perm_vec = _mm256_load_si256((__m256i*)(permute_table+lut_rem.idx));
   71|  1.18k|        __m128i ret_vec0 = _mm_loadu_si128((__m128i*)buf);
   72|  1.18k|        perm_vec = _mm256_add_epi8(perm_vec, permute_xform);
   73|  1.18k|        ret_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ret_vec0), ret_vec0, 1);
   74|  1.18k|        ret_vec = _mm256_shuffle_epi8(ret_vec, perm_vec);
   75|  1.18k|    }  else {
   76|    436|        __m128i ret_vec0 = _mm_loadu_si128((__m128i*)buf);
   77|    436|        __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|    436|        __m128i perm_vec1 = _mm_load_si128((__m128i*)(permute_table + lut_rem.idx));
   80|    436|        __m128i xlane_permutes = _mm_cmpgt_epi8(_mm_set1_epi8(16), perm_vec1);
   81|    436|        __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|    436|        __m128i latter_half = _mm_blendv_epi8(ret_vec1, xlane_res, xlane_permutes);
   85|    436|        ret_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ret_vec0), latter_half, 1);
   86|    436|    }
   87|       |
   88|  1.62k|    return ret_vec;
   89|  1.62k|}
chunkset_avx2.c:storechunk:
   48|  90.8k|static inline void storechunk(uint8_t *out, chunk_t *chunk) {
   49|  90.8k|    _mm256_storeu_si256((__m256i *)out, *chunk);
   50|  90.8k|}
chunkset_avx2.c:loadchunk:
   44|  74.5k|static inline void loadchunk(uint8_t const *s, chunk_t *chunk) {
   45|  74.5k|    *chunk = _mm256_loadu_si256((__m256i *)s);
   46|  74.5k|}

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|  3.33k|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|  3.33k|    len = MIN(len, left);
  ------------------
  |  |  124|  3.33k|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 0, False: 3.33k]
  |  |  ------------------
  ------------------
  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|  3.33k|#ifndef HAVE_MASKED_READWRITE
  247|  3.33k|    if (UNLIKELY(left < sizeof(chunk_t))) {
  ------------------
  |  |  214|  3.33k|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 455, False: 2.88k]
  |  |  ------------------
  ------------------
  248|  3.73k|        while (len > 0) {
  ------------------
  |  Branch (248:16): [True: 3.28k, False: 455]
  ------------------
  249|  3.28k|            *out++ = *from++;
  250|  3.28k|            --len;
  251|  3.28k|        }
  252|       |
  253|    455|        return out;
  254|    455|    }
  255|  2.88k|#endif
  256|       |
  257|  2.88k|    if (len)
  ------------------
  |  Branch (257:9): [True: 2.88k, False: 0]
  ------------------
  258|  2.88k|        out = CHUNKMEMSET(out, from, len);
  ------------------
  |  |  121|  2.88k|#define CHUNKMEMSET      chunkmemset_avx2
  ------------------
  259|       |
  260|  2.88k|    return out;
  261|  3.33k|}
chunkset_avx2.c:chunkmemset_avx2:
  112|  47.4k|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|  47.4k|    Assert(from != out, "chunkmemset cannot have a distance 0");
  116|       |
  117|  47.4k|    chunk_t chunk_load;
  118|  47.4k|    uint32_t chunk_mod = 0;
  119|  47.4k|    uint32_t adv_amount;
  120|  47.4k|    int64_t sdist = out - from;
  121|  47.4k|    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|  47.4k|    if (sdist < 0 && dist < len) {
  ------------------
  |  Branch (127:9): [True: 0, False: 47.4k]
  |  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|  47.4k|    if (dist == 1) {
  ------------------
  |  Branch (143:9): [True: 10.8k, False: 36.5k]
  ------------------
  144|  10.8k|        memset(out, *from, len);
  145|  10.8k|        return out + len;
  146|  36.5k|    } else if (dist >= sizeof(chunk_t)) {
  ------------------
  |  Branch (146:16): [True: 350, False: 36.2k]
  ------------------
  147|    350|        return CHUNKCOPY(out, from, len);
  ------------------
  |  |  119|    350|#define CHUNKCOPY        chunkcopy_avx2
  ------------------
  148|    350|    }
  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|  36.2k|#ifdef HAVE_HALF_CHUNK
  158|  36.2k|    if (len <= sizeof(halfchunk_t)) {
  ------------------
  |  Branch (158:9): [True: 28.1k, False: 8.12k]
  ------------------
  159|  28.1k|        if (dist >= sizeof(halfchunk_t))
  ------------------
  |  Branch (159:13): [True: 152, False: 27.9k]
  ------------------
  160|    152|            return HALFCHUNKCOPY(out, from, len);
  161|       |
  162|  27.9k|        if ((dist % 2) != 0 || dist == 6) {
  ------------------
  |  Branch (162:13): [True: 6.60k, False: 21.3k]
  |  Branch (162:32): [True: 886, False: 20.4k]
  ------------------
  163|  7.48k|            halfchunk_t halfchunk_load = GET_HALFCHUNK_MAG(from, &chunk_mod, (unsigned)dist);
  164|       |
  165|  7.48k|            if (len == sizeof(halfchunk_t)) {
  ------------------
  |  Branch (165:17): [True: 511, False: 6.97k]
  ------------------
  166|    511|                storehalfchunk(out, &halfchunk_load);
  167|    511|                len -= sizeof(halfchunk_t);
  168|    511|                out += sizeof(halfchunk_t);
  169|    511|            }
  170|       |
  171|  7.48k|            chunk_load = halfchunk2whole(&halfchunk_load);
  172|  7.48k|            goto rem_bytes;
  173|  7.48k|        }
  174|  27.9k|    }
  175|  28.5k|#endif
  176|       |
  177|  28.5k|#ifdef HAVE_CHUNKMEMSET_2
  178|  28.5k|    if (dist == 2) {
  ------------------
  |  Branch (178:9): [True: 9.80k, False: 18.7k]
  ------------------
  179|  9.80k|        chunkmemset_2(from, &chunk_load);
  180|  9.80k|    } else
  181|  18.7k|#endif
  182|  18.7k|#ifdef HAVE_CHUNKMEMSET_4
  183|  18.7k|    if (dist == 4) {
  ------------------
  |  Branch (183:9): [True: 12.6k, False: 6.16k]
  ------------------
  184|  12.6k|        chunkmemset_4(from, &chunk_load);
  185|  12.6k|    } else
  186|  6.16k|#endif
  187|  6.16k|#ifdef HAVE_CHUNKMEMSET_8
  188|  6.16k|    if (dist == 8) {
  ------------------
  |  Branch (188:9): [True: 3.03k, False: 3.13k]
  ------------------
  189|  3.03k|        chunkmemset_8(from, &chunk_load);
  190|  3.03k|    } else
  191|  3.13k|#endif
  192|  3.13k|#ifdef HAVE_CHUNKMEMSET_16
  193|  3.13k|    if (dist == 16) {
  ------------------
  |  Branch (193:9): [True: 1.51k, False: 1.62k]
  ------------------
  194|  1.51k|        chunkmemset_16(from, &chunk_load);
  195|  1.51k|    } else
  196|  1.62k|#endif
  197|  1.62k|    chunk_load = GET_CHUNK_MAG(from, &chunk_mod, (unsigned)dist);
  198|       |
  199|  28.5k|    adv_amount = sizeof(chunk_t) - chunk_mod;
  200|       |
  201|  33.8k|    while (len >= (2 * sizeof(chunk_t))) {
  ------------------
  |  Branch (201:12): [True: 5.25k, False: 28.5k]
  ------------------
  202|  5.25k|        storechunk(out, &chunk_load);
  203|  5.25k|        storechunk(out + adv_amount, &chunk_load);
  204|  5.25k|        out += 2 * adv_amount;
  205|  5.25k|        len -= 2 * adv_amount;
  206|  5.25k|    }
  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|  34.4k|    while (len >= sizeof(chunk_t)) {
  ------------------
  |  Branch (212:12): [True: 5.85k, False: 28.5k]
  ------------------
  213|  5.85k|        storechunk(out, &chunk_load);
  214|  5.85k|        len -= adv_amount;
  215|  5.85k|        out += adv_amount;
  216|  5.85k|    }
  217|       |
  218|  28.5k|#ifdef HAVE_HALF_CHUNK
  219|  36.0k|rem_bytes:
  220|  36.0k|#endif
  221|  36.0k|    if (len) {
  ------------------
  |  Branch (221:9): [True: 35.5k, False: 541]
  ------------------
  222|  35.5k|        memcpy(out, &chunk_load, len);
  223|  35.5k|        out += len;
  224|  35.5k|    }
  225|       |
  226|  36.0k|    return out;
  227|  28.5k|}
chunkset_avx2.c:HALFCHUNKCOPY:
   91|    152|static inline uint8_t* HALFCHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
   92|    152|    halfchunk_t chunk;
   93|    152|    int32_t align = ((len - 1) % sizeof(halfchunk_t)) + 1;
   94|    152|    loadhalfchunk(from, &chunk);
   95|    152|    storehalfchunk(out, &chunk);
   96|    152|    out += align;
   97|    152|    from += align;
   98|    152|    len -= align;
   99|    152|    while (len > 0) {
  ------------------
  |  Branch (99:12): [True: 0, False: 152]
  ------------------
  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|    152|    return out;
  107|    152|}
chunkset_avx2.c:chunksize_avx2:
    9|  45.4k|static inline size_t CHUNKSIZE(void) {
   10|  45.4k|    return sizeof(chunk_t);
   11|  45.4k|}
chunkset_avx2.c:chunkcopy_avx2:
   24|  64.8k|static inline uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
   25|  64.8k|    Assert(len > 0, "chunkcopy should never have a length 0");
   26|  64.8k|    chunk_t chunk;
   27|  64.8k|    int32_t align = ((len - 1) % sizeof(chunk_t)) + 1;
   28|  64.8k|    loadchunk(from, &chunk);
   29|  64.8k|    storechunk(out, &chunk);
   30|  64.8k|    out += align;
   31|  64.8k|    from += align;
   32|  64.8k|    len -= align;
   33|  74.5k|    while (len > 0) {
  ------------------
  |  Branch (33:12): [True: 9.63k, False: 64.8k]
  ------------------
   34|  9.63k|        loadchunk(from, &chunk);
   35|  9.63k|        storechunk(out, &chunk);
   36|  9.63k|        out += sizeof(chunk_t);
   37|  9.63k|        from += sizeof(chunk_t);
   38|  9.63k|        len -= sizeof(chunk_t);
   39|  9.63k|    }
   40|  64.8k|    return out;
   41|  64.8k|}

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|  1.09k|static int force_init_empty(void) {
   64|  1.09k|    return 0;
   65|  1.09k|}

inflate_fast_avx2:
   53|  22.5k|void Z_INTERNAL INFLATE_FAST(PREFIX3(stream) *strm, uint32_t start) {
   54|       |    /* start: inflate()'s starting value for strm->avail_out */
   55|  22.5k|    struct inflate_state *state;
   56|  22.5k|    z_const unsigned char *in;  /* local strm->next_in */
  ------------------
  |  |   23|  22.5k|#define z_const const
  ------------------
   57|  22.5k|    const unsigned char *last;  /* have enough input while in < last */
   58|  22.5k|    unsigned char *out;         /* local strm->next_out */
   59|  22.5k|    unsigned char *beg;         /* inflate()'s initial strm->next_out */
   60|  22.5k|    unsigned char *end;         /* while out < end, enough space available */
   61|  22.5k|    unsigned char *safe;        /* can use chunkcopy provided out < safe */
   62|  22.5k|    unsigned char *window;      /* allocated sliding window, if wsize != 0 */
   63|  22.5k|    unsigned wsize;             /* window size or zero if not using window */
   64|  22.5k|    unsigned whave;             /* valid bytes in the window */
   65|  22.5k|    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|  22.5k|    unsigned bits;              /* local strm->bits */
  105|  22.5k|    uint64_t hold;              /* local strm->hold */
  106|  22.5k|    unsigned lmask;             /* mask for first level of length codes */
  107|  22.5k|    unsigned dmask;             /* mask for first level of distance codes */
  108|  22.5k|    code const *lcode;          /* local strm->lencode */
  109|  22.5k|    code const *dcode;          /* local strm->distcode */
  110|  22.5k|    const code *here;           /* retrieved table entry */
  111|  22.5k|    unsigned op;                /* code bits, operation, extra bits, or */
  112|       |                                /*  window position, window bytes to copy */
  113|  22.5k|    unsigned len;               /* match length, unused bytes */
  114|  22.5k|    unsigned char *from;        /* where to copy match from */
  115|  22.5k|    unsigned dist;              /* match distance */
  116|  22.5k|    unsigned extra_safe;        /* copy chunks safely in all cases */
  117|       |
  118|       |    /* copy state to local variables */
  119|  22.5k|    state = (struct inflate_state *)strm->state;
  120|  22.5k|    in = strm->next_in;
  121|  22.5k|    last = in + (strm->avail_in - (INFLATE_FAST_MIN_HAVE - 1));
  ------------------
  |  |  137|  22.5k|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
  122|  22.5k|    out = strm->next_out;
  123|  22.5k|    beg = out - (start - strm->avail_out);
  124|  22.5k|    end = out + (strm->avail_out - (INFLATE_FAST_MIN_LEFT - 1));
  ------------------
  |  |  138|  22.5k|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  125|  22.5k|    safe = out + strm->avail_out;
  126|  22.5k|    wsize = state->wsize;
  127|  22.5k|    whave = state->whave;
  128|  22.5k|    wnext = state->wnext;
  129|  22.5k|    window = state->window;
  130|  22.5k|    hold = state->hold;
  131|  22.5k|    bits = state->bits;
  132|  22.5k|    lcode = state->lencode;
  133|  22.5k|    dcode = state->distcode;
  134|  22.5k|    lmask = (1U << state->lenbits) - 1;
  135|  22.5k|    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|  22.5k|    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: 22.5k]
  |  Branch (140:33): [True: 0, False: 0]
  |  Branch (140:50): [True: 0, False: 0]
  ------------------
  141|       |
  142|  22.5k|#define REFILL() do { \
  143|  22.5k|        hold |= load_64_bits(in, bits); \
  144|  22.5k|        in += 7; \
  145|  22.5k|        in -= ((bits >> 3) & 7); \
  146|  22.5k|        bits |= 56; \
  147|  22.5k|    } while (0)
  148|       |
  149|       |    /* decode literals and length/distances until end-of-block or not enough
  150|       |       input data or output space */
  151|  2.76M|    do {
  152|  2.76M|        REFILL();
  ------------------
  |  |  142|  2.76M|#define REFILL() do { \
  |  |  143|  2.76M|        hold |= load_64_bits(in, bits); \
  |  |  144|  2.76M|        in += 7; \
  |  |  145|  2.76M|        in -= ((bits >> 3) & 7); \
  |  |  146|  2.76M|        bits |= 56; \
  |  |  147|  2.76M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (147:14): [Folded, False: 2.76M]
  |  |  ------------------
  ------------------
  153|  2.76M|        here = lcode + (hold & lmask);
  154|  2.76M|        if (here->op == 0) {
  ------------------
  |  Branch (154:13): [True: 2.62M, False: 140k]
  ------------------
  155|  2.62M|            *out++ = (unsigned char)(here->val);
  156|  2.62M|            DROPBITS(here->bits);
  ------------------
  |  |  118|  2.62M|    do { \
  |  |  119|  2.62M|        hold >>= (n); \
  |  |  120|  2.62M|        bits -= (unsigned)(n); \
  |  |  121|  2.62M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 2.62M]
  |  |  ------------------
  ------------------
  157|  2.62M|            here = lcode + (hold & lmask);
  158|  2.62M|            if (here->op == 0) {
  ------------------
  |  Branch (158:17): [True: 2.55M, False: 71.6k]
  ------------------
  159|  2.55M|                *out++ = (unsigned char)(here->val);
  160|  2.55M|                DROPBITS(here->bits);
  ------------------
  |  |  118|  2.55M|    do { \
  |  |  119|  2.55M|        hold >>= (n); \
  |  |  120|  2.55M|        bits -= (unsigned)(n); \
  |  |  121|  2.55M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 2.55M]
  |  |  ------------------
  ------------------
  161|  2.55M|                here = lcode + (hold & lmask);
  162|  2.55M|            }
  163|  2.62M|        }
  164|  2.93M|      dolen:
  165|  2.93M|        DROPBITS(here->bits);
  ------------------
  |  |  118|  2.93M|    do { \
  |  |  119|  2.93M|        hold >>= (n); \
  |  |  120|  2.93M|        bits -= (unsigned)(n); \
  |  |  121|  2.93M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 2.93M]
  |  |  ------------------
  ------------------
  166|  2.93M|        op = here->op;
  167|  2.93M|        if (op == 0) {                          /* literal */
  ------------------
  |  Branch (167:13): [True: 2.63M, False: 293k]
  ------------------
  168|  2.63M|            Tracevv((stderr, here->val >= 0x20 && here->val < 0x7f ?
  169|  2.63M|                    "inflate:         literal '%c'\n" :
  170|  2.63M|                    "inflate:         literal 0x%02x\n", here->val));
  171|  2.63M|            *out++ = (unsigned char)(here->val);
  172|  2.63M|        } else if (op & 16) {                     /* length base */
  ------------------
  |  Branch (172:20): [True: 109k, False: 184k]
  ------------------
  173|   109k|            len = here->val;
  174|   109k|            op &= MAX_BITS;                       /* number of extra bits */
  ------------------
  |  |   39|   109k|#define MAX_BITS 15
  ------------------
  175|   109k|            len += BITS(op);
  ------------------
  |  |  114|   109k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  176|   109k|            DROPBITS(op);
  ------------------
  |  |  118|   109k|    do { \
  |  |  119|   109k|        hold >>= (n); \
  |  |  120|   109k|        bits -= (unsigned)(n); \
  |  |  121|   109k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 109k]
  |  |  ------------------
  ------------------
  177|   109k|            Tracevv((stderr, "inflate:         length %u\n", len));
  178|   109k|            here = dcode + (hold & dmask);
  179|   109k|            if (bits < MAX_BITS + MAX_DIST_EXTRA_BITS) {
  ------------------
  |  |   39|   109k|#define MAX_BITS 15
  ------------------
                          if (bits < MAX_BITS + MAX_DIST_EXTRA_BITS) {
  ------------------
  |  |   41|   109k|#define MAX_DIST_EXTRA_BITS 13
  ------------------
  |  Branch (179:17): [True: 1.24k, False: 107k]
  ------------------
  180|  1.24k|                REFILL();
  ------------------
  |  |  142|  1.24k|#define REFILL() do { \
  |  |  143|  1.24k|        hold |= load_64_bits(in, bits); \
  |  |  144|  1.24k|        in += 7; \
  |  |  145|  1.24k|        in -= ((bits >> 3) & 7); \
  |  |  146|  1.24k|        bits |= 56; \
  |  |  147|  1.24k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (147:14): [Folded, False: 1.24k]
  |  |  ------------------
  ------------------
  181|  1.24k|            }
  182|   114k|          dodist:
  183|   114k|            DROPBITS(here->bits);
  ------------------
  |  |  118|   114k|    do { \
  |  |  119|   114k|        hold >>= (n); \
  |  |  120|   114k|        bits -= (unsigned)(n); \
  |  |  121|   114k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 114k]
  |  |  ------------------
  ------------------
  184|   114k|            op = here->op;
  185|   114k|            if (op & 16) {                      /* distance base */
  ------------------
  |  Branch (185:17): [True: 109k, False: 4.92k]
  ------------------
  186|   109k|                dist = here->val;
  187|   109k|                op &= MAX_BITS;                 /* number of extra bits */
  ------------------
  |  |   39|   109k|#define MAX_BITS 15
  ------------------
  188|   109k|                dist += BITS(op);
  ------------------
  |  |  114|   109k|    (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|   109k|                DROPBITS(op);
  ------------------
  |  |  118|   109k|    do { \
  |  |  119|   109k|        hold >>= (n); \
  |  |  120|   109k|        bits -= (unsigned)(n); \
  |  |  121|   109k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 109k]
  |  |  ------------------
  ------------------
  196|   109k|                Tracevv((stderr, "inflate:         distance %u\n", dist));
  197|   109k|                op = (unsigned)(out - beg);     /* max distance in output */
  198|   109k|                if (dist > op) {                /* see if copy from window */
  ------------------
  |  Branch (198:21): [True: 23, False: 109k]
  ------------------
  199|     23|                    op = dist - op;             /* distance back in window */
  200|     23|                    if (op > whave) {
  ------------------
  |  Branch (200:25): [True: 23, 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|     23|                        SET_BAD("invalid distance too far back");
  ------------------
  |  |  132|     23|    do { \
  |  |  133|     23|        state->mode = BAD; \
  |  |  134|     23|        strm->msg = (char *)errmsg; \
  |  |  135|     23|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 23]
  |  |  ------------------
  ------------------
  225|     23|                        break;
  226|     23|#endif
  227|     23|                    }
  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|   109k|                } else if (extra_safe) {
  ------------------
  |  Branch (265:28): [True: 0, False: 109k]
  ------------------
  266|       |                    /* Whole reference is in range of current output. */
  267|      0|                        out = chunkcopy_safe(out, out - dist, len, safe);
  268|      0|#endif
  269|   109k|                } 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|   109k|                    if (dist >= len || dist >= CHUNKSIZE())
  ------------------
  |  |  118|  45.4k|#define CHUNKSIZE        chunksize_avx2
  ------------------
  |  Branch (275:25): [True: 63.6k, False: 45.4k]
  |  Branch (275:40): [True: 895, False: 44.5k]
  ------------------
  276|  64.5k|                        out = CHUNKCOPY(out, out - dist, len);
  ------------------
  |  |  119|  64.5k|#define CHUNKCOPY        chunkcopy_avx2
  ------------------
  277|  44.5k|                    else
  278|  44.5k|                        out = CHUNKMEMSET(out, out - dist, len);
  ------------------
  |  |  121|  44.5k|#define CHUNKMEMSET      chunkmemset_avx2
  ------------------
  279|   109k|                }
  280|   109k|            } else if ((op & 64) == 0) {          /* 2nd level distance code */
  ------------------
  |  Branch (280:24): [True: 4.92k, False: 3]
  ------------------
  281|  4.92k|                here = dcode + here->val + BITS(op);
  ------------------
  |  |  114|  4.92k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  282|  4.92k|                goto dodist;
  283|  4.92k|            } 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|   184k|        } else if ((op & 64) == 0) {              /* 2nd level length code */
  ------------------
  |  Branch (287:20): [True: 162k, False: 22.1k]
  ------------------
  288|   162k|            here = lcode + here->val + BITS(op);
  ------------------
  |  |  114|   162k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  289|   162k|            goto dolen;
  290|   162k|        } else if (op & 32) {                     /* end-of-block */
  ------------------
  |  Branch (290:20): [True: 22.1k, False: 3]
  ------------------
  291|  22.1k|            Tracevv((stderr, "inflate:         end of block\n"));
  292|  22.1k|            state->mode = TYPE;
  293|  22.1k|            break;
  294|  22.1k|        } else {
  295|      3|            SET_BAD("invalid literal/length 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]
  |  |  ------------------
  ------------------
  296|      3|            break;
  297|      3|        }
  298|  2.93M|    } while (in < last && out < end);
  ------------------
  |  Branch (298:14): [True: 2.74M, False: 203]
  |  Branch (298:27): [True: 2.74M, False: 186]
  ------------------
  299|       |
  300|       |    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
  301|  22.5k|    len = bits >> 3;
  302|  22.5k|    in -= len;
  303|  22.5k|    bits -= len << 3;
  304|  22.5k|    hold &= (UINT64_C(1) << bits) - 1;
  305|       |
  306|       |    /* update state and return */
  307|  22.5k|    strm->next_in = in;
  308|  22.5k|    strm->next_out = out;
  309|  22.5k|    strm->avail_in = (unsigned)(in < last ? (INFLATE_FAST_MIN_HAVE - 1) + (last - in)
  ------------------
  |  |  137|  22.5k|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
  |  Branch (309:33): [True: 22.5k, False: 44]
  ------------------
  310|  22.5k|                                          : (INFLATE_FAST_MIN_HAVE - 1) - (in - last));
  ------------------
  |  |  137|     44|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
  311|  22.5k|    strm->avail_out = (unsigned)(out < end ? (INFLATE_FAST_MIN_LEFT - 1) + (end - out)
  ------------------
  |  |  138|  22.3k|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  |  Branch (311:34): [True: 22.3k, False: 231]
  ------------------
  312|  22.5k|                                           : (INFLATE_FAST_MIN_LEFT - 1) - (out - end));
  ------------------
  |  |  138|    231|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  313|       |
  314|  22.5k|    Assert(bits <= 32, "Remaining bits greater than 32");
  315|  22.5k|    state->hold = (uint32_t)hold;
  316|  22.5k|    state->bits = bits;
  317|  22.5k|    return;
  318|  22.5k|}

zng_inflateResetKeep:
   61|  1.09k|int32_t Z_EXPORT PREFIX(inflateResetKeep)(PREFIX3(stream) *strm) {
   62|  1.09k|    struct inflate_state *state;
   63|       |
   64|  1.09k|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (64:9): [True: 0, False: 1.09k]
  ------------------
   65|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
   66|  1.09k|    state = (struct inflate_state *)strm->state;
   67|  1.09k|    strm->total_in = strm->total_out = state->total = 0;
   68|  1.09k|    strm->msg = NULL;
   69|  1.09k|    if (state->wrap)        /* to support ill-conceived Java test suite */
  ------------------
  |  Branch (69:9): [True: 1.09k, False: 0]
  ------------------
   70|  1.09k|        strm->adler = state->wrap & 1;
   71|  1.09k|    state->mode = HEAD;
   72|  1.09k|    state->check = ADLER32_INITIAL_VALUE;
  ------------------
  |  |   65|  1.09k|#define ADLER32_INITIAL_VALUE 1 /* initial adler-32 hash value */
  ------------------
   73|  1.09k|    state->last = 0;
   74|  1.09k|    state->havedict = 0;
   75|  1.09k|    state->flags = -1;
   76|  1.09k|    state->head = NULL;
   77|  1.09k|    state->hold = 0;
   78|  1.09k|    state->bits = 0;
   79|  1.09k|    state->lencode = state->distcode = state->next = state->codes;
   80|  1.09k|    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|  1.09k|    INFLATE_RESET_KEEP_HOOK(strm);  /* hook for IBM Z DFLTCC */
  ------------------
  |  |   25|  1.09k|#  define INFLATE_RESET_KEEP_HOOK(strm) do {} while (0)
  |  |  ------------------
  |  |  |  Branch (25:54): [Folded, False: 1.09k]
  |  |  ------------------
  ------------------
   88|  1.09k|    Tracev((stderr, "inflate: reset\n"));
   89|  1.09k|    return Z_OK;
  ------------------
  |  |  180|  1.09k|#define Z_OK            0
  ------------------
   90|  1.09k|}
zng_inflateReset:
   92|  1.09k|int32_t Z_EXPORT PREFIX(inflateReset)(PREFIX3(stream) *strm) {
   93|  1.09k|    struct inflate_state *state;
   94|       |
   95|  1.09k|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (95:9): [True: 0, False: 1.09k]
  ------------------
   96|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
   97|  1.09k|    state = (struct inflate_state *)strm->state;
   98|  1.09k|    state->wsize = 0;
   99|  1.09k|    state->whave = 0;
  100|  1.09k|    state->wnext = 0;
  101|  1.09k|    return PREFIX(inflateResetKeep)(strm);
  ------------------
  |  |   97|  1.09k|#  define PREFIX(x) zng_ ## x
  ------------------
  102|  1.09k|}
zng_inflateReset2:
  104|  1.09k|int32_t Z_EXPORT PREFIX(inflateReset2)(PREFIX3(stream) *strm, int32_t windowBits) {
  105|  1.09k|    int wrap;
  106|  1.09k|    struct inflate_state *state;
  107|       |
  108|       |    /* get the state */
  109|  1.09k|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (109:9): [True: 0, False: 1.09k]
  ------------------
  110|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  111|  1.09k|    state = (struct inflate_state *)strm->state;
  112|       |
  113|       |    /* extract wrap request from windowBits parameter */
  114|  1.09k|    if (windowBits < 0) {
  ------------------
  |  Branch (114:9): [True: 0, False: 1.09k]
  ------------------
  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|  1.09k|    } else {
  120|  1.09k|        wrap = (windowBits >> 4) + 5;
  121|  1.09k|#ifdef GUNZIP
  122|  1.09k|        if (windowBits < 48)
  ------------------
  |  Branch (122:13): [True: 1.09k, False: 0]
  ------------------
  123|  1.09k|            windowBits &= MAX_WBITS;
  ------------------
  |  |   39|  1.09k|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
  124|  1.09k|#endif
  125|  1.09k|    }
  126|       |
  127|       |    /* set number of window bits */
  128|  1.09k|    if (windowBits && (windowBits < MIN_WBITS || windowBits > MAX_WBITS))
  ------------------
  |  |   36|  2.19k|#  define MIN_WBITS   8  /* 256 LZ77 window */
  ------------------
                  if (windowBits && (windowBits < MIN_WBITS || windowBits > MAX_WBITS))
  ------------------
  |  |   39|  1.09k|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
  |  Branch (128:9): [True: 1.09k, False: 0]
  |  Branch (128:24): [True: 0, False: 1.09k]
  |  Branch (128:50): [True: 0, False: 1.09k]
  ------------------
  129|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  130|       |
  131|       |    /* update state and reset the rest of it */
  132|  1.09k|    state->wrap = wrap;
  133|  1.09k|    state->wbits = (unsigned)windowBits;
  134|  1.09k|    return PREFIX(inflateReset)(strm);
  ------------------
  |  |   97|  1.09k|#  define PREFIX(x) zng_ ## x
  ------------------
  135|  1.09k|}
alloc_inflate:
  152|  1.09k|Z_INTERNAL inflate_allocs* alloc_inflate(PREFIX3(stream) *strm) {
  153|  1.09k|    int curr_size = 0;
  154|       |
  155|       |    /* Define sizes */
  156|  1.09k|    int window_size = INFLATE_ADJUST_WINDOW_SIZE((1 << MAX_WBITS) + 64); /* 64B padding for chunksize */
  ------------------
  |  |   23|  1.09k|#  define INFLATE_ADJUST_WINDOW_SIZE(n) (n)
  ------------------
  157|  1.09k|    int state_size = sizeof(inflate_state);
  158|  1.09k|    int alloc_size = sizeof(inflate_allocs);
  159|       |
  160|       |    /* Calculate relative buffer positions and paddings */
  161|  1.09k|    LOGSZP("window", window_size, PAD_WINDOW(curr_size), PADSZ(curr_size,WINDOW_PAD_SIZE));
  162|  1.09k|    int window_pos = PAD_WINDOW(curr_size);
  ------------------
  |  |  465|  1.09k|#  define PAD_WINDOW            PAD_64
  |  |  ------------------
  |  |  |  |  245|  1.09k|#define PAD_64(bpos) ((bpos) + PADSZ((bpos),64))
  |  |  |  |  ------------------
  |  |  |  |  |  |  243|  1.09k|#define PADSZ(bpos, pad) (((pad) - ((uintptr_t)(bpos) % (pad))) % (pad))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|  1.09k|    curr_size = window_pos + window_size;
  164|       |
  165|  1.09k|    LOGSZP("state", state_size, PAD_64(curr_size), PADSZ(curr_size,64));
  166|  1.09k|    int state_pos = PAD_64(curr_size);
  ------------------
  |  |  245|  1.09k|#define PAD_64(bpos) ((bpos) + PADSZ((bpos),64))
  |  |  ------------------
  |  |  |  |  243|  1.09k|#define PADSZ(bpos, pad) (((pad) - ((uintptr_t)(bpos) % (pad))) % (pad))
  |  |  ------------------
  ------------------
  167|  1.09k|    curr_size = state_pos + state_size;
  168|       |
  169|  1.09k|    LOGSZP("alloc", alloc_size, PAD_16(curr_size), PADSZ(curr_size,16));
  170|  1.09k|    int alloc_pos = PAD_16(curr_size);
  ------------------
  |  |  244|  1.09k|#define PAD_16(bpos) ((bpos) + PADSZ((bpos),16))
  |  |  ------------------
  |  |  |  |  243|  1.09k|#define PADSZ(bpos, pad) (((pad) - ((uintptr_t)(bpos) % (pad))) % (pad))
  |  |  ------------------
  ------------------
  171|  1.09k|    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|  1.09k|    int total_size = PAD_64(curr_size + (WINDOW_PAD_SIZE - 1));
  ------------------
  |  |  245|  1.09k|#define PAD_64(bpos) ((bpos) + PADSZ((bpos),64))
  |  |  ------------------
  |  |  |  |  243|  1.09k|#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|  1.09k|    char *original_buf = (char *)strm->zalloc(strm->opaque, 1, total_size);
  178|  1.09k|    if (original_buf == NULL)
  ------------------
  |  Branch (178:9): [True: 0, False: 1.09k]
  ------------------
  179|      0|        return NULL;
  180|       |
  181|  1.09k|    char *buff = (char *)HINT_ALIGNED_WINDOW((char *)PAD_WINDOW(original_buf));
  ------------------
  |  |  467|  1.09k|#  define HINT_ALIGNED_WINDOW   HINT_ALIGNED_64
  |  |  ------------------
  |  |  |  |  236|  1.09k|#define HINT_ALIGNED_64(p) HINT_ALIGNED((p),64)
  |  |  |  |  ------------------
  |  |  |  |  |  |  231|  1.09k|#  define HINT_ALIGNED(p,n) __builtin_assume_aligned((void *)(p),(n))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|  1.09k|    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|  1.09k|    inflate_allocs *alloc_bufs  = (struct inflate_allocs_s *)(buff + alloc_pos);
  186|  1.09k|    alloc_bufs->buf_start = original_buf;
  187|  1.09k|    alloc_bufs->zfree = strm->zfree;
  188|       |
  189|  1.09k|    alloc_bufs->window =  (unsigned char *)HINT_ALIGNED_WINDOW((buff + window_pos));
  ------------------
  |  |  467|  1.09k|#  define HINT_ALIGNED_WINDOW   HINT_ALIGNED_64
  |  |  ------------------
  |  |  |  |  236|  1.09k|#define HINT_ALIGNED_64(p) HINT_ALIGNED((p),64)
  |  |  |  |  ------------------
  |  |  |  |  |  |  231|  1.09k|#  define HINT_ALIGNED(p,n) __builtin_assume_aligned((void *)(p),(n))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  190|  1.09k|    alloc_bufs->state = (inflate_state *)HINT_ALIGNED_64((buff + state_pos));
  ------------------
  |  |  236|  1.09k|#define HINT_ALIGNED_64(p) HINT_ALIGNED((p),64)
  |  |  ------------------
  |  |  |  |  231|  1.09k|#  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|  1.09k|    return alloc_bufs;
  200|  1.09k|}
free_inflate:
  205|  1.09k|Z_INTERNAL void free_inflate(PREFIX3(stream) *strm) {
  206|  1.09k|    struct inflate_state *state = (struct inflate_state *)strm->state;
  207|       |
  208|  1.09k|    if (state->alloc_bufs != NULL) {
  ------------------
  |  Branch (208:9): [True: 1.09k, False: 0]
  ------------------
  209|  1.09k|        inflate_allocs *alloc_bufs = state->alloc_bufs;
  210|  1.09k|        alloc_bufs->zfree(strm->opaque, alloc_bufs->buf_start);
  211|       |        strm->state = NULL;
  212|  1.09k|    }
  213|  1.09k|}
zng_inflateInit2:
  219|  1.09k|int32_t ZNG_CONDEXPORT PREFIX(inflateInit2)(PREFIX3(stream) *strm, int32_t windowBits) {
  220|  1.09k|    struct inflate_state *state;
  221|  1.09k|    int32_t ret;
  222|       |
  223|       |    /* Initialize functable */
  224|  1.09k|    FUNCTABLE_INIT;
  ------------------
  |  |   48|  1.09k|#  define FUNCTABLE_INIT if (functable.force_init()) {return Z_VERSION_ERROR;}
  |  |  ------------------
  |  |  |  |  188|      0|#define Z_VERSION_ERROR (-6)
  |  |  ------------------
  |  |  |  Branch (48:30): [True: 0, False: 1.09k]
  |  |  ------------------
  ------------------
  225|       |
  226|  1.09k|    if (strm == NULL)
  ------------------
  |  Branch (226:9): [True: 0, False: 1.09k]
  ------------------
  227|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  228|  1.09k|    strm->msg = NULL;                   /* in case we return an error */
  229|  1.09k|    if (strm->zalloc == NULL) {
  ------------------
  |  Branch (229:9): [True: 1.09k, False: 0]
  ------------------
  230|  1.09k|        strm->zalloc = PREFIX(zcalloc);
  ------------------
  |  |   97|  1.09k|#  define PREFIX(x) zng_ ## x
  ------------------
  231|  1.09k|        strm->opaque = NULL;
  232|  1.09k|    }
  233|  1.09k|    if (strm->zfree == NULL)
  ------------------
  |  Branch (233:9): [True: 1.09k, False: 0]
  ------------------
  234|  1.09k|        strm->zfree = PREFIX(zcfree);
  ------------------
  |  |   97|  1.09k|#  define PREFIX(x) zng_ ## x
  ------------------
  235|       |
  236|  1.09k|    inflate_allocs *alloc_bufs = alloc_inflate(strm);
  237|  1.09k|    if (alloc_bufs == NULL)
  ------------------
  |  Branch (237:9): [True: 0, False: 1.09k]
  ------------------
  238|      0|        return Z_MEM_ERROR;
  ------------------
  |  |  186|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  239|       |
  240|  1.09k|    state = alloc_bufs->state;
  241|  1.09k|    state->window = alloc_bufs->window;
  242|  1.09k|    state->alloc_bufs = alloc_bufs;
  243|  1.09k|    state->wbufsize = INFLATE_ADJUST_WINDOW_SIZE((1 << MAX_WBITS) + 64);
  ------------------
  |  |   23|  1.09k|#  define INFLATE_ADJUST_WINDOW_SIZE(n) (n)
  ------------------
  244|  1.09k|    Tracev((stderr, "inflate: allocated\n"));
  245|       |
  246|  1.09k|    strm->state = (struct internal_state *)state;
  247|  1.09k|    state->strm = strm;
  248|  1.09k|    state->mode = HEAD;     /* to pass state test in inflateReset2() */
  249|  1.09k|    ret = PREFIX(inflateReset2)(strm, windowBits);
  ------------------
  |  |   97|  1.09k|#  define PREFIX(x) zng_ ## x
  ------------------
  250|  1.09k|    if (ret != Z_OK) {
  ------------------
  |  |  180|  1.09k|#define Z_OK            0
  ------------------
  |  Branch (250:9): [True: 0, False: 1.09k]
  ------------------
  251|      0|        free_inflate(strm);
  252|      0|    }
  253|  1.09k|    return ret;
  254|  1.09k|}
zng_inflateInit:
  257|  1.09k|int32_t Z_EXPORT PREFIX(inflateInit)(PREFIX3(stream) *strm) {
  258|  1.09k|    return PREFIX(inflateInit2)(strm, DEF_WBITS);
  ------------------
  |  |   97|  1.09k|#  define PREFIX(x) zng_ ## x
  ------------------
                  return PREFIX(inflateInit2)(strm, DEF_WBITS);
  ------------------
  |  |   35|  1.09k|#  define DEF_WBITS MAX_WBITS
  |  |  ------------------
  |  |  |  |   39|  1.09k|#  define MAX_WBITS   15 /* 32K LZ77 window */
  |  |  ------------------
  ------------------
  259|  1.09k|}
zng_fixedtables:
  303|  12.9k|void Z_INTERNAL PREFIX(fixedtables)(struct inflate_state *state) {
  304|  12.9k|    state->lencode = lenfix;
  305|  12.9k|    state->lenbits = 9;
  306|  12.9k|    state->distcode = distfix;
  307|  12.9k|    state->distbits = 5;
  308|  12.9k|}
zng_inflate:
  475|  1.63k|int32_t Z_EXPORT PREFIX(inflate)(PREFIX3(stream) *strm, int32_t flush) {
  476|  1.63k|    struct inflate_state *state;
  477|  1.63k|    const unsigned char *next;  /* next input */
  478|  1.63k|    unsigned char *put;         /* next output */
  479|  1.63k|    unsigned char *from;        /* where to copy match bytes from */
  480|  1.63k|    unsigned have, left;        /* available input and output */
  481|  1.63k|    uint64_t hold;              /* bit buffer */
  482|  1.63k|    unsigned bits;              /* bits in bit buffer */
  483|  1.63k|    uint32_t in, out;           /* save starting available input and output */
  484|  1.63k|    unsigned copy;              /* number of stored or match bytes to copy */
  485|  1.63k|    code here;                  /* current decoding table entry */
  486|  1.63k|    code last;                  /* parent table entry */
  487|  1.63k|    unsigned len;               /* length to copy for repeats, bits to drop */
  488|  1.63k|    int32_t ret;                /* return code */
  489|  1.63k|#ifdef GUNZIP
  490|  1.63k|    unsigned char hbuf[4];      /* buffer for gzip header crc calculation */
  491|  1.63k|#endif
  492|  1.63k|    static const uint16_t order[19] = /* permutation of code lengths */
  493|  1.63k|        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
  494|       |
  495|  1.63k|    if (inflateStateCheck(strm) || strm->next_out == NULL ||
  ------------------
  |  Branch (495:9): [True: 0, False: 1.63k]
  |  Branch (495:36): [True: 0, False: 1.63k]
  ------------------
  496|  1.63k|        (strm->next_in == NULL && strm->avail_in != 0))
  ------------------
  |  Branch (496:10): [True: 0, False: 1.63k]
  |  Branch (496:35): [True: 0, False: 0]
  ------------------
  497|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  498|       |
  499|  1.63k|    state = (struct inflate_state *)strm->state;
  500|  1.63k|    if (state->mode == TYPE)      /* skip check */
  ------------------
  |  Branch (500:9): [True: 8, False: 1.62k]
  ------------------
  501|      8|        state->mode = TYPEDO;
  502|  1.63k|    LOAD();
  ------------------
  |  |   77|  1.63k|    do { \
  |  |   78|  1.63k|        put = strm->next_out; \
  |  |   79|  1.63k|        left = strm->avail_out; \
  |  |   80|  1.63k|        next = strm->next_in; \
  |  |   81|  1.63k|        have = strm->avail_in; \
  |  |   82|  1.63k|        hold = state->hold; \
  |  |   83|  1.63k|        bits = state->bits; \
  |  |   84|  1.63k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (84:14): [Folded, False: 1.63k]
  |  |  ------------------
  ------------------
  503|  1.63k|    in = have;
  504|  1.63k|    out = left;
  505|  1.63k|    ret = Z_OK;
  ------------------
  |  |  180|  1.63k|#define Z_OK            0
  ------------------
  506|  1.63k|    for (;;)
  507|   111k|        switch (state->mode) {
  508|  1.10k|        case HEAD:
  ------------------
  |  Branch (508:9): [True: 1.10k, False: 110k]
  ------------------
  509|  1.10k|            if (state->wrap == 0) {
  ------------------
  |  Branch (509:17): [True: 0, False: 1.10k]
  ------------------
  510|      0|                state->mode = TYPEDO;
  511|      0|                break;
  512|      0|            }
  513|  1.10k|            NEEDBITS(16);
  ------------------
  |  |  107|  1.10k|    do { \
  |  |  108|  3.29k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 2.20k, False: 1.09k]
  |  |  ------------------
  |  |  109|  2.20k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  2.20k|    do { \
  |  |  |  |  387|  2.20k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 16, False: 2.18k]
  |  |  |  |  ------------------
  |  |  |  |  388|  2.20k|        have--; \
  |  |  |  |  389|  2.18k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  2.18k|        bits += 8; \
  |  |  |  |  391|  2.18k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 2.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  1.10k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 1.09k]
  |  |  ------------------
  ------------------
  514|  1.09k|#ifdef GUNZIP
  515|  1.09k|            if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */
  ------------------
  |  Branch (515:17): [True: 0, False: 1.09k]
  |  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|  1.09k|            if (state->head != NULL)
  ------------------
  |  Branch (524:17): [True: 0, False: 1.09k]
  ------------------
  525|      0|                state->head->done = -1;
  526|  1.09k|            if (!(state->wrap & 1) ||   /* check if zlib header allowed */
  ------------------
  |  Branch (526:17): [True: 0, False: 1.09k]
  ------------------
  527|       |#else
  528|       |            if (
  529|       |#endif
  530|  1.09k|                ((BITS(8) << 8) + (hold >> 8)) % 31) {
  ------------------
  |  |  114|  1.09k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  |  Branch (530:17): [True: 14, False: 1.07k]
  ------------------
  531|     14|                SET_BAD("incorrect header check");
  ------------------
  |  |  132|     14|    do { \
  |  |  133|     14|        state->mode = BAD; \
  |  |  134|     14|        strm->msg = (char *)errmsg; \
  |  |  135|     14|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 14]
  |  |  ------------------
  ------------------
  532|     14|                break;
  533|     14|            }
  534|  1.07k|            if (BITS(4) != Z_DEFLATED) {
  ------------------
  |  |  114|  1.07k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
                          if (BITS(4) != Z_DEFLATED) {
  ------------------
  |  |  212|  1.07k|#define Z_DEFLATED   8
  ------------------
  |  Branch (534:17): [True: 5, False: 1.07k]
  ------------------
  535|      5|                SET_BAD("unknown compression method");
  ------------------
  |  |  132|      5|    do { \
  |  |  133|      5|        state->mode = BAD; \
  |  |  134|      5|        strm->msg = (char *)errmsg; \
  |  |  135|      5|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 5]
  |  |  ------------------
  ------------------
  536|      5|                break;
  537|      5|            }
  538|  1.07k|            DROPBITS(4);
  ------------------
  |  |  118|  1.07k|    do { \
  |  |  119|  1.07k|        hold >>= (n); \
  |  |  120|  1.07k|        bits -= (unsigned)(n); \
  |  |  121|  1.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 1.07k]
  |  |  ------------------
  ------------------
  539|  1.07k|            len = BITS(4) + 8;
  ------------------
  |  |  114|  1.07k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  540|  1.07k|            if (state->wbits == 0)
  ------------------
  |  Branch (540:17): [True: 0, False: 1.07k]
  ------------------
  541|      0|                state->wbits = len;
  542|  1.07k|            if (len > MAX_WBITS || len > state->wbits) {
  ------------------
  |  |   39|  2.14k|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
  |  Branch (542:17): [True: 2, False: 1.06k]
  |  Branch (542:36): [True: 0, False: 1.06k]
  ------------------
  543|      2|                SET_BAD("invalid window size");
  ------------------
  |  |  132|      2|    do { \
  |  |  133|      2|        state->mode = BAD; \
  |  |  134|      2|        strm->msg = (char *)errmsg; \
  |  |  135|      2|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
  544|      2|                break;
  545|      2|            }
  546|       |#ifdef INFLATE_STRICT
  547|       |            state->dmax = 1U << len;
  548|       |#endif
  549|  1.06k|            state->flags = 0;               /* indicate zlib header */
  550|  1.06k|            Tracev((stderr, "inflate:   zlib header ok\n"));
  551|  1.06k|            strm->adler = state->check = ADLER32_INITIAL_VALUE;
  ------------------
  |  |   65|  1.06k|#define ADLER32_INITIAL_VALUE 1 /* initial adler-32 hash value */
  ------------------
  552|  1.06k|            state->mode = hold & 0x200 ? DICTID : TYPE;
  ------------------
  |  Branch (552:27): [True: 6, False: 1.06k]
  ------------------
  553|  1.06k|            INITBITS();
  ------------------
  |  |   99|  1.06k|    do { \
  |  |  100|  1.06k|        hold = 0; \
  |  |  101|  1.06k|        bits = 0; \
  |  |  102|  1.06k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 1.06k]
  |  |  ------------------
  ------------------
  554|  1.06k|            break;
  555|      0|#ifdef GUNZIP
  556|       |
  557|      0|        case FLAGS:
  ------------------
  |  Branch (557:9): [True: 0, False: 111k]
  ------------------
  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: 111k]
  ------------------
  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: 111k]
  ------------------
  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: 111k]
  ------------------
  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: 111k]
  ------------------
  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: 111k]
  ------------------
  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: 111k]
  ------------------
  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: 111k]
  ------------------
  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|     10|        case DICTID:
  ------------------
  |  Branch (704:9): [True: 10, False: 111k]
  ------------------
  705|     10|            NEEDBITS(32);
  ------------------
  |  |  107|     10|    do { \
  |  |  108|     24|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 22, False: 2]
  |  |  ------------------
  |  |  109|     22|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|     22|    do { \
  |  |  |  |  387|     22|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 8, False: 14]
  |  |  |  |  ------------------
  |  |  |  |  388|     22|        have--; \
  |  |  |  |  389|     14|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|     14|        bits += 8; \
  |  |  |  |  391|     14|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 14]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     10|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
  706|      2|            strm->adler = state->check = ZSWAP32((unsigned)hold);
  ------------------
  |  |  170|      2|#  define ZSWAP32(q) __builtin_bswap32(q)
  ------------------
  707|      2|            INITBITS();
  ------------------
  |  |   99|      2|    do { \
  |  |  100|      2|        hold = 0; \
  |  |  101|      2|        bits = 0; \
  |  |  102|      2|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
  708|      2|            state->mode = DICT;
  709|      2|            Z_FALLTHROUGH;
  ------------------
  |  |   45|      2|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  710|       |
  711|      2|        case DICT:
  ------------------
  |  Branch (711:9): [True: 0, False: 111k]
  ------------------
  712|      2|            if (state->havedict == 0) {
  ------------------
  |  Branch (712:17): [True: 2, False: 0]
  ------------------
  713|      2|                RESTORE();
  ------------------
  |  |   88|      2|    do { \
  |  |   89|      2|        strm->next_out = put; \
  |  |   90|      2|        strm->avail_out = left; \
  |  |   91|      2|        strm->next_in = (z_const unsigned char *)next; \
  |  |   92|      2|        strm->avail_in = have; \
  |  |   93|      2|        state->hold = hold; \
  |  |   94|      2|        state->bits = bits; \
  |  |   95|      2|    } while (0)
  |  |  ------------------
  |  |  |  Branch (95:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
  714|      2|                return Z_NEED_DICT;
  ------------------
  |  |  182|      2|#define Z_NEED_DICT     2
  ------------------
  715|      2|            }
  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|  32.5k|        case TYPE:
  ------------------
  |  Branch (720:9): [True: 32.5k, False: 78.7k]
  ------------------
  721|  32.5k|            if (flush == Z_BLOCK || flush == Z_TREES)
  ------------------
  |  |  176|  65.0k|#define Z_BLOCK         5
  ------------------
                          if (flush == Z_BLOCK || flush == Z_TREES)
  ------------------
  |  |  177|  32.5k|#define Z_TREES         6
  ------------------
  |  Branch (721:17): [True: 0, False: 32.5k]
  |  Branch (721:37): [True: 0, False: 32.5k]
  ------------------
  722|      0|                goto inf_leave;
  723|  32.5k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  32.5k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  724|       |
  725|  32.5k|        case TYPEDO:
  ------------------
  |  Branch (725:9): [True: 8, False: 111k]
  ------------------
  726|       |            /* determine and dispatch block type */
  727|  32.5k|            INFLATE_TYPEDO_HOOK(strm, flush);  /* hook for IBM Z DFLTCC */
  ------------------
  |  |   29|  32.5k|#  define INFLATE_TYPEDO_HOOK(strm, flush) do {} while (0)
  |  |  ------------------
  |  |  |  Branch (29:57): [Folded, False: 32.5k]
  |  |  ------------------
  ------------------
  728|  32.5k|            if (state->last) {
  ------------------
  |  Branch (728:17): [True: 145, False: 32.4k]
  ------------------
  729|    145|                BYTEBITS();
  ------------------
  |  |  125|    145|    do { \
  |  |  126|    145|        hold >>= bits & 7; \
  |  |  127|    145|        bits -= bits & 7; \
  |  |  128|    145|    } while (0)
  |  |  ------------------
  |  |  |  Branch (128:14): [Folded, False: 145]
  |  |  ------------------
  ------------------
  730|    145|                state->mode = CHECK;
  731|    145|                break;
  732|    145|            }
  733|  32.4k|            NEEDBITS(3);
  ------------------
  |  |  107|  32.4k|    do { \
  |  |  108|  54.0k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 21.7k, False: 32.3k]
  |  |  ------------------
  |  |  109|  32.4k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  21.7k|    do { \
  |  |  |  |  387|  21.7k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 16, False: 21.6k]
  |  |  |  |  ------------------
  |  |  |  |  388|  21.7k|        have--; \
  |  |  |  |  389|  21.6k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  21.6k|        bits += 8; \
  |  |  |  |  391|  21.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 21.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  32.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  734|  32.3k|            state->last = BITS(1);
  ------------------
  |  |  114|  32.3k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  735|  32.3k|            DROPBITS(1);
  ------------------
  |  |  118|  32.3k|    do { \
  |  |  119|  32.3k|        hold >>= (n); \
  |  |  120|  32.3k|        bits -= (unsigned)(n); \
  |  |  121|  32.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  736|  32.3k|            switch (BITS(2)) {
  ------------------
  |  |  114|  32.3k|    (hold & ((1U << (unsigned)(n)) - 1))
  |  |  ------------------
  |  |  |  Branch (114:5): [True: 32.3k, False: 0]
  |  |  ------------------
  ------------------
  737|  8.86k|            case 0:                             /* stored block */
  ------------------
  |  Branch (737:13): [True: 8.86k, False: 23.5k]
  ------------------
  738|  8.86k|                Tracev((stderr, "inflate:     stored block%s\n", state->last ? " (last)" : ""));
  739|  8.86k|                state->mode = STORED;
  740|  8.86k|                break;
  741|  12.9k|            case 1:                             /* fixed block */
  ------------------
  |  Branch (741:13): [True: 12.9k, False: 19.3k]
  ------------------
  742|  12.9k|                PREFIX(fixedtables)(state);
  ------------------
  |  |   97|  12.9k|#  define PREFIX(x) zng_ ## x
  ------------------
  743|  12.9k|                Tracev((stderr, "inflate:     fixed codes block%s\n", state->last ? " (last)" : ""));
  744|  12.9k|                state->mode = LEN_;             /* decode codes */
  745|  12.9k|                if (flush == Z_TREES) {
  ------------------
  |  |  177|  12.9k|#define Z_TREES         6
  ------------------
  |  Branch (745:21): [True: 0, False: 12.9k]
  ------------------
  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|  12.9k|                break;
  750|  12.9k|            case 2:                             /* dynamic block */
  ------------------
  |  Branch (750:13): [True: 10.5k, False: 21.8k]
  ------------------
  751|  10.5k|                Tracev((stderr, "inflate:     dynamic codes block%s\n", state->last ? " (last)" : ""));
  752|  10.5k|                state->mode = TABLE;
  753|  10.5k|                break;
  754|      5|            case 3:
  ------------------
  |  Branch (754:13): [True: 5, False: 32.3k]
  ------------------
  755|      5|                SET_BAD("invalid block type");
  ------------------
  |  |  132|      5|    do { \
  |  |  133|      5|        state->mode = BAD; \
  |  |  134|      5|        strm->msg = (char *)errmsg; \
  |  |  135|      5|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 5]
  |  |  ------------------
  ------------------
  756|  32.3k|            }
  757|  32.3k|            DROPBITS(2);
  ------------------
  |  |  118|  32.3k|    do { \
  |  |  119|  32.3k|        hold >>= (n); \
  |  |  120|  32.3k|        bits -= (unsigned)(n); \
  |  |  121|  32.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 32.3k]
  |  |  ------------------
  ------------------
  758|  32.3k|            break;
  759|       |
  760|  8.87k|        case STORED:
  ------------------
  |  Branch (760:9): [True: 8.87k, False: 102k]
  ------------------
  761|       |            /* get and verify stored block length */
  762|  8.87k|            BYTEBITS();                         /* go to byte boundary */
  ------------------
  |  |  125|  8.87k|    do { \
  |  |  126|  8.87k|        hold >>= bits & 7; \
  |  |  127|  8.87k|        bits -= bits & 7; \
  |  |  128|  8.87k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (128:14): [Folded, False: 8.87k]
  |  |  ------------------
  ------------------
  763|  8.87k|            NEEDBITS(32);
  ------------------
  |  |  107|  8.87k|    do { \
  |  |  108|  44.2k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 35.4k, False: 8.84k]
  |  |  ------------------
  |  |  109|  35.4k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  35.4k|    do { \
  |  |  |  |  387|  35.4k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 32, False: 35.3k]
  |  |  |  |  ------------------
  |  |  |  |  388|  35.4k|        have--; \
  |  |  |  |  389|  35.3k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  35.3k|        bits += 8; \
  |  |  |  |  391|  35.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 35.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  8.87k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 8.84k]
  |  |  ------------------
  ------------------
  764|  8.84k|            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
  ------------------
  |  Branch (764:17): [True: 57, False: 8.78k]
  ------------------
  765|     57|                SET_BAD("invalid stored block lengths");
  ------------------
  |  |  132|     57|    do { \
  |  |  133|     57|        state->mode = BAD; \
  |  |  134|     57|        strm->msg = (char *)errmsg; \
  |  |  135|     57|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 57]
  |  |  ------------------
  ------------------
  766|     57|                break;
  767|     57|            }
  768|  8.78k|            state->length = (uint16_t)hold;
  769|  8.78k|            Tracev((stderr, "inflate:       stored length %u\n", state->length));
  770|  8.78k|            INITBITS();
  ------------------
  |  |   99|  8.78k|    do { \
  |  |  100|  8.78k|        hold = 0; \
  |  |  101|  8.78k|        bits = 0; \
  |  |  102|  8.78k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 8.78k]
  |  |  ------------------
  ------------------
  771|  8.78k|            state->mode = COPY_;
  772|  8.78k|            if (flush == Z_TREES)
  ------------------
  |  |  177|  8.78k|#define Z_TREES         6
  ------------------
  |  Branch (772:17): [True: 0, False: 8.78k]
  ------------------
  773|      0|                goto inf_leave;
  774|  8.78k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  8.78k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  775|       |
  776|  8.78k|        case COPY_:
  ------------------
  |  Branch (776:9): [True: 0, False: 111k]
  ------------------
  777|  8.78k|            state->mode = COPY;
  778|  8.78k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  8.78k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  779|       |
  780|  9.21k|        case COPY:
  ------------------
  |  Branch (780:9): [True: 424, False: 110k]
  ------------------
  781|       |            /* copy stored block from input to output */
  782|  9.21k|            copy = state->length;
  783|  9.21k|            if (copy) {
  ------------------
  |  Branch (783:17): [True: 459, False: 8.75k]
  ------------------
  784|    459|                copy = MIN(copy, have);
  ------------------
  |  |  124|    459|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 80, False: 379]
  |  |  ------------------
  ------------------
  785|    459|                copy = MIN(copy, left);
  ------------------
  |  |  124|    459|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 37, False: 422]
  |  |  ------------------
  ------------------
  786|    459|                if (copy == 0)
  ------------------
  |  Branch (786:21): [True: 70, False: 389]
  ------------------
  787|     70|                    goto inf_leave;
  788|    389|                memcpy(put, next, copy);
  789|    389|                have -= copy;
  790|    389|                next += copy;
  791|    389|                left -= copy;
  792|    389|                put += copy;
  793|    389|                state->length -= copy;
  794|    389|                break;
  795|    459|            }
  796|  8.75k|            Tracev((stderr, "inflate:       stored end\n"));
  797|  8.75k|            state->mode = TYPE;
  798|  8.75k|            break;
  799|       |
  800|  10.5k|        case TABLE:
  ------------------
  |  Branch (800:9): [True: 10.5k, False: 100k]
  ------------------
  801|       |            /* get dynamic table entries descriptor */
  802|  10.5k|            NEEDBITS(14);
  ------------------
  |  |  107|  10.5k|    do { \
  |  |  108|  31.5k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 21.0k, False: 10.5k]
  |  |  ------------------
  |  |  109|  21.0k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  21.0k|    do { \
  |  |  |  |  387|  21.0k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 14, False: 21.0k]
  |  |  |  |  ------------------
  |  |  |  |  388|  21.0k|        have--; \
  |  |  |  |  389|  21.0k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  21.0k|        bits += 8; \
  |  |  |  |  391|  21.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 21.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  10.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 10.5k]
  |  |  ------------------
  ------------------
  803|  10.5k|            state->nlen = BITS(5) + 257;
  ------------------
  |  |  114|  10.5k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  804|  10.5k|            DROPBITS(5);
  ------------------
  |  |  118|  10.5k|    do { \
  |  |  119|  10.5k|        hold >>= (n); \
  |  |  120|  10.5k|        bits -= (unsigned)(n); \
  |  |  121|  10.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 10.5k]
  |  |  ------------------
  ------------------
  805|  10.5k|            state->ndist = BITS(5) + 1;
  ------------------
  |  |  114|  10.5k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  806|  10.5k|            DROPBITS(5);
  ------------------
  |  |  118|  10.5k|    do { \
  |  |  119|  10.5k|        hold >>= (n); \
  |  |  120|  10.5k|        bits -= (unsigned)(n); \
  |  |  121|  10.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 10.5k]
  |  |  ------------------
  ------------------
  807|  10.5k|            state->ncode = BITS(4) + 4;
  ------------------
  |  |  114|  10.5k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  808|  10.5k|            DROPBITS(4);
  ------------------
  |  |  118|  10.5k|    do { \
  |  |  119|  10.5k|        hold >>= (n); \
  |  |  120|  10.5k|        bits -= (unsigned)(n); \
  |  |  121|  10.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 10.5k]
  |  |  ------------------
  ------------------
  809|  10.5k|#ifndef PKZIP_BUG_WORKAROUND
  810|  10.5k|            if (state->nlen > 286 || state->ndist > 30) {
  ------------------
  |  Branch (810:17): [True: 3, False: 10.5k]
  |  Branch (810:38): [True: 2, False: 10.5k]
  ------------------
  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|  10.5k|#endif
  815|  10.5k|            Tracev((stderr, "inflate:       table sizes ok\n"));
  816|  10.5k|            state->have = 0;
  817|  10.5k|            state->mode = LENLENS;
  818|  10.5k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  10.5k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  819|       |
  820|  10.5k|        case LENLENS:
  ------------------
  |  Branch (820:9): [True: 8, False: 111k]
  ------------------
  821|       |            /* get code length code lengths (not a typo) */
  822|   184k|            while (state->have < state->ncode) {
  ------------------
  |  Branch (822:20): [True: 174k, False: 10.5k]
  ------------------
  823|   174k|                NEEDBITS(3);
  ------------------
  |  |  107|   174k|    do { \
  |  |  108|   232k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 57.7k, False: 174k]
  |  |  ------------------
  |  |  109|   174k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  57.7k|    do { \
  |  |  |  |  387|  57.7k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 16, False: 57.7k]
  |  |  |  |  ------------------
  |  |  |  |  388|  57.7k|        have--; \
  |  |  |  |  389|  57.7k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  57.7k|        bits += 8; \
  |  |  |  |  391|  57.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 57.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   174k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 174k]
  |  |  ------------------
  ------------------
  824|   174k|                state->lens[order[state->have++]] = (uint16_t)BITS(3);
  ------------------
  |  |  114|   174k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  825|   174k|                DROPBITS(3);
  ------------------
  |  |  118|   174k|    do { \
  |  |  119|   174k|        hold >>= (n); \
  |  |  120|   174k|        bits -= (unsigned)(n); \
  |  |  121|   174k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 174k]
  |  |  ------------------
  ------------------
  826|   174k|            }
  827|  36.0k|            while (state->have < 19)
  ------------------
  |  Branch (827:20): [True: 25.5k, False: 10.5k]
  ------------------
  828|  25.5k|                state->lens[order[state->have++]] = 0;
  829|  10.5k|            state->next = state->codes;
  830|  10.5k|            state->lencode = (const code *)(state->next);
  831|  10.5k|            state->lenbits = 7;
  832|  10.5k|            ret = zng_inflate_table(CODES, state->lens, 19, &(state->next), &(state->lenbits), state->work);
  833|  10.5k|            if (ret) {
  ------------------
  |  Branch (833:17): [True: 62, False: 10.4k]
  ------------------
  834|     62|                SET_BAD("invalid code lengths set");
  ------------------
  |  |  132|     62|    do { \
  |  |  133|     62|        state->mode = BAD; \
  |  |  134|     62|        strm->msg = (char *)errmsg; \
  |  |  135|     62|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 62]
  |  |  ------------------
  ------------------
  835|     62|                break;
  836|     62|            }
  837|  10.4k|            Tracev((stderr, "inflate:       code lengths ok\n"));
  838|  10.4k|            state->have = 0;
  839|  10.4k|            state->mode = CODELENS;
  840|  10.4k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  10.4k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  841|       |
  842|  10.5k|        case CODELENS:
  ------------------
  |  Branch (842:9): [True: 103, False: 111k]
  ------------------
  843|       |            /* get length and distance code code lengths */
  844|  1.45M|            while (state->have < state->nlen + state->ndist) {
  ------------------
  |  Branch (844:20): [True: 1.44M, False: 10.3k]
  ------------------
  845|  1.77M|                for (;;) {
  846|  1.77M|                    here = state->lencode[BITS(state->lenbits)];
  ------------------
  |  |  114|  1.77M|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  847|  1.77M|                    if (here.bits <= bits) break;
  ------------------
  |  Branch (847:25): [True: 1.44M, False: 334k]
  ------------------
  848|   334k|                    PULLBYTE();
  ------------------
  |  |  386|   334k|    do { \
  |  |  387|   334k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 124, False: 334k]
  |  |  ------------------
  |  |  388|   334k|        have--; \
  |  |  389|   334k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|   334k|        bits += 8; \
  |  |  391|   334k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 334k]
  |  |  ------------------
  ------------------
  849|   334k|                }
  850|  1.44M|                if (here.val < 16) {
  ------------------
  |  Branch (850:21): [True: 1.31M, False: 127k]
  ------------------
  851|  1.31M|                    DROPBITS(here.bits);
  ------------------
  |  |  118|  1.31M|    do { \
  |  |  119|  1.31M|        hold >>= (n); \
  |  |  120|  1.31M|        bits -= (unsigned)(n); \
  |  |  121|  1.31M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 1.31M]
  |  |  ------------------
  ------------------
  852|  1.31M|                    state->lens[state->have++] = here.val;
  853|  1.31M|                } else {
  854|   127k|                    if (here.val == 16) {
  ------------------
  |  Branch (854:25): [True: 30.9k, False: 96.8k]
  ------------------
  855|  30.9k|                        NEEDBITS(here.bits + 2);
  ------------------
  |  |  107|  30.9k|    do { \
  |  |  108|  37.6k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 6.76k, False: 30.8k]
  |  |  ------------------
  |  |  109|  30.9k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  6.76k|    do { \
  |  |  |  |  387|  6.76k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 18, False: 6.74k]
  |  |  |  |  ------------------
  |  |  |  |  388|  6.76k|        have--; \
  |  |  |  |  389|  6.74k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  6.74k|        bits += 8; \
  |  |  |  |  391|  6.74k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 6.74k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  30.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 30.8k]
  |  |  ------------------
  ------------------
  856|  30.8k|                        DROPBITS(here.bits);
  ------------------
  |  |  118|  30.8k|    do { \
  |  |  119|  30.8k|        hold >>= (n); \
  |  |  120|  30.8k|        bits -= (unsigned)(n); \
  |  |  121|  30.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 30.8k]
  |  |  ------------------
  ------------------
  857|  30.8k|                        if (state->have == 0) {
  ------------------
  |  Branch (857:29): [True: 3, False: 30.8k]
  ------------------
  858|      3|                            SET_BAD("invalid bit length repeat");
  ------------------
  |  |  132|      3|    do { \
  |  |  133|      3|        state->mode = BAD; \
  |  |  134|      3|        strm->msg = (char *)errmsg; \
  |  |  135|      3|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 3]
  |  |  ------------------
  ------------------
  859|      3|                            break;
  860|      3|                        }
  861|  30.8k|                        len = state->lens[state->have - 1];
  862|  30.8k|                        copy = 3 + BITS(2);
  ------------------
  |  |  114|  30.8k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  863|  30.8k|                        DROPBITS(2);
  ------------------
  |  |  118|  30.8k|    do { \
  |  |  119|  30.8k|        hold >>= (n); \
  |  |  120|  30.8k|        bits -= (unsigned)(n); \
  |  |  121|  30.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 30.8k]
  |  |  ------------------
  ------------------
  864|  96.8k|                    } else if (here.val == 17) {
  ------------------
  |  Branch (864:32): [True: 62.9k, False: 33.9k]
  ------------------
  865|  62.9k|                        NEEDBITS(here.bits + 3);
  ------------------
  |  |  107|  62.9k|    do { \
  |  |  108|  94.1k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 31.2k, False: 62.8k]
  |  |  ------------------
  |  |  109|  62.9k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  31.2k|    do { \
  |  |  |  |  387|  31.2k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 22, False: 31.2k]
  |  |  |  |  ------------------
  |  |  |  |  388|  31.2k|        have--; \
  |  |  |  |  389|  31.2k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  31.2k|        bits += 8; \
  |  |  |  |  391|  31.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 31.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  62.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 62.8k]
  |  |  ------------------
  ------------------
  866|  62.8k|                        DROPBITS(here.bits);
  ------------------
  |  |  118|  62.8k|    do { \
  |  |  119|  62.8k|        hold >>= (n); \
  |  |  120|  62.8k|        bits -= (unsigned)(n); \
  |  |  121|  62.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 62.8k]
  |  |  ------------------
  ------------------
  867|  62.8k|                        len = 0;
  868|  62.8k|                        copy = 3 + BITS(3);
  ------------------
  |  |  114|  62.8k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  869|  62.8k|                        DROPBITS(3);
  ------------------
  |  |  118|  62.8k|    do { \
  |  |  119|  62.8k|        hold >>= (n); \
  |  |  120|  62.8k|        bits -= (unsigned)(n); \
  |  |  121|  62.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 62.8k]
  |  |  ------------------
  ------------------
  870|  62.8k|                    } else {
  871|  33.9k|                        NEEDBITS(here.bits + 7);
  ------------------
  |  |  107|  33.9k|    do { \
  |  |  108|  67.6k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 33.8k, False: 33.8k]
  |  |  ------------------
  |  |  109|  33.9k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  33.8k|    do { \
  |  |  |  |  387|  33.8k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 42, False: 33.7k]
  |  |  |  |  ------------------
  |  |  |  |  388|  33.8k|        have--; \
  |  |  |  |  389|  33.7k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  33.7k|        bits += 8; \
  |  |  |  |  391|  33.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 33.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  33.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 33.8k]
  |  |  ------------------
  ------------------
  872|  33.8k|                        DROPBITS(here.bits);
  ------------------
  |  |  118|  33.8k|    do { \
  |  |  119|  33.8k|        hold >>= (n); \
  |  |  120|  33.8k|        bits -= (unsigned)(n); \
  |  |  121|  33.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 33.8k]
  |  |  ------------------
  ------------------
  873|  33.8k|                        len = 0;
  874|  33.8k|                        copy = 11 + BITS(7);
  ------------------
  |  |  114|  33.8k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  875|  33.8k|                        DROPBITS(7);
  ------------------
  |  |  118|  33.8k|    do { \
  |  |  119|  33.8k|        hold >>= (n); \
  |  |  120|  33.8k|        bits -= (unsigned)(n); \
  |  |  121|  33.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 33.8k]
  |  |  ------------------
  ------------------
  876|  33.8k|                    }
  877|   127k|                    if (state->have + copy > state->nlen + state->ndist) {
  ------------------
  |  Branch (877:25): [True: 19, False: 127k]
  ------------------
  878|     19|                        SET_BAD("invalid bit length repeat");
  ------------------
  |  |  132|     19|    do { \
  |  |  133|     19|        state->mode = BAD; \
  |  |  134|     19|        strm->msg = (char *)errmsg; \
  |  |  135|     19|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 19]
  |  |  ------------------
  ------------------
  879|     19|                        break;
  880|     19|                    }
  881|  1.83M|                    while (copy) {
  ------------------
  |  Branch (881:28): [True: 1.71M, False: 127k]
  ------------------
  882|  1.71M|                        --copy;
  883|  1.71M|                        state->lens[state->have++] = (uint16_t)len;
  884|  1.71M|                    }
  885|   127k|                }
  886|  1.44M|            }
  887|       |
  888|       |            /* handle error breaks in while */
  889|  10.3k|            if (state->mode == BAD)
  ------------------
  |  Branch (889:17): [True: 22, False: 10.3k]
  ------------------
  890|     22|                break;
  891|       |
  892|       |            /* check for end-of-block code (better have one) */
  893|  10.3k|            if (state->lens[256] == 0) {
  ------------------
  |  Branch (893:17): [True: 7, False: 10.3k]
  ------------------
  894|      7|                SET_BAD("invalid code -- missing end-of-block");
  ------------------
  |  |  132|      7|    do { \
  |  |  133|      7|        state->mode = BAD; \
  |  |  134|      7|        strm->msg = (char *)errmsg; \
  |  |  135|      7|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 7]
  |  |  ------------------
  ------------------
  895|      7|                break;
  896|      7|            }
  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|  10.3k|            state->next = state->codes;
  902|  10.3k|            state->lencode = (const code *)(state->next);
  903|  10.3k|            state->lenbits = 10;
  904|  10.3k|            ret = zng_inflate_table(LENS, state->lens, state->nlen, &(state->next), &(state->lenbits), state->work);
  905|  10.3k|            if (ret) {
  ------------------
  |  Branch (905:17): [True: 96, False: 10.2k]
  ------------------
  906|     96|                SET_BAD("invalid literal/lengths set");
  ------------------
  |  |  132|     96|    do { \
  |  |  133|     96|        state->mode = BAD; \
  |  |  134|     96|        strm->msg = (char *)errmsg; \
  |  |  135|     96|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 96]
  |  |  ------------------
  ------------------
  907|     96|                break;
  908|     96|            }
  909|  10.2k|            state->distcode = (const code *)(state->next);
  910|  10.2k|            state->distbits = 9;
  911|  10.2k|            ret = zng_inflate_table(DISTS, state->lens + state->nlen, state->ndist,
  912|  10.2k|                            &(state->next), &(state->distbits), state->work);
  913|  10.2k|            if (ret) {
  ------------------
  |  Branch (913:17): [True: 50, False: 10.1k]
  ------------------
  914|     50|                SET_BAD("invalid distances set");
  ------------------
  |  |  132|     50|    do { \
  |  |  133|     50|        state->mode = BAD; \
  |  |  134|     50|        strm->msg = (char *)errmsg; \
  |  |  135|     50|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 50]
  |  |  ------------------
  ------------------
  915|     50|                break;
  916|     50|            }
  917|  10.1k|            Tracev((stderr, "inflate:       codes ok\n"));
  918|  10.1k|            state->mode = LEN_;
  919|  10.1k|            if (flush == Z_TREES)
  ------------------
  |  |  177|  10.1k|#define Z_TREES         6
  ------------------
  |  Branch (919:17): [True: 0, False: 10.1k]
  ------------------
  920|      0|                goto inf_leave;
  921|  10.1k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  10.1k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  922|       |
  923|  23.1k|        case LEN_:
  ------------------
  |  Branch (923:9): [True: 12.9k, False: 98.3k]
  ------------------
  924|  23.1k|            state->mode = LEN;
  925|  23.1k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  23.1k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  926|       |
  927|  46.7k|        case LEN:
  ------------------
  |  Branch (927:9): [True: 23.6k, False: 87.7k]
  ------------------
  928|       |            /* use inflate_fast() if we have enough input and output */
  929|  46.7k|            if (have >= INFLATE_FAST_MIN_HAVE && left >= INFLATE_FAST_MIN_LEFT) {
  ------------------
  |  |  137|  93.5k|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
                          if (have >= INFLATE_FAST_MIN_HAVE && left >= INFLATE_FAST_MIN_LEFT) {
  ------------------
  |  |  138|  43.5k|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  |  Branch (929:17): [True: 43.5k, False: 3.25k]
  |  Branch (929:50): [True: 22.5k, False: 20.9k]
  ------------------
  930|  22.5k|                RESTORE();
  ------------------
  |  |   88|  22.5k|    do { \
  |  |   89|  22.5k|        strm->next_out = put; \
  |  |   90|  22.5k|        strm->avail_out = left; \
  |  |   91|  22.5k|        strm->next_in = (z_const unsigned char *)next; \
  |  |   92|  22.5k|        strm->avail_in = have; \
  |  |   93|  22.5k|        state->hold = hold; \
  |  |   94|  22.5k|        state->bits = bits; \
  |  |   95|  22.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (95:14): [Folded, False: 22.5k]
  |  |  ------------------
  ------------------
  931|  22.5k|                FUNCTABLE_CALL(inflate_fast)(strm, out);
  ------------------
  |  |   49|  22.5k|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
  932|  22.5k|                LOAD();
  ------------------
  |  |   77|  22.5k|    do { \
  |  |   78|  22.5k|        put = strm->next_out; \
  |  |   79|  22.5k|        left = strm->avail_out; \
  |  |   80|  22.5k|        next = strm->next_in; \
  |  |   81|  22.5k|        have = strm->avail_in; \
  |  |   82|  22.5k|        hold = state->hold; \
  |  |   83|  22.5k|        bits = state->bits; \
  |  |   84|  22.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (84:14): [Folded, False: 22.5k]
  |  |  ------------------
  ------------------
  933|  22.5k|                if (state->mode == TYPE)
  ------------------
  |  Branch (933:21): [True: 22.1k, False: 418]
  ------------------
  934|  22.1k|                    state->back = -1;
  935|  22.5k|                break;
  936|  22.5k|            }
  937|  24.2k|            state->back = 0;
  938|       |
  939|       |            /* get a literal, length, or end-of-block code */
  940|  39.1k|            for (;;) {
  941|  39.1k|                here = state->lencode[BITS(state->lenbits)];
  ------------------
  |  |  114|  39.1k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  942|  39.1k|                if (here.bits <= bits)
  ------------------
  |  Branch (942:21): [True: 24.0k, False: 15.1k]
  ------------------
  943|  24.0k|                    break;
  944|  15.1k|                PULLBYTE();
  ------------------
  |  |  386|  15.1k|    do { \
  |  |  387|  15.1k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 192, False: 14.9k]
  |  |  ------------------
  |  |  388|  15.1k|        have--; \
  |  |  389|  14.9k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|  14.9k|        bits += 8; \
  |  |  391|  14.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 14.9k]
  |  |  ------------------
  ------------------
  945|  15.1k|            }
  946|  24.0k|            if (here.op && (here.op & 0xf0) == 0) {
  ------------------
  |  Branch (946:17): [True: 5.41k, False: 18.6k]
  |  Branch (946:28): [True: 2.37k, False: 3.03k]
  ------------------
  947|  2.37k|                last = here;
  948|  2.93k|                for (;;) {
  949|  2.93k|                    here = state->lencode[last.val + (BITS(last.bits + last.op) >> last.bits)];
  ------------------
  |  |  114|  2.93k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  950|  2.93k|                    if ((unsigned)last.bits + (unsigned)here.bits <= bits)
  ------------------
  |  Branch (950:25): [True: 2.37k, False: 555]
  ------------------
  951|  2.37k|                        break;
  952|    555|                    PULLBYTE();
  ------------------
  |  |  386|    555|    do { \
  |  |  387|    555|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 4, False: 551]
  |  |  ------------------
  |  |  388|    555|        have--; \
  |  |  389|    551|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|    551|        bits += 8; \
  |  |  391|    551|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 551]
  |  |  ------------------
  ------------------
  953|    555|                }
  954|  2.37k|                DROPBITS(last.bits);
  ------------------
  |  |  118|  2.37k|    do { \
  |  |  119|  2.37k|        hold >>= (n); \
  |  |  120|  2.37k|        bits -= (unsigned)(n); \
  |  |  121|  2.37k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 2.37k]
  |  |  ------------------
  ------------------
  955|  2.37k|                state->back += last.bits;
  956|  2.37k|            }
  957|  24.0k|            DROPBITS(here.bits);
  ------------------
  |  |  118|  24.0k|    do { \
  |  |  119|  24.0k|        hold >>= (n); \
  |  |  120|  24.0k|        bits -= (unsigned)(n); \
  |  |  121|  24.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 24.0k]
  |  |  ------------------
  ------------------
  958|  24.0k|            state->back += here.bits;
  959|  24.0k|            state->length = here.val;
  960|       |
  961|       |            /* process literal */
  962|  24.0k|            if ((int)(here.op) == 0) {
  ------------------
  |  Branch (962:17): [True: 19.9k, False: 4.01k]
  ------------------
  963|  19.9k|                Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
  964|  19.9k|                        "inflate:         literal '%c'\n" :
  965|  19.9k|                        "inflate:         literal 0x%02x\n", here.val));
  966|  19.9k|                state->mode = LIT;
  967|  19.9k|                break;
  968|  19.9k|            }
  969|       |
  970|       |            /* process end of block */
  971|  4.01k|            if (here.op & 32) {
  ------------------
  |  Branch (971:17): [True: 570, False: 3.44k]
  ------------------
  972|    570|                Tracevv((stderr, "inflate:         end of block\n"));
  973|    570|                state->back = -1;
  974|    570|                state->mode = TYPE;
  975|    570|                break;
  976|    570|            }
  977|       |
  978|       |            /* invalid code */
  979|  3.44k|            if (here.op & 64) {
  ------------------
  |  Branch (979:17): [True: 1, False: 3.44k]
  ------------------
  980|      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]
  |  |  ------------------
  ------------------
  981|      1|                break;
  982|      1|            }
  983|       |
  984|       |            /* length code */
  985|  3.44k|            state->extra = (here.op & MAX_BITS);
  ------------------
  |  |   39|  3.44k|#define MAX_BITS 15
  ------------------
  986|  3.44k|            state->mode = LENEXT;
  987|  3.44k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  3.44k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  988|       |
  989|  3.44k|        case LENEXT:
  ------------------
  |  Branch (989:9): [True: 5, False: 111k]
  ------------------
  990|       |            /* get extra bits, if any */
  991|  3.44k|            if (state->extra) {
  ------------------
  |  Branch (991:17): [True: 848, False: 2.60k]
  ------------------
  992|    848|                NEEDBITS(state->extra);
  ------------------
  |  |  107|    848|    do { \
  |  |  108|  1.07k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 237, False: 838]
  |  |  ------------------
  |  |  109|    848|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|    237|    do { \
  |  |  |  |  387|    237|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 10, False: 227]
  |  |  |  |  ------------------
  |  |  |  |  388|    237|        have--; \
  |  |  |  |  389|    227|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|    227|        bits += 8; \
  |  |  |  |  391|    227|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 227]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    848|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 838]
  |  |  ------------------
  ------------------
  993|    838|                state->length += BITS(state->extra);
  ------------------
  |  |  114|    838|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  994|    838|                DROPBITS(state->extra);
  ------------------
  |  |  118|    838|    do { \
  |  |  119|    838|        hold >>= (n); \
  |  |  120|    838|        bits -= (unsigned)(n); \
  |  |  121|    838|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 838]
  |  |  ------------------
  ------------------
  995|    838|                state->back += state->extra;
  996|    838|            }
  997|  3.43k|            Tracevv((stderr, "inflate:         length %u\n", state->length));
  998|  3.43k|            state->was = state->length;
  999|  3.43k|            state->mode = DIST;
 1000|  3.43k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  3.43k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1001|       |
 1002|  3.45k|        case DIST:
  ------------------
  |  Branch (1002:9): [True: 12, False: 111k]
  ------------------
 1003|       |            /* get distance code */
 1004|  5.13k|            for (;;) {
 1005|  5.13k|                here = state->distcode[BITS(state->distbits)];
  ------------------
  |  |  114|  5.13k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
 1006|  5.13k|                if (here.bits <= bits)
  ------------------
  |  Branch (1006:21): [True: 3.42k, False: 1.70k]
  ------------------
 1007|  3.42k|                    break;
 1008|  1.70k|                PULLBYTE();
  ------------------
  |  |  386|  1.70k|    do { \
  |  |  387|  1.70k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 22, False: 1.68k]
  |  |  ------------------
  |  |  388|  1.70k|        have--; \
  |  |  389|  1.68k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|  1.68k|        bits += 8; \
  |  |  391|  1.68k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 1.68k]
  |  |  ------------------
  ------------------
 1009|  1.70k|            }
 1010|  3.42k|            if ((here.op & 0xf0) == 0) {
  ------------------
  |  Branch (1010:17): [True: 625, False: 2.80k]
  ------------------
 1011|    625|                last = here;
 1012|    890|                for (;;) {
 1013|    890|                    here = state->distcode[last.val + (BITS(last.bits + last.op) >> last.bits)];
  ------------------
  |  |  114|    890|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
 1014|    890|                    if ((unsigned)last.bits + (unsigned)here.bits <= bits)
  ------------------
  |  Branch (1014:25): [True: 623, False: 267]
  ------------------
 1015|    623|                        break;
 1016|    267|                    PULLBYTE();
  ------------------
  |  |  386|    267|    do { \
  |  |  387|    267|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 2, False: 265]
  |  |  ------------------
  |  |  388|    267|        have--; \
  |  |  389|    265|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|    265|        bits += 8; \
  |  |  391|    265|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 265]
  |  |  ------------------
  ------------------
 1017|    267|                }
 1018|    623|                DROPBITS(last.bits);
  ------------------
  |  |  118|    623|    do { \
  |  |  119|    623|        hold >>= (n); \
  |  |  120|    623|        bits -= (unsigned)(n); \
  |  |  121|    623|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 623]
  |  |  ------------------
  ------------------
 1019|    623|                state->back += last.bits;
 1020|    623|            }
 1021|  3.42k|            DROPBITS(here.bits);
  ------------------
  |  |  118|  3.42k|    do { \
  |  |  119|  3.42k|        hold >>= (n); \
  |  |  120|  3.42k|        bits -= (unsigned)(n); \
  |  |  121|  3.42k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 3.42k]
  |  |  ------------------
  ------------------
 1022|  3.42k|            state->back += here.bits;
 1023|  3.42k|            if (here.op & 64) {
  ------------------
  |  Branch (1023:17): [True: 9, False: 3.41k]
  ------------------
 1024|      9|                SET_BAD("invalid distance code");
  ------------------
  |  |  132|      9|    do { \
  |  |  133|      9|        state->mode = BAD; \
  |  |  134|      9|        strm->msg = (char *)errmsg; \
  |  |  135|      9|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 9]
  |  |  ------------------
  ------------------
 1025|      9|                break;
 1026|      9|            }
 1027|  3.41k|            state->offset = here.val;
 1028|  3.41k|            state->extra = (here.op & MAX_BITS);
  ------------------
  |  |   39|  3.41k|#define MAX_BITS 15
  ------------------
 1029|  3.41k|            state->mode = DISTEXT;
 1030|  3.41k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  3.41k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1031|       |
 1032|  3.42k|        case DISTEXT:
  ------------------
  |  Branch (1032:9): [True: 8, False: 111k]
  ------------------
 1033|       |            /* get distance extra bits, if any */
 1034|  3.42k|            if (state->extra) {
  ------------------
  |  Branch (1034:17): [True: 1.67k, False: 1.75k]
  ------------------
 1035|  1.67k|                NEEDBITS(state->extra);
  ------------------
  |  |  107|  1.67k|    do { \
  |  |  108|  2.29k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 638, False: 1.65k]
  |  |  ------------------
  |  |  109|  1.67k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|    638|    do { \
  |  |  |  |  387|    638|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 16, False: 622]
  |  |  |  |  ------------------
  |  |  |  |  388|    638|        have--; \
  |  |  |  |  389|    622|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|    622|        bits += 8; \
  |  |  |  |  391|    622|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 622]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  1.67k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 1.65k]
  |  |  ------------------
  ------------------
 1036|  1.65k|                state->offset += BITS(state->extra);
  ------------------
  |  |  114|  1.65k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
 1037|  1.65k|                DROPBITS(state->extra);
  ------------------
  |  |  118|  1.65k|    do { \
  |  |  119|  1.65k|        hold >>= (n); \
  |  |  120|  1.65k|        bits -= (unsigned)(n); \
  |  |  121|  1.65k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 1.65k]
  |  |  ------------------
  ------------------
 1038|  1.65k|                state->back += state->extra;
 1039|  1.65k|            }
 1040|       |#ifdef INFLATE_STRICT
 1041|       |            if (state->offset > state->dmax) {
 1042|       |                SET_BAD("invalid distance too far back");
 1043|       |                break;
 1044|       |            }
 1045|       |#endif
 1046|  3.41k|            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
 1047|  3.41k|            state->mode = MATCH;
 1048|  3.41k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  3.41k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1049|       |
 1050|  3.72k|        case MATCH:
  ------------------
  |  Branch (1050:9): [True: 317, False: 111k]
  ------------------
 1051|       |            /* copy match from window to output */
 1052|  3.72k|            if (left == 0)
  ------------------
  |  Branch (1052:17): [True: 322, False: 3.40k]
  ------------------
 1053|    322|                goto inf_leave;
 1054|  3.40k|            copy = out - left;
 1055|  3.40k|            if (state->offset > copy) {         /* copy from window */
  ------------------
  |  Branch (1055:17): [True: 66, False: 3.33k]
  ------------------
 1056|     66|                copy = state->offset - copy;
 1057|     66|                if (copy > state->whave) {
  ------------------
  |  Branch (1057:21): [True: 66, 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|     66|                    SET_BAD("invalid distance too far back");
  ------------------
  |  |  132|     66|    do { \
  |  |  133|     66|        state->mode = BAD; \
  |  |  134|     66|        strm->msg = (char *)errmsg; \
  |  |  135|     66|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 66]
  |  |  ------------------
  ------------------
 1076|     66|#endif
 1077|     66|                    break;
 1078|     66|                }
 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|  3.33k|            } else {
 1090|  3.33k|                copy = MIN(state->length, left);
  ------------------
  |  |  124|  3.33k|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 156, False: 3.18k]
  |  |  ------------------
  ------------------
 1091|       |
 1092|  3.33k|                put = FUNCTABLE_CALL(chunkmemset_safe)(put, put - state->offset, copy, left);
  ------------------
  |  |   49|  3.33k|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
 1093|  3.33k|            }
 1094|  3.33k|            left -= copy;
 1095|  3.33k|            state->length -= copy;
 1096|  3.33k|            if (state->length == 0)
  ------------------
  |  Branch (1096:17): [True: 3.18k, False: 156]
  ------------------
 1097|  3.18k|                state->mode = LEN;
 1098|  3.33k|            break;
 1099|       |
 1100|  20.0k|        case LIT:
  ------------------
  |  Branch (1100:9): [True: 20.0k, False: 91.2k]
  ------------------
 1101|  20.0k|            if (left == 0)
  ------------------
  |  Branch (1101:17): [True: 96, False: 19.9k]
  ------------------
 1102|     96|                goto inf_leave;
 1103|  19.9k|            *put++ = (unsigned char)(state->length);
 1104|  19.9k|            left--;
 1105|  19.9k|            state->mode = LEN;
 1106|  19.9k|            break;
 1107|       |
 1108|    156|        case CHECK:
  ------------------
  |  Branch (1108:9): [True: 156, False: 111k]
  ------------------
 1109|    156|            if (state->wrap) {
  ------------------
  |  Branch (1109:17): [True: 156, False: 0]
  ------------------
 1110|    156|                NEEDBITS(32);
  ------------------
  |  |  107|    156|    do { \
  |  |  108|    705|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 571, False: 134]
  |  |  ------------------
  |  |  109|    571|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|    571|    do { \
  |  |  |  |  387|    571|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 22, False: 549]
  |  |  |  |  ------------------
  |  |  |  |  388|    571|        have--; \
  |  |  |  |  389|    549|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|    549|        bits += 8; \
  |  |  |  |  391|    549|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 549]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    156|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 134]
  |  |  ------------------
  ------------------
 1111|    134|                out -= left;
 1112|    134|                strm->total_out += out;
 1113|    134|                state->total += out;
 1114|       |
 1115|       |                /* compute crc32 checksum if not in raw mode */
 1116|    134|                if (INFLATE_NEED_CHECKSUM(strm) && state->wrap & 4) {
  ------------------
  |  |   31|    268|#  define INFLATE_NEED_CHECKSUM(strm) 1
  |  |  ------------------
  |  |  |  Branch (31:39): [True: 134, Folded]
  |  |  ------------------
  ------------------
  |  Branch (1116:52): [True: 134, False: 0]
  ------------------
 1117|    134|                    if (out) {
  ------------------
  |  Branch (1117:25): [True: 90, False: 44]
  ------------------
 1118|     90|                        inf_chksum(strm, put - out, out);
 1119|     90|                    }
 1120|    134|#ifdef GUNZIP
 1121|    134|                    if (state->flags)
  ------------------
  |  Branch (1121:25): [True: 0, False: 134]
  ------------------
 1122|      0|                        strm->adler = state->check = FUNCTABLE_CALL(crc32_fold_final)(&state->crc_fold);
  ------------------
  |  |   49|      0|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
 1123|    134|#endif
 1124|    134|                }
 1125|    134|                out = left;
 1126|    134|                if ((state->wrap & 4) && (
  ------------------
  |  Branch (1126:21): [True: 134, False: 0]
  |  Branch (1126:42): [True: 132, False: 2]
  ------------------
 1127|    134|#ifdef GUNZIP
 1128|    134|                     state->flags ? hold :
  ------------------
  |  Branch (1128:22): [True: 0, False: 134]
  ------------------
 1129|    134|#endif
 1130|    134|                     ZSWAP32((unsigned)hold)) != state->check) {
  ------------------
  |  |  170|    134|#  define ZSWAP32(q) __builtin_bswap32(q)
  ------------------
 1131|    132|                    SET_BAD("incorrect data check");
  ------------------
  |  |  132|    132|    do { \
  |  |  133|    132|        state->mode = BAD; \
  |  |  134|    132|        strm->msg = (char *)errmsg; \
  |  |  135|    132|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 132]
  |  |  ------------------
  ------------------
 1132|    132|                    break;
 1133|    132|                }
 1134|      2|                INITBITS();
  ------------------
  |  |   99|      2|    do { \
  |  |  100|      2|        hold = 0; \
  |  |  101|      2|        bits = 0; \
  |  |  102|      2|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
 1135|      2|                Tracev((stderr, "inflate:   check matches trailer\n"));
 1136|      2|            }
 1137|      2|#ifdef GUNZIP
 1138|      2|            state->mode = LENGTH;
 1139|      2|            Z_FALLTHROUGH;
  ------------------
  |  |   45|      2|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1140|       |
 1141|      2|        case LENGTH:
  ------------------
  |  Branch (1141:9): [True: 0, False: 111k]
  ------------------
 1142|      2|            if (state->wrap && state->flags) {
  ------------------
  |  Branch (1142:17): [True: 2, False: 0]
  |  Branch (1142:32): [True: 0, False: 2]
  ------------------
 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|      2|#endif
 1152|      2|            state->mode = DONE;
 1153|      2|            Z_FALLTHROUGH;
  ------------------
  |  |   45|      2|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1154|       |
 1155|      2|        case DONE:
  ------------------
  |  Branch (1155:9): [True: 0, False: 111k]
  ------------------
 1156|       |            /* inflate stream terminated properly */
 1157|      2|            ret = Z_STREAM_END;
  ------------------
  |  |  181|      2|#define Z_STREAM_END    1
  ------------------
 1158|      2|            goto inf_leave;
 1159|       |
 1160|    562|        case BAD:
  ------------------
  |  Branch (1160:9): [True: 562, False: 110k]
  ------------------
 1161|    562|            ret = Z_DATA_ERROR;
  ------------------
  |  |  185|    562|#define Z_DATA_ERROR   (-3)
  ------------------
 1162|    562|            goto inf_leave;
 1163|       |
 1164|      0|        case SYNC:
  ------------------
  |  Branch (1164:9): [True: 0, False: 111k]
  ------------------
 1165|       |
 1166|      0|        default:                 /* can't happen, but makes compilers happy */
  ------------------
  |  Branch (1166:9): [True: 0, False: 111k]
  ------------------
 1167|      0|            return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1168|   111k|        }
 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|  1.62k|  inf_leave:
 1176|  1.62k|    RESTORE();
  ------------------
  |  |   88|  1.62k|    do { \
  |  |   89|  1.62k|        strm->next_out = put; \
  |  |   90|  1.62k|        strm->avail_out = left; \
  |  |   91|  1.62k|        strm->next_in = (z_const unsigned char *)next; \
  |  |   92|  1.62k|        strm->avail_in = have; \
  |  |   93|  1.62k|        state->hold = hold; \
  |  |   94|  1.62k|        state->bits = bits; \
  |  |   95|  1.62k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (95:14): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1177|  1.62k|    uint32_t check_bytes = out - strm->avail_out;
 1178|  1.62k|    if (INFLATE_NEED_UPDATEWINDOW(strm) &&
  ------------------
  |  |   33|  3.25k|#  define INFLATE_NEED_UPDATEWINDOW(strm) 1
  |  |  ------------------
  |  |  |  Branch (33:43): [True: 1.62k, Folded]
  |  |  ------------------
  ------------------
 1179|  1.62k|            (state->wsize || (out != strm->avail_out && state->mode < BAD &&
  ------------------
  |  Branch (1179:14): [True: 398, False: 1.23k]
  |  Branch (1179:31): [True: 584, False: 646]
  |  Branch (1179:57): [True: 398, False: 186]
  ------------------
 1180|    796|                 (state->mode < CHECK || flush != Z_FINISH)))) {
  ------------------
  |  |  175|      9|#define Z_FINISH        4
  ------------------
  |  Branch (1180:19): [True: 389, False: 9]
  |  Branch (1180:42): [True: 9, False: 0]
  ------------------
 1181|       |        /* update sliding window with respective checksum if not in "raw" mode */
 1182|    796|        updatewindow(strm, strm->next_out, check_bytes, state->wrap & 4);
 1183|    796|    }
 1184|  1.62k|    in -= strm->avail_in;
 1185|  1.62k|    out -= strm->avail_out;
 1186|  1.62k|    strm->total_in += in;
 1187|  1.62k|    strm->total_out += out;
 1188|  1.62k|    state->total += out;
 1189|       |
 1190|  1.62k|    strm->data_type = (int)state->bits + (state->last ? 64 : 0) +
  ------------------
  |  Branch (1190:43): [True: 565, False: 1.06k]
  ------------------
 1191|  1.62k|                      (state->mode == TYPE ? 128 : 0) + (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
  ------------------
  |  Branch (1191:24): [True: 8, False: 1.62k]
  |  Branch (1191:58): [True: 0, False: 1.62k]
  |  Branch (1191:81): [True: 0, False: 1.62k]
  ------------------
 1192|  1.62k|    if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) {
  ------------------
  |  |  175|  1.09k|#define Z_FINISH        4
  ------------------
                  if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) {
  ------------------
  |  |  180|    532|#define Z_OK            0
  ------------------
  |  Branch (1192:11): [True: 532, False: 1.09k]
  |  Branch (1192:22): [True: 532, False: 0]
  |  Branch (1192:35): [True: 0, False: 1.09k]
  |  Branch (1192:57): [True: 532, False: 0]
  ------------------
 1193|       |        /* when no sliding window is used, hash the output bytes if no CHECK state */
 1194|    532|        if (INFLATE_NEED_CHECKSUM(strm) && !state->wsize && flush == Z_FINISH) {
  ------------------
  |  |   31|  1.06k|#  define INFLATE_NEED_CHECKSUM(strm) 1
  |  |  ------------------
  |  |  |  Branch (31:39): [True: 532, Folded]
  |  |  ------------------
  ------------------
                      if (INFLATE_NEED_CHECKSUM(strm) && !state->wsize && flush == Z_FINISH) {
  ------------------
  |  |  175|    134|#define Z_FINISH        4
  ------------------
  |  Branch (1194:44): [True: 134, False: 398]
  |  Branch (1194:61): [True: 0, False: 134]
  ------------------
 1195|      0|            inf_chksum(strm, put - check_bytes, check_bytes);
 1196|      0|        }
 1197|    532|        ret = Z_BUF_ERROR;
  ------------------
  |  |  187|    532|#define Z_BUF_ERROR    (-5)
  ------------------
 1198|    532|    }
 1199|  1.62k|    return ret;
 1200|  1.63k|}
zng_inflateEnd:
 1202|  1.09k|int32_t Z_EXPORT PREFIX(inflateEnd)(PREFIX3(stream) *strm) {
 1203|  1.09k|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (1203:9): [True: 0, False: 1.09k]
  ------------------
 1204|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1205|       |
 1206|       |    /* Free allocated buffers */
 1207|  1.09k|    free_inflate(strm);
 1208|       |
 1209|  1.09k|    Tracev((stderr, "inflate: end\n"));
 1210|  1.09k|    return Z_OK;
  ------------------
  |  |  180|  1.09k|#define Z_OK            0
  ------------------
 1211|  1.09k|}
inflate.c:inflateStateCheck:
   51|  6.02k|static int inflateStateCheck(PREFIX3(stream) *strm) {
   52|  6.02k|    struct inflate_state *state;
   53|  6.02k|    if (strm == NULL || strm->zalloc == NULL || strm->zfree == NULL)
  ------------------
  |  Branch (53:9): [True: 0, False: 6.02k]
  |  Branch (53:25): [True: 0, False: 6.02k]
  |  Branch (53:49): [True: 0, False: 6.02k]
  ------------------
   54|      0|        return 1;
   55|  6.02k|    state = (struct inflate_state *)strm->state;
   56|  6.02k|    if (state == NULL || state->alloc_bufs == NULL || state->strm != strm || state->mode < HEAD || state->mode > SYNC)
  ------------------
  |  Branch (56:9): [True: 0, False: 6.02k]
  |  Branch (56:26): [True: 0, False: 6.02k]
  |  Branch (56:55): [True: 0, False: 6.02k]
  |  Branch (56:78): [True: 0, False: 6.02k]
  |  Branch (56:100): [True: 0, False: 6.02k]
  ------------------
   57|      0|        return 1;
   58|  6.02k|    return 0;
   59|  6.02k|}
inflate.c:inf_chksum:
   39|    131|static inline void inf_chksum(PREFIX3(stream) *strm, const uint8_t *src, uint32_t len) {
   40|    131|    struct inflate_state *state = (struct inflate_state*)strm->state;
   41|    131|#ifdef GUNZIP
   42|    131|    if (state->flags) {
  ------------------
  |  Branch (42:9): [True: 0, False: 131]
  ------------------
   43|      0|        FUNCTABLE_CALL(crc32_fold)(&state->crc_fold, src, len, 0);
  ------------------
  |  |   49|      0|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
   44|      0|    } else
   45|    131|#endif
   46|    131|    {
   47|    131|        strm->adler = state->check = FUNCTABLE_CALL(adler32)(state->check, src, len);
  ------------------
  |  |   49|    131|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
   48|    131|    }
   49|    131|}
inflate.c:updatewindow:
  324|    796|static void updatewindow(PREFIX3(stream) *strm, const uint8_t *end, uint32_t len, int32_t cksum) {
  325|    796|    struct inflate_state *state;
  326|    796|    uint32_t dist;
  327|       |
  328|    796|    state = (struct inflate_state *)strm->state;
  329|       |
  330|       |    /* if window not in use yet, initialize */
  331|    796|    if (state->wsize == 0)
  ------------------
  |  Branch (331:9): [True: 398, False: 398]
  ------------------
  332|    398|        state->wsize = 1U << state->wbits;
  333|       |
  334|       |    /* len state->wsize or less output bytes into the circular window */
  335|    796|    if (len >= state->wsize) {
  ------------------
  |  Branch (335:9): [True: 42, False: 754]
  ------------------
  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|     42|        if (INFLATE_NEED_CHECKSUM(strm) && cksum) {
  ------------------
  |  |   31|     84|#  define INFLATE_NEED_CHECKSUM(strm) 1
  |  |  ------------------
  |  |  |  Branch (31:39): [True: 42, Folded]
  |  |  ------------------
  ------------------
  |  Branch (338:44): [True: 42, False: 0]
  ------------------
  339|       |            /* We have to split the checksum over non-copied and copied bytes */
  340|     42|            if (len > state->wsize)
  ------------------
  |  Branch (340:17): [True: 41, False: 1]
  ------------------
  341|     41|                inf_chksum(strm, end - len, len - state->wsize);
  342|     42|            inf_chksum_cpy(strm, state->window, end - state->wsize, state->wsize);
  343|     42|        } else {
  344|      0|            memcpy(state->window, end - state->wsize, state->wsize);
  345|      0|        }
  346|       |
  347|     42|        state->wnext = 0;
  348|     42|        state->whave = state->wsize;
  349|    754|    } else {
  350|    754|        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|    754|        dist = MIN(dist, len);
  ------------------
  |  |  124|    754|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 754, False: 0]
  |  |  ------------------
  ------------------
  354|    754|        if (INFLATE_NEED_CHECKSUM(strm) && cksum) {
  ------------------
  |  |   31|  1.50k|#  define INFLATE_NEED_CHECKSUM(strm) 1
  |  |  ------------------
  |  |  |  Branch (31:39): [True: 754, Folded]
  |  |  ------------------
  ------------------
  |  Branch (354:44): [True: 754, False: 0]
  ------------------
  355|    754|            inf_chksum_cpy(strm, state->window + state->wnext, end - len, dist);
  356|    754|        } else {
  357|      0|            memcpy(state->window + state->wnext, end - len, dist);
  358|      0|        }
  359|    754|        len -= dist;
  360|    754|        if (len) {
  ------------------
  |  Branch (360:13): [True: 0, False: 754]
  ------------------
  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|    754|        } else {
  370|    754|            state->wnext += dist;
  371|    754|            if (state->wnext == state->wsize)
  ------------------
  |  Branch (371:17): [True: 0, False: 754]
  ------------------
  372|      0|                state->wnext = 0;
  373|    754|            if (state->whave < state->wsize)
  ------------------
  |  Branch (373:17): [True: 712, False: 42]
  ------------------
  374|    712|                state->whave += dist;
  375|    754|        }
  376|    754|    }
  377|    796|}
inflate.c:inf_chksum_cpy:
   26|    796|                           const uint8_t *src, uint32_t copy) {
   27|    796|    if (!copy) return;
  ------------------
  |  Branch (27:9): [True: 398, False: 398]
  ------------------
   28|    398|    struct inflate_state *state = (struct inflate_state*)strm->state;
   29|    398|#ifdef GUNZIP
   30|    398|    if (state->flags) {
  ------------------
  |  Branch (30:9): [True: 0, False: 398]
  ------------------
   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|    398|#endif
   34|    398|    {
   35|    398|        strm->adler = state->check = FUNCTABLE_CALL(adler32_fold_copy)(state->check, dst, src, copy);
  ------------------
  |  |   49|    398|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
   36|    398|    }
   37|    398|}

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

zng_inflate_table:
   31|  31.0k|                                code * *table, unsigned *bits, uint16_t *work) {
   32|  31.0k|    unsigned len;               /* a code's length in bits */
   33|  31.0k|    unsigned sym;               /* index of code symbols */
   34|  31.0k|    unsigned min, max;          /* minimum and maximum code lengths */
   35|  31.0k|    unsigned root;              /* number of index bits for root table */
   36|  31.0k|    unsigned curr;              /* number of index bits for current table */
   37|  31.0k|    unsigned drop;              /* code bits to drop for sub-table */
   38|  31.0k|    int left;                   /* number of prefix codes available */
   39|  31.0k|    unsigned used;              /* code entries in table used */
   40|  31.0k|    unsigned huff;              /* Huffman code */
   41|  31.0k|    unsigned incr;              /* for incrementing code, index */
   42|  31.0k|    unsigned fill;              /* index for replicating entries */
   43|  31.0k|    unsigned low;               /* low bits for current root entry */
   44|  31.0k|    unsigned mask;              /* mask for low root bits */
   45|  31.0k|    code here;                  /* table entry for duplication */
   46|  31.0k|    code *next;                 /* next available space in table */
   47|  31.0k|    const uint16_t *base;       /* base value table to use */
   48|  31.0k|    const uint16_t *extra;      /* extra bits table to use */
   49|  31.0k|    unsigned match;             /* use base and extra for symbol >= match */
   50|  31.0k|    uint16_t count[MAX_BITS+1];  /* number of codes of each length */
   51|  31.0k|    uint16_t offs[MAX_BITS+1];   /* offsets in table for each length */
   52|  31.0k|    static const uint16_t lbase[31] = { /* Length codes 257..285 base */
   53|  31.0k|        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
   54|  31.0k|        35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
   55|  31.0k|    static const uint16_t lext[31] = { /* Length codes 257..285 extra */
   56|  31.0k|        16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
   57|  31.0k|        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 203, 77};
   58|  31.0k|    static const uint16_t dbase[32] = { /* Distance codes 0..29 base */
   59|  31.0k|        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
   60|  31.0k|        257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
   61|  31.0k|        8193, 12289, 16385, 24577, 0, 0};
   62|  31.0k|    static const uint16_t dext[32] = { /* Distance codes 0..29 extra */
   63|  31.0k|        16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
   64|  31.0k|        23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
   65|  31.0k|        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|   527k|    for (len = 0; len <= MAX_BITS; len++)
  ------------------
  |  |   39|   527k|#define MAX_BITS 15
  ------------------
  |  Branch (99:19): [True: 496k, False: 31.0k]
  ------------------
  100|   496k|        count[len] = 0;
  101|  3.23M|    for (sym = 0; sym < codes; sym++)
  ------------------
  |  Branch (101:19): [True: 3.20M, False: 31.0k]
  ------------------
  102|  3.20M|        count[lens[sym]]++;
  103|       |
  104|       |    /* bound code lengths, force root to be within code lengths */
  105|  31.0k|    root = *bits;
  106|   258k|    for (max = MAX_BITS; max >= 1; max--)
  ------------------
  |  |   39|  31.0k|#define MAX_BITS 15
  ------------------
  |  Branch (106:26): [True: 256k, False: 1.58k]
  ------------------
  107|   256k|        if (count[max] != 0) break;
  ------------------
  |  Branch (107:13): [True: 29.4k, False: 227k]
  ------------------
  108|  31.0k|    root = MIN(root, max);
  ------------------
  |  |  124|  31.0k|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 9.62k, False: 21.4k]
  |  |  ------------------
  ------------------
  109|  31.0k|    if (UNLIKELY(max == 0)) {           /* no symbols to code at all */
  ------------------
  |  |  214|  31.0k|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 1.58k, False: 29.4k]
  |  |  ------------------
  ------------------
  110|  1.58k|        here.op = (unsigned char)64;    /* invalid code marker */
  111|  1.58k|        here.bits = (unsigned char)1;
  112|  1.58k|        here.val = (uint16_t)0;
  113|  1.58k|        *(*table)++ = here;             /* make a table to force an error */
  114|  1.58k|        *(*table)++ = here;
  115|  1.58k|        *bits = 1;
  116|  1.58k|        return 0;     /* no symbols, but wait for decoding to report error */
  117|  1.58k|    }
  118|  50.6k|    for (min = 1; min < max; min++)
  ------------------
  |  Branch (118:19): [True: 44.3k, False: 6.26k]
  ------------------
  119|  44.3k|        if (count[min] != 0) break;
  ------------------
  |  Branch (119:13): [True: 23.2k, False: 21.1k]
  ------------------
  120|  29.4k|    root = MAX(root, min);
  ------------------
  |  |  126|  29.4k|#define MAX(a, b) ((a) < (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (126:20): [True: 15, False: 29.4k]
  |  |  ------------------
  ------------------
  121|       |
  122|       |    /* check for an over-subscribed or incomplete set of lengths */
  123|  29.4k|    left = 1;
  124|   470k|    for (len = 1; len <= MAX_BITS; len++) {
  ------------------
  |  |   39|   470k|#define MAX_BITS 15
  ------------------
  |  Branch (124:19): [True: 441k, False: 29.3k]
  ------------------
  125|   441k|        left <<= 1;
  126|   441k|        left -= count[len];
  127|   441k|        if (left < 0) return -1;        /* over-subscribed */
  ------------------
  |  Branch (127:13): [True: 111, False: 441k]
  ------------------
  128|   441k|    }
  129|  29.3k|    if (left > 0 && (type == CODES || max != 1))
  ------------------
  |  Branch (129:9): [True: 5.84k, False: 23.5k]
  |  Branch (129:22): [True: 32, False: 5.81k]
  |  Branch (129:39): [True: 65, False: 5.74k]
  ------------------
  130|     97|        return -1;                      /* incomplete set */
  131|       |
  132|       |    /* generate offsets into symbol table for each length for sorting */
  133|  29.2k|    offs[1] = 0;
  134|   439k|    for (len = 1; len < MAX_BITS; len++)
  ------------------
  |  |   39|   439k|#define MAX_BITS 15
  ------------------
  |  Branch (134:19): [True: 409k, False: 29.2k]
  ------------------
  135|   409k|        offs[len + 1] = offs[len] + count[len];
  136|       |
  137|       |    /* sort symbols by length, by symbol order within each length */
  138|  3.17M|    for (sym = 0; sym < codes; sym++)
  ------------------
  |  Branch (138:19): [True: 3.14M, False: 29.2k]
  ------------------
  139|  3.14M|        if (lens[sym] != 0) work[offs[lens[sym]]++] = (uint16_t)sym;
  ------------------
  |  Branch (139:13): [True: 1.55M, False: 1.58M]
  ------------------
  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|  29.2k|    switch (type) {
  174|  10.4k|    case CODES:
  ------------------
  |  Branch (174:5): [True: 10.4k, False: 18.8k]
  ------------------
  175|  10.4k|        base = extra = work;    /* dummy value--not used */
  176|  10.4k|        match = 20;
  177|  10.4k|        break;
  178|  10.2k|    case LENS:
  ------------------
  |  Branch (178:5): [True: 10.2k, False: 19.0k]
  ------------------
  179|  10.2k|        base = lbase;
  180|  10.2k|        extra = lext;
  181|  10.2k|        match = 257;
  182|  10.2k|        break;
  183|  8.60k|    default:    /* DISTS */
  ------------------
  |  Branch (183:5): [True: 8.60k, False: 20.6k]
  ------------------
  184|  8.60k|        base = dbase;
  185|  8.60k|        extra = dext;
  186|  8.60k|        match = 0;
  187|  29.2k|    }
  188|       |
  189|       |    /* initialize state for loop */
  190|  29.2k|    huff = 0;                   /* starting code */
  191|  29.2k|    sym = 0;                    /* starting code symbol */
  192|  29.2k|    len = min;                  /* starting code length */
  193|  29.2k|    next = *table;              /* current table to fill in */
  194|  29.2k|    curr = root;                /* current table index bits */
  195|  29.2k|    drop = 0;                   /* current bits to drop from code for index */
  196|  29.2k|    low = (unsigned)(-1);       /* trigger new sub-table when len > root */
  197|  29.2k|    used = 1U << root;          /* use root table entries */
  198|  29.2k|    mask = used - 1;            /* mask for comparing low */
  199|       |
  200|       |    /* check available table space */
  201|  29.2k|    if ((type == LENS && used > ENOUGH_LENS) ||
  ------------------
  |  |   52|  10.2k|#define ENOUGH_LENS 1332
  ------------------
  |  Branch (201:10): [True: 10.2k, False: 19.0k]
  |  Branch (201:26): [True: 0, False: 10.2k]
  ------------------
  202|  29.2k|        (type == DISTS && used > ENOUGH_DISTS))
  ------------------
  |  |   53|  8.60k|#define ENOUGH_DISTS 592
  ------------------
  |  Branch (202:10): [True: 8.60k, False: 20.6k]
  |  Branch (202:27): [True: 0, False: 8.60k]
  ------------------
  203|      0|        return 1;
  204|       |
  205|       |    /* process all codes and make table entries */
  206|  1.55M|    for (;;) {
  207|       |        /* create table entry */
  208|  1.55M|        here.bits = (unsigned char)(len - drop);
  209|  1.55M|        if (LIKELY(work[sym] >= match)) {
  ------------------
  |  |  213|  1.55M|#  define LIKELY(x)             __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (213:33): [True: 119k, False: 1.43M]
  |  |  ------------------
  ------------------
  210|   119k|            here.op = (unsigned char)(extra[work[sym] - match]);
  211|   119k|            here.val = base[work[sym] - match];
  212|  1.43M|        } else if (work[sym] + 1U < match) {
  ------------------
  |  Branch (212:20): [True: 1.42M, False: 10.2k]
  ------------------
  213|  1.42M|            here.op = (unsigned char)0;
  214|  1.42M|            here.val = work[sym];
  215|  1.42M|        } else {
  216|  10.2k|            here.op = (unsigned char)(32 + 64);         /* end of block */
  217|  10.2k|            here.val = 0;
  218|  10.2k|        }
  219|       |
  220|       |        /* replicate for those indices with low len bits equal to huff */
  221|  1.55M|        incr = 1U << (len - drop);
  222|  1.55M|        fill = 1U << curr;
  223|  1.55M|        min = fill;                 /* save offset to next table */
  224|  12.9M|        do {
  225|  12.9M|            fill -= incr;
  226|  12.9M|            next[(huff >> drop) + fill] = here;
  227|  12.9M|        } while (fill != 0);
  ------------------
  |  Branch (227:18): [True: 11.4M, False: 1.55M]
  ------------------
  228|       |
  229|       |        /* backwards increment the len-bit code huff */
  230|  1.55M|        incr = 1U << (len - 1);
  231|  3.07M|        while (huff & incr)
  ------------------
  |  Branch (231:16): [True: 1.52M, False: 1.55M]
  ------------------
  232|  1.52M|            incr >>= 1;
  233|  1.55M|        if (incr != 0) {
  ------------------
  |  Branch (233:13): [True: 1.52M, False: 23.5k]
  ------------------
  234|  1.52M|            huff &= incr - 1;
  235|  1.52M|            huff += incr;
  236|  1.52M|        } else {
  237|  23.5k|            huff = 0;
  238|  23.5k|        }
  239|       |
  240|       |        /* go to next symbol, update count, len */
  241|  1.55M|        sym++;
  242|  1.55M|        if (--(count[len]) == 0) {
  ------------------
  |  Branch (242:13): [True: 160k, False: 1.39M]
  ------------------
  243|   160k|            if (len == max)
  ------------------
  |  Branch (243:17): [True: 29.2k, False: 130k]
  ------------------
  244|  29.2k|                break;
  245|   130k|            len = lens[work[sym]];
  246|   130k|        }
  247|       |
  248|       |        /* create new sub-table if needed */
  249|  1.52M|        if (len > root && (huff & mask) != low) {
  ------------------
  |  Branch (249:13): [True: 128k, False: 1.39M]
  |  Branch (249:27): [True: 47.4k, False: 80.6k]
  ------------------
  250|       |            /* if first time, transition to sub-tables */
  251|  47.4k|            if (drop == 0)
  ------------------
  |  Branch (251:17): [True: 11.1k, False: 36.3k]
  ------------------
  252|  11.1k|                drop = root;
  253|       |
  254|       |            /* increment past last table */
  255|  47.4k|            next += min;            /* here min is 1 << curr */
  256|       |
  257|       |            /* determine length of next table */
  258|  47.4k|            curr = len - drop;
  259|  47.4k|            left = (int)(1 << curr);
  260|  67.4k|            while (curr + drop < max) {
  ------------------
  |  Branch (260:20): [True: 56.0k, False: 11.3k]
  ------------------
  261|  56.0k|                left -= count[curr + drop];
  262|  56.0k|                if (left <= 0)
  ------------------
  |  Branch (262:21): [True: 36.0k, False: 19.9k]
  ------------------
  263|  36.0k|                    break;
  264|  19.9k|                curr++;
  265|  19.9k|                left <<= 1;
  266|  19.9k|            }
  267|       |
  268|       |            /* check for enough space */
  269|  47.4k|            used += 1U << curr;
  270|  47.4k|            if ((type == LENS && used > ENOUGH_LENS) || (type == DISTS && used > ENOUGH_DISTS))
  ------------------
  |  |   52|  29.6k|#define ENOUGH_LENS 1332
  ------------------
                          if ((type == LENS && used > ENOUGH_LENS) || (type == DISTS && used > ENOUGH_DISTS))
  ------------------
  |  |   53|  17.7k|#define ENOUGH_DISTS 592
  ------------------
  |  Branch (270:18): [True: 29.6k, False: 17.7k]
  |  Branch (270:34): [True: 0, False: 29.6k]
  |  Branch (270:58): [True: 17.7k, False: 29.6k]
  |  Branch (270:75): [True: 0, False: 17.7k]
  ------------------
  271|      0|                return 1;
  272|       |
  273|       |            /* point entry in root table to sub-table */
  274|  47.4k|            low = huff & mask;
  275|  47.4k|            (*table)[low].op = (unsigned char)curr;
  276|  47.4k|            (*table)[low].bits = (unsigned char)root;
  277|  47.4k|            (*table)[low].val = (uint16_t)(next - *table);
  278|  47.4k|        }
  279|  1.52M|    }
  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|  29.2k|    if (UNLIKELY(huff != 0)) {
  ------------------
  |  |  214|  29.2k|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 5.74k, False: 23.5k]
  |  |  ------------------
  ------------------
  285|  5.74k|        here.op = (unsigned char)64;            /* invalid code marker */
  286|  5.74k|        here.bits = (unsigned char)(len - drop);
  287|  5.74k|        here.val = (uint16_t)0;
  288|  5.74k|        next[huff] = here;
  289|  5.74k|    }
  290|       |
  291|       |    /* set return parameters */
  292|  29.2k|    *table += used;
  293|  29.2k|    *bits = root;
  294|  29.2k|    return 0;
  295|  29.2k|}

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

chunkset_avx2.c:zng_memread_2:
   12|  9.80k|static inline uint16_t zng_memread_2(const void *ptr) {
   13|  9.80k|#if defined(HAVE_MAY_ALIAS)
   14|  9.80k|    typedef struct { uint16_t val; } __attribute__ ((__packed__, __may_alias__)) unaligned_uint16_t;
   15|  9.80k|    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|  9.80k|}
chunkset_avx2.c:zng_memread_4:
   23|  12.6k|static inline uint32_t zng_memread_4(const void *ptr) {
   24|  12.6k|#if defined(HAVE_MAY_ALIAS)
   25|  12.6k|    typedef struct { uint32_t val; } __attribute__ ((__packed__, __may_alias__)) unaligned_uint32_t;
   26|  12.6k|    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|  12.6k|}
chunkset_avx2.c:zng_memread_8:
   34|  2.77M|static inline uint64_t zng_memread_8(const void *ptr) {
   35|  2.77M|#if defined(HAVE_MAY_ALIAS)
   36|  2.77M|    typedef struct { uint64_t val; } __attribute__ ((__packed__, __may_alias__)) unaligned_uint64_t;
   37|  2.77M|    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|  2.77M|}

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

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

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

zstd_decompress_block.c:ZSTD_highbit32:
  175|   909k|{
  176|   909k|    assert(val != 0);
  ------------------
  |  |   70|   909k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|   909k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|   909k|}
zstd_decompress_block.c:ZSTD_countLeadingZeros32:
   70|   909k|{
   71|   909k|    assert(val != 0);
  ------------------
  |  |   70|   909k|#    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|   909k|}
entropy_common.c:ZSTD_countTrailingZeros32:
   29|  10.6k|{
   30|  10.6k|    assert(val != 0);
  ------------------
  |  |   70|  10.6k|#    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|  10.6k|}
entropy_common.c:ZSTD_highbit32:
  175|  53.8k|{
  176|  53.8k|    assert(val != 0);
  ------------------
  |  |   70|  53.8k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  53.8k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  53.8k|}
entropy_common.c:ZSTD_countLeadingZeros32:
   70|  53.8k|{
   71|  53.8k|    assert(val != 0);
  ------------------
  |  |   70|  53.8k|#    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|  53.8k|}
fse_decompress.c:ZSTD_highbit32:
  175|   218k|{
  176|   218k|    assert(val != 0);
  ------------------
  |  |   70|   218k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|   218k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|   218k|}
fse_decompress.c:ZSTD_countLeadingZeros32:
   70|   218k|{
   71|   218k|    assert(val != 0);
  ------------------
  |  |   70|   218k|#    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|   218k|}
huf_decompress.c:ZSTD_highbit32:
  175|  8.87k|{
  176|  8.87k|    assert(val != 0);
  ------------------
  |  |   70|  8.87k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  8.87k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  8.87k|}
huf_decompress.c:ZSTD_countLeadingZeros32:
   70|  8.87k|{
   71|  8.87k|    assert(val != 0);
  ------------------
  |  |   70|  8.87k|#    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|  8.87k|}
huf_decompress.c:ZSTD_countTrailingZeros64:
   94|  11.3k|{
   95|  11.3k|    assert(val != 0);
  ------------------
  |  |   70|  11.3k|#    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|  11.3k|}

zstd_decompress_block.c:BIT_initDStream:
  255|  4.54k|{
  256|  4.54k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|     31|# 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|     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 (256:9): [True: 31, False: 4.51k]
  ------------------
  257|       |
  258|  4.51k|    bitD->start = (const char*)srcBuffer;
  259|  4.51k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  4.51k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 1.67k, False: 2.84k]
  ------------------
  262|  1.67k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|  1.67k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|  1.67k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|  1.67k|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 1.54k, False: 129]
  ------------------
  266|  1.67k|          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.54k]
  ------------------
  267|  2.84k|    } else {
  268|  2.84k|        bitD->ptr   = bitD->start;
  269|  2.84k|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|  2.84k|        switch(srcSize)
  271|  2.84k|        {
  272|    120|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 120, False: 2.72k]
  ------------------
  273|    120|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    120|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|    349|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 229, False: 2.61k]
  ------------------
  276|    349|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    349|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|    662|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 313, False: 2.53k]
  ------------------
  279|    662|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    662|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|  1.14k|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 483, False: 2.36k]
  ------------------
  282|  1.14k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.14k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|  1.43k|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 288, False: 2.55k]
  ------------------
  285|  1.43k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.43k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|  2.38k|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 954, False: 1.88k]
  ------------------
  288|  2.38k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  2.38k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|  2.84k|        default: break;
  ------------------
  |  Branch (290:9): [True: 456, False: 2.38k]
  ------------------
  291|  2.84k|        }
  292|  2.84k|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|  2.84k|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 2.82k, False: 19]
  ------------------
  294|  2.84k|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   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 (294:17): [True: 19, False: 2.82k]
  ------------------
  295|  2.84k|        }
  296|  2.82k|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|  2.82k|    }
  298|       |
  299|  4.36k|    return srcSize;
  300|  4.51k|}
zstd_decompress_block.c:BIT_readBits:
  363|  13.4M|{
  364|  13.4M|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|  13.4M|    BIT_skipBits(bitD, nbBits);
  366|  13.4M|    return value;
  367|  13.4M|}
zstd_decompress_block.c:BIT_lookBits:
  331|  13.4M|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|  13.4M|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|  13.4M|    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|  13.4M|}
zstd_decompress_block.c:BIT_getMiddleBits:
  308|  13.4M|{
  309|  13.4M|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|  13.4M|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|  13.4M|#    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|  13.4M|#if defined(__x86_64__) || defined(_M_X64)
  318|  13.4M|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|  13.4M|}
zstd_decompress_block.c:BIT_skipBits:
  354|  17.5M|{
  355|  17.5M|    bitD->bitsConsumed += nbBits;
  356|  17.5M|}
zstd_decompress_block.c:BIT_reloadDStream:
  413|  4.49M|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|  4.49M|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|  4.49M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 137k, False: 4.35M]
  |  |  ------------------
  ------------------
  416|   137k|        static const BitContainerType zeroFilled = 0;
  417|   137k|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|   137k|        return BIT_DStream_overflow;
  420|   137k|    }
  421|       |
  422|  4.35M|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  4.35M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|  4.35M|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 4.33M, False: 19.7k]
  ------------------
  425|  4.33M|        return BIT_reloadDStream_internal(bitD);
  426|  4.33M|    }
  427|  19.7k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 16.4k, False: 3.24k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  16.4k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 15.7k, False: 746]
  ------------------
  430|    746|        return BIT_DStream_completed;
  431|  16.4k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  3.24k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  3.24k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  3.24k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 171, False: 3.07k]
  ------------------
  436|    171|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    171|            result = BIT_DStream_endOfBuffer;
  438|    171|        }
  439|  3.24k|        bitD->ptr -= nbBytes;
  440|  3.24k|        bitD->bitsConsumed -= nbBytes*8;
  441|  3.24k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  3.24k|        return result;
  443|  19.7k|    }
  444|  19.7k|}
zstd_decompress_block.c:BIT_reloadDStream_internal:
  385|  4.33M|{
  386|  4.33M|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  4.33M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  4.33M|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  4.33M|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  4.33M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  4.33M|    bitD->bitsConsumed &= 7;
  390|  4.33M|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  4.33M|    return BIT_DStream_unfinished;
  392|  4.33M|}
zstd_decompress_block.c:BIT_readBitsFast:
  372|  4.14M|{
  373|  4.14M|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  4.14M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  4.14M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  4.14M|    BIT_skipBits(bitD, nbBits);
  376|  4.14M|    return value;
  377|  4.14M|}
zstd_decompress_block.c:BIT_lookBitsFast:
  347|  4.14M|{
  348|  4.14M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  4.14M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  4.14M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  4.14M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  4.14M|}
zstd_decompress_block.c:BIT_endOfDStream:
  450|  2.72k|{
  451|  2.72k|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 2.69k, False: 34]
  |  Branch (451:49): [True: 2.65k, False: 32]
  ------------------
  452|  2.72k|}
fse_decompress.c:BIT_initDStream:
  255|  5.40k|{
  256|  5.40k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|     28|# 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|     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 (256:9): [True: 28, False: 5.37k]
  ------------------
  257|       |
  258|  5.37k|    bitD->start = (const char*)srcBuffer;
  259|  5.37k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  5.37k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 4.20k, False: 1.17k]
  ------------------
  262|  4.20k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|  4.20k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|  4.20k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|  4.20k|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 4.13k, False: 63]
  ------------------
  266|  4.20k|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|     63|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     63|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     63|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:15): [True: 63, False: 4.13k]
  ------------------
  267|  4.20k|    } else {
  268|  1.17k|        bitD->ptr   = bitD->start;
  269|  1.17k|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|  1.17k|        switch(srcSize)
  271|  1.17k|        {
  272|    268|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 268, False: 906]
  ------------------
  273|    268|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    268|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|    483|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 215, False: 959]
  ------------------
  276|    483|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    483|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|    600|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 117, False: 1.05k]
  ------------------
  279|    600|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    600|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|    735|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 135, False: 1.03k]
  ------------------
  282|    735|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    735|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|    928|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 193, False: 981]
  ------------------
  285|    928|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    928|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|  1.15k|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 231, False: 943]
  ------------------
  288|  1.15k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.15k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|  1.17k|        default: break;
  ------------------
  |  Branch (290:9): [True: 15, False: 1.15k]
  ------------------
  291|  1.17k|        }
  292|  1.17k|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|  1.17k|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 1.16k, False: 12]
  ------------------
  294|  1.17k|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   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 (294:17): [True: 12, False: 1.16k]
  ------------------
  295|  1.17k|        }
  296|  1.16k|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|  1.16k|    }
  298|       |
  299|  5.29k|    return srcSize;
  300|  5.37k|}
fse_decompress.c:BIT_readBits:
  363|   410k|{
  364|   410k|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|   410k|    BIT_skipBits(bitD, nbBits);
  366|   410k|    return value;
  367|   410k|}
fse_decompress.c:BIT_lookBits:
  331|   410k|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|   410k|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|   410k|    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|   410k|}
fse_decompress.c:BIT_getMiddleBits:
  308|   410k|{
  309|   410k|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|   410k|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|   410k|#    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|   410k|#if defined(__x86_64__) || defined(_M_X64)
  318|   410k|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|   410k|}
fse_decompress.c:BIT_skipBits:
  354|   475k|{
  355|   475k|    bitD->bitsConsumed += nbBits;
  356|   475k|}
fse_decompress.c:BIT_reloadDStream:
  413|   328k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|   328k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|   328k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 5.29k, False: 322k]
  |  |  ------------------
  ------------------
  416|  5.29k|        static const BitContainerType zeroFilled = 0;
  417|  5.29k|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|  5.29k|        return BIT_DStream_overflow;
  420|  5.29k|    }
  421|       |
  422|   322k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   322k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|   322k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 14.3k, False: 308k]
  ------------------
  425|  14.3k|        return BIT_reloadDStream_internal(bitD);
  426|  14.3k|    }
  427|   308k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 260k, False: 48.4k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|   260k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 253k, False: 6.83k]
  ------------------
  430|  6.83k|        return BIT_DStream_completed;
  431|   260k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  48.4k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  48.4k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  48.4k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 337, False: 48.1k]
  ------------------
  436|    337|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    337|            result = BIT_DStream_endOfBuffer;
  438|    337|        }
  439|  48.4k|        bitD->ptr -= nbBytes;
  440|  48.4k|        bitD->bitsConsumed -= nbBytes*8;
  441|  48.4k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  48.4k|        return result;
  443|   308k|    }
  444|   308k|}
fse_decompress.c:BIT_reloadDStream_internal:
  385|  14.3k|{
  386|  14.3k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  14.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  14.3k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  14.3k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  14.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  14.3k|    bitD->bitsConsumed &= 7;
  390|  14.3k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  14.3k|    return BIT_DStream_unfinished;
  392|  14.3k|}
fse_decompress.c:BIT_readBitsFast:
  372|  64.5k|{
  373|  64.5k|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  64.5k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  64.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  64.5k|    BIT_skipBits(bitD, nbBits);
  376|  64.5k|    return value;
  377|  64.5k|}
fse_decompress.c:BIT_lookBitsFast:
  347|  64.5k|{
  348|  64.5k|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  64.5k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  64.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  64.5k|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  64.5k|}
huf_decompress.c:BIT_initDStream:
  255|  2.99k|{
  256|  2.99k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|     15|# 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|     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 (256:9): [True: 15, False: 2.98k]
  ------------------
  257|       |
  258|  2.98k|    bitD->start = (const char*)srcBuffer;
  259|  2.98k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  2.98k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 850, False: 2.13k]
  ------------------
  262|    850|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|    850|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|    850|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|    850|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 838, False: 12]
  ------------------
  266|    850|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   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 (266:15): [True: 12, False: 838]
  ------------------
  267|  2.13k|    } else {
  268|  2.13k|        bitD->ptr   = bitD->start;
  269|  2.13k|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|  2.13k|        switch(srcSize)
  271|  2.13k|        {
  272|     52|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 52, False: 2.08k]
  ------------------
  273|     52|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     52|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|    119|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 67, False: 2.06k]
  ------------------
  276|    119|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    119|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|    165|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 46, False: 2.08k]
  ------------------
  279|    165|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    165|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|    240|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 75, False: 2.05k]
  ------------------
  282|    240|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    240|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|  1.19k|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 956, False: 1.17k]
  ------------------
  285|  1.19k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.19k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|  1.30k|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 109, False: 2.02k]
  ------------------
  288|  1.30k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.30k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|  2.13k|        default: break;
  ------------------
  |  Branch (290:9): [True: 827, False: 1.30k]
  ------------------
  291|  2.13k|        }
  292|  2.13k|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|  2.13k|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 2.11k, False: 18]
  ------------------
  294|  2.13k|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   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 (294:17): [True: 18, False: 2.11k]
  ------------------
  295|  2.13k|        }
  296|  2.11k|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|  2.11k|    }
  298|       |
  299|  2.95k|    return srcSize;
  300|  2.98k|}
huf_decompress.c:BIT_reloadDStream:
  413|   307k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|   307k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|   307k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 273, False: 307k]
  |  |  ------------------
  ------------------
  416|    273|        static const BitContainerType zeroFilled = 0;
  417|    273|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|    273|        return BIT_DStream_overflow;
  420|    273|    }
  421|       |
  422|   307k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   307k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|   307k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 290k, False: 16.8k]
  ------------------
  425|   290k|        return BIT_reloadDStream_internal(bitD);
  426|   290k|    }
  427|  16.8k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 3.61k, False: 13.2k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  3.61k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 3.03k, False: 585]
  ------------------
  430|    585|        return BIT_DStream_completed;
  431|  3.61k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  13.2k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  13.2k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  13.2k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 1.50k, False: 11.7k]
  ------------------
  436|  1.50k|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|  1.50k|            result = BIT_DStream_endOfBuffer;
  438|  1.50k|        }
  439|  13.2k|        bitD->ptr -= nbBytes;
  440|  13.2k|        bitD->bitsConsumed -= nbBytes*8;
  441|  13.2k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  13.2k|        return result;
  443|  16.8k|    }
  444|  16.8k|}
huf_decompress.c:BIT_reloadDStream_internal:
  385|   358k|{
  386|   358k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|   358k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|   358k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|   358k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   358k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|   358k|    bitD->bitsConsumed &= 7;
  390|   358k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|   358k|    return BIT_DStream_unfinished;
  392|   358k|}
huf_decompress.c:BIT_lookBitsFast:
  347|  3.35M|{
  348|  3.35M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  3.35M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  3.35M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  3.35M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  3.35M|}
huf_decompress.c:BIT_skipBits:
  354|  3.35M|{
  355|  3.35M|    bitD->bitsConsumed += nbBits;
  356|  3.35M|}
huf_decompress.c:BIT_endOfDStream:
  450|  2.89k|{
  451|  2.89k|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 2.50k, False: 385]
  |  Branch (451:49): [True: 1.78k, False: 726]
  ------------------
  452|  2.89k|}
huf_decompress.c:BIT_reloadDStreamFast:
  401|  68.8k|{
  402|  68.8k|    if (UNLIKELY(bitD->ptr < bitD->limitPtr))
  ------------------
  |  |  188|  68.8k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 540, False: 68.3k]
  |  |  ------------------
  ------------------
  403|    540|        return BIT_DStream_overflow;
  404|  68.3k|    return BIT_reloadDStream_internal(bitD);
  405|  68.8k|}

zstd_decompress_block.c:ZSTD_maybeNullPtrAdd:
  386|  14.4k|{
  387|  14.4k|    return add > 0 ? ptr + add : ptr;
  ------------------
  |  Branch (387:12): [True: 14.1k, False: 265]
  ------------------
  388|  14.4k|}
zstd_decompress_block.c:ZSTD_wrappedPtrSub:
  374|  1.97M|{
  375|  1.97M|    return ptr - sub;
  376|  1.97M|}
zstd_decompress_block.c:ZSTD_wrappedPtrAdd:
  361|  1.97M|{
  362|  1.97M|    return ptr + add;
  363|  1.97M|}
huf_decompress.c:ZSTD_maybeNullPtrAdd:
  386|  8.28k|{
  387|  8.28k|    return add > 0 ? ptr + add : ptr;
  ------------------
  |  Branch (387:12): [True: 7.72k, False: 553]
  ------------------
  388|  8.28k|}

zstd_decompress.c:ZSTD_cpuid:
   32|  10.2k|MEM_STATIC ZSTD_cpuid_t ZSTD_cpuid(void) {
   33|  10.2k|    U32 f1c = 0;
   34|  10.2k|    U32 f1d = 0;
   35|  10.2k|    U32 f7b = 0;
   36|  10.2k|    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|  10.2k|    __asm__("cpuid" : "=a"(n) : "a"(0) : "ebx", "ecx", "edx");
  124|  10.2k|    if (n >= 1) {
  ------------------
  |  Branch (124:9): [True: 10.2k, False: 0]
  ------------------
  125|  10.2k|      U32 f1a;
  126|  10.2k|      __asm__("cpuid" : "=a"(f1a), "=c"(f1c), "=d"(f1d) : "a"(1) : "ebx");
  127|  10.2k|    }
  128|  10.2k|    if (n >= 7) {
  ------------------
  |  Branch (128:9): [True: 10.2k, False: 0]
  ------------------
  129|  10.2k|      U32 f7a;
  130|  10.2k|      __asm__("cpuid"
  131|  10.2k|              : "=a"(f7a), "=b"(f7b), "=c"(f7c)
  132|  10.2k|              : "a"(7), "c"(0)
  133|  10.2k|              : "edx");
  134|  10.2k|    }
  135|  10.2k|#endif
  136|  10.2k|    {
  137|  10.2k|        ZSTD_cpuid_t cpuid;
  138|  10.2k|        cpuid.f1c = f1c;
  139|  10.2k|        cpuid.f1d = f1d;
  140|  10.2k|        cpuid.f7b = f7b;
  141|  10.2k|        cpuid.f7c = f7c;
  142|  10.2k|        return cpuid;
  143|  10.2k|    }
  144|  10.2k|}
zstd_decompress.c:ZSTD_cpuid_bmi1:
  147|  10.2k|  MEM_STATIC int ZSTD_cpuid_##name(ZSTD_cpuid_t const cpuid) {                 \
  148|  10.2k|    return ((cpuid.r) & (1U << bit)) != 0;                                     \
  149|  10.2k|  }
zstd_decompress.c:ZSTD_cpuid_bmi2:
  147|  10.2k|  MEM_STATIC int ZSTD_cpuid_##name(ZSTD_cpuid_t const cpuid) {                 \
  148|  10.2k|    return ((cpuid.r) & (1U << bit)) != 0;                                     \
  149|  10.2k|  }

FSE_isError:
   31|  7.49k|unsigned FSE_isError(size_t code) { return ERR_isError(code); }
FSE_readNCount_bmi2:
  209|  15.1k|{
  210|  15.1k|#if DYNAMIC_BMI2
  211|  15.1k|    if (bmi2) {
  ------------------
  |  Branch (211:9): [True: 4.70k, False: 10.4k]
  ------------------
  212|  4.70k|        return FSE_readNCount_body_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  213|  4.70k|    }
  214|  10.4k|#endif
  215|  10.4k|    (void)bmi2;
  216|  10.4k|    return FSE_readNCount_body_default(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  217|  15.1k|}
FSE_readNCount:
  222|  9.63k|{
  223|  9.63k|    return FSE_readNCount_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize, /* bmi2 */ 0);
  224|  9.63k|}
HUF_readStats_wksp:
  332|  5.91k|{
  333|  5.91k|#if DYNAMIC_BMI2
  334|  5.91k|    if (flags & HUF_flags_bmi2) {
  ------------------
  |  Branch (334:9): [True: 4.91k, False: 1.00k]
  ------------------
  335|  4.91k|        return HUF_readStats_body_bmi2(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize);
  336|  4.91k|    }
  337|  1.00k|#endif
  338|  1.00k|    (void)flags;
  339|  1.00k|    return HUF_readStats_body_default(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize);
  340|  5.91k|}
entropy_common.c:FSE_readNCount_body_bmi2:
  201|  4.70k|{
  202|  4.70k|    return FSE_readNCount_body(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  203|  4.70k|}
entropy_common.c:FSE_readNCount_body:
   44|  15.1k|{
   45|  15.1k|    const BYTE* const istart = (const BYTE*) headerBuffer;
   46|  15.1k|    const BYTE* const iend = istart + hbSize;
   47|  15.1k|    const BYTE* ip = istart;
   48|  15.1k|    int nbBits;
   49|  15.1k|    int remaining;
   50|  15.1k|    int threshold;
   51|  15.1k|    U32 bitStream;
   52|  15.1k|    int bitCount;
   53|  15.1k|    unsigned charnum = 0;
   54|  15.1k|    unsigned const maxSV1 = *maxSVPtr + 1;
   55|  15.1k|    int previous0 = 0;
   56|       |
   57|  15.1k|    if (hbSize < 8) {
  ------------------
  |  Branch (57:9): [True: 2.00k, False: 13.1k]
  ------------------
   58|       |        /* This function only works when hbSize >= 8 */
   59|  2.00k|        char buffer[8] = {0};
   60|  2.00k|        ZSTD_memcpy(buffer, headerBuffer, hbSize);
  ------------------
  |  |   44|  2.00k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
   61|  2.00k|        {   size_t const countSize = FSE_readNCount(normalizedCounter, maxSVPtr, tableLogPtr,
   62|  2.00k|                                                    buffer, sizeof(buffer));
   63|  2.00k|            if (FSE_isError(countSize)) return countSize;
  ------------------
  |  Branch (63:17): [True: 116, False: 1.88k]
  ------------------
   64|  1.88k|            if (countSize > hbSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|    157|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    157|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    157|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (64:17): [True: 157, False: 1.72k]
  ------------------
   65|  1.72k|            return countSize;
   66|  1.88k|    }   }
   67|  13.1k|    assert(hbSize >= 8);
  ------------------
  |  |   70|  13.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   68|       |
   69|       |    /* init */
   70|  13.1k|    ZSTD_memset(normalizedCounter, 0, (*maxSVPtr+1) * sizeof(normalizedCounter[0]));   /* all symbols not present in NCount have a frequency of 0 */
  ------------------
  |  |   46|  13.1k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
   71|  13.1k|    bitStream = MEM_readLE32(ip);
   72|  13.1k|    nbBits = (bitStream & 0xF) + FSE_MIN_TABLELOG;   /* extract tableLog */
  ------------------
  |  |  616|  13.1k|#define FSE_MIN_TABLELOG 5
  ------------------
   73|  13.1k|    if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |  618|  13.1k|#define FSE_TABLELOG_ABSOLUTE_MAX 15
  ------------------
                  if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   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 (73:9): [True: 47, False: 13.0k]
  ------------------
   74|  13.0k|    bitStream >>= 4;
   75|  13.0k|    bitCount = 4;
   76|  13.0k|    *tableLogPtr = nbBits;
   77|  13.0k|    remaining = (1<<nbBits)+1;
   78|  13.0k|    threshold = 1<<nbBits;
   79|  13.0k|    nbBits++;
   80|       |
   81|   120k|    for (;;) {
   82|   120k|        if (previous0) {
  ------------------
  |  Branch (82:13): [True: 10.3k, False: 109k]
  ------------------
   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|  10.3k|            int repeats = ZSTD_countTrailingZeros32(~bitStream | 0x80000000) >> 1;
   89|  10.6k|            while (repeats >= 12) {
  ------------------
  |  Branch (89:20): [True: 328, False: 10.3k]
  ------------------
   90|    328|                charnum += 3 * 12;
   91|    328|                if (LIKELY(ip <= iend-7)) {
  ------------------
  |  |  187|    328|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 264, False: 64]
  |  |  ------------------
  ------------------
   92|    264|                    ip += 3;
   93|    264|                } else {
   94|     64|                    bitCount -= (int)(8 * (iend - 7 - ip));
   95|     64|                    bitCount &= 31;
   96|     64|                    ip = iend - 4;
   97|     64|                }
   98|    328|                bitStream = MEM_readLE32(ip) >> bitCount;
   99|    328|                repeats = ZSTD_countTrailingZeros32(~bitStream | 0x80000000) >> 1;
  100|    328|            }
  101|  10.3k|            charnum += 3 * repeats;
  102|  10.3k|            bitStream >>= 2 * repeats;
  103|  10.3k|            bitCount += 2 * repeats;
  104|       |
  105|       |            /* Add the final repeat which isn't 0b11. */
  106|  10.3k|            assert((bitStream & 3) < 3);
  ------------------
  |  |   70|  10.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  107|  10.3k|            charnum += bitStream & 3;
  108|  10.3k|            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|  10.3k|            if (charnum >= maxSV1) break;
  ------------------
  |  Branch (114:17): [True: 21, False: 10.3k]
  ------------------
  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|  10.3k|            if (LIKELY(ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  |  187|  20.6k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 7.25k, False: 3.04k]
  |  |  ------------------
  ------------------
  |  Branch (120:41): [True: 918, False: 2.13k]
  ------------------
  121|  8.17k|                assert((bitCount >> 3) <= 3); /* For first condition to work */
  ------------------
  |  |   70|  8.17k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  122|  8.17k|                ip += bitCount>>3;
  123|  8.17k|                bitCount &= 7;
  124|  8.17k|            } else {
  125|  2.13k|                bitCount -= (int)(8 * (iend - 4 - ip));
  126|  2.13k|                bitCount &= 31;
  127|  2.13k|                ip = iend - 4;
  128|  2.13k|            }
  129|  10.3k|            bitStream = MEM_readLE32(ip) >> bitCount;
  130|  10.3k|        }
  131|   120k|        {
  132|   120k|            int const max = (2*threshold-1) - remaining;
  133|   120k|            int count;
  134|       |
  135|   120k|            if ((bitStream & (threshold-1)) < (U32)max) {
  ------------------
  |  Branch (135:17): [True: 81.5k, False: 38.5k]
  ------------------
  136|  81.5k|                count = bitStream & (threshold-1);
  137|  81.5k|                bitCount += nbBits-1;
  138|  81.5k|            } else {
  139|  38.5k|                count = bitStream & (2*threshold-1);
  140|  38.5k|                if (count >= threshold) count -= max;
  ------------------
  |  Branch (140:21): [True: 17.8k, False: 20.7k]
  ------------------
  141|  38.5k|                bitCount += nbBits;
  142|  38.5k|            }
  143|       |
  144|   120k|            count--;   /* extra accuracy */
  145|       |            /* When it matters (small blocks), this is a
  146|       |             * predictable branch, because we don't use -1.
  147|       |             */
  148|   120k|            if (count >= 0) {
  ------------------
  |  Branch (148:17): [True: 65.9k, False: 54.1k]
  ------------------
  149|  65.9k|                remaining -= count;
  150|  65.9k|            } else {
  151|  54.1k|                assert(count == -1);
  ------------------
  |  |   70|  54.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  152|  54.1k|                remaining += count;
  153|  54.1k|            }
  154|   120k|            normalizedCounter[charnum++] = (short)count;
  155|   120k|            previous0 = !count;
  156|       |
  157|   120k|            assert(threshold > 1);
  ------------------
  |  |   70|   120k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  158|   120k|            if (remaining < threshold) {
  ------------------
  |  Branch (158:17): [True: 49.8k, False: 70.1k]
  ------------------
  159|       |                /* This branch can be folded into the
  160|       |                 * threshold update condition because we
  161|       |                 * know that threshold > 1.
  162|       |                 */
  163|  49.8k|                if (remaining <= 1) break;
  ------------------
  |  Branch (163:21): [True: 12.9k, False: 36.9k]
  ------------------
  164|  36.9k|                nbBits = ZSTD_highbit32(remaining) + 1;
  165|  36.9k|                threshold = 1 << (nbBits - 1);
  166|  36.9k|            }
  167|   107k|            if (charnum >= maxSV1) break;
  ------------------
  |  Branch (167:17): [True: 85, False: 107k]
  ------------------
  168|       |
  169|   107k|            if (LIKELY(ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  |  187|   214k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 87.2k, False: 19.7k]
  |  |  ------------------
  ------------------
  |  Branch (169:41): [True: 5.12k, False: 14.6k]
  ------------------
  170|  92.3k|                ip += bitCount>>3;
  171|  92.3k|                bitCount &= 7;
  172|  92.3k|            } else {
  173|  14.6k|                bitCount -= (int)(8 * (iend - 4 - ip));
  174|  14.6k|                bitCount &= 31;
  175|  14.6k|                ip = iend - 4;
  176|  14.6k|            }
  177|   107k|            bitStream = MEM_readLE32(ip) >> bitCount;
  178|   107k|    }   }
  179|  13.0k|    if (remaining != 1) return ERROR(corruption_detected);
  ------------------
  |  |   49|    106|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    106|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    106|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (179:9): [True: 106, False: 12.9k]
  ------------------
  180|       |    /* Only possible when there are too many zeros. */
  181|  12.9k|    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: 12.9k]
  ------------------
  182|  12.9k|    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: 12.9k]
  ------------------
  183|  12.9k|    *maxSVPtr = charnum-1;
  184|       |
  185|  12.9k|    ip += (bitCount+7)>>3;
  186|  12.9k|    return ip-istart;
  187|  12.9k|}
entropy_common.c:FSE_readNCount_body_default:
  193|  10.4k|{
  194|  10.4k|    return FSE_readNCount_body(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  195|  10.4k|}
entropy_common.c:HUF_readStats_body_bmi2:
  322|  4.91k|{
  323|  4.91k|    return HUF_readStats_body(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize, 1);
  324|  4.91k|}
entropy_common.c:HUF_readStats_body:
  248|  5.91k|{
  249|  5.91k|    U32 weightTotal;
  250|  5.91k|    const BYTE* ip = (const BYTE*) src;
  251|  5.91k|    size_t iSize;
  252|  5.91k|    size_t oSize;
  253|       |
  254|  5.91k|    if (!srcSize) 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 (254:9): [True: 6, False: 5.91k]
  ------------------
  255|  5.91k|    iSize = ip[0];
  256|       |    /* ZSTD_memset(huffWeight, 0, hwSize);   *//* is not necessary, even though some analyzer complain ... */
  257|       |
  258|  5.91k|    if (iSize >= 128) {  /* special header */
  ------------------
  |  Branch (258:9): [True: 421, False: 5.49k]
  ------------------
  259|    421|        oSize = iSize - 127;
  260|    421|        iSize = ((oSize+1)/2);
  261|    421|        if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   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 (261:13): [True: 4, False: 417]
  ------------------
  262|    417|        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: 417]
  ------------------
  263|    417|        ip += 1;
  264|    417|        {   U32 n;
  265|  2.89k|            for (n=0; n<oSize; n+=2) {
  ------------------
  |  Branch (265:23): [True: 2.48k, False: 417]
  ------------------
  266|  2.48k|                huffWeight[n]   = ip[n/2] >> 4;
  267|  2.48k|                huffWeight[n+1] = ip[n/2] & 15;
  268|  2.48k|    }   }   }
  269|  5.49k|    else  {   /* header compressed with FSE (normal case) */
  270|  5.49k|        if (iSize+1 > srcSize) 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 (270:13): [True: 3, False: 5.48k]
  ------------------
  271|       |        /* max (hwSize-1) values decoded, as last one is implied */
  272|  5.48k|        oSize = FSE_decompress_wksp_bmi2(huffWeight, hwSize-1, ip+1, iSize, 6, workSpace, wkspSize, bmi2);
  273|  5.48k|        if (FSE_isError(oSize)) return oSize;
  ------------------
  |  Branch (273:13): [True: 220, False: 5.26k]
  ------------------
  274|  5.48k|    }
  275|       |
  276|       |    /* collect weight stats */
  277|  5.68k|    ZSTD_memset(rankStats, 0, (HUF_TABLELOG_MAX + 1) * sizeof(U32));
  ------------------
  |  |   46|  5.68k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  278|  5.68k|    weightTotal = 0;
  279|   469k|    {   U32 n; for (n=0; n<oSize; n++) {
  ------------------
  |  Branch (279:26): [True: 463k, False: 5.65k]
  ------------------
  280|   463k|            if (huffWeight[n] > HUF_TABLELOG_MAX) return ERROR(corruption_detected);
  ------------------
  |  |   37|   463k|#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|     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 (280:17): [True: 27, False: 463k]
  ------------------
  281|   463k|            rankStats[huffWeight[n]]++;
  282|   463k|            weightTotal += (1 << huffWeight[n]) >> 1;
  283|   463k|    }   }
  284|  5.65k|    if (weightTotal == 0) 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 (284:9): [True: 2, False: 5.65k]
  ------------------
  285|       |
  286|       |    /* get last non-null symbol weight (implied, total must be 2^n) */
  287|  5.65k|    {   U32 const tableLog = ZSTD_highbit32(weightTotal) + 1;
  288|  5.65k|        if (tableLog > HUF_TABLELOG_MAX) return ERROR(corruption_detected);
  ------------------
  |  |   37|  5.65k|#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|      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 (288:13): [True: 3, False: 5.65k]
  ------------------
  289|  5.65k|        *tableLogPtr = tableLog;
  290|       |        /* determine last weight */
  291|  5.65k|        {   U32 const total = 1 << tableLog;
  292|  5.65k|            U32 const rest = total - weightTotal;
  293|  5.65k|            U32 const verif = 1 << ZSTD_highbit32(rest);
  294|  5.65k|            U32 const lastWeight = ZSTD_highbit32(rest) + 1;
  295|  5.65k|            if (verif != rest) return ERROR(corruption_detected);    /* last value must be a clean power of 2 */
  ------------------
  |  |   49|    116|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    116|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    116|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (295:17): [True: 116, False: 5.53k]
  ------------------
  296|  5.53k|            huffWeight[oSize] = (BYTE)lastWeight;
  297|  5.53k|            rankStats[lastWeight]++;
  298|  5.53k|    }   }
  299|       |
  300|       |    /* check tree construction validity */
  301|  5.53k|    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: 5.53k]
  |  Branch (301:31): [True: 0, False: 5.53k]
  ------------------
  302|       |
  303|       |    /* results */
  304|  5.53k|    *nbSymbolsPtr = (U32)(oSize+1);
  305|  5.53k|    return iSize+1;
  306|  5.53k|}
entropy_common.c:HUF_readStats_body_default:
  313|  1.00k|{
  314|  1.00k|    return HUF_readStats_body(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize, 0);
  315|  1.00k|}

zstd_common.c:ERR_isError:
   52|  26.4k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  26.4k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  26.4k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  26.4k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_common.c:ERR_getErrorCode:
   54|  14.1k|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: 9.73k, False: 4.37k]
  ------------------
zstd_ddict.c:ERR_isError:
   52|  8.46k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  8.46k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  8.46k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  8.46k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress.c:ERR_isError:
   52|   218k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|   218k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|   218k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   218k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress_block.c:ERR_isError:
   52|  4.52M|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  4.52M|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  4.52M|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  4.52M|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v05.c:ERR_isError:
   52|   123k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|   123k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|   123k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   123k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v06.c:ERR_isError:
   52|   106k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|   106k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|   106k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   106k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v07.c:ERR_isError:
   52|  43.8k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  43.8k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  43.8k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  43.8k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
entropy_common.c:ERR_isError:
   52|  7.49k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  7.49k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  7.49k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  7.49k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
fse_decompress.c:ERR_isError:
   52|  16.2k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  16.2k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  16.2k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  16.2k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
huf_decompress.c:ERR_isError:
   52|  28.3k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  28.3k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  28.3k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  28.3k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------

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

FSE_decompress_wksp_bmi2:
  305|  5.48k|{
  306|  5.48k|#if DYNAMIC_BMI2
  307|  5.48k|    if (bmi2) {
  ------------------
  |  Branch (307:9): [True: 4.70k, False: 786]
  ------------------
  308|  4.70k|        return FSE_decompress_wksp_body_bmi2(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize);
  309|  4.70k|    }
  310|    786|#endif
  311|    786|    (void)bmi2;
  312|    786|    return FSE_decompress_wksp_body_default(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize);
  313|  5.48k|}
fse_decompress.c:FSE_buildDTable_internal:
   59|  5.40k|{
   60|  5.40k|    void* const tdPtr = dt+1;   /* because *dt is unsigned, 32-bits aligned on 32-bits */
   61|  5.40k|    FSE_DECODE_TYPE* const tableDecode = (FSE_DECODE_TYPE*) (tdPtr);
  ------------------
  |  |  603|  5.40k|#define FSE_DECODE_TYPE FSE_decode_t
  ------------------
   62|  5.40k|    U16* symbolNext = (U16*)workSpace;
   63|  5.40k|    BYTE* spread = (BYTE*)(symbolNext + maxSymbolValue + 1);
   64|       |
   65|  5.40k|    U32 const maxSV1 = maxSymbolValue + 1;
   66|  5.40k|    U32 const tableSize = 1 << tableLog;
   67|  5.40k|    U32 highThreshold = tableSize-1;
   68|       |
   69|       |    /* Sanity Checks */
   70|  5.40k|    if (FSE_BUILD_DTABLE_WKSP_SIZE(tableLog, maxSymbolValue) > wkspSize) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  |  267|  5.40k|#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: 5.40k]
  ------------------
   71|  5.40k|    if (maxSymbolValue > FSE_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  |  595|  5.40k|#  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: 5.40k]
  ------------------
   72|  5.40k|    if (tableLog > FSE_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  |  612|  5.40k|#define FSE_MAX_TABLELOG  (FSE_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  582|  5.40k|#  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: 5.40k]
  ------------------
   73|       |
   74|       |    /* Init, lay down lowprob symbols */
   75|  5.40k|    {   FSE_DTableHeader DTableH;
   76|  5.40k|        DTableH.tableLog = (U16)tableLog;
   77|  5.40k|        DTableH.fastMode = 1;
   78|  5.40k|        {   S16 const largeLimit= (S16)(1 << (tableLog-1));
   79|  5.40k|            U32 s;
   80|  43.2k|            for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (80:23): [True: 37.8k, False: 5.40k]
  ------------------
   81|  37.8k|                if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (81:21): [True: 11.1k, False: 26.7k]
  ------------------
   82|  11.1k|                    tableDecode[highThreshold--].symbol = (FSE_FUNCTION_TYPE)s;
   83|  11.1k|                    symbolNext[s] = 1;
   84|  26.7k|                } else {
   85|  26.7k|                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
  ------------------
  |  Branch (85:25): [True: 3.85k, False: 22.8k]
  ------------------
   86|  26.7k|                    symbolNext[s] = (U16)normalizedCounter[s];
   87|  26.7k|        }   }   }
   88|  5.40k|        ZSTD_memcpy(dt, &DTableH, sizeof(DTableH));
  ------------------
  |  |   44|  5.40k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
   89|  5.40k|    }
   90|       |
   91|       |    /* Spread symbols */
   92|  5.40k|    if (highThreshold == tableSize - 1) {
  ------------------
  |  Branch (92:9): [True: 2.45k, False: 2.95k]
  ------------------
   93|  2.45k|        size_t const tableMask = tableSize-1;
   94|  2.45k|        size_t const step = FSE_TABLESTEP(tableSize);
  ------------------
  |  |  623|  2.45k|#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|  2.45k|        {   U64 const add = 0x0101010101010101ull;
  102|  2.45k|            size_t pos = 0;
  103|  2.45k|            U64 sv = 0;
  104|  2.45k|            U32 s;
  105|  9.28k|            for (s=0; s<maxSV1; ++s, sv += add) {
  ------------------
  |  Branch (105:23): [True: 6.83k, False: 2.45k]
  ------------------
  106|  6.83k|                int i;
  107|  6.83k|                int const n = normalizedCounter[s];
  108|  6.83k|                MEM_write64(spread + pos, sv);
  109|  16.6k|                for (i = 8; i < n; i += 8) {
  ------------------
  |  Branch (109:29): [True: 9.80k, False: 6.83k]
  ------------------
  110|  9.80k|                    MEM_write64(spread + pos + i, sv);
  111|  9.80k|                }
  112|  6.83k|                pos += (size_t)n;
  113|  6.83k|        }   }
  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|  2.45k|        {
  121|  2.45k|            size_t position = 0;
  122|  2.45k|            size_t s;
  123|  2.45k|            size_t const unroll = 2;
  124|  2.45k|            assert(tableSize % unroll == 0); /* FSE_MIN_TABLELOG is 5 */
  ------------------
  |  |   70|  2.45k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  125|  53.9k|            for (s = 0; s < (size_t)tableSize; s += unroll) {
  ------------------
  |  Branch (125:25): [True: 51.5k, False: 2.45k]
  ------------------
  126|  51.5k|                size_t u;
  127|   154k|                for (u = 0; u < unroll; ++u) {
  ------------------
  |  Branch (127:29): [True: 103k, False: 51.5k]
  ------------------
  128|   103k|                    size_t const uPosition = (position + (u * step)) & tableMask;
  129|   103k|                    tableDecode[uPosition].symbol = spread[s + u];
  130|   103k|                }
  131|  51.5k|                position = (position + (unroll * step)) & tableMask;
  132|  51.5k|            }
  133|  2.45k|            assert(position == 0);
  ------------------
  |  |   70|  2.45k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  134|  2.45k|        }
  135|  2.95k|    } else {
  136|  2.95k|        U32 const tableMask = tableSize-1;
  137|  2.95k|        U32 const step = FSE_TABLESTEP(tableSize);
  ------------------
  |  |  623|  2.95k|#define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3)
  ------------------
  138|  2.95k|        U32 s, position = 0;
  139|  33.9k|        for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (139:19): [True: 31.0k, False: 2.95k]
  ------------------
  140|  31.0k|            int i;
  141|   129k|            for (i=0; i<normalizedCounter[s]; i++) {
  ------------------
  |  Branch (141:23): [True: 98.5k, False: 31.0k]
  ------------------
  142|  98.5k|                tableDecode[position].symbol = (FSE_FUNCTION_TYPE)s;
  143|  98.5k|                position = (position + step) & tableMask;
  144|   109k|                while (position > highThreshold) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  Branch (144:24): [True: 11.1k, False: 98.5k]
  ------------------
  145|  98.5k|        }   }
  146|  2.95k|        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: 2.95k]
  ------------------
  147|  2.95k|    }
  148|       |
  149|       |    /* Build Decoding table */
  150|  5.40k|    {   U32 u;
  151|   218k|        for (u=0; u<tableSize; u++) {
  ------------------
  |  Branch (151:19): [True: 212k, False: 5.40k]
  ------------------
  152|   212k|            FSE_FUNCTION_TYPE const symbol = (FSE_FUNCTION_TYPE)(tableDecode[u].symbol);
  ------------------
  |  |  601|   212k|#define FSE_FUNCTION_TYPE BYTE
  ------------------
  153|   212k|            U32 const nextState = symbolNext[symbol]++;
  154|   212k|            tableDecode[u].nbBits = (BYTE) (tableLog - ZSTD_highbit32(nextState) );
  155|   212k|            tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
  156|   212k|    }   }
  157|       |
  158|  5.40k|    return 0;
  159|  5.40k|}
fse_decompress.c:FSE_decompress_wksp_body_bmi2:
  299|  4.70k|{
  300|  4.70k|    return FSE_decompress_wksp_body(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize, 1);
  301|  4.70k|}
fse_decompress.c:FSE_decompress_wksp_body:
  248|  5.48k|{
  249|  5.48k|    const BYTE* const istart = (const BYTE*)cSrc;
  250|  5.48k|    const BYTE* ip = istart;
  251|  5.48k|    unsigned tableLog;
  252|  5.48k|    unsigned maxSymbolValue = FSE_MAX_SYMBOL_VALUE;
  ------------------
  |  |  595|  5.48k|#  define FSE_MAX_SYMBOL_VALUE 255
  ------------------
  253|  5.48k|    FSE_DecompressWksp* const wksp = (FSE_DecompressWksp*)workSpace;
  254|  5.48k|    size_t const dtablePos = sizeof(FSE_DecompressWksp) / sizeof(FSE_DTable);
  255|  5.48k|    FSE_DTable* const dtable = (FSE_DTable*)workSpace + dtablePos;
  256|       |
  257|  5.48k|    FSE_STATIC_ASSERT((FSE_MAX_SYMBOL_VALUE + 1) % 2 == 0);
  ------------------
  |  |   33|  5.48k|#define FSE_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)   /* use only *after* variable declarations */
  |  |  ------------------
  |  |  |  |   39|  5.48k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
  258|  5.48k|    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: 5.48k]
  ------------------
  259|       |
  260|       |    /* correct offset to dtable depends on this property */
  261|  5.48k|    FSE_STATIC_ASSERT(sizeof(FSE_DecompressWksp) % sizeof(FSE_DTable) == 0);
  ------------------
  |  |   33|  5.48k|#define FSE_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)   /* use only *after* variable declarations */
  |  |  ------------------
  |  |  |  |   39|  5.48k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
  262|       |
  263|       |    /* normal FSE decoding mode */
  264|  5.48k|    {   size_t const NCountLength =
  265|  5.48k|            FSE_readNCount_bmi2(wksp->ncount, &maxSymbolValue, &tableLog, istart, cSrcSize, bmi2);
  266|  5.48k|        if (FSE_isError(NCountLength)) return NCountLength;
  ------------------
  |  |   32|  5.48k|#define FSE_isError ERR_isError
  ------------------
  |  Branch (266:13): [True: 40, False: 5.44k]
  ------------------
  267|  5.44k|        if (tableLog > maxLog) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (267:13): [True: 34, False: 5.41k]
  ------------------
  268|  5.41k|        assert(NCountLength <= cSrcSize);
  ------------------
  |  |   70|  5.41k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  269|  5.41k|        ip += NCountLength;
  270|  5.41k|        cSrcSize -= NCountLength;
  271|  5.41k|    }
  272|       |
  273|  5.41k|    if (FSE_DECOMPRESS_WKSP_SIZE(tableLog, maxSymbolValue) > wkspSize) return ERROR(tableLog_tooLarge);
  ------------------
  |  |  273|  5.41k|#define FSE_DECOMPRESS_WKSP_SIZE(maxTableLog, maxSymbolValue) (FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(unsigned))
  |  |  ------------------
  |  |  |  |  272|  5.41k|#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|  5.41k|#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|  5.41k|#define FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) ((FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) + sizeof(unsigned) - 1) / sizeof(unsigned))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  267|  5.41k|#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|  5.41k|#  define FSE_MAX_SYMBOL_VALUE 255
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (FSE_DECOMPRESS_WKSP_SIZE(tableLog, maxSymbolValue) > wkspSize) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   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 (273:9): [True: 12, False: 5.40k]
  ------------------
  274|  5.40k|    assert(sizeof(*wksp) + FSE_DTABLE_SIZE(tableLog) <= wkspSize);
  ------------------
  |  |   70|  5.40k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  275|  5.40k|    workSpace = (BYTE*)workSpace + sizeof(*wksp) + FSE_DTABLE_SIZE(tableLog);
  ------------------
  |  |  245|  5.40k|#define FSE_DTABLE_SIZE(maxTableLog)                   (FSE_DTABLE_SIZE_U32(maxTableLog) * sizeof(FSE_DTable))
  |  |  ------------------
  |  |  |  |  241|  5.40k|#define FSE_DTABLE_SIZE_U32(maxTableLog)                   (1 + (1<<(maxTableLog)))
  |  |  ------------------
  ------------------
  276|  5.40k|    wkspSize -= sizeof(*wksp) + FSE_DTABLE_SIZE(tableLog);
  ------------------
  |  |  245|  5.40k|#define FSE_DTABLE_SIZE(maxTableLog)                   (FSE_DTABLE_SIZE_U32(maxTableLog) * sizeof(FSE_DTable))
  |  |  ------------------
  |  |  |  |  241|  5.40k|#define FSE_DTABLE_SIZE_U32(maxTableLog)                   (1 + (1<<(maxTableLog)))
  |  |  ------------------
  ------------------
  277|       |
  278|  5.40k|    CHECK_F( FSE_buildDTable_internal(dtable, wksp->ncount, maxSymbolValue, tableLog, workSpace, wkspSize) );
  ------------------
  |  |   63|  5.40k|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|  5.40k|    size_t const e = f;     \
  |  |  |  |   59|  5.40k|    do {                    \
  |  |  |  |   60|  5.40k|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 0, False: 5.40k]
  |  |  |  |  ------------------
  |  |  |  |   61|  5.40k|            return e;       \
  |  |  |  |   62|  5.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 5.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 5.40k]
  |  |  ------------------
  ------------------
  279|       |
  280|  5.40k|    {
  281|  5.40k|        const void* ptr = dtable;
  282|  5.40k|        const FSE_DTableHeader* DTableH = (const FSE_DTableHeader*)ptr;
  283|  5.40k|        const U32 fastMode = DTableH->fastMode;
  284|       |
  285|       |        /* select fast mode (static) */
  286|  5.40k|        if (fastMode) return FSE_decompress_usingDTable_generic(dst, dstCapacity, ip, cSrcSize, dtable, 1);
  ------------------
  |  Branch (286:13): [True: 1.54k, False: 3.85k]
  ------------------
  287|  3.85k|        return FSE_decompress_usingDTable_generic(dst, dstCapacity, ip, cSrcSize, dtable, 0);
  288|  5.40k|    }
  289|  5.40k|}
fse_decompress.c:FSE_decompress_usingDTable_generic:
  177|  5.40k|{
  178|  5.40k|    BYTE* const ostart = (BYTE*) dst;
  179|  5.40k|    BYTE* op = ostart;
  180|  5.40k|    BYTE* const omax = op + maxDstSize;
  181|  5.40k|    BYTE* const olimit = omax-3;
  182|       |
  183|  5.40k|    BIT_DStream_t bitD;
  184|  5.40k|    FSE_DState_t state1;
  185|  5.40k|    FSE_DState_t state2;
  186|       |
  187|       |    /* Init */
  188|  5.40k|    CHECK_F(BIT_initDStream(&bitD, cSrc, cSrcSize));
  ------------------
  |  |   63|  5.40k|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|  5.40k|    size_t const e = f;     \
  |  |  |  |   59|  5.40k|    do {                    \
  |  |  |  |   60|  5.40k|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 103, False: 5.29k]
  |  |  |  |  ------------------
  |  |  |  |   61|  5.40k|            return e;       \
  |  |  |  |   62|  5.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 5.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 5.29k]
  |  |  ------------------
  ------------------
  189|       |
  190|  5.29k|    FSE_initDState(&state1, &bitD, dt);
  191|  5.29k|    FSE_initDState(&state2, &bitD, dt);
  192|       |
  193|  5.29k|    RETURN_ERROR_IF(BIT_reloadDStream(&bitD)==BIT_DStream_overflow, corruption_detected, "");
  ------------------
  |  |  114|  5.29k|    do {                                                                       \
  |  |  115|  5.29k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 11, False: 5.28k]
  |  |  ------------------
  |  |  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|  5.29k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.28k]
  |  |  ------------------
  ------------------
  194|       |
  195|  5.28k|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  196|       |
  197|       |    /* 4 symbols per loop */
  198|  56.0k|    for ( ; (BIT_reloadDStream(&bitD)==BIT_DStream_unfinished) & (op<olimit) ; op+=4) {
  ------------------
  |  Branch (198:13): [True: 50.7k, False: 5.28k]
  ------------------
  199|  50.7k|        op[0] = FSE_GETSYMBOL(&state1);
  ------------------
  |  |  195|  50.7k|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (195:33): [True: 5.64k, False: 45.0k]
  |  |  ------------------
  ------------------
  200|       |
  201|  50.7k|        if (FSE_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  |  612|  50.7k|#define FSE_MAX_TABLELOG  (FSE_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  582|  50.7k|#  define FSE_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (201:13): [Folded, False: 50.7k]
  ------------------
  202|      0|            BIT_reloadDStream(&bitD);
  203|       |
  204|  50.7k|        op[1] = FSE_GETSYMBOL(&state2);
  ------------------
  |  |  195|  50.7k|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (195:33): [True: 5.64k, False: 45.0k]
  |  |  ------------------
  ------------------
  205|       |
  206|  50.7k|        if (FSE_MAX_TABLELOG*4+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  |  612|  50.7k|#define FSE_MAX_TABLELOG  (FSE_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  582|  50.7k|#  define FSE_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (206:13): [Folded, False: 50.7k]
  ------------------
  207|      0|            { if (BIT_reloadDStream(&bitD) > BIT_DStream_unfinished) { op+=2; break; } }
  ------------------
  |  Branch (207:19): [True: 0, False: 0]
  ------------------
  208|       |
  209|  50.7k|        op[2] = FSE_GETSYMBOL(&state1);
  ------------------
  |  |  195|  50.7k|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (195:33): [True: 5.64k, False: 45.0k]
  |  |  ------------------
  ------------------
  210|       |
  211|  50.7k|        if (FSE_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  |  612|  50.7k|#define FSE_MAX_TABLELOG  (FSE_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  582|  50.7k|#  define FSE_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (211:13): [Folded, False: 50.7k]
  ------------------
  212|      0|            BIT_reloadDStream(&bitD);
  213|       |
  214|  50.7k|        op[3] = FSE_GETSYMBOL(&state2);
  ------------------
  |  |  195|  50.7k|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (195:33): [True: 5.64k, False: 45.0k]
  |  |  ------------------
  ------------------
  215|  50.7k|    }
  216|       |
  217|       |    /* tail */
  218|       |    /* note : BIT_reloadDStream(&bitD) >= FSE_DStream_partiallyFilled; Ends at exactly BIT_DStream_completed */
  219|   129k|    while (1) {
  ------------------
  |  Branch (219:12): [True: 129k, Folded]
  ------------------
  220|   129k|        if (op>(omax-2)) 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 (220:13): [True: 20, False: 129k]
  ------------------
  221|   129k|        *op++ = FSE_GETSYMBOL(&state1);
  ------------------
  |  |  195|   129k|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (195:33): [True: 20.6k, False: 108k]
  |  |  ------------------
  ------------------
  222|   129k|        if (BIT_reloadDStream(&bitD)==BIT_DStream_overflow) {
  ------------------
  |  Branch (222:13): [True: 2.84k, False: 126k]
  ------------------
  223|  2.84k|            *op++ = FSE_GETSYMBOL(&state2);
  ------------------
  |  |  195|  2.84k|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (195:33): [True: 762, False: 2.08k]
  |  |  ------------------
  ------------------
  224|  2.84k|            break;
  225|  2.84k|        }
  226|       |
  227|   126k|        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: 126k]
  ------------------
  228|   126k|        *op++ = FSE_GETSYMBOL(&state2);
  ------------------
  |  |  195|   126k|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (195:33): [True: 19.8k, False: 106k]
  |  |  ------------------
  ------------------
  229|   126k|        if (BIT_reloadDStream(&bitD)==BIT_DStream_overflow) {
  ------------------
  |  Branch (229:13): [True: 2.41k, False: 124k]
  ------------------
  230|  2.41k|            *op++ = FSE_GETSYMBOL(&state1);
  ------------------
  |  |  195|  2.41k|#define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (195:33): [True: 689, False: 1.73k]
  |  |  ------------------
  ------------------
  231|  2.41k|            break;
  232|  2.41k|    }   }
  233|       |
  234|  5.26k|    assert(op >= ostart);
  ------------------
  |  |   70|  5.26k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  235|  5.26k|    return (size_t)(op-ostart);
  236|  5.28k|}
fse_decompress.c:FSE_decompress_wksp_body_default:
  293|    786|{
  294|    786|    return FSE_decompress_wksp_body(dst, dstCapacity, cSrc, cSrcSize, maxLog, workSpace, wkspSize, 0);
  295|    786|}

zstd_ddict.c:MEM_readLE32:
  322|  4.44k|{
  323|  4.44k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 4.44k, False: 0]
  ------------------
  324|  4.44k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  4.44k|}
zstd_ddict.c:MEM_isLittleEndian:
  141|  4.44k|{
  142|  4.44k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  4.44k|    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|  4.44k|}
zstd_ddict.c:MEM_read32:
  183|  4.44k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE32:
  322|   107k|{
  323|   107k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 107k, False: 0]
  ------------------
  324|   107k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|   107k|}
zstd_decompress.c:MEM_isLittleEndian:
  141|   110k|{
  142|   110k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   110k|    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|   110k|}
zstd_decompress.c:MEM_read32:
  183|   107k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE16:
  290|  1.16k|{
  291|  1.16k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 1.16k, False: 0]
  ------------------
  292|  1.16k|        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.16k|}
zstd_decompress.c:MEM_read16:
  182|  1.16k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress.c:MEM_readLE64:
  338|  1.79k|{
  339|  1.79k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 1.79k, False: 0]
  ------------------
  340|  1.79k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  1.79k|}
zstd_decompress.c:MEM_read64:
  184|  1.79k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_decompress_block.c:MEM_readLE24:
  311|  45.7k|{
  312|  45.7k|    return (U32)MEM_readLE16(memPtr) + ((U32)(((const BYTE*)memPtr)[2]) << 16);
  313|  45.7k|}
zstd_decompress_block.c:MEM_readLE32:
  322|  5.45k|{
  323|  5.45k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 5.45k, False: 0]
  ------------------
  324|  5.45k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  5.45k|}
zstd_decompress_block.c:MEM_isLittleEndian:
  141|  4.39M|{
  142|  4.39M|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  4.39M|    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|  4.39M|}
zstd_decompress_block.c:MEM_read32:
  183|  5.45k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress_block.c:MEM_write64:
  189|  46.2k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
zstd_decompress_block.c:MEM_readLE16:
  290|  46.6k|{
  291|  46.6k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 46.6k, False: 0]
  ------------------
  292|  46.6k|        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|  46.6k|}
zstd_decompress_block.c:MEM_read16:
  182|  46.6k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress_block.c:MEM_32bits:
  137|  30.1M|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_decompress_block.c:MEM_64bits:
  138|  4.48M|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_decompress_block.c:MEM_readLEST:
  354|  4.33M|{
  355|  4.33M|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 4.33M]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  4.33M|    else
  358|  4.33M|        return (size_t)MEM_readLE64(memPtr);
  359|  4.33M|}
zstd_decompress_block.c:MEM_readLE64:
  338|  4.33M|{
  339|  4.33M|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 4.33M, False: 0]
  ------------------
  340|  4.33M|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  4.33M|}
zstd_decompress_block.c:MEM_read64:
  184|  4.33M|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_v05.c:MEM_readLE32:
  322|   104k|{
  323|   104k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 104k, False: 0]
  ------------------
  324|   104k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|   104k|}
zstd_v05.c:MEM_isLittleEndian:
  141|   570k|{
  142|   570k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   570k|    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|   570k|}
zstd_v05.c:MEM_read32:
  183|   104k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_v05.c:MEM_readLEST:
  354|   127k|{
  355|   127k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 127k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|   127k|    else
  358|   127k|        return (size_t)MEM_readLE64(memPtr);
  359|   127k|}
zstd_v05.c:MEM_32bits:
  137|   257k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_v05.c:MEM_readLE64:
  338|   127k|{
  339|   127k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 127k, False: 0]
  ------------------
  340|   127k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|   127k|}
zstd_v05.c:MEM_read64:
  184|   127k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_v05.c:MEM_readLE16:
  290|  1.15k|{
  291|  1.15k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 1.15k, False: 0]
  ------------------
  292|  1.15k|        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.15k|}
zstd_v05.c:MEM_read16:
  182|  1.15k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_v05.c:MEM_64bits:
  138|  67.4k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_v05.c:MEM_writeLE16:
  300|   337k|{
  301|   337k|    if (MEM_isLittleEndian()) {
  ------------------
  |  Branch (301:9): [True: 337k, False: 0]
  ------------------
  302|   337k|        MEM_write16(memPtr, val);
  303|   337k|    } else {
  304|      0|        BYTE* p = (BYTE*)memPtr;
  305|      0|        p[0] = (BYTE)val;
  306|      0|        p[1] = (BYTE)(val>>8);
  307|      0|    }
  308|   337k|}
zstd_v05.c:MEM_write16:
  187|   337k|MEM_STATIC void MEM_write16(void* memPtr, U16 value) { *(unalign16*)memPtr = value; }
entropy_common.c:MEM_readLE32:
  322|   130k|{
  323|   130k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 130k, False: 0]
  ------------------
  324|   130k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|   130k|}
entropy_common.c:MEM_isLittleEndian:
  141|   130k|{
  142|   130k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   130k|    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|   130k|}
entropy_common.c:MEM_read32:
  183|   130k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
fse_decompress.c:MEM_write64:
  189|  16.6k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
fse_decompress.c:MEM_readLEST:
  354|  67.0k|{
  355|  67.0k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 67.0k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  67.0k|    else
  358|  67.0k|        return (size_t)MEM_readLE64(memPtr);
  359|  67.0k|}
fse_decompress.c:MEM_32bits:
  137|  67.0k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
fse_decompress.c:MEM_isLittleEndian:
  141|  67.0k|{
  142|  67.0k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  67.0k|    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|  67.0k|}
fse_decompress.c:MEM_readLE64:
  338|  67.0k|{
  339|  67.0k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 67.0k, False: 0]
  ------------------
  340|  67.0k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  67.0k|}
fse_decompress.c:MEM_read64:
  184|  67.0k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_isLittleEndian:
  141|   883k|{
  142|   883k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   883k|    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|   883k|}
huf_decompress.c:MEM_write64:
  189|  2.38M|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
huf_decompress.c:MEM_readLEST:
  354|   395k|{
  355|   395k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 395k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|   395k|    else
  358|   395k|        return (size_t)MEM_readLE64(memPtr);
  359|   395k|}
huf_decompress.c:MEM_32bits:
  137|   411k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
huf_decompress.c:MEM_readLE64:
  338|   395k|{
  339|   395k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 395k, False: 0]
  ------------------
  340|   395k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|   395k|}
huf_decompress.c:MEM_read64:
  184|   395k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_64bits:
  138|   631k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
huf_decompress.c:MEM_readLE16:
  290|  10.3k|{
  291|  10.3k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 10.3k, False: 0]
  ------------------
  292|  10.3k|        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|  10.3k|}
huf_decompress.c:MEM_read16:
  182|  10.3k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }

ZSTD_XXH64_reset:
 3561|  2.36k|{
 3562|  2.36k|    XXH_ASSERT(statePtr != NULL);
  ------------------
  |  | 2430|  2.36k|#    define XXH_ASSERT(c)   XXH_ASSUME(c)
  |  |  ------------------
  |  |  |  | 2707|  2.36k|#  define XXH_ASSUME(c) __builtin_assume(c)
  |  |  ------------------
  ------------------
 3563|  2.36k|    memset(statePtr, 0, sizeof(*statePtr));
 3564|  2.36k|    statePtr->v[0] = seed + XXH_PRIME64_1 + XXH_PRIME64_2;
  ------------------
  |  | 3361|  2.36k|#define XXH_PRIME64_1  0x9E3779B185EBCA87ULL  /*!< 0b1001111000110111011110011011000110000101111010111100101010000111 */
  ------------------
                  statePtr->v[0] = seed + XXH_PRIME64_1 + XXH_PRIME64_2;
  ------------------
  |  | 3362|  2.36k|#define XXH_PRIME64_2  0xC2B2AE3D27D4EB4FULL  /*!< 0b1100001010110010101011100011110100100111110101001110101101001111 */
  ------------------
 3565|  2.36k|    statePtr->v[1] = seed + XXH_PRIME64_2;
  ------------------
  |  | 3362|  2.36k|#define XXH_PRIME64_2  0xC2B2AE3D27D4EB4FULL  /*!< 0b1100001010110010101011100011110100100111110101001110101101001111 */
  ------------------
 3566|  2.36k|    statePtr->v[2] = seed + 0;
 3567|  2.36k|    statePtr->v[3] = seed - XXH_PRIME64_1;
  ------------------
  |  | 3361|  2.36k|#define XXH_PRIME64_1  0x9E3779B185EBCA87ULL  /*!< 0b1001111000110111011110011011000110000101111010111100101010000111 */
  ------------------
 3568|  2.36k|    return XXH_OK;
 3569|  2.36k|}
ZSTD_XXH64_update:
 3574|  17.0k|{
 3575|  17.0k|    if (input==NULL) {
  ------------------
  |  Branch (3575:9): [True: 0, False: 17.0k]
  ------------------
 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|  17.0k|    {   const xxh_u8* p = (const xxh_u8*)input;
 3581|  17.0k|        const xxh_u8* const bEnd = p + len;
 3582|       |
 3583|  17.0k|        state->total_len += len;
 3584|       |
 3585|  17.0k|        if (state->memsize + len < 32) {  /* fill in tmp buffer */
  ------------------
  |  Branch (3585:13): [True: 12.1k, False: 4.95k]
  ------------------
 3586|  12.1k|            XXH_memcpy(((xxh_u8*)state->mem64) + state->memsize, input, len);
 3587|  12.1k|            state->memsize += (xxh_u32)len;
 3588|  12.1k|            return XXH_OK;
 3589|  12.1k|        }
 3590|       |
 3591|  4.95k|        if (state->memsize) {   /* tmp buffer is full */
  ------------------
  |  Branch (3591:13): [True: 4.39k, False: 559]
  ------------------
 3592|  4.39k|            XXH_memcpy(((xxh_u8*)state->mem64) + state->memsize, input, 32-state->memsize);
 3593|  4.39k|            state->v[0] = XXH64_round(state->v[0], XXH_readLE64(state->mem64+0));
 3594|  4.39k|            state->v[1] = XXH64_round(state->v[1], XXH_readLE64(state->mem64+1));
 3595|  4.39k|            state->v[2] = XXH64_round(state->v[2], XXH_readLE64(state->mem64+2));
 3596|  4.39k|            state->v[3] = XXH64_round(state->v[3], XXH_readLE64(state->mem64+3));
 3597|  4.39k|            p += 32 - state->memsize;
 3598|  4.39k|            state->memsize = 0;
 3599|  4.39k|        }
 3600|       |
 3601|  4.95k|        if (p+32 <= bEnd) {
  ------------------
  |  Branch (3601:13): [True: 3.68k, False: 1.27k]
  ------------------
 3602|  3.68k|            const xxh_u8* const limit = bEnd - 32;
 3603|       |
 3604|  3.49M|            do {
 3605|  3.49M|                state->v[0] = XXH64_round(state->v[0], XXH_readLE64(p)); p+=8;
 3606|  3.49M|                state->v[1] = XXH64_round(state->v[1], XXH_readLE64(p)); p+=8;
 3607|  3.49M|                state->v[2] = XXH64_round(state->v[2], XXH_readLE64(p)); p+=8;
 3608|  3.49M|                state->v[3] = XXH64_round(state->v[3], XXH_readLE64(p)); p+=8;
 3609|  3.49M|            } while (p<=limit);
  ------------------
  |  Branch (3609:22): [True: 3.49M, False: 3.68k]
  ------------------
 3610|       |
 3611|  3.68k|        }
 3612|       |
 3613|  4.95k|        if (p < bEnd) {
  ------------------
  |  Branch (3613:13): [True: 4.43k, False: 527]
  ------------------
 3614|  4.43k|            XXH_memcpy(state->mem64, p, (size_t)(bEnd-p));
 3615|  4.43k|            state->memsize = (unsigned)(bEnd-p);
 3616|  4.43k|        }
 3617|  4.95k|    }
 3618|       |
 3619|      0|    return XXH_OK;
 3620|  17.0k|}
ZSTD_XXH64_digest:
 3625|     92|{
 3626|     92|    xxh_u64 h64;
 3627|       |
 3628|     92|    if (state->total_len >= 32) {
  ------------------
  |  Branch (3628:9): [True: 38, False: 54]
  ------------------
 3629|     38|        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|     38|#  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|     38|#  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|     38|#  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|     38|#  define XXH_rotl64 __builtin_rotateleft64
  ------------------
 3630|     38|        h64 = XXH64_mergeRound(h64, state->v[0]);
 3631|     38|        h64 = XXH64_mergeRound(h64, state->v[1]);
 3632|     38|        h64 = XXH64_mergeRound(h64, state->v[2]);
 3633|     38|        h64 = XXH64_mergeRound(h64, state->v[3]);
 3634|     54|    } else {
 3635|     54|        h64  = state->v[2] /*seed*/ + XXH_PRIME64_5;
  ------------------
  |  | 3365|     54|#define XXH_PRIME64_5  0x27D4EB2F165667C5ULL  /*!< 0b0010011111010100111010110010111100010110010101100110011111000101 */
  ------------------
 3636|     54|    }
 3637|       |
 3638|     92|    h64 += (xxh_u64) state->total_len;
 3639|       |
 3640|     92|    return XXH64_finalize(h64, (const xxh_u8*)state->mem64, (size_t)state->total_len, XXH_aligned);
 3641|     92|}
xxhash.c:XXH_readLE32_align:
 2813|     22|{
 2814|     22|    if (align==XXH_unaligned) {
  ------------------
  |  Branch (2814:9): [True: 0, False: 22]
  ------------------
 2815|      0|        return XXH_readLE32(ptr);
 2816|     22|    } else {
 2817|     22|        return XXH_CPU_LITTLE_ENDIAN ? *(const xxh_u32*)ptr : XXH_swap32(*(const xxh_u32*)ptr);
  ------------------
  |  | 2629|     22|#    define XXH_CPU_LITTLE_ENDIAN 1
  |  |  ------------------
  |  |  |  Branch (2629:35): [True: 22, Folded]
  |  |  ------------------
  ------------------
 2818|     22|    }
 2819|     22|}
xxhash.c:XXH_memcpy:
 2359|  20.9k|{
 2360|  20.9k|    return memcpy(dest,src,size);
 2361|  20.9k|}
xxhash.c:XXH_readLE64_align:
 3343|    122|{
 3344|    122|    if (align==XXH_unaligned)
  ------------------
  |  Branch (3344:9): [True: 0, False: 122]
  ------------------
 3345|      0|        return XXH_readLE64(ptr);
 3346|    122|    else
 3347|    122|        return XXH_CPU_LITTLE_ENDIAN ? *(const xxh_u64*)ptr : XXH_swap64(*(const xxh_u64*)ptr);
  ------------------
  |  | 2629|    122|#    define XXH_CPU_LITTLE_ENDIAN 1
  |  |  ------------------
  |  |  |  Branch (2629:35): [True: 122, Folded]
  |  |  ------------------
  ------------------
 3348|    122|}
xxhash.c:XXH64_round:
 3377|  14.0M|{
 3378|  14.0M|    acc += input * XXH_PRIME64_2;
  ------------------
  |  | 3362|  14.0M|#define XXH_PRIME64_2  0xC2B2AE3D27D4EB4FULL  /*!< 0b1100001010110010101011100011110100100111110101001110101101001111 */
  ------------------
 3379|  14.0M|    acc  = XXH_rotl64(acc, 31);
  ------------------
  |  | 2728|  14.0M|#  define XXH_rotl64 __builtin_rotateleft64
  ------------------
 3380|  14.0M|    acc *= XXH_PRIME64_1;
  ------------------
  |  | 3361|  14.0M|#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|  14.0M|    return acc;
 3399|  14.0M|}
xxhash.c:XXH_readLE64:
 3331|  14.0M|{
 3332|  14.0M|    return XXH_CPU_LITTLE_ENDIAN ? XXH_read64(ptr) : XXH_swap64(XXH_read64(ptr));
  ------------------
  |  | 2629|  14.0M|#    define XXH_CPU_LITTLE_ENDIAN 1
  |  |  ------------------
  |  |  |  Branch (2629:35): [True: 14.0M, Folded]
  |  |  ------------------
  ------------------
 3333|  14.0M|}
xxhash.c:XXH_read64:
 3261|  14.0M|{
 3262|  14.0M|    typedef __attribute__((aligned(1))) xxh_u64 xxh_unalign64;
 3263|  14.0M|    return *((const xxh_unalign64*)ptr);
 3264|  14.0M|}
xxhash.c:XXH64_mergeRound:
 3402|    152|{
 3403|    152|    val  = XXH64_round(0, val);
 3404|    152|    acc ^= val;
 3405|    152|    acc  = acc * XXH_PRIME64_1 + XXH_PRIME64_4;
  ------------------
  |  | 3361|    152|#define XXH_PRIME64_1  0x9E3779B185EBCA87ULL  /*!< 0b1001111000110111011110011011000110000101111010111100101010000111 */
  ------------------
                  acc  = acc * XXH_PRIME64_1 + XXH_PRIME64_4;
  ------------------
  |  | 3364|    152|#define XXH_PRIME64_4  0x85EBCA77C2B2AE63ULL  /*!< 0b1000010111101011110010100111011111000010101100101010111001100011 */
  ------------------
 3406|    152|    return acc;
 3407|    152|}
xxhash.c:XXH64_finalize:
 3440|     92|{
 3441|     92|    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: 92]
  ------------------
 3442|     92|    len &= 31;
 3443|    214|    while (len >= 8) {
  ------------------
  |  Branch (3443:12): [True: 122, False: 92]
  ------------------
 3444|    122|        xxh_u64 const k1 = XXH64_round(0, XXH_get64bits(ptr));
  ------------------
  |  | 3421|    122|#define XXH_get64bits(p) XXH_readLE64_align(p, align)
  ------------------
 3445|    122|        ptr += 8;
 3446|    122|        hash ^= k1;
 3447|    122|        hash  = XXH_rotl64(hash,27) * XXH_PRIME64_1 + XXH_PRIME64_4;
  ------------------
  |  | 2728|    122|#  define XXH_rotl64 __builtin_rotateleft64
  ------------------
                      hash  = XXH_rotl64(hash,27) * XXH_PRIME64_1 + XXH_PRIME64_4;
  ------------------
  |  | 3361|    122|#define XXH_PRIME64_1  0x9E3779B185EBCA87ULL  /*!< 0b1001111000110111011110011011000110000101111010111100101010000111 */
  ------------------
                      hash  = XXH_rotl64(hash,27) * XXH_PRIME64_1 + XXH_PRIME64_4;
  ------------------
  |  | 3364|    122|#define XXH_PRIME64_4  0x85EBCA77C2B2AE63ULL  /*!< 0b1000010111101011110010100111011111000010101100101010111001100011 */
  ------------------
 3448|    122|        len -= 8;
 3449|    122|    }
 3450|     92|    if (len >= 4) {
  ------------------
  |  Branch (3450:9): [True: 22, False: 70]
  ------------------
 3451|     22|        hash ^= (xxh_u64)(XXH_get32bits(ptr)) * XXH_PRIME64_1;
  ------------------
  |  | 2933|     22|#define XXH_get32bits(p) XXH_readLE32_align(p, align)
  ------------------
                      hash ^= (xxh_u64)(XXH_get32bits(ptr)) * XXH_PRIME64_1;
  ------------------
  |  | 3361|     22|#define XXH_PRIME64_1  0x9E3779B185EBCA87ULL  /*!< 0b1001111000110111011110011011000110000101111010111100101010000111 */
  ------------------
 3452|     22|        ptr += 4;
 3453|     22|        hash = XXH_rotl64(hash, 23) * XXH_PRIME64_2 + XXH_PRIME64_3;
  ------------------
  |  | 2728|     22|#  define XXH_rotl64 __builtin_rotateleft64
  ------------------
                      hash = XXH_rotl64(hash, 23) * XXH_PRIME64_2 + XXH_PRIME64_3;
  ------------------
  |  | 3362|     22|#define XXH_PRIME64_2  0xC2B2AE3D27D4EB4FULL  /*!< 0b1100001010110010101011100011110100100111110101001110101101001111 */
  ------------------
                      hash = XXH_rotl64(hash, 23) * XXH_PRIME64_2 + XXH_PRIME64_3;
  ------------------
  |  | 3363|     22|#define XXH_PRIME64_3  0x165667B19E3779F9ULL  /*!< 0b0001011001010110011001111011000110011110001101110111100111111001 */
  ------------------
 3454|     22|        len -= 4;
 3455|     22|    }
 3456|    210|    while (len > 0) {
  ------------------
  |  Branch (3456:12): [True: 118, False: 92]
  ------------------
 3457|    118|        hash ^= (*ptr++) * XXH_PRIME64_5;
  ------------------
  |  | 3365|    118|#define XXH_PRIME64_5  0x27D4EB2F165667C5ULL  /*!< 0b0010011111010100111010110010111100010110010101100110011111000101 */
  ------------------
 3458|    118|        hash = XXH_rotl64(hash, 11) * XXH_PRIME64_1;
  ------------------
  |  | 2728|    118|#  define XXH_rotl64 __builtin_rotateleft64
  ------------------
                      hash = XXH_rotl64(hash, 11) * XXH_PRIME64_1;
  ------------------
  |  | 3361|    118|#define XXH_PRIME64_1  0x9E3779B185EBCA87ULL  /*!< 0b1001111000110111011110011011000110000101111010111100101010000111 */
  ------------------
 3459|    118|        --len;
 3460|    118|    }
 3461|     92|    return  XXH64_avalanche(hash);
 3462|     92|}
xxhash.c:XXH64_avalanche:
 3411|     92|{
 3412|     92|    hash ^= hash >> 33;
 3413|     92|    hash *= XXH_PRIME64_2;
  ------------------
  |  | 3362|     92|#define XXH_PRIME64_2  0xC2B2AE3D27D4EB4FULL  /*!< 0b1100001010110010101011100011110100100111110101001110101101001111 */
  ------------------
 3414|     92|    hash ^= hash >> 29;
 3415|     92|    hash *= XXH_PRIME64_3;
  ------------------
  |  | 3363|     92|#define XXH_PRIME64_3  0x165667B19E3779F9ULL  /*!< 0b0001011001010110011001111011000110011110001101110111100111111001 */
  ------------------
 3416|     92|    hash ^= hash >> 32;
 3417|     92|    return hash;
 3418|     92|}

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

zstd_decompress.c:ZSTD_cpuSupportsBmi2:
  319|  10.2k|{
  320|  10.2k|    ZSTD_cpuid_t cpuid = ZSTD_cpuid();
  321|  10.2k|    return ZSTD_cpuid_bmi1(cpuid) && ZSTD_cpuid_bmi2(cpuid);
  ------------------
  |  Branch (321:12): [True: 10.2k, False: 0]
  |  Branch (321:38): [True: 10.2k, False: 0]
  ------------------
  322|  10.2k|}
zstd_decompress_block.c:ZSTD_wildcopy:
  217|  2.92M|{
  218|  2.92M|    ptrdiff_t diff = (BYTE*)dst - (const BYTE*)src;
  219|  2.92M|    const BYTE* ip = (const BYTE*)src;
  220|  2.92M|    BYTE* op = (BYTE*)dst;
  221|  2.92M|    BYTE* const oend = op + length;
  222|       |
  223|  2.92M|    if (ovtype == ZSTD_overlap_src_before_dst && diff < WILDCOPY_VECLEN) {
  ------------------
  |  |  200|   206k|#define WILDCOPY_VECLEN 16
  ------------------
  |  Branch (223:9): [True: 206k, False: 2.72M]
  |  Branch (223:50): [True: 205k, False: 199]
  ------------------
  224|       |        /* Handle short offset copies. */
  225|   920k|        do {
  226|   920k|            COPY8(op, ip);
  ------------------
  |  |  177|   920k|#define COPY8(d,s) do { ZSTD_copy8(d,s); d+=8; s+=8; } while (0)
  |  |  ------------------
  |  |  |  Branch (177:63): [Folded, False: 920k]
  |  |  ------------------
  ------------------
  227|   920k|        } while (op < oend);
  ------------------
  |  Branch (227:18): [True: 714k, False: 205k]
  ------------------
  228|  2.72M|    } else {
  229|  2.72M|        assert(diff >= WILDCOPY_VECLEN || diff <= -WILDCOPY_VECLEN);
  ------------------
  |  |   70|  2.72M|#    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|  2.72M|        ZSTD_copy16(op, ip);
  237|  2.72M|        if (16 >= length) return;
  ------------------
  |  Branch (237:13): [True: 2.57M, False: 142k]
  ------------------
  238|   142k|        op += 16;
  239|   142k|        ip += 16;
  240|   743k|        do {
  241|   743k|            COPY16(op, ip);
  ------------------
  |  |  197|   743k|#define COPY16(d,s) do { ZSTD_copy16(d,s); d+=16; s+=16; } while (0)
  |  |  ------------------
  |  |  |  Branch (197:67): [Folded, False: 743k]
  |  |  ------------------
  ------------------
  242|   743k|            COPY16(op, ip);
  ------------------
  |  |  197|   743k|#define COPY16(d,s) do { ZSTD_copy16(d,s); d+=16; s+=16; } while (0)
  |  |  ------------------
  |  |  |  Branch (197:67): [Folded, False: 743k]
  |  |  ------------------
  ------------------
  243|   743k|        }
  244|   743k|        while (op < oend);
  ------------------
  |  Branch (244:16): [True: 600k, False: 142k]
  ------------------
  245|   142k|    }
  246|  2.92M|}
zstd_decompress_block.c:ZSTD_copy8:
  170|  1.92M|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|  1.92M|    ZSTD_memcpy(dst, src, 8);
  ------------------
  |  |   44|  1.92M|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  175|  1.92M|#endif
  176|  1.92M|}
zstd_decompress_block.c:ZSTD_copy16:
  183|  8.62M|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.62M|}

HUF_readDTableX1_wksp:
  386|  4.83k|{
  387|  4.83k|    U32 tableLog = 0;
  388|  4.83k|    U32 nbSymbols = 0;
  389|  4.83k|    size_t iSize;
  390|  4.83k|    void* const dtPtr = DTable + 1;
  391|  4.83k|    HUF_DEltX1* const dt = (HUF_DEltX1*)dtPtr;
  392|  4.83k|    HUF_ReadDTableX1_Workspace* wksp = (HUF_ReadDTableX1_Workspace*)workSpace;
  393|       |
  394|  4.83k|    DEBUG_STATIC_ASSERT(HUF_DECOMPRESS_WORKSPACE_SIZE >= sizeof(*wksp));
  ------------------
  |  |   39|  4.83k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  395|  4.83k|    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: 4.83k]
  ------------------
  396|       |
  397|  4.83k|    DEBUG_STATIC_ASSERT(sizeof(DTableDesc) == sizeof(HUF_DTable));
  ------------------
  |  |   39|  4.83k|#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|  4.83k|    iSize = HUF_readStats_wksp(wksp->huffWeight, HUF_SYMBOLVALUE_MAX + 1, wksp->rankVal, &nbSymbols, &tableLog, src, srcSize, wksp->statsWksp, sizeof(wksp->statsWksp), flags);
  ------------------
  |  |   39|  4.83k|#define HUF_SYMBOLVALUE_MAX  255
  ------------------
  401|  4.83k|    if (HUF_isError(iSize)) return iSize;
  ------------------
  |  |   78|  4.83k|#define HUF_isError ERR_isError
  ------------------
  |  Branch (401:9): [True: 262, False: 4.56k]
  ------------------
  402|       |
  403|       |
  404|       |    /* Table header */
  405|  4.56k|    {   DTableDesc dtd = HUF_getDTableDesc(DTable);
  406|  4.56k|        U32 const maxTableLog = dtd.maxTableLog + 1;
  407|  4.56k|        U32 const targetTableLog = MIN(maxTableLog, HUF_DECODER_FAST_TABLELOG);
  ------------------
  |  |   54|  4.56k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 0, False: 4.56k]
  |  |  ------------------
  ------------------
  408|  4.56k|        tableLog = HUF_rescaleStats(wksp->huffWeight, wksp->rankVal, nbSymbols, tableLog, targetTableLog);
  409|  4.56k|        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: 4.56k]
  ------------------
  410|  4.56k|        dtd.tableType = 0;
  411|  4.56k|        dtd.tableLog = (BYTE)tableLog;
  412|  4.56k|        ZSTD_memcpy(DTable, &dtd, sizeof(dtd));
  ------------------
  |  |   44|  4.56k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  413|  4.56k|    }
  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|  4.56k|        U32 nextRankStart = 0;
  429|  4.56k|        int const unroll = 4;
  430|  4.56k|        int const nLimit = (int)nbSymbols - unroll + 1;
  431|  59.4k|        for (n=0; n<(int)tableLog+1; n++) {
  ------------------
  |  Branch (431:19): [True: 54.9k, False: 4.56k]
  ------------------
  432|  54.9k|            U32 const curr = nextRankStart;
  433|  54.9k|            nextRankStart += wksp->rankVal[n];
  434|  54.9k|            wksp->rankStart[n] = curr;
  435|  54.9k|        }
  436|   102k|        for (n=0; n < nLimit; n += unroll) {
  ------------------
  |  Branch (436:19): [True: 98.0k, False: 4.56k]
  ------------------
  437|  98.0k|            int u;
  438|   490k|            for (u=0; u < unroll; ++u) {
  ------------------
  |  Branch (438:23): [True: 392k, False: 98.0k]
  ------------------
  439|   392k|                size_t const w = wksp->huffWeight[n+u];
  440|   392k|                wksp->symbols[wksp->rankStart[w]++] = (BYTE)(n+u);
  441|   392k|            }
  442|  98.0k|        }
  443|  11.0k|        for (; n < (int)nbSymbols; ++n) {
  ------------------
  |  Branch (443:16): [True: 6.50k, False: 4.56k]
  ------------------
  444|  6.50k|            size_t const w = wksp->huffWeight[n];
  445|  6.50k|            wksp->symbols[wksp->rankStart[w]++] = (BYTE)n;
  446|  6.50k|        }
  447|  4.56k|    }
  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|  4.56k|    {   U32 w;
  456|  4.56k|        int symbol = wksp->rankVal[0];
  457|  4.56k|        int rankStart = 0;
  458|  54.9k|        for (w=1; w<tableLog+1; ++w) {
  ------------------
  |  Branch (458:19): [True: 50.3k, False: 4.56k]
  ------------------
  459|  50.3k|            int const symbolCount = wksp->rankVal[w];
  460|  50.3k|            int const length = (1 << w) >> 1;
  461|  50.3k|            int uStart = rankStart;
  462|  50.3k|            BYTE const nbBits = (BYTE)(tableLog + 1 - w);
  463|  50.3k|            int s;
  464|  50.3k|            int u;
  465|  50.3k|            switch (length) {
  466|  4.56k|            case 1:
  ------------------
  |  Branch (466:13): [True: 4.56k, False: 45.7k]
  ------------------
  467|  11.6k|                for (s=0; s<symbolCount; ++s) {
  ------------------
  |  Branch (467:27): [True: 7.10k, False: 4.56k]
  ------------------
  468|  7.10k|                    HUF_DEltX1 D;
  469|  7.10k|                    D.byte = wksp->symbols[symbol + s];
  470|  7.10k|                    D.nbBits = nbBits;
  471|  7.10k|                    dt[uStart] = D;
  472|  7.10k|                    uStart += 1;
  473|  7.10k|                }
  474|  4.56k|                break;
  475|  4.56k|            case 2:
  ------------------
  |  Branch (475:13): [True: 4.56k, False: 45.7k]
  ------------------
  476|  6.63k|                for (s=0; s<symbolCount; ++s) {
  ------------------
  |  Branch (476:27): [True: 2.06k, False: 4.56k]
  ------------------
  477|  2.06k|                    HUF_DEltX1 D;
  478|  2.06k|                    D.byte = wksp->symbols[symbol + s];
  479|  2.06k|                    D.nbBits = nbBits;
  480|  2.06k|                    dt[uStart+0] = D;
  481|  2.06k|                    dt[uStart+1] = D;
  482|  2.06k|                    uStart += 2;
  483|  2.06k|                }
  484|  4.56k|                break;
  485|  4.56k|            case 4:
  ------------------
  |  Branch (485:13): [True: 4.56k, False: 45.7k]
  ------------------
  486|  7.99k|                for (s=0; s<symbolCount; ++s) {
  ------------------
  |  Branch (486:27): [True: 3.42k, False: 4.56k]
  ------------------
  487|  3.42k|                    U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits);
  488|  3.42k|                    MEM_write64(dt + uStart, D4);
  489|  3.42k|                    uStart += 4;
  490|  3.42k|                }
  491|  4.56k|                break;
  492|  4.56k|            case 8:
  ------------------
  |  Branch (492:13): [True: 4.56k, False: 45.7k]
  ------------------
  493|  18.3k|                for (s=0; s<symbolCount; ++s) {
  ------------------
  |  Branch (493:27): [True: 13.8k, False: 4.56k]
  ------------------
  494|  13.8k|                    U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits);
  495|  13.8k|                    MEM_write64(dt + uStart, D4);
  496|  13.8k|                    MEM_write64(dt + uStart + 4, D4);
  497|  13.8k|                    uStart += 8;
  498|  13.8k|                }
  499|  4.56k|                break;
  500|  32.0k|            default:
  ------------------
  |  Branch (500:13): [True: 32.0k, False: 18.2k]
  ------------------
  501|   233k|                for (s=0; s<symbolCount; ++s) {
  ------------------
  |  Branch (501:27): [True: 201k, False: 32.0k]
  ------------------
  502|   201k|                    U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits);
  503|   788k|                    for (u=0; u < length; u += 16) {
  ------------------
  |  Branch (503:31): [True: 587k, False: 201k]
  ------------------
  504|   587k|                        MEM_write64(dt + uStart + u + 0, D4);
  505|   587k|                        MEM_write64(dt + uStart + u + 4, D4);
  506|   587k|                        MEM_write64(dt + uStart + u + 8, D4);
  507|   587k|                        MEM_write64(dt + uStart + u + 12, D4);
  508|   587k|                    }
  509|   201k|                    assert(u == length);
  ------------------
  |  |   70|   201k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  510|   201k|                    uStart += length;
  511|   201k|                }
  512|  32.0k|                break;
  513|  50.3k|            }
  514|  50.3k|            symbol += symbolCount;
  515|  50.3k|            rankStart += symbolCount * length;
  516|  50.3k|        }
  517|  4.56k|    }
  518|  4.56k|    return iSize;
  519|  4.56k|}
HUF_readDTableX2_wksp:
 1182|  1.08k|{
 1183|  1.08k|    U32 tableLog, maxW, nbSymbols;
 1184|  1.08k|    DTableDesc dtd = HUF_getDTableDesc(DTable);
 1185|  1.08k|    U32 maxTableLog = dtd.maxTableLog;
 1186|  1.08k|    size_t iSize;
 1187|  1.08k|    void* dtPtr = DTable+1;   /* force compiler to avoid strict-aliasing */
 1188|  1.08k|    HUF_DEltX2* const dt = (HUF_DEltX2*)dtPtr;
 1189|  1.08k|    U32 *rankStart;
 1190|       |
 1191|  1.08k|    HUF_ReadDTableX2_Workspace* const wksp = (HUF_ReadDTableX2_Workspace*)workSpace;
 1192|       |
 1193|  1.08k|    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: 1.08k]
  ------------------
 1194|       |
 1195|  1.08k|    rankStart = wksp->rankStart0 + 1;
 1196|  1.08k|    ZSTD_memset(wksp->rankStats, 0, sizeof(wksp->rankStats));
  ------------------
  |  |   46|  1.08k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
 1197|  1.08k|    ZSTD_memset(wksp->rankStart0, 0, sizeof(wksp->rankStart0));
  ------------------
  |  |   46|  1.08k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
 1198|       |
 1199|  1.08k|    DEBUG_STATIC_ASSERT(sizeof(HUF_DEltX2) == sizeof(HUF_DTable));   /* if compiler fails here, assertion is wrong */
  ------------------
  |  |   39|  1.08k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
 1200|  1.08k|    if (maxTableLog > HUF_TABLELOG_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   37|  1.08k|#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: 1.08k]
  ------------------
 1201|       |    /* ZSTD_memset(weightList, 0, sizeof(weightList)); */  /* is not necessary, even though some analyzer complain ... */
 1202|       |
 1203|  1.08k|    iSize = HUF_readStats_wksp(wksp->weightList, HUF_SYMBOLVALUE_MAX + 1, wksp->rankStats, &nbSymbols, &tableLog, src, srcSize, wksp->calleeWksp, sizeof(wksp->calleeWksp), flags);
  ------------------
  |  |   39|  1.08k|#define HUF_SYMBOLVALUE_MAX  255
  ------------------
 1204|  1.08k|    if (HUF_isError(iSize)) return iSize;
  ------------------
  |  |   78|  1.08k|#define HUF_isError ERR_isError
  ------------------
  |  Branch (1204:9): [True: 126, False: 961]
  ------------------
 1205|       |
 1206|       |    /* check result */
 1207|    961|    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: 961]
  ------------------
 1208|    961|    if (tableLog <= HUF_DECODER_FAST_TABLELOG && maxTableLog > HUF_DECODER_FAST_TABLELOG) maxTableLog = HUF_DECODER_FAST_TABLELOG;
  ------------------
  |  |   31|  1.92k|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
                  if (tableLog <= HUF_DECODER_FAST_TABLELOG && maxTableLog > HUF_DECODER_FAST_TABLELOG) maxTableLog = HUF_DECODER_FAST_TABLELOG;
  ------------------
  |  |   31|    824|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
                  if (tableLog <= HUF_DECODER_FAST_TABLELOG && maxTableLog > HUF_DECODER_FAST_TABLELOG) maxTableLog = HUF_DECODER_FAST_TABLELOG;
  ------------------
  |  |   31|    824|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
  |  Branch (1208:9): [True: 824, False: 137]
  |  Branch (1208:50): [True: 824, False: 0]
  ------------------
 1209|       |
 1210|       |    /* find maxWeight */
 1211|  1.99k|    for (maxW = tableLog; wksp->rankStats[maxW]==0; maxW--) {}  /* necessarily finds a solution before 0 */
  ------------------
  |  Branch (1211:27): [True: 1.03k, False: 961]
  ------------------
 1212|       |
 1213|       |    /* Get start index of each weight */
 1214|    961|    {   U32 w, nextRankStart = 0;
 1215|  6.83k|        for (w=1; w<maxW+1; w++) {
  ------------------
  |  Branch (1215:19): [True: 5.87k, False: 961]
  ------------------
 1216|  5.87k|            U32 curr = nextRankStart;
 1217|  5.87k|            nextRankStart += wksp->rankStats[w];
 1218|  5.87k|            rankStart[w] = curr;
 1219|  5.87k|        }
 1220|    961|        rankStart[0] = nextRankStart;   /* put all 0w symbols at the end of sorted list*/
 1221|    961|        rankStart[maxW+1] = nextRankStart;
 1222|    961|    }
 1223|       |
 1224|       |    /* sort symbols by weight */
 1225|    961|    {   U32 s;
 1226|  64.3k|        for (s=0; s<nbSymbols; s++) {
  ------------------
  |  Branch (1226:19): [True: 63.3k, False: 961]
  ------------------
 1227|  63.3k|            U32 const w = wksp->weightList[s];
 1228|  63.3k|            U32 const r = rankStart[w]++;
 1229|  63.3k|            wksp->sortedSymbol[r].symbol = (BYTE)s;
 1230|  63.3k|        }
 1231|    961|        rankStart[0] = 0;   /* forget 0w symbols; this is beginning of weight(1) */
 1232|    961|    }
 1233|       |
 1234|       |    /* Build rankVal */
 1235|    961|    {   U32* const rankVal0 = wksp->rankVal[0];
 1236|    961|        {   int const rescale = (maxTableLog-tableLog) - 1;   /* tableLog <= maxTableLog */
 1237|    961|            U32 nextRankVal = 0;
 1238|    961|            U32 w;
 1239|  6.83k|            for (w=1; w<maxW+1; w++) {
  ------------------
  |  Branch (1239:23): [True: 5.87k, False: 961]
  ------------------
 1240|  5.87k|                U32 curr = nextRankVal;
 1241|  5.87k|                nextRankVal += wksp->rankStats[w] << (w+rescale);
 1242|  5.87k|                rankVal0[w] = curr;
 1243|  5.87k|        }   }
 1244|    961|        {   U32 const minBits = tableLog+1 - maxW;
 1245|    961|            U32 consumed;
 1246|  8.66k|            for (consumed = minBits; consumed < maxTableLog - minBits + 1; consumed++) {
  ------------------
  |  Branch (1246:38): [True: 7.70k, False: 961]
  ------------------
 1247|  7.70k|                U32* const rankValPtr = wksp->rankVal[consumed];
 1248|  7.70k|                U32 w;
 1249|  59.3k|                for (w = 1; w < maxW+1; w++) {
  ------------------
  |  Branch (1249:29): [True: 51.6k, False: 7.70k]
  ------------------
 1250|  51.6k|                    rankValPtr[w] = rankVal0[w] >> consumed;
 1251|  51.6k|    }   }   }   }
 1252|       |
 1253|    961|    HUF_fillDTableX2(dt, maxTableLog,
 1254|    961|                   wksp->sortedSymbol,
 1255|    961|                   wksp->rankStart0, wksp->rankVal, maxW,
 1256|    961|                   tableLog+1);
 1257|       |
 1258|    961|    dtd.tableLog = (BYTE)maxTableLog;
 1259|    961|    dtd.tableType = 1;
 1260|    961|    ZSTD_memcpy(DTable, &dtd, sizeof(dtd));
  ------------------
  |  |   44|    961|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1261|    961|    return iSize;
 1262|    961|}
HUF_selectDecoder:
 1822|  3.07k|{
 1823|  3.07k|    assert(dstSize > 0);
  ------------------
  |  |   70|  3.07k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1824|  3.07k|    assert(dstSize <= 128*1024);
  ------------------
  |  |   70|  3.07k|#    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|  3.07k|    {   U32 const Q = (cSrcSize >= dstSize) ? 15 : (U32)(cSrcSize * 16 / dstSize);   /* Q < 16 */
  ------------------
  |  Branch (1835:23): [True: 799, False: 2.27k]
  ------------------
 1836|  3.07k|        U32 const D256 = (U32)(dstSize >> 8);
 1837|  3.07k|        U32 const DTime0 = algoTime[Q][0].tableTime + (algoTime[Q][0].decode256Time * D256);
 1838|  3.07k|        U32 DTime1 = algoTime[Q][1].tableTime + (algoTime[Q][1].decode256Time * D256);
 1839|  3.07k|        DTime1 += DTime1 >> 5;  /* small advantage to algorithm using less memory, to reduce cache eviction */
 1840|  3.07k|        return DTime1 < DTime0;
 1841|  3.07k|    }
 1842|  3.07k|#endif
 1843|  3.07k|}
HUF_decompress1X_usingDTable:
 1877|    237|{
 1878|    237|    DTableDesc const dtd = HUF_getDTableDesc(DTable);
 1879|       |#if defined(HUF_FORCE_DECOMPRESS_X1)
 1880|       |    (void)dtd;
 1881|       |    assert(dtd.tableType == 0);
 1882|       |    return HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);
 1883|       |#elif defined(HUF_FORCE_DECOMPRESS_X2)
 1884|       |    (void)dtd;
 1885|       |    assert(dtd.tableType == 1);
 1886|       |    return HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);
 1887|       |#else
 1888|    237|    return dtd.tableType ? HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags) :
  ------------------
  |  Branch (1888:12): [True: 235, False: 2]
  ------------------
 1889|    237|                           HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);
 1890|    237|#endif
 1891|    237|}
HUF_decompress1X1_DCtx_wksp:
 1895|  1.84k|{
 1896|  1.84k|    const BYTE* ip = (const BYTE*) cSrc;
 1897|       |
 1898|  1.84k|    size_t const hSize = HUF_readDTableX1_wksp(dctx, cSrc, cSrcSize, workSpace, wkspSize, flags);
 1899|  1.84k|    if (HUF_isError(hSize)) return hSize;
  ------------------
  |  |   78|  1.84k|#define HUF_isError ERR_isError
  ------------------
  |  Branch (1899:9): [True: 172, False: 1.66k]
  ------------------
 1900|  1.66k|    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   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 (1900:9): [True: 47, False: 1.62k]
  ------------------
 1901|  1.62k|    ip += hSize; cSrcSize -= hSize;
 1902|       |
 1903|  1.62k|    return HUF_decompress1X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, flags);
 1904|  1.66k|}
HUF_decompress4X_usingDTable:
 1908|    247|{
 1909|    247|    DTableDesc const dtd = HUF_getDTableDesc(DTable);
 1910|       |#if defined(HUF_FORCE_DECOMPRESS_X1)
 1911|       |    (void)dtd;
 1912|       |    assert(dtd.tableType == 0);
 1913|       |    return HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);
 1914|       |#elif defined(HUF_FORCE_DECOMPRESS_X2)
 1915|       |    (void)dtd;
 1916|       |    assert(dtd.tableType == 1);
 1917|       |    return HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);
 1918|       |#else
 1919|    247|    return dtd.tableType ? HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags) :
  ------------------
  |  Branch (1919:12): [True: 232, False: 15]
  ------------------
 1920|    247|                           HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);
 1921|    247|#endif
 1922|    247|}
HUF_decompress4X_hufOnly_wksp:
 1925|  3.07k|{
 1926|       |    /* validation checks */
 1927|  3.07k|    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: 3.07k]
  ------------------
 1928|  3.07k|    if (cSrcSize == 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 (1928:9): [True: 4, False: 3.07k]
  ------------------
 1929|       |
 1930|  3.07k|    {   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|  3.07k|        return algoNb ? HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags) :
  ------------------
  |  Branch (1940:16): [True: 84, False: 2.99k]
  ------------------
 1941|  3.07k|                        HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags);
 1942|  3.07k|#endif
 1943|  3.07k|    }
 1944|  3.07k|}
huf_decompress.c:HUF_getDTableDesc:
  144|  11.5k|{
  145|  11.5k|    DTableDesc dtd;
  146|  11.5k|    ZSTD_memcpy(&dtd, table, sizeof(dtd));
  ------------------
  |  |   44|  11.5k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  147|  11.5k|    return dtd;
  148|  11.5k|}
huf_decompress.c:HUF_rescaleStats:
  353|  4.56k|{
  354|  4.56k|    if (tableLog > targetTableLog)
  ------------------
  |  Branch (354:9): [True: 87, False: 4.48k]
  ------------------
  355|     87|        return tableLog;
  356|  4.48k|    if (tableLog < targetTableLog) {
  ------------------
  |  Branch (356:9): [True: 4.36k, False: 113]
  ------------------
  357|  4.36k|        U32 const scale = targetTableLog - tableLog;
  358|  4.36k|        U32 s;
  359|       |        /* Increase the weight for all non-zero probability symbols by scale. */
  360|   390k|        for (s = 0; s < nbSymbols; ++s) {
  ------------------
  |  Branch (360:21): [True: 386k, False: 4.36k]
  ------------------
  361|   386k|            huffWeight[s] += (BYTE)((huffWeight[s] == 0) ? 0 : scale);
  ------------------
  |  Branch (361:37): [True: 169k, False: 216k]
  ------------------
  362|   386k|        }
  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|  31.5k|        for (s = targetTableLog; s > scale; --s) {
  ------------------
  |  Branch (367:34): [True: 27.1k, False: 4.36k]
  ------------------
  368|  27.1k|            rankVal[s] = rankVal[s - scale];
  369|  27.1k|        }
  370|  25.2k|        for (s = scale; s > 0; --s) {
  ------------------
  |  Branch (370:25): [True: 20.8k, False: 4.36k]
  ------------------
  371|  20.8k|            rankVal[s] = 0;
  372|  20.8k|        }
  373|  4.36k|    }
  374|  4.48k|    return targetTableLog;
  375|  4.56k|}
huf_decompress.c:HUF_DEltX1_set4:
  335|   218k|static U64 HUF_DEltX1_set4(BYTE symbol, BYTE nbBits) {
  336|   218k|    U64 D4;
  337|   218k|    if (MEM_isLittleEndian()) {
  ------------------
  |  Branch (337:9): [True: 218k, False: 0]
  ------------------
  338|   218k|        D4 = (U64)((symbol << 8) + nbBits);
  339|   218k|    } else {
  340|      0|        D4 = (U64)(symbol + (nbBits << 8));
  341|      0|    }
  342|   218k|    assert(D4 < (1U << 16));
  ------------------
  |  |   70|   218k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  343|   218k|    D4 *= 0x0001000100010001ULL;
  344|   218k|    return D4;
  345|   218k|}
huf_decompress.c:HUF_fillDTableX2:
 1128|    961|{
 1129|    961|    U32* const rankVal = rankValOrigin[0];
 1130|    961|    const int scaleLog = nbBitsBaseline - targetLog;   /* note : targetLog >= srcLog, hence scaleLog <= 1 */
 1131|    961|    const U32 minBits  = nbBitsBaseline - maxWeight;
 1132|    961|    int w;
 1133|    961|    int const wEnd = (int)maxWeight + 1;
 1134|       |
 1135|       |    /* Fill DTable in order of weight. */
 1136|  6.83k|    for (w = 1; w < wEnd; ++w) {
  ------------------
  |  Branch (1136:17): [True: 5.87k, False: 961]
  ------------------
 1137|  5.87k|        int const begin = (int)rankStart[w];
 1138|  5.87k|        int const end = (int)rankStart[w+1];
 1139|  5.87k|        U32 const nbBits = nbBitsBaseline - w;
 1140|       |
 1141|  5.87k|        if (targetLog-nbBits >= minBits) {
  ------------------
  |  Branch (1141:13): [True: 5.24k, False: 630]
  ------------------
 1142|       |            /* Enough room for a second symbol. */
 1143|  5.24k|            int start = rankVal[w];
 1144|  5.24k|            U32 const length = 1U << ((targetLog - nbBits) & 0x1F /* quiet static-analyzer */);
 1145|  5.24k|            int minWeight = nbBits + scaleLog;
 1146|  5.24k|            int s;
 1147|  5.24k|            if (minWeight < 1) minWeight = 1;
  ------------------
  |  Branch (1147:17): [True: 1.16k, False: 4.07k]
  ------------------
 1148|       |            /* Fill the DTable for every symbol of weight w.
 1149|       |             * These symbols get at least 1 second symbol.
 1150|       |             */
 1151|  35.5k|            for (s = begin; s != end; ++s) {
  ------------------
  |  Branch (1151:29): [True: 30.2k, False: 5.24k]
  ------------------
 1152|  30.2k|                HUF_fillDTableX2Level2(
 1153|  30.2k|                    DTable + start, targetLog, nbBits,
 1154|  30.2k|                    rankValOrigin[nbBits], minWeight, wEnd,
 1155|  30.2k|                    sortedList, rankStart,
 1156|  30.2k|                    nbBitsBaseline, sortedList[s].symbol);
 1157|  30.2k|                start += length;
 1158|  30.2k|            }
 1159|  5.24k|        } else {
 1160|       |            /* Only a single symbol. */
 1161|    630|            HUF_fillDTableX2ForWeight(
 1162|    630|                DTable + rankVal[w],
 1163|    630|                sortedList + begin, sortedList + end,
 1164|    630|                nbBits, targetLog,
 1165|    630|                /* baseSeq */ 0, /* level */ 1);
 1166|    630|        }
 1167|  5.87k|    }
 1168|    961|}
huf_decompress.c:HUF_fillDTableX2Level2:
 1073|  30.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|  30.2k|    if (minWeight>1) {
  ------------------
  |  Branch (1078:9): [True: 26.9k, False: 3.29k]
  ------------------
 1079|  26.9k|        U32 const length = 1U << ((targetLog - consumedBits) & 0x1F /* quiet static-analyzer */);
 1080|  26.9k|        U64 const DEltX2 = HUF_buildDEltX2U64(baseSeq, consumedBits, /* baseSeq */ 0, /* level */ 1);
 1081|  26.9k|        int const skipSize = rankVal[minWeight];
 1082|  26.9k|        assert(length > 1);
  ------------------
  |  |   70|  26.9k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1083|  26.9k|        assert((U32)skipSize < length);
  ------------------
  |  |   70|  26.9k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1084|  26.9k|        switch (length) {
 1085|    910|        case 2:
  ------------------
  |  Branch (1085:9): [True: 910, False: 26.0k]
  ------------------
 1086|    910|            assert(skipSize == 1);
  ------------------
  |  |   70|    910|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1087|    910|            ZSTD_memcpy(DTable, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|    910|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1088|    910|            break;
 1089|  2.10k|        case 4:
  ------------------
  |  Branch (1089:9): [True: 2.10k, False: 24.8k]
  ------------------
 1090|  2.10k|            assert(skipSize <= 4);
  ------------------
  |  |   70|  2.10k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1091|  2.10k|            ZSTD_memcpy(DTable + 0, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  2.10k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1092|  2.10k|            ZSTD_memcpy(DTable + 2, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  2.10k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1093|  2.10k|            break;
 1094|  23.9k|        default:
  ------------------
  |  Branch (1094:9): [True: 23.9k, False: 3.01k]
  ------------------
 1095|  23.9k|            {
 1096|  23.9k|                int i;
 1097|  62.6k|                for (i = 0; i < skipSize; i += 8) {
  ------------------
  |  Branch (1097:29): [True: 38.7k, False: 23.9k]
  ------------------
 1098|  38.7k|                    ZSTD_memcpy(DTable + i + 0, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  38.7k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1099|  38.7k|                    ZSTD_memcpy(DTable + i + 2, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  38.7k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1100|  38.7k|                    ZSTD_memcpy(DTable + i + 4, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  38.7k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1101|  38.7k|                    ZSTD_memcpy(DTable + i + 6, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  38.7k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1102|  38.7k|                }
 1103|  23.9k|            }
 1104|  26.9k|        }
 1105|  26.9k|    }
 1106|       |
 1107|       |    /* Fill each of the second level symbols by weight. */
 1108|  30.2k|    {
 1109|  30.2k|        int w;
 1110|   123k|        for (w = minWeight; w < maxWeight1; ++w) {
  ------------------
  |  Branch (1110:29): [True: 92.7k, False: 30.2k]
  ------------------
 1111|  92.7k|            int const begin = rankStart[w];
 1112|  92.7k|            int const end = rankStart[w+1];
 1113|  92.7k|            U32 const nbBits = nbBitsBaseline - w;
 1114|  92.7k|            U32 const totalBits = nbBits + consumedBits;
 1115|  92.7k|            HUF_fillDTableX2ForWeight(
 1116|  92.7k|                DTable + rankVal[w],
 1117|  92.7k|                sortedSymbols + begin, sortedSymbols + end,
 1118|  92.7k|                totalBits, targetLog,
 1119|  92.7k|                baseSeq, /* level */ 2);
 1120|  92.7k|        }
 1121|  30.2k|    }
 1122|  30.2k|}
huf_decompress.c:HUF_buildDEltX2U64:
  993|   104k|{
  994|   104k|    U32 DElt = HUF_buildDEltX2U32(symbol, nbBits, baseSeq, level);
  995|   104k|    return (U64)DElt + ((U64)DElt << 32);
  996|   104k|}
huf_decompress.c:HUF_buildDEltX2U32:
  962|   255k|{
  963|   255k|    U32 seq;
  964|   255k|    DEBUG_STATIC_ASSERT(offsetof(HUF_DEltX2, sequence) == 0);
  ------------------
  |  |   39|   255k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  965|   255k|    DEBUG_STATIC_ASSERT(offsetof(HUF_DEltX2, nbBits) == 2);
  ------------------
  |  |   39|   255k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  966|   255k|    DEBUG_STATIC_ASSERT(offsetof(HUF_DEltX2, length) == 3);
  ------------------
  |  |   39|   255k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  967|   255k|    DEBUG_STATIC_ASSERT(sizeof(HUF_DEltX2) == sizeof(U32));
  ------------------
  |  |   39|   255k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  968|   255k|    if (MEM_isLittleEndian()) {
  ------------------
  |  Branch (968:9): [True: 255k, False: 0]
  ------------------
  969|   255k|        seq = level == 1 ? symbol : (baseSeq + (symbol << 8));
  ------------------
  |  Branch (969:15): [True: 41.3k, False: 214k]
  ------------------
  970|   255k|        return seq + (nbBits << 16) + ((U32)level << 24);
  971|   255k|    } 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|   255k|}
huf_decompress.c:HUF_fillDTableX2ForWeight:
 1015|  93.4k|{
 1016|  93.4k|    U32 const length = 1U << ((tableLog - nbBits) & 0x1F /* quiet static-analyzer */);
 1017|  93.4k|    const sortedSymbol_t* ptr;
 1018|  93.4k|    assert(level >= 1 && level <= 2);
  ------------------
  |  |   70|  93.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1019|  93.4k|    switch (length) {
 1020|  27.8k|    case 1:
  ------------------
  |  Branch (1020:5): [True: 27.8k, False: 65.5k]
  ------------------
 1021|   107k|        for (ptr = begin; ptr != end; ++ptr) {
  ------------------
  |  Branch (1021:27): [True: 79.6k, False: 27.8k]
  ------------------
 1022|  79.6k|            HUF_DEltX2 const DElt = HUF_buildDEltX2(ptr->symbol, nbBits, baseSeq, level);
 1023|  79.6k|            *DTableRank++ = DElt;
 1024|  79.6k|        }
 1025|  27.8k|        break;
 1026|  22.1k|    case 2:
  ------------------
  |  Branch (1026:5): [True: 22.1k, False: 71.2k]
  ------------------
 1027|  93.5k|        for (ptr = begin; ptr != end; ++ptr) {
  ------------------
  |  Branch (1027:27): [True: 71.4k, False: 22.1k]
  ------------------
 1028|  71.4k|            HUF_DEltX2 const DElt = HUF_buildDEltX2(ptr->symbol, nbBits, baseSeq, level);
 1029|  71.4k|            DTableRank[0] = DElt;
 1030|  71.4k|            DTableRank[1] = DElt;
 1031|  71.4k|            DTableRank += 2;
 1032|  71.4k|        }
 1033|  22.1k|        break;
 1034|  17.3k|    case 4:
  ------------------
  |  Branch (1034:5): [True: 17.3k, False: 76.0k]
  ------------------
 1035|  43.3k|        for (ptr = begin; ptr != end; ++ptr) {
  ------------------
  |  Branch (1035:27): [True: 26.0k, False: 17.3k]
  ------------------
 1036|  26.0k|            U64 const DEltX2 = HUF_buildDEltX2U64(ptr->symbol, nbBits, baseSeq, level);
 1037|  26.0k|            ZSTD_memcpy(DTableRank + 0, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  26.0k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1038|  26.0k|            ZSTD_memcpy(DTableRank + 2, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  26.0k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1039|  26.0k|            DTableRank += 4;
 1040|  26.0k|        }
 1041|  17.3k|        break;
 1042|  12.2k|    case 8:
  ------------------
  |  Branch (1042:5): [True: 12.2k, False: 81.1k]
  ------------------
 1043|  40.1k|        for (ptr = begin; ptr != end; ++ptr) {
  ------------------
  |  Branch (1043:27): [True: 27.9k, False: 12.2k]
  ------------------
 1044|  27.9k|            U64 const DEltX2 = HUF_buildDEltX2U64(ptr->symbol, nbBits, baseSeq, level);
 1045|  27.9k|            ZSTD_memcpy(DTableRank + 0, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  27.9k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1046|  27.9k|            ZSTD_memcpy(DTableRank + 2, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  27.9k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1047|  27.9k|            ZSTD_memcpy(DTableRank + 4, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  27.9k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1048|  27.9k|            ZSTD_memcpy(DTableRank + 6, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  27.9k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1049|  27.9k|            DTableRank += 8;
 1050|  27.9k|        }
 1051|  12.2k|        break;
 1052|  13.7k|    default:
  ------------------
  |  Branch (1052:5): [True: 13.7k, False: 79.6k]
  ------------------
 1053|  37.4k|        for (ptr = begin; ptr != end; ++ptr) {
  ------------------
  |  Branch (1053:27): [True: 23.6k, False: 13.7k]
  ------------------
 1054|  23.6k|            U64 const DEltX2 = HUF_buildDEltX2U64(ptr->symbol, nbBits, baseSeq, level);
 1055|  23.6k|            HUF_DEltX2* const DTableRankEnd = DTableRank + length;
 1056|   204k|            for (; DTableRank != DTableRankEnd; DTableRank += 8) {
  ------------------
  |  Branch (1056:20): [True: 180k, False: 23.6k]
  ------------------
 1057|   180k|                ZSTD_memcpy(DTableRank + 0, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|   180k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1058|   180k|                ZSTD_memcpy(DTableRank + 2, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|   180k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1059|   180k|                ZSTD_memcpy(DTableRank + 4, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|   180k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1060|   180k|                ZSTD_memcpy(DTableRank + 6, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|   180k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1061|   180k|            }
 1062|  23.6k|        }
 1063|  13.7k|        break;
 1064|  93.4k|    }
 1065|  93.4k|}
huf_decompress.c:HUF_buildDEltX2:
  981|   151k|{
  982|   151k|    HUF_DEltX2 DElt;
  983|   151k|    U32 const val = HUF_buildDEltX2U32(symbol, nbBits, baseSeq, level);
  984|   151k|    DEBUG_STATIC_ASSERT(sizeof(DElt) == sizeof(val));
  ------------------
  |  |   39|   151k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  985|   151k|    ZSTD_memcpy(&DElt, &val, sizeof(val));
  ------------------
  |  |   44|   151k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  986|   151k|    return DElt;
  987|   151k|}
huf_decompress.c:HUF_decompress1X2_usingDTable_internal:
  118|    235|    {                                                                       \
  119|    235|        if (flags & HUF_flags_bmi2) {                                       \
  ------------------
  |  Branch (119:13): [True: 235, False: 0]
  ------------------
  120|    235|            return fn##_bmi2(dst, dstSize, cSrc, cSrcSize, DTable);         \
  121|    235|        }                                                                   \
  122|    235|        return fn##_default(dst, dstSize, cSrc, cSrcSize, DTable);          \
  123|    235|    }
huf_decompress.c:HUF_decompress1X2_usingDTable_internal_bmi2:
  112|    235|    {                                                                       \
  113|    235|        return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable);             \
  114|    235|    }                                                                       \
huf_decompress.c:HUF_decompress1X2_usingDTable_internal_body:
 1357|    235|{
 1358|    235|    BIT_DStream_t bitD;
 1359|       |
 1360|       |    /* Init */
 1361|    235|    CHECK_F( BIT_initDStream(&bitD, cSrc, cSrcSize) );
  ------------------
  |  |   63|    235|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    235|    size_t const e = f;     \
  |  |  |  |   59|    235|    do {                    \
  |  |  |  |   60|    235|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 4, False: 231]
  |  |  |  |  ------------------
  |  |  |  |   61|    235|            return e;       \
  |  |  |  |   62|    235|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 231]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 231]
  |  |  ------------------
  ------------------
 1362|       |
 1363|       |    /* decode */
 1364|    231|    {   BYTE* const ostart = (BYTE*) dst;
 1365|    231|        BYTE* const oend = ZSTD_maybeNullPtrAdd(ostart, dstSize);
 1366|    231|        const void* const dtPtr = DTable+1;   /* force compiler to not use strict-aliasing */
 1367|    231|        const HUF_DEltX2* const dt = (const HUF_DEltX2*)dtPtr;
 1368|    231|        DTableDesc const dtd = HUF_getDTableDesc(DTable);
 1369|    231|        HUF_decodeStreamX2(ostart, &bitD, oend, dt, dtd.tableLog);
 1370|    231|    }
 1371|       |
 1372|       |    /* check */
 1373|    231|    if (!BIT_endOfDStream(&bitD)) return ERROR(corruption_detected);
  ------------------
  |  |   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 (1373:9): [True: 44, False: 187]
  ------------------
 1374|       |
 1375|       |    /* decoded size */
 1376|    187|    return dstSize;
 1377|    231|}
huf_decompress.c:HUF_decodeStreamX2:
 1310|  1.33k|{
 1311|  1.33k|    BYTE* const pStart = p;
 1312|       |
 1313|       |    /* up to 8 symbols at a time */
 1314|  1.33k|    if ((size_t)(pEnd - p) >= sizeof(bitDPtr->bitContainer)) {
  ------------------
  |  Branch (1314:9): [True: 1.04k, False: 283]
  ------------------
 1315|  1.04k|        if (dtLog <= 11 && MEM_64bits()) {
  ------------------
  |  Branch (1315:13): [True: 725, False: 323]
  |  Branch (1315:28): [True: 725, False: 0]
  ------------------
 1316|       |            /* up to 10 symbols at a time */
 1317|   149k|            while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-9)) {
  ------------------
  |  Branch (1317:20): [True: 148k, False: 725]
  ------------------
 1318|   148k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1293|   148k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 148k]
  |  |  ------------------
  ------------------
 1319|   148k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1293|   148k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 148k]
  |  |  ------------------
  ------------------
 1320|   148k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1293|   148k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 148k]
  |  |  ------------------
  ------------------
 1321|   148k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1293|   148k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 148k]
  |  |  ------------------
  ------------------
 1322|   148k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1293|   148k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 148k]
  |  |  ------------------
  ------------------
 1323|   148k|            }
 1324|    725|        } else {
 1325|       |            /* up to 8 symbols at a time */
 1326|  64.9k|            while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-(sizeof(bitDPtr->bitContainer)-1))) {
  ------------------
  |  Branch (1326:20): [True: 64.5k, False: 323]
  ------------------
 1327|  64.5k|                HUF_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1302|  64.5k|    do {                                                           \
  |  | 1303|  64.5k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 64.5k, False: 0]
  |  |  ------------------
  |  | 1304|  64.5k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  64.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 64.5k]
  |  |  ------------------
  ------------------
 1328|  64.5k|                HUF_DECODE_SYMBOLX2_1(p, bitDPtr);
  ------------------
  |  | 1296|  64.5k|    do {                                                           \
  |  | 1297|  64.5k|        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: 64.5k, False: 0]
  |  |  |  Branch (1297:29): [True: 0, Folded]
  |  |  ------------------
  |  | 1298|  64.5k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1299|  64.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1299:14): [Folded, False: 64.5k]
  |  |  ------------------
  ------------------
 1329|  64.5k|                HUF_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1302|  64.5k|    do {                                                           \
  |  | 1303|  64.5k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 64.5k, False: 0]
  |  |  ------------------
  |  | 1304|  64.5k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  64.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 64.5k]
  |  |  ------------------
  ------------------
 1330|  64.5k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1293|  64.5k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 64.5k]
  |  |  ------------------
  ------------------
 1331|  64.5k|            }
 1332|    323|        }
 1333|  1.04k|    } else {
 1334|    283|        BIT_reloadDStream(bitDPtr);
 1335|    283|    }
 1336|       |
 1337|       |    /* closer to end : up to 2 symbols at a time */
 1338|  1.33k|    if ((size_t)(pEnd - p) >= 2) {
  ------------------
  |  Branch (1338:9): [True: 1.23k, False: 92]
  ------------------
 1339|  2.94k|        while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p <= pEnd-2))
  ------------------
  |  Branch (1339:16): [True: 1.70k, False: 1.23k]
  ------------------
 1340|  1.70k|            HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1293|  1.70k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 1.70k]
  |  |  ------------------
  ------------------
 1341|       |
 1342|  1.61M|        while (p <= pEnd-2)
  ------------------
  |  Branch (1342:16): [True: 1.61M, False: 1.23k]
  ------------------
 1343|  1.61M|            HUF_DECODE_SYMBOLX2_0(p, bitDPtr);   /* no need to reload : reached the end of DStream */
  ------------------
  |  | 1293|  1.61M|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 1.61M]
  |  |  ------------------
  ------------------
 1344|  1.23k|    }
 1345|       |
 1346|  1.33k|    if (p < pEnd)
  ------------------
  |  Branch (1346:9): [True: 976, False: 355]
  ------------------
 1347|    976|        p += HUF_decodeLastSymbolX2(p, bitDPtr, dt, dtLog);
 1348|       |
 1349|  1.33k|    return p-pStart;
 1350|  1.33k|}
huf_decompress.c:HUF_decodeSymbolX2:
 1267|  2.79M|{
 1268|  2.79M|    size_t const val = BIT_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */
 1269|  2.79M|    ZSTD_memcpy(op, &dt[val].sequence, 2);
  ------------------
  |  |   44|  2.79M|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1270|  2.79M|    BIT_skipBits(DStream, dt[val].nbBits);
 1271|  2.79M|    return dt[val].length;
 1272|  2.79M|}
huf_decompress.c:HUF_decodeLastSymbolX2:
 1276|    976|{
 1277|    976|    size_t const val = BIT_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */
 1278|    976|    ZSTD_memcpy(op, &dt[val].sequence, 1);
  ------------------
  |  |   44|    976|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1279|    976|    if (dt[val].length==1) {
  ------------------
  |  Branch (1279:9): [True: 436, False: 540]
  ------------------
 1280|    436|        BIT_skipBits(DStream, dt[val].nbBits);
 1281|    540|    } else {
 1282|    540|        if (DStream->bitsConsumed < (sizeof(DStream->bitContainer)*8)) {
  ------------------
  |  Branch (1282:13): [True: 362, False: 178]
  ------------------
 1283|    362|            BIT_skipBits(DStream, dt[val].nbBits);
 1284|    362|            if (DStream->bitsConsumed > (sizeof(DStream->bitContainer)*8))
  ------------------
  |  Branch (1284:17): [True: 31, False: 331]
  ------------------
 1285|       |                /* ugly hack; works only because it's the last symbol. Note : can't easily extract nbBits from just this symbol */
 1286|     31|                DStream->bitsConsumed = (sizeof(DStream->bitContainer)*8);
 1287|    362|        }
 1288|    540|    }
 1289|    976|    return 1;
 1290|    976|}
huf_decompress.c:HUF_decompress1X1_usingDTable_internal:
  118|  1.62k|    {                                                                       \
  119|  1.62k|        if (flags & HUF_flags_bmi2) {                                       \
  ------------------
  |  Branch (119:13): [True: 1.62k, False: 0]
  ------------------
  120|  1.62k|            return fn##_bmi2(dst, dstSize, cSrc, cSrcSize, DTable);         \
  121|  1.62k|        }                                                                   \
  122|  1.62k|        return fn##_default(dst, dstSize, cSrc, cSrcSize, DTable);          \
  123|  1.62k|    }
huf_decompress.c:HUF_decompress1X1_usingDTable_internal_bmi2:
  112|  1.62k|    {                                                                       \
  113|  1.62k|        return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable);             \
  114|  1.62k|    }                                                                       \
huf_decompress.c:HUF_decompress1X1_usingDTable_internal_body:
  579|  1.62k|{
  580|  1.62k|    BYTE* op = (BYTE*)dst;
  581|  1.62k|    BYTE* const oend = ZSTD_maybeNullPtrAdd(op, dstSize);
  582|  1.62k|    const void* dtPtr = DTable + 1;
  583|  1.62k|    const HUF_DEltX1* const dt = (const HUF_DEltX1*)dtPtr;
  584|  1.62k|    BIT_DStream_t bitD;
  585|  1.62k|    DTableDesc const dtd = HUF_getDTableDesc(DTable);
  586|  1.62k|    U32 const dtLog = dtd.tableLog;
  587|       |
  588|  1.62k|    CHECK_F( BIT_initDStream(&bitD, cSrc, cSrcSize) );
  ------------------
  |  |   63|  1.62k|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|  1.62k|    size_t const e = f;     \
  |  |  |  |   59|  1.62k|    do {                    \
  |  |  |  |   60|  1.62k|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 5, False: 1.61k]
  |  |  |  |  ------------------
  |  |  |  |   61|  1.62k|            return e;       \
  |  |  |  |   62|  1.62k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 1.61k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 1.61k]
  |  |  ------------------
  ------------------
  589|       |
  590|  1.61k|    HUF_decodeStreamX1(op, &bitD, oend, dt, dtLog);
  591|       |
  592|  1.61k|    if (!BIT_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 (592:9): [True: 49, False: 1.56k]
  ------------------
  593|       |
  594|  1.56k|    return dstSize;
  595|  1.61k|}
huf_decompress.c:HUF_decodeStreamX1:
  547|  12.8k|{
  548|  12.8k|    BYTE* const pStart = p;
  549|       |
  550|       |    /* up to 4 symbols at a time */
  551|  12.8k|    if ((pEnd - p) > 3) {
  ------------------
  |  Branch (551:9): [True: 11.5k, False: 1.33k]
  ------------------
  552|  88.3k|        while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-3)) {
  ------------------
  |  Branch (552:16): [True: 76.8k, False: 11.5k]
  ------------------
  553|  76.8k|            HUF_DECODE_SYMBOLX1_2(p, bitDPtr);
  ------------------
  |  |  540|  76.8k|    do {                                            \
  |  |  541|  76.8k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 76.8k, False: 0]
  |  |  ------------------
  |  |  542|  76.8k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  76.8k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 76.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  76.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 76.8k]
  |  |  ------------------
  ------------------
  554|  76.8k|            HUF_DECODE_SYMBOLX1_1(p, bitDPtr);
  ------------------
  |  |  534|  76.8k|    do {                                            \
  |  |  535|  76.8k|        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: 76.8k, False: 0]
  |  |  |  Branch (535:29): [True: 0, Folded]
  |  |  ------------------
  |  |  536|  76.8k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  76.8k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 76.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  537|  76.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (537:14): [Folded, False: 76.8k]
  |  |  ------------------
  ------------------
  555|  76.8k|            HUF_DECODE_SYMBOLX1_2(p, bitDPtr);
  ------------------
  |  |  540|  76.8k|    do {                                            \
  |  |  541|  76.8k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 76.8k, False: 0]
  |  |  ------------------
  |  |  542|  76.8k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  76.8k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 76.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  76.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 76.8k]
  |  |  ------------------
  ------------------
  556|  76.8k|            HUF_DECODE_SYMBOLX1_0(p, bitDPtr);
  ------------------
  |  |  531|  76.8k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (531:71): [Folded, False: 76.8k]
  |  |  ------------------
  ------------------
  557|  76.8k|        }
  558|  11.5k|    } else {
  559|  1.33k|        BIT_reloadDStream(bitDPtr);
  560|  1.33k|    }
  561|       |
  562|       |    /* [0-3] symbols remaining */
  563|  12.8k|    if (MEM_32bits())
  ------------------
  |  Branch (563:9): [True: 0, False: 12.8k]
  ------------------
  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|   159k|    while (p < pEnd)
  ------------------
  |  Branch (568:12): [True: 147k, False: 12.8k]
  ------------------
  569|   147k|        HUF_DECODE_SYMBOLX1_0(p, bitDPtr);
  ------------------
  |  |  531|   147k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (531:71): [Folded, False: 147k]
  |  |  ------------------
  ------------------
  570|       |
  571|  12.8k|    return (size_t)(pEnd-pStart);
  572|  12.8k|}
huf_decompress.c:HUF_decodeSymbolX1:
  523|   553k|{
  524|   553k|    size_t const val = BIT_lookBitsFast(Dstream, dtLog); /* note : dtLog >= 1 */
  525|   553k|    BYTE const c = dt[val].byte;
  526|   553k|    BIT_skipBits(Dstream, dt[val].nbBits);
  527|   553k|    return c;
  528|   553k|}
huf_decompress.c:HUF_decompress4X2_usingDTable_internal:
 1721|    315|{
 1722|    315|    HUF_DecompressUsingDTableFn fallbackFn = HUF_decompress4X2_usingDTable_internal_default;
 1723|    315|    HUF_DecompressFastLoopFn loopFn = HUF_decompress4X2_usingDTable_internal_fast_c_loop;
 1724|       |
 1725|    315|#if DYNAMIC_BMI2
 1726|    315|    if (flags & HUF_flags_bmi2) {
  ------------------
  |  Branch (1726:9): [True: 315, False: 0]
  ------------------
 1727|    315|        fallbackFn = HUF_decompress4X2_usingDTable_internal_bmi2;
 1728|    315|# if ZSTD_ENABLE_ASM_X86_64_BMI2
 1729|    315|        if (!(flags & HUF_flags_disableAsm)) {
  ------------------
  |  Branch (1729:13): [True: 315, False: 0]
  ------------------
 1730|    315|            loopFn = HUF_decompress4X2_usingDTable_internal_fast_asm_loop;
 1731|    315|        }
 1732|    315|# endif
 1733|    315|    } else {
 1734|      0|        return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable);
 1735|      0|    }
 1736|    315|#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|    315|    if (HUF_ENABLE_FAST_DECODE && !(flags & HUF_flags_disableFast)) {
  ------------------
  |  |   40|    630|# define HUF_ENABLE_FAST_DECODE 1
  |  |  ------------------
  |  |  |  Branch (40:33): [True: 315, Folded]
  |  |  ------------------
  ------------------
  |  Branch (1744:35): [True: 315, False: 0]
  ------------------
 1745|    315|        size_t const ret = HUF_decompress4X2_usingDTable_internal_fast(dst, dstSize, cSrc, cSrcSize, DTable, loopFn);
 1746|    315|        if (ret != 0)
  ------------------
  |  Branch (1746:13): [True: 125, False: 190]
  ------------------
 1747|    125|            return ret;
 1748|    315|    }
 1749|    190|    return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable);
 1750|    315|}
huf_decompress.c:HUF_decompress4X2_usingDTable_internal_body:
 1388|    190|{
 1389|    190|    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: 190]
  ------------------
 1390|    190|    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: 190]
  ------------------
 1391|       |
 1392|    190|    {   const BYTE* const istart = (const BYTE*) cSrc;
 1393|    190|        BYTE* const ostart = (BYTE*) dst;
 1394|    190|        BYTE* const oend = ostart + dstSize;
 1395|    190|        BYTE* const olimit = oend - (sizeof(size_t)-1);
 1396|    190|        const void* const dtPtr = DTable+1;
 1397|    190|        const HUF_DEltX2* const dt = (const HUF_DEltX2*)dtPtr;
 1398|       |
 1399|       |        /* Init */
 1400|    190|        BIT_DStream_t bitD1;
 1401|    190|        BIT_DStream_t bitD2;
 1402|    190|        BIT_DStream_t bitD3;
 1403|    190|        BIT_DStream_t bitD4;
 1404|    190|        size_t const length1 = MEM_readLE16(istart);
 1405|    190|        size_t const length2 = MEM_readLE16(istart+2);
 1406|    190|        size_t const length3 = MEM_readLE16(istart+4);
 1407|    190|        size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);
 1408|    190|        const BYTE* const istart1 = istart + 6;  /* jumpTable */
 1409|    190|        const BYTE* const istart2 = istart1 + length1;
 1410|    190|        const BYTE* const istart3 = istart2 + length2;
 1411|    190|        const BYTE* const istart4 = istart3 + length3;
 1412|    190|        size_t const segmentSize = (dstSize+3) / 4;
 1413|    190|        BYTE* const opStart2 = ostart + segmentSize;
 1414|    190|        BYTE* const opStart3 = opStart2 + segmentSize;
 1415|    190|        BYTE* const opStart4 = opStart3 + segmentSize;
 1416|    190|        BYTE* op1 = ostart;
 1417|    190|        BYTE* op2 = opStart2;
 1418|    190|        BYTE* op3 = opStart3;
 1419|    190|        BYTE* op4 = opStart4;
 1420|    190|        U32 endSignal = 1;
 1421|    190|        DTableDesc const dtd = HUF_getDTableDesc(DTable);
 1422|    190|        U32 const dtLog = dtd.tableLog;
 1423|       |
 1424|    190|        if (length4 > cSrcSize) return ERROR(corruption_detected);  /* overflow */
  ------------------
  |  |   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 (1424:13): [True: 15, False: 175]
  ------------------
 1425|    175|        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: 175]
  ------------------
 1426|    175|        assert(dstSize >= 6 /* validated above */);
  ------------------
  |  |   70|    175|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1427|    175|        CHECK_F( BIT_initDStream(&bitD1, istart1, length1) );
  ------------------
  |  |   63|    175|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    175|    size_t const e = f;     \
  |  |  |  |   59|    175|    do {                    \
  |  |  |  |   60|    175|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 4, False: 171]
  |  |  |  |  ------------------
  |  |  |  |   61|    175|            return e;       \
  |  |  |  |   62|    175|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 171]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 171]
  |  |  ------------------
  ------------------
 1428|    171|        CHECK_F( BIT_initDStream(&bitD2, istart2, length2) );
  ------------------
  |  |   63|    171|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    171|    size_t const e = f;     \
  |  |  |  |   59|    171|    do {                    \
  |  |  |  |   60|    171|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 4, False: 167]
  |  |  |  |  ------------------
  |  |  |  |   61|    171|            return e;       \
  |  |  |  |   62|    171|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 167]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 167]
  |  |  ------------------
  ------------------
 1429|    167|        CHECK_F( BIT_initDStream(&bitD3, istart3, length3) );
  ------------------
  |  |   63|    167|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    167|    size_t const e = f;     \
  |  |  |  |   59|    167|    do {                    \
  |  |  |  |   60|    167|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 3, False: 164]
  |  |  |  |  ------------------
  |  |  |  |   61|    167|            return e;       \
  |  |  |  |   62|    167|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 164]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 164]
  |  |  ------------------
  ------------------
 1430|    164|        CHECK_F( BIT_initDStream(&bitD4, istart4, length4) );
  ------------------
  |  |   63|    164|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    164|    size_t const e = f;     \
  |  |  |  |   59|    164|    do {                    \
  |  |  |  |   60|    164|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 2, False: 162]
  |  |  |  |  ------------------
  |  |  |  |   61|    164|            return e;       \
  |  |  |  |   62|    164|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 162]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 162]
  |  |  ------------------
  ------------------
 1431|       |
 1432|       |        /* 16-32 symbols per loop (4-8 symbols per stream) */
 1433|    162|        if ((size_t)(oend - op4) >= sizeof(size_t)) {
  ------------------
  |  Branch (1433:13): [True: 147, False: 15]
  ------------------
 1434|  11.1k|            for ( ; (endSignal) & (op4 < olimit); ) {
  ------------------
  |  Branch (1434:21): [True: 10.9k, False: 147]
  ------------------
 1435|  10.9k|#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
 1436|  10.9k|                HUF_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 1302|  10.9k|    do {                                                           \
  |  | 1303|  10.9k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 10.9k, False: 0]
  |  |  ------------------
  |  | 1304|  10.9k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 1437|  10.9k|                HUF_DECODE_SYMBOLX2_1(op1, &bitD1);
  ------------------
  |  | 1296|  10.9k|    do {                                                           \
  |  | 1297|  10.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 (1297:13): [True: 10.9k, False: 0]
  |  |  |  Branch (1297:29): [True: 0, Folded]
  |  |  ------------------
  |  | 1298|  10.9k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1299|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1299:14): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 1438|  10.9k|                HUF_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 1302|  10.9k|    do {                                                           \
  |  | 1303|  10.9k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 10.9k, False: 0]
  |  |  ------------------
  |  | 1304|  10.9k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 1439|  10.9k|                HUF_DECODE_SYMBOLX2_0(op1, &bitD1);
  ------------------
  |  | 1293|  10.9k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 1440|  10.9k|                HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 1302|  10.9k|    do {                                                           \
  |  | 1303|  10.9k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 10.9k, False: 0]
  |  |  ------------------
  |  | 1304|  10.9k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 1441|  10.9k|                HUF_DECODE_SYMBOLX2_1(op2, &bitD2);
  ------------------
  |  | 1296|  10.9k|    do {                                                           \
  |  | 1297|  10.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 (1297:13): [True: 10.9k, False: 0]
  |  |  |  Branch (1297:29): [True: 0, Folded]
  |  |  ------------------
  |  | 1298|  10.9k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1299|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1299:14): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 1442|  10.9k|                HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 1302|  10.9k|    do {                                                           \
  |  | 1303|  10.9k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 10.9k, False: 0]
  |  |  ------------------
  |  | 1304|  10.9k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 1443|  10.9k|                HUF_DECODE_SYMBOLX2_0(op2, &bitD2);
  ------------------
  |  | 1293|  10.9k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 1444|  10.9k|                endSignal &= BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished;
 1445|  10.9k|                endSignal &= BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished;
 1446|  10.9k|                HUF_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 1302|  10.9k|    do {                                                           \
  |  | 1303|  10.9k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 10.9k, False: 0]
  |  |  ------------------
  |  | 1304|  10.9k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 1447|  10.9k|                HUF_DECODE_SYMBOLX2_1(op3, &bitD3);
  ------------------
  |  | 1296|  10.9k|    do {                                                           \
  |  | 1297|  10.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 (1297:13): [True: 10.9k, False: 0]
  |  |  |  Branch (1297:29): [True: 0, Folded]
  |  |  ------------------
  |  | 1298|  10.9k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1299|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1299:14): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 1448|  10.9k|                HUF_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 1302|  10.9k|    do {                                                           \
  |  | 1303|  10.9k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 10.9k, False: 0]
  |  |  ------------------
  |  | 1304|  10.9k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 1449|  10.9k|                HUF_DECODE_SYMBOLX2_0(op3, &bitD3);
  ------------------
  |  | 1293|  10.9k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 1450|  10.9k|                HUF_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 1302|  10.9k|    do {                                                           \
  |  | 1303|  10.9k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 10.9k, False: 0]
  |  |  ------------------
  |  | 1304|  10.9k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 1451|  10.9k|                HUF_DECODE_SYMBOLX2_1(op4, &bitD4);
  ------------------
  |  | 1296|  10.9k|    do {                                                           \
  |  | 1297|  10.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 (1297:13): [True: 10.9k, False: 0]
  |  |  |  Branch (1297:29): [True: 0, Folded]
  |  |  ------------------
  |  | 1298|  10.9k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1299|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1299:14): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 1452|  10.9k|                HUF_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 1302|  10.9k|    do {                                                           \
  |  | 1303|  10.9k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1303:13): [True: 10.9k, False: 0]
  |  |  ------------------
  |  | 1304|  10.9k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1305|  10.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1305:14): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 1453|  10.9k|                HUF_DECODE_SYMBOLX2_0(op4, &bitD4);
  ------------------
  |  | 1293|  10.9k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1293:74): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 1454|  10.9k|                endSignal &= BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished;
 1455|  10.9k|                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|  10.9k|            }
 1480|    147|        }
 1481|       |
 1482|       |        /* check corruption */
 1483|    162|        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: 161]
  ------------------
 1484|    161|        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: 160]
  ------------------
 1485|    160|        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: 159]
  ------------------
 1486|       |        /* note : op4 already verified within main loop */
 1487|       |
 1488|       |        /* finish bitStreams one by one */
 1489|    159|        HUF_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog);
 1490|    159|        HUF_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog);
 1491|    159|        HUF_decodeStreamX2(op3, &bitD3, opStart4, dt, dtLog);
 1492|    159|        HUF_decodeStreamX2(op4, &bitD4, oend,     dt, dtLog);
 1493|       |
 1494|       |        /* check */
 1495|    159|        { U32 const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4);
 1496|    159|          if (!endCheck) return ERROR(corruption_detected); }
  ------------------
  |  |   49|    158|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    158|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    158|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1496:15): [True: 158, False: 1]
  ------------------
 1497|       |
 1498|       |        /* decoded size */
 1499|      1|        return dstSize;
 1500|    159|    }
 1501|    159|}
huf_decompress.c:HUF_decompress4X2_usingDTable_internal_bmi2:
 1506|    190|                    size_t cSrcSize, HUF_DTable const* DTable) {
 1507|    190|    return HUF_decompress4X2_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable);
 1508|    190|}
huf_decompress.c:HUF_decompress4X2_usingDTable_internal_fast:
 1671|    315|    HUF_DecompressFastLoopFn loopFn) {
 1672|    315|    void const* dt = DTable + 1;
 1673|    315|    const BYTE* const ilowest = (const BYTE*)cSrc;
 1674|    315|    BYTE* const oend = ZSTD_maybeNullPtrAdd((BYTE*)dst, dstSize);
 1675|    315|    HUF_DecompressFastArgs args;
 1676|    315|    {
 1677|    315|        size_t const ret = HUF_DecompressFastArgs_init(&args, dst, dstSize, cSrc, cSrcSize, DTable);
 1678|    315|        FORWARD_IF_ERROR(ret, "Failed to init asm args");
  ------------------
  |  |  146|    315|    do {                                                                           \
  |  |  147|    315|        size_t const err_code = (err);                                             \
  |  |  148|    315|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 6, False: 309]
  |  |  ------------------
  |  |  149|      6|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|      6|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      6|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|      6|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|      6|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|      6|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|      6|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|      6|            return err_code;                                                       \
  |  |  155|      6|        }                                                                          \
  |  |  156|    315|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 309]
  |  |  ------------------
  ------------------
 1679|    309|        if (ret == 0)
  ------------------
  |  Branch (1679:13): [True: 190, False: 119]
  ------------------
 1680|    190|            return 0;
 1681|    309|    }
 1682|       |
 1683|    119|    assert(args.ip[0] >= args.ilowest);
  ------------------
  |  |   70|    119|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1684|    119|    loopFn(&args);
 1685|       |
 1686|       |    /* note : op4 already verified within main loop */
 1687|    119|    assert(args.ip[0] >= ilowest);
  ------------------
  |  |   70|    119|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1688|    119|    assert(args.ip[1] >= ilowest);
  ------------------
  |  |   70|    119|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1689|    119|    assert(args.ip[2] >= ilowest);
  ------------------
  |  |   70|    119|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1690|    119|    assert(args.ip[3] >= ilowest);
  ------------------
  |  |   70|    119|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1691|    119|    assert(args.op[3] <= oend);
  ------------------
  |  |   70|    119|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1692|       |
 1693|    119|    assert(ilowest == args.ilowest);
  ------------------
  |  |   70|    119|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1694|    119|    assert(ilowest + 6 == args.iend[0]);
  ------------------
  |  |   70|    119|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1695|    119|    (void)ilowest;
 1696|       |
 1697|       |    /* finish bitStreams one by one */
 1698|    119|    {
 1699|    119|        size_t const segmentSize = (dstSize+3) / 4;
 1700|    119|        BYTE* segmentEnd = (BYTE*)dst;
 1701|    119|        int i;
 1702|    583|        for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (1702:21): [True: 469, False: 114]
  ------------------
 1703|    469|            BIT_DStream_t bit;
 1704|    469|            if (segmentSize <= (size_t)(oend - segmentEnd))
  ------------------
  |  Branch (1704:17): [True: 379, False: 90]
  ------------------
 1705|    379|                segmentEnd += segmentSize;
 1706|     90|            else
 1707|     90|                segmentEnd = oend;
 1708|    469|            FORWARD_IF_ERROR(HUF_initRemainingDStream(&bit, &args, i, segmentEnd), "corruption");
  ------------------
  |  |  146|    469|    do {                                                                           \
  |  |  147|    469|        size_t const err_code = (err);                                             \
  |  |  148|    469|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 5, False: 464]
  |  |  ------------------
  |  |  149|      5|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      5|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|      5|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|      5|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|      5|            return err_code;                                                       \
  |  |  155|      5|        }                                                                          \
  |  |  156|    469|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 464]
  |  |  ------------------
  ------------------
 1709|    464|            args.op[i] += HUF_decodeStreamX2(args.op[i], &bit, segmentEnd, (HUF_DEltX2 const*)dt, HUF_DECODER_FAST_TABLELOG);
  ------------------
  |  |   31|    464|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
 1710|    464|            if (args.op[i] != segmentEnd)
  ------------------
  |  Branch (1710:17): [True: 0, False: 464]
  ------------------
 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|    464|        }
 1713|    119|    }
 1714|       |
 1715|       |    /* decoded size */
 1716|    114|    return dstSize;
 1717|    119|}
huf_decompress.c:HUF_DecompressFastArgs_init:
  192|  3.21k|{
  193|  3.21k|    void const* dt = DTable + 1;
  194|  3.21k|    U32 const dtLog = HUF_getDTableDesc(DTable).tableLog;
  195|       |
  196|  3.21k|    const BYTE* const istart = (const BYTE*)src;
  197|       |
  198|  3.21k|    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|  3.21k|    if (!MEM_isLittleEndian() || MEM_32bits())
  ------------------
  |  Branch (203:9): [True: 0, False: 3.21k]
  |  Branch (203:34): [True: 0, False: 3.21k]
  ------------------
  204|      0|        return 0;
  205|       |
  206|       |    /* Avoid nullptr addition */
  207|  3.21k|    if (dstSize == 0)
  ------------------
  |  Branch (207:9): [True: 0, False: 3.21k]
  ------------------
  208|      0|        return 0;
  209|  3.21k|    assert(dst != NULL);
  ------------------
  |  |   70|  3.21k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  210|       |
  211|       |    /* strict minimum : jump table + 1 byte per stream */
  212|  3.21k|    if (srcSize < 10)
  ------------------
  |  Branch (212:9): [True: 8, False: 3.20k]
  ------------------
  213|      8|        return ERROR(corruption_detected);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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|  3.20k|    if (dtLog != HUF_DECODER_FAST_TABLELOG)
  ------------------
  |  |   31|  3.20k|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
  |  Branch (219:9): [True: 98, False: 3.10k]
  ------------------
  220|     98|        return 0;
  221|       |
  222|       |    /* Read the jump table. */
  223|  3.10k|    {
  224|  3.10k|        size_t const length1 = MEM_readLE16(istart);
  225|  3.10k|        size_t const length2 = MEM_readLE16(istart+2);
  226|  3.10k|        size_t const length3 = MEM_readLE16(istart+4);
  227|  3.10k|        size_t const length4 = srcSize - (length1 + length2 + length3 + 6);
  228|  3.10k|        args->iend[0] = istart + 6;  /* jumpTable */
  229|  3.10k|        args->iend[1] = args->iend[0] + length1;
  230|  3.10k|        args->iend[2] = args->iend[1] + length2;
  231|  3.10k|        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|  3.10k|        if (length1 < 8 || length2 < 8 || length3 < 8 || length4 < 8)
  ------------------
  |  Branch (236:13): [True: 144, False: 2.96k]
  |  Branch (236:28): [True: 49, False: 2.91k]
  |  Branch (236:43): [True: 30, False: 2.88k]
  |  Branch (236:58): [True: 16, False: 2.86k]
  ------------------
  237|    239|            return 0;
  238|  2.86k|        if (length4 > srcSize) return ERROR(corruption_detected);   /* overflow */
  ------------------
  |  |   49|     32|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     32|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     32|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (238:13): [True: 32, False: 2.83k]
  ------------------
  239|  2.86k|    }
  240|       |    /* ip[] contains the position that is currently loaded into bits[]. */
  241|  2.83k|    args->ip[0] = args->iend[1] - sizeof(U64);
  242|  2.83k|    args->ip[1] = args->iend[2] - sizeof(U64);
  243|  2.83k|    args->ip[2] = args->iend[3] - sizeof(U64);
  244|  2.83k|    args->ip[3] = (BYTE const*)src + srcSize - sizeof(U64);
  245|       |
  246|       |    /* op[] contains the output pointers. */
  247|  2.83k|    args->op[0] = (BYTE*)dst;
  248|  2.83k|    args->op[1] = args->op[0] + (dstSize+3)/4;
  249|  2.83k|    args->op[2] = args->op[1] + (dstSize+3)/4;
  250|  2.83k|    args->op[3] = args->op[2] + (dstSize+3)/4;
  251|       |
  252|       |    /* No point to call the ASM loop for tiny outputs. */
  253|  2.83k|    if (args->op[3] >= oend)
  ------------------
  |  Branch (253:9): [True: 1, False: 2.83k]
  ------------------
  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|  2.83k|    args->bits[0] = HUF_initFastDStream(args->ip[0]);
  264|  2.83k|    args->bits[1] = HUF_initFastDStream(args->ip[1]);
  265|  2.83k|    args->bits[2] = HUF_initFastDStream(args->ip[2]);
  266|  2.83k|    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|  2.83k|    args->ilowest = istart;
  274|       |
  275|  2.83k|    args->oend = oend;
  276|  2.83k|    args->dt = dt;
  277|       |
  278|  2.83k|    return 1;
  279|  2.83k|}
huf_decompress.c:HUF_initFastDStream:
  150|  11.3k|static size_t HUF_initFastDStream(BYTE const* ip) {
  151|  11.3k|    BYTE const lastByte = ip[7];
  152|  11.3k|    size_t const bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (152:33): [True: 5.92k, False: 5.41k]
  ------------------
  153|  11.3k|    size_t const value = MEM_readLEST(ip) | 1;
  154|  11.3k|    assert(bitsConsumed <= 8);
  ------------------
  |  |   70|  11.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  155|  11.3k|    assert(sizeof(size_t) == 8);
  ------------------
  |  |   70|  11.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  156|  11.3k|    return value << bitsConsumed;
  157|  11.3k|}
huf_decompress.c:HUF_initRemainingDStream:
  282|  11.3k|{
  283|       |    /* Validate that we haven't overwritten. */
  284|  11.3k|    if (args->op[stream] > segmentEnd)
  ------------------
  |  Branch (284:9): [True: 0, False: 11.3k]
  ------------------
  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|  11.3k|    if (args->ip[stream] < args->iend[stream] - 8)
  ------------------
  |  Branch (291:9): [True: 10, False: 11.3k]
  ------------------
  292|     10|        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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  293|       |
  294|       |    /* Construct the BIT_DStream_t. */
  295|  11.3k|    assert(sizeof(size_t) == 8);
  ------------------
  |  |   70|  11.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  296|  11.3k|    bit->bitContainer = MEM_readLEST(args->ip[stream]);
  297|  11.3k|    bit->bitsConsumed = ZSTD_countTrailingZeros64(args->bits[stream]);
  298|  11.3k|    bit->start = (const char*)args->ilowest;
  299|  11.3k|    bit->limitPtr = bit->start + sizeof(size_t);
  300|  11.3k|    bit->ptr = (const char*)args->ip[stream];
  301|       |
  302|  11.3k|    return 0;
  303|  11.3k|}
huf_decompress.c:HUF_decompress4X1_usingDTable_internal:
  899|  2.89k|{
  900|  2.89k|    HUF_DecompressUsingDTableFn fallbackFn = HUF_decompress4X1_usingDTable_internal_default;
  901|  2.89k|    HUF_DecompressFastLoopFn loopFn = HUF_decompress4X1_usingDTable_internal_fast_c_loop;
  902|       |
  903|  2.89k|#if DYNAMIC_BMI2
  904|  2.89k|    if (flags & HUF_flags_bmi2) {
  ------------------
  |  Branch (904:9): [True: 2.89k, False: 0]
  ------------------
  905|  2.89k|        fallbackFn = HUF_decompress4X1_usingDTable_internal_bmi2;
  906|  2.89k|# if ZSTD_ENABLE_ASM_X86_64_BMI2
  907|  2.89k|        if (!(flags & HUF_flags_disableAsm)) {
  ------------------
  |  Branch (907:13): [True: 2.89k, False: 0]
  ------------------
  908|  2.89k|            loopFn = HUF_decompress4X1_usingDTable_internal_fast_asm_loop;
  909|  2.89k|        }
  910|  2.89k|# endif
  911|  2.89k|    } else {
  912|      0|        return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable);
  913|      0|    }
  914|  2.89k|#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|  2.89k|    if (HUF_ENABLE_FAST_DECODE && !(flags & HUF_flags_disableFast)) {
  ------------------
  |  |   40|  5.79k|# define HUF_ENABLE_FAST_DECODE 1
  |  |  ------------------
  |  |  |  Branch (40:33): [True: 2.89k, Folded]
  |  |  ------------------
  ------------------
  |  Branch (922:35): [True: 2.89k, False: 0]
  ------------------
  923|  2.89k|        size_t const ret = HUF_decompress4X1_usingDTable_internal_fast(dst, dstSize, cSrc, cSrcSize, DTable, loopFn);
  924|  2.89k|        if (ret != 0)
  ------------------
  |  Branch (924:13): [True: 2.75k, False: 148]
  ------------------
  925|  2.75k|            return ret;
  926|  2.89k|    }
  927|    148|    return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable);
  928|  2.89k|}
huf_decompress.c:HUF_decompress4X1_usingDTable_internal_body:
  606|    148|{
  607|       |    /* Check */
  608|    148|    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: 148]
  ------------------
  609|    148|    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: 148]
  ------------------
  610|       |
  611|    148|    {   const BYTE* const istart = (const BYTE*) cSrc;
  612|    148|        BYTE* const ostart = (BYTE*) dst;
  613|    148|        BYTE* const oend = ostart + dstSize;
  614|    148|        BYTE* const olimit = oend - 3;
  615|    148|        const void* const dtPtr = DTable + 1;
  616|    148|        const HUF_DEltX1* const dt = (const HUF_DEltX1*)dtPtr;
  617|       |
  618|       |        /* Init */
  619|    148|        BIT_DStream_t bitD1;
  620|    148|        BIT_DStream_t bitD2;
  621|    148|        BIT_DStream_t bitD3;
  622|    148|        BIT_DStream_t bitD4;
  623|    148|        size_t const length1 = MEM_readLE16(istart);
  624|    148|        size_t const length2 = MEM_readLE16(istart+2);
  625|    148|        size_t const length3 = MEM_readLE16(istart+4);
  626|    148|        size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);
  627|    148|        const BYTE* const istart1 = istart + 6;  /* jumpTable */
  628|    148|        const BYTE* const istart2 = istart1 + length1;
  629|    148|        const BYTE* const istart3 = istart2 + length2;
  630|    148|        const BYTE* const istart4 = istart3 + length3;
  631|    148|        const size_t segmentSize = (dstSize+3) / 4;
  632|    148|        BYTE* const opStart2 = ostart + segmentSize;
  633|    148|        BYTE* const opStart3 = opStart2 + segmentSize;
  634|    148|        BYTE* const opStart4 = opStart3 + segmentSize;
  635|    148|        BYTE* op1 = ostart;
  636|    148|        BYTE* op2 = opStart2;
  637|    148|        BYTE* op3 = opStart3;
  638|    148|        BYTE* op4 = opStart4;
  639|    148|        DTableDesc const dtd = HUF_getDTableDesc(DTable);
  640|    148|        U32 const dtLog = dtd.tableLog;
  641|    148|        U32 endSignal = 1;
  642|       |
  643|    148|        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 (643:13): [True: 23, False: 125]
  ------------------
  644|    125|        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: 125]
  ------------------
  645|    125|        assert(dstSize >= 6); /* validated above */
  ------------------
  |  |   70|    125|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  646|    125|        CHECK_F( BIT_initDStream(&bitD1, istart1, length1) );
  ------------------
  |  |   63|    125|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    125|    size_t const e = f;     \
  |  |  |  |   59|    125|    do {                    \
  |  |  |  |   60|    125|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 7, False: 118]
  |  |  |  |  ------------------
  |  |  |  |   61|    125|            return e;       \
  |  |  |  |   62|    125|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 118]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 118]
  |  |  ------------------
  ------------------
  647|    118|        CHECK_F( BIT_initDStream(&bitD2, istart2, length2) );
  ------------------
  |  |   63|    118|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    118|    size_t const e = f;     \
  |  |  |  |   59|    118|    do {                    \
  |  |  |  |   60|    118|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 6, False: 112]
  |  |  |  |  ------------------
  |  |  |  |   61|    118|            return e;       \
  |  |  |  |   62|    118|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 112]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 112]
  |  |  ------------------
  ------------------
  648|    112|        CHECK_F( BIT_initDStream(&bitD3, istart3, length3) );
  ------------------
  |  |   63|    112|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    112|    size_t const e = f;     \
  |  |  |  |   59|    112|    do {                    \
  |  |  |  |   60|    112|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 5, False: 107]
  |  |  |  |  ------------------
  |  |  |  |   61|    112|            return e;       \
  |  |  |  |   62|    112|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 107]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 107]
  |  |  ------------------
  ------------------
  649|    107|        CHECK_F( BIT_initDStream(&bitD4, istart4, length4) );
  ------------------
  |  |   63|    107|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    107|    size_t const e = f;     \
  |  |  |  |   59|    107|    do {                    \
  |  |  |  |   60|    107|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 5, False: 102]
  |  |  |  |  ------------------
  |  |  |  |   61|    107|            return e;       \
  |  |  |  |   62|    107|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 102]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 102]
  |  |  ------------------
  ------------------
  650|       |
  651|       |        /* up to 16 symbols per loop (4 symbols per stream) in 64-bit mode */
  652|    102|        if ((size_t)(oend - op4) >= sizeof(size_t)) {
  ------------------
  |  Branch (652:13): [True: 78, False: 24]
  ------------------
  653|  6.31k|            for ( ; (endSignal) & (op4 < olimit) ; ) {
  ------------------
  |  Branch (653:21): [True: 6.23k, False: 78]
  ------------------
  654|  6.23k|                HUF_DECODE_SYMBOLX1_2(op1, &bitD1);
  ------------------
  |  |  540|  6.23k|    do {                                            \
  |  |  541|  6.23k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 6.23k, False: 0]
  |  |  ------------------
  |  |  542|  6.23k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  6.23k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 6.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  6.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 6.23k]
  |  |  ------------------
  ------------------
  655|  6.23k|                HUF_DECODE_SYMBOLX1_2(op2, &bitD2);
  ------------------
  |  |  540|  6.23k|    do {                                            \
  |  |  541|  6.23k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 6.23k, False: 0]
  |  |  ------------------
  |  |  542|  6.23k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  6.23k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 6.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  6.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 6.23k]
  |  |  ------------------
  ------------------
  656|  6.23k|                HUF_DECODE_SYMBOLX1_2(op3, &bitD3);
  ------------------
  |  |  540|  6.23k|    do {                                            \
  |  |  541|  6.23k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 6.23k, False: 0]
  |  |  ------------------
  |  |  542|  6.23k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  6.23k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 6.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  6.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 6.23k]
  |  |  ------------------
  ------------------
  657|  6.23k|                HUF_DECODE_SYMBOLX1_2(op4, &bitD4);
  ------------------
  |  |  540|  6.23k|    do {                                            \
  |  |  541|  6.23k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 6.23k, False: 0]
  |  |  ------------------
  |  |  542|  6.23k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  6.23k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 6.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  6.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 6.23k]
  |  |  ------------------
  ------------------
  658|  6.23k|                HUF_DECODE_SYMBOLX1_1(op1, &bitD1);
  ------------------
  |  |  534|  6.23k|    do {                                            \
  |  |  535|  6.23k|        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: 6.23k, False: 0]
  |  |  |  Branch (535:29): [True: 0, Folded]
  |  |  ------------------
  |  |  536|  6.23k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  6.23k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 6.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  537|  6.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (537:14): [Folded, False: 6.23k]
  |  |  ------------------
  ------------------
  659|  6.23k|                HUF_DECODE_SYMBOLX1_1(op2, &bitD2);
  ------------------
  |  |  534|  6.23k|    do {                                            \
  |  |  535|  6.23k|        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: 6.23k, False: 0]
  |  |  |  Branch (535:29): [True: 0, Folded]
  |  |  ------------------
  |  |  536|  6.23k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  6.23k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 6.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  537|  6.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (537:14): [Folded, False: 6.23k]
  |  |  ------------------
  ------------------
  660|  6.23k|                HUF_DECODE_SYMBOLX1_1(op3, &bitD3);
  ------------------
  |  |  534|  6.23k|    do {                                            \
  |  |  535|  6.23k|        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: 6.23k, False: 0]
  |  |  |  Branch (535:29): [True: 0, Folded]
  |  |  ------------------
  |  |  536|  6.23k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  6.23k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 6.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  537|  6.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (537:14): [Folded, False: 6.23k]
  |  |  ------------------
  ------------------
  661|  6.23k|                HUF_DECODE_SYMBOLX1_1(op4, &bitD4);
  ------------------
  |  |  534|  6.23k|    do {                                            \
  |  |  535|  6.23k|        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: 6.23k, False: 0]
  |  |  |  Branch (535:29): [True: 0, Folded]
  |  |  ------------------
  |  |  536|  6.23k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  6.23k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 6.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  537|  6.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (537:14): [Folded, False: 6.23k]
  |  |  ------------------
  ------------------
  662|  6.23k|                HUF_DECODE_SYMBOLX1_2(op1, &bitD1);
  ------------------
  |  |  540|  6.23k|    do {                                            \
  |  |  541|  6.23k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 6.23k, False: 0]
  |  |  ------------------
  |  |  542|  6.23k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  6.23k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 6.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  6.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 6.23k]
  |  |  ------------------
  ------------------
  663|  6.23k|                HUF_DECODE_SYMBOLX1_2(op2, &bitD2);
  ------------------
  |  |  540|  6.23k|    do {                                            \
  |  |  541|  6.23k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 6.23k, False: 0]
  |  |  ------------------
  |  |  542|  6.23k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  6.23k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 6.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  6.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 6.23k]
  |  |  ------------------
  ------------------
  664|  6.23k|                HUF_DECODE_SYMBOLX1_2(op3, &bitD3);
  ------------------
  |  |  540|  6.23k|    do {                                            \
  |  |  541|  6.23k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 6.23k, False: 0]
  |  |  ------------------
  |  |  542|  6.23k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  6.23k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 6.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  6.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 6.23k]
  |  |  ------------------
  ------------------
  665|  6.23k|                HUF_DECODE_SYMBOLX1_2(op4, &bitD4);
  ------------------
  |  |  540|  6.23k|    do {                                            \
  |  |  541|  6.23k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (541:13): [True: 6.23k, False: 0]
  |  |  ------------------
  |  |  542|  6.23k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  531|  6.23k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (531:71): [Folded, False: 6.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  543|  6.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (543:14): [Folded, False: 6.23k]
  |  |  ------------------
  ------------------
  666|  6.23k|                HUF_DECODE_SYMBOLX1_0(op1, &bitD1);
  ------------------
  |  |  531|  6.23k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (531:71): [Folded, False: 6.23k]
  |  |  ------------------
  ------------------
  667|  6.23k|                HUF_DECODE_SYMBOLX1_0(op2, &bitD2);
  ------------------
  |  |  531|  6.23k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (531:71): [Folded, False: 6.23k]
  |  |  ------------------
  ------------------
  668|  6.23k|                HUF_DECODE_SYMBOLX1_0(op3, &bitD3);
  ------------------
  |  |  531|  6.23k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (531:71): [Folded, False: 6.23k]
  |  |  ------------------
  ------------------
  669|  6.23k|                HUF_DECODE_SYMBOLX1_0(op4, &bitD4);
  ------------------
  |  |  531|  6.23k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (531:71): [Folded, False: 6.23k]
  |  |  ------------------
  ------------------
  670|  6.23k|                endSignal &= BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished;
  671|  6.23k|                endSignal &= BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished;
  672|  6.23k|                endSignal &= BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished;
  673|  6.23k|                endSignal &= BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished;
  674|  6.23k|            }
  675|     78|        }
  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|    102|        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: 102]
  ------------------
  681|    102|        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: 102]
  ------------------
  682|    102|        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: 102]
  ------------------
  683|       |        /* note : op4 supposed already verified within main loop */
  684|       |
  685|       |        /* finish bitStreams one by one */
  686|    102|        HUF_decodeStreamX1(op1, &bitD1, opStart2, dt, dtLog);
  687|    102|        HUF_decodeStreamX1(op2, &bitD2, opStart3, dt, dtLog);
  688|    102|        HUF_decodeStreamX1(op3, &bitD3, opStart4, dt, dtLog);
  689|    102|        HUF_decodeStreamX1(op4, &bitD4, oend,     dt, dtLog);
  690|       |
  691|       |        /* check */
  692|    102|        { U32 const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4);
  693|    102|          if (!endCheck) return ERROR(corruption_detected); }
  ------------------
  |  |   49|    101|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    101|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    101|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (693:15): [True: 101, False: 1]
  ------------------
  694|       |
  695|       |        /* decoded size */
  696|      1|        return dstSize;
  697|    102|    }
  698|    102|}
huf_decompress.c:HUF_decompress4X1_usingDTable_internal_bmi2:
  703|    148|                    size_t cSrcSize, HUF_DTable const* DTable) {
  704|    148|    return HUF_decompress4X1_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable);
  705|    148|}
huf_decompress.c:HUF_decompress4X1_usingDTable_internal_fast:
  845|  2.89k|{
  846|  2.89k|    void const* dt = DTable + 1;
  847|  2.89k|    BYTE const* const ilowest = (BYTE const*)cSrc;
  848|  2.89k|    BYTE* const oend = ZSTD_maybeNullPtrAdd((BYTE*)dst, dstSize);
  849|  2.89k|    HUF_DecompressFastArgs args;
  850|  2.89k|    {   size_t const ret = HUF_DecompressFastArgs_init(&args, dst, dstSize, cSrc, cSrcSize, DTable);
  851|  2.89k|        FORWARD_IF_ERROR(ret, "Failed to init fast loop args");
  ------------------
  |  |  146|  2.89k|    do {                                                                           \
  |  |  147|  2.89k|        size_t const err_code = (err);                                             \
  |  |  148|  2.89k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 34, False: 2.86k]
  |  |  ------------------
  |  |  149|     34|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|     34|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 34]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     34|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|     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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|     34|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|     34|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 34]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|     34|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|     34|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 34]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|     34|            return err_code;                                                       \
  |  |  155|     34|        }                                                                          \
  |  |  156|  2.89k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 2.86k]
  |  |  ------------------
  ------------------
  852|  2.86k|        if (ret == 0)
  ------------------
  |  Branch (852:13): [True: 148, False: 2.71k]
  ------------------
  853|    148|            return 0;
  854|  2.86k|    }
  855|       |
  856|  2.71k|    assert(args.ip[0] >= args.ilowest);
  ------------------
  |  |   70|  2.71k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  857|  2.71k|    loopFn(&args);
  858|       |
  859|       |    /* Our loop guarantees that ip[] >= ilowest and that we haven't
  860|       |    * overwritten any op[].
  861|       |    */
  862|  2.71k|    assert(args.ip[0] >= ilowest);
  ------------------
  |  |   70|  2.71k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  863|  2.71k|    assert(args.ip[0] >= ilowest);
  ------------------
  |  |   70|  2.71k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  864|  2.71k|    assert(args.ip[1] >= ilowest);
  ------------------
  |  |   70|  2.71k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  865|  2.71k|    assert(args.ip[2] >= ilowest);
  ------------------
  |  |   70|  2.71k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  866|  2.71k|    assert(args.ip[3] >= ilowest);
  ------------------
  |  |   70|  2.71k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  867|  2.71k|    assert(args.op[3] <= oend);
  ------------------
  |  |   70|  2.71k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  868|       |
  869|  2.71k|    assert(ilowest == args.ilowest);
  ------------------
  |  |   70|  2.71k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  870|  2.71k|    assert(ilowest + 6 == args.iend[0]);
  ------------------
  |  |   70|  2.71k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  871|  2.71k|    (void)ilowest;
  872|       |
  873|       |    /* finish bit streams one by one. */
  874|  2.71k|    {   size_t const segmentSize = (dstSize+3) / 4;
  875|  2.71k|        BYTE* segmentEnd = (BYTE*)dst;
  876|  2.71k|        int i;
  877|  13.5k|        for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (877:21): [True: 10.8k, False: 2.71k]
  ------------------
  878|  10.8k|            BIT_DStream_t bit;
  879|  10.8k|            if (segmentSize <= (size_t)(oend - segmentEnd))
  ------------------
  |  Branch (879:17): [True: 9.90k, False: 951]
  ------------------
  880|  9.90k|                segmentEnd += segmentSize;
  881|    951|            else
  882|    951|                segmentEnd = oend;
  883|  10.8k|            FORWARD_IF_ERROR(HUF_initRemainingDStream(&bit, &args, i, segmentEnd), "corruption");
  ------------------
  |  |  146|  10.8k|    do {                                                                           \
  |  |  147|  10.8k|        size_t const err_code = (err);                                             \
  |  |  148|  10.8k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 5, False: 10.8k]
  |  |  ------------------
  |  |  149|      5|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      5|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|      5|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|      5|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|      5|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|      5|            return err_code;                                                       \
  |  |  155|      5|        }                                                                          \
  |  |  156|  10.8k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 10.8k]
  |  |  ------------------
  ------------------
  884|       |            /* Decompress and validate that we've produced exactly the expected length. */
  885|  10.8k|            args.op[i] += HUF_decodeStreamX1(args.op[i], &bit, segmentEnd, (HUF_DEltX1 const*)dt, HUF_DECODER_FAST_TABLELOG);
  ------------------
  |  |   31|  10.8k|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
  886|  10.8k|            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: 10.8k]
  ------------------
  887|  10.8k|        }
  888|  2.71k|    }
  889|       |
  890|       |    /* decoded size */
  891|  2.71k|    assert(dstSize != 0);
  ------------------
  |  |   70|  2.71k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  892|  2.71k|    return dstSize;
  893|  2.71k|}
huf_decompress.c:HUF_decompress4X2_DCtx_wksp:
 1772|     84|{
 1773|     84|    const BYTE* ip = (const BYTE*) cSrc;
 1774|       |
 1775|     84|    size_t hSize = HUF_readDTableX2_wksp(dctx, cSrc, cSrcSize,
 1776|     84|                                         workSpace, wkspSize, flags);
 1777|     84|    if (HUF_isError(hSize)) return hSize;
  ------------------
  |  |   78|     84|#define HUF_isError ERR_isError
  ------------------
  |  Branch (1777:9): [True: 1, False: 83]
  ------------------
 1778|     83|    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: 83]
  ------------------
 1779|     83|    ip += hSize; cSrcSize -= hSize;
 1780|       |
 1781|     83|    return HUF_decompress4X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, flags);
 1782|     83|}
huf_decompress.c:HUF_decompress4X1_DCtx_wksp:
  933|  2.99k|{
  934|  2.99k|    const BYTE* ip = (const BYTE*) cSrc;
  935|       |
  936|  2.99k|    size_t const hSize = HUF_readDTableX1_wksp(dctx, cSrc, cSrcSize, workSpace, wkspSize, flags);
  937|  2.99k|    if (HUF_isError(hSize)) return hSize;
  ------------------
  |  |   78|  2.99k|#define HUF_isError ERR_isError
  ------------------
  |  Branch (937:9): [True: 90, False: 2.90k]
  ------------------
  938|  2.90k|    if (hSize >= cSrcSize) 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 (938:9): [True: 18, False: 2.88k]
  ------------------
  939|  2.88k|    ip += hSize; cSrcSize -= hSize;
  940|       |
  941|  2.88k|    return HUF_decompress4X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, flags);
  942|  2.90k|}

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

ZSTD_sizeof_DCtx:
  222|  10.2k|{
  223|  10.2k|    if (dctx==NULL) return 0;   /* support sizeof NULL */
  ------------------
  |  Branch (223:9): [True: 0, False: 10.2k]
  ------------------
  224|  10.2k|    return sizeof(*dctx)
  225|  10.2k|           + ZSTD_sizeof_DDict(dctx->ddictLocal)
  226|  10.2k|           + dctx->inBuffSize + dctx->outBuffSize;
  227|  10.2k|}
ZSTD_createDCtx:
  311|  10.2k|{
  312|  10.2k|    DEBUGLOG(3, "ZSTD_createDCtx");
  ------------------
  |  |  104|  10.2k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
  313|  10.2k|    return ZSTD_createDCtx_internal(ZSTD_defaultCMem);
  314|  10.2k|}
ZSTD_freeDCtx:
  325|  10.2k|{
  326|  10.2k|    if (dctx==NULL) return 0;   /* support free on NULL */
  ------------------
  |  Branch (326:9): [True: 0, False: 10.2k]
  ------------------
  327|  10.2k|    RETURN_ERROR_IF(dctx->staticSize, memory_allocation, "not compatible with static DCtx");
  ------------------
  |  |  114|  10.2k|    do {                                                                       \
  |  |  115|  10.2k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 10.2k]
  |  |  ------------------
  |  |  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|  10.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
  328|  10.2k|    {   ZSTD_customMem const cMem = dctx->customMem;
  329|  10.2k|        ZSTD_clearDict(dctx);
  330|  10.2k|        ZSTD_customFree(dctx->inBuff, cMem);
  331|  10.2k|        dctx->inBuff = NULL;
  332|  10.2k|#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)
  333|  10.2k|        if (dctx->legacyContext)
  ------------------
  |  Branch (333:13): [True: 0, False: 10.2k]
  ------------------
  334|      0|            ZSTD_freeLegacyStreamContext(dctx->legacyContext, dctx->previousLegacyVersion);
  335|  10.2k|#endif
  336|  10.2k|        if (dctx->ddictSet) {
  ------------------
  |  Branch (336:13): [True: 0, False: 10.2k]
  ------------------
  337|      0|            ZSTD_freeDDictHashSet(dctx->ddictSet, cMem);
  338|       |            dctx->ddictSet = NULL;
  339|      0|        }
  340|  10.2k|        ZSTD_customFree(dctx, cMem);
  341|  10.2k|        return 0;
  342|  10.2k|    }
  343|  10.2k|}
ZSTD_getFrameHeader_advanced:
  448|  13.9k|{
  449|  13.9k|    const BYTE* ip = (const BYTE*)src;
  450|  13.9k|    size_t const minInputSize = ZSTD_startingInputLength(format);
  451|       |
  452|  13.9k|    DEBUGLOG(5, "ZSTD_getFrameHeader_advanced: minInputSize = %zu, srcSize = %zu", minInputSize, srcSize);
  ------------------
  |  |  104|  13.9k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 13.9k]
  |  |  ------------------
  ------------------
  453|       |
  454|  13.9k|    if (srcSize > 0) {
  ------------------
  |  Branch (454:9): [True: 13.9k, False: 0]
  ------------------
  455|       |        /* note : technically could be considered an assert(), since it's an invalid entry */
  456|  13.9k|        RETURN_ERROR_IF(src==NULL, GENERIC, "invalid parameter : src==NULL, but srcSize>0");
  ------------------
  |  |  114|  13.9k|    do {                                                                       \
  |  |  115|  13.9k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 13.9k]
  |  |  ------------------
  |  |  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|  13.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 13.9k]
  |  |  ------------------
  ------------------
  457|  13.9k|    }
  458|  13.9k|    if (srcSize < minInputSize) {
  ------------------
  |  Branch (458:9): [True: 0, False: 13.9k]
  ------------------
  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|  13.9k|    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|  13.9k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  480|  13.9k|    if ( (format != ZSTD_f_zstd1_magicless)
  ------------------
  |  Branch (480:10): [True: 13.9k, False: 0]
  ------------------
  481|  13.9k|      && (MEM_readLE32(src) != ZSTD_MAGICNUMBER) ) {
  ------------------
  |  |  142|  13.9k|#define ZSTD_MAGICNUMBER            0xFD2FB528    /* valid since v0.8.0 */
  ------------------
  |  Branch (481:10): [True: 550, False: 13.3k]
  ------------------
  482|    550|        if ((MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  145|    550|#define ZSTD_MAGIC_SKIPPABLE_MASK   0xFFFFFFF0
  ------------------
                      if ((MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  144|    550|#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: 550]
  ------------------
  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|    550|        RETURN_ERROR(prefix_unknown, "");
  ------------------
  |  |  131|    550|    do {                                                                     \
  |  |  132|    550|        RAWLOG(3, "%s:%d: ERROR!: unconditional check failed, returning %s", \
  |  |  ------------------
  |  |  |  |  103|    550|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 550]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  133|    550|              __FILE__, __LINE__, ERR_QUOTE(ERROR(err)));                    \
  |  |  134|    550|        _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                               \
  |  |  ------------------
  |  |  |  |   98|    550|    do {                                           \
  |  |  |  |   99|    550|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 550]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    550|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 550]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  135|    550|        RAWLOG(3, ": " __VA_ARGS__);                                         \
  |  |  ------------------
  |  |  |  |  103|    550|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 550]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  136|    550|        RAWLOG(3, "\n");                                                     \
  |  |  ------------------
  |  |  |  |  103|    550|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 550]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  137|    550|        return ERROR(err);                                                   \
  |  |  ------------------
  |  |  |  |   49|    550|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    550|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    550|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  138|    550|    } while(0)
  |  |  ------------------
  |  |  |  Branch (138:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  494|    550|    }
  495|       |
  496|       |    /* ensure there is enough `srcSize` to fully read/decode frame header */
  497|  13.3k|    {   size_t const fhsize = ZSTD_frameHeaderSize_internal(src, srcSize, format);
  498|  13.3k|        if (srcSize < fhsize) return fhsize;
  ------------------
  |  Branch (498:13): [True: 0, False: 13.3k]
  ------------------
  499|  13.3k|        zfhPtr->headerSize = (U32)fhsize;
  500|  13.3k|    }
  501|       |
  502|      0|    {   BYTE const fhdByte = ip[minInputSize-1];
  503|  13.3k|        size_t pos = minInputSize;
  504|  13.3k|        U32 const dictIDSizeCode = fhdByte&3;
  505|  13.3k|        U32 const checksumFlag = (fhdByte>>2)&1;
  506|  13.3k|        U32 const singleSegment = (fhdByte>>5)&1;
  507|  13.3k|        U32 const fcsID = fhdByte>>6;
  508|  13.3k|        U64 windowSize = 0;
  509|  13.3k|        U32 dictID = 0;
  510|  13.3k|        U64 frameContentSize = ZSTD_CONTENTSIZE_UNKNOWN;
  ------------------
  |  |  203|  13.3k|#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
  ------------------
  511|  13.3k|        RETURN_ERROR_IF((fhdByte & 0x08) != 0, frameParameter_unsupported,
  ------------------
  |  |  114|  13.3k|    do {                                                                       \
  |  |  115|  13.3k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 13.3k]
  |  |  ------------------
  |  |  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|  13.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 13.3k]
  |  |  ------------------
  ------------------
  512|  13.3k|                        "reserved bits, must be zero");
  513|       |
  514|  13.3k|        if (!singleSegment) {
  ------------------
  |  Branch (514:13): [True: 7.33k, False: 6.03k]
  ------------------
  515|  7.33k|            BYTE const wlByte = ip[pos++];
  516|  7.33k|            U32 const windowLog = (wlByte >> 3) + ZSTD_WINDOWLOG_ABSOLUTEMIN;
  ------------------
  |  |   78|  7.33k|#define ZSTD_WINDOWLOG_ABSOLUTEMIN 10
  ------------------
  517|  7.33k|            RETURN_ERROR_IF(windowLog > ZSTD_WINDOWLOG_MAX, frameParameter_windowTooLarge, "");
  ------------------
  |  |  114|  7.33k|    do {                                                                       \
  |  |  115|  22.0k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [Folded, False: 7.33k]
  |  |  |  Branch (115:13): [True: 1, False: 7.33k]
  |  |  ------------------
  |  |  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|  7.33k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 7.33k]
  |  |  ------------------
  ------------------
  518|  7.33k|            windowSize = (1ULL << windowLog);
  519|  7.33k|            windowSize += (windowSize >> 3) * (wlByte&7);
  520|  7.33k|        }
  521|  13.3k|        switch(dictIDSizeCode)
  522|  13.3k|        {
  523|      0|            default:
  ------------------
  |  Branch (523:13): [True: 0, False: 13.3k]
  ------------------
  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|  9.44k|            case 0 : break;
  ------------------
  |  Branch (526:13): [True: 9.44k, False: 3.92k]
  ------------------
  527|  2.78k|            case 1 : dictID = ip[pos]; pos++; break;
  ------------------
  |  Branch (527:13): [True: 2.78k, False: 10.5k]
  ------------------
  528|    747|            case 2 : dictID = MEM_readLE16(ip+pos); pos+=2; break;
  ------------------
  |  Branch (528:13): [True: 747, False: 12.6k]
  ------------------
  529|    395|            case 3 : dictID = MEM_readLE32(ip+pos); pos+=4; break;
  ------------------
  |  Branch (529:13): [True: 395, False: 12.9k]
  ------------------
  530|  13.3k|        }
  531|  13.3k|        switch(fcsID)
  532|  13.3k|        {
  533|      0|            default:
  ------------------
  |  Branch (533:13): [True: 0, False: 13.3k]
  ------------------
  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|  9.59k|            case 0 : if (singleSegment) frameContentSize = ip[pos]; break;
  ------------------
  |  Branch (536:13): [True: 9.59k, False: 3.77k]
  |  Branch (536:26): [True: 2.92k, False: 6.67k]
  ------------------
  537|    420|            case 1 : frameContentSize = MEM_readLE16(ip+pos)+256; break;
  ------------------
  |  Branch (537:13): [True: 420, False: 12.9k]
  ------------------
  538|  1.56k|            case 2 : frameContentSize = MEM_readLE32(ip+pos); break;
  ------------------
  |  Branch (538:13): [True: 1.56k, False: 11.8k]
  ------------------
  539|  1.79k|            case 3 : frameContentSize = MEM_readLE64(ip+pos); break;
  ------------------
  |  Branch (539:13): [True: 1.79k, False: 11.5k]
  ------------------
  540|  13.3k|        }
  541|  13.3k|        if (singleSegment) windowSize = frameContentSize;
  ------------------
  |  Branch (541:13): [True: 6.03k, False: 7.33k]
  ------------------
  542|       |
  543|  13.3k|        zfhPtr->frameType = ZSTD_frame;
  544|  13.3k|        zfhPtr->frameContentSize = frameContentSize;
  545|  13.3k|        zfhPtr->windowSize = windowSize;
  546|  13.3k|        zfhPtr->blockSizeMax = (unsigned) MIN(windowSize, ZSTD_BLOCKSIZE_MAX);
  ------------------
  |  |   54|  13.3k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 10.7k, False: 2.66k]
  |  |  ------------------
  ------------------
  547|  13.3k|        zfhPtr->dictID = dictID;
  548|  13.3k|        zfhPtr->checksumFlag = checksumFlag;
  549|  13.3k|    }
  550|      0|    return 0;
  551|  13.3k|}
ZSTD_getFrameContentSize:
  570|  8.94k|{
  571|  8.94k|#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)
  572|  8.94k|    if (ZSTD_isLegacy(src, srcSize)) {
  ------------------
  |  Branch (572:9): [True: 8.94k, False: 0]
  ------------------
  573|  8.94k|        unsigned long long const ret = ZSTD_getDecompressedSize_legacy(src, srcSize);
  574|  8.94k|        return ret == 0 ? ZSTD_CONTENTSIZE_UNKNOWN : ret;
  ------------------
  |  |  203|  8.64k|#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
  ------------------
  |  Branch (574:16): [True: 8.64k, False: 301]
  ------------------
  575|  8.94k|    }
  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|  8.80k|{
 1199|  8.80k|    return ZSTD_decompress_usingDDict(dctx, dst, dstCapacity, src, srcSize, ZSTD_getDDict(dctx));
 1200|  8.80k|}
ZSTD_loadDEntropy:
 1454|  1.00k|{
 1455|  1.00k|    const BYTE* dictPtr = (const BYTE*)dict;
 1456|  1.00k|    const BYTE* const dictEnd = dictPtr + dictSize;
 1457|       |
 1458|  1.00k|    RETURN_ERROR_IF(dictSize <= 8, dictionary_corrupted, "dict is too small");
  ------------------
  |  |  114|  1.00k|    do {                                                                       \
  |  |  115|  1.00k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 1.00k]
  |  |  ------------------
  |  |  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.00k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.00k]
  |  |  ------------------
  ------------------
 1459|  1.00k|    assert(MEM_readLE32(dict) == ZSTD_MAGIC_DICTIONARY);   /* dict must be valid */
  ------------------
  |  |   70|  1.00k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1460|  1.00k|    dictPtr += 8;   /* skip header = magic + dictID */
 1461|       |
 1462|  1.00k|    ZSTD_STATIC_ASSERT(offsetof(ZSTD_entropyDTables_t, OFTable) == offsetof(ZSTD_entropyDTables_t, LLTable) + sizeof(entropy->LLTable));
  ------------------
  |  |   43|  1.00k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  1.00k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1463|  1.00k|    ZSTD_STATIC_ASSERT(offsetof(ZSTD_entropyDTables_t, MLTable) == offsetof(ZSTD_entropyDTables_t, OFTable) + sizeof(entropy->OFTable));
  ------------------
  |  |   43|  1.00k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  1.00k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1464|  1.00k|    ZSTD_STATIC_ASSERT(sizeof(entropy->LLTable) + sizeof(entropy->OFTable) + sizeof(entropy->MLTable) >= HUF_DECOMPRESS_WORKSPACE_SIZE);
  ------------------
  |  |   43|  1.00k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  1.00k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1465|  1.00k|    {   void* const workspace = &entropy->LLTable;   /* use fse tables as temporary workspace; implies fse tables are grouped together */
 1466|  1.00k|        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|  1.00k|        size_t const hSize = HUF_readDTableX2_wksp(entropy->hufTable,
 1474|  1.00k|                                                dictPtr, (size_t)(dictEnd - dictPtr),
 1475|  1.00k|                                                workspace, workspaceSize, /* flags */ 0);
 1476|  1.00k|#endif
 1477|  1.00k|        RETURN_ERROR_IF(HUF_isError(hSize), dictionary_corrupted, "");
  ------------------
  |  |  114|  1.00k|    do {                                                                       \
  |  |  115|  1.00k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 125, False: 878]
  |  |  ------------------
  |  |  116|    125|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    125|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 125]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    125|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    125|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    125|    do {                                           \
  |  |  |  |   99|    125|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 125]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    125|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 125]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    125|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    125|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 125]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    125|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    125|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 125]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    125|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    125|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    125|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    125|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    125|        }                                                                      \
  |  |  123|  1.00k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 878]
  |  |  ------------------
  ------------------
 1478|    878|        dictPtr += hSize;
 1479|    878|    }
 1480|       |
 1481|      0|    {   short offcodeNCount[MaxOff+1];
 1482|    878|        unsigned offcodeMaxValue = MaxOff, offcodeLog;
  ------------------
  |  |  106|    878|#define MaxOff  31
  ------------------
 1483|    878|        size_t const offcodeHeaderSize = FSE_readNCount(offcodeNCount, &offcodeMaxValue, &offcodeLog, dictPtr, (size_t)(dictEnd-dictPtr));
 1484|    878|        RETURN_ERROR_IF(FSE_isError(offcodeHeaderSize), dictionary_corrupted, "");
  ------------------
  |  |  114|    878|    do {                                                                       \
  |  |  115|    878|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 145, False: 733]
  |  |  ------------------
  |  |  116|    145|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    145|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 145]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    145|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    145|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    145|    do {                                           \
  |  |  |  |   99|    145|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 145]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    145|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 145]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    145|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    145|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 145]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    145|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    145|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 145]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    145|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    145|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    145|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    145|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    145|        }                                                                      \
  |  |  123|    878|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 733]
  |  |  ------------------
  ------------------
 1485|    733|        RETURN_ERROR_IF(offcodeMaxValue > MaxOff, dictionary_corrupted, "");
  ------------------
  |  |  114|    733|    do {                                                                       \
  |  |  115|    733|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 733]
  |  |  ------------------
  |  |  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|    733|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 733]
  |  |  ------------------
  ------------------
 1486|    733|        RETURN_ERROR_IF(offcodeLog > OffFSELog, dictionary_corrupted, "");
  ------------------
  |  |  114|    733|    do {                                                                       \
  |  |  115|    733|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 6, False: 727]
  |  |  ------------------
  |  |  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|    733|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 727]
  |  |  ------------------
  ------------------
 1487|    727|        ZSTD_buildFSETable( entropy->OFTable,
 1488|    727|                            offcodeNCount, offcodeMaxValue,
 1489|    727|                            OF_base, OF_bits,
 1490|    727|                            offcodeLog,
 1491|    727|                            entropy->workspace, sizeof(entropy->workspace),
 1492|    727|                            /* bmi2 */0);
 1493|    727|        dictPtr += offcodeHeaderSize;
 1494|    727|    }
 1495|       |
 1496|      0|    {   short matchlengthNCount[MaxML+1];
 1497|    727|        unsigned matchlengthMaxValue = MaxML, matchlengthLog;
  ------------------
  |  |  103|    727|#define MaxML   52
  ------------------
 1498|    727|        size_t const matchlengthHeaderSize = FSE_readNCount(matchlengthNCount, &matchlengthMaxValue, &matchlengthLog, dictPtr, (size_t)(dictEnd-dictPtr));
 1499|    727|        RETURN_ERROR_IF(FSE_isError(matchlengthHeaderSize), dictionary_corrupted, "");
  ------------------
  |  |  114|    727|    do {                                                                       \
  |  |  115|    727|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 26, False: 701]
  |  |  ------------------
  |  |  116|     26|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     26|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 26]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     26|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     26|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     26|    do {                                           \
  |  |  |  |   99|     26|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 26]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     26|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 26]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     26|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     26|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 26]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     26|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     26|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 26]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     26|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     26|        }                                                                      \
  |  |  123|    727|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 701]
  |  |  ------------------
  ------------------
 1500|    701|        RETURN_ERROR_IF(matchlengthMaxValue > MaxML, dictionary_corrupted, "");
  ------------------
  |  |  114|    701|    do {                                                                       \
  |  |  115|    701|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 701]
  |  |  ------------------
  |  |  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|    701|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 701]
  |  |  ------------------
  ------------------
 1501|    701|        RETURN_ERROR_IF(matchlengthLog > MLFSELog, dictionary_corrupted, "");
  ------------------
  |  |  114|    701|    do {                                                                       \
  |  |  115|    701|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4, False: 697]
  |  |  ------------------
  |  |  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|    701|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 697]
  |  |  ------------------
  ------------------
 1502|    697|        ZSTD_buildFSETable( entropy->MLTable,
 1503|    697|                            matchlengthNCount, matchlengthMaxValue,
 1504|    697|                            ML_base, ML_bits,
 1505|    697|                            matchlengthLog,
 1506|    697|                            entropy->workspace, sizeof(entropy->workspace),
 1507|    697|                            /* bmi2 */ 0);
 1508|    697|        dictPtr += matchlengthHeaderSize;
 1509|    697|    }
 1510|       |
 1511|      0|    {   short litlengthNCount[MaxLL+1];
 1512|    697|        unsigned litlengthMaxValue = MaxLL, litlengthLog;
  ------------------
  |  |  104|    697|#define MaxLL   35
  ------------------
 1513|    697|        size_t const litlengthHeaderSize = FSE_readNCount(litlengthNCount, &litlengthMaxValue, &litlengthLog, dictPtr, (size_t)(dictEnd-dictPtr));
 1514|    697|        RETURN_ERROR_IF(FSE_isError(litlengthHeaderSize), dictionary_corrupted, "");
  ------------------
  |  |  114|    697|    do {                                                                       \
  |  |  115|    697|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 31, False: 666]
  |  |  ------------------
  |  |  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|    697|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 666]
  |  |  ------------------
  ------------------
 1515|    666|        RETURN_ERROR_IF(litlengthMaxValue > MaxLL, dictionary_corrupted, "");
  ------------------
  |  |  114|    666|    do {                                                                       \
  |  |  115|    666|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 666]
  |  |  ------------------
  |  |  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|    666|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 666]
  |  |  ------------------
  ------------------
 1516|    666|        RETURN_ERROR_IF(litlengthLog > LLFSELog, dictionary_corrupted, "");
  ------------------
  |  |  114|    666|    do {                                                                       \
  |  |  115|    666|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4, False: 662]
  |  |  ------------------
  |  |  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|    666|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 662]
  |  |  ------------------
  ------------------
 1517|    662|        ZSTD_buildFSETable( entropy->LLTable,
 1518|    662|                            litlengthNCount, litlengthMaxValue,
 1519|    662|                            LL_base, LL_bits,
 1520|    662|                            litlengthLog,
 1521|    662|                            entropy->workspace, sizeof(entropy->workspace),
 1522|    662|                            /* bmi2 */ 0);
 1523|    662|        dictPtr += litlengthHeaderSize;
 1524|    662|    }
 1525|       |
 1526|    662|    RETURN_ERROR_IF(dictPtr+12 > dictEnd, dictionary_corrupted, "");
  ------------------
  |  |  114|    662|    do {                                                                       \
  |  |  115|    662|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 19, False: 643]
  |  |  ------------------
  |  |  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|    662|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 643]
  |  |  ------------------
  ------------------
 1527|    643|    {   int i;
 1528|    643|        size_t const dictContentSize = (size_t)(dictEnd - (dictPtr+12));
 1529|  2.34k|        for (i=0; i<3; i++) {
  ------------------
  |  Branch (1529:19): [True: 1.81k, False: 532]
  ------------------
 1530|  1.81k|            U32 const rep = MEM_readLE32(dictPtr); dictPtr += 4;
 1531|  1.81k|            RETURN_ERROR_IF(rep==0 || rep > dictContentSize,
  ------------------
  |  |  114|  1.81k|    do {                                                                       \
  |  |  115|  5.43k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 1.81k]
  |  |  |  Branch (115:13): [True: 108, False: 1.70k]
  |  |  ------------------
  |  |  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|  1.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.70k]
  |  |  ------------------
  ------------------
 1532|  1.81k|                            dictionary_corrupted, "");
 1533|  1.70k|            entropy->rep[i] = rep;
 1534|  1.70k|    }   }
 1535|       |
 1536|    532|    return (size_t)(dictPtr - (const BYTE*)dict);
 1537|    643|}
ZSTD_decompressBegin:
 1561|  14.1k|{
 1562|  14.1k|    assert(dctx != NULL);
  ------------------
  |  |   70|  14.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1563|  14.1k|#if ZSTD_TRACE
 1564|  14.1k|    dctx->traceCtx = (ZSTD_trace_decompress_begin != NULL) ? ZSTD_trace_decompress_begin(dctx) : 0;
  ------------------
  |  Branch (1564:22): [True: 0, False: 14.1k]
  ------------------
 1565|  14.1k|#endif
 1566|  14.1k|    dctx->expected = ZSTD_startingInputLength(dctx->format);  /* dctx->format must be properly set */
 1567|  14.1k|    dctx->stage = ZSTDds_getFrameHeaderSize;
 1568|  14.1k|    dctx->processedCSize = 0;
 1569|  14.1k|    dctx->decodedSize = 0;
 1570|  14.1k|    dctx->previousDstEnd = NULL;
 1571|  14.1k|    dctx->prefixStart = NULL;
 1572|  14.1k|    dctx->virtualStart = NULL;
 1573|  14.1k|    dctx->dictEnd = NULL;
 1574|  14.1k|    dctx->entropy.hufTable[0] = (HUF_DTable)((ZSTD_HUFFDTABLE_CAPACITY_LOG)*0x1000001);  /* cover both little and big endian */
  ------------------
  |  |   78|  14.1k|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
 1575|  14.1k|    dctx->litEntropy = dctx->fseEntropy = 0;
 1576|  14.1k|    dctx->dictID = 0;
 1577|  14.1k|    dctx->bType = bt_reserved;
 1578|  14.1k|    dctx->isFrameDecompression = 1;
 1579|  14.1k|    ZSTD_STATIC_ASSERT(sizeof(dctx->entropy.rep) == sizeof(repStartValue));
  ------------------
  |  |   43|  14.1k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  14.1k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1580|  14.1k|    ZSTD_memcpy(dctx->entropy.rep, repStartValue, sizeof(repStartValue));  /* initial repcodes */
  ------------------
  |  |   44|  14.1k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1581|  14.1k|    dctx->LLTptr = dctx->entropy.LLTable;
 1582|  14.1k|    dctx->MLTptr = dctx->entropy.MLTable;
 1583|  14.1k|    dctx->OFTptr = dctx->entropy.OFTable;
 1584|  14.1k|    dctx->HUFptr = dctx->entropy.hufTable;
 1585|  14.1k|    return 0;
 1586|  14.1k|}
ZSTD_decompressBegin_usingDict:
 1589|  11.7k|{
 1590|  11.7k|    FORWARD_IF_ERROR( ZSTD_decompressBegin(dctx) , "");
  ------------------
  |  |  146|  11.7k|    do {                                                                           \
  |  |  147|  11.7k|        size_t const err_code = (err);                                             \
  |  |  148|  11.7k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 0, False: 11.7k]
  |  |  ------------------
  |  |  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|  11.7k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 11.7k]
  |  |  ------------------
  ------------------
 1591|  11.7k|    if (dict && dictSize)
  ------------------
  |  Branch (1591:9): [True: 0, False: 11.7k]
  |  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|  11.7k|            ZSTD_isError(ZSTD_decompress_insertDictionary(dctx, dict, dictSize)),
 1594|  11.7k|            dictionary_corrupted, "");
 1595|  11.7k|    return 0;
 1596|  11.7k|}
ZSTD_decompressBegin_usingDDict:
 1602|  2.36k|{
 1603|  2.36k|    DEBUGLOG(4, "ZSTD_decompressBegin_usingDDict");
  ------------------
  |  |  104|  2.36k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.36k]
  |  |  ------------------
  ------------------
 1604|  2.36k|    assert(dctx != NULL);
  ------------------
  |  |   70|  2.36k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1605|  2.36k|    if (ddict) {
  ------------------
  |  Branch (1605:9): [True: 2.36k, False: 0]
  ------------------
 1606|  2.36k|        const char* const dictStart = (const char*)ZSTD_DDict_dictContent(ddict);
 1607|  2.36k|        size_t const dictSize = ZSTD_DDict_dictSize(ddict);
 1608|  2.36k|        const void* const dictEnd = dictStart + dictSize;
 1609|  2.36k|        dctx->ddictIsCold = (dctx->dictEnd != dictEnd);
 1610|  2.36k|        DEBUGLOG(4, "DDict is %s",
  ------------------
  |  |  104|  2.36k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.36k]
  |  |  ------------------
  ------------------
 1611|  2.36k|                    dctx->ddictIsCold ? "~cold~" : "hot!");
 1612|  2.36k|    }
 1613|  2.36k|    FORWARD_IF_ERROR( ZSTD_decompressBegin(dctx) , "");
  ------------------
  |  |  146|  2.36k|    do {                                                                           \
  |  |  147|  2.36k|        size_t const err_code = (err);                                             \
  |  |  148|  2.36k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 0, False: 2.36k]
  |  |  ------------------
  |  |  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.36k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 2.36k]
  |  |  ------------------
  ------------------
 1614|  2.36k|    if (ddict) {   /* NULL ddict is equivalent to no dictionary */
  ------------------
  |  Branch (1614:9): [True: 2.36k, False: 0]
  ------------------
 1615|  2.36k|        ZSTD_copyDDictParameters(dctx, ddict);
 1616|  2.36k|    }
 1617|  2.36k|    return 0;
 1618|  2.36k|}
ZSTD_decompress_usingDDict:
 1660|  12.3k|{
 1661|       |    /* pass content and size in case legacy frames are encountered */
 1662|  12.3k|    return ZSTD_decompressMultiFrame(dctx, dst, dstCapacity, src, srcSize,
 1663|       |                                     NULL, 0,
 1664|  12.3k|                                     ddict);
 1665|  12.3k|}
zstd_decompress.c:ZSTD_initDCtx_internal:
  253|  10.2k|{
  254|  10.2k|    dctx->staticSize  = 0;
  255|  10.2k|    dctx->ddict       = NULL;
  256|  10.2k|    dctx->ddictLocal  = NULL;
  257|  10.2k|    dctx->dictEnd     = NULL;
  258|  10.2k|    dctx->ddictIsCold = 0;
  259|  10.2k|    dctx->dictUses = ZSTD_dont_use;
  260|  10.2k|    dctx->inBuff      = NULL;
  261|  10.2k|    dctx->inBuffSize  = 0;
  262|  10.2k|    dctx->outBuffSize = 0;
  263|  10.2k|    dctx->streamStage = zdss_init;
  264|  10.2k|#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)
  265|  10.2k|    dctx->legacyContext = NULL;
  266|  10.2k|    dctx->previousLegacyVersion = 0;
  267|  10.2k|#endif
  268|  10.2k|    dctx->noForwardProgress = 0;
  269|  10.2k|    dctx->oversizedDuration = 0;
  270|  10.2k|    dctx->isFrameDecompression = 1;
  271|  10.2k|#if DYNAMIC_BMI2
  272|  10.2k|    dctx->bmi2 = ZSTD_cpuSupportsBmi2();
  273|  10.2k|#endif
  274|  10.2k|    dctx->ddictSet = NULL;
  275|  10.2k|    ZSTD_DCtx_resetParameters(dctx);
  276|  10.2k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  277|       |    dctx->dictContentEndForFuzzing = NULL;
  278|  10.2k|#endif
  279|  10.2k|}
zstd_decompress.c:ZSTD_createDCtx_internal:
  294|  10.2k|static ZSTD_DCtx* ZSTD_createDCtx_internal(ZSTD_customMem customMem) {
  295|  10.2k|    if ((!customMem.customAlloc) ^ (!customMem.customFree)) return NULL;
  ------------------
  |  Branch (295:9): [True: 0, False: 10.2k]
  ------------------
  296|       |
  297|  10.2k|    {   ZSTD_DCtx* const dctx = (ZSTD_DCtx*)ZSTD_customMalloc(sizeof(*dctx), customMem);
  298|  10.2k|        if (!dctx) return NULL;
  ------------------
  |  Branch (298:13): [True: 0, False: 10.2k]
  ------------------
  299|  10.2k|        dctx->customMem = customMem;
  300|  10.2k|        ZSTD_initDCtx_internal(dctx);
  301|  10.2k|        return dctx;
  302|  10.2k|    }
  303|  10.2k|}
zstd_decompress.c:ZSTD_clearDict:
  317|  19.1k|{
  318|  19.1k|    ZSTD_freeDDict(dctx->ddictLocal);
  319|  19.1k|    dctx->ddictLocal = NULL;
  320|       |    dctx->ddict = NULL;
  321|  19.1k|    dctx->dictUses = ZSTD_dont_use;
  322|  19.1k|}
zstd_decompress.c:ZSTD_frameHeaderSize_internal:
  417|  27.3k|{
  418|  27.3k|    size_t const minInputSize = ZSTD_startingInputLength(format);
  419|  27.3k|    RETURN_ERROR_IF(srcSize < minInputSize, srcSize_wrong, "");
  ------------------
  |  |  114|  27.3k|    do {                                                                       \
  |  |  115|  27.3k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 27.3k]
  |  |  ------------------
  |  |  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|  27.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 27.3k]
  |  |  ------------------
  ------------------
  420|       |
  421|  27.3k|    {   BYTE const fhd = ((const BYTE*)src)[minInputSize-1];
  422|  27.3k|        U32 const dictID= fhd & 3;
  423|  27.3k|        U32 const singleSegment = (fhd >> 5) & 1;
  424|  27.3k|        U32 const fcsId = fhd >> 6;
  425|  27.3k|        return minInputSize + !singleSegment
  426|  27.3k|             + ZSTD_did_fieldSize[dictID] + ZSTD_fcs_fieldSize[fcsId]
  427|  27.3k|             + (singleSegment && !fcsId);
  ------------------
  |  Branch (427:17): [True: 12.3k, False: 15.0k]
  |  Branch (427:34): [True: 5.92k, False: 6.38k]
  ------------------
  428|  27.3k|    }
  429|  27.3k|}
zstd_decompress.c:ZSTD_startingInputLength:
  233|  86.3k|{
  234|  86.3k|    size_t const startingInputLength = ZSTD_FRAMEHEADERSIZE_PREFIX(format);
  ------------------
  |  | 1257|  86.3k|#define ZSTD_FRAMEHEADERSIZE_PREFIX(format) ((format) == ZSTD_f_zstd1 ? 5 : 1)   /* minimum input size required to query frame header size */
  |  |  ------------------
  |  |  |  Branch (1257:46): [True: 86.3k, False: 0]
  |  |  ------------------
  ------------------
  235|       |    /* only supports formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless */
  236|  86.3k|    assert( (format == ZSTD_f_zstd1) || (format == ZSTD_f_zstd1_magicless) );
  ------------------
  |  |   70|  86.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  237|  86.3k|    return startingInputLength;
  238|  86.3k|}
zstd_decompress.c:readSkippableFrameSize:
  588|    234|{
  589|    234|    size_t const skippableHeaderSize = ZSTD_SKIPPABLEHEADERSIZE;
  ------------------
  |  | 1260|    234|#define ZSTD_SKIPPABLEHEADERSIZE    8
  ------------------
  590|    234|    U32 sizeU32;
  591|       |
  592|    234|    RETURN_ERROR_IF(srcSize < ZSTD_SKIPPABLEHEADERSIZE, srcSize_wrong, "");
  ------------------
  |  |  114|    234|    do {                                                                       \
  |  |  115|    234|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 232]
  |  |  ------------------
  |  |  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|    234|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 232]
  |  |  ------------------
  ------------------
  593|       |
  594|    232|    sizeU32 = MEM_readLE32((BYTE const*)src + ZSTD_FRAMEIDSIZE);
  ------------------
  |  |   82|    232|#define ZSTD_FRAMEIDSIZE 4   /* magic number size */
  ------------------
  595|    232|    RETURN_ERROR_IF((U32)(sizeU32 + ZSTD_SKIPPABLEHEADERSIZE) < sizeU32,
  ------------------
  |  |  114|    232|    do {                                                                       \
  |  |  115|    232|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 231]
  |  |  ------------------
  |  |  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|    232|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 231]
  |  |  ------------------
  ------------------
  596|    232|                    frameParameter_unsupported, "");
  597|    231|    {   size_t const skippableSize = skippableHeaderSize + sizeU32;
  598|    231|        RETURN_ERROR_IF(skippableSize > srcSize, srcSize_wrong, "");
  ------------------
  |  |  114|    231|    do {                                                                       \
  |  |  115|    231|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 57, False: 174]
  |  |  ------------------
  |  |  116|     57|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     57|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 57]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     57|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     57|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     57|    do {                                           \
  |  |  |  |   99|     57|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 57]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     57|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 57]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     57|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     57|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 57]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     57|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     57|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 57]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     57|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     57|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     57|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     57|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     57|        }                                                                      \
  |  |  123|    231|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 174]
  |  |  ------------------
  ------------------
  599|    174|        return skippableSize;
  600|    231|    }
  601|    231|}
zstd_decompress.c:ZSTD_decompressMultiFrame:
 1075|  12.3k|{
 1076|  12.3k|    void* const dststart = dst;
 1077|  12.3k|    int moreThan1Frame = 0;
 1078|       |
 1079|  12.3k|    DEBUGLOG(5, "ZSTD_decompressMultiFrame");
  ------------------
  |  |  104|  12.3k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
 1080|  12.3k|    assert(dict==NULL || ddict==NULL);  /* either dict or ddict set, not both */
  ------------------
  |  |   70|  12.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1081|       |
 1082|  12.3k|    if (ddict) {
  ------------------
  |  Branch (1082:9): [True: 3.53k, False: 8.80k]
  ------------------
 1083|  3.53k|        dict = ZSTD_DDict_dictContent(ddict);
 1084|  3.53k|        dictSize = ZSTD_DDict_dictSize(ddict);
 1085|  3.53k|    }
 1086|       |
 1087|  30.9k|    while (srcSize >= ZSTD_startingInputLength(dctx->format)) {
  ------------------
  |  Branch (1087:12): [True: 28.4k, False: 2.51k]
  ------------------
 1088|       |
 1089|  28.4k|#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)
 1090|  28.4k|        if (dctx->format == ZSTD_f_zstd1 && ZSTD_isLegacy(src, srcSize)) {
  ------------------
  |  Branch (1090:13): [True: 28.4k, False: 0]
  |  Branch (1090:45): [True: 14.0k, False: 14.3k]
  ------------------
 1091|  14.0k|            size_t decodedSize;
 1092|  14.0k|            size_t const frameSize = ZSTD_findFrameCompressedSizeLegacy(src, srcSize);
 1093|  14.0k|            if (ZSTD_isError(frameSize)) return frameSize;
  ------------------
  |  |   44|  14.0k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1093:17): [True: 260, False: 13.7k]
  ------------------
 1094|  13.7k|            RETURN_ERROR_IF(dctx->staticSize, memory_allocation,
  ------------------
  |  |  114|  13.7k|    do {                                                                       \
  |  |  115|  13.7k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 13.7k]
  |  |  ------------------
  |  |  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|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 13.7k]
  |  |  ------------------
  ------------------
 1095|  13.7k|                "legacy support is not compatible with static dctx");
 1096|       |
 1097|  13.7k|            decodedSize = ZSTD_decompressLegacy(dst, dstCapacity, src, frameSize, dict, dictSize);
 1098|  13.7k|            if (ZSTD_isError(decodedSize)) return decodedSize;
  ------------------
  |  |   44|  13.7k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1098:17): [True: 4.85k, False: 8.94k]
  ------------------
 1099|       |
 1100|  8.94k|            {
 1101|  8.94k|                unsigned long long const expectedSize = ZSTD_getFrameContentSize(src, srcSize);
 1102|  8.94k|                RETURN_ERROR_IF(expectedSize == ZSTD_CONTENTSIZE_ERROR, corruption_detected, "Corrupted frame header!");
  ------------------
  |  |  114|  8.94k|    do {                                                                       \
  |  |  115|  8.94k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 8.94k]
  |  |  ------------------
  |  |  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|  8.94k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 8.94k]
  |  |  ------------------
  ------------------
 1103|  8.94k|                if (expectedSize != ZSTD_CONTENTSIZE_UNKNOWN) {
  ------------------
  |  |  203|  8.94k|#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
  ------------------
  |  Branch (1103:21): [True: 271, False: 8.66k]
  ------------------
 1104|    271|                    RETURN_ERROR_IF(expectedSize != decodedSize, corruption_detected,
  ------------------
  |  |  114|    271|    do {                                                                       \
  |  |  115|    271|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 267, False: 4]
  |  |  ------------------
  |  |  116|    267|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    267|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 267]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    267|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    267|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    267|    do {                                           \
  |  |  |  |   99|    267|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 267]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    267|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 267]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    267|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    267|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 267]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    267|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    267|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 267]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    267|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    267|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    267|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    267|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    267|        }                                                                      \
  |  |  123|    271|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4]
  |  |  ------------------
  ------------------
 1105|    271|                        "Frame header size does not match decoded size!");
 1106|    271|                }
 1107|  8.94k|            }
 1108|       |
 1109|  8.67k|            assert(decodedSize <= dstCapacity);
  ------------------
  |  |   70|  8.67k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1110|  8.67k|            dst = (BYTE*)dst + decodedSize;
 1111|  8.67k|            dstCapacity -= decodedSize;
 1112|       |
 1113|  8.67k|            src = (const BYTE*)src + frameSize;
 1114|  8.67k|            srcSize -= frameSize;
 1115|       |
 1116|  8.67k|            continue;
 1117|  8.94k|        }
 1118|  14.3k|#endif
 1119|       |
 1120|  14.3k|        if (dctx->format == ZSTD_f_zstd1 && srcSize >= 4) {
  ------------------
  |  Branch (1120:13): [True: 14.3k, False: 0]
  |  Branch (1120:45): [True: 14.3k, False: 0]
  ------------------
 1121|  14.3k|            U32 const magicNumber = MEM_readLE32(src);
 1122|  14.3k|            DEBUGLOG(5, "reading magic number %08X", (unsigned)magicNumber);
  ------------------
  |  |  104|  14.3k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 14.3k]
  |  |  ------------------
  ------------------
 1123|  14.3k|            if ((magicNumber & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  145|  14.3k|#define ZSTD_MAGIC_SKIPPABLE_MASK   0xFFFFFFF0
  ------------------
                          if ((magicNumber & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  144|  14.3k|#define ZSTD_MAGIC_SKIPPABLE_START  0x184D2A50    /* all 16 values, from 0x184D2A50 to 0x184D2A5F, signal the beginning of a skippable frame */
  ------------------
  |  Branch (1123:17): [True: 234, False: 14.1k]
  ------------------
 1124|       |                /* skippable frame detected : skip it */
 1125|    234|                size_t const skippableSize = readSkippableFrameSize(src, srcSize);
 1126|    234|                FORWARD_IF_ERROR(skippableSize, "invalid skippable frame");
  ------------------
  |  |  146|    234|    do {                                                                           \
  |  |  147|    234|        size_t const err_code = (err);                                             \
  |  |  148|    234|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 60, False: 174]
  |  |  ------------------
  |  |  149|     60|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|     60|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     60|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|     60|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|     60|    do {                                           \
  |  |  |  |   99|     60|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 60]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     60|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|     60|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|     60|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|     60|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|     60|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|     60|            return err_code;                                                       \
  |  |  155|     60|        }                                                                          \
  |  |  156|    234|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 174]
  |  |  ------------------
  ------------------
 1127|    174|                assert(skippableSize <= srcSize);
  ------------------
  |  |   70|    174|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1128|       |
 1129|    174|                src = (const BYTE *)src + skippableSize;
 1130|    174|                srcSize -= skippableSize;
 1131|    174|                continue; /* check next frame */
 1132|    234|        }   }
 1133|       |
 1134|  14.1k|        if (ddict) {
  ------------------
  |  Branch (1134:13): [True: 2.36k, False: 11.7k]
  ------------------
 1135|       |            /* we were called from ZSTD_decompress_usingDDict */
 1136|  2.36k|            FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDDict(dctx, ddict), "");
  ------------------
  |  |  146|  2.36k|    do {                                                                           \
  |  |  147|  2.36k|        size_t const err_code = (err);                                             \
  |  |  148|  2.36k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 0, False: 2.36k]
  |  |  ------------------
  |  |  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.36k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 2.36k]
  |  |  ------------------
  ------------------
 1137|  11.7k|        } else {
 1138|       |            /* this will initialize correctly with no dict if dict == NULL, so
 1139|       |             * use this in all cases but ddict */
 1140|  11.7k|            FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDict(dctx, dict, dictSize), "");
  ------------------
  |  |  146|  11.7k|    do {                                                                           \
  |  |  147|  11.7k|        size_t const err_code = (err);                                             \
  |  |  148|  11.7k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 0, False: 11.7k]
  |  |  ------------------
  |  |  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|  11.7k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 11.7k]
  |  |  ------------------
  ------------------
 1141|  11.7k|        }
 1142|  14.1k|        ZSTD_checkContinuity(dctx, dst, dstCapacity);
 1143|       |
 1144|  14.1k|        {   const size_t res = ZSTD_decompressFrame(dctx, dst, dstCapacity,
 1145|  14.1k|                                                    &src, &srcSize);
 1146|  14.1k|            RETURN_ERROR_IF(
  ------------------
  |  |  114|  14.1k|    do {                                                                       \
  |  |  115|  28.7k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 550, False: 13.5k]
  |  |  |  Branch (115:13): [True: 29, False: 521]
  |  |  ------------------
  |  |  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|  14.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 14.0k]
  |  |  ------------------
  ------------------
 1147|  14.1k|                (ZSTD_getErrorCode(res) == ZSTD_error_prefix_unknown)
 1148|  14.1k|             && (moreThan1Frame==1),
 1149|  14.1k|                srcSize_wrong,
 1150|  14.1k|                "At least one frame successfully completed, "
 1151|  14.1k|                "but following bytes are garbage: "
 1152|  14.1k|                "it's more likely to be a srcSize error, "
 1153|  14.1k|                "specifying more input bytes than size of frame(s). "
 1154|  14.1k|                "Note: one could be unlucky, it might be a corruption error instead, "
 1155|  14.1k|                "happening right at the place where we expect zstd magic bytes. "
 1156|  14.1k|                "But this is _much_ less likely than a srcSize field error.");
 1157|  14.0k|            if (ZSTD_isError(res)) return res;
  ------------------
  |  |   44|  14.0k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1157:17): [True: 4.34k, False: 9.73k]
  ------------------
 1158|  9.73k|            assert(res <= dstCapacity);
  ------------------
  |  |   70|  9.73k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1159|  9.73k|            if (res != 0)
  ------------------
  |  Branch (1159:17): [True: 4.56k, False: 5.17k]
  ------------------
 1160|  4.56k|                dst = (BYTE*)dst + res;
 1161|  9.73k|            dstCapacity -= res;
 1162|  9.73k|        }
 1163|      0|        moreThan1Frame = 1;
 1164|  9.73k|    }  /* while (srcSize >= ZSTD_frameHeaderSize_prefix) */
 1165|       |
 1166|  2.51k|    RETURN_ERROR_IF(srcSize, srcSize_wrong, "input not entirely consumed");
  ------------------
  |  |  114|  2.51k|    do {                                                                       \
  |  |  115|  2.51k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 123, False: 2.39k]
  |  |  ------------------
  |  |  116|    123|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    123|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 123]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    123|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    123|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    123|    do {                                           \
  |  |  |  |   99|    123|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 123]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    123|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 123]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    123|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    123|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 123]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    123|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    123|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 123]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    123|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    123|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    123|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    123|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    123|        }                                                                      \
  |  |  123|  2.51k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.39k]
  |  |  ------------------
  ------------------
 1167|       |
 1168|  2.39k|    return (size_t)((BYTE*)dst - (BYTE*)dststart);
 1169|  2.51k|}
zstd_decompress.c:ZSTD_decompressFrame:
  956|  14.1k|{
  957|  14.1k|    const BYTE* const istart = (const BYTE*)(*srcPtr);
  958|  14.1k|    const BYTE* ip = istart;
  959|  14.1k|    BYTE* const ostart = (BYTE*)dst;
  960|  14.1k|    BYTE* const oend = dstCapacity != 0 ? ostart + dstCapacity : ostart;
  ------------------
  |  Branch (960:24): [True: 13.6k, False: 429]
  ------------------
  961|  14.1k|    BYTE* op = ostart;
  962|  14.1k|    size_t remainingSrcSize = *srcSizePtr;
  963|       |
  964|  14.1k|    DEBUGLOG(4, "ZSTD_decompressFrame (srcSize:%i)", (int)*srcSizePtr);
  ------------------
  |  |  104|  14.1k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
  965|       |
  966|       |    /* check */
  967|  14.1k|    RETURN_ERROR_IF(
  ------------------
  |  |  114|  14.1k|    do {                                                                       \
  |  |  115|  42.3k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 14.1k, False: 0]
  |  |  |  Branch (115:13): [True: 105, False: 14.0k]
  |  |  ------------------
  |  |  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|  14.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 14.0k]
  |  |  ------------------
  ------------------
  968|  14.1k|        remainingSrcSize < ZSTD_FRAMEHEADERSIZE_MIN(dctx->format)+ZSTD_blockHeaderSize,
  969|  14.1k|        srcSize_wrong, "");
  970|       |
  971|       |    /* Frame Header */
  972|  14.0k|    {   size_t const frameHeaderSize = ZSTD_frameHeaderSize_internal(
  973|  14.0k|                ip, ZSTD_FRAMEHEADERSIZE_PREFIX(dctx->format), dctx->format);
  ------------------
  |  | 1257|  14.0k|#define ZSTD_FRAMEHEADERSIZE_PREFIX(format) ((format) == ZSTD_f_zstd1 ? 5 : 1)   /* minimum input size required to query frame header size */
  |  |  ------------------
  |  |  |  Branch (1257:46): [True: 14.0k, False: 0]
  |  |  ------------------
  ------------------
  974|  14.0k|        if (ZSTD_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  |   44|  14.0k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (974:13): [True: 0, False: 14.0k]
  ------------------
  975|  14.0k|        RETURN_ERROR_IF(remainingSrcSize < frameHeaderSize+ZSTD_blockHeaderSize,
  ------------------
  |  |  114|  14.0k|    do {                                                                       \
  |  |  115|  14.0k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 84, False: 13.9k]
  |  |  ------------------
  |  |  116|     84|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     84|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 84]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     84|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     84|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     84|    do {                                           \
  |  |  |  |   99|     84|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 84]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     84|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 84]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     84|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     84|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 84]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     84|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     84|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 84]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     84|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     84|        }                                                                      \
  |  |  123|  14.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 13.9k]
  |  |  ------------------
  ------------------
  976|  14.0k|                        srcSize_wrong, "");
  977|  13.9k|        FORWARD_IF_ERROR( ZSTD_decodeFrameHeader(dctx, ip, frameHeaderSize) , "");
  ------------------
  |  |  146|  13.9k|    do {                                                                           \
  |  |  147|  13.9k|        size_t const err_code = (err);                                             \
  |  |  148|  13.9k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 554, False: 13.3k]
  |  |  ------------------
  |  |  149|    554|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|    554|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 554]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|    554|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|    554|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|    554|    do {                                           \
  |  |  |  |   99|    554|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 554]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    554|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 554]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|    554|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|    554|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 554]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|    554|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|    554|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 554]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|    554|            return err_code;                                                       \
  |  |  155|    554|        }                                                                          \
  |  |  156|  13.9k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 13.3k]
  |  |  ------------------
  ------------------
  978|  13.3k|        ip += frameHeaderSize; remainingSrcSize -= frameHeaderSize;
  979|  13.3k|    }
  980|       |
  981|       |    /* Shrink the blockSizeMax if enabled */
  982|  13.3k|    if (dctx->maxBlockSizeParam != 0)
  ------------------
  |  Branch (982:9): [True: 0, False: 13.3k]
  ------------------
  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|  44.6k|    while (1) {
  ------------------
  |  Branch (986:12): [True: 44.6k, Folded]
  ------------------
  987|  44.6k|        BYTE* oBlockEnd = oend;
  988|  44.6k|        size_t decodedSize;
  989|  44.6k|        blockProperties_t blockProperties;
  990|  44.6k|        size_t const cBlockSize = ZSTD_getcBlockSize(ip, remainingSrcSize, &blockProperties);
  991|  44.6k|        if (ZSTD_isError(cBlockSize)) return cBlockSize;
  ------------------
  |  |   44|  44.6k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (991:13): [True: 52, False: 44.6k]
  ------------------
  992|       |
  993|  44.6k|        ip += ZSTD_blockHeaderSize;
  994|  44.6k|        remainingSrcSize -= ZSTD_blockHeaderSize;
  995|  44.6k|        RETURN_ERROR_IF(cBlockSize > remainingSrcSize, srcSize_wrong, "");
  ------------------
  |  |  114|  44.6k|    do {                                                                       \
  |  |  115|  44.6k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 127, False: 44.5k]
  |  |  ------------------
  |  |  116|    127|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    127|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 127]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    127|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    127|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    127|    do {                                           \
  |  |  |  |   99|    127|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 127]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    127|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 127]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    127|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    127|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 127]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    127|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    127|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 127]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    127|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    127|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    127|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    127|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    127|        }                                                                      \
  |  |  123|  44.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 44.5k]
  |  |  ------------------
  ------------------
  996|       |
  997|  44.5k|        if (ip >= op && ip < oBlockEnd) {
  ------------------
  |  Branch (997:13): [True: 1.51k, False: 43.0k]
  |  Branch (997:25): [True: 0, False: 1.51k]
  ------------------
  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|  44.5k|        switch(blockProperties.blockType)
 1015|  44.5k|        {
 1016|  9.76k|        case bt_compressed:
  ------------------
  |  Branch (1016:9): [True: 9.76k, False: 34.7k]
  ------------------
 1017|  9.76k|            assert(dctx->isFrameDecompression == 1);
  ------------------
  |  |   70|  9.76k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1018|  9.76k|            decodedSize = ZSTD_decompressBlock_internal(dctx, op, (size_t)(oBlockEnd-op), ip, cBlockSize, not_streaming);
 1019|  9.76k|            break;
 1020|  32.9k|        case bt_raw :
  ------------------
  |  Branch (1020:9): [True: 32.9k, False: 11.5k]
  ------------------
 1021|       |            /* Use oend instead of oBlockEnd because this function is safe to overlap. It uses memmove. */
 1022|  32.9k|            decodedSize = ZSTD_copyRawBlock(op, (size_t)(oend-op), ip, cBlockSize);
 1023|  32.9k|            break;
 1024|  1.81k|        case bt_rle :
  ------------------
  |  Branch (1024:9): [True: 1.81k, False: 42.6k]
  ------------------
 1025|  1.81k|            decodedSize = ZSTD_setRleBlock(op, (size_t)(oBlockEnd-op), *ip, blockProperties.origSize);
 1026|  1.81k|            break;
 1027|      0|        case bt_reserved :
  ------------------
  |  Branch (1027:9): [True: 0, False: 44.5k]
  ------------------
 1028|      0|        default:
  ------------------
  |  Branch (1028:9): [True: 0, False: 44.5k]
  ------------------
 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|  44.5k|        }
 1031|  44.5k|        FORWARD_IF_ERROR(decodedSize, "Block decompression failure");
  ------------------
  |  |  146|  44.5k|    do {                                                                           \
  |  |  147|  44.5k|        size_t const err_code = (err);                                             \
  |  |  148|  44.5k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 3.24k, False: 41.2k]
  |  |  ------------------
  |  |  149|  3.24k|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|  3.24k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 3.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  3.24k|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|  3.24k|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|  3.24k|    do {                                           \
  |  |  |  |   99|  3.24k|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 3.24k]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|  3.24k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 3.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|  3.24k|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|  3.24k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 3.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  3.24k|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|  3.24k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 3.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|  3.24k|            return err_code;                                                       \
  |  |  155|  3.24k|        }                                                                          \
  |  |  156|  44.5k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 41.2k]
  |  |  ------------------
  ------------------
 1032|  41.2k|        DEBUGLOG(5, "Decompressed block of dSize = %u", (unsigned)decodedSize);
  ------------------
  |  |  104|  41.2k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 41.2k]
  |  |  ------------------
  ------------------
 1033|  41.2k|        if (dctx->validateChecksum) {
  ------------------
  |  Branch (1033:13): [True: 16.6k, False: 24.6k]
  ------------------
 1034|  16.6k|            XXH64_update(&dctx->xxhState, op, decodedSize);
  ------------------
  |  |  460|  16.6k|#  define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update)
  |  |  ------------------
  |  |  |  |  443|  16.6k|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|  16.6k|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1035|  16.6k|        }
 1036|  41.2k|        if (decodedSize) /* support dst = NULL,0 */ {
  ------------------
  |  Branch (1036:13): [True: 16.0k, False: 25.2k]
  ------------------
 1037|  16.0k|            op += decodedSize;
 1038|  16.0k|        }
 1039|  41.2k|        assert(ip != NULL);
  ------------------
  |  |   70|  41.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1040|  41.2k|        ip += cBlockSize;
 1041|  41.2k|        remainingSrcSize -= cBlockSize;
 1042|  41.2k|        if (blockProperties.lastBlock) break;
  ------------------
  |  Branch (1042:13): [True: 9.94k, False: 31.3k]
  ------------------
 1043|  41.2k|    }
 1044|       |
 1045|  9.94k|    if (dctx->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN) {
  ------------------
  |  |  203|  9.94k|#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
  ------------------
  |  Branch (1045:9): [True: 4.39k, False: 5.54k]
  ------------------
 1046|  4.39k|        RETURN_ERROR_IF((U64)(op-ostart) != dctx->fParams.frameContentSize,
  ------------------
  |  |  114|  4.39k|    do {                                                                       \
  |  |  115|  4.39k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 124, False: 4.27k]
  |  |  ------------------
  |  |  116|    124|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    124|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 124]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    124|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    124|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    124|    do {                                           \
  |  |  |  |   99|    124|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 124]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    124|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 124]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    124|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    124|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 124]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    124|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    124|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 124]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    124|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    124|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    124|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    124|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    124|        }                                                                      \
  |  |  123|  4.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.27k]
  |  |  ------------------
  ------------------
 1047|  4.39k|                        corruption_detected, "");
 1048|  4.39k|    }
 1049|  9.82k|    if (dctx->fParams.checksumFlag) { /* Frame content checksum verification */
  ------------------
  |  Branch (1049:9): [True: 106, False: 9.71k]
  ------------------
 1050|    106|        RETURN_ERROR_IF(remainingSrcSize<4, checksum_wrong, "");
  ------------------
  |  |  114|    106|    do {                                                                       \
  |  |  115|    106|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 14, False: 92]
  |  |  ------------------
  |  |  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|    106|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 92]
  |  |  ------------------
  ------------------
 1051|     92|        if (!dctx->forceIgnoreChecksum) {
  ------------------
  |  Branch (1051:13): [True: 92, False: 0]
  ------------------
 1052|     92|            U32 const checkCalc = (U32)XXH64_digest(&dctx->xxhState);
  ------------------
  |  |  461|     92|#  define XXH64_digest XXH_NAME2(XXH_NAMESPACE, XXH64_digest)
  |  |  ------------------
  |  |  |  |  443|     92|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|     92|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1053|     92|            U32 checkRead;
 1054|     92|            checkRead = MEM_readLE32(ip);
 1055|     92|            RETURN_ERROR_IF(checkRead != checkCalc, checksum_wrong, "");
  ------------------
  |  |  114|     92|    do {                                                                       \
  |  |  115|     92|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 72, False: 20]
  |  |  ------------------
  |  |  116|     72|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     72|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 72]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     72|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     72|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     72|    do {                                           \
  |  |  |  |   99|     72|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 72]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     72|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 72]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     72|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     72|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 72]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     72|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     72|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 72]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     72|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     72|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     72|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     72|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     72|        }                                                                      \
  |  |  123|     92|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 20]
  |  |  ------------------
  ------------------
 1056|     92|        }
 1057|     20|        ip += 4;
 1058|     20|        remainingSrcSize -= 4;
 1059|     20|    }
 1060|  9.73k|    ZSTD_DCtx_trace_end(dctx, (U64)(op-ostart), (U64)(ip-istart), /* streaming */ 0);
 1061|       |    /* Allow caller to get size read */
 1062|  9.73k|    DEBUGLOG(4, "ZSTD_decompressFrame: decompressed frame of size %i, consuming %i bytes of input", (int)(op-ostart), (int)(ip - (const BYTE*)*srcPtr));
  ------------------
  |  |  104|  9.73k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 9.73k]
  |  |  ------------------
  ------------------
 1063|  9.73k|    *srcPtr = ip;
 1064|  9.73k|    *srcSizePtr = remainingSrcSize;
 1065|  9.73k|    return (size_t)(op-ostart);
 1066|  9.82k|}
zstd_decompress.c:ZSTD_getDDict:
 1181|  8.80k|{
 1182|  8.80k|    switch (dctx->dictUses) {
 1183|      0|    default:
  ------------------
  |  Branch (1183:5): [True: 0, False: 8.80k]
  ------------------
 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|  8.80k|    case ZSTD_dont_use:
  ------------------
  |  Branch (1186:5): [True: 8.80k, False: 0]
  ------------------
 1187|  8.80k|        ZSTD_clearDict(dctx);
 1188|  8.80k|        return NULL;
 1189|      0|    case ZSTD_use_indefinitely:
  ------------------
  |  Branch (1189:5): [True: 0, False: 8.80k]
  ------------------
 1190|      0|        return dctx->ddict;
 1191|      0|    case ZSTD_use_once:
  ------------------
  |  Branch (1191:5): [True: 0, False: 8.80k]
  ------------------
 1192|      0|        dctx->dictUses = ZSTD_dont_use;
 1193|      0|        return dctx->ddict;
 1194|  8.80k|    }
 1195|  8.80k|}
zstd_decompress.c:ZSTD_decodeFrameHeader:
  703|  13.9k|{
  704|  13.9k|    size_t const result = ZSTD_getFrameHeader_advanced(&(dctx->fParams), src, headerSize, dctx->format);
  705|  13.9k|    if (ZSTD_isError(result)) return result;    /* invalid header */
  ------------------
  |  |   44|  13.9k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (705:9): [True: 554, False: 13.3k]
  ------------------
  706|  13.3k|    RETURN_ERROR_IF(result>0, srcSize_wrong, "headerSize too small");
  ------------------
  |  |  114|  13.3k|    do {                                                                       \
  |  |  115|  13.3k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 13.3k]
  |  |  ------------------
  |  |  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|  13.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 13.3k]
  |  |  ------------------
  ------------------
  707|       |
  708|       |    /* Reference DDict requested by frame if dctx references multiple ddicts */
  709|  13.3k|    if (dctx->refMultipleDDicts == ZSTD_rmd_refMultipleDDicts && dctx->ddictSet) {
  ------------------
  |  Branch (709:9): [True: 0, False: 13.3k]
  |  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|  13.3k|    dctx->validateChecksum = (dctx->fParams.checksumFlag && !dctx->forceIgnoreChecksum) ? 1 : 0;
  ------------------
  |  Branch (720:31): [True: 1.62k, False: 11.7k]
  |  Branch (720:61): [True: 1.62k, False: 0]
  ------------------
  721|  13.3k|    if (dctx->validateChecksum) XXH64_reset(&dctx->xxhState, 0);
  ------------------
  |  |  459|  1.62k|#  define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset)
  |  |  ------------------
  |  |  |  |  443|  1.62k|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|  1.62k|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (721:9): [True: 1.62k, False: 11.7k]
  ------------------
  722|  13.3k|    dctx->processedCSize += headerSize;
  723|  13.3k|    return 0;
  724|  13.3k|}
zstd_decompress.c:ZSTD_copyRawBlock:
  898|  32.9k|{
  899|  32.9k|    DEBUGLOG(5, "ZSTD_copyRawBlock");
  ------------------
  |  |  104|  32.9k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 32.9k]
  |  |  ------------------
  ------------------
  900|  32.9k|    RETURN_ERROR_IF(srcSize > dstCapacity, dstSize_tooSmall, "");
  ------------------
  |  |  114|  32.9k|    do {                                                                       \
  |  |  115|  32.9k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 23, False: 32.9k]
  |  |  ------------------
  |  |  116|     23|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     23|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 23]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     23|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     23|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     23|    do {                                           \
  |  |  |  |   99|     23|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 23]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     23|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 23]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     23|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     23|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 23]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     23|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     23|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 23]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     23|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     23|        }                                                                      \
  |  |  123|  32.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 32.9k]
  |  |  ------------------
  ------------------
  901|  32.9k|    if (dst == NULL) {
  ------------------
  |  Branch (901:9): [True: 0, False: 32.9k]
  ------------------
  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|  32.9k|    ZSTD_memmove(dst, src, srcSize);
  ------------------
  |  |   45|  32.9k|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  906|  32.9k|    return srcSize;
  907|  32.9k|}
zstd_decompress.c:ZSTD_setRleBlock:
  912|  1.81k|{
  913|  1.81k|    RETURN_ERROR_IF(regenSize > dstCapacity, dstSize_tooSmall, "");
  ------------------
  |  |  114|  1.81k|    do {                                                                       \
  |  |  115|  1.81k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 21, False: 1.79k]
  |  |  ------------------
  |  |  116|     21|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     21|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 21]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     21|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     21|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     21|    do {                                           \
  |  |  |  |   99|     21|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 21]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     21|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 21]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     21|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     21|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 21]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     21|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     21|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 21]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     21|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     21|        }                                                                      \
  |  |  123|  1.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.79k]
  |  |  ------------------
  ------------------
  914|  1.79k|    if (dst == NULL) {
  ------------------
  |  Branch (914:9): [True: 0, False: 1.79k]
  ------------------
  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|  1.79k|    ZSTD_memset(dst, b, regenSize);
  ------------------
  |  |   46|  1.79k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  919|  1.79k|    return regenSize;
  920|  1.79k|}
zstd_decompress.c:ZSTD_DCtx_trace_end:
  923|  9.73k|{
  924|  9.73k|#if ZSTD_TRACE
  925|  9.73k|    if (dctx->traceCtx && ZSTD_trace_decompress_end != NULL) {
  ------------------
  |  Branch (925:9): [True: 0, False: 9.73k]
  |  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|  9.73k|}
zstd_decompress.c:ZSTD_DCtx_resetParameters:
  241|  10.2k|{
  242|  10.2k|    assert(dctx->streamStage == zdss_init);
  ------------------
  |  |   70|  10.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  243|  10.2k|    dctx->format = ZSTD_f_zstd1;
  244|  10.2k|    dctx->maxWindowSize = ZSTD_MAXWINDOWSIZE_DEFAULT;
  ------------------
  |  |   40|  10.2k|#  define ZSTD_MAXWINDOWSIZE_DEFAULT (((U32)1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT) + 1)
  |  |  ------------------
  |  |  |  | 1287|  10.2k|#define ZSTD_WINDOWLOG_LIMIT_DEFAULT 27   /* by default, the streaming decoder will refuse any frame
  |  |  ------------------
  ------------------
  245|  10.2k|    dctx->outBufferMode = ZSTD_bm_buffered;
  246|  10.2k|    dctx->forceIgnoreChecksum = ZSTD_d_validateChecksum;
  247|  10.2k|    dctx->refMultipleDDicts = ZSTD_rmd_refSingleDDict;
  248|  10.2k|    dctx->disableHufAsm = 0;
  249|  10.2k|    dctx->maxBlockSizeParam = 0;
  250|  10.2k|}

ZSTD_getcBlockSize:
   65|  44.6k|{
   66|  44.6k|    RETURN_ERROR_IF(srcSize < ZSTD_blockHeaderSize, srcSize_wrong, "");
  ------------------
  |  |  114|  44.6k|    do {                                                                       \
  |  |  115|  44.6k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 43, False: 44.6k]
  |  |  ------------------
  |  |  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|  44.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 44.6k]
  |  |  ------------------
  ------------------
   67|       |
   68|  44.6k|    {   U32 const cBlockHeader = MEM_readLE24(src);
   69|  44.6k|        U32 const cSize = cBlockHeader >> 3;
   70|  44.6k|        bpPtr->lastBlock = cBlockHeader & 1;
   71|  44.6k|        bpPtr->blockType = (blockType_e)((cBlockHeader >> 1) & 3);
   72|  44.6k|        bpPtr->origSize = cSize;   /* only useful for RLE */
   73|  44.6k|        if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (73:13): [True: 1.81k, False: 42.8k]
  ------------------
   74|  42.8k|        RETURN_ERROR_IF(bpPtr->blockType == bt_reserved, corruption_detected, "");
  ------------------
  |  |  114|  42.8k|    do {                                                                       \
  |  |  115|  42.8k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 9, False: 42.8k]
  |  |  ------------------
  |  |  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|  42.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 42.8k]
  |  |  ------------------
  ------------------
   75|  42.8k|        return cSize;
   76|  42.8k|    }
   77|  42.8k|}
ZSTD_buildFSETable:
  630|  7.33k|{
  631|  7.33k|#if DYNAMIC_BMI2
  632|  7.33k|    if (bmi2) {
  ------------------
  |  Branch (632:9): [True: 5.25k, False: 2.08k]
  ------------------
  633|  5.25k|        ZSTD_buildFSETable_body_bmi2(dt, normalizedCounter, maxSymbolValue,
  634|  5.25k|                baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  635|  5.25k|        return;
  636|  5.25k|    }
  637|  2.08k|#endif
  638|  2.08k|    (void)bmi2;
  639|  2.08k|    ZSTD_buildFSETable_body_default(dt, normalizedCounter, maxSymbolValue,
  640|  2.08k|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  641|  2.08k|}
ZSTD_decodeSeqHeaders:
  697|  8.76k|{
  698|  8.76k|    const BYTE* const istart = (const BYTE*)src;
  699|  8.76k|    const BYTE* const iend = istart + srcSize;
  700|  8.76k|    const BYTE* ip = istart;
  701|  8.76k|    int nbSeq;
  702|  8.76k|    DEBUGLOG(5, "ZSTD_decodeSeqHeaders");
  ------------------
  |  |  104|  8.76k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 8.76k]
  |  |  ------------------
  ------------------
  703|       |
  704|       |    /* check */
  705|  8.76k|    RETURN_ERROR_IF(srcSize < MIN_SEQUENCES_SIZE, srcSize_wrong, "");
  ------------------
  |  |  114|  8.76k|    do {                                                                       \
  |  |  115|  8.76k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 20, False: 8.74k]
  |  |  ------------------
  |  |  116|     20|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     20|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     20|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     20|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     20|    do {                                           \
  |  |  |  |   99|     20|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     20|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     20|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     20|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     20|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     20|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     20|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     20|        }                                                                      \
  |  |  123|  8.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 8.74k]
  |  |  ------------------
  ------------------
  706|       |
  707|       |    /* SeqHead */
  708|  8.74k|    nbSeq = *ip++;
  709|  8.74k|    if (nbSeq > 0x7F) {
  ------------------
  |  Branch (709:9): [True: 1.24k, False: 7.50k]
  ------------------
  710|  1.24k|        if (nbSeq == 0xFF) {
  ------------------
  |  Branch (710:13): [True: 549, False: 697]
  ------------------
  711|    549|            RETURN_ERROR_IF(ip+2 > iend, srcSize_wrong, "");
  ------------------
  |  |  114|    549|    do {                                                                       \
  |  |  115|    549|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 5, False: 544]
  |  |  ------------------
  |  |  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|    549|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 544]
  |  |  ------------------
  ------------------
  712|    544|            nbSeq = MEM_readLE16(ip) + LONGNBSEQ;
  ------------------
  |  |   96|    544|#define LONGNBSEQ 0x7F00
  ------------------
  713|    544|            ip+=2;
  714|    697|        } else {
  715|    697|            RETURN_ERROR_IF(ip >= iend, srcSize_wrong, "");
  ------------------
  |  |  114|    697|    do {                                                                       \
  |  |  115|    697|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 12, False: 685]
  |  |  ------------------
  |  |  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|    697|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 685]
  |  |  ------------------
  ------------------
  716|    685|            nbSeq = ((nbSeq-0x80)<<8) + *ip++;
  717|    685|        }
  718|  1.24k|    }
  719|  8.73k|    *nbSeqPtr = nbSeq;
  720|       |
  721|  8.73k|    if (nbSeq == 0) {
  ------------------
  |  Branch (721:9): [True: 4.03k, False: 4.69k]
  ------------------
  722|       |        /* No sequence : section ends immediately */
  723|  4.03k|        RETURN_ERROR_IF(ip != iend, corruption_detected,
  ------------------
  |  |  114|  4.03k|    do {                                                                       \
  |  |  115|  4.03k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 26, False: 4.00k]
  |  |  ------------------
  |  |  116|     26|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     26|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 26]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     26|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     26|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     26|    do {                                           \
  |  |  |  |   99|     26|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 26]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     26|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 26]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     26|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     26|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 26]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     26|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     26|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 26]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     26|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     26|        }                                                                      \
  |  |  123|  4.03k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.00k]
  |  |  ------------------
  ------------------
  724|  4.03k|            "extraneous data present in the Sequences section");
  725|  4.00k|        return (size_t)(ip - istart);
  726|  4.03k|    }
  727|       |
  728|       |    /* FSE table descriptors */
  729|  4.69k|    RETURN_ERROR_IF(ip+1 > iend, srcSize_wrong, ""); /* minimum possible size: 1 byte for symbol encoding types */
  ------------------
  |  |  114|  4.69k|    do {                                                                       \
  |  |  115|  4.69k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 20, False: 4.67k]
  |  |  ------------------
  |  |  116|     20|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     20|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     20|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     20|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     20|    do {                                           \
  |  |  |  |   99|     20|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     20|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     20|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     20|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     20|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     20|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     20|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     20|        }                                                                      \
  |  |  123|  4.69k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.67k]
  |  |  ------------------
  ------------------
  730|  4.67k|    RETURN_ERROR_IF(*ip & 3, corruption_detected, ""); /* The last field, Reserved, must be all-zeroes. */
  ------------------
  |  |  114|  4.67k|    do {                                                                       \
  |  |  115|  4.67k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 27, False: 4.65k]
  |  |  ------------------
  |  |  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|  4.67k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.65k]
  |  |  ------------------
  ------------------
  731|  4.65k|    {   SymbolEncodingType_e const LLtype = (SymbolEncodingType_e)(*ip >> 6);
  732|  4.65k|        SymbolEncodingType_e const OFtype = (SymbolEncodingType_e)((*ip >> 4) & 3);
  733|  4.65k|        SymbolEncodingType_e const MLtype = (SymbolEncodingType_e)((*ip >> 2) & 3);
  734|  4.65k|        ip++;
  735|       |
  736|       |        /* Build DTables */
  737|  4.65k|        {   size_t const llhSize = ZSTD_buildSeqTable(dctx->entropy.LLTable, &dctx->LLTptr,
  738|  4.65k|                                                      LLtype, MaxLL, LLFSELog,
  ------------------
  |  |  104|  4.65k|#define MaxLL   35
  ------------------
                                                                    LLtype, MaxLL, LLFSELog,
  ------------------
  |  |  109|  4.65k|#define LLFSELog    9
  ------------------
  739|  4.65k|                                                      ip, iend-ip,
  740|  4.65k|                                                      LL_base, LL_bits,
  741|  4.65k|                                                      LL_defaultDTable, dctx->fseEntropy,
  742|  4.65k|                                                      dctx->ddictIsCold, nbSeq,
  743|  4.65k|                                                      dctx->workspace, sizeof(dctx->workspace),
  744|  4.65k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  745|  4.65k|            RETURN_ERROR_IF(ZSTD_isError(llhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  4.65k|    do {                                                                       \
  |  |  115|  4.65k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 30, False: 4.62k]
  |  |  ------------------
  |  |  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|  4.65k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.62k]
  |  |  ------------------
  ------------------
  746|  4.62k|            ip += llhSize;
  747|  4.62k|        }
  748|       |
  749|      0|        {   size_t const ofhSize = ZSTD_buildSeqTable(dctx->entropy.OFTable, &dctx->OFTptr,
  750|  4.62k|                                                      OFtype, MaxOff, OffFSELog,
  ------------------
  |  |  106|  4.62k|#define MaxOff  31
  ------------------
                                                                    OFtype, MaxOff, OffFSELog,
  ------------------
  |  |  110|  4.62k|#define OffFSELog   8
  ------------------
  751|  4.62k|                                                      ip, iend-ip,
  752|  4.62k|                                                      OF_base, OF_bits,
  753|  4.62k|                                                      OF_defaultDTable, dctx->fseEntropy,
  754|  4.62k|                                                      dctx->ddictIsCold, nbSeq,
  755|  4.62k|                                                      dctx->workspace, sizeof(dctx->workspace),
  756|  4.62k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  757|  4.62k|            RETURN_ERROR_IF(ZSTD_isError(ofhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  4.62k|    do {                                                                       \
  |  |  115|  4.62k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 31, False: 4.59k]
  |  |  ------------------
  |  |  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|  4.62k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.59k]
  |  |  ------------------
  ------------------
  758|  4.59k|            ip += ofhSize;
  759|  4.59k|        }
  760|       |
  761|      0|        {   size_t const mlhSize = ZSTD_buildSeqTable(dctx->entropy.MLTable, &dctx->MLTptr,
  762|  4.59k|                                                      MLtype, MaxML, MLFSELog,
  ------------------
  |  |  103|  4.59k|#define MaxML   52
  ------------------
                                                                    MLtype, MaxML, MLFSELog,
  ------------------
  |  |  108|  4.59k|#define MLFSELog    9
  ------------------
  763|  4.59k|                                                      ip, iend-ip,
  764|  4.59k|                                                      ML_base, ML_bits,
  765|  4.59k|                                                      ML_defaultDTable, dctx->fseEntropy,
  766|  4.59k|                                                      dctx->ddictIsCold, nbSeq,
  767|  4.59k|                                                      dctx->workspace, sizeof(dctx->workspace),
  768|  4.59k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  769|  4.59k|            RETURN_ERROR_IF(ZSTD_isError(mlhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  4.59k|    do {                                                                       \
  |  |  115|  4.59k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 44, False: 4.54k]
  |  |  ------------------
  |  |  116|     44|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     44|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 44]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     44|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     44|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     44|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 44]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     44|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     44|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 44]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     44|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     44|        }                                                                      \
  |  |  123|  4.59k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.54k]
  |  |  ------------------
  ------------------
  770|  4.54k|            ip += mlhSize;
  771|  4.54k|        }
  772|  4.54k|    }
  773|       |
  774|      0|    return ip-istart;
  775|  4.59k|}
ZSTD_decompressBlock_internal:
 2069|  9.76k|{   /* blockType == blockCompressed */
 2070|  9.76k|    const BYTE* ip = (const BYTE*)src;
 2071|  9.76k|    DEBUGLOG(5, "ZSTD_decompressBlock_internal (cSize : %u)", (unsigned)srcSize);
  ------------------
  |  |  104|  9.76k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 9.76k]
  |  |  ------------------
  ------------------
 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|  9.76k|    RETURN_ERROR_IF(srcSize > ZSTD_blockSizeMax(dctx), srcSize_wrong, "");
  ------------------
  |  |  114|  9.76k|    do {                                                                       \
  |  |  115|  9.76k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 14, False: 9.75k]
  |  |  ------------------
  |  |  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|  9.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 9.75k]
  |  |  ------------------
  ------------------
 2082|       |
 2083|       |    /* Decode literals section */
 2084|  9.75k|    {   size_t const litCSize = ZSTD_decodeLiteralsBlock(dctx, src, srcSize, dst, dstCapacity, streaming);
 2085|  9.75k|        DEBUGLOG(5, "ZSTD_decodeLiteralsBlock : cSize=%u, nbLiterals=%zu", (U32)litCSize, dctx->litSize);
  ------------------
  |  |  104|  9.75k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 9.75k]
  |  |  ------------------
  ------------------
 2086|  9.75k|        if (ZSTD_isError(litCSize)) return litCSize;
  ------------------
  |  |   44|  9.75k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (2086:13): [True: 983, False: 8.76k]
  ------------------
 2087|  8.76k|        ip += litCSize;
 2088|  8.76k|        srcSize -= litCSize;
 2089|  8.76k|    }
 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|  8.76k|        size_t const blockSizeMax = MIN(dstCapacity, ZSTD_blockSizeMax(dctx));
  ------------------
  |  |   54|  8.76k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 5.36k, False: 3.39k]
  |  |  ------------------
  ------------------
 2097|  8.76k|        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|  8.76k|        ZSTD_longOffset_e isLongOffset = (ZSTD_longOffset_e)(MEM_32bits() && (totalHistorySize > ZSTD_maxShortOffset()));
  ------------------
  |  Branch (2109:62): [True: 0, False: 8.76k]
  |  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|  8.76k|#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \
 2115|  8.76k|    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)
 2116|  8.76k|        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|  8.76k|        int nbSeq;
 2124|  8.76k|        size_t const seqHSize = ZSTD_decodeSeqHeaders(dctx, &nbSeq, ip, srcSize);
 2125|  8.76k|        if (ZSTD_isError(seqHSize)) return seqHSize;
  ------------------
  |  |   44|  8.76k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (2125:13): [True: 215, False: 8.55k]
  ------------------
 2126|  8.55k|        ip += seqHSize;
 2127|  8.55k|        srcSize -= seqHSize;
 2128|       |
 2129|  8.55k|        RETURN_ERROR_IF((dst == NULL || dstCapacity == 0) && nbSeq > 0, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  8.55k|    do {                                                                       \
  |  |  115|  34.3k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 8.55k]
  |  |  |  Branch (115:13): [True: 132, False: 8.42k]
  |  |  |  Branch (115:13): [True: 1, False: 131]
  |  |  ------------------
  |  |  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|  8.55k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 8.55k]
  |  |  ------------------
  ------------------
 2130|  8.55k|        RETURN_ERROR_IF(MEM_64bits() && sizeof(size_t) == sizeof(void*) && (size_t)(-1) - (size_t)dst < (size_t)(1 << 20), dstSize_tooSmall,
  ------------------
  |  |  114|  8.55k|    do {                                                                       \
  |  |  115|  42.7k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 8.55k, False: 0]
  |  |  |  Branch (115:13): [True: 0, Folded]
  |  |  |  Branch (115:13): [True: 0, False: 8.55k]
  |  |  ------------------
  |  |  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|  8.55k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 8.55k]
  |  |  ------------------
  ------------------
 2131|  8.55k|                "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|  8.55k|        if (isLongOffset || (!usePrefetchDecoder && (totalHistorySize > (1u << 24)) && (nbSeq > 8))) {
  ------------------
  |  Branch (2137:13): [True: 0, False: 8.55k]
  |  Branch (2137:30): [True: 7.46k, False: 1.09k]
  |  Branch (2137:53): [True: 115, False: 7.34k]
  |  Branch (2137:88): [True: 0, False: 115]
  ------------------
 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|  8.55k|        dctx->ddictIsCold = 0;
 2153|       |
 2154|  8.55k|#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \
 2155|  8.55k|    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)
 2156|  8.55k|        if (usePrefetchDecoder) {
  ------------------
  |  Branch (2156:13): [True: 1.09k, False: 7.46k]
  ------------------
 2157|       |#else
 2158|       |        (void)usePrefetchDecoder;
 2159|       |        {
 2160|       |#endif
 2161|  1.09k|#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT
 2162|  1.09k|            return ZSTD_decompressSequencesLong(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2163|  1.09k|#endif
 2164|  1.09k|        }
 2165|       |
 2166|  7.46k|#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG
 2167|       |        /* else */
 2168|  7.46k|        if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (2168:13): [True: 464, False: 6.99k]
  ------------------
 2169|    464|            return ZSTD_decompressSequencesSplitLitBuffer(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2170|  6.99k|        else
 2171|  6.99k|            return ZSTD_decompressSequences(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2172|  7.46k|#endif
 2173|  7.46k|    }
 2174|  7.46k|}
ZSTD_checkContinuity:
 2179|  14.1k|{
 2180|  14.1k|    if (dst != dctx->previousDstEnd && dstSize > 0) {   /* not contiguous */
  ------------------
  |  Branch (2180:9): [True: 14.1k, False: 0]
  |  Branch (2180:40): [True: 13.6k, False: 429]
  ------------------
 2181|  13.6k|        dctx->dictEnd = dctx->previousDstEnd;
 2182|  13.6k|        dctx->virtualStart = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->prefixStart));
 2183|  13.6k|        dctx->prefixStart = dst;
 2184|  13.6k|        dctx->previousDstEnd = dst;
 2185|  13.6k|    }
 2186|  14.1k|}
zstd_decompress_block.c:ZSTD_decodeLiteralsBlock:
  137|  9.75k|{
  138|  9.75k|    DEBUGLOG(5, "ZSTD_decodeLiteralsBlock");
  ------------------
  |  |  104|  9.75k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 9.75k]
  |  |  ------------------
  ------------------
  139|  9.75k|    RETURN_ERROR_IF(srcSize < MIN_CBLOCK_SIZE, corruption_detected, "");
  ------------------
  |  |  114|  9.75k|    do {                                                                       \
  |  |  115|  9.75k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 11, False: 9.73k]
  |  |  ------------------
  |  |  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|  9.75k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 9.73k]
  |  |  ------------------
  ------------------
  140|       |
  141|  9.73k|    {   const BYTE* const istart = (const BYTE*) src;
  142|  9.73k|        SymbolEncodingType_e const litEncType = (SymbolEncodingType_e)(istart[0] & 3);
  143|  9.73k|        size_t const blockSizeMax = ZSTD_blockSizeMax(dctx);
  144|       |
  145|  9.73k|        switch(litEncType)
  146|  9.73k|        {
  147|    491|        case set_repeat:
  ------------------
  |  Branch (147:9): [True: 491, False: 9.24k]
  ------------------
  148|    491|            DEBUGLOG(5, "set_repeat flag : re-using stats from previous compressed literals block");
  ------------------
  |  |  104|    491|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 491]
  |  |  ------------------
  ------------------
  149|    491|            RETURN_ERROR_IF(dctx->litEntropy==0, dictionary_corrupted, "");
  ------------------
  |  |  114|    491|    do {                                                                       \
  |  |  115|    491|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 489]
  |  |  ------------------
  |  |  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|    491|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 489]
  |  |  ------------------
  ------------------
  150|    489|            ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    489|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  151|       |
  152|  5.45k|        case set_compressed:
  ------------------
  |  Branch (152:9): [True: 4.96k, False: 4.77k]
  ------------------
  153|  5.45k|            RETURN_ERROR_IF(srcSize < 5, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need up to 5 for case 3");
  ------------------
  |  |  114|  5.45k|    do {                                                                       \
  |  |  115|  5.45k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 5.45k]
  |  |  ------------------
  |  |  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|  5.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.45k]
  |  |  ------------------
  ------------------
  154|  5.45k|            {   size_t lhSize, litSize, litCSize;
  155|  5.45k|                U32 singleStream=0;
  156|  5.45k|                U32 const lhlCode = (istart[0] >> 2) & 3;
  157|  5.45k|                U32 const lhc = MEM_readLE32(istart);
  158|  5.45k|                size_t hufSuccess;
  159|  5.45k|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|  5.45k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 2.34k, False: 3.10k]
  |  |  ------------------
  ------------------
  160|  5.45k|                int const flags = 0
  161|  5.45k|                    | (ZSTD_DCtx_get_bmi2(dctx) ? HUF_flags_bmi2 : 0)
  ------------------
  |  Branch (161:24): [True: 5.45k, False: 0]
  ------------------
  162|  5.45k|                    | (dctx->disableHufAsm ? HUF_flags_disableAsm : 0);
  ------------------
  |  Branch (162:24): [True: 0, False: 5.45k]
  ------------------
  163|  5.45k|                switch(lhlCode)
  164|  5.45k|                {
  165|  5.31k|                case 0: case 1: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (165:17): [True: 2.08k, False: 3.36k]
  |  Branch (165:25): [True: 3.22k, False: 2.22k]
  |  Branch (165:33): [True: 0, False: 5.45k]
  ------------------
  166|       |                    /* 2 - 2 - 10 - 10 */
  167|  5.31k|                    singleStream = !lhlCode;
  168|  5.31k|                    lhSize = 3;
  169|  5.31k|                    litSize  = (lhc >> 4) & 0x3FF;
  170|  5.31k|                    litCSize = (lhc >> 14) & 0x3FF;
  171|  5.31k|                    break;
  172|     61|                case 2:
  ------------------
  |  Branch (172:17): [True: 61, False: 5.39k]
  ------------------
  173|       |                    /* 2 - 2 - 14 - 14 */
  174|     61|                    lhSize = 4;
  175|     61|                    litSize  = (lhc >> 4) & 0x3FFF;
  176|     61|                    litCSize = lhc >> 18;
  177|     61|                    break;
  178|     77|                case 3:
  ------------------
  |  Branch (178:17): [True: 77, False: 5.37k]
  ------------------
  179|       |                    /* 2 - 2 - 18 - 18 */
  180|     77|                    lhSize = 5;
  181|     77|                    litSize  = (lhc >> 4) & 0x3FFFF;
  182|     77|                    litCSize = (lhc >> 22) + ((size_t)istart[4] << 10);
  183|     77|                    break;
  184|  5.45k|                }
  185|  5.45k|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  5.45k|    do {                                                                       \
  |  |  115|  15.7k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4.80k, False: 646]
  |  |  |  Branch (115:13): [True: 0, False: 4.80k]
  |  |  ------------------
  |  |  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|  5.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.45k]
  |  |  ------------------
  ------------------
  186|  5.45k|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|  5.45k|    do {                                                                       \
  |  |  115|  5.45k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 9, False: 5.44k]
  |  |  ------------------
  |  |  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|  5.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.44k]
  |  |  ------------------
  ------------------
  187|  5.44k|                if (!singleStream)
  ------------------
  |  Branch (187:21): [True: 3.35k, False: 2.08k]
  ------------------
  188|  3.35k|                    RETURN_ERROR_IF(litSize < MIN_LITERALS_FOR_4_STREAMS, literals_headerWrong,
  ------------------
  |  |  114|  3.35k|    do {                                                                       \
  |  |  115|  3.35k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 3.35k]
  |  |  ------------------
  |  |  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.35k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.35k]
  |  |  ------------------
  ------------------
  189|  5.44k|                        "Not enough literals (%zu) for the 4-streams mode (min %u)",
  190|  5.44k|                        litSize, MIN_LITERALS_FOR_4_STREAMS);
  191|  5.44k|                RETURN_ERROR_IF(litCSize + lhSize > srcSize, corruption_detected, "");
  ------------------
  |  |  114|  5.44k|    do {                                                                       \
  |  |  115|  5.44k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 26, False: 5.41k]
  |  |  ------------------
  |  |  116|     26|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     26|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 26]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     26|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     26|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     26|    do {                                           \
  |  |  |  |   99|     26|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 26]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     26|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 26]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     26|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     26|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 26]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     26|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     26|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 26]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     26|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     26|        }                                                                      \
  |  |  123|  5.44k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.41k]
  |  |  ------------------
  ------------------
  192|  5.41k|                RETURN_ERROR_IF(expectedWriteSize < litSize , dstSize_tooSmall, "");
  ------------------
  |  |  114|  5.41k|    do {                                                                       \
  |  |  115|  5.41k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 11, False: 5.40k]
  |  |  ------------------
  |  |  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|  5.41k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.40k]
  |  |  ------------------
  ------------------
  193|  5.40k|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 0);
  194|       |
  195|       |                /* prefetch huffman table if cold */
  196|  5.40k|                if (dctx->ddictIsCold && (litSize > 768 /* heuristic */)) {
  ------------------
  |  Branch (196:21): [True: 377, False: 5.02k]
  |  Branch (196:42): [True: 44, False: 333]
  ------------------
  197|     44|                    PREFETCH_AREA(dctx->HUFptr, sizeof(dctx->entropy.hufTable));
  ------------------
  |  |  159|     44|    do {                                                 \
  |  |  160|     44|        const char* const _ptr = (const char*)(p);       \
  |  |  161|     44|        size_t const _size = (size_t)(s);                \
  |  |  162|     44|        size_t _pos;                                     \
  |  |  163|  11.3k|        for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \
  |  |  ------------------
  |  |  |  |  156|  11.3k|#define CACHELINE_SIZE 64
  |  |  ------------------
  |  |  |  Branch (163:22): [True: 11.3k, False: 44]
  |  |  ------------------
  |  |  164|  11.3k|            PREFETCH_L2(_ptr + _pos);                    \
  |  |  ------------------
  |  |  |  |  146|  11.3k|#    define PREFETCH_L2(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */)
  |  |  ------------------
  |  |  165|  11.3k|        }                                                \
  |  |  166|     44|    } while (0)
  |  |  ------------------
  |  |  |  Branch (166:14): [Folded, False: 44]
  |  |  ------------------
  ------------------
  198|     44|                }
  199|       |
  200|  5.40k|                if (litEncType==set_repeat) {
  ------------------
  |  Branch (200:21): [True: 484, False: 4.91k]
  ------------------
  201|    484|                    if (singleStream) {
  ------------------
  |  Branch (201:25): [True: 237, False: 247]
  ------------------
  202|    237|                        hufSuccess = HUF_decompress1X_usingDTable(
  203|    237|                            dctx->litBuffer, litSize, istart+lhSize, litCSize,
  204|    237|                            dctx->HUFptr, flags);
  205|    247|                    } else {
  206|    247|                        assert(litSize >= MIN_LITERALS_FOR_4_STREAMS);
  ------------------
  |  |   70|    247|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  207|    247|                        hufSuccess = HUF_decompress4X_usingDTable(
  208|    247|                            dctx->litBuffer, litSize, istart+lhSize, litCSize,
  209|    247|                            dctx->HUFptr, flags);
  210|    247|                    }
  211|  4.91k|                } else {
  212|  4.91k|                    if (singleStream) {
  ------------------
  |  Branch (212:25): [True: 1.84k, False: 3.07k]
  ------------------
  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|  1.84k|                        hufSuccess = HUF_decompress1X1_DCtx_wksp(
  220|  1.84k|                            dctx->entropy.hufTable, dctx->litBuffer, litSize,
  221|  1.84k|                            istart+lhSize, litCSize, dctx->workspace,
  222|  1.84k|                            sizeof(dctx->workspace), flags);
  223|  1.84k|#endif
  224|  3.07k|                    } else {
  225|  3.07k|                        hufSuccess = HUF_decompress4X_hufOnly_wksp(
  226|  3.07k|                            dctx->entropy.hufTable, dctx->litBuffer, litSize,
  227|  3.07k|                            istart+lhSize, litCSize, dctx->workspace,
  228|  3.07k|                            sizeof(dctx->workspace), flags);
  229|  3.07k|                    }
  230|  4.91k|                }
  231|  5.40k|                if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (231:21): [True: 30, False: 5.37k]
  ------------------
  232|     30|                {
  233|     30|                    assert(litSize > ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   70|     30|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  234|     30|                    ZSTD_memcpy(dctx->litExtraBuffer, dctx->litBufferEnd - ZSTD_LITBUFFEREXTRASIZE, ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   44|    180|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  |  |  ------------------
  |  |  |  Branch (44:51): [True: 0, Folded]
  |  |  |  Branch (44:51): [True: 30, Folded]
  |  |  |  Branch (44:51): [Folded, False: 30]
  |  |  |  Branch (44:55): [True: 0, Folded]
  |  |  |  Branch (44:55): [True: 30, Folded]
  |  |  |  Branch (44:55): [Folded, False: 30]
  |  |  ------------------
  ------------------
  235|     30|                    ZSTD_memmove(dctx->litBuffer + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH, dctx->litBuffer, litSize - ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   45|    180|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  |  |  ------------------
  |  |  |  Branch (45:49): [True: 0, Folded]
  |  |  |  Branch (45:49): [True: 30, Folded]
  |  |  |  Branch (45:49): [Folded, False: 30]
  |  |  |  Branch (45:57): [True: 0, Folded]
  |  |  |  Branch (45:57): [True: 30, Folded]
  |  |  |  Branch (45:57): [Folded, False: 30]
  |  |  ------------------
  ------------------
  236|     30|                    dctx->litBuffer += ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  118|     30|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|     30|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|     60|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 30]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 30, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  dctx->litBuffer += ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|     30|#define WILDCOPY_OVERLENGTH 32
  ------------------
  237|     30|                    dctx->litBufferEnd -= WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|     30|#define WILDCOPY_OVERLENGTH 32
  ------------------
  238|     30|                    assert(dctx->litBufferEnd <= (BYTE*)dst + blockSizeMax);
  ------------------
  |  |   70|     30|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  239|     30|                }
  240|       |
  241|  5.40k|                RETURN_ERROR_IF(HUF_isError(hufSuccess), corruption_detected, "");
  ------------------
  |  |  114|  5.40k|    do {                                                                       \
  |  |  115|  5.40k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 820, False: 4.58k]
  |  |  ------------------
  |  |  116|    820|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    820|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 820]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    820|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    820|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    820|    do {                                           \
  |  |  |  |   99|    820|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 820]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    820|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 820]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    820|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    820|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 820]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    820|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    820|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 820]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    820|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    820|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    820|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    820|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    820|        }                                                                      \
  |  |  123|  5.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.58k]
  |  |  ------------------
  ------------------
  242|       |
  243|  4.58k|                dctx->litPtr = dctx->litBuffer;
  244|  4.58k|                dctx->litSize = litSize;
  245|  4.58k|                dctx->litEntropy = 1;
  246|  4.58k|                if (litEncType==set_compressed) dctx->HUFptr = dctx->entropy.hufTable;
  ------------------
  |  Branch (246:21): [True: 4.29k, False: 285]
  ------------------
  247|  4.58k|                return litCSize + lhSize;
  248|  5.40k|            }
  249|       |
  250|  2.20k|        case set_basic:
  ------------------
  |  Branch (250:9): [True: 2.20k, False: 7.53k]
  ------------------
  251|  2.20k|            {   size_t litSize, lhSize;
  252|  2.20k|                U32 const lhlCode = ((istart[0]) >> 2) & 3;
  253|  2.20k|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|  2.20k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 599, False: 1.60k]
  |  |  ------------------
  ------------------
  254|  2.20k|                switch(lhlCode)
  255|  2.20k|                {
  256|  1.86k|                case 0: case 2: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (256:17): [True: 1.50k, False: 696]
  |  Branch (256:25): [True: 362, False: 1.83k]
  |  Branch (256:33): [True: 0, False: 2.20k]
  ------------------
  257|  1.86k|                    lhSize = 1;
  258|  1.86k|                    litSize = istart[0] >> 3;
  259|  1.86k|                    break;
  260|    263|                case 1:
  ------------------
  |  Branch (260:17): [True: 263, False: 1.93k]
  ------------------
  261|    263|                    lhSize = 2;
  262|    263|                    litSize = MEM_readLE16(istart) >> 4;
  263|    263|                    break;
  264|     71|                case 3:
  ------------------
  |  Branch (264:17): [True: 71, False: 2.12k]
  ------------------
  265|     71|                    lhSize = 3;
  266|     71|                    RETURN_ERROR_IF(srcSize<3, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize = 3");
  ------------------
  |  |  114|     71|    do {                                                                       \
  |  |  115|     71|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 70]
  |  |  ------------------
  |  |  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|     71|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 70]
  |  |  ------------------
  ------------------
  267|     70|                    litSize = MEM_readLE24(istart) >> 4;
  268|     70|                    break;
  269|  2.20k|                }
  270|       |
  271|  2.19k|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  2.19k|    do {                                                                       \
  |  |  115|  5.00k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 604, False: 1.59k]
  |  |  |  Branch (115:13): [True: 0, False: 604]
  |  |  ------------------
  |  |  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.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.19k]
  |  |  ------------------
  ------------------
  272|  2.19k|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|  2.19k|    do {                                                                       \
  |  |  115|  2.19k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 28, False: 2.17k]
  |  |  ------------------
  |  |  116|     28|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     28|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 28]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     28|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     28|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     28|    do {                                           \
  |  |  |  |   99|     28|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 28]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     28|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 28]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     28|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     28|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 28]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     28|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     28|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 28]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     28|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     28|        }                                                                      \
  |  |  123|  2.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.17k]
  |  |  ------------------
  ------------------
  273|  2.17k|                RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, "");
  ------------------
  |  |  114|  2.17k|    do {                                                                       \
  |  |  115|  2.17k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 13, False: 2.15k]
  |  |  ------------------
  |  |  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|  2.17k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.15k]
  |  |  ------------------
  ------------------
  274|  2.15k|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1);
  275|  2.15k|                if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */
  ------------------
  |  |  199|  2.15k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  |  Branch (275:21): [True: 2.06k, False: 90]
  ------------------
  276|  2.06k|                    RETURN_ERROR_IF(litSize+lhSize > srcSize, corruption_detected, "");
  ------------------
  |  |  114|  2.06k|    do {                                                                       \
  |  |  115|  2.06k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 18, False: 2.05k]
  |  |  ------------------
  |  |  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|  2.06k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.05k]
  |  |  ------------------
  ------------------
  277|  2.05k|                    if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (277:25): [True: 0, False: 2.05k]
  ------------------
  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|  2.05k|                    else
  283|  2.05k|                    {
  284|  2.05k|                        ZSTD_memcpy(dctx->litBuffer, istart + lhSize, litSize);
  ------------------
  |  |   44|  2.05k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  285|  2.05k|                    }
  286|  2.05k|                    dctx->litPtr = dctx->litBuffer;
  287|  2.05k|                    dctx->litSize = litSize;
  288|  2.05k|                    return lhSize+litSize;
  289|  2.06k|                }
  290|       |                /* direct reference into compressed stream */
  291|     90|                dctx->litPtr = istart+lhSize;
  292|     90|                dctx->litSize = litSize;
  293|     90|                dctx->litBufferEnd = dctx->litPtr + litSize;
  294|     90|                dctx->litBufferLocation = ZSTD_not_in_dst;
  295|     90|                return lhSize+litSize;
  296|  2.15k|            }
  297|       |
  298|  2.08k|        case set_rle:
  ------------------
  |  Branch (298:9): [True: 2.08k, False: 7.65k]
  ------------------
  299|  2.08k|            {   U32 const lhlCode = ((istart[0]) >> 2) & 3;
  300|  2.08k|                size_t litSize, lhSize;
  301|  2.08k|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|  2.08k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 547, False: 1.53k]
  |  |  ------------------
  ------------------
  302|  2.08k|                switch(lhlCode)
  303|  2.08k|                {
  304|    977|                case 0: case 2: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (304:17): [True: 582, False: 1.50k]
  |  Branch (304:25): [True: 395, False: 1.68k]
  |  Branch (304:33): [True: 0, False: 2.08k]
  ------------------
  305|    977|                    lhSize = 1;
  306|    977|                    litSize = istart[0] >> 3;
  307|    977|                    break;
  308|    124|                case 1:
  ------------------
  |  Branch (308:17): [True: 124, False: 1.96k]
  ------------------
  309|    124|                    lhSize = 2;
  310|    124|                    RETURN_ERROR_IF(srcSize<3, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize+1 = 3");
  ------------------
  |  |  114|    124|    do {                                                                       \
  |  |  115|    124|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4, False: 120]
  |  |  ------------------
  |  |  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|    124|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 120]
  |  |  ------------------
  ------------------
  311|    120|                    litSize = MEM_readLE16(istart) >> 4;
  312|    120|                    break;
  313|    983|                case 3:
  ------------------
  |  Branch (313:17): [True: 983, False: 1.10k]
  ------------------
  314|    983|                    lhSize = 3;
  315|    983|                    RETURN_ERROR_IF(srcSize<4, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize+1 = 4");
  ------------------
  |  |  114|    983|    do {                                                                       \
  |  |  115|    983|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 982]
  |  |  ------------------
  |  |  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|    983|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 982]
  |  |  ------------------
  ------------------
  316|    982|                    litSize = MEM_readLE24(istart) >> 4;
  317|    982|                    break;
  318|  2.08k|                }
  319|  2.07k|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  2.07k|    do {                                                                       \
  |  |  115|  6.08k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1.92k, False: 156]
  |  |  |  Branch (115:13): [True: 0, False: 1.92k]
  |  |  ------------------
  |  |  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.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.07k]
  |  |  ------------------
  ------------------
  320|  2.07k|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|  2.07k|    do {                                                                       \
  |  |  115|  2.07k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 24, False: 2.05k]
  |  |  ------------------
  |  |  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.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.05k]
  |  |  ------------------
  ------------------
  321|  2.05k|                RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, "");
  ------------------
  |  |  114|  2.05k|    do {                                                                       \
  |  |  115|  2.05k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 11, False: 2.04k]
  |  |  ------------------
  |  |  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|  2.05k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.04k]
  |  |  ------------------
  ------------------
  322|  2.04k|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1);
  323|  2.04k|                if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (323:21): [True: 736, False: 1.30k]
  ------------------
  324|    736|                {
  325|    736|                    ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize - ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   46|  4.41k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  |  |  ------------------
  |  |  |  Branch (46:55): [True: 0, Folded]
  |  |  |  Branch (46:55): [True: 736, Folded]
  |  |  |  Branch (46:55): [Folded, False: 736]
  |  |  ------------------
  ------------------
  326|    736|                    ZSTD_memset(dctx->litExtraBuffer, istart[lhSize], ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   46|  4.41k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  |  |  ------------------
  |  |  |  Branch (46:55): [True: 0, Folded]
  |  |  |  Branch (46:55): [True: 736, Folded]
  |  |  |  Branch (46:55): [Folded, False: 736]
  |  |  ------------------
  ------------------
  327|    736|                }
  328|  1.30k|                else
  329|  1.30k|                {
  330|  1.30k|                    ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize);
  ------------------
  |  |   46|  1.30k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  331|  1.30k|                }
  332|  2.04k|                dctx->litPtr = dctx->litBuffer;
  333|  2.04k|                dctx->litSize = litSize;
  334|  2.04k|                return lhSize+1;
  335|  2.05k|            }
  336|      0|        default:
  ------------------
  |  Branch (336:9): [True: 0, False: 9.73k]
  ------------------
  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|  9.73k|        }
  339|  9.73k|    }
  340|  9.73k|}
zstd_decompress_block.c:ZSTD_allocateLiteralsBuffer:
   82|  9.60k|{
   83|  9.60k|    size_t const blockSizeMax = ZSTD_blockSizeMax(dctx);
   84|  9.60k|    assert(litSize <= blockSizeMax);
  ------------------
  |  |   70|  9.60k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   85|  9.60k|    assert(dctx->isFrameDecompression || streaming == not_streaming);
  ------------------
  |  |   70|  9.60k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   86|  9.60k|    assert(expectedWriteSize <= blockSizeMax);
  ------------------
  |  |   70|  9.60k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   87|  9.60k|    if (streaming == not_streaming && dstCapacity > blockSizeMax + WILDCOPY_OVERLENGTH + litSize + WILDCOPY_OVERLENGTH) {
  ------------------
  |  |  199|  9.60k|#define WILDCOPY_OVERLENGTH 32
  ------------------
                  if (streaming == not_streaming && dstCapacity > blockSizeMax + WILDCOPY_OVERLENGTH + litSize + WILDCOPY_OVERLENGTH) {
  ------------------
  |  |  199|  9.60k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  |  Branch (87:9): [True: 9.60k, False: 0]
  |  Branch (87:39): [True: 2.89k, False: 6.70k]
  ------------------
   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|  2.89k|        dctx->litBuffer = (BYTE*)dst + blockSizeMax + WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|  2.89k|#define WILDCOPY_OVERLENGTH 32
  ------------------
   94|  2.89k|        dctx->litBufferEnd = dctx->litBuffer + litSize;
   95|  2.89k|        dctx->litBufferLocation = ZSTD_in_dst;
   96|  6.70k|    } else if (litSize <= ZSTD_LITBUFFEREXTRASIZE) {
  ------------------
  |  |  118|  6.70k|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|  6.70k|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  13.4k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 6.70k]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 6.70k, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (96:16): [True: 5.93k, False: 769]
  ------------------
   97|       |        /* Literals fit entirely within the extra buffer, put them there to avoid
   98|       |         * having to split the literals.
   99|       |         */
  100|  5.93k|        dctx->litBuffer = dctx->litExtraBuffer;
  101|  5.93k|        dctx->litBufferEnd = dctx->litBuffer + litSize;
  102|  5.93k|        dctx->litBufferLocation = ZSTD_not_in_dst;
  103|  5.93k|    } else {
  104|    769|        assert(blockSizeMax > ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   70|    769|#    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|    769|        if (splitImmediately) {
  ------------------
  |  Branch (112:13): [True: 739, False: 30]
  ------------------
  113|       |            /* won't fit in litExtraBuffer, so it will be split between end of dst and extra buffer */
  114|    739|            dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  118|    739|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    739|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.47k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 739]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 739, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|    739|#define WILDCOPY_OVERLENGTH 32
  ------------------
  115|    739|            dctx->litBufferEnd = dctx->litBuffer + litSize - ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    739|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    739|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.47k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 739]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 739, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|    739|        } else {
  117|       |            /* initially this will be stored entirely in dst during huffman decoding, it will partially be shifted to litExtraBuffer after */
  118|     30|            dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize;
  119|     30|            dctx->litBufferEnd = (BYTE*)dst + expectedWriteSize;
  120|     30|        }
  121|    769|        dctx->litBufferLocation = ZSTD_split;
  122|    769|        assert(dctx->litBufferEnd <= (BYTE*)dst + expectedWriteSize);
  ------------------
  |  |   70|    769|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  123|    769|    }
  124|  9.60k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body_bmi2:
  620|  5.25k|{
  621|  5.25k|    ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,
  622|  5.25k|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  623|  5.25k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body:
  489|  7.33k|{
  490|  7.33k|    ZSTD_seqSymbol* const tableDecode = dt+1;
  491|  7.33k|    U32 const maxSV1 = maxSymbolValue + 1;
  492|  7.33k|    U32 const tableSize = 1 << tableLog;
  493|       |
  494|  7.33k|    U16* symbolNext = (U16*)wksp;
  495|  7.33k|    BYTE* spread = (BYTE*)(symbolNext + MaxSeq + 1);
  ------------------
  |  |  107|  7.33k|#define MaxSeq MAX(MaxLL, MaxML)   /* Assumption : MaxOff < MaxLL,MaxML */
  |  |  ------------------
  |  |  |  |   55|  7.33k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (55:19): [Folded, False: 7.33k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  496|  7.33k|    U32 highThreshold = tableSize - 1;
  497|       |
  498|       |
  499|       |    /* Sanity Checks */
  500|  7.33k|    assert(maxSymbolValue <= MaxSeq);
  ------------------
  |  |   70|  7.33k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  501|  7.33k|    assert(tableLog <= MaxFSELog);
  ------------------
  |  |   70|  7.33k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  502|  7.33k|    assert(wkspSize >= ZSTD_BUILD_FSE_TABLE_WKSP_SIZE);
  ------------------
  |  |   70|  7.33k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  503|  7.33k|    (void)wkspSize;
  504|       |    /* Init, lay down lowprob symbols */
  505|  7.33k|    {   ZSTD_seqSymbol_header DTableH;
  506|  7.33k|        DTableH.tableLog = tableLog;
  507|  7.33k|        DTableH.fastMode = 1;
  508|  7.33k|        {   S16 const largeLimit= (S16)(1 << (tableLog-1));
  509|  7.33k|            U32 s;
  510|  96.6k|            for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (510:23): [True: 89.3k, False: 7.33k]
  ------------------
  511|  89.3k|                if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (511:21): [True: 32.2k, False: 57.0k]
  ------------------
  512|  32.2k|                    tableDecode[highThreshold--].baseValue = s;
  513|  32.2k|                    symbolNext[s] = 1;
  514|  57.0k|                } else {
  515|  57.0k|                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
  ------------------
  |  Branch (515:25): [True: 4.52k, False: 52.5k]
  ------------------
  516|  57.0k|                    assert(normalizedCounter[s]>=0);
  ------------------
  |  |   70|  57.0k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  517|  57.0k|                    symbolNext[s] = (U16)normalizedCounter[s];
  518|  57.0k|        }   }   }
  519|  7.33k|        ZSTD_memcpy(dt, &DTableH, sizeof(DTableH));
  ------------------
  |  |   44|  7.33k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  520|  7.33k|    }
  521|       |
  522|       |    /* Spread symbols */
  523|  7.33k|    assert(tableSize <= 512);
  ------------------
  |  |   70|  7.33k|#    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|  7.33k|    if (highThreshold == tableSize - 1) {
  ------------------
  |  Branch (529:9): [True: 2.48k, False: 4.85k]
  ------------------
  530|  2.48k|        size_t const tableMask = tableSize-1;
  531|  2.48k|        size_t const step = FSE_TABLESTEP(tableSize);
  ------------------
  |  |  623|  2.48k|#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|  2.48k|        {
  539|  2.48k|            U64 const add = 0x0101010101010101ull;
  540|  2.48k|            size_t pos = 0;
  541|  2.48k|            U64 sv = 0;
  542|  2.48k|            U32 s;
  543|  13.6k|            for (s=0; s<maxSV1; ++s, sv += add) {
  ------------------
  |  Branch (543:23): [True: 11.1k, False: 2.48k]
  ------------------
  544|  11.1k|                int i;
  545|  11.1k|                int const n = normalizedCounter[s];
  546|  11.1k|                MEM_write64(spread + pos, sv);
  547|  46.2k|                for (i = 8; i < n; i += 8) {
  ------------------
  |  Branch (547:29): [True: 35.0k, False: 11.1k]
  ------------------
  548|  35.0k|                    MEM_write64(spread + pos + i, sv);
  549|  35.0k|                }
  550|  11.1k|                assert(n>=0);
  ------------------
  |  |   70|  11.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  551|  11.1k|                pos += (size_t)n;
  552|  11.1k|            }
  553|  2.48k|        }
  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|  2.48k|        {
  561|  2.48k|            size_t position = 0;
  562|  2.48k|            size_t s;
  563|  2.48k|            size_t const unroll = 2;
  564|  2.48k|            assert(tableSize % unroll == 0); /* FSE_MIN_TABLELOG is 5 */
  ------------------
  |  |   70|  2.48k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  565|   160k|            for (s = 0; s < (size_t)tableSize; s += unroll) {
  ------------------
  |  Branch (565:25): [True: 158k, False: 2.48k]
  ------------------
  566|   158k|                size_t u;
  567|   474k|                for (u = 0; u < unroll; ++u) {
  ------------------
  |  Branch (567:29): [True: 316k, False: 158k]
  ------------------
  568|   316k|                    size_t const uPosition = (position + (u * step)) & tableMask;
  569|   316k|                    tableDecode[uPosition].baseValue = spread[s + u];
  570|   316k|                }
  571|   158k|                position = (position + (unroll * step)) & tableMask;
  572|   158k|            }
  573|  2.48k|            assert(position == 0);
  ------------------
  |  |   70|  2.48k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  574|  2.48k|        }
  575|  4.85k|    } else {
  576|  4.85k|        U32 const tableMask = tableSize-1;
  577|  4.85k|        U32 const step = FSE_TABLESTEP(tableSize);
  ------------------
  |  |  623|  4.85k|#define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3)
  ------------------
  578|  4.85k|        U32 s, position = 0;
  579|  83.0k|        for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (579:19): [True: 78.1k, False: 4.85k]
  ------------------
  580|  78.1k|            int i;
  581|  78.1k|            int const n = normalizedCounter[s];
  582|   634k|            for (i=0; i<n; i++) {
  ------------------
  |  Branch (582:23): [True: 556k, False: 78.1k]
  ------------------
  583|   556k|                tableDecode[position].baseValue = s;
  584|   556k|                position = (position + step) & tableMask;
  585|   588k|                while (UNLIKELY(position > highThreshold)) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  |  188|   588k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 31.5k, False: 556k]
  |  |  ------------------
  ------------------
  586|   556k|        }   }
  587|  4.85k|        assert(position == 0); /* position must reach all cells once, otherwise normalizedCounter is incorrect */
  ------------------
  |  |   70|  4.85k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  588|  4.85k|    }
  589|       |
  590|       |    /* Build Decoding table */
  591|  7.33k|    {
  592|  7.33k|        U32 u;
  593|   912k|        for (u=0; u<tableSize; u++) {
  ------------------
  |  Branch (593:19): [True: 904k, False: 7.33k]
  ------------------
  594|   904k|            U32 const symbol = tableDecode[u].baseValue;
  595|   904k|            U32 const nextState = symbolNext[symbol]++;
  596|   904k|            tableDecode[u].nbBits = (BYTE) (tableLog - ZSTD_highbit32(nextState) );
  597|   904k|            tableDecode[u].nextState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
  598|   904k|            assert(nbAdditionalBits[symbol] < 255);
  ------------------
  |  |   70|   904k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  599|   904k|            tableDecode[u].nbAdditionalBits = nbAdditionalBits[symbol];
  600|   904k|            tableDecode[u].baseValue = baseValue[symbol];
  601|   904k|        }
  602|  7.33k|    }
  603|  7.33k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body_default:
  610|  2.08k|{
  611|  2.08k|    ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,
  612|  2.08k|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  613|  2.08k|}
zstd_decompress_block.c:ZSTD_buildSeqTable:
  654|  13.8k|{
  655|  13.8k|    switch(type)
  656|  13.8k|    {
  657|  3.12k|    case set_rle :
  ------------------
  |  Branch (657:5): [True: 3.12k, False: 10.7k]
  ------------------
  658|  3.12k|        RETURN_ERROR_IF(!srcSize, srcSize_wrong, "");
  ------------------
  |  |  114|  3.12k|    do {                                                                       \
  |  |  115|  3.12k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 8, False: 3.11k]
  |  |  ------------------
  |  |  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|  3.12k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.11k]
  |  |  ------------------
  ------------------
  659|  3.11k|        RETURN_ERROR_IF((*(const BYTE*)src) > max, corruption_detected, "");
  ------------------
  |  |  114|  3.11k|    do {                                                                       \
  |  |  115|  3.11k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 9, False: 3.10k]
  |  |  ------------------
  |  |  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|  3.11k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.10k]
  |  |  ------------------
  ------------------
  660|  3.10k|        {   U32 const symbol = *(const BYTE*)src;
  661|  3.10k|            U32 const baseline = baseValue[symbol];
  662|  3.10k|            U8 const nbBits = nbAdditionalBits[symbol];
  663|  3.10k|            ZSTD_buildSeqTable_rle(DTableSpace, baseline, nbBits);
  664|  3.10k|        }
  665|  3.10k|        *DTablePtr = DTableSpace;
  666|  3.10k|        return 1;
  667|  4.96k|    case set_basic :
  ------------------
  |  Branch (667:5): [True: 4.96k, False: 8.90k]
  ------------------
  668|  4.96k|        *DTablePtr = defaultTable;
  669|  4.96k|        return 0;
  670|    449|    case set_repeat:
  ------------------
  |  Branch (670:5): [True: 449, False: 13.4k]
  ------------------
  671|    449|        RETURN_ERROR_IF(!flagRepeatTable, corruption_detected, "");
  ------------------
  |  |  114|    449|    do {                                                                       \
  |  |  115|    449|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 7, False: 442]
  |  |  ------------------
  |  |  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|    449|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 442]
  |  |  ------------------
  ------------------
  672|       |        /* prefetch FSE table if used */
  673|    442|        if (ddictIsCold && (nbSeq > 24 /* heuristic */)) {
  ------------------
  |  Branch (673:13): [True: 120, False: 322]
  |  Branch (673:28): [True: 36, False: 84]
  ------------------
  674|     36|            const void* const pStart = *DTablePtr;
  675|     36|            size_t const pSize = sizeof(ZSTD_seqSymbol) * (SEQSYMBOL_TABLE_SIZE(maxLog));
  ------------------
  |  |   74|     36| #define SEQSYMBOL_TABLE_SIZE(log)   (1 + (1 << (log)))
  ------------------
  676|     36|            PREFETCH_AREA(pStart, pSize);
  ------------------
  |  |  159|     36|    do {                                                 \
  |  |  160|     36|        const char* const _ptr = (const char*)(p);       \
  |  |  161|     36|        size_t const _size = (size_t)(s);                \
  |  |  162|     36|        size_t _pos;                                     \
  |  |  163|  1.96k|        for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \
  |  |  ------------------
  |  |  |  |  156|  1.92k|#define CACHELINE_SIZE 64
  |  |  ------------------
  |  |  |  Branch (163:22): [True: 1.92k, False: 36]
  |  |  ------------------
  |  |  164|  1.92k|            PREFETCH_L2(_ptr + _pos);                    \
  |  |  ------------------
  |  |  |  |  146|  1.92k|#    define PREFETCH_L2(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */)
  |  |  ------------------
  |  |  165|  1.92k|        }                                                \
  |  |  166|     36|    } while (0)
  |  |  ------------------
  |  |  |  Branch (166:14): [Folded, False: 36]
  |  |  ------------------
  ------------------
  677|     36|        }
  678|    442|        return 0;
  679|  5.33k|    case set_compressed :
  ------------------
  |  Branch (679:5): [True: 5.33k, False: 8.53k]
  ------------------
  680|  5.33k|        {   unsigned tableLog;
  681|  5.33k|            S16 norm[MaxSeq+1];
  682|  5.33k|            size_t const headerSize = FSE_readNCount(norm, &max, &tableLog, src, srcSize);
  683|  5.33k|            RETURN_ERROR_IF(FSE_isError(headerSize), corruption_detected, "");
  ------------------
  |  |  114|  5.33k|    do {                                                                       \
  |  |  115|  5.33k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 68, False: 5.26k]
  |  |  ------------------
  |  |  116|     68|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     68|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 68]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     68|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     68|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     68|    do {                                           \
  |  |  |  |   99|     68|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 68]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     68|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 68]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     68|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     68|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 68]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     68|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     68|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 68]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     68|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     68|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     68|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     68|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     68|        }                                                                      \
  |  |  123|  5.33k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.26k]
  |  |  ------------------
  ------------------
  684|  5.26k|            RETURN_ERROR_IF(tableLog > maxLog, corruption_detected, "");
  ------------------
  |  |  114|  5.26k|    do {                                                                       \
  |  |  115|  5.26k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 13, False: 5.25k]
  |  |  ------------------
  |  |  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|  5.26k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.25k]
  |  |  ------------------
  ------------------
  685|  5.25k|            ZSTD_buildFSETable(DTableSpace, norm, max, baseValue, nbAdditionalBits, tableLog, wksp, wkspSize, bmi2);
  686|  5.25k|            *DTablePtr = DTableSpace;
  687|  5.25k|            return headerSize;
  688|  5.26k|        }
  689|      0|    default :
  ------------------
  |  Branch (689:5): [True: 0, False: 13.8k]
  ------------------
  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|  13.8k|    }
  693|  13.8k|}
zstd_decompress_block.c:ZSTD_buildSeqTable_rle:
  464|  3.10k|{
  465|  3.10k|    void* ptr = dt;
  466|  3.10k|    ZSTD_seqSymbol_header* const DTableH = (ZSTD_seqSymbol_header*)ptr;
  467|  3.10k|    ZSTD_seqSymbol* const cell = dt + 1;
  468|       |
  469|  3.10k|    DTableH->tableLog = 0;
  470|  3.10k|    DTableH->fastMode = 0;
  471|       |
  472|  3.10k|    cell->nbBits = 0;
  473|  3.10k|    cell->nextState = 0;
  474|  3.10k|    assert(nbAddBits < 255);
  ------------------
  |  |   70|  3.10k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  475|  3.10k|    cell->nbAdditionalBits = nbAddBits;
  476|  3.10k|    cell->baseValue = baseValue;
  477|  3.10k|}
zstd_decompress_block.c:ZSTD_blockSizeMax:
   55|  41.2k|{
   56|  41.2k|    size_t const blockSizeMax = dctx->isFrameDecompression ? dctx->fParams.blockSizeMax : ZSTD_BLOCKSIZE_MAX;
  ------------------
  |  |  148|  41.2k|#define ZSTD_BLOCKSIZE_MAX     (1<<ZSTD_BLOCKSIZELOG_MAX)
  |  |  ------------------
  |  |  |  |  147|      0|#define ZSTD_BLOCKSIZELOG_MAX  17
  |  |  ------------------
  ------------------
  |  Branch (56:33): [True: 41.2k, False: 0]
  ------------------
   57|  41.2k|    assert(blockSizeMax <= ZSTD_BLOCKSIZE_MAX);
  ------------------
  |  |   70|  41.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   58|  41.2k|    return blockSizeMax;
   59|  41.2k|}
zstd_decompress_block.c:ZSTD_totalHistorySize:
 1997|  8.76k|{
 1998|  8.76k|    return (size_t)(op - virtualStart);
 1999|  8.76k|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong:
 1979|  1.09k|{
 1980|  1.09k|    DEBUGLOG(5, "ZSTD_decompressSequencesLong");
  ------------------
  |  |  104|  1.09k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 1.09k]
  |  |  ------------------
  ------------------
 1981|  1.09k|#if DYNAMIC_BMI2
 1982|  1.09k|    if (ZSTD_DCtx_get_bmi2(dctx)) {
  ------------------
  |  Branch (1982:9): [True: 1.09k, False: 0]
  ------------------
 1983|  1.09k|        return ZSTD_decompressSequencesLong_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1984|  1.09k|    }
 1985|      0|#endif
 1986|      0|  return ZSTD_decompressSequencesLong_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1987|  1.09k|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong_bmi2:
 1931|  1.09k|{
 1932|  1.09k|    return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1933|  1.09k|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong_body:
 1738|  1.09k|{
 1739|  1.09k|    const BYTE* ip = (const BYTE*)seqStart;
 1740|  1.09k|    const BYTE* const iend = ip + seqSize;
 1741|  1.09k|    BYTE* const ostart = (BYTE*)dst;
 1742|  1.09k|    BYTE* const oend = dctx->litBufferLocation == ZSTD_in_dst ? dctx->litBuffer : ZSTD_maybeNullPtrAdd(ostart, maxDstSize);
  ------------------
  |  Branch (1742:24): [True: 39, False: 1.05k]
  ------------------
 1743|  1.09k|    BYTE* op = ostart;
 1744|  1.09k|    const BYTE* litPtr = dctx->litPtr;
 1745|  1.09k|    const BYTE* litBufferEnd = dctx->litBufferEnd;
 1746|  1.09k|    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);
 1747|  1.09k|    const BYTE* const dictStart = (const BYTE*) (dctx->virtualStart);
 1748|  1.09k|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 1749|       |
 1750|       |    /* Regen sequences */
 1751|  1.09k|    if (nbSeq) {
  ------------------
  |  Branch (1751:9): [True: 995, False: 95]
  ------------------
 1752|    995|#define STORED_SEQS 8
 1753|    995|#define STORED_SEQS_MASK (STORED_SEQS-1)
 1754|    995|#define ADVANCED_SEQS STORED_SEQS
 1755|    995|        seq_t sequences[STORED_SEQS];
 1756|    995|        int const seqAdvance = MIN(nbSeq, ADVANCED_SEQS);
  ------------------
  |  |   54|    995|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 213, False: 782]
  |  |  ------------------
  ------------------
 1757|    995|        seqState_t seqState;
 1758|    995|        int seqNb;
 1759|    995|        size_t prefetchPos = (size_t)(op-prefixStart); /* track position relative to prefixStart */
 1760|       |
 1761|    995|        dctx->fseEntropy = 1;
 1762|  3.98k|        { int i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  3.98k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1762:28): [True: 2.98k, False: 995]
  ------------------
 1763|    995|        assert(dst != NULL);
  ------------------
  |  |   70|    995|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1764|    995|        assert(iend >= ip);
  ------------------
  |  |   70|    995|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1765|    995|        RETURN_ERROR_IF(
  ------------------
  |  |  114|    995|    do {                                                                       \
  |  |  115|    995|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 59, False: 936]
  |  |  ------------------
  |  |  116|     59|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     59|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 59]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     59|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     59|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     59|    do {                                           \
  |  |  |  |   99|     59|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 59]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     59|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 59]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     59|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     59|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 59]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     59|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     59|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 59]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     59|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     59|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     59|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     59|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     59|        }                                                                      \
  |  |  123|    995|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 936]
  |  |  ------------------
  ------------------
 1766|    995|            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)),
 1767|    995|            corruption_detected, "");
 1768|    936|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1769|    936|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1770|    936|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1771|       |
 1772|       |        /* prepare in advance */
 1773|  7.55k|        for (seqNb=0; seqNb<seqAdvance; seqNb++) {
  ------------------
  |  Branch (1773:23): [True: 6.61k, False: 936]
  ------------------
 1774|  6.61k|            seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1);
 1775|  6.61k|            prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1776|  6.61k|            sequences[seqNb] = sequence;
 1777|  6.61k|        }
 1778|       |
 1779|       |        /* decompress without stomping litBuffer */
 1780|  1.96M|        for (; seqNb < nbSeq; seqNb++) {
  ------------------
  |  Branch (1780:16): [True: 1.96M, False: 225]
  ------------------
 1781|  1.96M|            seq_t sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1);
 1782|       |
 1783|  1.96M|            if (dctx->litBufferLocation == ZSTD_split && litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength > dctx->litBufferEnd) {
  ------------------
  |  | 1754|  1.80M|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|  1.80M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                          if (dctx->litBufferLocation == ZSTD_split && litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength > dctx->litBufferEnd) {
  ------------------
  |  | 1753|  1.80M|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|  1.80M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
  |  Branch (1783:17): [True: 1.80M, False: 160k]
  |  Branch (1783:58): [True: 191, False: 1.80M]
  ------------------
 1784|       |                /* lit buffer is reaching split point, empty out the first buffer and transition to litExtraBuffer */
 1785|    191|                const size_t leftoverLit = dctx->litBufferEnd - litPtr;
 1786|    191|                if (leftoverLit)
  ------------------
  |  Branch (1786:21): [True: 189, False: 2]
  ------------------
 1787|    189|                {
 1788|    189|                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer");
  ------------------
  |  |  114|    189|    do {                                                                       \
  |  |  115|    189|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 12, False: 177]
  |  |  ------------------
  |  |  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|    189|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 177]
  |  |  ------------------
  ------------------
 1789|    177|                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);
 1790|    177|                    sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength -= leftoverLit;
  ------------------
  |  | 1754|    177|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|    177|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength -= leftoverLit;
  ------------------
  |  | 1753|    177|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    177|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1791|    177|                    op += leftoverLit;
 1792|    177|                }
 1793|    179|                litPtr = dctx->litExtraBuffer;
 1794|    179|                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    179|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    179|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|    358|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 179]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 179, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1795|    179|                dctx->litBufferLocation = ZSTD_not_in_dst;
 1796|    179|                {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1754|    179|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|    179|#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|    179|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    179|#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|    179|                    if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|    179|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1801:25): [True: 41, False: 138]
  ------------------
 1802|       |
 1803|    138|                    prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1804|    138|                    sequences[seqNb & STORED_SEQS_MASK] = sequence;
  ------------------
  |  | 1753|    138|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    138|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1805|    138|                    op += oneSeqSize;
 1806|    138|            }   }
 1807|  1.96M|            else
 1808|  1.96M|            {
 1809|       |                /* lit buffer is either wholly contained in first or second split, or not split at all*/
 1810|  1.96M|                size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ?
  ------------------
  |  Branch (1810:43): [True: 1.80M, False: 160k]
  ------------------
 1811|  1.80M|                    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|  1.80M|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|  1.80M|#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|  1.80M|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|  1.80M|#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|  1.80M|#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|  1.80M|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|  1.80M|#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|  1.80M|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|  1.80M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1812|  1.96M|                    ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1754|   160k|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|   160k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1753|   160k|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|   160k|#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.96M|                if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|  1.96M|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1817:21): [True: 658, False: 1.96M]
  ------------------
 1818|       |
 1819|  1.96M|                prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1820|  1.96M|                sequences[seqNb & STORED_SEQS_MASK] = sequence;
  ------------------
  |  | 1753|  1.96M|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|  1.96M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1821|  1.96M|                op += oneSeqSize;
 1822|  1.96M|            }
 1823|  1.96M|        }
 1824|    225|        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, "");
  ------------------
  |  |  114|    225|    do {                                                                       \
  |  |  115|    225|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 31, False: 194]
  |  |  ------------------
  |  |  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|    225|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 194]
  |  |  ------------------
  ------------------
 1825|       |
 1826|       |        /* finish queue */
 1827|    194|        seqNb -= seqAdvance;
 1828|    800|        for ( ; seqNb<nbSeq ; seqNb++) {
  ------------------
  |  Branch (1828:17): [True: 678, False: 122]
  ------------------
 1829|    678|            seq_t *sequence = &(sequences[seqNb&STORED_SEQS_MASK]);
  ------------------
  |  | 1753|    678|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    678|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1830|    678|            if (dctx->litBufferLocation == ZSTD_split && litPtr + sequence->litLength > dctx->litBufferEnd) {
  ------------------
  |  Branch (1830:17): [True: 0, False: 678]
  |  Branch (1830:58): [True: 0, False: 0]
  ------------------
 1831|      0|                const size_t leftoverLit = dctx->litBufferEnd - litPtr;
 1832|      0|                if (leftoverLit) {
  ------------------
  |  Branch (1832:21): [True: 0, False: 0]
  ------------------
 1833|      0|                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer");
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 1834|      0|                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);
 1835|      0|                    sequence->litLength -= leftoverLit;
 1836|      0|                    op += leftoverLit;
 1837|      0|                }
 1838|      0|                litPtr = dctx->litExtraBuffer;
 1839|      0|                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|      0|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|      0|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      0|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 0, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1840|      0|                dctx->litBufferLocation = ZSTD_not_in_dst;
 1841|      0|                {   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|      0|                    if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|      0|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1846:25): [True: 0, False: 0]
  ------------------
 1847|      0|                    op += oneSeqSize;
 1848|      0|                }
 1849|      0|            }
 1850|    678|            else
 1851|    678|            {
 1852|    678|                size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ?
  ------------------
  |  Branch (1852:43): [True: 0, False: 678]
  ------------------
 1853|      0|                    ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence->litLength - WILDCOPY_OVERLENGTH, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  |  199|      0|#define WILDCOPY_OVERLENGTH 32
  ------------------
 1854|    678|                    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|    678|                if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|    678|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1859:21): [True: 72, False: 606]
  ------------------
 1860|    606|                op += oneSeqSize;
 1861|    606|            }
 1862|    678|        }
 1863|       |
 1864|       |        /* save reps for next block */
 1865|    488|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  |   64|    488|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1865:28): [True: 366, False: 122]
  ------------------
 1866|    122|    }
 1867|       |
 1868|       |    /* last literal segment */
 1869|    217|    if (dctx->litBufferLocation == ZSTD_split) { /* first deplete literal buffer in dst, then copy litExtraBuffer */
  ------------------
  |  Branch (1869:9): [True: 0, False: 217]
  ------------------
 1870|      0|        size_t const lastLLSize = litBufferEnd - litPtr;
 1871|      0|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend - op), dstSize_tooSmall, "");
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 1872|      0|        if (op != NULL) {
  ------------------
  |  Branch (1872:13): [True: 0, False: 0]
  ------------------
 1873|      0|            ZSTD_memmove(op, litPtr, lastLLSize);
  ------------------
  |  |   45|      0|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1874|      0|            op += lastLLSize;
 1875|      0|        }
 1876|      0|        litPtr = dctx->litExtraBuffer;
 1877|      0|        litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|      0|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|      0|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      0|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 0, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1878|      0|    }
 1879|    217|    {   size_t const lastLLSize = litBufferEnd - litPtr;
 1880|    217|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, "");
  ------------------
  |  |  114|    217|    do {                                                                       \
  |  |  115|    217|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4, False: 213]
  |  |  ------------------
  |  |  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|    217|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 213]
  |  |  ------------------
  ------------------
 1881|    213|        if (op != NULL) {
  ------------------
  |  Branch (1881:13): [True: 213, False: 0]
  ------------------
 1882|    213|            ZSTD_memmove(op, litPtr, lastLLSize);
  ------------------
  |  |   45|    213|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1883|    213|            op += lastLLSize;
 1884|    213|        }
 1885|    213|    }
 1886|       |
 1887|      0|    return (size_t)(op - ostart);
 1888|    217|}
zstd_decompress_block.c:ZSTD_initFseState:
 1193|  13.1k|{
 1194|  13.1k|    const void* ptr = dt;
 1195|  13.1k|    const ZSTD_seqSymbol_header* const DTableH = (const ZSTD_seqSymbol_header*)ptr;
 1196|  13.1k|    DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);
 1197|  13.1k|    DEBUGLOG(6, "ZSTD_initFseState : val=%u using %u bits",
  ------------------
  |  |  104|  13.1k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 13.1k]
  |  |  ------------------
  ------------------
 1198|  13.1k|                (U32)DStatePtr->state, DTableH->tableLog);
 1199|  13.1k|    BIT_reloadDStream(bitD);
 1200|  13.1k|    DStatePtr->table = dt + 1;
 1201|  13.1k|}
zstd_decompress_block.c:ZSTD_decodeSequence:
 1230|  4.47M|{
 1231|  4.47M|    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|  4.47M|    const ZSTD_seqSymbol* const llDInfo = seqState->stateLL.table + seqState->stateLL.state;
 1250|  4.47M|    const ZSTD_seqSymbol* const mlDInfo = seqState->stateML.table + seqState->stateML.state;
 1251|  4.47M|    const ZSTD_seqSymbol* const ofDInfo = seqState->stateOffb.table + seqState->stateOffb.state;
 1252|  4.47M|#endif
 1253|  4.47M|    seq.matchLength = mlDInfo->baseValue;
 1254|  4.47M|    seq.litLength = llDInfo->baseValue;
 1255|  4.47M|    {   U32 const ofBase = ofDInfo->baseValue;
 1256|  4.47M|        BYTE const llBits = llDInfo->nbAdditionalBits;
 1257|  4.47M|        BYTE const mlBits = mlDInfo->nbAdditionalBits;
 1258|  4.47M|        BYTE const ofBits = ofDInfo->nbAdditionalBits;
 1259|  4.47M|        BYTE const totalBits = llBits+mlBits+ofBits;
 1260|       |
 1261|  4.47M|        U16 const llNext = llDInfo->nextState;
 1262|  4.47M|        U16 const mlNext = mlDInfo->nextState;
 1263|  4.47M|        U16 const ofNext = ofDInfo->nextState;
 1264|  4.47M|        U32 const llnbBits = llDInfo->nbBits;
 1265|  4.47M|        U32 const mlnbBits = mlDInfo->nbBits;
 1266|  4.47M|        U32 const ofnbBits = ofDInfo->nbBits;
 1267|       |
 1268|  4.47M|        assert(llBits <= MaxLLBits);
  ------------------
  |  |   70|  4.47M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1269|  4.47M|        assert(mlBits <= MaxMLBits);
  ------------------
  |  |   70|  4.47M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1270|  4.47M|        assert(ofBits <= MaxOff);
  ------------------
  |  |   70|  4.47M|#    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|  4.47M|        {   size_t offset;
 1279|  4.47M|            if (ofBits > 1) {
  ------------------
  |  Branch (1279:17): [True: 3.98M, False: 492k]
  ------------------
 1280|  3.98M|                ZSTD_STATIC_ASSERT(ZSTD_lo_isLongOffset == 1);
  ------------------
  |  |   43|  3.98M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  3.98M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1281|  3.98M|                ZSTD_STATIC_ASSERT(LONG_OFFSETS_MAX_EXTRA_BITS_32 == 5);
  ------------------
  |  |   43|  3.98M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  3.98M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1282|  3.98M|                ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 > LONG_OFFSETS_MAX_EXTRA_BITS_32);
  ------------------
  |  |   43|  3.98M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  3.98M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1283|  3.98M|                ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 - LONG_OFFSETS_MAX_EXTRA_BITS_32 >= MaxMLBits);
  ------------------
  |  |   43|  3.98M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  3.98M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1284|  3.98M|                if (MEM_32bits() && longOffsets && (ofBits >= STREAM_ACCUMULATOR_MIN_32)) {
  ------------------
  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  ------------------
  |  Branch (1284:21): [True: 0, False: 3.98M]
  |  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|  3.98M|                } else {
 1293|  3.98M|                    offset = ofBase + BIT_readBitsFast(&seqState->DStream, ofBits/*>0*/);   /* <=  (ZSTD_WINDOWLOG_MAX-1) bits */
 1294|  3.98M|                    if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);
  ------------------
  |  Branch (1294:25): [True: 0, False: 3.98M]
  ------------------
 1295|  3.98M|                }
 1296|  3.98M|                seqState->prevOffset[2] = seqState->prevOffset[1];
 1297|  3.98M|                seqState->prevOffset[1] = seqState->prevOffset[0];
 1298|  3.98M|                seqState->prevOffset[0] = offset;
 1299|  3.98M|            } else {
 1300|   492k|                U32 const ll0 = (llDInfo->baseValue == 0);
 1301|   492k|                if (LIKELY((ofBits == 0))) {
  ------------------
  |  |  187|   492k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 422k, False: 70.2k]
  |  |  ------------------
  ------------------
 1302|   422k|                    offset = seqState->prevOffset[ll0];
 1303|   422k|                    seqState->prevOffset[1] = seqState->prevOffset[!ll0];
 1304|   422k|                    seqState->prevOffset[0] = offset;
 1305|   422k|                } else {
 1306|  70.2k|                    offset = ofBase + ll0 + BIT_readBitsFast(&seqState->DStream, 1);
 1307|  70.2k|                    {   size_t temp = (offset==3) ? seqState->prevOffset[0] - 1 : seqState->prevOffset[offset];
  ------------------
  |  Branch (1307:39): [True: 14.5k, False: 55.7k]
  ------------------
 1308|  70.2k|                        temp -= !temp; /* 0 is not valid: input corrupted => force offset to -1 => corruption detected at execSequence */
 1309|  70.2k|                        if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1];
  ------------------
  |  Branch (1309:29): [True: 53.3k, False: 16.8k]
  ------------------
 1310|  70.2k|                        seqState->prevOffset[1] = seqState->prevOffset[0];
 1311|  70.2k|                        seqState->prevOffset[0] = offset = temp;
 1312|  70.2k|            }   }   }
 1313|  4.47M|            seq.offset = offset;
 1314|  4.47M|        }
 1315|       |
 1316|  4.47M|        if (mlBits > 0)
  ------------------
  |  Branch (1316:13): [True: 36.0k, False: 4.44M]
  ------------------
 1317|  36.0k|            seq.matchLength += BIT_readBitsFast(&seqState->DStream, mlBits/*>0*/);
 1318|       |
 1319|  4.47M|        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: 4.47M]
  |  Branch (1319:29): [True: 0, False: 0]
  ------------------
 1320|      0|            BIT_reloadDStream(&seqState->DStream);
 1321|  4.47M|        if (MEM_64bits() && UNLIKELY(totalBits >= STREAM_ACCUMULATOR_MIN_64-(LLFSELog+MLFSELog+OffFSELog)))
  ------------------
  |  |  188|  4.47M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 618, False: 4.47M]
  |  |  ------------------
  ------------------
  |  Branch (1321:13): [True: 4.47M, False: 0]
  ------------------
 1322|    618|            BIT_reloadDStream(&seqState->DStream);
 1323|       |        /* Ensure there are enough bits to read the rest of data in 64-bit mode. */
 1324|  4.47M|        ZSTD_STATIC_ASSERT(16+LLFSELog+MLFSELog+OffFSELog < STREAM_ACCUMULATOR_MIN_64);
  ------------------
  |  |   43|  4.47M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  4.47M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1325|       |
 1326|  4.47M|        if (llBits > 0)
  ------------------
  |  Branch (1326:13): [True: 49.0k, False: 4.43M]
  ------------------
 1327|  49.0k|            seq.litLength += BIT_readBitsFast(&seqState->DStream, llBits/*>0*/);
 1328|       |
 1329|  4.47M|        if (MEM_32bits())
  ------------------
  |  Branch (1329:13): [True: 0, False: 4.47M]
  ------------------
 1330|      0|            BIT_reloadDStream(&seqState->DStream);
 1331|       |
 1332|  4.47M|        DEBUGLOG(6, "seq: litL=%u, matchL=%u, offset=%u",
  ------------------
  |  |  104|  4.47M|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 4.47M]
  |  |  ------------------
  ------------------
 1333|  4.47M|                    (U32)seq.litLength, (U32)seq.matchLength, (U32)seq.offset);
 1334|       |
 1335|  4.47M|        if (!isLastSeq) {
  ------------------
  |  Branch (1335:13): [True: 4.47M, False: 2.77k]
  ------------------
 1336|       |            /* don't update FSE state for last Sequence */
 1337|  4.47M|            ZSTD_updateFseStateWithDInfo(&seqState->stateLL, &seqState->DStream, llNext, llnbBits);    /* <=  9 bits */
 1338|  4.47M|            ZSTD_updateFseStateWithDInfo(&seqState->stateML, &seqState->DStream, mlNext, mlnbBits);    /* <=  9 bits */
 1339|  4.47M|            if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);    /* <= 18 bits */
  ------------------
  |  Branch (1339:17): [True: 0, False: 4.47M]
  ------------------
 1340|  4.47M|            ZSTD_updateFseStateWithDInfo(&seqState->stateOffb, &seqState->DStream, ofNext, ofnbBits);  /* <=  8 bits */
 1341|  4.47M|            BIT_reloadDStream(&seqState->DStream);
 1342|  4.47M|        }
 1343|  4.47M|    }
 1344|       |
 1345|  4.47M|    return seq;
 1346|  4.47M|}
zstd_decompress_block.c:ZSTD_updateFseStateWithDInfo:
 1205|  13.4M|{
 1206|  13.4M|    size_t const lowBits = BIT_readBits(bitD, nbBits);
 1207|  13.4M|    DStatePtr->state = nextState + lowBits;
 1208|  13.4M|}
zstd_decompress_block.c:ZSTD_prefetchMatch:
 1717|  1.97M|{
 1718|  1.97M|    prefetchPos += sequence.litLength;
 1719|  1.97M|    {   const BYTE* const matchBase = (sequence.offset > prefetchPos) ? dictEnd : prefixStart;
  ------------------
  |  Branch (1719:39): [True: 8.04k, False: 1.96M]
  ------------------
 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.97M|        const BYTE* const match = ZSTD_wrappedPtrSub(ZSTD_wrappedPtrAdd(matchBase, prefetchPos), sequence.offset);
 1723|  1.97M|        PREFETCH_L1(match); PREFETCH_L1(match+CACHELINE_SIZE);   /* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */
  ------------------
  |  |  145|  1.97M|#    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.97M|#    define PREFETCH_L1(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */)
  ------------------
 1724|  1.97M|    }
 1725|  1.97M|    return prefetchPos + sequence.matchLength;
 1726|  1.97M|}
zstd_decompress_block.c:ZSTD_safecopyDstBeforeSrc:
  877|  53.4k|static void ZSTD_safecopyDstBeforeSrc(BYTE* op, const BYTE* ip, ptrdiff_t length) {
  878|  53.4k|    ptrdiff_t const diff = op - ip;
  879|  53.4k|    BYTE* const oend = op + length;
  880|       |
  881|  53.4k|    if (length < 8 || diff > -8) {
  ------------------
  |  Branch (881:9): [True: 49.2k, False: 4.28k]
  |  Branch (881:23): [True: 3.78k, False: 496]
  ------------------
  882|       |        /* Handle short lengths, close overlaps, and dst not before src. */
  883|   467k|        while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (883:16): [True: 414k, False: 52.9k]
  ------------------
  884|  52.9k|        return;
  885|  52.9k|    }
  886|       |
  887|    496|    if (op <= oend - WILDCOPY_OVERLENGTH && diff < -WILDCOPY_VECLEN) {
  ------------------
  |  |  199|    992|#define WILDCOPY_OVERLENGTH 32
  ------------------
                  if (op <= oend - WILDCOPY_OVERLENGTH && diff < -WILDCOPY_VECLEN) {
  ------------------
  |  |  200|    330|#define WILDCOPY_VECLEN 16
  ------------------
  |  Branch (887:9): [True: 330, False: 166]
  |  Branch (887:45): [True: 292, False: 38]
  ------------------
  888|    292|        ZSTD_wildcopy(op, ip, oend - WILDCOPY_OVERLENGTH - op, ZSTD_no_overlap);
  ------------------
  |  |  199|    292|#define WILDCOPY_OVERLENGTH 32
  ------------------
  889|    292|        ip += oend - WILDCOPY_OVERLENGTH - op;
  ------------------
  |  |  199|    292|#define WILDCOPY_OVERLENGTH 32
  ------------------
  890|    292|        op += oend - WILDCOPY_OVERLENGTH - op;
  ------------------
  |  |  199|    292|#define WILDCOPY_OVERLENGTH 32
  ------------------
  891|    292|    }
  892|       |
  893|       |    /* Handle the leftovers. */
  894|  87.8k|    while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (894:12): [True: 87.4k, False: 496]
  ------------------
  895|    496|}
zstd_decompress_block.c:ZSTD_execSequence:
 1005|   462k|{
 1006|   462k|    BYTE* const oLitEnd = op + sequence.litLength;
 1007|   462k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 1008|   462k|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 1009|   462k|    BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;   /* risk : address space underflow on oend=NULL */
  ------------------
  |  |  199|   462k|#define WILDCOPY_OVERLENGTH 32
  ------------------
 1010|   462k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 1011|   462k|    const BYTE* match = oLitEnd - sequence.offset;
 1012|       |
 1013|   462k|    assert(op != NULL /* Precondition */);
  ------------------
  |  |   70|   462k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1014|   462k|    assert(oend_w < oend /* No underflow */);
  ------------------
  |  |   70|   462k|#    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|   462k|    if (UNLIKELY(
  ------------------
  |  |  188|  2.29M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 5.70k, False: 456k]
  |  |  |  Branch (188:40): [True: 319, False: 461k]
  |  |  |  Branch (188:40): [True: 5.38k, False: 456k]
  |  |  |  Branch (188:40): [True: 0, False: 456k]
  |  |  |  Branch (188:40): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1026|   462k|        iLitEnd > litLimit ||
 1027|   462k|        oMatchEnd > oend_w ||
 1028|   462k|        (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH)))
 1029|  5.70k|        return ZSTD_execSequenceEnd(op, oend, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd);
 1030|       |
 1031|       |    /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */
 1032|   456k|    assert(op <= oLitEnd /* No overflow */);
  ------------------
  |  |   70|   456k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1033|   456k|    assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */);
  ------------------
  |  |   70|   456k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1034|   456k|    assert(oMatchEnd <= oend /* No underflow */);
  ------------------
  |  |   70|   456k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1035|   456k|    assert(iLitEnd <= litLimit /* Literal length is in bounds */);
  ------------------
  |  |   70|   456k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1036|   456k|    assert(oLitEnd <= oend_w /* Can wildcopy literals */);
  ------------------
  |  |   70|   456k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1037|   456k|    assert(oMatchEnd <= oend_w /* Can wildcopy matches */);
  ------------------
  |  |   70|   456k|#    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|   456k|    assert(WILDCOPY_OVERLENGTH >= 16);
  ------------------
  |  |   70|   456k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1044|   456k|    ZSTD_copy16(op, (*litPtr));
 1045|   456k|    if (UNLIKELY(sequence.litLength > 16)) {
  ------------------
  |  |  188|   456k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 10.4k, False: 446k]
  |  |  ------------------
  ------------------
 1046|  10.4k|        ZSTD_wildcopy(op + 16, (*litPtr) + 16, sequence.litLength - 16, ZSTD_no_overlap);
 1047|  10.4k|    }
 1048|   456k|    op = oLitEnd;
 1049|   456k|    *litPtr = iLitEnd;   /* update for next sequence */
 1050|       |
 1051|       |    /* Copy Match */
 1052|   456k|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (1052:9): [True: 2.43k, False: 454k]
  ------------------
 1053|       |        /* offset beyond prefix -> go into extDict */
 1054|  2.43k|        RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected, "");
  ------------------
  |  |  114|  2.43k|    do {                                                                       \
  |  |  115|  2.43k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 401, False: 2.03k]
  |  |  ------------------
  |  |  116|    401|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    401|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 401]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    401|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    401|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    401|    do {                                           \
  |  |  |  |   99|    401|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 401]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    401|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 401]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    401|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    401|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 401]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    401|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    401|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 401]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    401|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    401|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    401|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    401|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    401|        }                                                                      \
  |  |  123|  2.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.03k]
  |  |  ------------------
  ------------------
 1055|  2.03k|        match = dictEnd + (match - prefixStart);
 1056|  2.03k|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (1056:13): [True: 1.83k, False: 204]
  ------------------
 1057|  1.83k|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|  1.83k|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1058|  1.83k|            return sequenceLength;
 1059|  1.83k|        }
 1060|       |        /* span extDict & currentPrefixSegment */
 1061|    204|        {   size_t const length1 = dictEnd - match;
 1062|    204|        ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|    204|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1063|    204|        op = oLitEnd + length1;
 1064|    204|        sequence.matchLength -= length1;
 1065|    204|        match = prefixStart;
 1066|    204|        }
 1067|    204|    }
 1068|       |    /* Match within prefix of 1 or more bytes */
 1069|   454k|    assert(op <= oMatchEnd);
  ------------------
  |  |   70|   454k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1070|   454k|    assert(oMatchEnd <= oend_w);
  ------------------
  |  |   70|   454k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1071|   454k|    assert(match >= prefixStart);
  ------------------
  |  |   70|   454k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1072|   454k|    assert(sequence.matchLength >= 1);
  ------------------
  |  |   70|   454k|#    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|   454k|    if (LIKELY(sequence.offset >= WILDCOPY_VECLEN)) {
  ------------------
  |  |  187|   454k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 296k, False: 157k]
  |  |  ------------------
  ------------------
 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|   296k|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength, ZSTD_no_overlap);
 1083|   296k|        return sequenceLength;
 1084|   296k|    }
 1085|   157k|    assert(sequence.offset < WILDCOPY_VECLEN);
  ------------------
  |  |   70|   157k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1086|       |
 1087|       |    /* Copy 8 bytes and spread the offset to be >= 8. */
 1088|   157k|    ZSTD_overlapCopy8(&op, &match, sequence.offset);
 1089|       |
 1090|       |    /* If the match length is > 8 bytes, then continue with the wildcopy. */
 1091|   157k|    if (sequence.matchLength > 8) {
  ------------------
  |  Branch (1091:9): [True: 16.2k, False: 141k]
  ------------------
 1092|  16.2k|        assert(op < oMatchEnd);
  ------------------
  |  |   70|  16.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1093|  16.2k|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength - 8, ZSTD_overlap_src_before_dst);
 1094|  16.2k|    }
 1095|   157k|    return sequenceLength;
 1096|   454k|}
zstd_decompress_block.c:ZSTD_execSequenceEnd:
  911|  5.70k|{
  912|  5.70k|    BYTE* const oLitEnd = op + sequence.litLength;
  913|  5.70k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
  914|  5.70k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
  915|  5.70k|    const BYTE* match = oLitEnd - sequence.offset;
  916|  5.70k|    BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|  5.70k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  917|       |
  918|       |    /* bounds checks : careful of address space overflow in 32-bit mode */
  919|  5.70k|    RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, "last match must fit within dstBuffer");
  ------------------
  |  |  114|  5.70k|    do {                                                                       \
  |  |  115|  5.70k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 776, False: 4.92k]
  |  |  ------------------
  |  |  116|    776|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    776|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 776]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    776|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    776|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    776|    do {                                           \
  |  |  |  |   99|    776|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 776]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    776|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 776]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    776|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    776|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 776]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    776|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    776|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 776]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    776|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    776|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    776|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    776|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    776|        }                                                                      \
  |  |  123|  5.70k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.92k]
  |  |  ------------------
  ------------------
  920|  4.92k|    RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, "try to read beyond literal buffer");
  ------------------
  |  |  114|  4.92k|    do {                                                                       \
  |  |  115|  4.92k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 96, False: 4.83k]
  |  |  ------------------
  |  |  116|     96|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     96|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 96]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     96|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     96|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     96|    do {                                           \
  |  |  |  |   99|     96|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 96]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     96|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 96]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     96|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     96|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 96]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     96|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     96|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 96]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     96|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     96|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     96|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     96|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     96|        }                                                                      \
  |  |  123|  4.92k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.83k]
  |  |  ------------------
  ------------------
  921|  4.83k|    assert(op < op + sequenceLength);
  ------------------
  |  |   70|  4.83k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  922|  4.83k|    assert(oLitEnd < op + sequenceLength);
  ------------------
  |  |   70|  4.83k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  923|       |
  924|       |    /* copy literals */
  925|  4.83k|    ZSTD_safecopy(op, oend_w, *litPtr, sequence.litLength, ZSTD_no_overlap);
  926|  4.83k|    op = oLitEnd;
  927|  4.83k|    *litPtr = iLitEnd;
  928|       |
  929|       |    /* copy Match */
  930|  4.83k|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (930:9): [True: 512, False: 4.31k]
  ------------------
  931|       |        /* offset beyond prefix */
  932|    512|        RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, "");
  ------------------
  |  |  114|    512|    do {                                                                       \
  |  |  115|    512|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 159, False: 353]
  |  |  ------------------
  |  |  116|    159|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    159|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 159]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    159|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    159|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    159|    do {                                           \
  |  |  |  |   99|    159|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 159]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    159|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 159]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    159|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    159|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 159]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    159|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    159|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 159]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    159|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    159|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    159|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    159|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    159|        }                                                                      \
  |  |  123|    512|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 353]
  |  |  ------------------
  ------------------
  933|    353|        match = dictEnd - (prefixStart - match);
  934|    353|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (934:13): [True: 255, False: 98]
  ------------------
  935|    255|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|    255|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  936|    255|            return sequenceLength;
  937|    255|        }
  938|       |        /* span extDict & currentPrefixSegment */
  939|     98|        {   size_t const length1 = dictEnd - match;
  940|     98|        ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|     98|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  941|     98|        op = oLitEnd + length1;
  942|     98|        sequence.matchLength -= length1;
  943|     98|        match = prefixStart;
  944|     98|        }
  945|     98|    }
  946|  4.41k|    ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst);
  947|  4.41k|    return sequenceLength;
  948|  4.83k|}
zstd_decompress_block.c:ZSTD_safecopy:
  837|  62.2k|static void ZSTD_safecopy(BYTE* op, const BYTE* const oend_w, BYTE const* ip, ptrdiff_t length, ZSTD_overlap_e ovtype) {
  838|  62.2k|    ptrdiff_t const diff = op - ip;
  839|  62.2k|    BYTE* const oend = op + length;
  840|       |
  841|  62.2k|    assert((ovtype == ZSTD_no_overlap && (diff <= -8 || diff >= 8 || op >= oend_w)) ||
  ------------------
  |  |   70|  62.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  842|  62.2k|           (ovtype == ZSTD_overlap_src_before_dst && diff >= 0));
  843|       |
  844|  62.2k|    if (length < 8) {
  ------------------
  |  Branch (844:9): [True: 40.1k, False: 22.0k]
  ------------------
  845|       |        /* Handle short lengths. */
  846|   177k|        while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (846:16): [True: 137k, False: 40.1k]
  ------------------
  847|  40.1k|        return;
  848|  40.1k|    }
  849|  22.0k|    if (ovtype == ZSTD_overlap_src_before_dst) {
  ------------------
  |  Branch (849:9): [True: 20.8k, False: 1.20k]
  ------------------
  850|       |        /* Copy 8 bytes and ensure the offset >= 8 when there can be overlap. */
  851|  20.8k|        assert(length >= 8);
  ------------------
  |  |   70|  20.8k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  852|  20.8k|        ZSTD_overlapCopy8(&op, &ip, diff);
  853|  20.8k|        length -= 8;
  854|  20.8k|        assert(op - ip >= 8);
  ------------------
  |  |   70|  20.8k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  855|  20.8k|        assert(op <= oend);
  ------------------
  |  |   70|  20.8k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  856|  20.8k|    }
  857|       |
  858|  22.0k|    if (oend <= oend_w) {
  ------------------
  |  Branch (858:9): [True: 42, False: 22.0k]
  ------------------
  859|       |        /* No risk of overwrite. */
  860|     42|        ZSTD_wildcopy(op, ip, length, ovtype);
  861|     42|        return;
  862|     42|    }
  863|  22.0k|    if (op <= oend_w) {
  ------------------
  |  Branch (863:9): [True: 487, False: 21.5k]
  ------------------
  864|       |        /* Wildcopy until we get close to the end. */
  865|    487|        assert(oend > oend_w);
  ------------------
  |  |   70|    487|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  866|    487|        ZSTD_wildcopy(op, ip, oend_w - op, ovtype);
  867|    487|        ip += oend_w - op;
  868|    487|        op += oend_w - op;
  869|    487|    }
  870|       |    /* Handle the leftovers. */
  871|  2.14M|    while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (871:12): [True: 2.12M, False: 22.0k]
  ------------------
  872|  22.0k|}
zstd_decompress_block.c:ZSTD_overlapCopy8:
  804|  1.74M|HINT_INLINE void ZSTD_overlapCopy8(BYTE** op, BYTE const** ip, size_t offset) {
  805|  1.74M|    assert(*ip <= *op);
  ------------------
  |  |   70|  1.74M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  806|  1.74M|    if (offset < 8) {
  ------------------
  |  Branch (806:9): [True: 747k, False: 1.00M]
  ------------------
  807|       |        /* close range match, overlap */
  808|   747k|        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
  809|   747k|        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
  810|   747k|        int const sub2 = dec64table[offset];
  811|   747k|        (*op)[0] = (*ip)[0];
  812|   747k|        (*op)[1] = (*ip)[1];
  813|   747k|        (*op)[2] = (*ip)[2];
  814|   747k|        (*op)[3] = (*ip)[3];
  815|   747k|        *ip += dec32table[offset];
  816|   747k|        ZSTD_copy4(*op+4, *ip);
  817|   747k|        *ip -= sub2;
  818|  1.00M|    } else {
  819|  1.00M|        ZSTD_copy8(*op, *ip);
  820|  1.00M|    }
  821|  1.74M|    *ip += 8;
  822|  1.74M|    *op += 8;
  823|  1.74M|    assert(*op - *ip >= 8);
  ------------------
  |  |   70|  1.74M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  824|  1.74M|}
zstd_decompress_block.c:ZSTD_copy4:
   47|   747k|static void ZSTD_copy4(void* dst, const void* src) { ZSTD_memcpy(dst, src, 4); }
  ------------------
  |  |   44|   747k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
zstd_decompress_block.c:ZSTD_execSequenceSplitLitBuffer:
 1104|  4.01M|{
 1105|  4.01M|    BYTE* const oLitEnd = op + sequence.litLength;
 1106|  4.01M|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 1107|  4.01M|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 1108|  4.01M|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 1109|  4.01M|    const BYTE* match = oLitEnd - sequence.offset;
 1110|       |
 1111|  4.01M|    assert(op != NULL /* Precondition */);
  ------------------
  |  |   70|  4.01M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1112|  4.01M|    assert(oend_w < oend /* No underflow */);
  ------------------
  |  |   70|  4.01M|#    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|  4.01M|    if (UNLIKELY(
  ------------------
  |  |  188|  19.9M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 53.2k, False: 3.95M]
  |  |  |  Branch (188:40): [True: 0, False: 4.01M]
  |  |  |  Branch (188:40): [True: 53.2k, False: 3.95M]
  |  |  |  Branch (188:40): [True: 0, False: 3.95M]
  |  |  |  Branch (188:40): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1119|  4.01M|            iLitEnd > litLimit ||
 1120|  4.01M|            oMatchEnd > oend_w ||
 1121|  4.01M|            (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH)))
 1122|  53.2k|        return ZSTD_execSequenceEndSplitLitBuffer(op, oend, oend_w, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd);
 1123|       |
 1124|       |    /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */
 1125|  3.95M|    assert(op <= oLitEnd /* No overflow */);
  ------------------
  |  |   70|  3.95M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1126|  3.95M|    assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */);
  ------------------
  |  |   70|  3.95M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1127|  3.95M|    assert(oMatchEnd <= oend /* No underflow */);
  ------------------
  |  |   70|  3.95M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1128|  3.95M|    assert(iLitEnd <= litLimit /* Literal length is in bounds */);
  ------------------
  |  |   70|  3.95M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1129|  3.95M|    assert(oLitEnd <= oend_w /* Can wildcopy literals */);
  ------------------
  |  |   70|  3.95M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1130|  3.95M|    assert(oMatchEnd <= oend_w /* Can wildcopy matches */);
  ------------------
  |  |   70|  3.95M|#    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|  3.95M|    assert(WILDCOPY_OVERLENGTH >= 16);
  ------------------
  |  |   70|  3.95M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1137|  3.95M|    ZSTD_copy16(op, (*litPtr));
 1138|  3.95M|    if (UNLIKELY(sequence.litLength > 16)) {
  ------------------
  |  |  188|  3.95M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 31.5k, False: 3.92M]
  |  |  ------------------
  ------------------
 1139|  31.5k|        ZSTD_wildcopy(op+16, (*litPtr)+16, sequence.litLength-16, ZSTD_no_overlap);
 1140|  31.5k|    }
 1141|  3.95M|    op = oLitEnd;
 1142|  3.95M|    *litPtr = iLitEnd;   /* update for next sequence */
 1143|       |
 1144|       |    /* Copy Match */
 1145|  3.95M|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (1145:9): [True: 5.36k, False: 3.95M]
  ------------------
 1146|       |        /* offset beyond prefix -> go into extDict */
 1147|  5.36k|        RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected, "");
  ------------------
  |  |  114|  5.36k|    do {                                                                       \
  |  |  115|  5.36k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 73, False: 5.29k]
  |  |  ------------------
  |  |  116|     73|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     73|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 73]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     73|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     73|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     73|    do {                                           \
  |  |  |  |   99|     73|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 73]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     73|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 73]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     73|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     73|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 73]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     73|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     73|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 73]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     73|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     73|        }                                                                      \
  |  |  123|  5.36k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.29k]
  |  |  ------------------
  ------------------
 1148|  5.29k|        match = dictEnd + (match - prefixStart);
 1149|  5.29k|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (1149:13): [True: 5.19k, False: 101]
  ------------------
 1150|  5.19k|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|  5.19k|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1151|  5.19k|            return sequenceLength;
 1152|  5.19k|        }
 1153|       |        /* span extDict & currentPrefixSegment */
 1154|    101|        {   size_t const length1 = dictEnd - match;
 1155|    101|            ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|    101|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1156|    101|            op = oLitEnd + length1;
 1157|    101|            sequence.matchLength -= length1;
 1158|    101|            match = prefixStart;
 1159|    101|    }   }
 1160|       |    /* Match within prefix of 1 or more bytes */
 1161|  3.95M|    assert(op <= oMatchEnd);
  ------------------
  |  |   70|  3.95M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1162|  3.95M|    assert(oMatchEnd <= oend_w);
  ------------------
  |  |   70|  3.95M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1163|  3.95M|    assert(match >= prefixStart);
  ------------------
  |  |   70|  3.95M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1164|  3.95M|    assert(sequence.matchLength >= 1);
  ------------------
  |  |   70|  3.95M|#    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|  3.95M|    if (LIKELY(sequence.offset >= WILDCOPY_VECLEN)) {
  ------------------
  |  |  187|  3.95M|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 2.38M, False: 1.57M]
  |  |  ------------------
  ------------------
 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|  2.38M|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength, ZSTD_no_overlap);
 1175|  2.38M|        return sequenceLength;
 1176|  2.38M|    }
 1177|  1.57M|    assert(sequence.offset < WILDCOPY_VECLEN);
  ------------------
  |  |   70|  1.57M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1178|       |
 1179|       |    /* Copy 8 bytes and spread the offset to be >= 8. */
 1180|  1.57M|    ZSTD_overlapCopy8(&op, &match, sequence.offset);
 1181|       |
 1182|       |    /* If the match length is > 8 bytes, then continue with the wildcopy. */
 1183|  1.57M|    if (sequence.matchLength > 8) {
  ------------------
  |  Branch (1183:9): [True: 189k, False: 1.38M]
  ------------------
 1184|   189k|        assert(op < oMatchEnd);
  ------------------
  |  |   70|   189k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1185|   189k|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8, ZSTD_overlap_src_before_dst);
 1186|   189k|    }
 1187|  1.57M|    return sequenceLength;
 1188|  3.95M|}
zstd_decompress_block.c:ZSTD_execSequenceEndSplitLitBuffer:
  959|  53.2k|{
  960|  53.2k|    BYTE* const oLitEnd = op + sequence.litLength;
  961|  53.2k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
  962|  53.2k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
  963|  53.2k|    const BYTE* match = oLitEnd - sequence.offset;
  964|       |
  965|       |
  966|       |    /* bounds checks : careful of address space overflow in 32-bit mode */
  967|  53.2k|    RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, "last match must fit within dstBuffer");
  ------------------
  |  |  114|  53.2k|    do {                                                                       \
  |  |  115|  53.2k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 109, False: 53.0k]
  |  |  ------------------
  |  |  116|    109|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    109|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 109]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    109|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    109|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    109|    do {                                           \
  |  |  |  |   99|    109|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 109]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    109|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 109]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    109|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    109|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 109]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    109|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    109|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 109]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    109|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    109|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    109|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    109|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    109|        }                                                                      \
  |  |  123|  53.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 53.0k]
  |  |  ------------------
  ------------------
  968|  53.0k|    RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, "try to read beyond literal buffer");
  ------------------
  |  |  114|  53.0k|    do {                                                                       \
  |  |  115|  53.0k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 53.0k]
  |  |  ------------------
  |  |  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|  53.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 53.0k]
  |  |  ------------------
  ------------------
  969|  53.0k|    assert(op < op + sequenceLength);
  ------------------
  |  |   70|  53.0k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  970|  53.0k|    assert(oLitEnd < op + sequenceLength);
  ------------------
  |  |   70|  53.0k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  971|       |
  972|       |    /* copy literals */
  973|  53.0k|    RETURN_ERROR_IF(op > *litPtr && op < *litPtr + sequence.litLength, dstSize_tooSmall, "output should not catch up to and overwrite literal buffer");
  ------------------
  |  |  114|  53.0k|    do {                                                                       \
  |  |  115|   158k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 51.8k, False: 1.20k]
  |  |  |  Branch (115:13): [True: 20, False: 51.8k]
  |  |  ------------------
  |  |  116|     20|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     20|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     20|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     20|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     20|    do {                                           \
  |  |  |  |   99|     20|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     20|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     20|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     20|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     20|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     20|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     20|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     20|        }                                                                      \
  |  |  123|  53.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 53.0k]
  |  |  ------------------
  ------------------
  974|  53.0k|    ZSTD_safecopyDstBeforeSrc(op, *litPtr, sequence.litLength);
  975|  53.0k|    op = oLitEnd;
  976|  53.0k|    *litPtr = iLitEnd;
  977|       |
  978|       |    /* copy Match */
  979|  53.0k|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (979:9): [True: 122, False: 52.9k]
  ------------------
  980|       |        /* offset beyond prefix */
  981|    122|        RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, "");
  ------------------
  |  |  114|    122|    do {                                                                       \
  |  |  115|    122|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 62, False: 60]
  |  |  ------------------
  |  |  116|     62|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     62|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 62]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     62|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     62|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     62|    do {                                           \
  |  |  |  |   99|     62|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 62]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     62|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 62]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     62|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     62|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 62]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     62|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     62|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 62]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     62|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     62|        }                                                                      \
  |  |  123|    122|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 60]
  |  |  ------------------
  ------------------
  982|     60|        match = dictEnd - (prefixStart - match);
  983|     60|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (983:13): [True: 54, False: 6]
  ------------------
  984|     54|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|     54|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  985|     54|            return sequenceLength;
  986|     54|        }
  987|       |        /* span extDict & currentPrefixSegment */
  988|      6|        {   size_t const length1 = dictEnd - match;
  989|      6|        ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|      6|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  990|      6|        op = oLitEnd + length1;
  991|      6|        sequence.matchLength -= length1;
  992|      6|        match = prefixStart;
  993|      6|        }
  994|      6|    }
  995|  52.9k|    ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst);
  996|  52.9k|    return sequenceLength;
  997|  53.0k|}
zstd_decompress_block.c:ZSTD_decompressSequencesSplitLitBuffer:
 1956|    464|{
 1957|    464|    DEBUGLOG(5, "ZSTD_decompressSequencesSplitLitBuffer");
  ------------------
  |  |  104|    464|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 464]
  |  |  ------------------
  ------------------
 1958|    464|#if DYNAMIC_BMI2
 1959|    464|    if (ZSTD_DCtx_get_bmi2(dctx)) {
  ------------------
  |  Branch (1959:9): [True: 464, False: 0]
  ------------------
 1960|    464|        return ZSTD_decompressSequencesSplitLitBuffer_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1961|    464|    }
 1962|      0|#endif
 1963|      0|    return ZSTD_decompressSequencesSplitLitBuffer_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1964|    464|}
zstd_decompress_block.c:ZSTD_decompressSequencesSplitLitBuffer_bmi2:
 1920|    464|{
 1921|    464|    return ZSTD_decompressSequences_bodySplitLitBuffer(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1922|    464|}
zstd_decompress_block.c:ZSTD_decompressSequences_bodySplitLitBuffer:
 1407|    464|{
 1408|    464|    const BYTE* ip = (const BYTE*)seqStart;
 1409|    464|    const BYTE* const iend = ip + seqSize;
 1410|    464|    BYTE* const ostart = (BYTE*)dst;
 1411|    464|    BYTE* const oend = ZSTD_maybeNullPtrAdd(ostart, maxDstSize);
 1412|    464|    BYTE* op = ostart;
 1413|    464|    const BYTE* litPtr = dctx->litPtr;
 1414|    464|    const BYTE* litBufferEnd = dctx->litBufferEnd;
 1415|    464|    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);
 1416|    464|    const BYTE* const vBase = (const BYTE*) (dctx->virtualStart);
 1417|    464|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 1418|    464|    DEBUGLOG(5, "ZSTD_decompressSequences_bodySplitLitBuffer (%i seqs)", nbSeq);
  ------------------
  |  |  104|    464|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 464]
  |  |  ------------------
  ------------------
 1419|       |
 1420|       |    /* Literals are split between internal buffer & output buffer */
 1421|    464|    if (nbSeq) {
  ------------------
  |  Branch (1421:9): [True: 464, False: 0]
  ------------------
 1422|    464|        seqState_t seqState;
 1423|    464|        dctx->fseEntropy = 1;
 1424|  1.85k|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  1.85k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1424:28): [True: 1.39k, False: 464]
  ------------------
 1425|    464|        RETURN_ERROR_IF(
  ------------------
  |  |  114|    464|    do {                                                                       \
  |  |  115|    464|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 27, False: 437]
  |  |  ------------------
  |  |  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|    464|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 437]
  |  |  ------------------
  ------------------
 1426|    464|            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)),
 1427|    464|            corruption_detected, "");
 1428|    437|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1429|    437|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1430|    437|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1431|    437|        assert(dst != NULL);
  ------------------
  |  |   70|    437|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1432|       |
 1433|    437|        ZSTD_STATIC_ASSERT(
  ------------------
  |  |   43|    437|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|    437|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1434|    437|                BIT_DStream_unfinished < BIT_DStream_completed &&
 1435|    437|                BIT_DStream_endOfBuffer < BIT_DStream_completed &&
 1436|    437|                BIT_DStream_completed < BIT_DStream_overflow);
 1437|       |
 1438|       |        /* decompress without overrunning litPtr begins */
 1439|    437|        {   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|    437|#if defined(__GNUC__) && defined(__x86_64__)
 1485|    437|            __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|    437|#endif
 1499|       |
 1500|       |            /* Handle the initial state where litBuffer is currently split between dst and litExtraBuffer */
 1501|  2.20M|            for ( ; nbSeq; nbSeq--) {
  ------------------
  |  Branch (1501:21): [True: 2.20M, False: 1]
  ------------------
 1502|  2.20M|                sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1503|  2.20M|                if (litPtr + sequence.litLength > dctx->litBufferEnd) break;
  ------------------
  |  Branch (1503:21): [True: 268, False: 2.20M]
  ------------------
 1504|  2.20M|                {   size_t const oneSeqSize = ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence.litLength - WILDCOPY_OVERLENGTH, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd);
  ------------------
  |  |  199|  2.20M|#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|  2.20M|                    if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|  2.20M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 168, False: 2.20M]
  |  |  ------------------
  ------------------
 1510|    168|                        return oneSeqSize;
 1511|  2.20M|                    DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|  2.20M|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.20M]
  |  |  ------------------
  ------------------
 1512|  2.20M|                    op += oneSeqSize;
 1513|  2.20M|            }   }
 1514|    269|            DEBUGLOG(6, "reached: (litPtr + sequence.litLength > dctx->litBufferEnd)");
  ------------------
  |  |  104|    269|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 269]
  |  |  ------------------
  ------------------
 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|    269|            if (nbSeq > 0) {
  ------------------
  |  Branch (1517:17): [True: 268, False: 1]
  ------------------
 1518|    268|                const size_t leftoverLit = dctx->litBufferEnd - litPtr;
 1519|    268|                DEBUGLOG(6, "There are %i sequences left, and %zu/%zu literals left in buffer", nbSeq, leftoverLit, sequence.litLength);
  ------------------
  |  |  104|    268|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 268]
  |  |  ------------------
  ------------------
 1520|    268|                if (leftoverLit) {
  ------------------
  |  Branch (1520:21): [True: 249, False: 19]
  ------------------
 1521|    249|                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer");
  ------------------
  |  |  114|    249|    do {                                                                       \
  |  |  115|    249|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 7, False: 242]
  |  |  ------------------
  |  |  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|    249|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 242]
  |  |  ------------------
  ------------------
 1522|    242|                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);
 1523|    242|                    sequence.litLength -= leftoverLit;
 1524|    242|                    op += leftoverLit;
 1525|    242|                }
 1526|    261|                litPtr = dctx->litExtraBuffer;
 1527|    261|                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    261|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    261|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|    522|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 261]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 261, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1528|    261|                dctx->litBufferLocation = ZSTD_not_in_dst;
 1529|    261|                {   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|    261|                    if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|    261|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 51, False: 210]
  |  |  ------------------
  ------------------
 1535|     51|                        return oneSeqSize;
 1536|    210|                    DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|    210|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 210]
  |  |  ------------------
  ------------------
 1537|    210|                    op += oneSeqSize;
 1538|    210|                }
 1539|      0|                nbSeq--;
 1540|    210|            }
 1541|    269|        }
 1542|       |
 1543|    211|        if (nbSeq > 0) {
  ------------------
  |  Branch (1543:13): [True: 209, False: 2]
  ------------------
 1544|       |            /* there is remaining lit from extra buffer */
 1545|       |
 1546|    209|#if defined(__GNUC__) && defined(__x86_64__)
 1547|    209|            __asm__(".p2align 6");
 1548|    209|            __asm__("nop");
 1549|    209|#  if __GNUC__ != 7
 1550|       |            /* worse for gcc-7 better for gcc-8, gcc-9, and gcc-10 and clang */
 1551|    209|            __asm__(".p2align 4");
 1552|    209|            __asm__("nop");
 1553|    209|            __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|    209|#endif
 1562|       |
 1563|   158k|            for ( ; nbSeq ; nbSeq--) {
  ------------------
  |  Branch (1563:21): [True: 158k, False: 2]
  ------------------
 1564|   158k|                seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1565|   158k|                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|   158k|                if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|   158k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 207, False: 157k]
  |  |  ------------------
  ------------------
 1571|    207|                    return oneSeqSize;
 1572|   157k|                DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|   157k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 157k]
  |  |  ------------------
  ------------------
 1573|   157k|                op += oneSeqSize;
 1574|   157k|            }
 1575|    209|        }
 1576|       |
 1577|       |        /* check if reached exact end */
 1578|      4|        DEBUGLOG(5, "ZSTD_decompressSequences_bodySplitLitBuffer: after decode loop, remaining nbSeq : %i", nbSeq);
  ------------------
  |  |  104|      4|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 4]
  |  |  ------------------
  ------------------
 1579|      4|        RETURN_ERROR_IF(nbSeq, corruption_detected, "");
  ------------------
  |  |  114|      4|    do {                                                                       \
  |  |  115|      4|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 4]
  |  |  ------------------
  |  |  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|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4]
  |  |  ------------------
  ------------------
 1580|      4|        DEBUGLOG(5, "bitStream : start=%p, ptr=%p, bitsConsumed=%u", seqState.DStream.start, seqState.DStream.ptr, seqState.DStream.bitsConsumed);
  ------------------
  |  |  104|      4|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 4]
  |  |  ------------------
  ------------------
 1581|      4|        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, "");
  ------------------
  |  |  114|      4|    do {                                                                       \
  |  |  115|      4|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4, False: 0]
  |  |  ------------------
  |  |  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|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1582|       |        /* save reps for next block */
 1583|      0|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  |   64|      0|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1583:28): [True: 0, False: 0]
  ------------------
 1584|      0|    }
 1585|       |
 1586|       |    /* last literal segment */
 1587|      0|    if (dctx->litBufferLocation == ZSTD_split) {
  ------------------
  |  Branch (1587:9): [True: 0, False: 0]
  ------------------
 1588|       |        /* split hasn't been reached yet, first get dst then copy litExtraBuffer */
 1589|      0|        size_t const lastLLSize = (size_t)(litBufferEnd - litPtr);
 1590|      0|        DEBUGLOG(6, "copy last literals from segment : %u", (U32)lastLLSize);
  ------------------
  |  |  104|      0|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1591|      0|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend - op), dstSize_tooSmall, "");
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 1592|      0|        if (op != NULL) {
  ------------------
  |  Branch (1592:13): [True: 0, False: 0]
  ------------------
 1593|      0|            ZSTD_memmove(op, litPtr, lastLLSize);
  ------------------
  |  |   45|      0|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1594|      0|            op += lastLLSize;
 1595|      0|        }
 1596|      0|        litPtr = dctx->litExtraBuffer;
 1597|      0|        litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|      0|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|      0|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      0|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 0, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1598|      0|        dctx->litBufferLocation = ZSTD_not_in_dst;
 1599|      0|    }
 1600|       |    /* copy last literals from internal buffer */
 1601|      0|    {   size_t const lastLLSize = (size_t)(litBufferEnd - litPtr);
 1602|      0|        DEBUGLOG(6, "copy last literals from internal buffer : %u", (U32)lastLLSize);
  ------------------
  |  |  104|      0|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1603|      0|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, "");
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 1604|      0|        if (op != NULL) {
  ------------------
  |  Branch (1604:13): [True: 0, False: 0]
  ------------------
 1605|      0|            ZSTD_memcpy(op, litPtr, lastLLSize);
  ------------------
  |  |   44|      0|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1606|      0|            op += lastLLSize;
 1607|      0|    }   }
 1608|       |
 1609|      0|    DEBUGLOG(6, "decoded block of size %u bytes", (U32)(op - ostart));
  ------------------
  |  |  104|      0|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1610|      0|    return (size_t)(op - ostart);
 1611|      0|}
zstd_decompress_block.c:ZSTD_decompressSequences:
 1943|  6.99k|{
 1944|  6.99k|    DEBUGLOG(5, "ZSTD_decompressSequences");
  ------------------
  |  |  104|  6.99k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 6.99k]
  |  |  ------------------
  ------------------
 1945|  6.99k|#if DYNAMIC_BMI2
 1946|  6.99k|    if (ZSTD_DCtx_get_bmi2(dctx)) {
  ------------------
  |  Branch (1946:9): [True: 6.99k, False: 0]
  ------------------
 1947|  6.99k|        return ZSTD_decompressSequences_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1948|  6.99k|    }
 1949|      0|#endif
 1950|      0|    return ZSTD_decompressSequences_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1951|  6.99k|}
zstd_decompress_block.c:ZSTD_decompressSequences_bmi2:
 1911|  6.99k|{
 1912|  6.99k|    return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1913|  6.99k|}
zstd_decompress_block.c:ZSTD_decompressSequences_body:
 1619|  6.99k|{
 1620|  6.99k|    const BYTE* ip = (const BYTE*)seqStart;
 1621|  6.99k|    const BYTE* const iend = ip + seqSize;
 1622|  6.99k|    BYTE* const ostart = (BYTE*)dst;
 1623|  6.99k|    BYTE* const oend = dctx->litBufferLocation == ZSTD_not_in_dst ? ZSTD_maybeNullPtrAdd(ostart, maxDstSize) : dctx->litBuffer;
  ------------------
  |  Branch (1623:24): [True: 4.17k, False: 2.82k]
  ------------------
 1624|  6.99k|    BYTE* op = ostart;
 1625|  6.99k|    const BYTE* litPtr = dctx->litPtr;
 1626|  6.99k|    const BYTE* const litEnd = litPtr + dctx->litSize;
 1627|  6.99k|    const BYTE* const prefixStart = (const BYTE*)(dctx->prefixStart);
 1628|  6.99k|    const BYTE* const vBase = (const BYTE*)(dctx->virtualStart);
 1629|  6.99k|    const BYTE* const dictEnd = (const BYTE*)(dctx->dictEnd);
 1630|  6.99k|    DEBUGLOG(5, "ZSTD_decompressSequences_body: nbSeq = %d", nbSeq);
  ------------------
  |  |  104|  6.99k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 6.99k]
  |  |  ------------------
  ------------------
 1631|       |
 1632|       |    /* Regen sequences */
 1633|  6.99k|    if (nbSeq) {
  ------------------
  |  Branch (1633:9): [True: 3.08k, False: 3.91k]
  ------------------
 1634|  3.08k|        seqState_t seqState;
 1635|  3.08k|        dctx->fseEntropy = 1;
 1636|  12.3k|        { U32 i; for (i = 0; i < ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  12.3k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1636:30): [True: 9.26k, False: 3.08k]
  ------------------
 1637|  3.08k|        RETURN_ERROR_IF(
  ------------------
  |  |  114|  3.08k|    do {                                                                       \
  |  |  115|  3.08k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 93, False: 2.99k]
  |  |  ------------------
  |  |  116|     93|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     93|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 93]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     93|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     93|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     93|    do {                                           \
  |  |  |  |   99|     93|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 93]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     93|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 93]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     93|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     93|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 93]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     93|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     93|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 93]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     93|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     93|        }                                                                      \
  |  |  123|  3.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
 1638|  3.08k|            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend - ip)),
 1639|  3.08k|            corruption_detected, "");
 1640|  2.99k|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1641|  2.99k|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1642|  2.99k|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1643|  2.99k|        assert(dst != NULL);
  ------------------
  |  |   70|  2.99k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1644|       |
 1645|  2.99k|#if defined(__GNUC__) && defined(__x86_64__)
 1646|  2.99k|            __asm__(".p2align 6");
 1647|  2.99k|            __asm__("nop");
 1648|       |#  if __GNUC__ >= 7
 1649|       |            __asm__(".p2align 5");
 1650|       |            __asm__("nop");
 1651|       |            __asm__(".p2align 3");
 1652|       |#  else
 1653|  2.99k|            __asm__(".p2align 4");
 1654|  2.99k|            __asm__("nop");
 1655|  2.99k|            __asm__(".p2align 3");
 1656|  2.99k|#  endif
 1657|  2.99k|#endif
 1658|       |
 1659|   144k|        for ( ; nbSeq ; nbSeq--) {
  ------------------
  |  Branch (1659:17): [True: 142k, False: 2.49k]
  ------------------
 1660|   142k|            seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1661|   142k|            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|   142k|            if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|   142k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 499, False: 141k]
  |  |  ------------------
  ------------------
 1667|    499|                return oneSeqSize;
 1668|   141k|            DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|   141k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 141k]
  |  |  ------------------
  ------------------
 1669|   141k|            op += oneSeqSize;
 1670|   141k|        }
 1671|       |
 1672|       |        /* check if reached exact end */
 1673|  2.49k|        assert(nbSeq == 0);
  ------------------
  |  |   70|  2.49k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1674|  2.49k|        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, "");
  ------------------
  |  |  114|  2.49k|    do {                                                                       \
  |  |  115|  2.49k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 31, False: 2.46k]
  |  |  ------------------
  |  |  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|  2.49k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.46k]
  |  |  ------------------
  ------------------
 1675|       |        /* save reps for next block */
 1676|  9.85k|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  |   64|  9.85k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1676:28): [True: 7.39k, False: 2.46k]
  ------------------
 1677|  2.46k|    }
 1678|       |
 1679|       |    /* last literal segment */
 1680|  6.37k|    {   size_t const lastLLSize = (size_t)(litEnd - litPtr);
 1681|  6.37k|        DEBUGLOG(6, "copy last literals : %u", (U32)lastLLSize);
  ------------------
  |  |  104|  6.37k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 6.37k]
  |  |  ------------------
  ------------------
 1682|  6.37k|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, "");
  ------------------
  |  |  114|  6.37k|    do {                                                                       \
  |  |  115|  6.37k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 25, False: 6.34k]
  |  |  ------------------
  |  |  116|     25|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     25|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 25]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     25|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     25|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     25|    do {                                           \
  |  |  |  |   99|     25|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 25]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     25|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 25]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     25|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     25|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 25]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     25|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     25|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 25]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     25|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     25|        }                                                                      \
  |  |  123|  6.37k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 6.34k]
  |  |  ------------------
  ------------------
 1683|  6.34k|        if (op != NULL) {
  ------------------
  |  Branch (1683:13): [True: 6.34k, False: 0]
  ------------------
 1684|  6.34k|            ZSTD_memcpy(op, litPtr, lastLLSize);
  ------------------
  |  |   44|  6.34k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1685|  6.34k|            op += lastLLSize;
 1686|  6.34k|    }   }
 1687|       |
 1688|  6.34k|    DEBUGLOG(6, "decoded block of size %u bytes", (U32)(op - ostart));
  ------------------
  |  |  104|  6.34k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 6.34k]
  |  |  ------------------
  ------------------
 1689|  6.34k|    return (size_t)(op - ostart);
 1690|  6.37k|}

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

zstd_decompress.c:ZSTD_isLegacy:
   57|  74.1k|{
   58|  74.1k|    U32 magicNumberLE;
   59|  74.1k|    if (srcSize<4) return 0;
  ------------------
  |  Branch (59:9): [True: 0, False: 74.1k]
  ------------------
   60|  74.1k|    magicNumberLE = MEM_readLE32(src);
   61|  74.1k|    switch(magicNumberLE)
   62|  74.1k|    {
   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|  21.4k|        case ZSTDv05_MAGICNUMBER : return 5;
  ------------------
  |  |  153|  21.4k|#define ZSTDv05_MAGICNUMBER 0xFD2FB525   /* v0.5 */
  ------------------
  |  Branch (76:9): [True: 21.4k, False: 52.7k]
  ------------------
   77|      0|#endif
   78|      0|#if (ZSTD_LEGACY_SUPPORT <= 6)
   79|  30.4k|        case ZSTDv06_MAGICNUMBER : return 6;
  ------------------
  |  |  164|  30.4k|#define ZSTDv06_MAGICNUMBER 0xFD2FB526   /* v0.6 */
  ------------------
  |  Branch (79:9): [True: 30.4k, False: 43.6k]
  ------------------
   80|      0|#endif
   81|      0|#if (ZSTD_LEGACY_SUPPORT <= 7)
   82|  7.92k|        case ZSTDv07_MAGICNUMBER : return 7;
  ------------------
  |  |  180|  7.92k|#define ZSTDv07_MAGICNUMBER            0xFD2FB527   /* v0.7 */
  ------------------
  |  Branch (82:9): [True: 7.92k, False: 66.2k]
  ------------------
   83|      0|#endif
   84|  14.3k|        default : return 0;
  ------------------
  |  Branch (84:9): [True: 14.3k, False: 59.7k]
  ------------------
   85|  74.1k|    }
   86|  74.1k|}
zstd_decompress.c:ZSTD_getDecompressedSize_legacy:
   90|  8.94k|{
   91|  8.94k|    U32 const version = ZSTD_isLegacy(src, srcSize);
   92|  8.94k|    if (version < 5) return 0;  /* no decompressed size in frame header, or not a legacy format */
  ------------------
  |  Branch (92:9): [True: 0, False: 8.94k]
  ------------------
   93|  8.94k|#if (ZSTD_LEGACY_SUPPORT <= 5)
   94|  8.94k|    if (version==5) {
  ------------------
  |  Branch (94:9): [True: 3.27k, False: 5.66k]
  ------------------
   95|  3.27k|        ZSTDv05_parameters fParams;
   96|  3.27k|        size_t const frResult = ZSTDv05_getFrameParams(&fParams, src, srcSize);
   97|  3.27k|        if (frResult != 0) return 0;
  ------------------
  |  Branch (97:13): [True: 0, False: 3.27k]
  ------------------
   98|  3.27k|        return fParams.srcSize;
   99|  3.27k|    }
  100|  5.66k|#endif
  101|  5.66k|#if (ZSTD_LEGACY_SUPPORT <= 6)
  102|  5.66k|    if (version==6) {
  ------------------
  |  Branch (102:9): [True: 5.09k, False: 570]
  ------------------
  103|  5.09k|        ZSTDv06_frameParams fParams;
  104|  5.09k|        size_t const frResult = ZSTDv06_getFrameParams(&fParams, src, srcSize);
  105|  5.09k|        if (frResult != 0) return 0;
  ------------------
  |  Branch (105:13): [True: 0, False: 5.09k]
  ------------------
  106|  5.09k|        return fParams.frameContentSize;
  107|  5.09k|    }
  108|    570|#endif
  109|    570|#if (ZSTD_LEGACY_SUPPORT <= 7)
  110|    570|    if (version==7) {
  ------------------
  |  Branch (110:9): [True: 570, False: 0]
  ------------------
  111|    570|        ZSTDv07_frameParams fParams;
  112|    570|        size_t const frResult = ZSTDv07_getFrameParams(&fParams, src, srcSize);
  113|    570|        if (frResult != 0) return 0;
  ------------------
  |  Branch (113:13): [True: 0, False: 570]
  ------------------
  114|    570|        return fParams.frameContentSize;
  115|    570|    }
  116|      0|#endif
  117|      0|    return 0;   /* should not be possible */
  118|    570|}
zstd_decompress.c:ZSTD_findFrameSizeInfoLegacy:
  196|  14.0k|{
  197|  14.0k|    ZSTD_frameSizeInfo frameSizeInfo;
  198|  14.0k|    U32 const version = ZSTD_isLegacy(src, srcSize);
  199|  14.0k|    switch(version)
  200|  14.0k|    {
  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|  4.98k|        case 5 :
  ------------------
  |  Branch (230:9): [True: 4.98k, False: 9.07k]
  ------------------
  231|  4.98k|            ZSTDv05_findFrameSizeInfoLegacy(src, srcSize,
  232|  4.98k|                &frameSizeInfo.compressedSize,
  233|  4.98k|                &frameSizeInfo.decompressedBound);
  234|  4.98k|            break;
  235|      0|#endif
  236|      0|#if (ZSTD_LEGACY_SUPPORT <= 6)
  237|  6.78k|        case 6 :
  ------------------
  |  Branch (237:9): [True: 6.78k, False: 7.27k]
  ------------------
  238|  6.78k|            ZSTDv06_findFrameSizeInfoLegacy(src, srcSize,
  239|  6.78k|                &frameSizeInfo.compressedSize,
  240|  6.78k|                &frameSizeInfo.decompressedBound);
  241|  6.78k|            break;
  242|      0|#endif
  243|      0|#if (ZSTD_LEGACY_SUPPORT <= 7)
  244|  2.28k|        case 7 :
  ------------------
  |  Branch (244:9): [True: 2.28k, False: 11.7k]
  ------------------
  245|  2.28k|            ZSTDv07_findFrameSizeInfoLegacy(src, srcSize,
  246|  2.28k|                &frameSizeInfo.compressedSize,
  247|  2.28k|                &frameSizeInfo.decompressedBound);
  248|  2.28k|            break;
  249|      0|#endif
  250|      0|        default :
  ------------------
  |  Branch (250:9): [True: 0, False: 14.0k]
  ------------------
  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|  14.0k|    }
  255|  14.0k|    if (!ZSTD_isError(frameSizeInfo.compressedSize) && frameSizeInfo.compressedSize > srcSize) {
  ------------------
  |  |   44|  14.0k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (255:9): [True: 13.7k, False: 260]
  |  Branch (255:56): [True: 0, False: 13.7k]
  ------------------
  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|  14.0k|    if (frameSizeInfo.decompressedBound != ZSTD_CONTENTSIZE_ERROR) {
  ------------------
  |  |  204|  14.0k|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
  |  Branch (262:9): [True: 13.7k, False: 260]
  ------------------
  263|  13.7k|        assert((frameSizeInfo.decompressedBound & (ZSTD_BLOCKSIZE_MAX - 1)) == 0);
  ------------------
  |  |   70|  13.7k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  264|  13.7k|        frameSizeInfo.nbBlocks = (size_t)(frameSizeInfo.decompressedBound / ZSTD_BLOCKSIZE_MAX);
  ------------------
  |  |  148|  13.7k|#define ZSTD_BLOCKSIZE_MAX     (1<<ZSTD_BLOCKSIZELOG_MAX)
  |  |  ------------------
  |  |  |  |  147|  13.7k|#define ZSTD_BLOCKSIZELOG_MAX  17
  |  |  ------------------
  ------------------
  265|  13.7k|    }
  266|  14.0k|    return frameSizeInfo;
  267|  14.0k|}
zstd_decompress.c:ZSTD_findFrameCompressedSizeLegacy:
  270|  14.0k|{
  271|  14.0k|    ZSTD_frameSizeInfo frameSizeInfo = ZSTD_findFrameSizeInfoLegacy(src, srcSize);
  272|  14.0k|    return frameSizeInfo.compressedSize;
  273|  14.0k|}
zstd_decompress.c:ZSTD_decompressLegacy:
  125|  13.7k|{
  126|  13.7k|    U32 const version = ZSTD_isLegacy(src, compressedSize);
  127|  13.7k|    char x;
  128|       |    /* Avoid passing NULL to legacy decoding. */
  129|  13.7k|    if (dst == NULL) {
  ------------------
  |  Branch (129:9): [True: 0, False: 13.7k]
  ------------------
  130|      0|        assert(dstCapacity == 0);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  131|      0|        dst = &x;
  132|      0|    }
  133|  13.7k|    if (src == NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 13.7k]
  ------------------
  134|      0|        assert(compressedSize == 0);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  135|      0|        src = &x;
  136|      0|    }
  137|  13.7k|    if (dict == NULL) {
  ------------------
  |  Branch (137:9): [True: 5.04k, False: 8.74k]
  ------------------
  138|  5.04k|        assert(dictSize == 0);
  ------------------
  |  |   70|  5.04k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  139|  5.04k|        dict = &x;
  140|  5.04k|    }
  141|  13.7k|    (void)dst; (void)dstCapacity; (void)dict; (void)dictSize;  /* unused when ZSTD_LEGACY_SUPPORT >= 8 */
  142|  13.7k|    switch(version)
  143|  13.7k|    {
  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|  4.89k|        case 5 :
  ------------------
  |  Branch (161:9): [True: 4.89k, False: 8.90k]
  ------------------
  162|  4.89k|            {   size_t result;
  163|  4.89k|                ZSTDv05_DCtx* const zd = ZSTDv05_createDCtx();
  164|  4.89k|                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: 4.89k]
  ------------------
  165|  4.89k|                result = ZSTDv05_decompress_usingDict(zd, dst, dstCapacity, src, compressedSize, dict, dictSize);
  166|  4.89k|                ZSTDv05_freeDCtx(zd);
  167|  4.89k|                return result;
  168|  4.89k|            }
  169|      0|#endif
  170|      0|#if (ZSTD_LEGACY_SUPPORT <= 6)
  171|  6.68k|        case 6 :
  ------------------
  |  Branch (171:9): [True: 6.68k, False: 7.10k]
  ------------------
  172|  6.68k|            {   size_t result;
  173|  6.68k|                ZSTDv06_DCtx* const zd = ZSTDv06_createDCtx();
  174|  6.68k|                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: 6.68k]
  ------------------
  175|  6.68k|                result = ZSTDv06_decompress_usingDict(zd, dst, dstCapacity, src, compressedSize, dict, dictSize);
  176|  6.68k|                ZSTDv06_freeDCtx(zd);
  177|  6.68k|                return result;
  178|  6.68k|            }
  179|      0|#endif
  180|      0|#if (ZSTD_LEGACY_SUPPORT <= 7)
  181|  2.21k|        case 7 :
  ------------------
  |  Branch (181:9): [True: 2.21k, False: 11.5k]
  ------------------
  182|  2.21k|            {   size_t result;
  183|  2.21k|                ZSTDv07_DCtx* const zd = ZSTDv07_createDCtx();
  184|  2.21k|                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: 2.21k]
  ------------------
  185|  2.21k|                result = ZSTDv07_decompress_usingDict(zd, dst, dstCapacity, src, compressedSize, dict, dictSize);
  186|  2.21k|                ZSTDv07_freeDCtx(zd);
  187|  2.21k|                return result;
  188|  2.21k|            }
  189|      0|#endif
  190|      0|        default :
  ------------------
  |  Branch (190:9): [True: 0, False: 13.7k]
  ------------------
  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|  13.7k|    }
  193|  13.7k|}

FSEv05_buildDTable:
 1158|  3.80k|{
 1159|  3.80k|    FSEv05_DTableHeader DTableH;
 1160|  3.80k|    void* const tdPtr = dt+1;   /* because dt is unsigned, 32-bits aligned on 32-bits */
 1161|  3.80k|    FSEv05_DECODE_TYPE* const tableDecode = (FSEv05_DECODE_TYPE*) (tdPtr);
  ------------------
  |  | 1056|  3.80k|#define FSEv05_DECODE_TYPE FSEv05_decode_t
  ------------------
 1162|  3.80k|    const U32 tableSize = 1 << tableLog;
 1163|  3.80k|    const U32 tableMask = tableSize-1;
 1164|  3.80k|    const U32 step = FSEv05_tableStep(tableSize);
 1165|  3.80k|    U16 symbolNext[FSEv05_MAX_SYMBOL_VALUE+1];
 1166|  3.80k|    U32 position = 0;
 1167|  3.80k|    U32 highThreshold = tableSize-1;
 1168|  3.80k|    const S16 largeLimit= (S16)(1 << (tableLog-1));
 1169|  3.80k|    U32 noLarge = 1;
 1170|  3.80k|    U32 s;
 1171|       |
 1172|       |    /* Sanity Checks */
 1173|  3.80k|    if (maxSymbolValue > FSEv05_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  | 1048|  3.80k|#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: 3.80k]
  ------------------
 1174|  3.80k|    if (tableLog > FSEv05_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1094|  3.80k|#define FSEv05_MAX_TABLELOG  (FSEv05_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1042|  3.80k|#define FSEv05_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
                  if (tableLog > FSEv05_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   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 (1174:9): [True: 42, False: 3.75k]
  ------------------
 1175|       |
 1176|       |    /* Init, lay down lowprob symbols */
 1177|  3.75k|    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|  3.75k|    DTableH.tableLog = (U16)tableLog;
 1179|  81.8k|    for (s=0; s<=maxSymbolValue; s++) {
  ------------------
  |  Branch (1179:15): [True: 78.0k, False: 3.75k]
  ------------------
 1180|  78.0k|        if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (1180:13): [True: 34.1k, False: 43.9k]
  ------------------
 1181|  34.1k|            tableDecode[highThreshold--].symbol = (FSEv05_FUNCTION_TYPE)s;
 1182|  34.1k|            symbolNext[s] = 1;
 1183|  43.9k|        } else {
 1184|  43.9k|            if (normalizedCounter[s] >= largeLimit) noLarge=0;
  ------------------
  |  Branch (1184:17): [True: 1.89k, False: 42.0k]
  ------------------
 1185|  43.9k|            symbolNext[s] = normalizedCounter[s];
 1186|  43.9k|    }   }
 1187|       |
 1188|       |    /* Spread symbols */
 1189|  81.8k|    for (s=0; s<=maxSymbolValue; s++) {
  ------------------
  |  Branch (1189:15): [True: 78.0k, False: 3.75k]
  ------------------
 1190|  78.0k|        int i;
 1191|  2.70M|        for (i=0; i<normalizedCounter[s]; i++) {
  ------------------
  |  Branch (1191:19): [True: 2.62M, False: 78.0k]
  ------------------
 1192|  2.62M|            tableDecode[position].symbol = (FSEv05_FUNCTION_TYPE)s;
 1193|  2.62M|            position = (position + step) & tableMask;
 1194|  2.65M|            while (position > highThreshold) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  Branch (1194:20): [True: 33.0k, False: 2.62M]
  ------------------
 1195|  2.62M|    }   }
 1196|       |
 1197|  3.75k|    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: 3.75k]
  ------------------
 1198|       |
 1199|       |    /* Build Decoding table */
 1200|  3.75k|    {
 1201|  3.75k|        U32 i;
 1202|  2.66M|        for (i=0; i<tableSize; i++) {
  ------------------
  |  Branch (1202:19): [True: 2.65M, False: 3.75k]
  ------------------
 1203|  2.65M|            FSEv05_FUNCTION_TYPE symbol = (FSEv05_FUNCTION_TYPE)(tableDecode[i].symbol);
  ------------------
  |  | 1054|  2.65M|#define FSEv05_FUNCTION_TYPE BYTE
  ------------------
 1204|  2.65M|            U16 nextState = symbolNext[symbol]++;
 1205|  2.65M|            tableDecode[i].nbBits = (BYTE) (tableLog - BITv05_highbit32 ((U32)nextState) );
 1206|  2.65M|            tableDecode[i].newState = (U16) ( (nextState << tableDecode[i].nbBits) - tableSize);
 1207|  2.65M|    }   }
 1208|       |
 1209|  3.75k|    DTableH.fastMode = (U16)noLarge;
 1210|  3.75k|    memcpy(dt, &DTableH, sizeof(DTableH));
 1211|  3.75k|    return 0;
 1212|  3.75k|}
FSEv05_isError:
 1219|  11.4k|unsigned FSEv05_isError(size_t code) { return ERR_isError(code); }
FSEv05_readNCount:
 1232|  4.42k|{
 1233|  4.42k|    const BYTE* const istart = (const BYTE*) headerBuffer;
 1234|  4.42k|    const BYTE* const iend = istart + hbSize;
 1235|  4.42k|    const BYTE* ip = istart;
 1236|  4.42k|    int nbBits;
 1237|  4.42k|    int remaining;
 1238|  4.42k|    int threshold;
 1239|  4.42k|    U32 bitStream;
 1240|  4.42k|    int bitCount;
 1241|  4.42k|    unsigned charnum = 0;
 1242|  4.42k|    int previous0 = 0;
 1243|       |
 1244|  4.42k|    if (hbSize < 4) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     92|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     92|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     92|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1244:9): [True: 92, False: 4.32k]
  ------------------
 1245|  4.32k|    bitStream = MEM_readLE32(ip);
 1246|  4.32k|    nbBits = (bitStream & 0xF) + FSEv05_MIN_TABLELOG;   /* extract tableLog */
  ------------------
  |  | 1098|  4.32k|#define FSEv05_MIN_TABLELOG 5
  ------------------
 1247|  4.32k|    if (nbBits > FSEv05_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1100|  4.32k|#define FSEv05_TABLELOG_ABSOLUTE_MAX 15
  ------------------
                  if (nbBits > FSEv05_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|    127|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    127|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    127|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1247:9): [True: 127, False: 4.20k]
  ------------------
 1248|  4.20k|    bitStream >>= 4;
 1249|  4.20k|    bitCount = 4;
 1250|  4.20k|    *tableLogPtr = nbBits;
 1251|  4.20k|    remaining = (1<<nbBits)+1;
 1252|  4.20k|    threshold = 1<<nbBits;
 1253|  4.20k|    nbBits++;
 1254|       |
 1255|  78.3k|    while ((remaining>1) && (charnum<=*maxSVPtr)) {
  ------------------
  |  Branch (1255:12): [True: 74.2k, False: 4.08k]
  |  Branch (1255:29): [True: 74.1k, False: 41]
  ------------------
 1256|  74.1k|        if (previous0) {
  ------------------
  |  Branch (1256:13): [True: 5.72k, False: 68.4k]
  ------------------
 1257|  5.72k|            unsigned n0 = charnum;
 1258|  6.69k|            while ((bitStream & 0xFFFF) == 0xFFFF) {
  ------------------
  |  Branch (1258:20): [True: 970, False: 5.72k]
  ------------------
 1259|    970|                n0+=24;
 1260|    970|                if (ip < iend-5) {
  ------------------
  |  Branch (1260:21): [True: 680, False: 290]
  ------------------
 1261|    680|                    ip+=2;
 1262|    680|                    bitStream = MEM_readLE32(ip) >> bitCount;
 1263|    680|                } else {
 1264|    290|                    bitStream >>= 16;
 1265|    290|                    bitCount+=16;
 1266|    290|            }   }
 1267|  8.20k|            while ((bitStream & 3) == 3) {
  ------------------
  |  Branch (1267:20): [True: 2.48k, False: 5.72k]
  ------------------
 1268|  2.48k|                n0+=3;
 1269|  2.48k|                bitStream>>=2;
 1270|  2.48k|                bitCount+=2;
 1271|  2.48k|            }
 1272|  5.72k|            n0 += bitStream & 3;
 1273|  5.72k|            bitCount += 2;
 1274|  5.72k|            if (n0 > *maxSVPtr) return ERROR(maxSymbolValue_tooSmall);
  ------------------
  |  |   49|     80|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     80|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     80|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1274:17): [True: 80, False: 5.64k]
  ------------------
 1275|  34.8k|            while (charnum < n0) normalizedCounter[charnum++] = 0;
  ------------------
  |  Branch (1275:20): [True: 29.1k, False: 5.64k]
  ------------------
 1276|  5.64k|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1276:17): [True: 3.92k, False: 1.71k]
  |  Branch (1276:35): [True: 259, False: 1.45k]
  ------------------
 1277|  4.18k|                ip += bitCount>>3;
 1278|  4.18k|                bitCount &= 7;
 1279|  4.18k|                bitStream = MEM_readLE32(ip) >> bitCount;
 1280|  4.18k|            }
 1281|  1.45k|            else
 1282|  1.45k|                bitStream >>= 2;
 1283|  5.64k|        }
 1284|  74.1k|        {
 1285|  74.1k|            const short max = (short)((2*threshold-1)-remaining);
 1286|  74.1k|            short count;
 1287|       |
 1288|  74.1k|            if ((bitStream & (threshold-1)) < (U32)max) {
  ------------------
  |  Branch (1288:17): [True: 56.3k, False: 17.7k]
  ------------------
 1289|  56.3k|                count = (short)(bitStream & (threshold-1));
 1290|  56.3k|                bitCount   += nbBits-1;
 1291|  56.3k|            } else {
 1292|  17.7k|                count = (short)(bitStream & (2*threshold-1));
 1293|  17.7k|                if (count >= threshold) count -= max;
  ------------------
  |  Branch (1293:21): [True: 6.36k, False: 11.4k]
  ------------------
 1294|  17.7k|                bitCount   += nbBits;
 1295|  17.7k|            }
 1296|       |
 1297|  74.1k|            count--;   /* extra accuracy */
 1298|  74.1k|            remaining -= FSEv05_abs(count);
 1299|  74.1k|            normalizedCounter[charnum++] = count;
 1300|  74.1k|            previous0 = !count;
 1301|   105k|            while (remaining < threshold) {
  ------------------
  |  Branch (1301:20): [True: 31.6k, False: 74.1k]
  ------------------
 1302|  31.6k|                nbBits--;
 1303|  31.6k|                threshold >>= 1;
 1304|  31.6k|            }
 1305|       |
 1306|  74.1k|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1306:17): [True: 61.4k, False: 12.6k]
  |  Branch (1306:35): [True: 2.91k, False: 9.76k]
  ------------------
 1307|  64.3k|                ip += bitCount>>3;
 1308|  64.3k|                bitCount &= 7;
 1309|  64.3k|            } else {
 1310|  9.76k|                bitCount -= (int)(8 * (iend - 4 - ip));
 1311|  9.76k|                ip = iend - 4;
 1312|  9.76k|            }
 1313|  74.1k|            bitStream = MEM_readLE32(ip) >> (bitCount & 31);
 1314|  74.1k|    }   }
 1315|  4.12k|    if (remaining != 1) return ERROR(GENERIC);
  ------------------
  |  |   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 (1315:9): [True: 41, False: 4.08k]
  ------------------
 1316|  4.08k|    *maxSVPtr = charnum-1;
 1317|       |
 1318|  4.08k|    ip += (bitCount+7)>>3;
 1319|  4.08k|    if ((size_t)(ip-istart) > hbSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   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 (1319:9): [True: 84, False: 3.99k]
  ------------------
 1320|  3.99k|    return ip-istart;
 1321|  4.08k|}
FSEv05_buildDTable_rle:
 1329|    516|{
 1330|    516|    void* ptr = dt;
 1331|    516|    FSEv05_DTableHeader* const DTableH = (FSEv05_DTableHeader*)ptr;
 1332|    516|    void* dPtr = dt + 1;
 1333|    516|    FSEv05_decode_t* const cell = (FSEv05_decode_t*)dPtr;
 1334|       |
 1335|    516|    DTableH->tableLog = 0;
 1336|    516|    DTableH->fastMode = 0;
 1337|       |
 1338|    516|    cell->newState = 0;
 1339|    516|    cell->symbol = symbolValue;
 1340|    516|    cell->nbBits = 0;
 1341|       |
 1342|    516|    return 0;
 1343|    516|}
FSEv05_buildDTable_raw:
 1347|    918|{
 1348|    918|    void* ptr = dt;
 1349|    918|    FSEv05_DTableHeader* const DTableH = (FSEv05_DTableHeader*)ptr;
 1350|    918|    void* dPtr = dt + 1;
 1351|    918|    FSEv05_decode_t* const dinfo = (FSEv05_decode_t*)dPtr;
 1352|    918|    const unsigned tableSize = 1 << nbBits;
 1353|    918|    const unsigned tableMask = tableSize - 1;
 1354|    918|    const unsigned maxSymbolValue = tableMask;
 1355|    918|    unsigned s;
 1356|       |
 1357|       |    /* Sanity checks */
 1358|    918|    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: 918]
  ------------------
 1359|       |
 1360|       |    /* Build Decoding Table */
 1361|    918|    DTableH->tableLog = (U16)nbBits;
 1362|    918|    DTableH->fastMode = 1;
 1363|  71.7k|    for (s=0; s<=maxSymbolValue; s++) {
  ------------------
  |  Branch (1363:15): [True: 70.8k, False: 918]
  ------------------
 1364|  70.8k|        dinfo[s].newState = 0;
 1365|  70.8k|        dinfo[s].symbol = (BYTE)s;
 1366|  70.8k|        dinfo[s].nbBits = (BYTE)nbBits;
 1367|  70.8k|    }
 1368|       |
 1369|    918|    return 0;
 1370|    918|}
FSEv05_decompress_usingDTable:
 1443|  1.83k|{
 1444|  1.83k|    const void* ptr = dt;
 1445|  1.83k|    const FSEv05_DTableHeader* DTableH = (const FSEv05_DTableHeader*)ptr;
 1446|  1.83k|    const U32 fastMode = DTableH->fastMode;
 1447|       |
 1448|       |    /* select fast mode (static) */
 1449|  1.83k|    if (fastMode) return FSEv05_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 1);
  ------------------
  |  Branch (1449:9): [True: 885, False: 950]
  ------------------
 1450|    950|    return FSEv05_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 0);
 1451|  1.83k|}
FSEv05_decompress:
 1455|  2.07k|{
 1456|  2.07k|    const BYTE* const istart = (const BYTE*)cSrc;
 1457|  2.07k|    const BYTE* ip = istart;
 1458|  2.07k|    short counting[FSEv05_MAX_SYMBOL_VALUE+1];
 1459|  2.07k|    DTable_max_t dt;   /* Static analyzer seems unable to understand this table will be properly initialized later */
 1460|  2.07k|    unsigned tableLog;
 1461|  2.07k|    unsigned maxSymbolValue = FSEv05_MAX_SYMBOL_VALUE;
  ------------------
  |  | 1048|  2.07k|#define FSEv05_MAX_SYMBOL_VALUE 255
  ------------------
 1462|  2.07k|    size_t errorCode;
 1463|       |
 1464|  2.07k|    if (cSrcSize<2) return ERROR(srcSize_wrong);   /* too small input size */
  ------------------
  |  |   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 (1464:9): [True: 42, False: 2.03k]
  ------------------
 1465|       |
 1466|       |    /* normal FSEv05 decoding mode */
 1467|  2.03k|    errorCode = FSEv05_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize);
 1468|  2.03k|    if (FSEv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1468:9): [True: 117, False: 1.92k]
  ------------------
 1469|  1.92k|    if (errorCode >= cSrcSize) return ERROR(srcSize_wrong);   /* too small input size */
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1469:9): [True: 43, False: 1.87k]
  ------------------
 1470|  1.87k|    ip += errorCode;
 1471|  1.87k|    cSrcSize -= errorCode;
 1472|       |
 1473|  1.87k|    errorCode = FSEv05_buildDTable (dt, counting, maxSymbolValue, tableLog);
 1474|  1.87k|    if (FSEv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1474:9): [True: 42, False: 1.83k]
  ------------------
 1475|       |
 1476|       |    /* always return, even if it is an error code */
 1477|  1.83k|    return FSEv05_decompress_usingDTable (dst, maxDstSize, ip, cSrcSize, dt);
 1478|  1.87k|}
HUFv05_isError:
 1723|  9.21k|unsigned HUFv05_isError(size_t code) { return ERR_isError(code); }
HUFv05_readDTableX2:
 1818|    705|{
 1819|    705|    BYTE huffWeight[HUFv05_MAX_SYMBOL_VALUE + 1];
 1820|    705|    U32 rankVal[HUFv05_ABSOLUTEMAX_TABLELOG + 1];   /* large enough for values from 0 to 16 */
 1821|    705|    U32 tableLog = 0;
 1822|    705|    size_t iSize;
 1823|    705|    U32 nbSymbols = 0;
 1824|    705|    U32 n;
 1825|    705|    U32 nextRankStart;
 1826|    705|    void* const dtPtr = DTable + 1;
 1827|    705|    HUFv05_DEltX2* const dt = (HUFv05_DEltX2*)dtPtr;
 1828|       |
 1829|    705|    HUFv05_STATIC_ASSERT(sizeof(HUFv05_DEltX2) == sizeof(U16));   /* if compilation fails here, assertion is false */
  ------------------
  |  | 1725|    705|#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|    705|    iSize = HUFv05_readStats(huffWeight, HUFv05_MAX_SYMBOL_VALUE + 1, rankVal, &nbSymbols, &tableLog, src, srcSize);
  ------------------
  |  | 1714|    705|#define HUFv05_MAX_SYMBOL_VALUE 255
  ------------------
 1833|    705|    if (HUFv05_isError(iSize)) return iSize;
  ------------------
  |  Branch (1833:9): [True: 198, False: 507]
  ------------------
 1834|       |
 1835|       |    /* check result */
 1836|    507|    if (tableLog > DTable[0]) return ERROR(tableLog_tooLarge);   /* DTable is too small */
  ------------------
  |  |   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 (1836:9): [True: 3, False: 504]
  ------------------
 1837|    504|    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|    504|    nextRankStart = 0;
 1841|  3.35k|    for (n=1; n<=tableLog; n++) {
  ------------------
  |  Branch (1841:15): [True: 2.85k, False: 504]
  ------------------
 1842|  2.85k|        U32 current = nextRankStart;
 1843|  2.85k|        nextRankStart += (rankVal[n] << (n-1));
 1844|  2.85k|        rankVal[n] = current;
 1845|  2.85k|    }
 1846|       |
 1847|       |    /* fill DTable */
 1848|  31.5k|    for (n=0; n<nbSymbols; n++) {
  ------------------
  |  Branch (1848:15): [True: 30.9k, False: 504]
  ------------------
 1849|  30.9k|        const U32 w = huffWeight[n];
 1850|  30.9k|        const U32 length = (1 << w) >> 1;
 1851|  30.9k|        U32 i;
 1852|  30.9k|        HUFv05_DEltX2 D;
 1853|  30.9k|        D.byte = (BYTE)n; D.nbBits = (BYTE)(tableLog + 1 - w);
 1854|   107k|        for (i = rankVal[w]; i < rankVal[w] + length; i++)
  ------------------
  |  Branch (1854:30): [True: 76.7k, False: 30.9k]
  ------------------
 1855|  76.7k|            dt[i] = D;
 1856|  30.9k|        rankVal[w] += length;
 1857|  30.9k|    }
 1858|       |
 1859|    504|    return iSize;
 1860|    507|}
HUFv05_decompress1X2_usingDTable:
 1908|    138|{
 1909|    138|    BYTE* op = (BYTE*)dst;
 1910|    138|    BYTE* const oend = op + dstSize;
 1911|    138|    const U32 dtLog = DTable[0];
 1912|    138|    const void* dtPtr = DTable;
 1913|    138|    const HUFv05_DEltX2* const dt = ((const HUFv05_DEltX2*)dtPtr)+1;
 1914|    138|    BITv05_DStream_t bitD;
 1915|       |
 1916|    138|    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: 137]
  ------------------
 1917|    137|    { size_t const errorCode = BITv05_initDStream(&bitD, cSrc, cSrcSize);
 1918|    137|      if (HUFv05_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1918:11): [True: 52, False: 85]
  ------------------
 1919|       |
 1920|     85|    HUFv05_decodeStreamX2(op, &bitD, oend, dt, dtLog);
 1921|       |
 1922|       |    /* check */
 1923|     85|    if (!BITv05_endOfDStream(&bitD)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     82|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     82|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     82|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1923:9): [True: 82, False: 3]
  ------------------
 1924|       |
 1925|      3|    return dstSize;
 1926|     85|}
HUFv05_decompress1X2:
 1929|    226|{
 1930|    226|    HUFv05_CREATE_STATIC_DTABLEX2(DTable, HUFv05_MAX_TABLELOG);
  ------------------
  |  | 1604|    226|        unsigned short DTable[HUFv05_DTABLE_SIZE(maxTableLog)] = { maxTableLog }
  ------------------
 1931|    226|    const BYTE* ip = (const BYTE*) cSrc;
 1932|    226|    size_t errorCode;
 1933|       |
 1934|    226|    errorCode = HUFv05_readDTableX2 (DTable, cSrc, cSrcSize);
 1935|    226|    if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1935:9): [True: 70, False: 156]
  ------------------
 1936|    156|    if (errorCode >= cSrcSize) 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 (1936:9): [True: 18, False: 138]
  ------------------
 1937|    138|    ip += errorCode;
 1938|    138|    cSrcSize -= errorCode;
 1939|       |
 1940|    138|    return HUFv05_decompress1X2_usingDTable (dst, dstSize, ip, cSrcSize, DTable);
 1941|    156|}
HUFv05_decompress4X2_usingDTable:
 1948|    330|{
 1949|       |    /* Check */
 1950|    330|    if (cSrcSize < 10) return ERROR(corruption_detected);   /* strict minimum : jump table + 1 byte per stream */
  ------------------
  |  |   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 (1950:9): [True: 22, False: 308]
  ------------------
 1951|    308|    {
 1952|    308|        const BYTE* const istart = (const BYTE*) cSrc;
 1953|    308|        BYTE* const ostart = (BYTE*) dst;
 1954|    308|        BYTE* const oend = ostart + dstSize;
 1955|    308|        const void* const dtPtr = DTable;
 1956|    308|        const HUFv05_DEltX2* const dt = ((const HUFv05_DEltX2*)dtPtr) +1;
 1957|    308|        const U32 dtLog = DTable[0];
 1958|    308|        size_t errorCode;
 1959|       |
 1960|       |        /* Init */
 1961|    308|        BITv05_DStream_t bitD1;
 1962|    308|        BITv05_DStream_t bitD2;
 1963|    308|        BITv05_DStream_t bitD3;
 1964|    308|        BITv05_DStream_t bitD4;
 1965|    308|        const size_t length1 = MEM_readLE16(istart);
 1966|    308|        const size_t length2 = MEM_readLE16(istart+2);
 1967|    308|        const size_t length3 = MEM_readLE16(istart+4);
 1968|    308|        size_t length4;
 1969|    308|        const BYTE* const istart1 = istart + 6;  /* jumpTable */
 1970|    308|        const BYTE* const istart2 = istart1 + length1;
 1971|    308|        const BYTE* const istart3 = istart2 + length2;
 1972|    308|        const BYTE* const istart4 = istart3 + length3;
 1973|    308|        const size_t segmentSize = (dstSize+3) / 4;
 1974|    308|        BYTE* const opStart2 = ostart + segmentSize;
 1975|    308|        BYTE* const opStart3 = opStart2 + segmentSize;
 1976|    308|        BYTE* const opStart4 = opStart3 + segmentSize;
 1977|    308|        BYTE* op1 = ostart;
 1978|    308|        BYTE* op2 = opStart2;
 1979|    308|        BYTE* op3 = opStart3;
 1980|    308|        BYTE* op4 = opStart4;
 1981|    308|        U32 endSignal;
 1982|       |
 1983|    308|        length4 = cSrcSize - (length1 + length2 + length3 + 6);
 1984|    308|        if (length4 > cSrcSize) return ERROR(corruption_detected);   /* overflow */
  ------------------
  |  |   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 (1984:13): [True: 24, False: 284]
  ------------------
 1985|    284|        errorCode = BITv05_initDStream(&bitD1, istart1, length1);
 1986|    284|        if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1986:13): [True: 38, False: 246]
  ------------------
 1987|    246|        errorCode = BITv05_initDStream(&bitD2, istart2, length2);
 1988|    246|        if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1988:13): [True: 62, False: 184]
  ------------------
 1989|    184|        errorCode = BITv05_initDStream(&bitD3, istart3, length3);
 1990|    184|        if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1990:13): [True: 65, False: 119]
  ------------------
 1991|    119|        errorCode = BITv05_initDStream(&bitD4, istart4, length4);
 1992|    119|        if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1992:13): [True: 9, False: 110]
  ------------------
 1993|       |
 1994|       |        /* 16-32 symbols per loop (4-8 symbols per stream) */
 1995|    110|        endSignal = BITv05_reloadDStream(&bitD1) | BITv05_reloadDStream(&bitD2) | BITv05_reloadDStream(&bitD3) | BITv05_reloadDStream(&bitD4);
 1996|    320|        for ( ; (endSignal==BITv05_DStream_unfinished) && (op4<(oend-7)) ; ) {
  ------------------
  |  Branch (1996:17): [True: 217, False: 103]
  |  Branch (1996:59): [True: 210, False: 7]
  ------------------
 1997|    210|            HUFv05_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 1878|    210|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 210, False: 0]
  |  |  ------------------
  |  | 1879|    210|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    210|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1998|    210|            HUFv05_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 1878|    210|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 210, False: 0]
  |  |  ------------------
  |  | 1879|    210|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    210|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1999|    210|            HUFv05_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 1878|    210|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 210, False: 0]
  |  |  ------------------
  |  | 1879|    210|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    210|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2000|    210|            HUFv05_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 1878|    210|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 210, False: 0]
  |  |  ------------------
  |  | 1879|    210|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    210|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2001|    210|            HUFv05_DECODE_SYMBOLX2_1(op1, &bitD1);
  ------------------
  |  | 1874|    210|    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: 210, False: 0]
  |  |  |  Branch (1874:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1875|    210|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    210|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2002|    210|            HUFv05_DECODE_SYMBOLX2_1(op2, &bitD2);
  ------------------
  |  | 1874|    210|    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: 210, False: 0]
  |  |  |  Branch (1874:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1875|    210|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    210|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2003|    210|            HUFv05_DECODE_SYMBOLX2_1(op3, &bitD3);
  ------------------
  |  | 1874|    210|    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: 210, False: 0]
  |  |  |  Branch (1874:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1875|    210|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    210|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2004|    210|            HUFv05_DECODE_SYMBOLX2_1(op4, &bitD4);
  ------------------
  |  | 1874|    210|    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: 210, False: 0]
  |  |  |  Branch (1874:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1875|    210|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    210|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2005|    210|            HUFv05_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 1878|    210|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 210, False: 0]
  |  |  ------------------
  |  | 1879|    210|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    210|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2006|    210|            HUFv05_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 1878|    210|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 210, False: 0]
  |  |  ------------------
  |  | 1879|    210|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    210|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2007|    210|            HUFv05_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 1878|    210|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 210, False: 0]
  |  |  ------------------
  |  | 1879|    210|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    210|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2008|    210|            HUFv05_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 1878|    210|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 210, False: 0]
  |  |  ------------------
  |  | 1879|    210|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    210|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2009|    210|            HUFv05_DECODE_SYMBOLX2_0(op1, &bitD1);
  ------------------
  |  | 1871|    210|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2010|    210|            HUFv05_DECODE_SYMBOLX2_0(op2, &bitD2);
  ------------------
  |  | 1871|    210|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2011|    210|            HUFv05_DECODE_SYMBOLX2_0(op3, &bitD3);
  ------------------
  |  | 1871|    210|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2012|    210|            HUFv05_DECODE_SYMBOLX2_0(op4, &bitD4);
  ------------------
  |  | 1871|    210|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2013|    210|            endSignal = BITv05_reloadDStream(&bitD1) | BITv05_reloadDStream(&bitD2) | BITv05_reloadDStream(&bitD3) | BITv05_reloadDStream(&bitD4);
 2014|    210|        }
 2015|       |
 2016|       |        /* check corruption */
 2017|    110|        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: 110]
  ------------------
 2018|    110|        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: 110]
  ------------------
 2019|    110|        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: 110]
  ------------------
 2020|       |        /* note : op4 supposed already verified within main loop */
 2021|       |
 2022|       |        /* finish bitStreams one by one */
 2023|    110|        HUFv05_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog);
 2024|    110|        HUFv05_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog);
 2025|    110|        HUFv05_decodeStreamX2(op3, &bitD3, opStart4, dt, dtLog);
 2026|    110|        HUFv05_decodeStreamX2(op4, &bitD4, oend,     dt, dtLog);
 2027|       |
 2028|       |        /* check */
 2029|    110|        endSignal = BITv05_endOfDStream(&bitD1) & BITv05_endOfDStream(&bitD2) & BITv05_endOfDStream(&bitD3) & BITv05_endOfDStream(&bitD4);
 2030|    110|        if (!endSignal) return ERROR(corruption_detected);
  ------------------
  |  |   49|    110|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    110|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    110|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2030:13): [True: 110, False: 0]
  ------------------
 2031|       |
 2032|       |        /* decoded size */
 2033|      0|        return dstSize;
 2034|    110|    }
 2035|    110|}
HUFv05_decompress4X2:
 2039|    479|{
 2040|    479|    HUFv05_CREATE_STATIC_DTABLEX2(DTable, HUFv05_MAX_TABLELOG);
  ------------------
  |  | 1604|    479|        unsigned short DTable[HUFv05_DTABLE_SIZE(maxTableLog)] = { maxTableLog }
  ------------------
 2041|    479|    const BYTE* ip = (const BYTE*) cSrc;
 2042|    479|    size_t errorCode;
 2043|       |
 2044|    479|    errorCode = HUFv05_readDTableX2 (DTable, cSrc, cSrcSize);
 2045|    479|    if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2045:9): [True: 131, False: 348]
  ------------------
 2046|    348|    if (errorCode >= cSrcSize) 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 (2046:9): [True: 18, False: 330]
  ------------------
 2047|    330|    ip += errorCode;
 2048|    330|    cSrcSize -= errorCode;
 2049|       |
 2050|    330|    return HUFv05_decompress4X2_usingDTable (dst, dstSize, ip, cSrcSize, DTable);
 2051|    348|}
HUFv05_readDTableX4:
 2146|  2.83k|{
 2147|  2.83k|    BYTE weightList[HUFv05_MAX_SYMBOL_VALUE + 1];
 2148|  2.83k|    sortedSymbol_t sortedSymbol[HUFv05_MAX_SYMBOL_VALUE + 1];
 2149|  2.83k|    U32 rankStats[HUFv05_ABSOLUTEMAX_TABLELOG + 1] = { 0 };
 2150|  2.83k|    U32 rankStart0[HUFv05_ABSOLUTEMAX_TABLELOG + 2] = { 0 };
 2151|  2.83k|    U32* const rankStart = rankStart0+1;
 2152|  2.83k|    rankVal_t rankVal;
 2153|  2.83k|    U32 tableLog, maxW, sizeOfSort, nbSymbols;
 2154|  2.83k|    const U32 memLog = DTable[0];
 2155|  2.83k|    size_t iSize;
 2156|  2.83k|    void* dtPtr = DTable;
 2157|  2.83k|    HUFv05_DEltX4* const dt = ((HUFv05_DEltX4*)dtPtr) + 1;
 2158|       |
 2159|  2.83k|    HUFv05_STATIC_ASSERT(sizeof(HUFv05_DEltX4) == sizeof(unsigned));   /* if compilation fails here, assertion is false */
  ------------------
  |  | 1725|  2.83k|#define HUFv05_STATIC_ASSERT(c) { enum { HUFv05_static_assert = 1/(int)(!!(c)) }; }   /* use only *after* variable declarations */
  ------------------
 2160|  2.83k|    if (memLog > HUFv05_ABSOLUTEMAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1711|  2.83k|#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: 2.83k]
  ------------------
 2161|       |    /* memset(weightList, 0, sizeof(weightList)); */   /* is not necessary, even though some analyzer complain ... */
 2162|       |
 2163|  2.83k|    iSize = HUFv05_readStats(weightList, HUFv05_MAX_SYMBOL_VALUE + 1, rankStats, &nbSymbols, &tableLog, src, srcSize);
  ------------------
  |  | 1714|  2.83k|#define HUFv05_MAX_SYMBOL_VALUE 255
  ------------------
 2164|  2.83k|    if (HUFv05_isError(iSize)) return iSize;
  ------------------
  |  Branch (2164:9): [True: 2.02k, False: 810]
  ------------------
 2165|       |
 2166|       |    /* check result */
 2167|    810|    if (tableLog > memLog) return ERROR(tableLog_tooLarge);   /* DTable can't fit code depth */
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2167:9): [True: 34, False: 776]
  ------------------
 2168|       |
 2169|       |    /* find maxWeight */
 2170|  1.41k|    for (maxW = tableLog; rankStats[maxW]==0; maxW--) {}  /* necessarily finds a solution before 0 */
  ------------------
  |  Branch (2170:27): [True: 636, False: 776]
  ------------------
 2171|       |
 2172|       |    /* Get start index of each weight */
 2173|    776|    {
 2174|    776|        U32 w, nextRankStart = 0;
 2175|  4.64k|        for (w=1; w<=maxW; w++) {
  ------------------
  |  Branch (2175:19): [True: 3.86k, False: 776]
  ------------------
 2176|  3.86k|            U32 current = nextRankStart;
 2177|  3.86k|            nextRankStart += rankStats[w];
 2178|  3.86k|            rankStart[w] = current;
 2179|  3.86k|        }
 2180|    776|        rankStart[0] = nextRankStart;   /* put all 0w symbols at the end of sorted list*/
 2181|    776|        sizeOfSort = nextRankStart;
 2182|    776|    }
 2183|       |
 2184|       |    /* sort symbols by weight */
 2185|    776|    {
 2186|    776|        U32 s;
 2187|  59.2k|        for (s=0; s<nbSymbols; s++) {
  ------------------
  |  Branch (2187:19): [True: 58.4k, False: 776]
  ------------------
 2188|  58.4k|            U32 w = weightList[s];
 2189|  58.4k|            U32 r = rankStart[w]++;
 2190|  58.4k|            sortedSymbol[r].symbol = (BYTE)s;
 2191|  58.4k|            sortedSymbol[r].weight = (BYTE)w;
 2192|  58.4k|        }
 2193|    776|        rankStart[0] = 0;   /* forget 0w symbols; this is beginning of weight(1) */
 2194|    776|    }
 2195|       |
 2196|       |    /* Build rankVal */
 2197|    776|    {
 2198|    776|        const U32 minBits = tableLog+1 - maxW;
 2199|    776|        U32 nextRankVal = 0;
 2200|    776|        U32 w, consumed;
 2201|    776|        const int rescale = (memLog-tableLog) - 1;   /* tableLog <= memLog */
 2202|    776|        U32* rankVal0 = rankVal[0];
 2203|  4.64k|        for (w=1; w<=maxW; w++) {
  ------------------
  |  Branch (2203:19): [True: 3.86k, False: 776]
  ------------------
 2204|  3.86k|            U32 current = nextRankVal;
 2205|  3.86k|            nextRankVal += rankStats[w] << (w+rescale);
 2206|  3.86k|            rankVal0[w] = current;
 2207|  3.86k|        }
 2208|  8.07k|        for (consumed = minBits; consumed <= memLog - minBits; consumed++) {
  ------------------
  |  Branch (2208:34): [True: 7.30k, False: 776]
  ------------------
 2209|  7.30k|            U32* rankValPtr = rankVal[consumed];
 2210|  47.3k|            for (w = 1; w <= maxW; w++) {
  ------------------
  |  Branch (2210:25): [True: 40.0k, False: 7.30k]
  ------------------
 2211|  40.0k|                rankValPtr[w] = rankVal0[w] >> consumed;
 2212|  40.0k|    }   }   }
 2213|       |
 2214|    776|    HUFv05_fillDTableX4(dt, memLog,
 2215|    776|                   sortedSymbol, sizeOfSort,
 2216|    776|                   rankStart0, rankVal, maxW,
 2217|    776|                   tableLog+1);
 2218|       |
 2219|    776|    return iSize;
 2220|    810|}
HUFv05_decompress1X4_usingDTable:
 2287|     90|{
 2288|     90|    const BYTE* const istart = (const BYTE*) cSrc;
 2289|     90|    BYTE* const ostart = (BYTE*) dst;
 2290|     90|    BYTE* const oend = ostart + dstSize;
 2291|       |
 2292|     90|    const U32 dtLog = DTable[0];
 2293|     90|    const void* const dtPtr = DTable;
 2294|     90|    const HUFv05_DEltX4* const dt = ((const HUFv05_DEltX4*)dtPtr) +1;
 2295|     90|    size_t errorCode;
 2296|       |
 2297|       |    /* Init */
 2298|     90|    BITv05_DStream_t bitD;
 2299|     90|    errorCode = BITv05_initDStream(&bitD, istart, cSrcSize);
 2300|     90|    if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2300:9): [True: 28, False: 62]
  ------------------
 2301|       |
 2302|       |    /* finish bitStreams one by one */
 2303|     62|    HUFv05_decodeStreamX4(ostart, &bitD, oend,     dt, dtLog);
 2304|       |
 2305|       |    /* check */
 2306|     62|    if (!BITv05_endOfDStream(&bitD)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     59|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     59|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     59|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2306:9): [True: 59, False: 3]
  ------------------
 2307|       |
 2308|       |    /* decoded size */
 2309|      3|    return dstSize;
 2310|     62|}
HUFv05_decompress4X4_usingDTable:
 2330|     53|{
 2331|     53|    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 (2331:9): [True: 0, False: 53]
  ------------------
 2332|       |
 2333|     53|    {
 2334|     53|        const BYTE* const istart = (const BYTE*) cSrc;
 2335|     53|        BYTE* const ostart = (BYTE*) dst;
 2336|     53|        BYTE* const oend = ostart + dstSize;
 2337|     53|        const void* const dtPtr = DTable;
 2338|     53|        const HUFv05_DEltX4* const dt = ((const HUFv05_DEltX4*)dtPtr) +1;
 2339|     53|        const U32 dtLog = DTable[0];
 2340|     53|        size_t errorCode;
 2341|       |
 2342|       |        /* Init */
 2343|     53|        BITv05_DStream_t bitD1;
 2344|     53|        BITv05_DStream_t bitD2;
 2345|     53|        BITv05_DStream_t bitD3;
 2346|     53|        BITv05_DStream_t bitD4;
 2347|     53|        const size_t length1 = MEM_readLE16(istart);
 2348|     53|        const size_t length2 = MEM_readLE16(istart+2);
 2349|     53|        const size_t length3 = MEM_readLE16(istart+4);
 2350|     53|        size_t length4;
 2351|     53|        const BYTE* const istart1 = istart + 6;  /* jumpTable */
 2352|     53|        const BYTE* const istart2 = istart1 + length1;
 2353|     53|        const BYTE* const istart3 = istart2 + length2;
 2354|     53|        const BYTE* const istart4 = istart3 + length3;
 2355|     53|        const size_t segmentSize = (dstSize+3) / 4;
 2356|     53|        BYTE* const opStart2 = ostart + segmentSize;
 2357|     53|        BYTE* const opStart3 = opStart2 + segmentSize;
 2358|     53|        BYTE* const opStart4 = opStart3 + segmentSize;
 2359|     53|        BYTE* op1 = ostart;
 2360|     53|        BYTE* op2 = opStart2;
 2361|     53|        BYTE* op3 = opStart3;
 2362|     53|        BYTE* op4 = opStart4;
 2363|     53|        U32 endSignal;
 2364|       |
 2365|     53|        length4 = cSrcSize - (length1 + length2 + length3 + 6);
 2366|     53|        if (length4 > cSrcSize) return ERROR(corruption_detected);   /* overflow */
  ------------------
  |  |   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 (2366:13): [True: 1, False: 52]
  ------------------
 2367|     52|        errorCode = BITv05_initDStream(&bitD1, istart1, length1);
 2368|     52|        if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2368:13): [True: 4, False: 48]
  ------------------
 2369|     48|        errorCode = BITv05_initDStream(&bitD2, istart2, length2);
 2370|     48|        if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2370:13): [True: 4, False: 44]
  ------------------
 2371|     44|        errorCode = BITv05_initDStream(&bitD3, istart3, length3);
 2372|     44|        if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2372:13): [True: 12, False: 32]
  ------------------
 2373|     32|        errorCode = BITv05_initDStream(&bitD4, istart4, length4);
 2374|     32|        if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2374:13): [True: 12, False: 20]
  ------------------
 2375|       |
 2376|       |        /* 16-32 symbols per loop (4-8 symbols per stream) */
 2377|     20|        endSignal = BITv05_reloadDStream(&bitD1) | BITv05_reloadDStream(&bitD2) | BITv05_reloadDStream(&bitD3) | BITv05_reloadDStream(&bitD4);
 2378|    723|        for ( ; (endSignal==BITv05_DStream_unfinished) && (op4<(oend-7)) ; ) {
  ------------------
  |  Branch (2378:17): [True: 703, False: 20]
  |  Branch (2378:59): [True: 703, False: 0]
  ------------------
 2379|    703|            HUFv05_DECODE_SYMBOLX4_2(op1, &bitD1);
  ------------------
  |  | 2254|    703|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2254:9): [True: 703, False: 0]
  |  |  ------------------
  |  | 2255|    703|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2380|    703|            HUFv05_DECODE_SYMBOLX4_2(op2, &bitD2);
  ------------------
  |  | 2254|    703|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2254:9): [True: 703, False: 0]
  |  |  ------------------
  |  | 2255|    703|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2381|    703|            HUFv05_DECODE_SYMBOLX4_2(op3, &bitD3);
  ------------------
  |  | 2254|    703|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2254:9): [True: 703, False: 0]
  |  |  ------------------
  |  | 2255|    703|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2382|    703|            HUFv05_DECODE_SYMBOLX4_2(op4, &bitD4);
  ------------------
  |  | 2254|    703|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2254:9): [True: 703, False: 0]
  |  |  ------------------
  |  | 2255|    703|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2383|    703|            HUFv05_DECODE_SYMBOLX4_1(op1, &bitD1);
  ------------------
  |  | 2250|    703|    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: 703, False: 0]
  |  |  |  Branch (2250:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2251|    703|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2384|    703|            HUFv05_DECODE_SYMBOLX4_1(op2, &bitD2);
  ------------------
  |  | 2250|    703|    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: 703, False: 0]
  |  |  |  Branch (2250:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2251|    703|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2385|    703|            HUFv05_DECODE_SYMBOLX4_1(op3, &bitD3);
  ------------------
  |  | 2250|    703|    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: 703, False: 0]
  |  |  |  Branch (2250:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2251|    703|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2386|    703|            HUFv05_DECODE_SYMBOLX4_1(op4, &bitD4);
  ------------------
  |  | 2250|    703|    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: 703, False: 0]
  |  |  |  Branch (2250:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2251|    703|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2387|    703|            HUFv05_DECODE_SYMBOLX4_2(op1, &bitD1);
  ------------------
  |  | 2254|    703|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2254:9): [True: 703, False: 0]
  |  |  ------------------
  |  | 2255|    703|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2388|    703|            HUFv05_DECODE_SYMBOLX4_2(op2, &bitD2);
  ------------------
  |  | 2254|    703|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2254:9): [True: 703, False: 0]
  |  |  ------------------
  |  | 2255|    703|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2389|    703|            HUFv05_DECODE_SYMBOLX4_2(op3, &bitD3);
  ------------------
  |  | 2254|    703|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2254:9): [True: 703, False: 0]
  |  |  ------------------
  |  | 2255|    703|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2390|    703|            HUFv05_DECODE_SYMBOLX4_2(op4, &bitD4);
  ------------------
  |  | 2254|    703|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2254:9): [True: 703, False: 0]
  |  |  ------------------
  |  | 2255|    703|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2391|    703|            HUFv05_DECODE_SYMBOLX4_0(op1, &bitD1);
  ------------------
  |  | 2247|    703|    ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2392|    703|            HUFv05_DECODE_SYMBOLX4_0(op2, &bitD2);
  ------------------
  |  | 2247|    703|    ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2393|    703|            HUFv05_DECODE_SYMBOLX4_0(op3, &bitD3);
  ------------------
  |  | 2247|    703|    ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2394|    703|            HUFv05_DECODE_SYMBOLX4_0(op4, &bitD4);
  ------------------
  |  | 2247|    703|    ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2395|       |
 2396|    703|            endSignal = BITv05_reloadDStream(&bitD1) | BITv05_reloadDStream(&bitD2) | BITv05_reloadDStream(&bitD3) | BITv05_reloadDStream(&bitD4);
 2397|    703|        }
 2398|       |
 2399|       |        /* check corruption */
 2400|     20|        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 (2400:13): [True: 0, False: 20]
  ------------------
 2401|     20|        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 (2401:13): [True: 0, False: 20]
  ------------------
 2402|     20|        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 (2402:13): [True: 0, False: 20]
  ------------------
 2403|       |        /* note : op4 supposed already verified within main loop */
 2404|       |
 2405|       |        /* finish bitStreams one by one */
 2406|     20|        HUFv05_decodeStreamX4(op1, &bitD1, opStart2, dt, dtLog);
 2407|     20|        HUFv05_decodeStreamX4(op2, &bitD2, opStart3, dt, dtLog);
 2408|     20|        HUFv05_decodeStreamX4(op3, &bitD3, opStart4, dt, dtLog);
 2409|     20|        HUFv05_decodeStreamX4(op4, &bitD4, oend,     dt, dtLog);
 2410|       |
 2411|       |        /* check */
 2412|     20|        endSignal = BITv05_endOfDStream(&bitD1) & BITv05_endOfDStream(&bitD2) & BITv05_endOfDStream(&bitD3) & BITv05_endOfDStream(&bitD4);
 2413|     20|        if (!endSignal) 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 (2413:13): [True: 20, False: 0]
  ------------------
 2414|       |
 2415|       |        /* decoded size */
 2416|      0|        return dstSize;
 2417|     20|    }
 2418|     20|}
HUFv05_decompress4X4:
 2422|     55|{
 2423|     55|    HUFv05_CREATE_STATIC_DTABLEX4(DTable, HUFv05_MAX_TABLELOG);
  ------------------
  |  | 1606|     55|        unsigned int DTable[HUFv05_DTABLE_SIZE(maxTableLog)] = { maxTableLog }
  ------------------
 2424|     55|    const BYTE* ip = (const BYTE*) cSrc;
 2425|       |
 2426|     55|    size_t hSize = HUFv05_readDTableX4 (DTable, cSrc, cSrcSize);
 2427|     55|    if (HUFv05_isError(hSize)) return hSize;
  ------------------
  |  Branch (2427:9): [True: 2, False: 53]
  ------------------
 2428|     53|    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 (2428:9): [True: 0, False: 53]
  ------------------
 2429|     53|    ip += hSize;
 2430|     53|    cSrcSize -= hSize;
 2431|       |
 2432|     53|    return HUFv05_decompress4X4_usingDTable (dst, dstSize, ip, cSrcSize, DTable);
 2433|     53|}
HUFv05_decompress:
 2465|    586|{
 2466|    586|    static const decompressionAlgo decompress[3] = { HUFv05_decompress4X2, HUFv05_decompress4X4, NULL };
 2467|       |    /* estimate decompression time */
 2468|    586|    U32 Q;
 2469|    586|    const U32 D256 = (U32)(dstSize >> 8);
 2470|    586|    U32 Dtime[3];
 2471|    586|    U32 algoNb = 0;
 2472|    586|    int n;
 2473|       |
 2474|       |    /* validation checks */
 2475|    586|    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: 584]
  ------------------
 2476|    584|    if (cSrcSize >= dstSize) return ERROR(corruption_detected);   /* invalid, or not compressed, but not compressed already dealt with */
  ------------------
  |  |   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 (2476:9): [True: 10, False: 574]
  ------------------
 2477|    574|    if (cSrcSize == 1) { memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; }   /* RLE */
  ------------------
  |  Branch (2477:9): [True: 40, False: 534]
  ------------------
 2478|       |
 2479|       |    /* decoder timing evaluation */
 2480|    534|    Q = (U32)(cSrcSize * 16 / dstSize);   /* Q < 16 since dstSize > cSrcSize */
 2481|  2.13k|    for (n=0; n<3; n++)
  ------------------
  |  Branch (2481:15): [True: 1.60k, False: 534]
  ------------------
 2482|  1.60k|        Dtime[n] = algoTime[Q][n].tableTime + (algoTime[Q][n].decode256Time * D256);
 2483|       |
 2484|    534|    Dtime[1] += Dtime[1] >> 4; Dtime[2] += Dtime[2] >> 3; /* advantage to algorithms using less memory, for cache eviction */
 2485|       |
 2486|    534|    if (Dtime[1] < Dtime[0]) algoNb = 1;
  ------------------
  |  Branch (2486:9): [True: 55, False: 479]
  ------------------
 2487|       |
 2488|    534|    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|    574|}
ZSTDv05_isError:
 2577|   102k|unsigned ZSTDv05_isError(size_t code) { return ERR_isError(code); }
ZSTDv05_decompressBegin:
 2617|  9.79k|{
 2618|  9.79k|    dctx->expected = ZSTDv05_frameHeaderSize_min;
 2619|  9.79k|    dctx->stage = ZSTDv05ds_getFrameHeaderSize;
 2620|  9.79k|    dctx->previousDstEnd = NULL;
 2621|  9.79k|    dctx->base = NULL;
 2622|  9.79k|    dctx->vBase = NULL;
 2623|  9.79k|    dctx->dictEnd = NULL;
 2624|  9.79k|    dctx->hufTableX4[0] = ZSTD_HUFFDTABLE_CAPACITY_LOG;
  ------------------
  |  |  436|  9.79k|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
 2625|  9.79k|    dctx->flagStaticTables = 0;
 2626|  9.79k|    return 0;
 2627|  9.79k|}
ZSTDv05_createDCtx:
 2630|  4.89k|{
 2631|  4.89k|    ZSTDv05_DCtx* dctx = (ZSTDv05_DCtx*)malloc(sizeof(ZSTDv05_DCtx));
 2632|  4.89k|    if (dctx==NULL) return NULL;
  ------------------
  |  Branch (2632:9): [True: 0, False: 4.89k]
  ------------------
 2633|  4.89k|    ZSTDv05_decompressBegin(dctx);
 2634|  4.89k|    return dctx;
 2635|  4.89k|}
ZSTDv05_freeDCtx:
 2638|  4.89k|{
 2639|  4.89k|    free(dctx);
 2640|  4.89k|    return 0;   /* reserved as a potential error code in the future */
 2641|  4.89k|}
ZSTDv05_getFrameParams:
 2752|  8.16k|{
 2753|  8.16k|    U32 magicNumber;
 2754|  8.16k|    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: 8.16k]
  ------------------
 2755|  8.16k|    magicNumber = MEM_readLE32(src);
 2756|  8.16k|    if (magicNumber != ZSTDv05_MAGICNUMBER) return ERROR(prefix_unknown);
  ------------------
  |  |  153|  8.16k|#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: 8.16k]
  ------------------
 2757|  8.16k|    memset(params, 0, sizeof(*params));
 2758|  8.16k|    params->windowLog = (((const BYTE*)src)[4] & 15) + ZSTDv05_WINDOWLOG_ABSOLUTEMIN;
  ------------------
  |  |  256|  8.16k|#define ZSTDv05_WINDOWLOG_ABSOLUTEMIN 11
  ------------------
 2759|  8.16k|    if ((((const BYTE*)src)[4] >> 4) != 0) return ERROR(frameParameter_unsupported);   /* reserved bits */
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2759:9): [True: 40, False: 8.12k]
  ------------------
 2760|  8.12k|    return 0;
 2761|  8.16k|}
ZSTDv05_decompress_usingDict:
 3449|  4.89k|{
 3450|  4.89k|    ZSTDv05_decompressBegin_usingDict(dctx, dict, dictSize);
 3451|  4.89k|    ZSTDv05_checkContinuity(dctx, dst);
 3452|  4.89k|    return ZSTDv05_decompress_continueDCtx(dctx, dst, maxDstSize, src, srcSize);
 3453|  4.89k|}
ZSTDv05_findFrameSizeInfoLegacy:
 3485|  4.98k|{
 3486|  4.98k|    const BYTE* ip = (const BYTE*)src;
 3487|  4.98k|    size_t remainingSize = srcSize;
 3488|  4.98k|    size_t nbBlocks = 0;
 3489|  4.98k|    blockProperties_t blockProperties;
 3490|       |
 3491|       |    /* Frame Header */
 3492|  4.98k|    if (srcSize < ZSTDv05_frameHeaderSize_min) {
  ------------------
  |  Branch (3492:9): [True: 0, False: 4.98k]
  ------------------
 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|  4.98k|    if (MEM_readLE32(src) != ZSTDv05_MAGICNUMBER) {
  ------------------
  |  |  153|  4.98k|#define ZSTDv05_MAGICNUMBER 0xFD2FB525   /* v0.5 */
  ------------------
  |  Branch (3496:9): [True: 0, False: 4.98k]
  ------------------
 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|  4.98k|    ip += ZSTDv05_frameHeaderSize_min; remainingSize -= ZSTDv05_frameHeaderSize_min;
 3501|       |
 3502|       |    /* Loop on each block */
 3503|  7.65k|    while (1)
  ------------------
  |  Branch (3503:12): [True: 7.65k, Folded]
  ------------------
 3504|  7.65k|    {
 3505|  7.65k|        size_t cBlockSize = ZSTDv05_getcBlockSize(ip, remainingSize, &blockProperties);
 3506|  7.65k|        if (ZSTDv05_isError(cBlockSize)) {
  ------------------
  |  Branch (3506:13): [True: 17, False: 7.64k]
  ------------------
 3507|     17|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, cBlockSize);
 3508|     17|            return;
 3509|     17|        }
 3510|       |
 3511|  7.64k|        ip += ZSTDv05_blockHeaderSize;
 3512|  7.64k|        remainingSize -= ZSTDv05_blockHeaderSize;
 3513|  7.64k|        if (cBlockSize > remainingSize) {
  ------------------
  |  Branch (3513:13): [True: 74, False: 7.56k]
  ------------------
 3514|     74|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(srcSize_wrong));
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3515|     74|            return;
 3516|     74|        }
 3517|       |
 3518|  7.56k|        if (cBlockSize == 0) break;   /* bt_end */
  ------------------
  |  Branch (3518:13): [True: 4.89k, False: 2.67k]
  ------------------
 3519|       |
 3520|  2.67k|        ip += cBlockSize;
 3521|  2.67k|        remainingSize -= cBlockSize;
 3522|  2.67k|        nbBlocks++;
 3523|  2.67k|    }
 3524|       |
 3525|  4.89k|    *cSize = ip - (const BYTE*)src;
 3526|  4.89k|    *dBound = nbBlocks * BLOCKSIZE;
  ------------------
  |  |  396|  4.89k|#define BLOCKSIZE (128 KB)                 /* define, for static allocation */
  |  |  ------------------
  |  |  |  |  392|  4.89k|#define KB *(1 <<10)
  |  |  ------------------
  ------------------
 3527|  4.89k|}
ZSTDv05_decompressBegin_usingDict:
 3687|  4.89k|{
 3688|  4.89k|    size_t errorCode;
 3689|  4.89k|    errorCode = ZSTDv05_decompressBegin(dctx);
 3690|  4.89k|    if (ZSTDv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (3690:9): [True: 0, False: 4.89k]
  ------------------
 3691|       |
 3692|  4.89k|    if (dict && dictSize) {
  ------------------
  |  Branch (3692:9): [True: 4.89k, False: 0]
  |  Branch (3692:17): [True: 3.25k, False: 1.64k]
  ------------------
 3693|  3.25k|        errorCode = ZSTDv05_decompress_insertDictionary(dctx, dict, dictSize);
 3694|  3.25k|        if (ZSTDv05_isError(errorCode)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|  2.45k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  2.45k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.45k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3694:13): [True: 2.45k, False: 796]
  ------------------
 3695|  3.25k|    }
 3696|       |
 3697|  2.43k|    return 0;
 3698|  4.89k|}
zstd_v05.c:FSEv05_tableStep:
 1142|  3.80k|static U32 FSEv05_tableStep(U32 tableSize) { return (tableSize>>1) + (tableSize>>3) + 3; }
zstd_v05.c:BITv05_highbit32:
  702|  2.66M|{
  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|  2.66M|}
zstd_v05.c:FSEv05_abs:
 1227|  74.1k|static short FSEv05_abs(short a) { return a<0 ? -a : a; }
  ------------------
  |  Branch (1227:43): [True: 42.2k, False: 31.8k]
  ------------------
zstd_v05.c:FSEv05_decompress_usingDTable_generic:
 1376|  1.83k|{
 1377|  1.83k|    BYTE* const ostart = (BYTE*) dst;
 1378|  1.83k|    BYTE* op = ostart;
 1379|  1.83k|    BYTE* const omax = op + maxDstSize;
 1380|  1.83k|    BYTE* const olimit = omax-3;
 1381|       |
 1382|  1.83k|    BITv05_DStream_t bitD;
 1383|  1.83k|    FSEv05_DState_t state1;
 1384|  1.83k|    FSEv05_DState_t state2;
 1385|  1.83k|    size_t errorCode;
 1386|       |
 1387|       |    /* Init */
 1388|  1.83k|    errorCode = BITv05_initDStream(&bitD, cSrc, cSrcSize);   /* replaced last arg by maxCompressed Size */
 1389|  1.83k|    if (FSEv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1389:9): [True: 190, False: 1.64k]
  ------------------
 1390|       |
 1391|  1.64k|    FSEv05_initDState(&state1, &bitD, dt);
 1392|  1.64k|    FSEv05_initDState(&state2, &bitD, dt);
 1393|       |
 1394|  1.64k|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
 1395|       |
 1396|       |    /* 4 symbols per loop */
 1397|  37.7k|    for ( ; (BITv05_reloadDStream(&bitD)==BITv05_DStream_unfinished) && (op<olimit) ; op+=4) {
  ------------------
  |  Branch (1397:13): [True: 36.4k, False: 1.27k]
  |  Branch (1397:73): [True: 36.0k, False: 372]
  ------------------
 1398|  36.0k|        op[0] = FSEv05_GETSYMBOL(&state1);
  ------------------
  |  | 1394|  36.0k|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 16.9k, False: 19.0k]
  |  |  ------------------
  ------------------
 1399|       |
 1400|  36.0k|        if (FSEv05_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1094|  36.0k|#define FSEv05_MAX_TABLELOG  (FSEv05_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1042|  36.0k|#define FSEv05_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1400:13): [Folded, False: 36.0k]
  ------------------
 1401|      0|            BITv05_reloadDStream(&bitD);
 1402|       |
 1403|  36.0k|        op[1] = FSEv05_GETSYMBOL(&state2);
  ------------------
  |  | 1394|  36.0k|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 16.9k, False: 19.0k]
  |  |  ------------------
  ------------------
 1404|       |
 1405|  36.0k|        if (FSEv05_MAX_TABLELOG*4+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1094|  36.0k|#define FSEv05_MAX_TABLELOG  (FSEv05_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1042|  36.0k|#define FSEv05_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1405:13): [Folded, False: 36.0k]
  ------------------
 1406|      0|            { if (BITv05_reloadDStream(&bitD) > BITv05_DStream_unfinished) { op+=2; break; } }
  ------------------
  |  Branch (1406:19): [True: 0, False: 0]
  ------------------
 1407|       |
 1408|  36.0k|        op[2] = FSEv05_GETSYMBOL(&state1);
  ------------------
  |  | 1394|  36.0k|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 16.9k, False: 19.0k]
  |  |  ------------------
  ------------------
 1409|       |
 1410|  36.0k|        if (FSEv05_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1094|  36.0k|#define FSEv05_MAX_TABLELOG  (FSEv05_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1042|  36.0k|#define FSEv05_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1410:13): [Folded, False: 36.0k]
  ------------------
 1411|      0|            BITv05_reloadDStream(&bitD);
 1412|       |
 1413|  36.0k|        op[3] = FSEv05_GETSYMBOL(&state2);
  ------------------
  |  | 1394|  36.0k|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 16.9k, False: 19.0k]
  |  |  ------------------
  ------------------
 1414|  36.0k|    }
 1415|       |
 1416|       |    /* tail */
 1417|       |    /* note : BITv05_reloadDStream(&bitD) >= FSEv05_DStream_partiallyFilled; Ends at exactly BITv05_DStream_completed */
 1418|  22.7k|    while (1) {
  ------------------
  |  Branch (1418:12): [True: 22.7k, Folded]
  ------------------
 1419|  22.7k|        if ( (BITv05_reloadDStream(&bitD)>BITv05_DStream_completed) || (op==omax) || (BITv05_endOfDStream(&bitD) && (fast || FSEv05_endOfDState(&state1))) )
  ------------------
  |  Branch (1419:14): [True: 312, False: 22.4k]
  |  Branch (1419:72): [True: 0, False: 22.4k]
  |  Branch (1419:87): [True: 841, False: 21.5k]
  |  Branch (1419:118): [True: 199, False: 642]
  |  Branch (1419:126): [True: 103, False: 539]
  ------------------
 1420|    614|            break;
 1421|       |
 1422|  22.1k|        *op++ = FSEv05_GETSYMBOL(&state1);
  ------------------
  |  | 1394|  22.1k|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 5.11k, False: 16.9k]
  |  |  ------------------
  ------------------
 1423|       |
 1424|  22.1k|        if ( (BITv05_reloadDStream(&bitD)>BITv05_DStream_completed) || (op==omax) || (BITv05_endOfDStream(&bitD) && (fast || FSEv05_endOfDState(&state2))) )
  ------------------
  |  Branch (1424:14): [True: 215, False: 21.8k]
  |  Branch (1424:72): [True: 533, False: 21.3k]
  |  Branch (1424:87): [True: 812, False: 20.5k]
  |  Branch (1424:118): [True: 148, False: 664]
  |  Branch (1424:126): [True: 135, False: 529]
  ------------------
 1425|  1.03k|            break;
 1426|       |
 1427|  21.0k|        *op++ = FSEv05_GETSYMBOL(&state2);
  ------------------
  |  | 1394|  21.0k|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 4.66k, False: 16.4k]
  |  |  ------------------
  ------------------
 1428|  21.0k|    }
 1429|       |
 1430|       |    /* end ? */
 1431|  1.64k|    if (BITv05_endOfDStream(&bitD) && FSEv05_endOfDState(&state1) && FSEv05_endOfDState(&state2))
  ------------------
  |  Branch (1431:9): [True: 655, False: 990]
  |  Branch (1431:39): [True: 360, False: 295]
  |  Branch (1431:70): [True: 254, False: 106]
  ------------------
 1432|    254|        return op-ostart;
 1433|       |
 1434|  1.39k|    if (op==omax) return ERROR(dstSize_tooSmall);   /* dst buffer is full, but cSrc unfinished */
  ------------------
  |  |   49|    530|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    530|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    530|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1434:9): [True: 530, False: 861]
  ------------------
 1435|       |
 1436|    861|    return ERROR(corruption_detected);
  ------------------
  |  |   49|    861|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    861|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    861|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1437|  1.39k|}
zstd_v05.c:FSEv05_initDState:
  951|  4.71k|{
  952|  4.71k|    const void* ptr = dt;
  953|  4.71k|    const FSEv05_DTableHeader* const DTableH = (const FSEv05_DTableHeader*)ptr;
  954|  4.71k|    DStatePtr->state = BITv05_readBits(bitD, DTableH->tableLog);
  955|  4.71k|    BITv05_reloadDStream(bitD);
  956|  4.71k|    DStatePtr->table = dt + 1;
  957|  4.71k|}
zstd_v05.c:BITv05_readBits:
  790|   364k|{
  791|   364k|    size_t value = BITv05_lookBits(bitD, nbBits);
  792|   364k|    BITv05_skipBits(bitD, nbBits);
  793|   364k|    return value;
  794|   364k|}
zstd_v05.c:BITv05_lookBits:
  771|   364k|{
  772|   364k|    const U32 bitMask = sizeof(bitD->bitContainer)*8 - 1;
  773|   364k|    return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask);
  774|   364k|}
zstd_v05.c:BITv05_skipBits:
  785|  3.03M|{
  786|  3.03M|    bitD->bitsConsumed += nbBits;
  787|  3.03M|}
zstd_v05.c:FSEv05_decodeSymbolFast:
  977|  77.6k|{
  978|  77.6k|    const FSEv05_decode_t DInfo = ((const FSEv05_decode_t*)(DStatePtr->table))[DStatePtr->state];
  979|  77.6k|    const U32 nbBits = DInfo.nbBits;
  980|  77.6k|    BYTE symbol = DInfo.symbol;
  981|  77.6k|    size_t lowBits = BITv05_readBitsFast(bitD, nbBits);
  982|       |
  983|  77.6k|    DStatePtr->state = DInfo.newState + lowBits;
  984|  77.6k|    return symbol;
  985|  77.6k|}
zstd_v05.c:BITv05_readBitsFast:
  799|  77.6k|{
  800|  77.6k|    size_t value = BITv05_lookBitsFast(bitD, nbBits);
  801|  77.6k|    BITv05_skipBits(bitD, nbBits);
  802|  77.6k|    return value;
  803|  77.6k|}
zstd_v05.c:BITv05_lookBitsFast:
  779|  2.66M|{
  780|  2.66M|    const U32 bitMask = sizeof(bitD->bitContainer)*8 - 1;
  781|  2.66M|    return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask);
  782|  2.66M|}
zstd_v05.c:FSEv05_decodeSymbol:
  966|   297k|{
  967|   297k|    const FSEv05_decode_t DInfo = ((const FSEv05_decode_t*)(DStatePtr->table))[DStatePtr->state];
  968|   297k|    const U32  nbBits = DInfo.nbBits;
  969|   297k|    BYTE symbol = DInfo.symbol;
  970|   297k|    size_t lowBits = BITv05_readBits(bitD, nbBits);
  971|       |
  972|   297k|    DStatePtr->state = DInfo.newState + lowBits;
  973|   297k|    return symbol;
  974|   297k|}
zstd_v05.c:FSEv05_endOfDState:
  988|  2.32k|{
  989|  2.32k|    return DStatePtr->state == 0;
  990|  2.32k|}
zstd_v05.c:HUFv05_readStats:
 1745|  3.53k|{
 1746|  3.53k|    U32 weightTotal;
 1747|  3.53k|    U32 tableLog;
 1748|  3.53k|    const BYTE* ip = (const BYTE*) src;
 1749|  3.53k|    size_t iSize;
 1750|  3.53k|    size_t oSize;
 1751|  3.53k|    U32 n;
 1752|       |
 1753|  3.53k|    if (!srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   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 (1753:9): [True: 54, False: 3.48k]
  ------------------
 1754|  3.48k|    iSize = ip[0];
 1755|       |    /* memset(huffWeight, 0, hwSize); */   /* is not necessary, even though some analyzer complain ... */
 1756|       |
 1757|  3.48k|    if (iSize >= 128)  { /* special header */
  ------------------
  |  Branch (1757:9): [True: 1.36k, False: 2.11k]
  ------------------
 1758|  1.36k|        if (iSize >= (242)) {  /* RLE */
  ------------------
  |  Branch (1758:13): [True: 1.10k, False: 265]
  ------------------
 1759|  1.10k|            static int l[14] = { 1, 2, 3, 4, 7, 8, 15, 16, 31, 32, 63, 64, 127, 128 };
 1760|  1.10k|            oSize = l[iSize-242];
 1761|  1.10k|            memset(huffWeight, 1, hwSize);
 1762|  1.10k|            iSize = 0;
 1763|  1.10k|        }
 1764|    265|        else {   /* Incompressible */
 1765|    265|            oSize = iSize - 127;
 1766|    265|            iSize = ((oSize+1)/2);
 1767|    265|            if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   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 (1767:17): [True: 41, False: 224]
  ------------------
 1768|    224|            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: 224]
  ------------------
 1769|    224|            ip += 1;
 1770|  4.29k|            for (n=0; n<oSize; n+=2) {
  ------------------
  |  Branch (1770:23): [True: 4.07k, False: 224]
  ------------------
 1771|  4.07k|                huffWeight[n]   = ip[n/2] >> 4;
 1772|  4.07k|                huffWeight[n+1] = ip[n/2] & 15;
 1773|  4.07k|    }   }   }
 1774|  2.11k|    else  {   /* header compressed with FSEv05 (normal case) */
 1775|  2.11k|        if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   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 (1775:13): [True: 38, False: 2.07k]
  ------------------
 1776|  2.07k|        oSize = FSEv05_decompress(huffWeight, hwSize-1, ip+1, iSize);   /* max (hwSize-1) values decoded, as last one is implied */
 1777|  2.07k|        if (FSEv05_isError(oSize)) return oSize;
  ------------------
  |  Branch (1777:13): [True: 1.82k, False: 254]
  ------------------
 1778|  2.07k|    }
 1779|       |
 1780|       |    /* collect weight stats */
 1781|  1.57k|    memset(rankStats, 0, (HUFv05_ABSOLUTEMAX_TABLELOG + 1) * sizeof(U32));
  ------------------
  |  | 1711|  1.57k|#define HUFv05_ABSOLUTEMAX_TABLELOG  16   /* absolute limit of HUFv05_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
 1782|  1.57k|    weightTotal = 0;
 1783|   101k|    for (n=0; n<oSize; n++) {
  ------------------
  |  Branch (1783:15): [True: 99.8k, False: 1.54k]
  ------------------
 1784|  99.8k|        if (huffWeight[n] >= HUFv05_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  | 1711|  99.8k|#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|     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 (1784:13): [True: 37, False: 99.8k]
  ------------------
 1785|  99.8k|        rankStats[huffWeight[n]]++;
 1786|  99.8k|        weightTotal += (1 << huffWeight[n]) >> 1;
 1787|  99.8k|    }
 1788|  1.54k|    if (weightTotal == 0) return ERROR(corruption_detected);
  ------------------
  |  |   49|     91|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     91|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     91|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1788:9): [True: 91, False: 1.45k]
  ------------------
 1789|       |
 1790|       |    /* get last non-null symbol weight (implied, total must be 2^n) */
 1791|  1.45k|    tableLog = BITv05_highbit32(weightTotal) + 1;
 1792|  1.45k|    if (tableLog > HUFv05_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  | 1711|  1.45k|#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|     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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1792:9): [True: 52, False: 1.39k]
  ------------------
 1793|  1.39k|    {   /* determine last weight */
 1794|  1.39k|        U32 total = 1 << tableLog;
 1795|  1.39k|        U32 rest = total - weightTotal;
 1796|  1.39k|        U32 verif = 1 << BITv05_highbit32(rest);
 1797|  1.39k|        U32 lastWeight = BITv05_highbit32(rest) + 1;
 1798|  1.39k|        if (verif != rest) return ERROR(corruption_detected);    /* last value must be a clean power of 2 */
  ------------------
  |  |   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 (1798:13): [True: 45, False: 1.35k]
  ------------------
 1799|  1.35k|        huffWeight[oSize] = (BYTE)lastWeight;
 1800|  1.35k|        rankStats[lastWeight]++;
 1801|  1.35k|    }
 1802|       |
 1803|       |    /* check tree construction validity */
 1804|  1.35k|    if ((rankStats[1] < 2) || (rankStats[1] & 1)) return ERROR(corruption_detected);   /* by construction : at least 2 elts of rank 1, must be even */
  ------------------
  |  |   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 (1804:9): [True: 37, False: 1.31k]
  |  Branch (1804:31): [True: 0, False: 1.31k]
  ------------------
 1805|       |
 1806|       |    /* results */
 1807|  1.31k|    *nbSymbolsPtr = (U32)(oSize+1);
 1808|  1.31k|    *tableLogPtr = tableLog;
 1809|  1.31k|    return iSize+1;
 1810|  1.35k|}
zstd_v05.c:BITv05_initDStream:
  735|  3.57k|{
  736|  3.57k|    if (srcSize < 1) { memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (736:9): [True: 40, False: 3.53k]
  ------------------
  737|       |
  738|  3.53k|    if (srcSize >=  sizeof(size_t)) {  /* normal case */
  ------------------
  |  Branch (738:9): [True: 2.11k, False: 1.42k]
  ------------------
  739|  2.11k|        U32 contain32;
  740|  2.11k|        bitD->start = (const char*)srcBuffer;
  741|  2.11k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(size_t);
  742|  2.11k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  743|  2.11k|        contain32 = ((const BYTE*)srcBuffer)[srcSize-1];
  744|  2.11k|        if (contain32 == 0) return ERROR(GENERIC);   /* endMark not present */
  ------------------
  |  |   49|    333|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    333|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    333|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (744:13): [True: 333, False: 1.78k]
  ------------------
  745|  1.78k|        bitD->bitsConsumed = 8 - BITv05_highbit32(contain32);
  746|  1.78k|    } else {
  747|  1.42k|        U32 contain32;
  748|  1.42k|        bitD->start = (const char*)srcBuffer;
  749|  1.42k|        bitD->ptr   = bitD->start;
  750|  1.42k|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  751|  1.42k|        switch(srcSize)
  752|  1.42k|        {
  753|    118|            case 7: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[6]) << (sizeof(size_t)*8 - 16);/* fall-through */
  ------------------
  |  Branch (753:13): [True: 118, False: 1.30k]
  ------------------
  754|    225|            case 6: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[5]) << (sizeof(size_t)*8 - 24);/* fall-through */
  ------------------
  |  Branch (754:13): [True: 107, False: 1.31k]
  ------------------
  755|    337|            case 5: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[4]) << (sizeof(size_t)*8 - 32);/* fall-through */
  ------------------
  |  Branch (755:13): [True: 112, False: 1.30k]
  ------------------
  756|    508|            case 4: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[3]) << 24; /* fall-through */
  ------------------
  |  Branch (756:13): [True: 171, False: 1.24k]
  ------------------
  757|    771|            case 3: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[2]) << 16; /* fall-through */
  ------------------
  |  Branch (757:13): [True: 263, False: 1.15k]
  ------------------
  758|    960|            case 2: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[1]) <<  8; /* fall-through */
  ------------------
  |  Branch (758:13): [True: 189, False: 1.23k]
  ------------------
  759|  1.42k|            default: break;
  ------------------
  |  Branch (759:13): [True: 460, False: 960]
  ------------------
  760|  1.42k|        }
  761|  1.42k|        contain32 = ((const BYTE*)srcBuffer)[srcSize-1];
  762|  1.42k|        if (contain32 == 0) return ERROR(GENERIC);   /* endMark not present */
  ------------------
  |  |   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 (762:13): [True: 131, False: 1.28k]
  ------------------
  763|  1.28k|        bitD->bitsConsumed = 8 - BITv05_highbit32(contain32);
  764|  1.28k|        bitD->bitsConsumed += (U32)(sizeof(size_t) - srcSize)*8;
  765|  1.28k|    }
  766|       |
  767|  3.07k|    return srcSize;
  768|  3.53k|}
zstd_v05.c:HUFv05_decodeStreamX2:
 1882|    525|{
 1883|    525|    BYTE* const pStart = p;
 1884|       |
 1885|       |    /* up to 4 symbols at a time */
 1886|  1.54k|    while ((BITv05_reloadDStream(bitDPtr) == BITv05_DStream_unfinished) && (p <= pEnd-4)) {
  ------------------
  |  Branch (1886:12): [True: 1.08k, False: 460]
  |  Branch (1886:76): [True: 1.02k, False: 65]
  ------------------
 1887|  1.02k|        HUFv05_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1878|  1.02k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 1.02k, False: 0]
  |  |  ------------------
  |  | 1879|  1.02k|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|  1.02k|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1888|  1.02k|        HUFv05_DECODE_SYMBOLX2_1(p, bitDPtr);
  ------------------
  |  | 1874|  1.02k|    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: 1.02k, False: 0]
  |  |  |  Branch (1874:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1875|  1.02k|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|  1.02k|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1889|  1.02k|        HUFv05_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1878|  1.02k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 1.02k, False: 0]
  |  |  ------------------
  |  | 1879|  1.02k|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|  1.02k|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1890|  1.02k|        HUFv05_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1871|  1.02k|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1891|  1.02k|    }
 1892|       |
 1893|       |    /* closer to the end */
 1894|    632|    while ((BITv05_reloadDStream(bitDPtr) == BITv05_DStream_unfinished) && (p < pEnd))
  ------------------
  |  Branch (1894:12): [True: 157, False: 475]
  |  Branch (1894:76): [True: 107, False: 50]
  ------------------
 1895|    107|        HUFv05_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1871|    107|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1896|       |
 1897|       |    /* no more data to retrieve from bitstream, hence no need to reload */
 1898|  2.33M|    while (p < pEnd)
  ------------------
  |  Branch (1898:12): [True: 2.33M, False: 525]
  ------------------
 1899|  2.33M|        HUFv05_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1871|  2.33M|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1900|       |
 1901|    525|    return pEnd-pStart;
 1902|    525|}
zstd_v05.c:BITv05_endOfDStream:
  838|  46.0k|{
  839|  46.0k|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (839:13): [True: 44.9k, False: 1.12k]
  |  Branch (839:49): [True: 2.32k, False: 42.6k]
  ------------------
  840|  46.0k|}
zstd_v05.c:BITv05_reloadDStream:
  806|   174k|{
  807|   174k|    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))  /* should never happen */
  ------------------
  |  Branch (807:9): [True: 962, False: 173k]
  ------------------
  808|    962|        return BITv05_DStream_overflow;
  809|       |
  810|   173k|    if (bitD->ptr >= bitD->start + sizeof(bitD->bitContainer)) {
  ------------------
  |  Branch (810:9): [True: 114k, False: 59.1k]
  ------------------
  811|   114k|        bitD->ptr -= bitD->bitsConsumed >> 3;
  812|   114k|        bitD->bitsConsumed &= 7;
  813|   114k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  814|   114k|        return BITv05_DStream_unfinished;
  815|   114k|    }
  816|  59.1k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (816:9): [True: 48.1k, False: 11.0k]
  ------------------
  817|  48.1k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BITv05_DStream_endOfBuffer;
  ------------------
  |  Branch (817:13): [True: 46.1k, False: 1.97k]
  ------------------
  818|  1.97k|        return BITv05_DStream_completed;
  819|  48.1k|    }
  820|  11.0k|    {
  821|  11.0k|        U32 nbBytes = bitD->bitsConsumed >> 3;
  822|  11.0k|        BITv05_DStream_status result = BITv05_DStream_unfinished;
  823|  11.0k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (823:13): [True: 599, False: 10.4k]
  ------------------
  824|    599|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  825|    599|            result = BITv05_DStream_endOfBuffer;
  826|    599|        }
  827|  11.0k|        bitD->ptr -= nbBytes;
  828|  11.0k|        bitD->bitsConsumed -= nbBytes*8;
  829|  11.0k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD) */
  830|  11.0k|        return result;
  831|  59.1k|    }
  832|  59.1k|}
zstd_v05.c:HUFv05_decodeSymbolX2:
 1863|  2.34M|{
 1864|  2.34M|        const size_t val = BITv05_lookBitsFast(Dstream, dtLog); /* note : dtLog >= 1 */
 1865|  2.34M|        const BYTE c = dt[val].byte;
 1866|  2.34M|        BITv05_skipBits(Dstream, dt[val].nbBits);
 1867|  2.34M|        return c;
 1868|  2.34M|}
zstd_v05.c:HUFv05_fillDTableX4:
 2105|    776|{
 2106|    776|    U32 rankVal[HUFv05_ABSOLUTEMAX_TABLELOG + 1];
 2107|    776|    const int scaleLog = nbBitsBaseline - targetLog;   /* note : targetLog >= srcLog, hence scaleLog <= 1 */
 2108|    776|    const U32 minBits  = nbBitsBaseline - maxWeight;
 2109|    776|    U32 s;
 2110|       |
 2111|    776|    memcpy(rankVal, rankValOrigin, sizeof(rankVal));
 2112|       |
 2113|       |    /* fill DTable */
 2114|  56.6k|    for (s=0; s<sortedListSize; s++) {
  ------------------
  |  Branch (2114:15): [True: 55.9k, False: 776]
  ------------------
 2115|  55.9k|        const U16 symbol = sortedList[s].symbol;
 2116|  55.9k|        const U32 weight = sortedList[s].weight;
 2117|  55.9k|        const U32 nbBits = nbBitsBaseline - weight;
 2118|  55.9k|        const U32 start = rankVal[weight];
 2119|  55.9k|        const U32 length = 1 << (targetLog-nbBits);
 2120|       |
 2121|  55.9k|        if (targetLog-nbBits >= minBits) {   /* enough room for a second symbol */
  ------------------
  |  Branch (2121:13): [True: 49.7k, False: 6.17k]
  ------------------
 2122|  49.7k|            U32 sortedRank;
 2123|  49.7k|            int minWeight = nbBits + scaleLog;
 2124|  49.7k|            if (minWeight < 1) minWeight = 1;
  ------------------
  |  Branch (2124:17): [True: 2.08k, False: 47.6k]
  ------------------
 2125|  49.7k|            sortedRank = rankStart[minWeight];
 2126|  49.7k|            HUFv05_fillDTableX4Level2(DTable+start, targetLog-nbBits, nbBits,
 2127|  49.7k|                           rankValOrigin[nbBits], minWeight,
 2128|  49.7k|                           sortedList+sortedRank, sortedListSize-sortedRank,
 2129|  49.7k|                           nbBitsBaseline, symbol);
 2130|  49.7k|        } else {
 2131|  6.17k|            U32 i;
 2132|  6.17k|            const U32 end = start + length;
 2133|  6.17k|            HUFv05_DEltX4 DElt;
 2134|       |
 2135|  6.17k|            MEM_writeLE16(&(DElt.sequence), symbol);
 2136|  6.17k|            DElt.nbBits   = (BYTE)(nbBits);
 2137|  6.17k|            DElt.length   = 1;
 2138|   178k|            for (i = start; i < end; i++)
  ------------------
  |  Branch (2138:29): [True: 172k, False: 6.17k]
  ------------------
 2139|   172k|                DTable[i] = DElt;
 2140|  6.17k|        }
 2141|  55.9k|        rankVal[weight] += length;
 2142|  55.9k|    }
 2143|    776|}
zstd_v05.c:HUFv05_fillDTableX4Level2:
 2062|  49.7k|{
 2063|  49.7k|    HUFv05_DEltX4 DElt;
 2064|  49.7k|    U32 rankVal[HUFv05_ABSOLUTEMAX_TABLELOG + 1];
 2065|  49.7k|    U32 s;
 2066|       |
 2067|       |    /* get pre-calculated rankVal */
 2068|  49.7k|    memcpy(rankVal, rankValOrigin, sizeof(rankVal));
 2069|       |
 2070|       |    /* fill skipped values */
 2071|  49.7k|    if (minWeight>1) {
  ------------------
  |  Branch (2071:9): [True: 45.5k, False: 4.15k]
  ------------------
 2072|  45.5k|        U32 i, skipSize = rankVal[minWeight];
 2073|  45.5k|        MEM_writeLE16(&(DElt.sequence), baseSeq);
 2074|  45.5k|        DElt.nbBits   = (BYTE)(consumed);
 2075|  45.5k|        DElt.length   = 1;
 2076|   418k|        for (i = 0; i < skipSize; i++)
  ------------------
  |  Branch (2076:21): [True: 372k, False: 45.5k]
  ------------------
 2077|   372k|            DTable[i] = DElt;
 2078|  45.5k|    }
 2079|       |
 2080|       |    /* fill DTable */
 2081|   335k|    for (s=0; s<sortedListSize; s++) {   /* note : sortedSymbols already skipped */
  ------------------
  |  Branch (2081:15): [True: 285k, False: 49.7k]
  ------------------
 2082|   285k|        const U32 symbol = sortedSymbols[s].symbol;
 2083|   285k|        const U32 weight = sortedSymbols[s].weight;
 2084|   285k|        const U32 nbBits = nbBitsBaseline - weight;
 2085|   285k|        const U32 length = 1 << (sizeLog-nbBits);
 2086|   285k|        const U32 start = rankVal[weight];
 2087|   285k|        U32 i = start;
 2088|   285k|        const U32 end = start + length;
 2089|       |
 2090|   285k|        MEM_writeLE16(&(DElt.sequence), (U16)(baseSeq + (symbol << 8)));
 2091|   285k|        DElt.nbBits = (BYTE)(nbBits + consumed);
 2092|   285k|        DElt.length = 2;
 2093|  2.63M|        do { DTable[i++] = DElt; } while (i<end);   /* since length >= 1 */
  ------------------
  |  Branch (2093:43): [True: 2.34M, False: 285k]
  ------------------
 2094|       |
 2095|   285k|        rankVal[weight] += length;
 2096|   285k|    }
 2097|  49.7k|}
zstd_v05.c:HUFv05_decodeStreamX4:
 2258|    142|{
 2259|    142|    BYTE* const pStart = p;
 2260|       |
 2261|       |    /* up to 8 symbols at a time */
 2262|  17.9k|    while ((BITv05_reloadDStream(bitDPtr) == BITv05_DStream_unfinished) && (p < pEnd-7)) {
  ------------------
  |  Branch (2262:12): [True: 17.8k, False: 109]
  |  Branch (2262:76): [True: 17.7k, False: 33]
  ------------------
 2263|  17.7k|        HUFv05_DECODE_SYMBOLX4_2(p, bitDPtr);
  ------------------
  |  | 2254|  17.7k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2254:9): [True: 17.7k, False: 0]
  |  |  ------------------
  |  | 2255|  17.7k|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2264|  17.7k|        HUFv05_DECODE_SYMBOLX4_1(p, bitDPtr);
  ------------------
  |  | 2250|  17.7k|    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: 17.7k, False: 0]
  |  |  |  Branch (2250:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2251|  17.7k|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2265|  17.7k|        HUFv05_DECODE_SYMBOLX4_2(p, bitDPtr);
  ------------------
  |  | 2254|  17.7k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2254:9): [True: 17.7k, False: 0]
  |  |  ------------------
  |  | 2255|  17.7k|        ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2266|  17.7k|        HUFv05_DECODE_SYMBOLX4_0(p, bitDPtr);
  ------------------
  |  | 2247|  17.7k|    ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2267|  17.7k|    }
 2268|       |
 2269|       |    /* closer to the end */
 2270|    207|    while ((BITv05_reloadDStream(bitDPtr) == BITv05_DStream_unfinished) && (p <= pEnd-2))
  ------------------
  |  Branch (2270:12): [True: 96, False: 111]
  |  Branch (2270:76): [True: 65, False: 31]
  ------------------
 2271|     65|        HUFv05_DECODE_SYMBOLX4_0(p, bitDPtr);
  ------------------
  |  | 2247|     65|    ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2272|       |
 2273|   163k|    while (p <= pEnd-2)
  ------------------
  |  Branch (2273:12): [True: 163k, False: 142]
  ------------------
 2274|   163k|        HUFv05_DECODE_SYMBOLX4_0(p, bitDPtr);   /* no need to reload : reached the end of DStream */
  ------------------
  |  | 2247|   163k|    ptr += HUFv05_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2275|       |
 2276|    142|    if (p < pEnd)
  ------------------
  |  Branch (2276:9): [True: 102, False: 40]
  ------------------
 2277|    102|        p += HUFv05_decodeLastSymbolX4(p, bitDPtr, dt, dtLog);
 2278|       |
 2279|    142|    return p-pStart;
 2280|    142|}
zstd_v05.c:HUFv05_decodeLastSymbolX4:
 2232|    102|{
 2233|    102|    const size_t val = BITv05_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */
 2234|    102|    memcpy(op, dt+val, 1);
 2235|    102|    if (dt[val].length==1) BITv05_skipBits(DStream, dt[val].nbBits);
  ------------------
  |  Branch (2235:9): [True: 47, False: 55]
  ------------------
 2236|     55|    else {
 2237|     55|        if (DStream->bitsConsumed < (sizeof(DStream->bitContainer)*8)) {
  ------------------
  |  Branch (2237:13): [True: 18, False: 37]
  ------------------
 2238|     18|            BITv05_skipBits(DStream, dt[val].nbBits);
 2239|     18|            if (DStream->bitsConsumed > (sizeof(DStream->bitContainer)*8))
  ------------------
  |  Branch (2239:17): [True: 1, False: 17]
  ------------------
 2240|      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 */
 2241|     18|    }   }
 2242|    102|    return 1;
 2243|    102|}
zstd_v05.c:HUFv05_decodeSymbolX4:
 2224|   246k|{
 2225|   246k|    const size_t val = BITv05_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */
 2226|   246k|    memcpy(op, dt+val, 2);
 2227|   246k|    BITv05_skipBits(DStream, dt[val].nbBits);
 2228|   246k|    return dt[val].length;
 2229|   246k|}
zstd_v05.c:ZSTDv05_checkContinuity:
 3330|  4.89k|{
 3331|  4.89k|    if (dst != dctx->previousDstEnd) {   /* not contiguous */
  ------------------
  |  Branch (3331:9): [True: 4.89k, False: 0]
  ------------------
 3332|  4.89k|        dctx->dictEnd = dctx->previousDstEnd;
 3333|  4.89k|        dctx->vBase = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3334|  4.89k|        dctx->base = dst;
 3335|  4.89k|        dctx->previousDstEnd = dst;
 3336|  4.89k|    }
 3337|  4.89k|}
zstd_v05.c:ZSTDv05_decompressBlock_internal:
 3343|  3.25k|{   /* blockType == blockCompressed */
 3344|  3.25k|    const BYTE* ip = (const BYTE*)src;
 3345|  3.25k|    size_t litCSize;
 3346|       |
 3347|  3.25k|    if (srcSize >= BLOCKSIZE) return ERROR(srcSize_wrong);
  ------------------
  |  |  396|  3.25k|#define BLOCKSIZE (128 KB)                 /* define, for static allocation */
  |  |  ------------------
  |  |  |  |  392|  3.25k|#define KB *(1 <<10)
  |  |  ------------------
  ------------------
                  if (srcSize >= BLOCKSIZE) return ERROR(srcSize_wrong);
  ------------------
  |  |   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 (3347:9): [True: 10, False: 3.24k]
  ------------------
 3348|       |
 3349|       |    /* Decode literals sub-block */
 3350|  3.24k|    litCSize = ZSTDv05_decodeLiteralsBlock(dctx, src, srcSize);
 3351|  3.24k|    if (ZSTDv05_isError(litCSize)) return litCSize;
  ------------------
  |  Branch (3351:9): [True: 2.36k, False: 879]
  ------------------
 3352|    879|    ip += litCSize;
 3353|    879|    srcSize -= litCSize;
 3354|       |
 3355|    879|    return ZSTDv05_decompressSequences(dctx, dst, dstCapacity, ip, srcSize);
 3356|  3.24k|}
zstd_v05.c:ZSTDv05_decodeLiteralsBlock:
 2812|  3.24k|{
 2813|  3.24k|    const BYTE* const istart = (const BYTE*) src;
 2814|       |
 2815|       |    /* any compressed block with literals segment must be at least this size */
 2816|  3.24k|    if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  |  439|  3.24k|#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */ + MIN_SEQUENCES_SIZE /* nbSeq==0 */)   /* for a non-null block */
  |  |  ------------------
  |  |  |  |  438|  3.24k|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  |  |  ------------------
  ------------------
                  if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  |   49|  1.39k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  1.39k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.39k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2816:9): [True: 1.39k, False: 1.85k]
  ------------------
 2817|       |
 2818|  1.85k|    switch(istart[0]>> 6)
 2819|  1.85k|    {
 2820|    864|    case IS_HUFv05:
  ------------------
  |  |  409|    864|#define IS_HUFv05 0
  ------------------
  |  Branch (2820:5): [True: 864, False: 994]
  ------------------
 2821|    864|        {
 2822|    864|            size_t litSize, litCSize, singleStream=0;
 2823|    864|            U32 lhSize = ((istart[0]) >> 4) & 3;
 2824|    864|            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: 863]
  ------------------
 2825|    863|            switch(lhSize)
 2826|    863|            {
 2827|    644|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (2827:13): [True: 413, False: 450]
  |  Branch (2827:21): [True: 231, False: 632]
  |  Branch (2827:29): [True: 0, False: 863]
  ------------------
 2828|       |                /* 2 - 2 - 10 - 10 */
 2829|    644|                lhSize=3;
 2830|    644|                singleStream = istart[0] & 16;
 2831|    644|                litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 2832|    644|                litCSize = ((istart[1] &  3) << 8) + istart[2];
 2833|    644|                break;
 2834|    104|            case 2:
  ------------------
  |  Branch (2834:13): [True: 104, False: 759]
  ------------------
 2835|       |                /* 2 - 2 - 14 - 14 */
 2836|    104|                lhSize=4;
 2837|    104|                litSize  = ((istart[0] & 15) << 10) + (istart[1] << 2) + (istart[2] >> 6);
 2838|    104|                litCSize = ((istart[2] & 63) <<  8) + istart[3];
 2839|    104|                break;
 2840|    115|            case 3:
  ------------------
  |  Branch (2840:13): [True: 115, False: 748]
  ------------------
 2841|       |                /* 2 - 2 - 18 - 18 */
 2842|    115|                lhSize=5;
 2843|    115|                litSize  = ((istart[0] & 15) << 14) + (istart[1] << 6) + (istart[2] >> 2);
 2844|    115|                litCSize = ((istart[2] &  3) << 16) + (istart[3] << 8) + istart[4];
 2845|    115|                break;
 2846|    863|            }
 2847|    863|            if (litSize > BLOCKSIZE) return ERROR(corruption_detected);
  ------------------
  |  |  396|    863|#define BLOCKSIZE (128 KB)                 /* define, for static allocation */
  |  |  ------------------
  |  |  |  |  392|    863|#define KB *(1 <<10)
  |  |  ------------------
  ------------------
                          if (litSize > BLOCKSIZE) 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 (2847:17): [True: 2, False: 861]
  ------------------
 2848|    861|            if (litCSize + lhSize > srcSize) 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 (2848:17): [True: 49, False: 812]
  ------------------
 2849|       |
 2850|    812|            if (HUFv05_isError(singleStream ?
  ------------------
  |  Branch (2850:17): [True: 769, False: 43]
  |  Branch (2850:32): [True: 226, False: 586]
  ------------------
 2851|    226|                            HUFv05_decompress1X2(dctx->litBuffer, litSize, istart+lhSize, litCSize) :
 2852|    812|                            HUFv05_decompress   (dctx->litBuffer, litSize, istart+lhSize, litCSize) ))
 2853|    769|                return ERROR(corruption_detected);
  ------------------
  |  |   49|    769|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    769|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    769|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2854|       |
 2855|     43|            dctx->litPtr = dctx->litBuffer;
 2856|     43|            dctx->litSize = litSize;
 2857|     43|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  441|     43|#define WILDCOPY_OVERLENGTH 8
  ------------------
 2858|     43|            return litCSize + lhSize;
 2859|    812|        }
 2860|    113|    case IS_PCH:
  ------------------
  |  |  410|    113|#define IS_PCH 1
  ------------------
  |  Branch (2860:5): [True: 113, False: 1.74k]
  ------------------
 2861|    113|        {
 2862|    113|            size_t errorCode;
 2863|    113|            size_t litSize, litCSize;
 2864|    113|            U32 lhSize = ((istart[0]) >> 4) & 3;
 2865|    113|            if (lhSize != 1)  /* only case supported for now : small litSize, single stream */
  ------------------
  |  Branch (2865:17): [True: 3, False: 110]
  ------------------
 2866|      3|                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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2867|    110|            if (!dctx->flagStaticTables)
  ------------------
  |  Branch (2867:17): [True: 17, False: 93]
  ------------------
 2868|     17|                return ERROR(dictionary_corrupted);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2869|       |
 2870|       |            /* 2 - 2 - 10 - 10 */
 2871|     93|            lhSize=3;
 2872|     93|            litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 2873|     93|            litCSize = ((istart[1] &  3) << 8) + istart[2];
 2874|     93|            if (litCSize + lhSize > srcSize) 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 (2874:17): [True: 3, False: 90]
  ------------------
 2875|       |
 2876|     90|            errorCode = HUFv05_decompress1X4_usingDTable(dctx->litBuffer, litSize, istart+lhSize, litCSize, dctx->hufTableX4);
 2877|     90|            if (HUFv05_isError(errorCode)) 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 (2877:17): [True: 87, False: 3]
  ------------------
 2878|       |
 2879|      3|            dctx->litPtr = dctx->litBuffer;
 2880|      3|            dctx->litSize = litSize;
 2881|      3|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  441|      3|#define WILDCOPY_OVERLENGTH 8
  ------------------
 2882|      3|            return litCSize + lhSize;
 2883|     90|        }
 2884|    315|    case IS_RAW:
  ------------------
  |  |  411|    315|#define IS_RAW 2
  ------------------
  |  Branch (2884:5): [True: 315, False: 1.54k]
  ------------------
 2885|    315|        {
 2886|    315|            size_t litSize;
 2887|    315|            U32 lhSize = ((istart[0]) >> 4) & 3;
 2888|    315|            switch(lhSize)
 2889|    315|            {
 2890|    264|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (2890:13): [True: 223, False: 92]
  |  Branch (2890:21): [True: 41, False: 274]
  |  Branch (2890:29): [True: 0, False: 315]
  ------------------
 2891|    264|                lhSize=1;
 2892|    264|                litSize = istart[0] & 31;
 2893|    264|                break;
 2894|     30|            case 2:
  ------------------
  |  Branch (2894:13): [True: 30, False: 285]
  ------------------
 2895|     30|                litSize = ((istart[0] & 15) << 8) + istart[1];
 2896|     30|                break;
 2897|     21|            case 3:
  ------------------
  |  Branch (2897:13): [True: 21, False: 294]
  ------------------
 2898|     21|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 2899|     21|                break;
 2900|    315|            }
 2901|       |
 2902|    315|            if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */
  ------------------
  |  |  441|    315|#define WILDCOPY_OVERLENGTH 8
  ------------------
  |  Branch (2902:17): [True: 148, False: 167]
  ------------------
 2903|    148|                if (litSize+lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|     32|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     32|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     32|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2903:21): [True: 32, False: 116]
  ------------------
 2904|    116|                memcpy(dctx->litBuffer, istart+lhSize, litSize);
 2905|    116|                dctx->litPtr = dctx->litBuffer;
 2906|    116|                dctx->litSize = litSize;
 2907|    116|                memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  441|    116|#define WILDCOPY_OVERLENGTH 8
  ------------------
 2908|    116|                return lhSize+litSize;
 2909|    148|            }
 2910|       |            /* direct reference into compressed stream */
 2911|    167|            dctx->litPtr = istart+lhSize;
 2912|    167|            dctx->litSize = litSize;
 2913|    167|            return lhSize+litSize;
 2914|    315|        }
 2915|    566|    case IS_RLE:
  ------------------
  |  |  412|    566|#define IS_RLE 3
  ------------------
  |  Branch (2915:5): [True: 566, False: 1.29k]
  ------------------
 2916|    566|        {
 2917|    566|            size_t litSize;
 2918|    566|            U32 lhSize = ((istart[0]) >> 4) & 3;
 2919|    566|            switch(lhSize)
 2920|    566|            {
 2921|    383|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (2921:13): [True: 51, False: 515]
  |  Branch (2921:21): [True: 332, False: 234]
  |  Branch (2921:29): [True: 0, False: 566]
  ------------------
 2922|    383|                lhSize = 1;
 2923|    383|                litSize = istart[0] & 31;
 2924|    383|                break;
 2925|    124|            case 2:
  ------------------
  |  Branch (2925:13): [True: 124, False: 442]
  ------------------
 2926|    124|                litSize = ((istart[0] & 15) << 8) + istart[1];
 2927|    124|                break;
 2928|     59|            case 3:
  ------------------
  |  Branch (2928:13): [True: 59, False: 507]
  ------------------
 2929|     59|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 2930|     59|                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: 58]
  ------------------
 2931|     58|                break;
 2932|    566|            }
 2933|    565|            if (litSize > BLOCKSIZE) return ERROR(corruption_detected);
  ------------------
  |  |  396|    565|#define BLOCKSIZE (128 KB)                 /* define, for static allocation */
  |  |  ------------------
  |  |  |  |  392|    565|#define KB *(1 <<10)
  |  |  ------------------
  ------------------
                          if (litSize > BLOCKSIZE) 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 (2933:17): [True: 15, False: 550]
  ------------------
 2934|    550|            memset(dctx->litBuffer, istart[lhSize], litSize + WILDCOPY_OVERLENGTH);
  ------------------
  |  |  441|    550|#define WILDCOPY_OVERLENGTH 8
  ------------------
 2935|    550|            dctx->litPtr = dctx->litBuffer;
 2936|    550|            dctx->litSize = litSize;
 2937|    550|            return lhSize+1;
 2938|    565|        }
 2939|      0|    default:
  ------------------
  |  Branch (2939:5): [True: 0, False: 1.85k]
  ------------------
 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|  1.85k|    }
 2942|  1.85k|}
zstd_v05.c:ZSTDv05_decompressSequences:
 3260|    879|{
 3261|    879|    const BYTE* ip = (const BYTE*)seqStart;
 3262|    879|    const BYTE* const iend = ip + seqSize;
 3263|    879|    BYTE* const ostart = (BYTE*)dst;
 3264|    879|    BYTE* op = ostart;
 3265|    879|    BYTE* const oend = ostart + maxDstSize;
 3266|    879|    size_t errorCode, dumpsLength=0;
 3267|    879|    const BYTE* litPtr = dctx->litPtr;
 3268|    879|    const BYTE* const litEnd = litPtr + dctx->litSize;
 3269|    879|    int nbSeq=0;
 3270|    879|    const BYTE* dumps = NULL;
 3271|    879|    unsigned* DTableLL = dctx->LLTable;
 3272|    879|    unsigned* DTableML = dctx->MLTable;
 3273|    879|    unsigned* DTableOffb = dctx->OffTable;
 3274|    879|    const BYTE* const base = (const BYTE*) (dctx->base);
 3275|    879|    const BYTE* const vBase = (const BYTE*) (dctx->vBase);
 3276|    879|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 3277|       |
 3278|       |    /* Build Decoding Tables */
 3279|    879|    errorCode = ZSTDv05_decodeSeqHeaders(&nbSeq, &dumps, &dumpsLength,
 3280|    879|                                      DTableLL, DTableML, DTableOffb,
 3281|    879|                                      ip, seqSize, dctx->flagStaticTables);
 3282|    879|    if (ZSTDv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (3282:9): [True: 123, False: 756]
  ------------------
 3283|    756|    ip += errorCode;
 3284|       |
 3285|       |    /* Regen sequences */
 3286|    756|    if (nbSeq) {
  ------------------
  |  Branch (3286:9): [True: 504, False: 252]
  ------------------
 3287|    504|        seq_t sequence;
 3288|    504|        seqState_t seqState;
 3289|       |
 3290|    504|        memset(&sequence, 0, sizeof(sequence));
 3291|    504|        sequence.offset = REPCODE_STARTVALUE;
  ------------------
  |  |  415|    504|#define REPCODE_STARTVALUE 1
  ------------------
 3292|    504|        seqState.dumps = dumps;
 3293|    504|        seqState.dumpsEnd = dumps + dumpsLength;
 3294|    504|        seqState.prevOffset = REPCODE_STARTVALUE;
  ------------------
  |  |  415|    504|#define REPCODE_STARTVALUE 1
  ------------------
 3295|    504|        errorCode = BITv05_initDStream(&(seqState.DStream), ip, iend-ip);
 3296|    504|        if (ERR_isError(errorCode)) return ERROR(corruption_detected);
  ------------------
  |  |   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 (3296:13): [True: 28, False: 476]
  ------------------
 3297|    476|        FSEv05_initDState(&(seqState.stateLL), &(seqState.DStream), DTableLL);
 3298|    476|        FSEv05_initDState(&(seqState.stateOffb), &(seqState.DStream), DTableOffb);
 3299|    476|        FSEv05_initDState(&(seqState.stateML), &(seqState.DStream), DTableML);
 3300|       |
 3301|  62.5k|        for ( ; (BITv05_reloadDStream(&(seqState.DStream)) <= BITv05_DStream_completed) && nbSeq ; ) {
  ------------------
  |  Branch (3301:17): [True: 62.5k, False: 69]
  |  Branch (3301:92): [True: 62.4k, False: 94]
  ------------------
 3302|  62.4k|            size_t oneSeqSize;
 3303|  62.4k|            nbSeq--;
 3304|  62.4k|            ZSTDv05_decodeSequence(&sequence, &seqState);
 3305|  62.4k|            oneSeqSize = ZSTDv05_execSequence(op, oend, sequence, &litPtr, litEnd, base, vBase, dictEnd);
 3306|  62.4k|            if (ZSTDv05_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  Branch (3306:17): [True: 313, False: 62.1k]
  ------------------
 3307|  62.1k|            op += oneSeqSize;
 3308|  62.1k|        }
 3309|       |
 3310|       |        /* check if reached exact end */
 3311|    163|        if (nbSeq) 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 (3311:13): [True: 45, False: 118]
  ------------------
 3312|    163|    }
 3313|       |
 3314|       |    /* last literal segment */
 3315|    370|    {
 3316|    370|        size_t lastLLSize = litEnd - litPtr;
 3317|    370|        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: 370]
  ------------------
 3318|    370|        if (op+lastLLSize > oend) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   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 (3318:13): [True: 14, False: 356]
  ------------------
 3319|    356|        if (lastLLSize > 0) {
  ------------------
  |  Branch (3319:13): [True: 333, False: 23]
  ------------------
 3320|    333|            memcpy(op, litPtr, lastLLSize);
 3321|    333|            op += lastLLSize;
 3322|    333|        }
 3323|    356|    }
 3324|       |
 3325|      0|    return op-ostart;
 3326|    370|}
zstd_v05.c:ZSTDv05_decodeSeqHeaders:
 2948|    879|{
 2949|    879|    const BYTE* const istart = (const BYTE*)src;
 2950|    879|    const BYTE* ip = istart;
 2951|    879|    const BYTE* const iend = istart + srcSize;
 2952|    879|    U32 LLtype, Offtype, MLtype;
 2953|    879|    unsigned LLlog, Offlog, MLlog;
 2954|    879|    size_t dumpsLength;
 2955|       |
 2956|       |    /* check */
 2957|    879|    if (srcSize < MIN_SEQUENCES_SIZE)
  ------------------
  |  |  438|    879|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  ------------------
  |  Branch (2957:9): [True: 6, False: 873]
  ------------------
 2958|      6|        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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2959|       |
 2960|       |    /* SeqHead */
 2961|    873|    *nbSeq = *ip++;
 2962|    873|    if (*nbSeq==0) return 1;
  ------------------
  |  Branch (2962:9): [True: 119, False: 754]
  ------------------
 2963|    754|    if (*nbSeq >= 128) {
  ------------------
  |  Branch (2963:9): [True: 293, False: 461]
  ------------------
 2964|    293|        if (ip >= iend) return 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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2964:13): [True: 13, False: 280]
  ------------------
 2965|    280|        *nbSeq = ((nbSeq[0]-128)<<8) + *ip++;
 2966|    280|    }
 2967|       |
 2968|    741|    if (ip >= iend) return ERROR(srcSize_wrong);
  ------------------
  |  |   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 (2968:9): [True: 7, False: 734]
  ------------------
 2969|    734|    LLtype  = *ip >> 6;
 2970|    734|    Offtype = (*ip >> 4) & 3;
 2971|    734|    MLtype  = (*ip >> 2) & 3;
 2972|    734|    if (*ip & 2) {
  ------------------
  |  Branch (2972:9): [True: 205, False: 529]
  ------------------
 2973|    205|        if (ip+3 > iend) 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 (2973:13): [True: 3, False: 202]
  ------------------
 2974|    202|        dumpsLength  = ip[2];
 2975|    202|        dumpsLength += ip[1] << 8;
 2976|    202|        ip += 3;
 2977|    529|    } else {
 2978|    529|        if (ip+2 > 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 (2978:13): [True: 2, False: 527]
  ------------------
 2979|    527|        dumpsLength  = ip[1];
 2980|    527|        dumpsLength += (ip[0] & 1) << 8;
 2981|    527|        ip += 2;
 2982|    527|    }
 2983|    729|    *dumpsPtr = ip;
 2984|    729|    ip += dumpsLength;
 2985|    729|    *dumpsLengthPtr = dumpsLength;
 2986|       |
 2987|       |    /* check */
 2988|    729|    if (ip > iend-3) return ERROR(srcSize_wrong); /* min : all 3 are "raw", hence no header, but at least xxLog bits per type */
  ------------------
  |  |   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 (2988:9): [True: 13, False: 716]
  ------------------
 2989|       |
 2990|       |    /* sequences */
 2991|    716|    {
 2992|    716|        S16 norm[MaxML+1];    /* assumption : MaxML >= MaxLL >= MaxOff */
 2993|    716|        size_t headerSize;
 2994|       |
 2995|       |        /* Build DTables */
 2996|    716|        switch(LLtype)
 2997|    716|        {
 2998|    135|        case FSEv05_ENCODING_RLE :
  ------------------
  |  |  431|    135|#define FSEv05_ENCODING_RLE     1
  ------------------
  |  Branch (2998:9): [True: 135, False: 581]
  ------------------
 2999|    135|            LLlog = 0;
 3000|    135|            FSEv05_buildDTable_rle(DTableLL, *ip++);
 3001|    135|            break;
 3002|    318|        case FSEv05_ENCODING_RAW :
  ------------------
  |  |  430|    318|#define FSEv05_ENCODING_RAW     0
  ------------------
  |  Branch (3002:9): [True: 318, False: 398]
  ------------------
 3003|    318|            LLlog = LLbits;
  ------------------
  |  |  419|    318|#define LLbits   6
  ------------------
 3004|    318|            FSEv05_buildDTable_raw(DTableLL, LLbits);
  ------------------
  |  |  419|    318|#define LLbits   6
  ------------------
 3005|    318|            break;
 3006|      4|        case FSEv05_ENCODING_STATIC:
  ------------------
  |  |  432|      4|#define FSEv05_ENCODING_STATIC  2
  ------------------
  |  Branch (3006:9): [True: 4, False: 712]
  ------------------
 3007|      4|            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: 3]
  ------------------
 3008|      3|            break;
 3009|    259|        case FSEv05_ENCODING_DYNAMIC :
  ------------------
  |  |  433|    259|#define FSEv05_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3009:9): [True: 259, False: 457]
  ------------------
 3010|    259|        default :   /* impossible */
  ------------------
  |  Branch (3010:9): [True: 0, False: 716]
  ------------------
 3011|    259|            {   unsigned max = MaxLL;
  ------------------
  |  |  423|    259|#define MaxLL  ((1<<LLbits) - 1)
  |  |  ------------------
  |  |  |  |  419|    259|#define LLbits   6
  |  |  ------------------
  ------------------
 3012|    259|                headerSize = FSEv05_readNCount(norm, &max, &LLlog, ip, iend-ip);
 3013|    259|                if (FSEv05_isError(headerSize)) return ERROR(GENERIC);
  ------------------
  |  |   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 (3013:21): [True: 14, False: 245]
  ------------------
 3014|    245|                if (LLlog > LLFSEv05Log) return ERROR(corruption_detected);
  ------------------
  |  |  426|    245|#define LLFSEv05Log   10
  ------------------
                              if (LLlog > LLFSEv05Log) 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 (3014:21): [True: 3, False: 242]
  ------------------
 3015|    242|                ip += headerSize;
 3016|    242|                FSEv05_buildDTable(DTableLL, norm, max, LLlog);
 3017|    242|        }   }
 3018|       |
 3019|    698|        switch(Offtype)
 3020|    698|        {
 3021|    223|        case FSEv05_ENCODING_RLE :
  ------------------
  |  |  431|    223|#define FSEv05_ENCODING_RLE     1
  ------------------
  |  Branch (3021:9): [True: 223, False: 475]
  ------------------
 3022|    223|            Offlog = 0;
 3023|    223|            if (ip > iend-2) return ERROR(srcSize_wrong);   /* min : "raw", hence no header, but at least xxLog bits */
  ------------------
  |  |   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 (3023:17): [True: 9, False: 214]
  ------------------
 3024|    214|            FSEv05_buildDTable_rle(DTableOffb, *ip++ & MaxOff); /* if *ip > MaxOff, data is corrupted */
  ------------------
  |  |  424|    214|#define MaxOff ((1<<Offbits)- 1)
  |  |  ------------------
  |  |  |  |  420|    214|#define Offbits  5
  |  |  ------------------
  ------------------
 3025|    214|            break;
 3026|    274|        case FSEv05_ENCODING_RAW :
  ------------------
  |  |  430|    274|#define FSEv05_ENCODING_RAW     0
  ------------------
  |  Branch (3026:9): [True: 274, False: 424]
  ------------------
 3027|    274|            Offlog = Offbits;
  ------------------
  |  |  420|    274|#define Offbits  5
  ------------------
 3028|    274|            FSEv05_buildDTable_raw(DTableOffb, Offbits);
  ------------------
  |  |  420|    274|#define Offbits  5
  ------------------
 3029|    274|            break;
 3030|      6|        case FSEv05_ENCODING_STATIC:
  ------------------
  |  |  432|      6|#define FSEv05_ENCODING_STATIC  2
  ------------------
  |  Branch (3030:9): [True: 6, False: 692]
  ------------------
 3031|      6|            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: 3]
  ------------------
 3032|      3|            break;
 3033|    195|        case FSEv05_ENCODING_DYNAMIC :
  ------------------
  |  |  433|    195|#define FSEv05_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3033:9): [True: 195, False: 503]
  ------------------
 3034|    195|        default :   /* impossible */
  ------------------
  |  Branch (3034:9): [True: 0, False: 698]
  ------------------
 3035|    195|            {   unsigned max = MaxOff;
  ------------------
  |  |  424|    195|#define MaxOff ((1<<Offbits)- 1)
  |  |  ------------------
  |  |  |  |  420|    195|#define Offbits  5
  |  |  ------------------
  ------------------
 3036|    195|                headerSize = FSEv05_readNCount(norm, &max, &Offlog, ip, iend-ip);
 3037|    195|                if (FSEv05_isError(headerSize)) return ERROR(GENERIC);
  ------------------
  |  |   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 (3037:21): [True: 11, False: 184]
  ------------------
 3038|    184|                if (Offlog > OffFSEv05Log) return ERROR(corruption_detected);
  ------------------
  |  |  427|    184|#define OffFSEv05Log   9
  ------------------
                              if (Offlog > OffFSEv05Log) 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 (3038:21): [True: 5, False: 179]
  ------------------
 3039|    179|                ip += headerSize;
 3040|    179|                FSEv05_buildDTable(DTableOffb, norm, max, Offlog);
 3041|    179|        }   }
 3042|       |
 3043|    670|        switch(MLtype)
 3044|    670|        {
 3045|    171|        case FSEv05_ENCODING_RLE :
  ------------------
  |  |  431|    171|#define FSEv05_ENCODING_RLE     1
  ------------------
  |  Branch (3045:9): [True: 171, False: 499]
  ------------------
 3046|    171|            MLlog = 0;
 3047|    171|            if (ip > iend-2) return ERROR(srcSize_wrong); /* min : "raw", hence no header, but at least xxLog bits */
  ------------------
  |  |   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 (3047:17): [True: 4, False: 167]
  ------------------
 3048|    167|            FSEv05_buildDTable_rle(DTableML, *ip++);
 3049|    167|            break;
 3050|    326|        case FSEv05_ENCODING_RAW :
  ------------------
  |  |  430|    326|#define FSEv05_ENCODING_RAW     0
  ------------------
  |  Branch (3050:9): [True: 326, False: 344]
  ------------------
 3051|    326|            MLlog = MLbits;
  ------------------
  |  |  418|    326|#define MLbits   7
  ------------------
 3052|    326|            FSEv05_buildDTable_raw(DTableML, MLbits);
  ------------------
  |  |  418|    326|#define MLbits   7
  ------------------
 3053|    326|            break;
 3054|      5|        case FSEv05_ENCODING_STATIC:
  ------------------
  |  |  432|      5|#define FSEv05_ENCODING_STATIC  2
  ------------------
  |  Branch (3054:9): [True: 5, False: 665]
  ------------------
 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|    168|        case FSEv05_ENCODING_DYNAMIC :
  ------------------
  |  |  433|    168|#define FSEv05_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3057:9): [True: 168, False: 502]
  ------------------
 3058|    168|        default :   /* impossible */
  ------------------
  |  Branch (3058:9): [True: 0, False: 670]
  ------------------
 3059|    168|            {   unsigned max = MaxML;
  ------------------
  |  |  422|    168|#define MaxML  ((1<<MLbits) - 1)
  |  |  ------------------
  |  |  |  |  418|    168|#define MLbits   7
  |  |  ------------------
  ------------------
 3060|    168|                headerSize = FSEv05_readNCount(norm, &max, &MLlog, ip, iend-ip);
 3061|    168|                if (FSEv05_isError(headerSize)) return ERROR(GENERIC);
  ------------------
  |  |   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 (3061:21): [True: 23, False: 145]
  ------------------
 3062|    145|                if (MLlog > MLFSEv05Log) return ERROR(corruption_detected);
  ------------------
  |  |  425|    145|#define MLFSEv05Log   10
  ------------------
                              if (MLlog > MLFSEv05Log) 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 (3062:21): [True: 2, False: 143]
  ------------------
 3063|    143|                ip += headerSize;
 3064|    143|                FSEv05_buildDTable(DTableML, norm, max, MLlog);
 3065|    143|    }   }   }
 3066|       |
 3067|    637|    return ip-istart;
 3068|    670|}
zstd_v05.c:ZSTDv05_decodeSequence:
 3090|  62.4k|{
 3091|  62.4k|    size_t litLength;
 3092|  62.4k|    size_t prevOffset;
 3093|  62.4k|    size_t offset;
 3094|  62.4k|    size_t matchLength;
 3095|  62.4k|    const BYTE* dumps = seqState->dumps;
 3096|  62.4k|    const BYTE* const de = seqState->dumpsEnd;
 3097|       |
 3098|       |    /* Literal length */
 3099|  62.4k|    litLength = FSEv05_peakSymbol(&(seqState->stateLL));
 3100|  62.4k|    prevOffset = litLength ? seq->offset : seqState->prevOffset;
  ------------------
  |  Branch (3100:18): [True: 5.71k, False: 56.7k]
  ------------------
 3101|  62.4k|    if (litLength == MaxLL) {
  ------------------
  |  |  423|  62.4k|#define MaxLL  ((1<<LLbits) - 1)
  |  |  ------------------
  |  |  |  |  419|  62.4k|#define LLbits   6
  |  |  ------------------
  ------------------
  |  Branch (3101:9): [True: 321, False: 62.0k]
  ------------------
 3102|    321|        const U32 add = *dumps++;
 3103|    321|        if (add < 255) litLength += add;
  ------------------
  |  Branch (3103:13): [True: 242, False: 79]
  ------------------
 3104|     79|        else if (dumps + 2 <= de) {
  ------------------
  |  Branch (3104:18): [True: 33, False: 46]
  ------------------
 3105|     33|            litLength = MEM_readLE16(dumps);
 3106|     33|            dumps += 2;
 3107|     33|            if ((litLength & 1) && dumps < de) {
  ------------------
  |  Branch (3107:17): [True: 25, False: 8]
  |  Branch (3107:36): [True: 21, False: 4]
  ------------------
 3108|     21|                litLength += *dumps << 16;
 3109|     21|                dumps += 1;
 3110|     21|            }
 3111|     33|            litLength>>=1;
 3112|     33|        }
 3113|    321|        if (dumps >= de) { dumps = de-1; }  /* late correction, to avoid read overflow (data is now corrupted anyway) */
  ------------------
  |  Branch (3113:13): [True: 183, False: 138]
  ------------------
 3114|    321|    }
 3115|       |
 3116|       |    /* Offset */
 3117|  62.4k|    {
 3118|  62.4k|        static const U32 offsetPrefix[MaxOff+1] = {
 3119|  62.4k|                1 /*fake*/, 1, 2, 4, 8, 16, 32, 64, 128, 256,
 3120|  62.4k|                512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144,
 3121|  62.4k|                524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, /*fake*/ 1, 1, 1, 1, 1 };
 3122|  62.4k|        U32 offsetCode = FSEv05_peakSymbol(&(seqState->stateOffb));   /* <= maxOff, by table construction */
 3123|  62.4k|        U32 nbBits = offsetCode - 1;
 3124|  62.4k|        if (offsetCode==0) nbBits = 0;   /* cmove */
  ------------------
  |  Branch (3124:13): [True: 57.4k, False: 4.94k]
  ------------------
 3125|  62.4k|        offset = offsetPrefix[offsetCode] + BITv05_readBits(&(seqState->DStream), nbBits);
 3126|  62.4k|        if (MEM_32bits()) BITv05_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3126:13): [True: 0, False: 62.4k]
  ------------------
 3127|  62.4k|        if (offsetCode==0) offset = prevOffset;   /* repcode, cmove */
  ------------------
  |  Branch (3127:13): [True: 57.4k, False: 4.94k]
  ------------------
 3128|  62.4k|        if (offsetCode | !litLength) seqState->prevOffset = seq->offset;   /* cmove */
  ------------------
  |  Branch (3128:13): [True: 59.0k, False: 3.39k]
  ------------------
 3129|  62.4k|        FSEv05_decodeSymbol(&(seqState->stateOffb), &(seqState->DStream));    /* update */
 3130|  62.4k|    }
 3131|       |
 3132|       |    /* Literal length update */
 3133|  62.4k|    FSEv05_decodeSymbol(&(seqState->stateLL), &(seqState->DStream));   /* update */
 3134|  62.4k|    if (MEM_32bits()) BITv05_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3134:9): [True: 0, False: 62.4k]
  ------------------
 3135|       |
 3136|       |    /* MatchLength */
 3137|  62.4k|    matchLength = FSEv05_decodeSymbol(&(seqState->stateML), &(seqState->DStream));
 3138|  62.4k|    if (matchLength == MaxML) {
  ------------------
  |  |  422|  62.4k|#define MaxML  ((1<<MLbits) - 1)
  |  |  ------------------
  |  |  |  |  418|  62.4k|#define MLbits   7
  |  |  ------------------
  ------------------
  |  Branch (3138:9): [True: 3.52k, False: 58.8k]
  ------------------
 3139|  3.52k|        const U32 add = dumps<de ? *dumps++ : 0;
  ------------------
  |  Branch (3139:25): [True: 3.51k, False: 9]
  ------------------
 3140|  3.52k|        if (add < 255) matchLength += add;
  ------------------
  |  Branch (3140:13): [True: 3.46k, False: 64]
  ------------------
 3141|     64|        else if (dumps + 2 <= de) {
  ------------------
  |  Branch (3141:18): [True: 39, False: 25]
  ------------------
 3142|     39|            matchLength = MEM_readLE16(dumps);
 3143|     39|            dumps += 2;
 3144|     39|            if ((matchLength & 1) && dumps < de) {
  ------------------
  |  Branch (3144:17): [True: 18, False: 21]
  |  Branch (3144:38): [True: 17, False: 1]
  ------------------
 3145|     17|                matchLength += *dumps << 16;
 3146|     17|                dumps += 1;
 3147|     17|            }
 3148|     39|            matchLength >>= 1;
 3149|     39|        }
 3150|  3.52k|        if (dumps >= de) { dumps = de-1; }  /* late correction, to avoid read overflow (data is now corrupted anyway) */
  ------------------
  |  Branch (3150:13): [True: 1.53k, False: 1.99k]
  ------------------
 3151|  3.52k|    }
 3152|  62.4k|    matchLength += MINMATCH;
  ------------------
  |  |  414|  62.4k|#define MINMATCH 4
  ------------------
 3153|       |
 3154|       |    /* save result */
 3155|  62.4k|    seq->litLength = litLength;
 3156|  62.4k|    seq->offset = offset;
 3157|  62.4k|    seq->matchLength = matchLength;
 3158|  62.4k|    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|  62.4k|}
zstd_v05.c:FSEv05_peakSymbol:
  960|   124k|{
  961|   124k|    const FSEv05_decode_t DInfo = ((const FSEv05_decode_t*)(DStatePtr->table))[DStatePtr->state];
  962|   124k|    return DInfo.symbol;
  963|   124k|}
zstd_v05.c:ZSTDv05_execSequence:
 3175|  62.4k|{
 3176|  62.4k|    static const int dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
 3177|  62.4k|    static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
 3178|  62.4k|    BYTE* const oLitEnd = op + sequence.litLength;
 3179|  62.4k|    const size_t sequenceLength = sequence.litLength + sequence.matchLength;
 3180|  62.4k|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 3181|  62.4k|    BYTE* const oend_8 = oend-8;
 3182|  62.4k|    const BYTE* const litEnd = *litPtr + sequence.litLength;
 3183|  62.4k|    const BYTE* match = oLitEnd - sequence.offset;
 3184|       |
 3185|       |    /* checks */
 3186|  62.4k|    size_t const seqLength = sequence.litLength + sequence.matchLength;
 3187|       |
 3188|  62.4k|    if (seqLength > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|    179|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    179|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    179|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3188:9): [True: 179, False: 62.2k]
  ------------------
 3189|  62.2k|    if (sequence.litLength > (size_t)(litLimit - *litPtr)) return ERROR(corruption_detected);
  ------------------
  |  |   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 (3189:9): [True: 28, False: 62.2k]
  ------------------
 3190|       |    /* Now we know there are no overflow in literal nor match lengths, can use pointer checks */
 3191|  62.2k|    if (oLitEnd > oend_8) 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 (3191:9): [True: 26, False: 62.1k]
  ------------------
 3192|       |
 3193|  62.1k|    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: 62.1k]
  ------------------
 3194|  62.1k|    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: 62.1k]
  ------------------
 3195|       |
 3196|       |    /* copy Literals */
 3197|  62.1k|    ZSTDv05_wildcopy(op, *litPtr, (ptrdiff_t)sequence.litLength);   /* note : oLitEnd <= oend-8 : no risk of overwrite beyond oend */
 3198|  62.1k|    op = oLitEnd;
 3199|  62.1k|    *litPtr = litEnd;   /* update for next sequence */
 3200|       |
 3201|       |    /* copy Match */
 3202|  62.1k|    if (sequence.offset > (size_t)(oLitEnd - base)) {
  ------------------
  |  Branch (3202:9): [True: 283, False: 61.9k]
  ------------------
 3203|       |        /* offset beyond prefix */
 3204|    283|        if (sequence.offset > (size_t)(oLitEnd - vBase))
  ------------------
  |  Branch (3204:13): [True: 80, False: 203]
  ------------------
 3205|     80|            return ERROR(corruption_detected);
  ------------------
  |  |   49|     80|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     80|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     80|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3206|    203|        match = dictEnd - (base-match);
 3207|    203|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (3207:13): [True: 131, False: 72]
  ------------------
 3208|    131|            memmove(oLitEnd, match, sequence.matchLength);
 3209|    131|            return sequenceLength;
 3210|    131|        }
 3211|       |        /* span extDict & currentPrefixSegment */
 3212|     72|        {
 3213|     72|            size_t length1 = dictEnd - match;
 3214|     72|            memmove(oLitEnd, match, length1);
 3215|     72|            op = oLitEnd + length1;
 3216|     72|            sequence.matchLength -= length1;
 3217|     72|            match = base;
 3218|     72|            if (op > oend_8 || sequence.matchLength < MINMATCH) {
  ------------------
  |  |  414|     68|#define MINMATCH 4
  ------------------
  |  Branch (3218:17): [True: 4, False: 68]
  |  Branch (3218:32): [True: 22, False: 46]
  ------------------
 3219|    100|              while (op < oMatchEnd) *op++ = *match++;
  ------------------
  |  Branch (3219:22): [True: 74, False: 26]
  ------------------
 3220|     26|              return sequenceLength;
 3221|     26|            }
 3222|     72|    }   }
 3223|       |    /* Requirement: op <= oend_8 */
 3224|       |
 3225|       |    /* match within prefix */
 3226|  61.9k|    if (sequence.offset < 8) {
  ------------------
  |  Branch (3226:9): [True: 57.7k, False: 4.18k]
  ------------------
 3227|       |        /* close range match, overlap */
 3228|  57.7k|        const int sub2 = dec64table[sequence.offset];
 3229|  57.7k|        op[0] = match[0];
 3230|  57.7k|        op[1] = match[1];
 3231|  57.7k|        op[2] = match[2];
 3232|  57.7k|        op[3] = match[3];
 3233|  57.7k|        match += dec32table[sequence.offset];
 3234|  57.7k|        ZSTDv05_copy4(op+4, match);
 3235|  57.7k|        match -= sub2;
 3236|  57.7k|    } else {
 3237|  4.18k|        ZSTDv05_copy8(op, match);
 3238|  4.18k|    }
 3239|  61.9k|    op += 8; match += 8;
 3240|       |
 3241|  61.9k|    if (oMatchEnd > oend-(16-MINMATCH)) {
  ------------------
  |  |  414|  61.9k|#define MINMATCH 4
  ------------------
  |  Branch (3241:9): [True: 163, False: 61.7k]
  ------------------
 3242|    163|        if (op < oend_8) {
  ------------------
  |  Branch (3242:13): [True: 36, False: 127]
  ------------------
 3243|     36|            ZSTDv05_wildcopy(op, match, oend_8 - op);
 3244|     36|            match += oend_8 - op;
 3245|     36|            op = oend_8;
 3246|     36|        }
 3247|    286|        while (op < oMatchEnd)
  ------------------
  |  Branch (3247:16): [True: 123, False: 163]
  ------------------
 3248|    123|            *op++ = *match++;
 3249|  61.7k|    } else {
 3250|  61.7k|        ZSTDv05_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8);   /* works even if matchLength < 8 */
 3251|  61.7k|    }
 3252|  61.9k|    return sequenceLength;
 3253|  62.1k|}
zstd_v05.c:ZSTDv05_wildcopy:
  458|   124k|{
  459|   124k|    const BYTE* ip = (const BYTE*)src;
  460|   124k|    BYTE* op = (BYTE*)dst;
  461|   124k|    BYTE* const oend = op + length;
  462|   124k|    do
  463|   471k|        COPY8(op, ip)
  ------------------
  |  |  453|   471k|#define COPY8(d,s) { ZSTDv05_copy8(d,s); d+=8; s+=8; }
  ------------------
  464|   471k|    while (op < oend);
  ------------------
  |  Branch (464:12): [True: 347k, False: 124k]
  ------------------
  465|   124k|}
zstd_v05.c:ZSTDv05_copy4:
 2569|  57.7k|static void ZSTDv05_copy4(void* dst, const void* src) { memcpy(dst, src, 4); }
zstd_v05.c:ZSTDv05_copy8:
  451|   475k|static void ZSTDv05_copy8(void* dst, const void* src) { memcpy(dst, src, 8); }
zstd_v05.c:ZSTDv05_decompress_continueDCtx:
 3373|  4.89k|{
 3374|  4.89k|    const BYTE* ip = (const BYTE*)src;
 3375|  4.89k|    const BYTE* iend = ip + srcSize;
 3376|  4.89k|    BYTE* const ostart = (BYTE*)dst;
 3377|  4.89k|    BYTE* op = ostart;
 3378|  4.89k|    BYTE* const oend = ostart + maxDstSize;
 3379|  4.89k|    size_t remainingSize = srcSize;
 3380|  4.89k|    blockProperties_t blockProperties;
 3381|  4.89k|    memset(&blockProperties, 0, sizeof(blockProperties));
 3382|       |
 3383|       |    /* Frame Header */
 3384|  4.89k|    {   size_t frameHeaderSize;
 3385|  4.89k|        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: 4.89k]
  ------------------
 3386|  4.89k|        frameHeaderSize = ZSTDv05_decodeFrameHeader_Part1(dctx, src, ZSTDv05_frameHeaderSize_min);
 3387|  4.89k|        if (ZSTDv05_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  Branch (3387:13): [True: 0, False: 4.89k]
  ------------------
 3388|  4.89k|        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: 4.89k]
  ------------------
 3389|  4.89k|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3390|  4.89k|        frameHeaderSize = ZSTDv05_decodeFrameHeader_Part2(dctx, src, frameHeaderSize);
 3391|  4.89k|        if (ZSTDv05_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  Branch (3391:13): [True: 40, False: 4.85k]
  ------------------
 3392|  4.89k|    }
 3393|       |
 3394|       |    /* Loop on each block */
 3395|  5.43k|    while (1)
  ------------------
  |  Branch (3395:12): [True: 5.43k, Folded]
  ------------------
 3396|  5.43k|    {
 3397|  5.43k|        size_t decodedSize=0;
 3398|  5.43k|        size_t cBlockSize = ZSTDv05_getcBlockSize(ip, iend-ip, &blockProperties);
 3399|  5.43k|        if (ZSTDv05_isError(cBlockSize)) return cBlockSize;
  ------------------
  |  Branch (3399:13): [True: 0, False: 5.43k]
  ------------------
 3400|       |
 3401|  5.43k|        ip += ZSTDv05_blockHeaderSize;
 3402|  5.43k|        remainingSize -= ZSTDv05_blockHeaderSize;
 3403|  5.43k|        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: 5.43k]
  ------------------
 3404|       |
 3405|  5.43k|        switch(blockProperties.blockType)
 3406|  5.43k|        {
 3407|  3.25k|        case bt_compressed:
  ------------------
  |  Branch (3407:9): [True: 3.25k, False: 2.17k]
  ------------------
 3408|  3.25k|            decodedSize = ZSTDv05_decompressBlock_internal(dctx, op, oend-op, ip, cBlockSize);
 3409|  3.25k|            break;
 3410|    386|        case bt_raw :
  ------------------
  |  Branch (3410:9): [True: 386, False: 5.04k]
  ------------------
 3411|    386|            decodedSize = ZSTDv05_copyRawBlock(op, oend-op, ip, cBlockSize);
 3412|    386|            break;
 3413|     64|        case bt_rle :
  ------------------
  |  Branch (3413:9): [True: 64, False: 5.36k]
  ------------------
 3414|     64|            return ERROR(GENERIC);   /* not yet supported */
  ------------------
  |  |   49|     64|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     64|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     64|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3415|      0|            break;
 3416|  1.72k|        case bt_end :
  ------------------
  |  Branch (3416:9): [True: 1.72k, False: 3.70k]
  ------------------
 3417|       |            /* end of frame */
 3418|  1.72k|            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: 1.72k]
  ------------------
 3419|  1.72k|            break;
 3420|  1.72k|        default:
  ------------------
  |  Branch (3420:9): [True: 0, False: 5.43k]
  ------------------
 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|  5.43k|        }
 3423|  5.36k|        if (cBlockSize == 0) break;   /* bt_end */
  ------------------
  |  Branch (3423:13): [True: 3.27k, False: 2.09k]
  ------------------
 3424|       |
 3425|  2.09k|        if (ZSTDv05_isError(decodedSize)) return decodedSize;
  ------------------
  |  Branch (3425:13): [True: 1.51k, False: 578]
  ------------------
 3426|    578|        op += decodedSize;
 3427|    578|        ip += cBlockSize;
 3428|    578|        remainingSize -= cBlockSize;
 3429|    578|    }
 3430|       |
 3431|  3.27k|    return op-ostart;
 3432|  4.85k|}
zstd_v05.c:ZSTD_errorFrameSizeInfoLegacy:
 3479|     91|{
 3480|     91|    *cSize = ret;
 3481|     91|    *dBound = ZSTD_CONTENTSIZE_ERROR;
  ------------------
  |  |  443|     91|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
 3482|     91|}
zstd_v05.c:ZSTDv05_getcBlockSize:
 2779|  13.0k|{
 2780|  13.0k|    const BYTE* const in = (const BYTE*)src;
 2781|  13.0k|    BYTE headerFlags;
 2782|  13.0k|    U32 cSize;
 2783|       |
 2784|  13.0k|    if (srcSize < 3)
  ------------------
  |  Branch (2784:9): [True: 17, False: 13.0k]
  ------------------
 2785|     17|        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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2786|       |
 2787|  13.0k|    headerFlags = *in;
 2788|  13.0k|    cSize = in[2] + (in[1]<<8) + ((in[0] & 7)<<16);
 2789|       |
 2790|  13.0k|    bpPtr->blockType = (blockType_t)(headerFlags >> 6);
 2791|  13.0k|    bpPtr->origSize = (bpPtr->blockType == bt_rle) ? cSize : 0;
  ------------------
  |  Branch (2791:23): [True: 383, False: 12.6k]
  ------------------
 2792|       |
 2793|  13.0k|    if (bpPtr->blockType == bt_end) return 0;
  ------------------
  |  Branch (2793:9): [True: 4.54k, False: 8.52k]
  ------------------
 2794|  8.52k|    if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (2794:9): [True: 383, False: 8.14k]
  ------------------
 2795|  8.14k|    return cSize;
 2796|  8.52k|}
zstd_v05.c:ZSTDv05_decodeFrameHeader_Part1:
 2740|  4.89k|{
 2741|  4.89k|    U32 magicNumber;
 2742|  4.89k|    if (srcSize != ZSTDv05_frameHeaderSize_min)
  ------------------
  |  Branch (2742:9): [True: 0, False: 4.89k]
  ------------------
 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|  4.89k|    magicNumber = MEM_readLE32(src);
 2745|  4.89k|    if (magicNumber != ZSTDv05_MAGICNUMBER) return ERROR(prefix_unknown);
  ------------------
  |  |  153|  4.89k|#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: 4.89k]
  ------------------
 2746|  4.89k|    zc->headerSize = ZSTDv05_frameHeaderSize_min;
 2747|  4.89k|    return zc->headerSize;
 2748|  4.89k|}
zstd_v05.c:ZSTDv05_decodeFrameHeader_Part2:
 2768|  4.89k|{
 2769|  4.89k|    size_t result;
 2770|  4.89k|    if (srcSize != zc->headerSize)
  ------------------
  |  Branch (2770:9): [True: 0, False: 4.89k]
  ------------------
 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|  4.89k|    result = ZSTDv05_getFrameParams(&(zc->params), src, srcSize);
 2773|  4.89k|    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: 4.89k]
  |  Branch (2773:27): [True: 0, False: 0]
  ------------------
 2774|  4.89k|    return result;
 2775|  4.89k|}
zstd_v05.c:ZSTDv05_copyRawBlock:
 2800|    386|{
 2801|    386|    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: 386]
  ------------------
 2802|    386|    if (srcSize > maxDstSize) 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 (2802:9): [True: 4, False: 382]
  ------------------
 2803|    382|    memcpy(dst, src, srcSize);
 2804|    382|    return srcSize;
 2805|    386|}
zstd_v05.c:ZSTDv05_decompress_insertDictionary:
 3663|  3.25k|{
 3664|  3.25k|    size_t eSize;
 3665|  3.25k|    U32 magic = MEM_readLE32(dict);
 3666|  3.25k|    if (magic != ZSTDv05_DICT_MAGIC) {
  ------------------
  |  |  390|  3.25k|#define ZSTDv05_DICT_MAGIC  0xEC30A435
  ------------------
  |  Branch (3666:9): [True: 475, False: 2.77k]
  ------------------
 3667|       |        /* pure content mode */
 3668|    475|        ZSTDv05_refDictContent(dctx, dict, dictSize);
 3669|    475|        return 0;
 3670|    475|    }
 3671|       |    /* load entropy tables */
 3672|  2.77k|    dict = (const char*)dict + 4;
 3673|  2.77k|    dictSize -= 4;
 3674|  2.77k|    eSize = ZSTDv05_loadEntropy(dctx, dict, dictSize);
 3675|  2.77k|    if (ZSTDv05_isError(eSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|  2.45k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  2.45k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.45k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3675:9): [True: 2.45k, False: 321]
  ------------------
 3676|       |
 3677|       |    /* reference dictionary content */
 3678|    321|    dict = (const char*)dict + eSize;
 3679|    321|    dictSize -= eSize;
 3680|    321|    ZSTDv05_refDictContent(dctx, dict, dictSize);
 3681|       |
 3682|    321|    return 0;
 3683|  2.77k|}
zstd_v05.c:ZSTDv05_refDictContent:
 3614|    796|{
 3615|    796|    dctx->dictEnd = dctx->previousDstEnd;
 3616|    796|    dctx->vBase = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3617|    796|    dctx->base = dict;
 3618|    796|    dctx->previousDstEnd = (const char*)dict + dictSize;
 3619|    796|}
zstd_v05.c:ZSTDv05_loadEntropy:
 3622|  2.77k|{
 3623|  2.77k|    size_t hSize, offcodeHeaderSize, matchlengthHeaderSize, errorCode, litlengthHeaderSize;
 3624|  2.77k|    short offcodeNCount[MaxOff+1];
 3625|  2.77k|    unsigned offcodeMaxValue=MaxOff, offcodeLog;
  ------------------
  |  |  424|  2.77k|#define MaxOff ((1<<Offbits)- 1)
  |  |  ------------------
  |  |  |  |  420|  2.77k|#define Offbits  5
  |  |  ------------------
  ------------------
 3626|  2.77k|    short matchlengthNCount[MaxML+1];
 3627|  2.77k|    unsigned matchlengthMaxValue = MaxML, matchlengthLog;
  ------------------
  |  |  422|  2.77k|#define MaxML  ((1<<MLbits) - 1)
  |  |  ------------------
  |  |  |  |  418|  2.77k|#define MLbits   7
  |  |  ------------------
  ------------------
 3628|  2.77k|    short litlengthNCount[MaxLL+1];
 3629|  2.77k|    unsigned litlengthMaxValue = MaxLL, litlengthLog;
  ------------------
  |  |  423|  2.77k|#define MaxLL  ((1<<LLbits) - 1)
  |  |  ------------------
  |  |  |  |  419|  2.77k|#define LLbits   6
  |  |  ------------------
  ------------------
 3630|       |
 3631|  2.77k|    hSize = HUFv05_readDTableX4(dctx->hufTableX4, dict, dictSize);
 3632|  2.77k|    if (HUFv05_isError(hSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|  2.05k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  2.05k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.05k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3632:9): [True: 2.05k, False: 723]
  ------------------
 3633|    723|    dict = (const char*)dict + hSize;
 3634|    723|    dictSize -= hSize;
 3635|       |
 3636|    723|    offcodeHeaderSize = FSEv05_readNCount(offcodeNCount, &offcodeMaxValue, &offcodeLog, dict, dictSize);
 3637|    723|    if (FSEv05_isError(offcodeHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|    110|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    110|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    110|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3637:9): [True: 110, False: 613]
  ------------------
 3638|    613|    if (offcodeLog > OffFSEv05Log) return ERROR(dictionary_corrupted);
  ------------------
  |  |  427|    613|#define OffFSEv05Log   9
  ------------------
                  if (offcodeLog > OffFSEv05Log) 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 (3638:9): [True: 50, False: 563]
  ------------------
 3639|    563|    errorCode = FSEv05_buildDTable(dctx->OffTable, offcodeNCount, offcodeMaxValue, offcodeLog);
 3640|    563|    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: 563]
  ------------------
 3641|    563|    dict = (const char*)dict + offcodeHeaderSize;
 3642|    563|    dictSize -= offcodeHeaderSize;
 3643|       |
 3644|    563|    matchlengthHeaderSize = FSEv05_readNCount(matchlengthNCount, &matchlengthMaxValue, &matchlengthLog, dict, dictSize);
 3645|    563|    if (FSEv05_isError(matchlengthHeaderSize)) 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 (3645:9): [True: 50, False: 513]
  ------------------
 3646|    513|    if (matchlengthLog > MLFSEv05Log) return ERROR(dictionary_corrupted);
  ------------------
  |  |  425|    513|#define MLFSEv05Log   10
  ------------------
                  if (matchlengthLog > MLFSEv05Log) return ERROR(dictionary_corrupted);
  ------------------
  |  |   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 (3646:9): [True: 38, False: 475]
  ------------------
 3647|    475|    errorCode = FSEv05_buildDTable(dctx->MLTable, matchlengthNCount, matchlengthMaxValue, matchlengthLog);
 3648|    475|    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: 475]
  ------------------
 3649|    475|    dict = (const char*)dict + matchlengthHeaderSize;
 3650|    475|    dictSize -= matchlengthHeaderSize;
 3651|       |
 3652|    475|    litlengthHeaderSize = FSEv05_readNCount(litlengthNCount, &litlengthMaxValue, &litlengthLog, dict, dictSize);
 3653|    475|    if (litlengthLog > LLFSEv05Log) return ERROR(dictionary_corrupted);
  ------------------
  |  |  426|    475|#define LLFSEv05Log   10
  ------------------
                  if (litlengthLog > LLFSEv05Log) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|    140|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    140|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    140|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3653:9): [True: 140, False: 335]
  ------------------
 3654|    335|    if (FSEv05_isError(litlengthHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   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 (3654:9): [True: 14, False: 321]
  ------------------
 3655|    321|    errorCode = FSEv05_buildDTable(dctx->LLTable, litlengthNCount, litlengthMaxValue, litlengthLog);
 3656|    321|    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: 321]
  ------------------
 3657|       |
 3658|    321|    dctx->flagStaticTables = 1;
 3659|    321|    return hSize + offcodeHeaderSize + matchlengthHeaderSize + litlengthHeaderSize;
 3660|    321|}

FSEv06_readNCount:
 1209|  8.33k|{
 1210|  8.33k|    const BYTE* const istart = (const BYTE*) headerBuffer;
 1211|  8.33k|    const BYTE* const iend = istart + hbSize;
 1212|  8.33k|    const BYTE* ip = istart;
 1213|  8.33k|    int nbBits;
 1214|  8.33k|    int remaining;
 1215|  8.33k|    int threshold;
 1216|  8.33k|    U32 bitStream;
 1217|  8.33k|    int bitCount;
 1218|  8.33k|    unsigned charnum = 0;
 1219|  8.33k|    int previous0 = 0;
 1220|       |
 1221|  8.33k|    if (hbSize < 4) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|    172|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    172|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    172|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1221:9): [True: 172, False: 8.16k]
  ------------------
 1222|  8.16k|    bitStream = MEM_readLE32(ip);
 1223|  8.16k|    nbBits = (bitStream & 0xF) + FSEv06_MIN_TABLELOG;   /* extract tableLog */
  ------------------
  |  | 1138|  8.16k|#define FSEv06_MIN_TABLELOG 5
  ------------------
 1224|  8.16k|    if (nbBits > FSEv06_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1140|  8.16k|#define FSEv06_TABLELOG_ABSOLUTE_MAX 15
  ------------------
                  if (nbBits > FSEv06_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|    447|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    447|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    447|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1224:9): [True: 447, False: 7.71k]
  ------------------
 1225|  7.71k|    bitStream >>= 4;
 1226|  7.71k|    bitCount = 4;
 1227|  7.71k|    *tableLogPtr = nbBits;
 1228|  7.71k|    remaining = (1<<nbBits)+1;
 1229|  7.71k|    threshold = 1<<nbBits;
 1230|  7.71k|    nbBits++;
 1231|       |
 1232|   130k|    while ((remaining>1) && (charnum<=*maxSVPtr)) {
  ------------------
  |  Branch (1232:12): [True: 123k, False: 7.51k]
  |  Branch (1232:29): [True: 123k, False: 87]
  ------------------
 1233|   123k|        if (previous0) {
  ------------------
  |  Branch (1233:13): [True: 8.65k, False: 114k]
  ------------------
 1234|  8.65k|            unsigned n0 = charnum;
 1235|  9.89k|            while ((bitStream & 0xFFFF) == 0xFFFF) {
  ------------------
  |  Branch (1235:20): [True: 1.24k, False: 8.65k]
  ------------------
 1236|  1.24k|                n0+=24;
 1237|  1.24k|                if (ip < iend-5) {
  ------------------
  |  Branch (1237:21): [True: 950, False: 290]
  ------------------
 1238|    950|                    ip+=2;
 1239|    950|                    bitStream = MEM_readLE32(ip) >> bitCount;
 1240|    950|                } else {
 1241|    290|                    bitStream >>= 16;
 1242|    290|                    bitCount+=16;
 1243|    290|            }   }
 1244|  12.0k|            while ((bitStream & 3) == 3) {
  ------------------
  |  Branch (1244:20): [True: 3.40k, False: 8.65k]
  ------------------
 1245|  3.40k|                n0+=3;
 1246|  3.40k|                bitStream>>=2;
 1247|  3.40k|                bitCount+=2;
 1248|  3.40k|            }
 1249|  8.65k|            n0 += bitStream & 3;
 1250|  8.65k|            bitCount += 2;
 1251|  8.65k|            if (n0 > *maxSVPtr) return ERROR(maxSymbolValue_tooSmall);
  ------------------
  |  |   49|    114|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    114|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    114|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1251:17): [True: 114, False: 8.54k]
  ------------------
 1252|  41.8k|            while (charnum < n0) normalizedCounter[charnum++] = 0;
  ------------------
  |  Branch (1252:20): [True: 33.2k, False: 8.54k]
  ------------------
 1253|  8.54k|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1253:17): [True: 5.60k, False: 2.94k]
  |  Branch (1253:35): [True: 711, False: 2.23k]
  ------------------
 1254|  6.31k|                ip += bitCount>>3;
 1255|  6.31k|                bitCount &= 7;
 1256|  6.31k|                bitStream = MEM_readLE32(ip) >> bitCount;
 1257|  6.31k|            }
 1258|  2.23k|            else
 1259|  2.23k|                bitStream >>= 2;
 1260|  8.54k|        }
 1261|   123k|        {   short const max = (short)((2*threshold-1)-remaining);
 1262|   123k|            short count;
 1263|       |
 1264|   123k|            if ((bitStream & (threshold-1)) < (U32)max) {
  ------------------
  |  Branch (1264:17): [True: 94.2k, False: 28.9k]
  ------------------
 1265|  94.2k|                count = (short)(bitStream & (threshold-1));
 1266|  94.2k|                bitCount   += nbBits-1;
 1267|  94.2k|            } else {
 1268|  28.9k|                count = (short)(bitStream & (2*threshold-1));
 1269|  28.9k|                if (count >= threshold) count -= max;
  ------------------
  |  Branch (1269:21): [True: 11.6k, False: 17.2k]
  ------------------
 1270|  28.9k|                bitCount   += nbBits;
 1271|  28.9k|            }
 1272|       |
 1273|   123k|            count--;   /* extra accuracy */
 1274|   123k|            remaining -= FSEv06_abs(count);
 1275|   123k|            normalizedCounter[charnum++] = count;
 1276|   123k|            previous0 = !count;
 1277|   180k|            while (remaining < threshold) {
  ------------------
  |  Branch (1277:20): [True: 57.6k, False: 123k]
  ------------------
 1278|  57.6k|                nbBits--;
 1279|  57.6k|                threshold >>= 1;
 1280|  57.6k|            }
 1281|       |
 1282|   123k|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1282:17): [True: 106k, False: 16.5k]
  |  Branch (1282:35): [True: 5.78k, False: 10.7k]
  ------------------
 1283|   112k|                ip += bitCount>>3;
 1284|   112k|                bitCount &= 7;
 1285|   112k|            } else {
 1286|  10.7k|                bitCount -= (int)(8 * (iend - 4 - ip));
 1287|  10.7k|                ip = iend - 4;
 1288|  10.7k|            }
 1289|   123k|            bitStream = MEM_readLE32(ip) >> (bitCount & 31);
 1290|   123k|    }   }   /* while ((remaining>1) && (charnum<=*maxSVPtr)) */
 1291|  7.60k|    if (remaining != 1) return ERROR(GENERIC);
  ------------------
  |  |   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 (1291:9): [True: 87, False: 7.51k]
  ------------------
 1292|  7.51k|    *maxSVPtr = charnum-1;
 1293|       |
 1294|  7.51k|    ip += (bitCount+7)>>3;
 1295|  7.51k|    if ((size_t)(ip-istart) > hbSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|    175|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    175|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    175|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1295:9): [True: 175, False: 7.33k]
  ------------------
 1296|  7.33k|    return ip-istart;
 1297|  7.51k|}
FSEv06_buildDTable:
 1403|  8.19k|{
 1404|  8.19k|    void* const tdPtr = dt+1;   /* because *dt is unsigned, 32-bits aligned on 32-bits */
 1405|  8.19k|    FSEv06_DECODE_TYPE* const tableDecode = (FSEv06_DECODE_TYPE*) (tdPtr);
  ------------------
  |  | 1125|  8.19k|#define FSEv06_DECODE_TYPE FSEv06_decode_t
  ------------------
 1406|  8.19k|    U16 symbolNext[FSEv06_MAX_SYMBOL_VALUE+1];
 1407|       |
 1408|  8.19k|    U32 const maxSV1 = maxSymbolValue + 1;
 1409|  8.19k|    U32 const tableSize = 1 << tableLog;
 1410|  8.19k|    U32 highThreshold = tableSize-1;
 1411|       |
 1412|       |    /* Sanity Checks */
 1413|  8.19k|    if (maxSymbolValue > FSEv06_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  | 1117|  8.19k|#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: 8.19k]
  ------------------
 1414|  8.19k|    if (tableLog > FSEv06_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1134|  8.19k|#define FSEv06_MAX_TABLELOG  (FSEv06_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1111|  8.19k|#define FSEv06_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
                  if (tableLog > FSEv06_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1414:9): [True: 69, False: 8.12k]
  ------------------
 1415|       |
 1416|       |    /* Init, lay down lowprob symbols */
 1417|  8.12k|    {   FSEv06_DTableHeader DTableH;
 1418|  8.12k|        DTableH.tableLog = (U16)tableLog;
 1419|  8.12k|        DTableH.fastMode = 1;
 1420|  8.12k|        {   S16 const largeLimit= (S16)(1 << (tableLog-1));
 1421|  8.12k|            U32 s;
 1422|   177k|            for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (1422:23): [True: 169k, False: 8.12k]
  ------------------
 1423|   169k|                if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (1423:21): [True: 63.9k, False: 105k]
  ------------------
 1424|  63.9k|                    tableDecode[highThreshold--].symbol = (FSEv06_FUNCTION_TYPE)s;
 1425|  63.9k|                    symbolNext[s] = 1;
 1426|   105k|                } else {
 1427|   105k|                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
  ------------------
  |  Branch (1427:25): [True: 3.61k, False: 102k]
  ------------------
 1428|   105k|                    symbolNext[s] = normalizedCounter[s];
 1429|   105k|        }   }   }
 1430|  8.12k|        memcpy(dt, &DTableH, sizeof(DTableH));
 1431|  8.12k|    }
 1432|       |
 1433|       |    /* Spread symbols */
 1434|  8.12k|    {   U32 const tableMask = tableSize-1;
 1435|  8.12k|        U32 const step = FSEv06_TABLESTEP(tableSize);
  ------------------
  |  | 1145|  8.12k|#define FSEv06_TABLESTEP(tableSize) ((tableSize>>1) + (tableSize>>3) + 3)
  ------------------
 1436|  8.12k|        U32 s, position = 0;
 1437|   177k|        for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (1437:19): [True: 169k, False: 8.12k]
  ------------------
 1438|   169k|            int i;
 1439|  4.52M|            for (i=0; i<normalizedCounter[s]; i++) {
  ------------------
  |  Branch (1439:23): [True: 4.35M, False: 169k]
  ------------------
 1440|  4.35M|                tableDecode[position].symbol = (FSEv06_FUNCTION_TYPE)s;
 1441|  4.35M|                position = (position + step) & tableMask;
 1442|  4.41M|                while (position > highThreshold) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  Branch (1442:24): [True: 60.9k, False: 4.35M]
  ------------------
 1443|  4.35M|        }   }
 1444|       |
 1445|  8.12k|        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: 8.12k]
  ------------------
 1446|  8.12k|    }
 1447|       |
 1448|       |    /* Build Decoding table */
 1449|  8.12k|    {   U32 u;
 1450|  4.42M|        for (u=0; u<tableSize; u++) {
  ------------------
  |  Branch (1450:19): [True: 4.41M, False: 8.12k]
  ------------------
 1451|  4.41M|            FSEv06_FUNCTION_TYPE const symbol = (FSEv06_FUNCTION_TYPE)(tableDecode[u].symbol);
  ------------------
  |  | 1123|  4.41M|#define FSEv06_FUNCTION_TYPE BYTE
  ------------------
 1452|  4.41M|            U16 nextState = symbolNext[symbol]++;
 1453|  4.41M|            tableDecode[u].nbBits = (BYTE) (tableLog - BITv06_highbit32 ((U32)nextState) );
 1454|  4.41M|            tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
 1455|  4.41M|    }   }
 1456|       |
 1457|  8.12k|    return 0;
 1458|  8.12k|}
FSEv06_buildDTable_rle:
 1468|    459|{
 1469|    459|    void* ptr = dt;
 1470|    459|    FSEv06_DTableHeader* const DTableH = (FSEv06_DTableHeader*)ptr;
 1471|    459|    void* dPtr = dt + 1;
 1472|    459|    FSEv06_decode_t* const cell = (FSEv06_decode_t*)dPtr;
 1473|       |
 1474|    459|    DTableH->tableLog = 0;
 1475|    459|    DTableH->fastMode = 0;
 1476|       |
 1477|    459|    cell->newState = 0;
 1478|    459|    cell->symbol = symbolValue;
 1479|    459|    cell->nbBits = 0;
 1480|       |
 1481|    459|    return 0;
 1482|    459|}
FSEv06_decompress_usingDTable:
 1582|  3.43k|{
 1583|  3.43k|    const void* ptr = dt;
 1584|  3.43k|    const FSEv06_DTableHeader* DTableH = (const FSEv06_DTableHeader*)ptr;
 1585|  3.43k|    const U32 fastMode = DTableH->fastMode;
 1586|       |
 1587|       |    /* select fast mode (static) */
 1588|  3.43k|    if (fastMode) return FSEv06_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 1);
  ------------------
  |  Branch (1588:9): [True: 1.57k, False: 1.85k]
  ------------------
 1589|  1.85k|    return FSEv06_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 0);
 1590|  3.43k|}
FSEv06_decompress:
 1594|  3.81k|{
 1595|  3.81k|    const BYTE* const istart = (const BYTE*)cSrc;
 1596|  3.81k|    const BYTE* ip = istart;
 1597|  3.81k|    short counting[FSEv06_MAX_SYMBOL_VALUE+1];
 1598|  3.81k|    DTable_max_t dt;   /* Static analyzer seems unable to understand this table will be properly initialized later */
 1599|  3.81k|    unsigned tableLog;
 1600|  3.81k|    unsigned maxSymbolValue = FSEv06_MAX_SYMBOL_VALUE;
  ------------------
  |  | 1117|  3.81k|#define FSEv06_MAX_SYMBOL_VALUE 255
  ------------------
 1601|       |
 1602|  3.81k|    if (cSrcSize<2) return ERROR(srcSize_wrong);   /* too small input size */
  ------------------
  |  |   49|     72|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     72|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     72|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1602:9): [True: 72, False: 3.74k]
  ------------------
 1603|       |
 1604|       |    /* normal FSE decoding mode */
 1605|  3.74k|    {   size_t const NCountLength = FSEv06_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize);
 1606|  3.74k|        if (FSEv06_isError(NCountLength)) return NCountLength;
  ------------------
  |  | 1357|  3.74k|#define FSEv06_isError ERR_isError
  ------------------
  |  Branch (1606:13): [True: 164, False: 3.57k]
  ------------------
 1607|  3.57k|        if (NCountLength >= cSrcSize) return ERROR(srcSize_wrong);   /* too small input size */
  ------------------
  |  |   49|     72|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     72|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     72|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1607:13): [True: 72, False: 3.50k]
  ------------------
 1608|  3.50k|        ip += NCountLength;
 1609|  3.50k|        cSrcSize -= NCountLength;
 1610|  3.50k|    }
 1611|       |
 1612|      0|    { size_t const errorCode = FSEv06_buildDTable (dt, counting, maxSymbolValue, tableLog);
 1613|  3.50k|      if (FSEv06_isError(errorCode)) return errorCode; }
  ------------------
  |  | 1357|  3.50k|#define FSEv06_isError ERR_isError
  ------------------
  |  Branch (1613:11): [True: 69, False: 3.43k]
  ------------------
 1614|       |
 1615|  3.43k|    return FSEv06_decompress_usingDTable (dst, maxDstSize, ip, cSrcSize, dt);   /* always return, even if it is an error code */
 1616|  3.50k|}
HUFv06_readDTableX2:
 1949|    607|{
 1950|    607|    BYTE huffWeight[HUFv06_MAX_SYMBOL_VALUE + 1];
 1951|    607|    U32 rankVal[HUFv06_ABSOLUTEMAX_TABLELOG + 1];   /* large enough for values from 0 to 16 */
 1952|    607|    U32 tableLog = 0;
 1953|    607|    size_t iSize;
 1954|    607|    U32 nbSymbols = 0;
 1955|    607|    U32 n;
 1956|    607|    U32 nextRankStart;
 1957|    607|    void* const dtPtr = DTable + 1;
 1958|    607|    HUFv06_DEltX2* const dt = (HUFv06_DEltX2*)dtPtr;
 1959|       |
 1960|    607|    HUFv06_STATIC_ASSERT(sizeof(HUFv06_DEltX2) == sizeof(U16));   /* if compilation fails here, assertion is false */
  ------------------
  |  | 1929|    607|#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|    607|    iSize = HUFv06_readStats(huffWeight, HUFv06_MAX_SYMBOL_VALUE + 1, rankVal, &nbSymbols, &tableLog, src, srcSize);
  ------------------
  |  | 1786|    607|#define HUFv06_MAX_SYMBOL_VALUE 255
  ------------------
 1964|    607|    if (HUFv06_isError(iSize)) return iSize;
  ------------------
  |  Branch (1964:9): [True: 138, False: 469]
  ------------------
 1965|       |
 1966|       |    /* check result */
 1967|    469|    if (tableLog > DTable[0]) return ERROR(tableLog_tooLarge);   /* DTable is too small */
  ------------------
  |  |   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 (1967:9): [True: 2, False: 467]
  ------------------
 1968|    467|    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|    467|    nextRankStart = 0;
 1972|  3.05k|    for (n=1; n<tableLog+1; n++) {
  ------------------
  |  Branch (1972:15): [True: 2.58k, False: 467]
  ------------------
 1973|  2.58k|        U32 current = nextRankStart;
 1974|  2.58k|        nextRankStart += (rankVal[n] << (n-1));
 1975|  2.58k|        rankVal[n] = current;
 1976|  2.58k|    }
 1977|       |
 1978|       |    /* fill DTable */
 1979|  27.2k|    for (n=0; n<nbSymbols; n++) {
  ------------------
  |  Branch (1979:15): [True: 26.8k, False: 467]
  ------------------
 1980|  26.8k|        const U32 w = huffWeight[n];
 1981|  26.8k|        const U32 length = (1 << w) >> 1;
 1982|  26.8k|        U32 i;
 1983|  26.8k|        HUFv06_DEltX2 D;
 1984|  26.8k|        D.byte = (BYTE)n; D.nbBits = (BYTE)(tableLog + 1 - w);
 1985|   100k|        for (i = rankVal[w]; i < rankVal[w] + length; i++)
  ------------------
  |  Branch (1985:30): [True: 73.7k, False: 26.8k]
  ------------------
 1986|  73.7k|            dt[i] = D;
 1987|  26.8k|        rankVal[w] += length;
 1988|  26.8k|    }
 1989|       |
 1990|    467|    return iSize;
 1991|    469|}
HUFv06_decompress1X2_usingDTable:
 2040|    135|{
 2041|    135|    BYTE* op = (BYTE*)dst;
 2042|    135|    BYTE* const oend = op + dstSize;
 2043|    135|    const U32 dtLog = DTable[0];
 2044|    135|    const void* dtPtr = DTable;
 2045|    135|    const HUFv06_DEltX2* const dt = ((const HUFv06_DEltX2*)dtPtr)+1;
 2046|    135|    BITv06_DStream_t bitD;
 2047|       |
 2048|    135|    { size_t const errorCode = BITv06_initDStream(&bitD, cSrc, cSrcSize);
 2049|    135|      if (HUFv06_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (2049:11): [True: 49, False: 86]
  ------------------
 2050|       |
 2051|     86|    HUFv06_decodeStreamX2(op, &bitD, oend, dt, dtLog);
 2052|       |
 2053|       |    /* check */
 2054|     86|    if (!BITv06_endOfDStream(&bitD)) return ERROR(corruption_detected);
  ------------------
  |  |   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 (2054:9): [True: 79, False: 7]
  ------------------
 2055|       |
 2056|      7|    return dstSize;
 2057|     86|}
HUFv06_decompress1X2:
 2060|    227|{
 2061|    227|    HUFv06_CREATE_STATIC_DTABLEX2(DTable, HUFv06_MAX_TABLELOG);
  ------------------
  |  | 1743|    227|        unsigned short DTable[HUFv06_DTABLE_SIZE(maxTableLog)] = { maxTableLog }
  ------------------
 2062|    227|    const BYTE* ip = (const BYTE*) cSrc;
 2063|       |
 2064|    227|    size_t const errorCode = HUFv06_readDTableX2 (DTable, cSrc, cSrcSize);
 2065|    227|    if (HUFv06_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2065:9): [True: 53, False: 174]
  ------------------
 2066|    174|    if (errorCode >= cSrcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2066:9): [True: 39, False: 135]
  ------------------
 2067|    135|    ip += errorCode;
 2068|    135|    cSrcSize -= errorCode;
 2069|       |
 2070|    135|    return HUFv06_decompress1X2_usingDTable (dst, dstSize, ip, cSrcSize, DTable);
 2071|    174|}
HUFv06_decompress4X2_usingDTable:
 2078|    250|{
 2079|       |    /* Check */
 2080|    250|    if (cSrcSize < 10) return ERROR(corruption_detected);  /* strict minimum : jump table + 1 byte per stream */
  ------------------
  |  |   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 (2080:9): [True: 18, False: 232]
  ------------------
 2081|       |
 2082|    232|    {   const BYTE* const istart = (const BYTE*) cSrc;
 2083|    232|        BYTE* const ostart = (BYTE*) dst;
 2084|    232|        BYTE* const oend = ostart + dstSize;
 2085|    232|        const void* const dtPtr = DTable;
 2086|    232|        const HUFv06_DEltX2* const dt = ((const HUFv06_DEltX2*)dtPtr) +1;
 2087|    232|        const U32 dtLog = DTable[0];
 2088|    232|        size_t errorCode;
 2089|       |
 2090|       |        /* Init */
 2091|    232|        BITv06_DStream_t bitD1;
 2092|    232|        BITv06_DStream_t bitD2;
 2093|    232|        BITv06_DStream_t bitD3;
 2094|    232|        BITv06_DStream_t bitD4;
 2095|    232|        const size_t length1 = MEM_readLE16(istart);
 2096|    232|        const size_t length2 = MEM_readLE16(istart+2);
 2097|    232|        const size_t length3 = MEM_readLE16(istart+4);
 2098|    232|        size_t length4;
 2099|    232|        const BYTE* const istart1 = istart + 6;  /* jumpTable */
 2100|    232|        const BYTE* const istart2 = istart1 + length1;
 2101|    232|        const BYTE* const istart3 = istart2 + length2;
 2102|    232|        const BYTE* const istart4 = istart3 + length3;
 2103|    232|        const size_t segmentSize = (dstSize+3) / 4;
 2104|    232|        BYTE* const opStart2 = ostart + segmentSize;
 2105|    232|        BYTE* const opStart3 = opStart2 + segmentSize;
 2106|    232|        BYTE* const opStart4 = opStart3 + segmentSize;
 2107|    232|        BYTE* op1 = ostart;
 2108|    232|        BYTE* op2 = opStart2;
 2109|    232|        BYTE* op3 = opStart3;
 2110|    232|        BYTE* op4 = opStart4;
 2111|    232|        U32 endSignal;
 2112|       |
 2113|    232|        length4 = cSrcSize - (length1 + length2 + length3 + 6);
 2114|    232|        if (length4 > cSrcSize) return ERROR(corruption_detected);   /* overflow */
  ------------------
  |  |   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 (2114:13): [True: 2, False: 230]
  ------------------
 2115|    230|        errorCode = BITv06_initDStream(&bitD1, istart1, length1);
 2116|    230|        if (HUFv06_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2116:13): [True: 45, False: 185]
  ------------------
 2117|    185|        errorCode = BITv06_initDStream(&bitD2, istart2, length2);
 2118|    185|        if (HUFv06_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2118:13): [True: 52, False: 133]
  ------------------
 2119|    133|        errorCode = BITv06_initDStream(&bitD3, istart3, length3);
 2120|    133|        if (HUFv06_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2120:13): [True: 17, False: 116]
  ------------------
 2121|    116|        errorCode = BITv06_initDStream(&bitD4, istart4, length4);
 2122|    116|        if (HUFv06_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2122:13): [True: 14, False: 102]
  ------------------
 2123|       |
 2124|       |        /* 16-32 symbols per loop (4-8 symbols per stream) */
 2125|    102|        endSignal = BITv06_reloadDStream(&bitD1) | BITv06_reloadDStream(&bitD2) | BITv06_reloadDStream(&bitD3) | BITv06_reloadDStream(&bitD4);
 2126|    412|        for ( ; (endSignal==BITv06_DStream_unfinished) && (op4<(oend-7)) ; ) {
  ------------------
  |  Branch (2126:17): [True: 318, False: 94]
  |  Branch (2126:59): [True: 310, False: 8]
  ------------------
 2127|    310|            HUFv06_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 2010|    310|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 310, False: 0]
  |  |  ------------------
  |  | 2011|    310|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    310|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2128|    310|            HUFv06_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 2010|    310|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 310, False: 0]
  |  |  ------------------
  |  | 2011|    310|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    310|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2129|    310|            HUFv06_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 2010|    310|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 310, False: 0]
  |  |  ------------------
  |  | 2011|    310|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    310|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2130|    310|            HUFv06_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 2010|    310|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 310, False: 0]
  |  |  ------------------
  |  | 2011|    310|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    310|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2131|    310|            HUFv06_DECODE_SYMBOLX2_1(op1, &bitD1);
  ------------------
  |  | 2006|    310|    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: 310, False: 0]
  |  |  |  Branch (2006:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2007|    310|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    310|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2132|    310|            HUFv06_DECODE_SYMBOLX2_1(op2, &bitD2);
  ------------------
  |  | 2006|    310|    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: 310, False: 0]
  |  |  |  Branch (2006:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2007|    310|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    310|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2133|    310|            HUFv06_DECODE_SYMBOLX2_1(op3, &bitD3);
  ------------------
  |  | 2006|    310|    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: 310, False: 0]
  |  |  |  Branch (2006:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2007|    310|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    310|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2134|    310|            HUFv06_DECODE_SYMBOLX2_1(op4, &bitD4);
  ------------------
  |  | 2006|    310|    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: 310, False: 0]
  |  |  |  Branch (2006:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2007|    310|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    310|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2135|    310|            HUFv06_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 2010|    310|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 310, False: 0]
  |  |  ------------------
  |  | 2011|    310|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    310|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2136|    310|            HUFv06_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 2010|    310|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 310, False: 0]
  |  |  ------------------
  |  | 2011|    310|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    310|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2137|    310|            HUFv06_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 2010|    310|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 310, False: 0]
  |  |  ------------------
  |  | 2011|    310|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    310|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2138|    310|            HUFv06_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 2010|    310|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 310, False: 0]
  |  |  ------------------
  |  | 2011|    310|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|    310|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2139|    310|            HUFv06_DECODE_SYMBOLX2_0(op1, &bitD1);
  ------------------
  |  | 2003|    310|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2140|    310|            HUFv06_DECODE_SYMBOLX2_0(op2, &bitD2);
  ------------------
  |  | 2003|    310|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2141|    310|            HUFv06_DECODE_SYMBOLX2_0(op3, &bitD3);
  ------------------
  |  | 2003|    310|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2142|    310|            HUFv06_DECODE_SYMBOLX2_0(op4, &bitD4);
  ------------------
  |  | 2003|    310|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2143|    310|            endSignal = BITv06_reloadDStream(&bitD1) | BITv06_reloadDStream(&bitD2) | BITv06_reloadDStream(&bitD3) | BITv06_reloadDStream(&bitD4);
 2144|    310|        }
 2145|       |
 2146|       |        /* check corruption */
 2147|    102|        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: 102]
  ------------------
 2148|    102|        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: 102]
  ------------------
 2149|    102|        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: 102]
  ------------------
 2150|       |        /* note : op4 supposed already verified within main loop */
 2151|       |
 2152|       |        /* finish bitStreams one by one */
 2153|    102|        HUFv06_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog);
 2154|    102|        HUFv06_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog);
 2155|    102|        HUFv06_decodeStreamX2(op3, &bitD3, opStart4, dt, dtLog);
 2156|    102|        HUFv06_decodeStreamX2(op4, &bitD4, oend,     dt, dtLog);
 2157|       |
 2158|       |        /* check */
 2159|    102|        endSignal = BITv06_endOfDStream(&bitD1) & BITv06_endOfDStream(&bitD2) & BITv06_endOfDStream(&bitD3) & BITv06_endOfDStream(&bitD4);
 2160|    102|        if (!endSignal) return ERROR(corruption_detected);
  ------------------
  |  |   49|    102|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    102|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    102|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2160:13): [True: 102, False: 0]
  ------------------
 2161|       |
 2162|       |        /* decoded size */
 2163|      0|        return dstSize;
 2164|    102|    }
 2165|    102|}
HUFv06_decompress4X2:
 2169|    380|{
 2170|    380|    HUFv06_CREATE_STATIC_DTABLEX2(DTable, HUFv06_MAX_TABLELOG);
  ------------------
  |  | 1743|    380|        unsigned short DTable[HUFv06_DTABLE_SIZE(maxTableLog)] = { maxTableLog }
  ------------------
 2171|    380|    const BYTE* ip = (const BYTE*) cSrc;
 2172|       |
 2173|    380|    size_t const errorCode = HUFv06_readDTableX2 (DTable, cSrc, cSrcSize);
 2174|    380|    if (HUFv06_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2174:9): [True: 87, False: 293]
  ------------------
 2175|    293|    if (errorCode >= cSrcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2175:9): [True: 43, False: 250]
  ------------------
 2176|    250|    ip += errorCode;
 2177|    250|    cSrcSize -= errorCode;
 2178|       |
 2179|    250|    return HUFv06_decompress4X2_usingDTable (dst, dstSize, ip, cSrcSize, DTable);
 2180|    293|}
HUFv06_readDTableX4:
 2272|  4.56k|{
 2273|  4.56k|    BYTE weightList[HUFv06_MAX_SYMBOL_VALUE + 1];
 2274|  4.56k|    sortedSymbol_t sortedSymbol[HUFv06_MAX_SYMBOL_VALUE + 1];
 2275|  4.56k|    U32 rankStats[HUFv06_ABSOLUTEMAX_TABLELOG + 1] = { 0 };
 2276|  4.56k|    U32 rankStart0[HUFv06_ABSOLUTEMAX_TABLELOG + 2] = { 0 };
 2277|  4.56k|    U32* const rankStart = rankStart0+1;
 2278|  4.56k|    rankVal_t rankVal;
 2279|  4.56k|    U32 tableLog, maxW, sizeOfSort, nbSymbols;
 2280|  4.56k|    const U32 memLog = DTable[0];
 2281|  4.56k|    size_t iSize;
 2282|  4.56k|    void* dtPtr = DTable;
 2283|  4.56k|    HUFv06_DEltX4* const dt = ((HUFv06_DEltX4*)dtPtr) + 1;
 2284|       |
 2285|  4.56k|    HUFv06_STATIC_ASSERT(sizeof(HUFv06_DEltX4) == sizeof(U32));   /* if compilation fails here, assertion is false */
  ------------------
  |  | 1929|  4.56k|#define HUFv06_STATIC_ASSERT(c) { enum { HUFv06_static_assert = 1/(int)(!!(c)) }; }   /* use only *after* variable declarations */
  ------------------
 2286|  4.56k|    if (memLog > HUFv06_ABSOLUTEMAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1783|  4.56k|#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: 4.56k]
  ------------------
 2287|       |    /* memset(weightList, 0, sizeof(weightList)); */   /* is not necessary, even though some analyzer complain ... */
 2288|       |
 2289|  4.56k|    iSize = HUFv06_readStats(weightList, HUFv06_MAX_SYMBOL_VALUE + 1, rankStats, &nbSymbols, &tableLog, src, srcSize);
  ------------------
  |  | 1786|  4.56k|#define HUFv06_MAX_SYMBOL_VALUE 255
  ------------------
 2290|  4.56k|    if (HUFv06_isError(iSize)) return iSize;
  ------------------
  |  Branch (2290:9): [True: 2.69k, False: 1.86k]
  ------------------
 2291|       |
 2292|       |    /* check result */
 2293|  1.86k|    if (tableLog > memLog) return ERROR(tableLog_tooLarge);   /* DTable can't fit code depth */
  ------------------
  |  |   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 (2293:9): [True: 75, False: 1.79k]
  ------------------
 2294|       |
 2295|       |    /* find maxWeight */
 2296|  4.42k|    for (maxW = tableLog; rankStats[maxW]==0; maxW--) {}  /* necessarily finds a solution before 0 */
  ------------------
  |  Branch (2296:27): [True: 2.63k, False: 1.79k]
  ------------------
 2297|       |
 2298|       |    /* Get start index of each weight */
 2299|  1.79k|    {   U32 w, nextRankStart = 0;
 2300|  9.75k|        for (w=1; w<maxW+1; w++) {
  ------------------
  |  Branch (2300:19): [True: 7.96k, False: 1.79k]
  ------------------
 2301|  7.96k|            U32 current = nextRankStart;
 2302|  7.96k|            nextRankStart += rankStats[w];
 2303|  7.96k|            rankStart[w] = current;
 2304|  7.96k|        }
 2305|  1.79k|        rankStart[0] = nextRankStart;   /* put all 0w symbols at the end of sorted list*/
 2306|  1.79k|        sizeOfSort = nextRankStart;
 2307|  1.79k|    }
 2308|       |
 2309|       |    /* sort symbols by weight */
 2310|  1.79k|    {   U32 s;
 2311|   126k|        for (s=0; s<nbSymbols; s++) {
  ------------------
  |  Branch (2311:19): [True: 125k, False: 1.79k]
  ------------------
 2312|   125k|            U32 const w = weightList[s];
 2313|   125k|            U32 const r = rankStart[w]++;
 2314|   125k|            sortedSymbol[r].symbol = (BYTE)s;
 2315|   125k|            sortedSymbol[r].weight = (BYTE)w;
 2316|   125k|        }
 2317|  1.79k|        rankStart[0] = 0;   /* forget 0w symbols; this is beginning of weight(1) */
 2318|  1.79k|    }
 2319|       |
 2320|       |    /* Build rankVal */
 2321|  1.79k|    {   U32* const rankVal0 = rankVal[0];
 2322|  1.79k|        {   int const rescale = (memLog-tableLog) - 1;   /* tableLog <= memLog */
 2323|  1.79k|            U32 nextRankVal = 0;
 2324|  1.79k|            U32 w;
 2325|  9.75k|            for (w=1; w<maxW+1; w++) {
  ------------------
  |  Branch (2325:23): [True: 7.96k, False: 1.79k]
  ------------------
 2326|  7.96k|                U32 current = nextRankVal;
 2327|  7.96k|                nextRankVal += rankStats[w] << (w+rescale);
 2328|  7.96k|                rankVal0[w] = current;
 2329|  7.96k|        }   }
 2330|  1.79k|        {   U32 const minBits = tableLog+1 - maxW;
 2331|  1.79k|            U32 consumed;
 2332|  16.3k|            for (consumed = minBits; consumed < memLog - minBits + 1; consumed++) {
  ------------------
  |  Branch (2332:38): [True: 14.5k, False: 1.79k]
  ------------------
 2333|  14.5k|                U32* const rankValPtr = rankVal[consumed];
 2334|  14.5k|                U32 w;
 2335|  83.8k|                for (w = 1; w < maxW+1; w++) {
  ------------------
  |  Branch (2335:29): [True: 69.2k, False: 14.5k]
  ------------------
 2336|  69.2k|                    rankValPtr[w] = rankVal0[w] >> consumed;
 2337|  69.2k|    }   }   }   }
 2338|       |
 2339|  1.79k|    HUFv06_fillDTableX4(dt, memLog,
 2340|  1.79k|                   sortedSymbol, sizeOfSort,
 2341|  1.79k|                   rankStart0, rankVal, maxW,
 2342|  1.79k|                   tableLog+1);
 2343|       |
 2344|  1.79k|    return iSize;
 2345|  1.86k|}
HUFv06_decompress1X4_usingDTable:
 2412|    108|{
 2413|    108|    const BYTE* const istart = (const BYTE*) cSrc;
 2414|    108|    BYTE* const ostart = (BYTE*) dst;
 2415|    108|    BYTE* const oend = ostart + dstSize;
 2416|       |
 2417|    108|    const U32 dtLog = DTable[0];
 2418|    108|    const void* const dtPtr = DTable;
 2419|    108|    const HUFv06_DEltX4* const dt = ((const HUFv06_DEltX4*)dtPtr) +1;
 2420|       |
 2421|       |    /* Init */
 2422|    108|    BITv06_DStream_t bitD;
 2423|    108|    { size_t const errorCode = BITv06_initDStream(&bitD, istart, cSrcSize);
 2424|    108|      if (HUFv06_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (2424:11): [True: 27, False: 81]
  ------------------
 2425|       |
 2426|       |    /* decode */
 2427|     81|    HUFv06_decodeStreamX4(ostart, &bitD, oend, dt, dtLog);
 2428|       |
 2429|       |    /* check */
 2430|     81|    if (!BITv06_endOfDStream(&bitD)) return ERROR(corruption_detected);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2430:9): [True: 52, False: 29]
  ------------------
 2431|       |
 2432|       |    /* decoded size */
 2433|     29|    return dstSize;
 2434|     81|}
HUFv06_decompress4X4_usingDTable:
 2454|     98|{
 2455|     98|    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 (2455:9): [True: 0, False: 98]
  ------------------
 2456|       |
 2457|     98|    {   const BYTE* const istart = (const BYTE*) cSrc;
 2458|     98|        BYTE* const ostart = (BYTE*) dst;
 2459|     98|        BYTE* const oend = ostart + dstSize;
 2460|     98|        const void* const dtPtr = DTable;
 2461|     98|        const HUFv06_DEltX4* const dt = ((const HUFv06_DEltX4*)dtPtr) +1;
 2462|     98|        const U32 dtLog = DTable[0];
 2463|     98|        size_t errorCode;
 2464|       |
 2465|       |        /* Init */
 2466|     98|        BITv06_DStream_t bitD1;
 2467|     98|        BITv06_DStream_t bitD2;
 2468|     98|        BITv06_DStream_t bitD3;
 2469|     98|        BITv06_DStream_t bitD4;
 2470|     98|        const size_t length1 = MEM_readLE16(istart);
 2471|     98|        const size_t length2 = MEM_readLE16(istart+2);
 2472|     98|        const size_t length3 = MEM_readLE16(istart+4);
 2473|     98|        size_t length4;
 2474|     98|        const BYTE* const istart1 = istart + 6;  /* jumpTable */
 2475|     98|        const BYTE* const istart2 = istart1 + length1;
 2476|     98|        const BYTE* const istart3 = istart2 + length2;
 2477|     98|        const BYTE* const istart4 = istart3 + length3;
 2478|     98|        const size_t segmentSize = (dstSize+3) / 4;
 2479|     98|        BYTE* const opStart2 = ostart + segmentSize;
 2480|     98|        BYTE* const opStart3 = opStart2 + segmentSize;
 2481|     98|        BYTE* const opStart4 = opStart3 + segmentSize;
 2482|     98|        BYTE* op1 = ostart;
 2483|     98|        BYTE* op2 = opStart2;
 2484|     98|        BYTE* op3 = opStart3;
 2485|     98|        BYTE* op4 = opStart4;
 2486|     98|        U32 endSignal;
 2487|       |
 2488|     98|        length4 = cSrcSize - (length1 + length2 + length3 + 6);
 2489|     98|        if (length4 > cSrcSize) return ERROR(corruption_detected);   /* overflow */
  ------------------
  |  |   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 (2489:13): [True: 5, False: 93]
  ------------------
 2490|     93|        errorCode = BITv06_initDStream(&bitD1, istart1, length1);
 2491|     93|        if (HUFv06_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2491:13): [True: 7, False: 86]
  ------------------
 2492|     86|        errorCode = BITv06_initDStream(&bitD2, istart2, length2);
 2493|     86|        if (HUFv06_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2493:13): [True: 20, False: 66]
  ------------------
 2494|     66|        errorCode = BITv06_initDStream(&bitD3, istart3, length3);
 2495|     66|        if (HUFv06_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2495:13): [True: 17, False: 49]
  ------------------
 2496|     49|        errorCode = BITv06_initDStream(&bitD4, istart4, length4);
 2497|     49|        if (HUFv06_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2497:13): [True: 8, False: 41]
  ------------------
 2498|       |
 2499|       |        /* 16-32 symbols per loop (4-8 symbols per stream) */
 2500|     41|        endSignal = BITv06_reloadDStream(&bitD1) | BITv06_reloadDStream(&bitD2) | BITv06_reloadDStream(&bitD3) | BITv06_reloadDStream(&bitD4);
 2501|    777|        for ( ; (endSignal==BITv06_DStream_unfinished) && (op4<(oend-7)) ; ) {
  ------------------
  |  Branch (2501:17): [True: 736, False: 41]
  |  Branch (2501:59): [True: 736, False: 0]
  ------------------
 2502|    736|            HUFv06_DECODE_SYMBOLX4_2(op1, &bitD1);
  ------------------
  |  | 2379|    736|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2379:9): [True: 736, False: 0]
  |  |  ------------------
  |  | 2380|    736|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2503|    736|            HUFv06_DECODE_SYMBOLX4_2(op2, &bitD2);
  ------------------
  |  | 2379|    736|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2379:9): [True: 736, False: 0]
  |  |  ------------------
  |  | 2380|    736|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2504|    736|            HUFv06_DECODE_SYMBOLX4_2(op3, &bitD3);
  ------------------
  |  | 2379|    736|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2379:9): [True: 736, False: 0]
  |  |  ------------------
  |  | 2380|    736|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2505|    736|            HUFv06_DECODE_SYMBOLX4_2(op4, &bitD4);
  ------------------
  |  | 2379|    736|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2379:9): [True: 736, False: 0]
  |  |  ------------------
  |  | 2380|    736|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2506|    736|            HUFv06_DECODE_SYMBOLX4_1(op1, &bitD1);
  ------------------
  |  | 2375|    736|    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: 736, False: 0]
  |  |  |  Branch (2375:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2376|    736|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2507|    736|            HUFv06_DECODE_SYMBOLX4_1(op2, &bitD2);
  ------------------
  |  | 2375|    736|    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: 736, False: 0]
  |  |  |  Branch (2375:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2376|    736|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2508|    736|            HUFv06_DECODE_SYMBOLX4_1(op3, &bitD3);
  ------------------
  |  | 2375|    736|    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: 736, False: 0]
  |  |  |  Branch (2375:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2376|    736|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2509|    736|            HUFv06_DECODE_SYMBOLX4_1(op4, &bitD4);
  ------------------
  |  | 2375|    736|    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: 736, False: 0]
  |  |  |  Branch (2375:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2376|    736|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2510|    736|            HUFv06_DECODE_SYMBOLX4_2(op1, &bitD1);
  ------------------
  |  | 2379|    736|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2379:9): [True: 736, False: 0]
  |  |  ------------------
  |  | 2380|    736|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2511|    736|            HUFv06_DECODE_SYMBOLX4_2(op2, &bitD2);
  ------------------
  |  | 2379|    736|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2379:9): [True: 736, False: 0]
  |  |  ------------------
  |  | 2380|    736|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2512|    736|            HUFv06_DECODE_SYMBOLX4_2(op3, &bitD3);
  ------------------
  |  | 2379|    736|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2379:9): [True: 736, False: 0]
  |  |  ------------------
  |  | 2380|    736|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2513|    736|            HUFv06_DECODE_SYMBOLX4_2(op4, &bitD4);
  ------------------
  |  | 2379|    736|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2379:9): [True: 736, False: 0]
  |  |  ------------------
  |  | 2380|    736|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2514|    736|            HUFv06_DECODE_SYMBOLX4_0(op1, &bitD1);
  ------------------
  |  | 2372|    736|    ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2515|    736|            HUFv06_DECODE_SYMBOLX4_0(op2, &bitD2);
  ------------------
  |  | 2372|    736|    ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2516|    736|            HUFv06_DECODE_SYMBOLX4_0(op3, &bitD3);
  ------------------
  |  | 2372|    736|    ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2517|    736|            HUFv06_DECODE_SYMBOLX4_0(op4, &bitD4);
  ------------------
  |  | 2372|    736|    ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2518|       |
 2519|    736|            endSignal = BITv06_reloadDStream(&bitD1) | BITv06_reloadDStream(&bitD2) | BITv06_reloadDStream(&bitD3) | BITv06_reloadDStream(&bitD4);
 2520|    736|        }
 2521|       |
 2522|       |        /* check corruption */
 2523|     41|        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 (2523:13): [True: 0, False: 41]
  ------------------
 2524|     41|        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 (2524:13): [True: 0, False: 41]
  ------------------
 2525|     41|        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 (2525:13): [True: 0, False: 41]
  ------------------
 2526|       |        /* note : op4 supposed already verified within main loop */
 2527|       |
 2528|       |        /* finish bitStreams one by one */
 2529|     41|        HUFv06_decodeStreamX4(op1, &bitD1, opStart2, dt, dtLog);
 2530|     41|        HUFv06_decodeStreamX4(op2, &bitD2, opStart3, dt, dtLog);
 2531|     41|        HUFv06_decodeStreamX4(op3, &bitD3, opStart4, dt, dtLog);
 2532|     41|        HUFv06_decodeStreamX4(op4, &bitD4, oend,     dt, dtLog);
 2533|       |
 2534|       |        /* check */
 2535|     41|        endSignal = BITv06_endOfDStream(&bitD1) & BITv06_endOfDStream(&bitD2) & BITv06_endOfDStream(&bitD3) & BITv06_endOfDStream(&bitD4);
 2536|     41|        if (!endSignal) return ERROR(corruption_detected);
  ------------------
  |  |   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 (2536:13): [True: 41, False: 0]
  ------------------
 2537|       |
 2538|       |        /* decoded size */
 2539|      0|        return dstSize;
 2540|     41|    }
 2541|     41|}
HUFv06_decompress4X4:
 2545|    100|{
 2546|    100|    HUFv06_CREATE_STATIC_DTABLEX4(DTable, HUFv06_MAX_TABLELOG);
  ------------------
  |  | 1745|    100|        unsigned int DTable[HUFv06_DTABLE_SIZE(maxTableLog)] = { maxTableLog }
  ------------------
 2547|    100|    const BYTE* ip = (const BYTE*) cSrc;
 2548|       |
 2549|    100|    size_t hSize = HUFv06_readDTableX4 (DTable, cSrc, cSrcSize);
 2550|    100|    if (HUFv06_isError(hSize)) return hSize;
  ------------------
  |  Branch (2550:9): [True: 2, False: 98]
  ------------------
 2551|     98|    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 (2551:9): [True: 0, False: 98]
  ------------------
 2552|     98|    ip += hSize;
 2553|     98|    cSrcSize -= hSize;
 2554|       |
 2555|     98|    return HUFv06_decompress4X4_usingDTable (dst, dstSize, ip, cSrcSize, DTable);
 2556|     98|}
HUFv06_decompress:
 2590|    544|{
 2591|    544|    static const decompressionAlgo decompress[3] = { HUFv06_decompress4X2, HUFv06_decompress4X4, NULL };
 2592|    544|    U32 Dtime[3];   /* decompression time estimation */
 2593|       |
 2594|       |    /* validation checks */
 2595|    544|    if (dstSize == 0) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   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 (2595:9): [True: 6, False: 538]
  ------------------
 2596|    538|    if (cSrcSize > dstSize) return ERROR(corruption_detected);   /* invalid */
  ------------------
  |  |   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 (2596:9): [True: 10, False: 528]
  ------------------
 2597|    528|    if (cSrcSize == dstSize) { memcpy(dst, cSrc, dstSize); return dstSize; }   /* not compressed */
  ------------------
  |  Branch (2597:9): [True: 9, False: 519]
  ------------------
 2598|    519|    if (cSrcSize == 1) { memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; }   /* RLE */
  ------------------
  |  Branch (2598:9): [True: 39, False: 480]
  ------------------
 2599|       |
 2600|       |    /* decoder timing evaluation */
 2601|    480|    {   U32 const Q = (U32)(cSrcSize * 16 / dstSize);   /* Q < 16 since dstSize > cSrcSize */
 2602|    480|        U32 const D256 = (U32)(dstSize >> 8);
 2603|  1.92k|        U32 n; for (n=0; n<3; n++)
  ------------------
  |  Branch (2603:26): [True: 1.44k, False: 480]
  ------------------
 2604|  1.44k|            Dtime[n] = algoTime[Q][n].tableTime + (algoTime[Q][n].decode256Time * D256);
 2605|    480|    }
 2606|       |
 2607|    480|    Dtime[1] += Dtime[1] >> 4; Dtime[2] += Dtime[2] >> 3; /* advantage to algorithms using less memory, for cache eviction */
 2608|       |
 2609|    480|    {   U32 algoNb = 0;
 2610|    480|        if (Dtime[1] < Dtime[0]) algoNb = 1;
  ------------------
  |  Branch (2610:13): [True: 100, False: 380]
  ------------------
 2611|       |        /* if (Dtime[2] < Dtime[algoNb]) algoNb = 2; */   /* current speed of HUFv06_decompress4X6 is not good */
 2612|    480|        return decompress[algoNb](dst, dstSize, cSrc, cSrcSize);
 2613|    519|    }
 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|    519|}
ZSTDv06_decompressBegin:
 2774|  13.3k|{
 2775|  13.3k|    dctx->expected = ZSTDv06_frameHeaderSize_min;
 2776|  13.3k|    dctx->stage = ZSTDds_getFrameHeaderSize;
 2777|  13.3k|    dctx->previousDstEnd = NULL;
 2778|  13.3k|    dctx->base = NULL;
 2779|  13.3k|    dctx->vBase = NULL;
 2780|  13.3k|    dctx->dictEnd = NULL;
 2781|  13.3k|    dctx->hufTableX4[0] = ZSTD_HUFFDTABLE_CAPACITY_LOG;
  ------------------
  |  |  426|  13.3k|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
 2782|  13.3k|    dctx->flagRepeatTable = 0;
 2783|  13.3k|    return 0;
 2784|  13.3k|}
ZSTDv06_createDCtx:
 2787|  6.68k|{
 2788|  6.68k|    ZSTDv06_DCtx* dctx = (ZSTDv06_DCtx*)malloc(sizeof(ZSTDv06_DCtx));
 2789|  6.68k|    if (dctx==NULL) return NULL;
  ------------------
  |  Branch (2789:9): [True: 0, False: 6.68k]
  ------------------
 2790|  6.68k|    ZSTDv06_decompressBegin(dctx);
 2791|  6.68k|    return dctx;
 2792|  6.68k|}
ZSTDv06_freeDCtx:
 2795|  6.68k|{
 2796|  6.68k|    free(dctx);
 2797|  6.68k|    return 0;   /* reserved as a potential error code in the future */
 2798|  6.68k|}
ZSTDv06_getFrameParams:
 2925|  11.7k|{
 2926|  11.7k|    const BYTE* ip = (const BYTE*)src;
 2927|       |
 2928|  11.7k|    if (srcSize < ZSTDv06_frameHeaderSize_min) return ZSTDv06_frameHeaderSize_min;
  ------------------
  |  Branch (2928:9): [True: 0, False: 11.7k]
  ------------------
 2929|  11.7k|    if (MEM_readLE32(src) != ZSTDv06_MAGICNUMBER) return ERROR(prefix_unknown);
  ------------------
  |  |  164|  11.7k|#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: 11.7k]
  ------------------
 2930|       |
 2931|       |    /* ensure there is enough `srcSize` to fully read/decode frame header */
 2932|  11.7k|    { size_t const fhsize = ZSTDv06_frameHeaderSize(src, srcSize);
 2933|  11.7k|      if (srcSize < fhsize) return fhsize; }
  ------------------
  |  Branch (2933:11): [True: 0, False: 11.7k]
  ------------------
 2934|       |
 2935|  11.7k|    memset(fparamsPtr, 0, sizeof(*fparamsPtr));
 2936|  11.7k|    {   BYTE const frameDesc = ip[4];
 2937|  11.7k|        fparamsPtr->windowLog = (frameDesc & 0xF) + ZSTDv06_WINDOWLOG_ABSOLUTEMIN;
  ------------------
  |  |  416|  11.7k|#define ZSTDv06_WINDOWLOG_ABSOLUTEMIN 12
  ------------------
 2938|  11.7k|        if ((frameDesc & 0x20) != 0) return ERROR(frameParameter_unsupported);   /* reserved 1 bit */
  ------------------
  |  |   49|     59|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     59|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     59|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2938:13): [True: 59, False: 11.7k]
  ------------------
 2939|  11.7k|        switch(frameDesc >> 6)  /* fcsId */
 2940|  11.7k|        {
 2941|      0|            default:   /* impossible */
  ------------------
  |  Branch (2941:13): [True: 0, False: 11.7k]
  ------------------
 2942|  11.0k|            case 0 : fparamsPtr->frameContentSize = 0; break;
  ------------------
  |  Branch (2942:13): [True: 11.0k, False: 669]
  ------------------
 2943|    222|            case 1 : fparamsPtr->frameContentSize = ip[5]; break;
  ------------------
  |  Branch (2943:13): [True: 222, False: 11.5k]
  ------------------
 2944|     85|            case 2 : fparamsPtr->frameContentSize = MEM_readLE16(ip+5)+256; break;
  ------------------
  |  Branch (2944:13): [True: 85, False: 11.6k]
  ------------------
 2945|    362|            case 3 : fparamsPtr->frameContentSize = MEM_readLE64(ip+5); break;
  ------------------
  |  Branch (2945:13): [True: 362, False: 11.3k]
  ------------------
 2946|  11.7k|    }   }
 2947|  11.7k|    return 0;
 2948|  11.7k|}
ZSTDv06_decompress_usingDict:
 3581|  6.68k|{
 3582|  6.68k|    ZSTDv06_decompressBegin_usingDict(dctx, dict, dictSize);
 3583|  6.68k|    ZSTDv06_checkContinuity(dctx, dst);
 3584|  6.68k|    return ZSTDv06_decompressFrame(dctx, dst, dstCapacity, src, srcSize);
 3585|  6.68k|}
ZSTDv06_findFrameSizeInfoLegacy:
 3618|  6.78k|{
 3619|  6.78k|    const BYTE* ip = (const BYTE*)src;
 3620|  6.78k|    size_t remainingSize = srcSize;
 3621|  6.78k|    size_t nbBlocks = 0;
 3622|  6.78k|    blockProperties_t blockProperties = { bt_compressed, 0 };
 3623|       |
 3624|       |    /* Frame Header */
 3625|  6.78k|    {   size_t const frameHeaderSize = ZSTDv06_frameHeaderSize(src, srcSize);
 3626|  6.78k|        if (ZSTDv06_isError(frameHeaderSize)) {
  ------------------
  |  | 2731|  6.78k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3626:13): [True: 0, False: 6.78k]
  ------------------
 3627|      0|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, frameHeaderSize);
 3628|      0|            return;
 3629|      0|        }
 3630|  6.78k|        if (MEM_readLE32(src) != ZSTDv06_MAGICNUMBER) {
  ------------------
  |  |  164|  6.78k|#define ZSTDv06_MAGICNUMBER 0xFD2FB526   /* v0.6 */
  ------------------
  |  Branch (3630:13): [True: 0, False: 6.78k]
  ------------------
 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|  6.78k|        if (srcSize < frameHeaderSize+ZSTDv06_blockHeaderSize) {
  ------------------
  |  Branch (3634:13): [True: 16, False: 6.77k]
  ------------------
 3635|     16|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(srcSize_wrong));
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3636|     16|            return;
 3637|     16|        }
 3638|  6.77k|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3639|  6.77k|    }
 3640|       |
 3641|       |    /* Loop on each block */
 3642|  9.86k|    while (1) {
  ------------------
  |  Branch (3642:12): [True: 9.86k, Folded]
  ------------------
 3643|  9.86k|        size_t const cBlockSize = ZSTDv06_getcBlockSize(ip, remainingSize, &blockProperties);
 3644|  9.86k|        if (ZSTDv06_isError(cBlockSize)) {
  ------------------
  |  | 2731|  9.86k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3644:13): [True: 11, False: 9.85k]
  ------------------
 3645|     11|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, cBlockSize);
 3646|     11|            return;
 3647|     11|        }
 3648|       |
 3649|  9.85k|        ip += ZSTDv06_blockHeaderSize;
 3650|  9.85k|        remainingSize -= ZSTDv06_blockHeaderSize;
 3651|  9.85k|        if (cBlockSize > remainingSize) {
  ------------------
  |  Branch (3651:13): [True: 72, False: 9.78k]
  ------------------
 3652|     72|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(srcSize_wrong));
  ------------------
  |  |   49|     72|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     72|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     72|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3653|     72|            return;
 3654|     72|        }
 3655|       |
 3656|  9.78k|        if (cBlockSize == 0) break;   /* bt_end */
  ------------------
  |  Branch (3656:13): [True: 6.68k, False: 3.09k]
  ------------------
 3657|       |
 3658|  3.09k|        ip += cBlockSize;
 3659|  3.09k|        remainingSize -= cBlockSize;
 3660|  3.09k|        nbBlocks++;
 3661|  3.09k|    }
 3662|       |
 3663|  6.68k|    *cSize = ip - (const BYTE*)src;
 3664|  6.68k|    *dBound = nbBlocks * ZSTDv06_BLOCKSIZE_MAX;
  ------------------
  |  |  344|  6.68k|#define ZSTDv06_BLOCKSIZE_MAX (128 * 1024)   /* define, for static allocation */
  ------------------
 3665|  6.68k|}
ZSTDv06_decompressBegin_usingDict:
 3827|  6.68k|{
 3828|  6.68k|    { size_t const errorCode = ZSTDv06_decompressBegin(dctx);
 3829|  6.68k|      if (ZSTDv06_isError(errorCode)) return errorCode; }
  ------------------
  |  | 2731|  6.68k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3829:11): [True: 0, False: 6.68k]
  ------------------
 3830|       |
 3831|  6.68k|    if (dict && dictSize) {
  ------------------
  |  Branch (3831:9): [True: 6.68k, False: 0]
  |  Branch (3831:17): [True: 4.80k, False: 1.88k]
  ------------------
 3832|  4.80k|        size_t const errorCode = ZSTDv06_decompress_insertDictionary(dctx, dict, dictSize);
 3833|  4.80k|        if (ZSTDv06_isError(errorCode)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2731|  4.80k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
                      if (ZSTDv06_isError(errorCode)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|  3.87k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  3.87k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  3.87k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3833:13): [True: 3.87k, False: 929]
  ------------------
 3834|  4.80k|    }
 3835|       |
 3836|  2.80k|    return 0;
 3837|  6.68k|}
zstd_v06.c:MEM_readLE32:
  190|   161k|{
  191|   161k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (191:9): [True: 161k, False: 0]
  ------------------
  192|   161k|        return MEM_read32(memPtr);
  193|      0|    else
  194|      0|        return MEM_swap32(MEM_read32(memPtr));
  195|   161k|}
zstd_v06.c:MEM_isLittleEndian:
  108|  1.09M|{
  109|  1.09M|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  110|  1.09M|    return one.c[0];
  111|  1.09M|}
zstd_v06.c:MEM_read32:
  119|   161k|{
  120|   161k|    U32 val; memcpy(&val, memPtr, sizeof(val)); return val;
  121|   161k|}
zstd_v06.c:FSEv06_abs:
 1205|   123k|static short FSEv06_abs(short a) { return a<0 ? -a : a; }
  ------------------
  |  Branch (1205:43): [True: 67.5k, False: 55.6k]
  ------------------
zstd_v06.c:BITv06_highbit32:
  802|  4.43M|{
  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|  4.43M|}
zstd_v06.c:FSEv06_decompress_usingDTable_generic:
 1515|  3.43k|{
 1516|  3.43k|    BYTE* const ostart = (BYTE*) dst;
 1517|  3.43k|    BYTE* op = ostart;
 1518|  3.43k|    BYTE* const omax = op + maxDstSize;
 1519|  3.43k|    BYTE* const olimit = omax-3;
 1520|       |
 1521|  3.43k|    BITv06_DStream_t bitD;
 1522|  3.43k|    FSEv06_DState_t state1;
 1523|  3.43k|    FSEv06_DState_t state2;
 1524|       |
 1525|       |    /* Init */
 1526|  3.43k|    { size_t const errorCode = BITv06_initDStream(&bitD, cSrc, cSrcSize);   /* replaced last arg by maxCompressed Size */
 1527|  3.43k|      if (FSEv06_isError(errorCode)) return errorCode; }
  ------------------
  |  | 1357|  3.43k|#define FSEv06_isError ERR_isError
  ------------------
  |  Branch (1527:11): [True: 351, False: 3.08k]
  ------------------
 1528|       |
 1529|  3.08k|    FSEv06_initDState(&state1, &bitD, dt);
 1530|  3.08k|    FSEv06_initDState(&state2, &bitD, dt);
 1531|       |
 1532|  3.08k|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
 1533|       |
 1534|       |    /* 4 symbols per loop */
 1535|  60.2k|    for ( ; (BITv06_reloadDStream(&bitD)==BITv06_DStream_unfinished) && (op<olimit) ; op+=4) {
  ------------------
  |  Branch (1535:13): [True: 57.7k, False: 2.50k]
  |  Branch (1535:73): [True: 57.1k, False: 583]
  ------------------
 1536|  57.1k|        op[0] = FSEv06_GETSYMBOL(&state1);
  ------------------
  |  | 1532|  57.1k|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1532:36): [True: 27.5k, False: 29.6k]
  |  |  ------------------
  ------------------
 1537|       |
 1538|  57.1k|        if (FSEv06_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1134|  57.1k|#define FSEv06_MAX_TABLELOG  (FSEv06_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1111|  57.1k|#define FSEv06_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1538:13): [Folded, False: 57.1k]
  ------------------
 1539|      0|            BITv06_reloadDStream(&bitD);
 1540|       |
 1541|  57.1k|        op[1] = FSEv06_GETSYMBOL(&state2);
  ------------------
  |  | 1532|  57.1k|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1532:36): [True: 27.5k, False: 29.6k]
  |  |  ------------------
  ------------------
 1542|       |
 1543|  57.1k|        if (FSEv06_MAX_TABLELOG*4+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1134|  57.1k|#define FSEv06_MAX_TABLELOG  (FSEv06_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1111|  57.1k|#define FSEv06_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1543:13): [Folded, False: 57.1k]
  ------------------
 1544|      0|            { if (BITv06_reloadDStream(&bitD) > BITv06_DStream_unfinished) { op+=2; break; } }
  ------------------
  |  Branch (1544:19): [True: 0, False: 0]
  ------------------
 1545|       |
 1546|  57.1k|        op[2] = FSEv06_GETSYMBOL(&state1);
  ------------------
  |  | 1532|  57.1k|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1532:36): [True: 27.5k, False: 29.6k]
  |  |  ------------------
  ------------------
 1547|       |
 1548|  57.1k|        if (FSEv06_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1134|  57.1k|#define FSEv06_MAX_TABLELOG  (FSEv06_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1111|  57.1k|#define FSEv06_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1548:13): [Folded, False: 57.1k]
  ------------------
 1549|      0|            BITv06_reloadDStream(&bitD);
 1550|       |
 1551|  57.1k|        op[3] = FSEv06_GETSYMBOL(&state2);
  ------------------
  |  | 1532|  57.1k|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1532:36): [True: 27.5k, False: 29.6k]
  |  |  ------------------
  ------------------
 1552|  57.1k|    }
 1553|       |
 1554|       |    /* tail */
 1555|       |    /* note : BITv06_reloadDStream(&bitD) >= FSEv06_DStream_partiallyFilled; Ends at exactly BITv06_DStream_completed */
 1556|  30.5k|    while (1) {
  ------------------
  |  Branch (1556:12): [True: 30.5k, Folded]
  ------------------
 1557|  30.5k|        if (op>(omax-2)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|    615|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    615|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    615|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1557:13): [True: 615, False: 29.9k]
  ------------------
 1558|       |
 1559|  29.9k|        *op++ = FSEv06_GETSYMBOL(&state1);
  ------------------
  |  | 1532|  29.9k|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1532:36): [True: 9.22k, False: 20.6k]
  |  |  ------------------
  ------------------
 1560|       |
 1561|  29.9k|        if (BITv06_reloadDStream(&bitD)==BITv06_DStream_overflow) {
  ------------------
  |  Branch (1561:13): [True: 1.45k, False: 28.4k]
  ------------------
 1562|  1.45k|            *op++ = FSEv06_GETSYMBOL(&state2);
  ------------------
  |  | 1532|  1.45k|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1532:36): [True: 626, False: 829]
  |  |  ------------------
  ------------------
 1563|  1.45k|            break;
 1564|  1.45k|        }
 1565|       |
 1566|  28.4k|        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: 28.4k]
  ------------------
 1567|       |
 1568|  28.4k|        *op++ = FSEv06_GETSYMBOL(&state2);
  ------------------
  |  | 1532|  28.4k|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1532:36): [True: 8.60k, False: 19.8k]
  |  |  ------------------
  ------------------
 1569|       |
 1570|  28.4k|        if (BITv06_reloadDStream(&bitD)==BITv06_DStream_overflow) {
  ------------------
  |  Branch (1570:13): [True: 1.01k, False: 27.4k]
  ------------------
 1571|  1.01k|            *op++ = FSEv06_GETSYMBOL(&state1);
  ------------------
  |  | 1532|  1.01k|#define FSEv06_GETSYMBOL(statePtr) fast ? FSEv06_decodeSymbolFast(statePtr, &bitD) : FSEv06_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1532:36): [True: 478, False: 537]
  |  |  ------------------
  ------------------
 1572|  1.01k|            break;
 1573|  1.01k|    }   }
 1574|       |
 1575|  2.47k|    return op-ostart;
 1576|  3.08k|}
zstd_v06.c:FSEv06_initDState:
 1053|  7.54k|{
 1054|  7.54k|    const void* ptr = dt;
 1055|  7.54k|    const FSEv06_DTableHeader* const DTableH = (const FSEv06_DTableHeader*)ptr;
 1056|  7.54k|    DStatePtr->state = BITv06_readBits(bitD, DTableH->tableLog);
 1057|  7.54k|    BITv06_reloadDStream(bitD);
 1058|  7.54k|    DStatePtr->table = dt + 1;
 1059|  7.54k|}
zstd_v06.c:BITv06_readBits:
  888|   228k|{
  889|   228k|    size_t const value = BITv06_lookBits(bitD, nbBits);
  890|   228k|    BITv06_skipBits(bitD, nbBits);
  891|   228k|    return value;
  892|   228k|}
zstd_v06.c:BITv06_lookBits:
  869|   228k|{
  870|   228k|    U32 const bitMask = sizeof(bitD->bitContainer)*8 - 1;
  871|   228k|    return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask);
  872|   228k|}
zstd_v06.c:BITv06_skipBits:
  883|  3.30M|{
  884|  3.30M|    bitD->bitsConsumed += nbBits;
  885|  3.30M|}
zstd_v06.c:FSEv06_decodeSymbolFast:
 1089|   128k|{
 1090|   128k|    FSEv06_decode_t const DInfo = ((const FSEv06_decode_t*)(DStatePtr->table))[DStatePtr->state];
 1091|   128k|    U32 const nbBits = DInfo.nbBits;
 1092|   128k|    BYTE const symbol = DInfo.symbol;
 1093|   128k|    size_t const lowBits = BITv06_readBitsFast(bitD, nbBits);
 1094|       |
 1095|   128k|    DStatePtr->state = DInfo.newState + lowBits;
 1096|   128k|    return symbol;
 1097|   128k|}
zstd_v06.c:BITv06_readBitsFast:
  897|   128k|{
  898|   128k|    size_t const value = BITv06_lookBitsFast(bitD, nbBits);
  899|   128k|    BITv06_skipBits(bitD, nbBits);
  900|   128k|    return value;
  901|   128k|}
zstd_v06.c:BITv06_lookBitsFast:
  877|  3.07M|{
  878|  3.07M|    U32 const bitMask = sizeof(bitD->bitContainer)*8 - 1;
  879|  3.07M|    return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask);
  880|  3.07M|}
zstd_v06.c:FSEv06_decodeSymbol:
 1076|   160k|{
 1077|   160k|    FSEv06_decode_t const DInfo = ((const FSEv06_decode_t*)(DStatePtr->table))[DStatePtr->state];
 1078|   160k|    U32 const nbBits = DInfo.nbBits;
 1079|   160k|    BYTE const symbol = DInfo.symbol;
 1080|   160k|    size_t const lowBits = BITv06_readBits(bitD, nbBits);
 1081|       |
 1082|   160k|    DStatePtr->state = DInfo.newState + lowBits;
 1083|   160k|    return symbol;
 1084|   160k|}
zstd_v06.c:HUFv06_readStats:
 1801|  5.16k|{
 1802|  5.16k|    U32 weightTotal;
 1803|  5.16k|    const BYTE* ip = (const BYTE*) src;
 1804|  5.16k|    size_t iSize;
 1805|  5.16k|    size_t oSize;
 1806|       |
 1807|  5.16k|    if (!srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   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 (1807:9): [True: 93, False: 5.07k]
  ------------------
 1808|  5.07k|    iSize = ip[0];
 1809|       |    /* memset(huffWeight, 0, hwSize); */   /* is not necessary, even though some analyzer complain ... */
 1810|       |
 1811|  5.07k|    if (iSize >= 128)  { /* special header */
  ------------------
  |  Branch (1811:9): [True: 1.18k, False: 3.89k]
  ------------------
 1812|  1.18k|        if (iSize >= (242)) {  /* RLE */
  ------------------
  |  Branch (1812:13): [True: 969, False: 214]
  ------------------
 1813|    969|            static U32 l[14] = { 1, 2, 3, 4, 7, 8, 15, 16, 31, 32, 63, 64, 127, 128 };
 1814|    969|            oSize = l[iSize-242];
 1815|    969|            memset(huffWeight, 1, hwSize);
 1816|    969|            iSize = 0;
 1817|    969|        }
 1818|    214|        else {   /* Incompressible */
 1819|    214|            oSize = iSize - 127;
 1820|    214|            iSize = ((oSize+1)/2);
 1821|    214|            if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   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 (1821:17): [True: 73, False: 141]
  ------------------
 1822|    141|            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: 141]
  ------------------
 1823|    141|            ip += 1;
 1824|    141|            {   U32 n;
 1825|  3.57k|                for (n=0; n<oSize; n+=2) {
  ------------------
  |  Branch (1825:27): [True: 3.43k, False: 141]
  ------------------
 1826|  3.43k|                    huffWeight[n]   = ip[n/2] >> 4;
 1827|  3.43k|                    huffWeight[n+1] = ip[n/2] & 15;
 1828|  3.43k|    }   }   }   }
 1829|  3.89k|    else  {   /* header compressed with FSE (normal case) */
 1830|  3.89k|        if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     80|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     80|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     80|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1830:13): [True: 80, False: 3.81k]
  ------------------
 1831|  3.81k|        oSize = FSEv06_decompress(huffWeight, hwSize-1, ip+1, iSize);   /* max (hwSize-1) values decoded, as last one is implied */
 1832|  3.81k|        if (FSEv06_isError(oSize)) return oSize;
  ------------------
  |  | 1357|  3.81k|#define FSEv06_isError ERR_isError
  ------------------
  |  Branch (1832:13): [True: 1.34k, False: 2.47k]
  ------------------
 1833|  3.81k|    }
 1834|       |
 1835|       |    /* collect weight stats */
 1836|  3.58k|    memset(rankStats, 0, (HUFv06_ABSOLUTEMAX_TABLELOG + 1) * sizeof(U32));
  ------------------
  |  | 1783|  3.58k|#define HUFv06_ABSOLUTEMAX_TABLELOG  16   /* absolute limit of HUFv06_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
 1837|  3.58k|    weightTotal = 0;
 1838|   190k|    {   U32 n; for (n=0; n<oSize; n++) {
  ------------------
  |  Branch (1838:26): [True: 187k, False: 3.15k]
  ------------------
 1839|   187k|            if (huffWeight[n] >= HUFv06_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  | 1783|   187k|#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|    422|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    422|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    422|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1839:17): [True: 422, False: 186k]
  ------------------
 1840|   186k|            rankStats[huffWeight[n]]++;
 1841|   186k|            weightTotal += (1 << huffWeight[n]) >> 1;
 1842|   186k|    }   }
 1843|  3.15k|    if (weightTotal == 0) return ERROR(corruption_detected);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1843:9): [True: 156, False: 3.00k]
  ------------------
 1844|       |
 1845|       |    /* get last non-null symbol weight (implied, total must be 2^n) */
 1846|  3.00k|    {   U32 const tableLog = BITv06_highbit32(weightTotal) + 1;
 1847|  3.00k|        if (tableLog > HUFv06_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  | 1783|  3.00k|#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|     77|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     77|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     77|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1847:13): [True: 77, False: 2.92k]
  ------------------
 1848|  2.92k|        *tableLogPtr = tableLog;
 1849|       |        /* determine last weight */
 1850|  2.92k|        {   U32 const total = 1 << tableLog;
 1851|  2.92k|            U32 const rest = total - weightTotal;
 1852|  2.92k|            U32 const verif = 1 << BITv06_highbit32(rest);
 1853|  2.92k|            U32 const lastWeight = BITv06_highbit32(rest) + 1;
 1854|  2.92k|            if (verif != rest) return ERROR(corruption_detected);    /* last value must be a clean power of 2 */
  ------------------
  |  |   49|    436|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    436|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    436|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1854:17): [True: 436, False: 2.48k]
  ------------------
 1855|  2.48k|            huffWeight[oSize] = (BYTE)lastWeight;
 1856|  2.48k|            rankStats[lastWeight]++;
 1857|  2.48k|    }   }
 1858|       |
 1859|       |    /* check tree construction validity */
 1860|  2.48k|    if ((rankStats[1] < 2) || (rankStats[1] & 1)) return ERROR(corruption_detected);   /* by construction : at least 2 elts of rank 1, must be even */
  ------------------
  |  |   49|    155|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    155|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    155|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1860:9): [True: 155, False: 2.33k]
  |  Branch (1860:31): [True: 0, False: 2.33k]
  ------------------
 1861|       |
 1862|       |    /* results */
 1863|  2.33k|    *nbSymbolsPtr = (U32)(oSize+1);
 1864|  2.33k|    return iSize+1;
 1865|  2.48k|}
zstd_v06.c:HUFv06_isError:
 1199|  7.07k|static unsigned HUFv06_isError(size_t code) { return ERR_isError(code); }
zstd_v06.c:BITv06_initDStream:
  834|  5.17k|{
  835|  5.17k|    if (srcSize < 1) { memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   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 (835:9): [True: 44, False: 5.13k]
  ------------------
  836|       |
  837|  5.13k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (837:9): [True: 3.21k, False: 1.91k]
  ------------------
  838|  3.21k|        bitD->start = (const char*)srcBuffer;
  839|  3.21k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  840|  3.21k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  841|  3.21k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  842|  3.21k|          if (lastByte == 0) return ERROR(GENERIC);   /* endMark not present */
  ------------------
  |  |   49|    415|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    415|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    415|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (842:15): [True: 415, False: 2.79k]
  ------------------
  843|  2.79k|          bitD->bitsConsumed = 8 - BITv06_highbit32(lastByte); }
  844|  2.79k|    } else {
  845|  1.91k|        bitD->start = (const char*)srcBuffer;
  846|  1.91k|        bitD->ptr   = bitD->start;
  847|  1.91k|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  848|  1.91k|        switch(srcSize)
  849|  1.91k|        {
  850|    181|            case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);/* fall-through */
  ------------------
  |  Branch (850:13): [True: 181, False: 1.73k]
  ------------------
  851|    369|            case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);/* fall-through */
  ------------------
  |  Branch (851:13): [True: 188, False: 1.73k]
  ------------------
  852|    554|            case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);/* fall-through */
  ------------------
  |  Branch (852:13): [True: 185, False: 1.73k]
  ------------------
  853|    819|            case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24; /* fall-through */
  ------------------
  |  Branch (853:13): [True: 265, False: 1.65k]
  ------------------
  854|  1.18k|            case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16; /* fall-through */
  ------------------
  |  Branch (854:13): [True: 365, False: 1.55k]
  ------------------
  855|  1.43k|            case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) <<  8; /* fall-through */
  ------------------
  |  Branch (855:13): [True: 248, False: 1.67k]
  ------------------
  856|  1.91k|            default: break;
  ------------------
  |  Branch (856:13): [True: 486, False: 1.43k]
  ------------------
  857|  1.91k|        }
  858|  1.91k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  859|  1.91k|          if (lastByte == 0) return ERROR(GENERIC);   /* endMark not present */
  ------------------
  |  |   49|    228|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    228|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    228|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (859:15): [True: 228, False: 1.69k]
  ------------------
  860|  1.69k|          bitD->bitsConsumed = 8 - BITv06_highbit32(lastByte); }
  861|      0|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  862|  1.69k|    }
  863|       |
  864|  4.48k|    return srcSize;
  865|  5.13k|}
zstd_v06.c:MEM_readLEST:
  208|   132k|{
  209|   132k|    if (MEM_32bits())
  ------------------
  |  Branch (209:9): [True: 0, False: 132k]
  ------------------
  210|      0|        return (size_t)MEM_readLE32(memPtr);
  211|   132k|    else
  212|   132k|        return (size_t)MEM_readLE64(memPtr);
  213|   132k|}
zstd_v06.c:MEM_32bits:
  104|   195k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_v06.c:HUFv06_decodeStreamX2:
 2014|    494|{
 2015|    494|    BYTE* const pStart = p;
 2016|       |
 2017|       |    /* up to 4 symbols at a time */
 2018|  3.75k|    while ((BITv06_reloadDStream(bitDPtr) == BITv06_DStream_unfinished) && (p <= pEnd-4)) {
  ------------------
  |  Branch (2018:12): [True: 3.34k, False: 418]
  |  Branch (2018:76): [True: 3.26k, False: 76]
  ------------------
 2019|  3.26k|        HUFv06_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 2010|  3.26k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 3.26k, False: 0]
  |  |  ------------------
  |  | 2011|  3.26k|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|  3.26k|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2020|  3.26k|        HUFv06_DECODE_SYMBOLX2_1(p, bitDPtr);
  ------------------
  |  | 2006|  3.26k|    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: 3.26k, False: 0]
  |  |  |  Branch (2006:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2007|  3.26k|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|  3.26k|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2021|  3.26k|        HUFv06_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 2010|  3.26k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2010:9): [True: 3.26k, False: 0]
  |  |  ------------------
  |  | 2011|  3.26k|        HUFv06_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 2003|  3.26k|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2022|  3.26k|        HUFv06_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 2003|  3.26k|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2023|  3.26k|    }
 2024|       |
 2025|       |    /* closer to the end */
 2026|    620|    while ((BITv06_reloadDStream(bitDPtr) == BITv06_DStream_unfinished) && (p < pEnd))
  ------------------
  |  Branch (2026:12): [True: 189, False: 431]
  |  Branch (2026:76): [True: 126, False: 63]
  ------------------
 2027|    126|        HUFv06_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 2003|    126|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2028|       |
 2029|       |    /* no more data to retrieve from bitstream, hence no need to reload */
 2030|  2.40M|    while (p < pEnd)
  ------------------
  |  Branch (2030:12): [True: 2.40M, False: 494]
  ------------------
 2031|  2.40M|        HUFv06_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 2003|  2.40M|    *ptr++ = HUFv06_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2032|       |
 2033|    494|    return pEnd-pStart;
 2034|    494|}
zstd_v06.c:BITv06_endOfDStream:
  935|    739|{
  936|    739|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (936:13): [True: 631, False: 108]
  |  Branch (936:49): [True: 43, False: 588]
  ------------------
  937|    739|}
zstd_v06.c:MEM_readLE16:
  169|  1.12k|{
  170|  1.12k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (170:9): [True: 1.12k, False: 0]
  ------------------
  171|  1.12k|        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.12k|}
zstd_v06.c:MEM_read16:
  114|  1.12k|{
  115|  1.12k|    U16 val; memcpy(&val, memPtr, sizeof(val)); return val;
  116|  1.12k|}
zstd_v06.c:BITv06_reloadDStream:
  904|   194k|{
  905|   194k|    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))  /* should never happen */
  ------------------
  |  Branch (905:9): [True: 3.75k, False: 190k]
  ------------------
  906|  3.75k|        return BITv06_DStream_overflow;
  907|       |
  908|   190k|    if (bitD->ptr >= bitD->start + sizeof(bitD->bitContainer)) {
  ------------------
  |  Branch (908:9): [True: 110k, False: 80.4k]
  ------------------
  909|   110k|        bitD->ptr -= bitD->bitsConsumed >> 3;
  910|   110k|        bitD->bitsConsumed &= 7;
  911|   110k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  912|   110k|        return BITv06_DStream_unfinished;
  913|   110k|    }
  914|  80.4k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (914:9): [True: 61.7k, False: 18.7k]
  ------------------
  915|  61.7k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BITv06_DStream_endOfBuffer;
  ------------------
  |  Branch (915:13): [True: 59.4k, False: 2.31k]
  ------------------
  916|  2.31k|        return BITv06_DStream_completed;
  917|  61.7k|    }
  918|  18.7k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  919|  18.7k|        BITv06_DStream_status result = BITv06_DStream_unfinished;
  920|  18.7k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (920:13): [True: 1.02k, False: 17.7k]
  ------------------
  921|  1.02k|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  922|  1.02k|            result = BITv06_DStream_endOfBuffer;
  923|  1.02k|        }
  924|  18.7k|        bitD->ptr -= nbBytes;
  925|  18.7k|        bitD->bitsConsumed -= nbBytes*8;
  926|  18.7k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD) */
  927|  18.7k|        return result;
  928|  80.4k|    }
  929|  80.4k|}
zstd_v06.c:MEM_64bits:
  105|   151k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_v06.c:HUFv06_decodeSymbolX2:
 1995|  2.41M|{
 1996|  2.41M|    const size_t val = BITv06_lookBitsFast(Dstream, dtLog); /* note : dtLog >= 1 */
 1997|  2.41M|    const BYTE c = dt[val].byte;
 1998|  2.41M|    BITv06_skipBits(Dstream, dt[val].nbBits);
 1999|  2.41M|    return c;
 2000|  2.41M|}
zstd_v06.c:HUFv06_fillDTableX4:
 2233|  1.79k|{
 2234|  1.79k|    U32 rankVal[HUFv06_ABSOLUTEMAX_TABLELOG + 1];
 2235|  1.79k|    const int scaleLog = nbBitsBaseline - targetLog;   /* note : targetLog >= srcLog, hence scaleLog <= 1 */
 2236|  1.79k|    const U32 minBits  = nbBitsBaseline - maxWeight;
 2237|  1.79k|    U32 s;
 2238|       |
 2239|  1.79k|    memcpy(rankVal, rankValOrigin, sizeof(rankVal));
 2240|       |
 2241|       |    /* fill DTable */
 2242|   101k|    for (s=0; s<sortedListSize; s++) {
  ------------------
  |  Branch (2242:15): [True: 99.9k, False: 1.79k]
  ------------------
 2243|  99.9k|        const U16 symbol = sortedList[s].symbol;
 2244|  99.9k|        const U32 weight = sortedList[s].weight;
 2245|  99.9k|        const U32 nbBits = nbBitsBaseline - weight;
 2246|  99.9k|        const U32 start = rankVal[weight];
 2247|  99.9k|        const U32 length = 1 << (targetLog-nbBits);
 2248|       |
 2249|  99.9k|        if (targetLog-nbBits >= minBits) {   /* enough room for a second symbol */
  ------------------
  |  Branch (2249:13): [True: 67.9k, False: 32.0k]
  ------------------
 2250|  67.9k|            U32 sortedRank;
 2251|  67.9k|            int minWeight = nbBits + scaleLog;
 2252|  67.9k|            if (minWeight < 1) minWeight = 1;
  ------------------
  |  Branch (2252:17): [True: 8.87k, False: 59.0k]
  ------------------
 2253|  67.9k|            sortedRank = rankStart[minWeight];
 2254|  67.9k|            HUFv06_fillDTableX4Level2(DTable+start, targetLog-nbBits, nbBits,
 2255|  67.9k|                           rankValOrigin[nbBits], minWeight,
 2256|  67.9k|                           sortedList+sortedRank, sortedListSize-sortedRank,
 2257|  67.9k|                           nbBitsBaseline, symbol);
 2258|  67.9k|        } else {
 2259|  32.0k|            HUFv06_DEltX4 DElt;
 2260|  32.0k|            MEM_writeLE16(&(DElt.sequence), symbol);
 2261|  32.0k|            DElt.nbBits = (BYTE)(nbBits);
 2262|  32.0k|            DElt.length = 1;
 2263|  32.0k|            {   U32 u;
 2264|  32.0k|                const U32 end = start + length;
 2265|   629k|                for (u = start; u < end; u++) DTable[u] = DElt;
  ------------------
  |  Branch (2265:33): [True: 597k, False: 32.0k]
  ------------------
 2266|  32.0k|        }   }
 2267|  99.9k|        rankVal[weight] += length;
 2268|  99.9k|    }
 2269|  1.79k|}
zstd_v06.c:HUFv06_fillDTableX4Level2:
 2191|  67.9k|{
 2192|  67.9k|    HUFv06_DEltX4 DElt;
 2193|  67.9k|    U32 rankVal[HUFv06_ABSOLUTEMAX_TABLELOG + 1];
 2194|       |
 2195|       |    /* get pre-calculated rankVal */
 2196|  67.9k|    memcpy(rankVal, rankValOrigin, sizeof(rankVal));
 2197|       |
 2198|       |    /* fill skipped values */
 2199|  67.9k|    if (minWeight>1) {
  ------------------
  |  Branch (2199:9): [True: 54.3k, False: 13.5k]
  ------------------
 2200|  54.3k|        U32 i, skipSize = rankVal[minWeight];
 2201|  54.3k|        MEM_writeLE16(&(DElt.sequence), baseSeq);
 2202|  54.3k|        DElt.nbBits   = (BYTE)(consumed);
 2203|  54.3k|        DElt.length   = 1;
 2204|   628k|        for (i = 0; i < skipSize; i++)
  ------------------
  |  Branch (2204:21): [True: 574k, False: 54.3k]
  ------------------
 2205|   574k|            DTable[i] = DElt;
 2206|  54.3k|    }
 2207|       |
 2208|       |    /* fill DTable */
 2209|   776k|    { U32 s; for (s=0; s<sortedListSize; s++) {   /* note : sortedSymbols already skipped */
  ------------------
  |  Branch (2209:24): [True: 708k, False: 67.9k]
  ------------------
 2210|   708k|        const U32 symbol = sortedSymbols[s].symbol;
 2211|   708k|        const U32 weight = sortedSymbols[s].weight;
 2212|   708k|        const U32 nbBits = nbBitsBaseline - weight;
 2213|   708k|        const U32 length = 1 << (sizeLog-nbBits);
 2214|   708k|        const U32 start = rankVal[weight];
 2215|   708k|        U32 i = start;
 2216|   708k|        const U32 end = start + length;
 2217|       |
 2218|   708k|        MEM_writeLE16(&(DElt.sequence), (U16)(baseSeq + (symbol << 8)));
 2219|   708k|        DElt.nbBits = (BYTE)(nbBits + consumed);
 2220|   708k|        DElt.length = 2;
 2221|  6.15M|        do { DTable[i++] = DElt; } while (i<end);   /* since length >= 1 */
  ------------------
  |  Branch (2221:43): [True: 5.45M, False: 708k]
  ------------------
 2222|       |
 2223|   708k|        rankVal[weight] += length;
 2224|   708k|    }}
 2225|  67.9k|}
zstd_v06.c:MEM_writeLE16:
  179|   794k|{
  180|   794k|    if (MEM_isLittleEndian()) {
  ------------------
  |  Branch (180:9): [True: 794k, False: 0]
  ------------------
  181|   794k|        MEM_write16(memPtr, val);
  182|   794k|    } else {
  183|      0|        BYTE* p = (BYTE*)memPtr;
  184|      0|        p[0] = (BYTE)val;
  185|      0|        p[1] = (BYTE)(val>>8);
  186|      0|    }
  187|   794k|}
zstd_v06.c:MEM_write16:
  129|   794k|{
  130|   794k|    memcpy(memPtr, &value, sizeof(value));
  131|   794k|}
zstd_v06.c:HUFv06_decodeStreamX4:
 2383|    245|{
 2384|    245|    BYTE* const pStart = p;
 2385|       |
 2386|       |    /* up to 8 symbols at a time */
 2387|  43.3k|    while ((BITv06_reloadDStream(bitDPtr) == BITv06_DStream_unfinished) && (p < pEnd-7)) {
  ------------------
  |  Branch (2387:12): [True: 43.1k, False: 187]
  |  Branch (2387:76): [True: 43.0k, False: 58]
  ------------------
 2388|  43.0k|        HUFv06_DECODE_SYMBOLX4_2(p, bitDPtr);
  ------------------
  |  | 2379|  43.0k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2379:9): [True: 43.0k, False: 0]
  |  |  ------------------
  |  | 2380|  43.0k|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2389|  43.0k|        HUFv06_DECODE_SYMBOLX4_1(p, bitDPtr);
  ------------------
  |  | 2375|  43.0k|    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: 43.0k, False: 0]
  |  |  |  Branch (2375:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2376|  43.0k|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2390|  43.0k|        HUFv06_DECODE_SYMBOLX4_2(p, bitDPtr);
  ------------------
  |  | 2379|  43.0k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2379:9): [True: 43.0k, False: 0]
  |  |  ------------------
  |  | 2380|  43.0k|        ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2391|  43.0k|        HUFv06_DECODE_SYMBOLX4_0(p, bitDPtr);
  ------------------
  |  | 2372|  43.0k|    ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2392|  43.0k|    }
 2393|       |
 2394|       |    /* closer to the end */
 2395|    424|    while ((BITv06_reloadDStream(bitDPtr) == BITv06_DStream_unfinished) && (p <= pEnd-2))
  ------------------
  |  Branch (2395:12): [True: 234, False: 190]
  |  Branch (2395:76): [True: 179, False: 55]
  ------------------
 2396|    179|        HUFv06_DECODE_SYMBOLX4_0(p, bitDPtr);
  ------------------
  |  | 2372|    179|    ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2397|       |
 2398|   347k|    while (p <= pEnd-2)
  ------------------
  |  Branch (2398:12): [True: 346k, False: 245]
  ------------------
 2399|   346k|        HUFv06_DECODE_SYMBOLX4_0(p, bitDPtr);   /* no need to reload : reached the end of DStream */
  ------------------
  |  | 2372|   346k|    ptr += HUFv06_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2400|       |
 2401|    245|    if (p < pEnd)
  ------------------
  |  Branch (2401:9): [True: 185, False: 60]
  ------------------
 2402|    185|        p += HUFv06_decodeLastSymbolX4(p, bitDPtr, dt, dtLog);
 2403|       |
 2404|    245|    return p-pStart;
 2405|    245|}
zstd_v06.c:HUFv06_decodeLastSymbolX4:
 2357|    185|{
 2358|    185|    const size_t val = BITv06_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */
 2359|    185|    memcpy(op, dt+val, 1);
 2360|    185|    if (dt[val].length==1) BITv06_skipBits(DStream, dt[val].nbBits);
  ------------------
  |  Branch (2360:9): [True: 92, False: 93]
  ------------------
 2361|     93|    else {
 2362|     93|        if (DStream->bitsConsumed < (sizeof(DStream->bitContainer)*8)) {
  ------------------
  |  Branch (2362:13): [True: 41, False: 52]
  ------------------
 2363|     41|            BITv06_skipBits(DStream, dt[val].nbBits);
 2364|     41|            if (DStream->bitsConsumed > (sizeof(DStream->bitContainer)*8))
  ------------------
  |  Branch (2364:17): [True: 14, False: 27]
  ------------------
 2365|     14|                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|     41|    }   }
 2367|    185|    return 1;
 2368|    185|}
zstd_v06.c:HUFv06_decodeSymbolX4:
 2349|   531k|{
 2350|   531k|    const size_t val = BITv06_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */
 2351|   531k|    memcpy(op, dt+val, 2);
 2352|   531k|    BITv06_skipBits(DStream, dt[val].nbBits);
 2353|   531k|    return dt[val].length;
 2354|   531k|}
zstd_v06.c:ZSTDv06_frameHeaderSize:
 2912|  25.2k|{
 2913|  25.2k|    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: 25.2k]
  ------------------
 2914|  25.2k|    { U32 const fcsId = (((const BYTE*)src)[4]) >> 6;
 2915|  25.2k|      return ZSTDv06_frameHeaderSize_min + ZSTDv06_fcs_fieldSize[fcsId]; }
 2916|  25.2k|}
zstd_v06.c:MEM_readLE64:
  199|   132k|{
  200|   132k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (200:9): [True: 132k, False: 0]
  ------------------
  201|   132k|        return MEM_read64(memPtr);
  202|      0|    else
  203|      0|        return MEM_swap64(MEM_read64(memPtr));
  204|   132k|}
zstd_v06.c:MEM_read64:
  124|   132k|{
  125|   132k|    U64 val; memcpy(&val, memPtr, sizeof(val)); return val;
  126|   132k|}
zstd_v06.c:ZSTDv06_checkContinuity:
 3465|  6.68k|{
 3466|  6.68k|    if (dst != dctx->previousDstEnd) {   /* not contiguous */
  ------------------
  |  Branch (3466:9): [True: 6.68k, False: 0]
  ------------------
 3467|  6.68k|        dctx->dictEnd = dctx->previousDstEnd;
 3468|  6.68k|        dctx->vBase = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3469|  6.68k|        dctx->base = dst;
 3470|  6.68k|        dctx->previousDstEnd = dst;
 3471|  6.68k|    }
 3472|  6.68k|}
zstd_v06.c:ZSTDv06_decompressBlock_internal:
 3478|  3.65k|{   /* blockType == blockCompressed */
 3479|  3.65k|    const BYTE* ip = (const BYTE*)src;
 3480|       |
 3481|  3.65k|    if (srcSize >= ZSTDv06_BLOCKSIZE_MAX) return ERROR(srcSize_wrong);
  ------------------
  |  |  344|  3.65k|#define ZSTDv06_BLOCKSIZE_MAX (128 * 1024)   /* define, for static allocation */
  ------------------
                  if (srcSize >= ZSTDv06_BLOCKSIZE_MAX) return ERROR(srcSize_wrong);
  ------------------
  |  |   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 (3481:9): [True: 7, False: 3.64k]
  ------------------
 3482|       |
 3483|       |    /* Decode literals sub-block */
 3484|  3.64k|    {   size_t const litCSize = ZSTDv06_decodeLiteralsBlock(dctx, src, srcSize);
 3485|  3.64k|        if (ZSTDv06_isError(litCSize)) return litCSize;
  ------------------
  |  | 2731|  3.64k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3485:13): [True: 2.55k, False: 1.08k]
  ------------------
 3486|  1.08k|        ip += litCSize;
 3487|  1.08k|        srcSize -= litCSize;
 3488|  1.08k|    }
 3489|      0|    return ZSTDv06_decompressSequences(dctx, dst, dstCapacity, ip, srcSize);
 3490|  3.64k|}
zstd_v06.c:ZSTDv06_decodeLiteralsBlock:
 3000|  3.64k|{
 3001|  3.64k|    const BYTE* const istart = (const BYTE*) src;
 3002|       |
 3003|       |    /* any compressed block with literals segment must be at least this size */
 3004|  3.64k|    if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  |  424|  3.64k|#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */ + MIN_SEQUENCES_SIZE /* nbSeq==0 */)   /* for a non-null block */
  |  |  ------------------
  |  |  |  |  423|  3.64k|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  |  |  ------------------
  ------------------
                  if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  |   49|  1.65k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  1.65k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.65k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3004:9): [True: 1.65k, False: 1.99k]
  ------------------
 3005|       |
 3006|  1.99k|    switch(istart[0]>> 6)
 3007|  1.99k|    {
 3008|    828|    case IS_HUF:
  ------------------
  |  |  428|    828|#define IS_HUF 0
  ------------------
  |  Branch (3008:5): [True: 828, False: 1.16k]
  ------------------
 3009|    828|        {   size_t litSize, litCSize, singleStream=0;
 3010|    828|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3011|    828|            if (srcSize < 5) return ERROR(corruption_detected);   /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for lhSize, + cSize (+nbSeq) */
  ------------------
  |  |   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 (3011:17): [True: 2, False: 826]
  ------------------
 3012|    826|            switch(lhSize)
 3013|    826|            {
 3014|    595|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3014:13): [True: 363, False: 463]
  |  Branch (3014:21): [True: 232, False: 594]
  |  Branch (3014:29): [True: 0, False: 826]
  ------------------
 3015|       |                /* 2 - 2 - 10 - 10 */
 3016|    595|                lhSize=3;
 3017|    595|                singleStream = istart[0] & 16;
 3018|    595|                litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 3019|    595|                litCSize = ((istart[1] &  3) << 8) + istart[2];
 3020|    595|                break;
 3021|    140|            case 2:
  ------------------
  |  Branch (3021:13): [True: 140, False: 686]
  ------------------
 3022|       |                /* 2 - 2 - 14 - 14 */
 3023|    140|                lhSize=4;
 3024|    140|                litSize  = ((istart[0] & 15) << 10) + (istart[1] << 2) + (istart[2] >> 6);
 3025|    140|                litCSize = ((istart[2] & 63) <<  8) + istart[3];
 3026|    140|                break;
 3027|     91|            case 3:
  ------------------
  |  Branch (3027:13): [True: 91, False: 735]
  ------------------
 3028|       |                /* 2 - 2 - 18 - 18 */
 3029|     91|                lhSize=5;
 3030|     91|                litSize  = ((istart[0] & 15) << 14) + (istart[1] << 6) + (istart[2] >> 2);
 3031|     91|                litCSize = ((istart[2] &  3) << 16) + (istart[3] << 8) + istart[4];
 3032|     91|                break;
 3033|    826|            }
 3034|    826|            if (litSize > ZSTDv06_BLOCKSIZE_MAX) return ERROR(corruption_detected);
  ------------------
  |  |  344|    826|#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: 824]
  ------------------
 3035|    824|            if (litCSize + lhSize > srcSize) 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 (3035:17): [True: 53, False: 771]
  ------------------
 3036|       |
 3037|    771|            if (HUFv06_isError(singleStream ?
  ------------------
  |  | 2733|    771|#define HUFv06_isError  ERR_isError
  ------------------
  |  Branch (3037:17): [True: 716, False: 55]
  |  Branch (3037:32): [True: 227, False: 544]
  ------------------
 3038|    227|                            HUFv06_decompress1X2(dctx->litBuffer, litSize, istart+lhSize, litCSize) :
 3039|    771|                            HUFv06_decompress   (dctx->litBuffer, litSize, istart+lhSize, litCSize) ))
 3040|    716|                return ERROR(corruption_detected);
  ------------------
  |  |   49|    716|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    716|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    716|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3041|       |
 3042|     55|            dctx->litPtr = dctx->litBuffer;
 3043|     55|            dctx->litSize = litSize;
 3044|     55|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  487|     55|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3045|     55|            return litCSize + lhSize;
 3046|    771|        }
 3047|    115|    case IS_PCH:
  ------------------
  |  |  429|    115|#define IS_PCH 1
  ------------------
  |  Branch (3047:5): [True: 115, False: 1.87k]
  ------------------
 3048|    115|        {   size_t litSize, litCSize;
 3049|    115|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3050|    115|            if (lhSize != 1)  /* only case supported for now : small litSize, single stream */
  ------------------
  |  Branch (3050:17): [True: 2, False: 113]
  ------------------
 3051|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3052|    113|            if (!dctx->flagRepeatTable)
  ------------------
  |  Branch (3052:17): [True: 2, False: 111]
  ------------------
 3053|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3054|       |
 3055|       |            /* 2 - 2 - 10 - 10 */
 3056|    111|            lhSize=3;
 3057|    111|            litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 3058|    111|            litCSize = ((istart[1] &  3) << 8) + istart[2];
 3059|    111|            if (litCSize + lhSize > srcSize) 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 (3059:17): [True: 3, False: 108]
  ------------------
 3060|       |
 3061|    108|            {   size_t const errorCode = HUFv06_decompress1X4_usingDTable(dctx->litBuffer, litSize, istart+lhSize, litCSize, dctx->hufTableX4);
 3062|    108|                if (HUFv06_isError(errorCode)) return ERROR(corruption_detected);
  ------------------
  |  | 2733|    108|#define HUFv06_isError  ERR_isError
  ------------------
                              if (HUFv06_isError(errorCode)) return ERROR(corruption_detected);
  ------------------
  |  |   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 (3062:21): [True: 79, False: 29]
  ------------------
 3063|    108|            }
 3064|     29|            dctx->litPtr = dctx->litBuffer;
 3065|     29|            dctx->litSize = litSize;
 3066|     29|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  487|     29|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3067|     29|            return litCSize + lhSize;
 3068|    108|        }
 3069|    352|    case IS_RAW:
  ------------------
  |  |  430|    352|#define IS_RAW 2
  ------------------
  |  Branch (3069:5): [True: 352, False: 1.63k]
  ------------------
 3070|    352|        {   size_t litSize;
 3071|    352|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3072|    352|            switch(lhSize)
 3073|    352|            {
 3074|    256|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3074:13): [True: 215, False: 137]
  |  Branch (3074:21): [True: 41, False: 311]
  |  Branch (3074:29): [True: 0, False: 352]
  ------------------
 3075|    256|                lhSize=1;
 3076|    256|                litSize = istart[0] & 31;
 3077|    256|                break;
 3078|     68|            case 2:
  ------------------
  |  Branch (3078:13): [True: 68, False: 284]
  ------------------
 3079|     68|                litSize = ((istart[0] & 15) << 8) + istart[1];
 3080|     68|                break;
 3081|     28|            case 3:
  ------------------
  |  Branch (3081:13): [True: 28, False: 324]
  ------------------
 3082|     28|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 3083|     28|                break;
 3084|    352|            }
 3085|       |
 3086|    352|            if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */
  ------------------
  |  |  487|    352|#define WILDCOPY_OVERLENGTH 8
  ------------------
  |  Branch (3086:17): [True: 115, False: 237]
  ------------------
 3087|    115|                if (litSize+lhSize > srcSize) 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 (3087:21): [True: 35, False: 80]
  ------------------
 3088|     80|                memcpy(dctx->litBuffer, istart+lhSize, litSize);
 3089|     80|                dctx->litPtr = dctx->litBuffer;
 3090|     80|                dctx->litSize = litSize;
 3091|     80|                memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  487|     80|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3092|     80|                return lhSize+litSize;
 3093|    115|            }
 3094|       |            /* direct reference into compressed stream */
 3095|    237|            dctx->litPtr = istart+lhSize;
 3096|    237|            dctx->litSize = litSize;
 3097|    237|            return lhSize+litSize;
 3098|    352|        }
 3099|    695|    case IS_RLE:
  ------------------
  |  |  431|    695|#define IS_RLE 3
  ------------------
  |  Branch (3099:5): [True: 695, False: 1.29k]
  ------------------
 3100|    695|        {   size_t litSize;
 3101|    695|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3102|    695|            switch(lhSize)
 3103|    695|            {
 3104|    537|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3104:13): [True: 30, False: 665]
  |  Branch (3104:21): [True: 507, False: 188]
  |  Branch (3104:29): [True: 0, False: 695]
  ------------------
 3105|    537|                lhSize = 1;
 3106|    537|                litSize = istart[0] & 31;
 3107|    537|                break;
 3108|     92|            case 2:
  ------------------
  |  Branch (3108:13): [True: 92, False: 603]
  ------------------
 3109|     92|                litSize = ((istart[0] & 15) << 8) + istart[1];
 3110|     92|                break;
 3111|     66|            case 3:
  ------------------
  |  Branch (3111:13): [True: 66, False: 629]
  ------------------
 3112|     66|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 3113|     66|                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: 65]
  ------------------
 3114|     65|                break;
 3115|    695|            }
 3116|    694|            if (litSize > ZSTDv06_BLOCKSIZE_MAX) return ERROR(corruption_detected);
  ------------------
  |  |  344|    694|#define ZSTDv06_BLOCKSIZE_MAX (128 * 1024)   /* define, for static allocation */
  ------------------
                          if (litSize > ZSTDv06_BLOCKSIZE_MAX) 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 (3116:17): [True: 7, False: 687]
  ------------------
 3117|    687|            memset(dctx->litBuffer, istart[lhSize], litSize + WILDCOPY_OVERLENGTH);
  ------------------
  |  |  487|    687|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3118|    687|            dctx->litPtr = dctx->litBuffer;
 3119|    687|            dctx->litSize = litSize;
 3120|    687|            return lhSize+1;
 3121|    694|        }
 3122|      0|    default:
  ------------------
  |  Branch (3122:5): [True: 0, False: 1.99k]
  ------------------
 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.99k|    }
 3125|  1.99k|}
zstd_v06.c:ZSTDv06_decompressSequences:
 3391|  1.08k|{
 3392|  1.08k|    const BYTE* ip = (const BYTE*)seqStart;
 3393|  1.08k|    const BYTE* const iend = ip + seqSize;
 3394|  1.08k|    BYTE* const ostart = (BYTE*)dst;
 3395|  1.08k|    BYTE* const oend = ostart + maxDstSize;
 3396|  1.08k|    BYTE* op = ostart;
 3397|  1.08k|    const BYTE* litPtr = dctx->litPtr;
 3398|  1.08k|    const BYTE* const litEnd = litPtr + dctx->litSize;
 3399|  1.08k|    FSEv06_DTable* DTableLL = dctx->LLTable;
 3400|  1.08k|    FSEv06_DTable* DTableML = dctx->MLTable;
 3401|  1.08k|    FSEv06_DTable* DTableOffb = dctx->OffTable;
 3402|  1.08k|    const BYTE* const base = (const BYTE*) (dctx->base);
 3403|  1.08k|    const BYTE* const vBase = (const BYTE*) (dctx->vBase);
 3404|  1.08k|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 3405|  1.08k|    int nbSeq;
 3406|       |
 3407|       |    /* Build Decoding Tables */
 3408|  1.08k|    {   size_t const seqHSize = ZSTDv06_decodeSeqHeaders(&nbSeq, DTableLL, DTableML, DTableOffb, dctx->flagRepeatTable, ip, seqSize);
 3409|  1.08k|        if (ZSTDv06_isError(seqHSize)) return seqHSize;
  ------------------
  |  | 2731|  1.08k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3409:13): [True: 124, False: 964]
  ------------------
 3410|    964|        ip += seqHSize;
 3411|    964|        dctx->flagRepeatTable = 0;
 3412|    964|    }
 3413|       |
 3414|       |    /* Regen sequences */
 3415|    964|    if (nbSeq) {
  ------------------
  |  Branch (3415:9): [True: 537, False: 427]
  ------------------
 3416|    537|        seq_t sequence;
 3417|    537|        seqState_t seqState;
 3418|       |
 3419|    537|        memset(&sequence, 0, sizeof(sequence));
 3420|    537|        sequence.offset = REPCODE_STARTVALUE;
  ------------------
  |  |  437|    537|#define REPCODE_STARTVALUE 1
  ------------------
 3421|  2.14k|        { U32 i; for (i=0; i<ZSTDv06_REP_INIT; i++) seqState.prevOffset[i] = REPCODE_STARTVALUE; }
  ------------------
  |  |  402|  2.14k|#define ZSTDv06_REP_INIT   ZSTDv06_REP_NUM
  |  |  ------------------
  |  |  |  |  401|  2.14k|#define ZSTDv06_REP_NUM    3
  |  |  ------------------
  ------------------
                      { U32 i; for (i=0; i<ZSTDv06_REP_INIT; i++) seqState.prevOffset[i] = REPCODE_STARTVALUE; }
  ------------------
  |  |  437|  1.61k|#define REPCODE_STARTVALUE 1
  ------------------
  |  Branch (3421:28): [True: 1.61k, False: 537]
  ------------------
 3422|    537|        { size_t const errorCode = BITv06_initDStream(&(seqState.DStream), ip, iend-ip);
 3423|    537|          if (ERR_isError(errorCode)) return ERROR(corruption_detected); }
  ------------------
  |  |   49|     80|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     80|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     80|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3423:15): [True: 80, False: 457]
  ------------------
 3424|    457|        FSEv06_initDState(&(seqState.stateLL), &(seqState.DStream), DTableLL);
 3425|    457|        FSEv06_initDState(&(seqState.stateOffb), &(seqState.DStream), DTableOffb);
 3426|    457|        FSEv06_initDState(&(seqState.stateML), &(seqState.DStream), DTableML);
 3427|       |
 3428|  15.4k|        for ( ; (BITv06_reloadDStream(&(seqState.DStream)) <= BITv06_DStream_completed) && nbSeq ; ) {
  ------------------
  |  Branch (3428:17): [True: 15.3k, False: 100]
  |  Branch (3428:92): [True: 15.2k, False: 61]
  ------------------
 3429|  15.2k|            nbSeq--;
 3430|  15.2k|            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|  15.2k|            {   size_t const oneSeqSize = ZSTDv06_execSequence(op, oend, sequence, &litPtr, litEnd, base, vBase, dictEnd);
 3442|  15.2k|                if (ZSTDv06_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  | 2731|  15.2k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3442:21): [True: 296, False: 14.9k]
  ------------------
 3443|  14.9k|                op += oneSeqSize;
 3444|  14.9k|        }   }
 3445|       |
 3446|       |        /* check if reached exact end */
 3447|    161|        if (nbSeq) 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 (3447:13): [True: 61, False: 100]
  ------------------
 3448|    161|    }
 3449|       |
 3450|       |    /* last literal segment */
 3451|    527|    {   size_t const lastLLSize = litEnd - litPtr;
 3452|    527|        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: 527]
  ------------------
 3453|    527|        if (op+lastLLSize > oend) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   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 (3453:13): [True: 17, False: 510]
  ------------------
 3454|    510|        if (lastLLSize > 0) {
  ------------------
  |  Branch (3454:13): [True: 490, False: 20]
  ------------------
 3455|    490|            memcpy(op, litPtr, lastLLSize);
 3456|    490|            op += lastLLSize;
 3457|    490|        }
 3458|    510|    }
 3459|       |
 3460|      0|    return op-ostart;
 3461|    527|}
zstd_v06.c:ZSTDv06_decodeSeqHeaders:
 3165|  1.08k|{
 3166|  1.08k|    const BYTE* const istart = (const BYTE*)src;
 3167|  1.08k|    const BYTE* const iend = istart + srcSize;
 3168|  1.08k|    const BYTE* ip = istart;
 3169|       |
 3170|       |    /* check */
 3171|  1.08k|    if (srcSize < MIN_SEQUENCES_SIZE) return ERROR(srcSize_wrong);
  ------------------
  |  |  423|  1.08k|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  ------------------
                  if (srcSize < MIN_SEQUENCES_SIZE) 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 (3171:9): [True: 8, False: 1.08k]
  ------------------
 3172|       |
 3173|       |    /* SeqHead */
 3174|  1.08k|    {   int nbSeq = *ip++;
 3175|  1.08k|        if (!nbSeq) { *nbSeqPtr=0; return 1; }
  ------------------
  |  Branch (3175:13): [True: 217, False: 863]
  ------------------
 3176|    863|        if (nbSeq > 0x7F) {
  ------------------
  |  Branch (3176:13): [True: 386, False: 477]
  ------------------
 3177|    386|            if (nbSeq == 0xFF) {
  ------------------
  |  Branch (3177:17): [True: 58, False: 328]
  ------------------
 3178|     58|                if (ip+2 > iend) 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 (3178:21): [True: 6, False: 52]
  ------------------
 3179|     52|                nbSeq = MEM_readLE16(ip) + LONGNBSEQ, ip+=2;
  ------------------
  |  |  433|     52|#define LONGNBSEQ 0x7F00
  ------------------
 3180|    328|            } else {
 3181|    328|                if (ip >= iend) return ERROR(srcSize_wrong);
  ------------------
  |  |   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 (3181:21): [True: 7, False: 321]
  ------------------
 3182|    321|                nbSeq = ((nbSeq-0x80)<<8) + *ip++;
 3183|    321|            }
 3184|    386|        }
 3185|    850|        *nbSeqPtr = nbSeq;
 3186|    850|    }
 3187|       |
 3188|       |    /* FSE table descriptors */
 3189|    850|    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|     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 (3189:9): [True: 15, False: 835]
  ------------------
 3190|    835|    {   U32 const LLtype  = *ip >> 6;
 3191|    835|        U32 const Offtype = (*ip >> 4) & 3;
 3192|    835|        U32 const MLtype  = (*ip >> 2) & 3;
 3193|    835|        ip++;
 3194|       |
 3195|       |        /* Build DTables */
 3196|    835|        {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableLL, LLtype, MaxLL, LLFSELog, ip, iend-ip, LL_defaultNorm, LL_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  442|    835|#define MaxLL  35
  ------------------
                      {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableLL, LLtype, MaxLL, LLFSELog, ip, iend-ip, LL_defaultNorm, LL_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  446|    835|#define LLFSELog    9
  ------------------
 3197|    835|            if (ZSTDv06_isError(bhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2731|    835|#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 (3197:17): [True: 24, False: 811]
  ------------------
 3198|    811|            ip += bhSize;
 3199|    811|        }
 3200|    811|        {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableOffb, Offtype, MaxOff, OffFSELog, ip, iend-ip, OF_defaultNorm, OF_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  443|    811|#define MaxOff 28
  ------------------
                      {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableOffb, Offtype, MaxOff, OffFSELog, ip, iend-ip, OF_defaultNorm, OF_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  447|    811|#define OffFSELog   8
  ------------------
 3201|    811|            if (ZSTDv06_isError(bhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2731|    811|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
                          if (ZSTDv06_isError(bhSize)) return ERROR(corruption_detected);
  ------------------
  |  |   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 (3201:17): [True: 41, False: 770]
  ------------------
 3202|    770|            ip += bhSize;
 3203|    770|        }
 3204|    770|        {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableML, MLtype, MaxML, MLFSELog, ip, iend-ip, ML_defaultNorm, ML_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  441|    770|#define MaxML  52
  ------------------
                      {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableML, MLtype, MaxML, MLFSELog, ip, iend-ip, ML_defaultNorm, ML_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  445|    770|#define MLFSELog    9
  ------------------
 3205|    770|            if (ZSTDv06_isError(bhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2731|    770|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
                          if (ZSTDv06_isError(bhSize)) return ERROR(corruption_detected);
  ------------------
  |  |   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 (3205:17): [True: 23, False: 747]
  ------------------
 3206|    747|            ip += bhSize;
 3207|    747|    }   }
 3208|       |
 3209|      0|    return ip-istart;
 3210|    770|}
zstd_v06.c:ZSTDv06_buildSeqTable:
 3135|  2.41k|{
 3136|  2.41k|    switch(type)
 3137|  2.41k|    {
 3138|    472|    case FSEv06_ENCODING_RLE :
  ------------------
  |  |  450|    472|#define FSEv06_ENCODING_RLE     1
  ------------------
  |  Branch (3138:5): [True: 472, False: 1.94k]
  ------------------
 3139|    472|        if (!srcSize) 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 (3139:13): [True: 3, False: 469]
  ------------------
 3140|    469|        if ( (*(const BYTE*)src) > max) 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 (3140:14): [True: 10, False: 459]
  ------------------
 3141|    459|        FSEv06_buildDTable_rle(DTable, *(const BYTE*)src);   /* if *src > max, data is corrupted */
 3142|    459|        return 1;
 3143|  1.27k|    case FSEv06_ENCODING_RAW :
  ------------------
  |  |  449|  1.27k|#define FSEv06_ENCODING_RAW     0
  ------------------
  |  Branch (3143:5): [True: 1.27k, False: 1.14k]
  ------------------
 3144|  1.27k|        FSEv06_buildDTable(DTable, defaultNorm, max, defaultLog);
 3145|  1.27k|        return 0;
 3146|     59|    case FSEv06_ENCODING_STATIC:
  ------------------
  |  |  451|     59|#define FSEv06_ENCODING_STATIC  2
  ------------------
  |  Branch (3146:5): [True: 59, False: 2.35k]
  ------------------
 3147|     59|        if (!flagRepeatTable) 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 (3147:13): [True: 9, False: 50]
  ------------------
 3148|     50|        return 0;
 3149|      0|    default :   /* impossible */
  ------------------
  |  Branch (3149:5): [True: 0, False: 2.41k]
  ------------------
 3150|    614|    case FSEv06_ENCODING_DYNAMIC :
  ------------------
  |  |  452|    614|#define FSEv06_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3150:5): [True: 614, False: 1.80k]
  ------------------
 3151|    614|        {   U32 tableLog;
 3152|    614|            S16 norm[MaxSeq+1];
 3153|    614|            size_t const headerSize = FSEv06_readNCount(norm, &max, &tableLog, src, srcSize);
 3154|    614|            if (FSEv06_isError(headerSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2732|    614|#define FSEv06_isError  ERR_isError
  ------------------
                          if (FSEv06_isError(headerSize)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     56|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     56|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     56|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3154:17): [True: 56, False: 558]
  ------------------
 3155|    558|            if (tableLog > maxLog) 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 (3155:17): [True: 10, False: 548]
  ------------------
 3156|    548|            FSEv06_buildDTable(DTable, norm, max, tableLog);
 3157|    548|            return headerSize;
 3158|    558|    }   }
 3159|  2.41k|}
zstd_v06.c:ZSTDv06_decodeSequence:
 3230|  15.2k|{
 3231|       |    /* Literal length */
 3232|  15.2k|    U32 const llCode = FSEv06_peekSymbol(&(seqState->stateLL));
 3233|  15.2k|    U32 const mlCode = FSEv06_peekSymbol(&(seqState->stateML));
 3234|  15.2k|    U32 const ofCode = FSEv06_peekSymbol(&(seqState->stateOffb));   /* <= maxOff, by table construction */
 3235|       |
 3236|  15.2k|    U32 const llBits = LL_bits[llCode];
 3237|  15.2k|    U32 const mlBits = ML_bits[mlCode];
 3238|  15.2k|    U32 const ofBits = ofCode;
 3239|  15.2k|    U32 const totalBits = llBits+mlBits+ofBits;
 3240|       |
 3241|  15.2k|    static const U32 LL_base[MaxLL+1] = {
 3242|  15.2k|                             0,  1,  2,  3,  4,  5,  6,  7,  8,  9,   10,    11,    12,    13,    14,     15,
 3243|  15.2k|                            16, 18, 20, 22, 24, 28, 32, 40, 48, 64, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000,
 3244|  15.2k|                            0x2000, 0x4000, 0x8000, 0x10000 };
 3245|       |
 3246|  15.2k|    static const U32 ML_base[MaxML+1] = {
 3247|  15.2k|                             0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10,   11,    12,    13,    14,    15,
 3248|  15.2k|                            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,   27,    28,    29,    30,    31,
 3249|  15.2k|                            32, 34, 36, 38, 40, 44, 48, 56, 64, 80, 96, 0x80, 0x100, 0x200, 0x400, 0x800,
 3250|  15.2k|                            0x1000, 0x2000, 0x4000, 0x8000, 0x10000 };
 3251|       |
 3252|  15.2k|    static const U32 OF_base[MaxOff+1] = {
 3253|  15.2k|                 0,        1,       3,       7,     0xF,     0x1F,     0x3F,     0x7F,
 3254|  15.2k|                 0xFF,   0x1FF,   0x3FF,   0x7FF,   0xFFF,   0x1FFF,   0x3FFF,   0x7FFF,
 3255|  15.2k|                 0xFFFF, 0x1FFFF, 0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF, 0x7FFFFF,
 3256|  15.2k|                 0xFFFFFF, 0x1FFFFFF, 0x3FFFFFF, /*fake*/ 1, 1 };
 3257|       |
 3258|       |    /* sequence */
 3259|  15.2k|    {   size_t offset;
 3260|  15.2k|        if (!ofCode)
  ------------------
  |  Branch (3260:13): [True: 4.59k, False: 10.6k]
  ------------------
 3261|  4.59k|            offset = 0;
 3262|  10.6k|        else {
 3263|  10.6k|            offset = OF_base[ofCode] + BITv06_readBits(&(seqState->DStream), ofBits);   /* <=  26 bits */
 3264|  10.6k|            if (MEM_32bits()) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3264:17): [True: 0, False: 10.6k]
  ------------------
 3265|  10.6k|        }
 3266|       |
 3267|  15.2k|        if (offset < ZSTDv06_REP_NUM) {
  ------------------
  |  |  401|  15.2k|#define ZSTDv06_REP_NUM    3
  ------------------
  |  Branch (3267:13): [True: 9.39k, False: 5.89k]
  ------------------
 3268|  9.39k|            if (llCode == 0 && offset <= 1) offset = 1-offset;
  ------------------
  |  Branch (3268:17): [True: 2.53k, False: 6.85k]
  |  Branch (3268:32): [True: 2.13k, False: 401]
  ------------------
 3269|       |
 3270|  9.39k|            if (offset != 0) {
  ------------------
  |  Branch (3270:17): [True: 5.92k, False: 3.46k]
  ------------------
 3271|  5.92k|                size_t temp = seqState->prevOffset[offset];
 3272|  5.92k|                if (offset != 1) {
  ------------------
  |  Branch (3272:21): [True: 1.82k, False: 4.10k]
  ------------------
 3273|  1.82k|                    seqState->prevOffset[2] = seqState->prevOffset[1];
 3274|  1.82k|                }
 3275|  5.92k|                seqState->prevOffset[1] = seqState->prevOffset[0];
 3276|  5.92k|                seqState->prevOffset[0] = offset = temp;
 3277|       |
 3278|  5.92k|            } else {
 3279|  3.46k|                offset = seqState->prevOffset[0];
 3280|  3.46k|            }
 3281|  9.39k|        } else {
 3282|  5.89k|            offset -= ZSTDv06_REP_MOVE;
  ------------------
  |  |  403|  5.89k|#define ZSTDv06_REP_MOVE   (ZSTDv06_REP_NUM-1)
  |  |  ------------------
  |  |  |  |  401|  5.89k|#define ZSTDv06_REP_NUM    3
  |  |  ------------------
  ------------------
 3283|  5.89k|            seqState->prevOffset[2] = seqState->prevOffset[1];
 3284|  5.89k|            seqState->prevOffset[1] = seqState->prevOffset[0];
 3285|  5.89k|            seqState->prevOffset[0] = offset;
 3286|  5.89k|        }
 3287|  15.2k|        seq->offset = offset;
 3288|  15.2k|    }
 3289|       |
 3290|  15.2k|    seq->matchLength = ML_base[mlCode] + MINMATCH + ((mlCode>31) ? BITv06_readBits(&(seqState->DStream), mlBits) : 0);   /* <=  16 bits */
  ------------------
  |  |  435|  15.2k|#define MINMATCH 3
  ------------------
  |  Branch (3290:54): [True: 2.25k, False: 13.0k]
  ------------------
 3291|  15.2k|    if (MEM_32bits() && (mlBits+llBits>24)) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3291:9): [True: 0, False: 15.2k]
  |  Branch (3291:25): [True: 0, False: 0]
  ------------------
 3292|       |
 3293|  15.2k|    seq->litLength = LL_base[llCode] + ((llCode>15) ? BITv06_readBits(&(seqState->DStream), llBits) : 0);   /* <=  16 bits */
  ------------------
  |  Branch (3293:41): [True: 2.22k, False: 13.0k]
  ------------------
 3294|  15.2k|    if (MEM_32bits() ||
  ------------------
  |  Branch (3294:9): [True: 0, False: 15.2k]
  ------------------
 3295|  15.2k|       (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  |  446|  15.2k|#define LLFSELog    9
  ------------------
                     (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  |  445|  15.2k|#define MLFSELog    9
  ------------------
                     (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  |  447|  15.2k|#define OffFSELog   8
  ------------------
  |  Branch (3295:8): [True: 48, False: 15.2k]
  ------------------
 3296|       |
 3297|       |    /* ANS state update */
 3298|  15.2k|    FSEv06_updateState(&(seqState->stateLL), &(seqState->DStream));   /* <=  9 bits */
 3299|  15.2k|    FSEv06_updateState(&(seqState->stateML), &(seqState->DStream));   /* <=  9 bits */
 3300|  15.2k|    if (MEM_32bits()) BITv06_reloadDStream(&(seqState->DStream));     /* <= 18 bits */
  ------------------
  |  Branch (3300:9): [True: 0, False: 15.2k]
  ------------------
 3301|  15.2k|    FSEv06_updateState(&(seqState->stateOffb), &(seqState->DStream)); /* <=  8 bits */
 3302|  15.2k|}
zstd_v06.c:FSEv06_peekSymbol:
 1062|  45.8k|{
 1063|  45.8k|    FSEv06_decode_t const DInfo = ((const FSEv06_decode_t*)(DStatePtr->table))[DStatePtr->state];
 1064|  45.8k|    return DInfo.symbol;
 1065|  45.8k|}
zstd_v06.c:FSEv06_updateState:
 1068|  45.8k|{
 1069|  45.8k|    FSEv06_decode_t const DInfo = ((const FSEv06_decode_t*)(DStatePtr->table))[DStatePtr->state];
 1070|  45.8k|    U32 const nbBits = DInfo.nbBits;
 1071|  45.8k|    size_t const lowBits = BITv06_readBits(bitD, nbBits);
 1072|  45.8k|    DStatePtr->state = DInfo.newState + lowBits;
 1073|  45.8k|}
zstd_v06.c:ZSTDv06_execSequence:
 3309|  15.2k|{
 3310|  15.2k|    BYTE* const oLitEnd = op + sequence.litLength;
 3311|  15.2k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 3312|  15.2k|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 3313|  15.2k|    BYTE* const oend_8 = oend-8;
 3314|  15.2k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 3315|  15.2k|    const BYTE* match = oLitEnd - sequence.offset;
 3316|       |
 3317|       |    /* checks */
 3318|  15.2k|    size_t const seqLength = sequence.litLength + sequence.matchLength;
 3319|       |
 3320|  15.2k|    if (seqLength > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|    153|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    153|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    153|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3320:9): [True: 153, False: 15.1k]
  ------------------
 3321|  15.1k|    if (sequence.litLength > (size_t)(litLimit - *litPtr)) return ERROR(corruption_detected);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3321:9): [True: 43, False: 15.0k]
  ------------------
 3322|       |    /* Now we know there are no overflow in literal nor match lengths, can use pointer checks */
 3323|  15.0k|    if (oLitEnd > oend_8) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   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 (3323:9): [True: 42, False: 15.0k]
  ------------------
 3324|       |
 3325|  15.0k|    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: 15.0k]
  ------------------
 3326|  15.0k|    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: 15.0k]
  ------------------
 3327|       |
 3328|       |    /* copy Literals */
 3329|  15.0k|    ZSTDv06_wildcopy(op, *litPtr, (ptrdiff_t)sequence.litLength);   /* note : oLitEnd <= oend-8 : no risk of overwrite beyond oend */
 3330|  15.0k|    op = oLitEnd;
 3331|  15.0k|    *litPtr = iLitEnd;   /* update for next sequence */
 3332|       |
 3333|       |    /* copy Match */
 3334|  15.0k|    if (sequence.offset > (size_t)(oLitEnd - base)) {
  ------------------
  |  Branch (3334:9): [True: 308, False: 14.7k]
  ------------------
 3335|       |        /* offset beyond prefix */
 3336|    308|        if (sequence.offset > (size_t)(oLitEnd - vBase)) 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 (3336:13): [True: 58, False: 250]
  ------------------
 3337|    250|        match = dictEnd - (base-match);
 3338|    250|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (3338:13): [True: 152, False: 98]
  ------------------
 3339|    152|            memmove(oLitEnd, match, sequence.matchLength);
 3340|    152|            return sequenceLength;
 3341|    152|        }
 3342|       |        /* span extDict & currentPrefixSegment */
 3343|     98|        {   size_t const length1 = dictEnd - match;
 3344|     98|            memmove(oLitEnd, match, length1);
 3345|     98|            op = oLitEnd + length1;
 3346|     98|            sequence.matchLength -= length1;
 3347|     98|            match = base;
 3348|     98|            if (op > oend_8 || sequence.matchLength < MINMATCH) {
  ------------------
  |  |  435|     95|#define MINMATCH 3
  ------------------
  |  Branch (3348:17): [True: 3, False: 95]
  |  Branch (3348:32): [True: 45, False: 50]
  ------------------
 3349|    146|              while (op < oMatchEnd) *op++ = *match++;
  ------------------
  |  Branch (3349:22): [True: 98, False: 48]
  ------------------
 3350|     48|              return sequenceLength;
 3351|     48|            }
 3352|     98|    }   }
 3353|       |    /* Requirement: op <= oend_8 */
 3354|       |
 3355|       |    /* match within prefix */
 3356|  14.7k|    if (sequence.offset < 8) {
  ------------------
  |  Branch (3356:9): [True: 8.38k, False: 6.40k]
  ------------------
 3357|       |        /* close range match, overlap */
 3358|  8.38k|        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
 3359|  8.38k|        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
 3360|  8.38k|        int const sub2 = dec64table[sequence.offset];
 3361|  8.38k|        op[0] = match[0];
 3362|  8.38k|        op[1] = match[1];
 3363|  8.38k|        op[2] = match[2];
 3364|  8.38k|        op[3] = match[3];
 3365|  8.38k|        match += dec32table[sequence.offset];
 3366|  8.38k|        ZSTDv06_copy4(op+4, match);
 3367|  8.38k|        match -= sub2;
 3368|  8.38k|    } else {
 3369|  6.40k|        ZSTDv06_copy8(op, match);
 3370|  6.40k|    }
 3371|  14.7k|    op += 8; match += 8;
 3372|       |
 3373|  14.7k|    if (oMatchEnd > oend-(16-MINMATCH)) {
  ------------------
  |  |  435|  14.7k|#define MINMATCH 3
  ------------------
  |  Branch (3373:9): [True: 187, False: 14.6k]
  ------------------
 3374|    187|        if (op < oend_8) {
  ------------------
  |  Branch (3374:13): [True: 45, False: 142]
  ------------------
 3375|     45|            ZSTDv06_wildcopy(op, match, oend_8 - op);
 3376|     45|            match += oend_8 - op;
 3377|     45|            op = oend_8;
 3378|     45|        }
 3379|    318|        while (op < oMatchEnd) *op++ = *match++;
  ------------------
  |  Branch (3379:16): [True: 131, False: 187]
  ------------------
 3380|  14.6k|    } else {
 3381|  14.6k|        ZSTDv06_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8);   /* works even if matchLength < 8 */
 3382|  14.6k|    }
 3383|  14.7k|    return sequenceLength;
 3384|  15.0k|}
zstd_v06.c:ZSTDv06_wildcopy:
  489|  29.6k|{
  490|  29.6k|    const BYTE* ip = (const BYTE*)src;
  491|  29.6k|    BYTE* op = (BYTE*)dst;
  492|  29.6k|    BYTE* const oend = op + length;
  493|  29.6k|    do
  494|   946k|        COPY8(op, ip)
  ------------------
  |  |  483|   946k|#define COPY8(d,s) { ZSTDv06_copy8(d,s); d+=8; s+=8; }
  ------------------
  495|   946k|    while (op < oend);
  ------------------
  |  Branch (495:12): [True: 916k, False: 29.6k]
  ------------------
  496|  29.6k|}
zstd_v06.c:ZSTDv06_copy4:
 2739|  8.38k|static void ZSTDv06_copy4(void* dst, const void* src) { memcpy(dst, src, 4); }
zstd_v06.c:ZSTDv06_copy8:
  482|   952k|static void ZSTDv06_copy8(void* dst, const void* src) { memcpy(dst, src, 8); }
zstd_v06.c:ZSTDv06_decompressFrame:
 3507|  6.68k|{
 3508|  6.68k|    const BYTE* ip = (const BYTE*)src;
 3509|  6.68k|    const BYTE* const iend = ip + srcSize;
 3510|  6.68k|    BYTE* const ostart = (BYTE*)dst;
 3511|  6.68k|    BYTE* op = ostart;
 3512|  6.68k|    BYTE* const oend = ostart + dstCapacity;
 3513|  6.68k|    size_t remainingSize = srcSize;
 3514|  6.68k|    blockProperties_t blockProperties = { bt_compressed, 0 };
 3515|       |
 3516|       |    /* check */
 3517|  6.68k|    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: 6.68k]
  ------------------
 3518|       |
 3519|       |    /* Frame Header */
 3520|  6.68k|    {   size_t const frameHeaderSize = ZSTDv06_frameHeaderSize(src, ZSTDv06_frameHeaderSize_min);
 3521|  6.68k|        if (ZSTDv06_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  | 2731|  6.68k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3521:13): [True: 0, False: 6.68k]
  ------------------
 3522|  6.68k|        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: 6.68k]
  ------------------
 3523|  6.68k|        if (ZSTDv06_decodeFrameHeader(dctx, src, frameHeaderSize)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     59|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     59|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     59|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3523:13): [True: 59, False: 6.62k]
  ------------------
 3524|  6.62k|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3525|  6.62k|    }
 3526|       |
 3527|       |    /* Loop on each block */
 3528|  7.30k|    while (1) {
  ------------------
  |  Branch (3528:12): [True: 7.30k, Folded]
  ------------------
 3529|  7.30k|        size_t decodedSize=0;
 3530|  7.30k|        size_t const cBlockSize = ZSTDv06_getcBlockSize(ip, iend-ip, &blockProperties);
 3531|  7.30k|        if (ZSTDv06_isError(cBlockSize)) return cBlockSize;
  ------------------
  |  | 2731|  7.30k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3531:13): [True: 0, False: 7.30k]
  ------------------
 3532|       |
 3533|  7.30k|        ip += ZSTDv06_blockHeaderSize;
 3534|  7.30k|        remainingSize -= ZSTDv06_blockHeaderSize;
 3535|  7.30k|        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: 7.30k]
  ------------------
 3536|       |
 3537|  7.30k|        switch(blockProperties.blockType)
 3538|  7.30k|        {
 3539|  3.65k|        case bt_compressed:
  ------------------
  |  Branch (3539:9): [True: 3.65k, False: 3.65k]
  ------------------
 3540|  3.65k|            decodedSize = ZSTDv06_decompressBlock_internal(dctx, op, oend-op, ip, cBlockSize);
 3541|  3.65k|            break;
 3542|  2.41k|        case bt_raw :
  ------------------
  |  Branch (3542:9): [True: 2.41k, False: 4.88k]
  ------------------
 3543|  2.41k|            decodedSize = ZSTDv06_copyRawBlock(op, oend-op, ip, cBlockSize);
 3544|  2.41k|            break;
 3545|     30|        case bt_rle :
  ------------------
  |  Branch (3545:9): [True: 30, False: 7.27k]
  ------------------
 3546|     30|            return ERROR(GENERIC);   /* not yet supported */
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3547|      0|            break;
 3548|  1.20k|        case bt_end :
  ------------------
  |  Branch (3548:9): [True: 1.20k, False: 6.09k]
  ------------------
 3549|       |            /* end of frame */
 3550|  1.20k|            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: 1.20k]
  ------------------
 3551|  1.20k|            break;
 3552|  1.20k|        default:
  ------------------
  |  Branch (3552:9): [True: 0, False: 7.30k]
  ------------------
 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|  7.30k|        }
 3555|  7.27k|        if (cBlockSize == 0) break;   /* bt_end */
  ------------------
  |  Branch (3555:13): [True: 5.09k, False: 2.17k]
  ------------------
 3556|       |
 3557|  2.17k|        if (ZSTDv06_isError(decodedSize)) return decodedSize;
  ------------------
  |  | 2731|  2.17k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3557:13): [True: 1.49k, False: 676]
  ------------------
 3558|    676|        op += decodedSize;
 3559|    676|        ip += cBlockSize;
 3560|    676|        remainingSize -= cBlockSize;
 3561|    676|    }
 3562|       |
 3563|  5.09k|    return op-ostart;
 3564|  6.62k|}
zstd_v06.c:ZSTD_errorFrameSizeInfoLegacy:
 3612|     99|{
 3613|     99|    *cSize = ret;
 3614|     99|    *dBound = ZSTD_CONTENTSIZE_ERROR;
  ------------------
  |  |  454|     99|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
 3615|     99|}
zstd_v06.c:ZSTDv06_getcBlockSize:
 2971|  17.1k|{
 2972|  17.1k|    const BYTE* const in = (const BYTE*)src;
 2973|  17.1k|    U32 cSize;
 2974|       |
 2975|  17.1k|    if (srcSize < ZSTDv06_blockHeaderSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   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 (2975:9): [True: 11, False: 17.1k]
  ------------------
 2976|       |
 2977|  17.1k|    bpPtr->blockType = (blockType_t)((*in) >> 6);
 2978|  17.1k|    cSize = in[2] + (in[1]<<8) + ((in[0] & 7)<<16);
 2979|  17.1k|    bpPtr->origSize = (bpPtr->blockType == bt_rle) ? cSize : 0;
  ------------------
  |  Branch (2979:23): [True: 513, False: 16.6k]
  ------------------
 2980|       |
 2981|  17.1k|    if (bpPtr->blockType == bt_end) return 0;
  ------------------
  |  Branch (2981:9): [True: 3.41k, False: 13.7k]
  ------------------
 2982|  13.7k|    if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (2982:9): [True: 513, False: 13.2k]
  ------------------
 2983|  13.2k|    return cSize;
 2984|  13.7k|}
zstd_v06.c:ZSTDv06_decodeFrameHeader:
 2955|  6.68k|{
 2956|  6.68k|    size_t const result = ZSTDv06_getFrameParams(&(zc->fParams), src, srcSize);
 2957|  6.68k|    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: 6.68k]
  |  Branch (2957:27): [True: 0, False: 0]
  ------------------
 2958|  6.68k|    return result;
 2959|  6.68k|}
zstd_v06.c:ZSTDv06_copyRawBlock:
 2988|  2.41k|{
 2989|  2.41k|    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: 2.41k]
  ------------------
 2990|  2.41k|    if (srcSize > dstCapacity) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   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 (2990:9): [True: 8, False: 2.40k]
  ------------------
 2991|  2.40k|    memcpy(dst, src, srcSize);
 2992|  2.40k|    return srcSize;
 2993|  2.41k|}
zstd_v06.c:ZSTDv06_decompress_insertDictionary:
 3803|  4.80k|{
 3804|  4.80k|    size_t eSize;
 3805|  4.80k|    U32 const magic = MEM_readLE32(dict);
 3806|  4.80k|    if (magic != ZSTDv06_DICT_MAGIC) {
  ------------------
  |  |  399|  4.80k|#define ZSTDv06_DICT_MAGIC  0xEC30A436
  ------------------
  |  Branch (3806:9): [True: 345, False: 4.46k]
  ------------------
 3807|       |        /* pure content mode */
 3808|    345|        ZSTDv06_refDictContent(dctx, dict, dictSize);
 3809|    345|        return 0;
 3810|    345|    }
 3811|       |    /* load entropy tables */
 3812|  4.46k|    dict = (const char*)dict + 4;
 3813|  4.46k|    dictSize -= 4;
 3814|  4.46k|    eSize = ZSTDv06_loadEntropy(dctx, dict, dictSize);
 3815|  4.46k|    if (ZSTDv06_isError(eSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2731|  4.46k|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
                  if (ZSTDv06_isError(eSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|  3.87k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  3.87k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  3.87k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3815:9): [True: 3.87k, False: 584]
  ------------------
 3816|       |
 3817|       |    /* reference dictionary content */
 3818|    584|    dict = (const char*)dict + eSize;
 3819|    584|    dictSize -= eSize;
 3820|    584|    ZSTDv06_refDictContent(dctx, dict, dictSize);
 3821|       |
 3822|    584|    return 0;
 3823|  4.46k|}
zstd_v06.c:ZSTDv06_refDictContent:
 3751|    929|{
 3752|    929|    dctx->dictEnd = dctx->previousDstEnd;
 3753|    929|    dctx->vBase = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3754|    929|    dctx->base = dict;
 3755|    929|    dctx->previousDstEnd = (const char*)dict + dictSize;
 3756|    929|}
zstd_v06.c:ZSTDv06_loadEntropy:
 3759|  4.46k|{
 3760|  4.46k|    size_t hSize, offcodeHeaderSize, matchlengthHeaderSize, litlengthHeaderSize;
 3761|       |
 3762|  4.46k|    hSize = HUFv06_readDTableX4(dctx->hufTableX4, dict, dictSize);
 3763|  4.46k|    if (HUFv06_isError(hSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2733|  4.46k|#define HUFv06_isError  ERR_isError
  ------------------
                  if (HUFv06_isError(hSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|  2.77k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  2.77k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.77k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3763:9): [True: 2.77k, False: 1.69k]
  ------------------
 3764|  1.69k|    dict = (const char*)dict + hSize;
 3765|  1.69k|    dictSize -= hSize;
 3766|       |
 3767|  1.69k|    {   short offcodeNCount[MaxOff+1];
 3768|  1.69k|        U32 offcodeMaxValue=MaxOff, offcodeLog;
  ------------------
  |  |  443|  1.69k|#define MaxOff 28
  ------------------
 3769|  1.69k|        offcodeHeaderSize = FSEv06_readNCount(offcodeNCount, &offcodeMaxValue, &offcodeLog, dict, dictSize);
 3770|  1.69k|        if (FSEv06_isError(offcodeHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2732|  1.69k|#define FSEv06_isError  ERR_isError
  ------------------
                      if (FSEv06_isError(offcodeHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|    295|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    295|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    295|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3770:13): [True: 295, False: 1.39k]
  ------------------
 3771|  1.39k|        if (offcodeLog > OffFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  |  447|  1.39k|#define OffFSELog   8
  ------------------
                      if (offcodeLog > OffFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|    104|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    104|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    104|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3771:13): [True: 104, False: 1.29k]
  ------------------
 3772|  1.29k|        { size_t const errorCode = FSEv06_buildDTable(dctx->OffTable, offcodeNCount, offcodeMaxValue, offcodeLog);
 3773|  1.29k|          if (FSEv06_isError(errorCode)) return ERROR(dictionary_corrupted); }
  ------------------
  |  | 2732|  1.29k|#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: 1.29k]
  ------------------
 3774|  1.29k|        dict = (const char*)dict + offcodeHeaderSize;
 3775|  1.29k|        dictSize -= offcodeHeaderSize;
 3776|  1.29k|    }
 3777|       |
 3778|      0|    {   short matchlengthNCount[MaxML+1];
 3779|  1.29k|        unsigned matchlengthMaxValue = MaxML, matchlengthLog;
  ------------------
  |  |  441|  1.29k|#define MaxML  52
  ------------------
 3780|  1.29k|        matchlengthHeaderSize = FSEv06_readNCount(matchlengthNCount, &matchlengthMaxValue, &matchlengthLog, dict, dictSize);
 3781|  1.29k|        if (FSEv06_isError(matchlengthHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2732|  1.29k|#define FSEv06_isError  ERR_isError
  ------------------
                      if (FSEv06_isError(matchlengthHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|    213|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    213|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    213|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3781:13): [True: 213, False: 1.08k]
  ------------------
 3782|  1.08k|        if (matchlengthLog > MLFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  |  445|  1.08k|#define MLFSELog    9
  ------------------
                      if (matchlengthLog > MLFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  |   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 (3782:13): [True: 87, False: 993]
  ------------------
 3783|    993|        { size_t const errorCode = FSEv06_buildDTable(dctx->MLTable, matchlengthNCount, matchlengthMaxValue, matchlengthLog);
 3784|    993|          if (FSEv06_isError(errorCode)) return ERROR(dictionary_corrupted); }
  ------------------
  |  | 2732|    993|#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: 993]
  ------------------
 3785|    993|        dict = (const char*)dict + matchlengthHeaderSize;
 3786|    993|        dictSize -= matchlengthHeaderSize;
 3787|    993|    }
 3788|       |
 3789|      0|    {   short litlengthNCount[MaxLL+1];
 3790|    993|        unsigned litlengthMaxValue = MaxLL, litlengthLog;
  ------------------
  |  |  442|    993|#define MaxLL  35
  ------------------
 3791|    993|        litlengthHeaderSize = FSEv06_readNCount(litlengthNCount, &litlengthMaxValue, &litlengthLog, dict, dictSize);
 3792|    993|        if (FSEv06_isError(litlengthHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2732|    993|#define FSEv06_isError  ERR_isError
  ------------------
                      if (FSEv06_isError(litlengthHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|    267|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    267|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    267|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3792:13): [True: 267, False: 726]
  ------------------
 3793|    726|        if (litlengthLog > LLFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  |  446|    726|#define LLFSELog    9
  ------------------
                      if (litlengthLog > LLFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|    142|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    142|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    142|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3793:13): [True: 142, False: 584]
  ------------------
 3794|    584|        { size_t const errorCode = FSEv06_buildDTable(dctx->LLTable, litlengthNCount, litlengthMaxValue, litlengthLog);
 3795|    584|          if (FSEv06_isError(errorCode)) return ERROR(dictionary_corrupted); }
  ------------------
  |  | 2732|    584|#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: 584]
  ------------------
 3796|    584|    }
 3797|       |
 3798|    584|    dctx->flagRepeatTable = 1;
 3799|    584|    return hSize + offcodeHeaderSize + matchlengthHeaderSize + litlengthHeaderSize;
 3800|    584|}

FSEv07_isError:
 1134|    634|unsigned FSEv07_isError(size_t code) { return ERR_isError(code); }
HUFv07_isError:
 1142|  2.84k|unsigned HUFv07_isError(size_t code) { return ERR_isError(code); }
FSEv07_readNCount:
 1154|  2.53k|{
 1155|  2.53k|    const BYTE* const istart = (const BYTE*) headerBuffer;
 1156|  2.53k|    const BYTE* const iend = istart + hbSize;
 1157|  2.53k|    const BYTE* ip = istart;
 1158|  2.53k|    int nbBits;
 1159|  2.53k|    int remaining;
 1160|  2.53k|    int threshold;
 1161|  2.53k|    U32 bitStream;
 1162|  2.53k|    int bitCount;
 1163|  2.53k|    unsigned charnum = 0;
 1164|  2.53k|    int previous0 = 0;
 1165|       |
 1166|  2.53k|    if (hbSize < 4) 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 (1166:9): [True: 17, False: 2.51k]
  ------------------
 1167|  2.51k|    bitStream = MEM_readLE32(ip);
 1168|  2.51k|    nbBits = (bitStream & 0xF) + FSEv07_MIN_TABLELOG;   /* extract tableLog */
  ------------------
  |  |  903|  2.51k|#define FSEv07_MIN_TABLELOG 5
  ------------------
 1169|  2.51k|    if (nbBits > FSEv07_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |  905|  2.51k|#define FSEv07_TABLELOG_ABSOLUTE_MAX 15
  ------------------
                  if (nbBits > FSEv07_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   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 (1169:9): [True: 8, False: 2.50k]
  ------------------
 1170|  2.50k|    bitStream >>= 4;
 1171|  2.50k|    bitCount = 4;
 1172|  2.50k|    *tableLogPtr = nbBits;
 1173|  2.50k|    remaining = (1<<nbBits)+1;
 1174|  2.50k|    threshold = 1<<nbBits;
 1175|  2.50k|    nbBits++;
 1176|       |
 1177|  22.2k|    while ((remaining>1) && (charnum<=*maxSVPtr)) {
  ------------------
  |  Branch (1177:12): [True: 19.8k, False: 2.46k]
  |  Branch (1177:29): [True: 19.7k, False: 18]
  ------------------
 1178|  19.7k|        if (previous0) {
  ------------------
  |  Branch (1178:13): [True: 2.69k, False: 17.0k]
  ------------------
 1179|  2.69k|            unsigned n0 = charnum;
 1180|  2.82k|            while ((bitStream & 0xFFFF) == 0xFFFF) {
  ------------------
  |  Branch (1180:20): [True: 128, False: 2.69k]
  ------------------
 1181|    128|                n0+=24;
 1182|    128|                if (ip < iend-5) {
  ------------------
  |  Branch (1182:21): [True: 97, False: 31]
  ------------------
 1183|     97|                    ip+=2;
 1184|     97|                    bitStream = MEM_readLE32(ip) >> bitCount;
 1185|     97|                } else {
 1186|     31|                    bitStream >>= 16;
 1187|     31|                    bitCount+=16;
 1188|     31|            }   }
 1189|  3.83k|            while ((bitStream & 3) == 3) {
  ------------------
  |  Branch (1189:20): [True: 1.13k, False: 2.69k]
  ------------------
 1190|  1.13k|                n0+=3;
 1191|  1.13k|                bitStream>>=2;
 1192|  1.13k|                bitCount+=2;
 1193|  1.13k|            }
 1194|  2.69k|            n0 += bitStream & 3;
 1195|  2.69k|            bitCount += 2;
 1196|  2.69k|            if (n0 > *maxSVPtr) return ERROR(maxSymbolValue_tooSmall);
  ------------------
  |  |   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 (1196:17): [True: 27, False: 2.66k]
  ------------------
 1197|  8.99k|            while (charnum < n0) normalizedCounter[charnum++] = 0;
  ------------------
  |  Branch (1197:20): [True: 6.33k, False: 2.66k]
  ------------------
 1198|  2.66k|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1198:17): [True: 1.52k, False: 1.14k]
  |  Branch (1198:35): [True: 66, False: 1.07k]
  ------------------
 1199|  1.58k|                ip += bitCount>>3;
 1200|  1.58k|                bitCount &= 7;
 1201|  1.58k|                bitStream = MEM_readLE32(ip) >> bitCount;
 1202|  1.58k|            }
 1203|  1.07k|            else
 1204|  1.07k|                bitStream >>= 2;
 1205|  2.66k|        }
 1206|  19.7k|        {   short const max = (short)((2*threshold-1)-remaining);
 1207|  19.7k|            short count;
 1208|       |
 1209|  19.7k|            if ((bitStream & (threshold-1)) < (U32)max) {
  ------------------
  |  Branch (1209:17): [True: 12.9k, False: 6.79k]
  ------------------
 1210|  12.9k|                count = (short)(bitStream & (threshold-1));
 1211|  12.9k|                bitCount   += nbBits-1;
 1212|  12.9k|            } else {
 1213|  6.79k|                count = (short)(bitStream & (2*threshold-1));
 1214|  6.79k|                if (count >= threshold) count -= max;
  ------------------
  |  Branch (1214:21): [True: 3.16k, False: 3.62k]
  ------------------
 1215|  6.79k|                bitCount   += nbBits;
 1216|  6.79k|            }
 1217|       |
 1218|  19.7k|            count--;   /* extra accuracy */
 1219|  19.7k|            remaining -= FSEv07_abs(count);
 1220|  19.7k|            normalizedCounter[charnum++] = count;
 1221|  19.7k|            previous0 = !count;
 1222|  34.3k|            while (remaining < threshold) {
  ------------------
  |  Branch (1222:20): [True: 14.5k, False: 19.7k]
  ------------------
 1223|  14.5k|                nbBits--;
 1224|  14.5k|                threshold >>= 1;
 1225|  14.5k|            }
 1226|       |
 1227|  19.7k|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1227:17): [True: 15.7k, False: 4.03k]
  |  Branch (1227:35): [True: 833, False: 3.19k]
  ------------------
 1228|  16.5k|                ip += bitCount>>3;
 1229|  16.5k|                bitCount &= 7;
 1230|  16.5k|            } else {
 1231|  3.19k|                bitCount -= (int)(8 * (iend - 4 - ip));
 1232|  3.19k|                ip = iend - 4;
 1233|  3.19k|            }
 1234|  19.7k|            bitStream = MEM_readLE32(ip) >> (bitCount & 31);
 1235|  19.7k|    }   }   /* while ((remaining>1) && (charnum<=*maxSVPtr)) */
 1236|  2.48k|    if (remaining != 1) return ERROR(GENERIC);
  ------------------
  |  |   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 (1236:9): [True: 18, False: 2.46k]
  ------------------
 1237|  2.46k|    *maxSVPtr = charnum-1;
 1238|       |
 1239|  2.46k|    ip += (bitCount+7)>>3;
 1240|  2.46k|    if ((size_t)(ip-istart) > hbSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   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 (1240:9): [True: 33, False: 2.43k]
  ------------------
 1241|  2.43k|    return ip-istart;
 1242|  2.46k|}
HUFv07_readStats:
 1254|  1.11k|{
 1255|  1.11k|    U32 weightTotal;
 1256|  1.11k|    const BYTE* ip = (const BYTE*) src;
 1257|  1.11k|    size_t iSize;
 1258|  1.11k|    size_t oSize;
 1259|       |
 1260|  1.11k|    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: 1.11k]
  ------------------
 1261|  1.11k|    iSize = ip[0];
 1262|       |    /* memset(huffWeight, 0, hwSize); */   /* is not necessary, even though some analyzer complain ... */
 1263|       |
 1264|  1.11k|    if (iSize >= 128)  { /* special header */
  ------------------
  |  Branch (1264:9): [True: 478, False: 637]
  ------------------
 1265|    478|        if (iSize >= (242)) {  /* RLE */
  ------------------
  |  Branch (1265:13): [True: 436, False: 42]
  ------------------
 1266|    436|            static U32 l[14] = { 1, 2, 3, 4, 7, 8, 15, 16, 31, 32, 63, 64, 127, 128 };
 1267|    436|            oSize = l[iSize-242];
 1268|    436|            memset(huffWeight, 1, hwSize);
 1269|    436|            iSize = 0;
 1270|    436|        }
 1271|     42|        else {   /* Incompressible */
 1272|     42|            oSize = iSize - 127;
 1273|     42|            iSize = ((oSize+1)/2);
 1274|     42|            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 (1274:17): [True: 8, False: 34]
  ------------------
 1275|     34|            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: 34]
  ------------------
 1276|     34|            ip += 1;
 1277|     34|            {   U32 n;
 1278|    345|                for (n=0; n<oSize; n+=2) {
  ------------------
  |  Branch (1278:27): [True: 311, False: 34]
  ------------------
 1279|    311|                    huffWeight[n]   = ip[n/2] >> 4;
 1280|    311|                    huffWeight[n+1] = ip[n/2] & 15;
 1281|    311|    }   }   }   }
 1282|    637|    else  {   /* header compressed with FSE (normal case) */
 1283|    637|        if (iSize+1 > srcSize) 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 (1283:13): [True: 3, False: 634]
  ------------------
 1284|    634|        oSize = FSEv07_decompress(huffWeight, hwSize-1, ip+1, iSize);   /* max (hwSize-1) values decoded, as last one is implied */
 1285|    634|        if (FSEv07_isError(oSize)) return oSize;
  ------------------
  |  Branch (1285:13): [True: 63, False: 571]
  ------------------
 1286|    634|    }
 1287|       |
 1288|       |    /* collect weight stats */
 1289|  1.04k|    memset(rankStats, 0, (HUFv07_TABLELOG_ABSOLUTEMAX + 1) * sizeof(U32));
  ------------------
  |  |  996|  1.04k|#define HUFv07_TABLELOG_ABSOLUTEMAX  16   /* absolute limit of HUFv07_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
 1290|  1.04k|    weightTotal = 0;
 1291|  70.6k|    {   U32 n; for (n=0; n<oSize; n++) {
  ------------------
  |  Branch (1291:26): [True: 69.5k, False: 1.03k]
  ------------------
 1292|  69.5k|            if (huffWeight[n] >= HUFv07_TABLELOG_ABSOLUTEMAX) return ERROR(corruption_detected);
  ------------------
  |  |  996|  69.5k|#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|      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 (1292:17): [True: 4, False: 69.5k]
  ------------------
 1293|  69.5k|            rankStats[huffWeight[n]]++;
 1294|  69.5k|            weightTotal += (1 << huffWeight[n]) >> 1;
 1295|  69.5k|    }   }
 1296|  1.03k|    if (weightTotal == 0) 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 (1296:9): [True: 5, False: 1.03k]
  ------------------
 1297|       |
 1298|       |    /* get last non-null symbol weight (implied, total must be 2^n) */
 1299|  1.03k|    {   U32 const tableLog = BITv07_highbit32(weightTotal) + 1;
 1300|  1.03k|        if (tableLog > HUFv07_TABLELOG_ABSOLUTEMAX) return ERROR(corruption_detected);
  ------------------
  |  |  996|  1.03k|#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|      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 (1300:13): [True: 9, False: 1.02k]
  ------------------
 1301|  1.02k|        *tableLogPtr = tableLog;
 1302|       |        /* determine last weight */
 1303|  1.02k|        {   U32 const total = 1 << tableLog;
 1304|  1.02k|            U32 const rest = total - weightTotal;
 1305|  1.02k|            U32 const verif = 1 << BITv07_highbit32(rest);
 1306|  1.02k|            U32 const lastWeight = BITv07_highbit32(rest) + 1;
 1307|  1.02k|            if (verif != rest) return ERROR(corruption_detected);    /* last value must be a clean power of 2 */
  ------------------
  |  |   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 (1307:17): [True: 45, False: 978]
  ------------------
 1308|    978|            huffWeight[oSize] = (BYTE)lastWeight;
 1309|    978|            rankStats[lastWeight]++;
 1310|    978|    }   }
 1311|       |
 1312|       |    /* check tree construction validity */
 1313|    978|    if ((rankStats[1] < 2) || (rankStats[1] & 1)) return ERROR(corruption_detected);   /* by construction : at least 2 elts of rank 1, must be even */
  ------------------
  |  |   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 (1313:9): [True: 9, False: 969]
  |  Branch (1313:31): [True: 0, False: 969]
  ------------------
 1314|       |
 1315|       |    /* results */
 1316|    969|    *nbSymbolsPtr = (U32)(oSize+1);
 1317|    969|    return iSize+1;
 1318|    978|}
FSEv07_buildDTable:
 1424|  3.35k|{
 1425|  3.35k|    void* const tdPtr = dt+1;   /* because *dt is unsigned, 32-bits aligned on 32-bits */
 1426|  3.35k|    FSEv07_DECODE_TYPE* const tableDecode = (FSEv07_DECODE_TYPE*) (tdPtr);
  ------------------
  |  |  890|  3.35k|#define FSEv07_DECODE_TYPE FSEv07_decode_t
  ------------------
 1427|  3.35k|    U16 symbolNext[FSEv07_MAX_SYMBOL_VALUE+1];
 1428|       |
 1429|  3.35k|    U32 const maxSV1 = maxSymbolValue + 1;
 1430|  3.35k|    U32 const tableSize = 1 << tableLog;
 1431|  3.35k|    U32 highThreshold = tableSize-1;
 1432|       |
 1433|       |    /* Sanity Checks */
 1434|  3.35k|    if (maxSymbolValue > FSEv07_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  |  882|  3.35k|#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: 3.35k]
  ------------------
 1435|  3.35k|    if (tableLog > FSEv07_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  |  899|  3.35k|#define FSEv07_MAX_TABLELOG  (FSEv07_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  876|  3.35k|#define FSEv07_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
                  if (tableLog > FSEv07_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   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 (1435:9): [True: 2, False: 3.35k]
  ------------------
 1436|       |
 1437|       |    /* Init, lay down lowprob symbols */
 1438|  3.35k|    {   FSEv07_DTableHeader DTableH;
 1439|  3.35k|        DTableH.tableLog = (U16)tableLog;
 1440|  3.35k|        DTableH.fastMode = 1;
 1441|  3.35k|        {   S16 const largeLimit= (S16)(1 << (tableLog-1));
 1442|  3.35k|            U32 s;
 1443|  60.2k|            for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (1443:23): [True: 56.9k, False: 3.35k]
  ------------------
 1444|  56.9k|                if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (1444:21): [True: 11.3k, False: 45.5k]
  ------------------
 1445|  11.3k|                    tableDecode[highThreshold--].symbol = (FSEv07_FUNCTION_TYPE)s;
 1446|  11.3k|                    symbolNext[s] = 1;
 1447|  45.5k|                } else {
 1448|  45.5k|                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
  ------------------
  |  Branch (1448:25): [True: 1.76k, False: 43.7k]
  ------------------
 1449|  45.5k|                    symbolNext[s] = normalizedCounter[s];
 1450|  45.5k|        }   }   }
 1451|  3.35k|        memcpy(dt, &DTableH, sizeof(DTableH));
 1452|  3.35k|    }
 1453|       |
 1454|       |    /* Spread symbols */
 1455|  3.35k|    {   U32 const tableMask = tableSize-1;
 1456|  3.35k|        U32 const step = FSEv07_TABLESTEP(tableSize);
  ------------------
  |  |  910|  3.35k|#define FSEv07_TABLESTEP(tableSize) ((tableSize>>1) + (tableSize>>3) + 3)
  ------------------
 1457|  3.35k|        U32 s, position = 0;
 1458|  60.2k|        for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (1458:19): [True: 56.9k, False: 3.35k]
  ------------------
 1459|  56.9k|            int i;
 1460|   373k|            for (i=0; i<normalizedCounter[s]; i++) {
  ------------------
  |  Branch (1460:23): [True: 316k, False: 56.9k]
  ------------------
 1461|   316k|                tableDecode[position].symbol = (FSEv07_FUNCTION_TYPE)s;
 1462|   316k|                position = (position + step) & tableMask;
 1463|   328k|                while (position > highThreshold) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  Branch (1463:24): [True: 11.1k, False: 316k]
  ------------------
 1464|   316k|        }   }
 1465|       |
 1466|  3.35k|        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: 3.35k]
  ------------------
 1467|  3.35k|    }
 1468|       |
 1469|       |    /* Build Decoding table */
 1470|  3.35k|    {   U32 u;
 1471|   331k|        for (u=0; u<tableSize; u++) {
  ------------------
  |  Branch (1471:19): [True: 328k, False: 3.35k]
  ------------------
 1472|   328k|            FSEv07_FUNCTION_TYPE const symbol = (FSEv07_FUNCTION_TYPE)(tableDecode[u].symbol);
  ------------------
  |  |  888|   328k|#define FSEv07_FUNCTION_TYPE BYTE
  ------------------
 1473|   328k|            U16 nextState = symbolNext[symbol]++;
 1474|   328k|            tableDecode[u].nbBits = (BYTE) (tableLog - BITv07_highbit32 ((U32)nextState) );
 1475|   328k|            tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
 1476|   328k|    }   }
 1477|       |
 1478|  3.35k|    return 0;
 1479|  3.35k|}
FSEv07_buildDTable_rle:
 1489|    291|{
 1490|    291|    void* ptr = dt;
 1491|    291|    FSEv07_DTableHeader* const DTableH = (FSEv07_DTableHeader*)ptr;
 1492|    291|    void* dPtr = dt + 1;
 1493|    291|    FSEv07_decode_t* const cell = (FSEv07_decode_t*)dPtr;
 1494|       |
 1495|    291|    DTableH->tableLog = 0;
 1496|    291|    DTableH->fastMode = 0;
 1497|       |
 1498|    291|    cell->newState = 0;
 1499|    291|    cell->symbol = symbolValue;
 1500|    291|    cell->nbBits = 0;
 1501|       |
 1502|    291|    return 0;
 1503|    291|}
FSEv07_decompress_usingDTable:
 1603|    600|{
 1604|    600|    const void* ptr = dt;
 1605|    600|    const FSEv07_DTableHeader* DTableH = (const FSEv07_DTableHeader*)ptr;
 1606|    600|    const U32 fastMode = DTableH->fastMode;
 1607|       |
 1608|       |    /* select fast mode (static) */
 1609|    600|    if (fastMode) return FSEv07_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 1);
  ------------------
  |  Branch (1609:9): [True: 197, False: 403]
  ------------------
 1610|    403|    return FSEv07_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 0);
 1611|    600|}
FSEv07_decompress:
 1615|    634|{
 1616|    634|    const BYTE* const istart = (const BYTE*)cSrc;
 1617|    634|    const BYTE* ip = istart;
 1618|    634|    short counting[FSEv07_MAX_SYMBOL_VALUE+1];
 1619|    634|    DTable_max_t dt;   /* Static analyzer seems unable to understand this table will be properly initialized later */
 1620|    634|    unsigned tableLog;
 1621|    634|    unsigned maxSymbolValue = FSEv07_MAX_SYMBOL_VALUE;
  ------------------
  |  |  882|    634|#define FSEv07_MAX_SYMBOL_VALUE 255
  ------------------
 1622|       |
 1623|    634|    if (cSrcSize<2) return ERROR(srcSize_wrong);   /* too small input size */
  ------------------
  |  |   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 (1623:9): [True: 2, False: 632]
  ------------------
 1624|       |
 1625|       |    /* normal FSE decoding mode */
 1626|    632|    {   size_t const NCountLength = FSEv07_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize);
 1627|    632|        if (FSEv07_isError(NCountLength)) return NCountLength;
  ------------------
  |  | 1378|    632|#define FSEv07_isError ERR_isError
  ------------------
  |  Branch (1627:13): [True: 28, False: 604]
  ------------------
 1628|    604|        if (NCountLength >= cSrcSize) return ERROR(srcSize_wrong);   /* too small input size */
  ------------------
  |  |   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 (1628:13): [True: 2, False: 602]
  ------------------
 1629|    602|        ip += NCountLength;
 1630|    602|        cSrcSize -= NCountLength;
 1631|    602|    }
 1632|       |
 1633|      0|    { size_t const errorCode = FSEv07_buildDTable (dt, counting, maxSymbolValue, tableLog);
 1634|    602|      if (FSEv07_isError(errorCode)) return errorCode; }
  ------------------
  |  | 1378|    602|#define FSEv07_isError ERR_isError
  ------------------
  |  Branch (1634:11): [True: 2, False: 600]
  ------------------
 1635|       |
 1636|    600|    return FSEv07_decompress_usingDTable (dst, maxDstSize, ip, cSrcSize, dt);   /* always return, even if it is an error code */
 1637|    602|}
HUFv07_readDTableX2:
 1722|    603|{
 1723|    603|    BYTE huffWeight[HUFv07_SYMBOLVALUE_MAX + 1];
 1724|    603|    U32 rankVal[HUFv07_TABLELOG_ABSOLUTEMAX + 1];   /* large enough for values from 0 to 16 */
 1725|    603|    U32 tableLog = 0;
 1726|    603|    U32 nbSymbols = 0;
 1727|    603|    size_t iSize;
 1728|    603|    void* const dtPtr = DTable + 1;
 1729|    603|    HUFv07_DEltX2* const dt = (HUFv07_DEltX2*)dtPtr;
 1730|       |
 1731|    603|    HUFv07_STATIC_ASSERT(sizeof(DTableDesc) == sizeof(HUFv07_DTable));
  ------------------
  |  | 1698|    603|#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|    603|    iSize = HUFv07_readStats(huffWeight, HUFv07_SYMBOLVALUE_MAX + 1, rankVal, &nbSymbols, &tableLog, src, srcSize);
  ------------------
  |  |  999|    603|#define HUFv07_SYMBOLVALUE_MAX 255
  ------------------
 1735|    603|    if (HUFv07_isError(iSize)) return iSize;
  ------------------
  |  Branch (1735:9): [True: 133, False: 470]
  ------------------
 1736|       |
 1737|       |    /* Table header */
 1738|    470|    {   DTableDesc dtd = HUFv07_getDTableDesc(DTable);
 1739|    470|        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: 469]
  ------------------
 1740|    469|        dtd.tableType = 0;
 1741|    469|        dtd.tableLog = (BYTE)tableLog;
 1742|    469|        memcpy(DTable, &dtd, sizeof(dtd));
 1743|    469|    }
 1744|       |
 1745|       |    /* Prepare ranks */
 1746|      0|    {   U32 n, nextRankStart = 0;
 1747|  2.96k|        for (n=1; n<tableLog+1; n++) {
  ------------------
  |  Branch (1747:19): [True: 2.49k, False: 469]
  ------------------
 1748|  2.49k|            U32 current = nextRankStart;
 1749|  2.49k|            nextRankStart += (rankVal[n] << (n-1));
 1750|  2.49k|            rankVal[n] = current;
 1751|  2.49k|    }   }
 1752|       |
 1753|       |    /* fill DTable */
 1754|    469|    {   U32 n;
 1755|  28.3k|        for (n=0; n<nbSymbols; n++) {
  ------------------
  |  Branch (1755:19): [True: 27.8k, False: 469]
  ------------------
 1756|  27.8k|            U32 const w = huffWeight[n];
 1757|  27.8k|            U32 const length = (1 << w) >> 1;
 1758|  27.8k|            U32 i;
 1759|  27.8k|            HUFv07_DEltX2 D;
 1760|  27.8k|            D.byte = (BYTE)n; D.nbBits = (BYTE)(tableLog + 1 - w);
 1761|  94.1k|            for (i = rankVal[w]; i < rankVal[w] + length; i++)
  ------------------
  |  Branch (1761:34): [True: 66.2k, False: 27.8k]
  ------------------
 1762|  66.2k|                dt[i] = D;
 1763|  27.8k|            rankVal[w] += length;
 1764|  27.8k|    }   }
 1765|       |
 1766|    469|    return iSize;
 1767|    470|}
HUFv07_decompress1X2_DCtx:
 1847|    204|{
 1848|    204|    const BYTE* ip = (const BYTE*) cSrc;
 1849|       |
 1850|    204|    size_t const hSize = HUFv07_readDTableX2 (DCtx, cSrc, cSrcSize);
 1851|    204|    if (HUFv07_isError(hSize)) return hSize;
  ------------------
  |  Branch (1851:9): [True: 55, False: 149]
  ------------------
 1852|    149|    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   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 (1852:9): [True: 24, False: 125]
  ------------------
 1853|    125|    ip += hSize; cSrcSize -= hSize;
 1854|       |
 1855|    125|    return HUFv07_decompress1X2_usingDTable_internal (dst, dstSize, ip, cSrcSize, DCtx);
 1856|    149|}
HUFv07_decompress4X2_DCtx:
 1970|    399|{
 1971|    399|    const BYTE* ip = (const BYTE*) cSrc;
 1972|       |
 1973|    399|    size_t const hSize = HUFv07_readDTableX2 (dctx, cSrc, cSrcSize);
 1974|    399|    if (HUFv07_isError(hSize)) return hSize;
  ------------------
  |  Branch (1974:9): [True: 79, False: 320]
  ------------------
 1975|    320|    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   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 (1975:9): [True: 21, False: 299]
  ------------------
 1976|    299|    ip += hSize; cSrcSize -= hSize;
 1977|       |
 1978|    299|    return HUFv07_decompress4X2_usingDTable_internal (dst, dstSize, ip, cSrcSize, dctx);
 1979|    320|}
HUFv07_readDTableX4:
 2080|    513|{
 2081|    513|    BYTE weightList[HUFv07_SYMBOLVALUE_MAX + 1];
 2082|    513|    sortedSymbol_t sortedSymbol[HUFv07_SYMBOLVALUE_MAX + 1];
 2083|    513|    U32 rankStats[HUFv07_TABLELOG_ABSOLUTEMAX + 1] = { 0 };
 2084|    513|    U32 rankStart0[HUFv07_TABLELOG_ABSOLUTEMAX + 2] = { 0 };
 2085|    513|    U32* const rankStart = rankStart0+1;
 2086|    513|    rankVal_t rankVal;
 2087|    513|    U32 tableLog, maxW, sizeOfSort, nbSymbols;
 2088|    513|    DTableDesc dtd = HUFv07_getDTableDesc(DTable);
 2089|    513|    U32 const maxTableLog = dtd.maxTableLog;
 2090|    513|    size_t iSize;
 2091|    513|    void* dtPtr = DTable+1;   /* force compiler to avoid strict-aliasing */
 2092|    513|    HUFv07_DEltX4* const dt = (HUFv07_DEltX4*)dtPtr;
 2093|       |
 2094|    513|    HUFv07_STATIC_ASSERT(sizeof(HUFv07_DEltX4) == sizeof(HUFv07_DTable));   /* if compilation fails here, assertion is false */
  ------------------
  |  | 1698|    513|#define HUFv07_STATIC_ASSERT(c) { enum { HUFv07_static_assert = 1/(int)(!!(c)) }; }   /* use only *after* variable declarations */
  ------------------
 2095|    513|    if (maxTableLog > HUFv07_TABLELOG_ABSOLUTEMAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |  996|    513|#define HUFv07_TABLELOG_ABSOLUTEMAX  16   /* absolute limit of HUFv07_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
                  if (maxTableLog > HUFv07_TABLELOG_ABSOLUTEMAX) 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 (2095:9): [True: 0, False: 513]
  ------------------
 2096|       |    /* memset(weightList, 0, sizeof(weightList)); */   /* is not necessary, even though some analyzer complain ... */
 2097|       |
 2098|    513|    iSize = HUFv07_readStats(weightList, HUFv07_SYMBOLVALUE_MAX + 1, rankStats, &nbSymbols, &tableLog, src, srcSize);
  ------------------
  |  |  999|    513|#define HUFv07_SYMBOLVALUE_MAX 255
  ------------------
 2099|    513|    if (HUFv07_isError(iSize)) return iSize;
  ------------------
  |  Branch (2099:9): [True: 14, False: 499]
  ------------------
 2100|       |
 2101|       |    /* check result */
 2102|    499|    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 (2102:9): [True: 0, False: 499]
  ------------------
 2103|       |
 2104|       |    /* find maxWeight */
 2105|  1.23k|    for (maxW = tableLog; rankStats[maxW]==0; maxW--) {}  /* necessarily finds a solution before 0 */
  ------------------
  |  Branch (2105:27): [True: 731, False: 499]
  ------------------
 2106|       |
 2107|       |    /* Get start index of each weight */
 2108|    499|    {   U32 w, nextRankStart = 0;
 2109|  3.21k|        for (w=1; w<maxW+1; w++) {
  ------------------
  |  Branch (2109:19): [True: 2.71k, False: 499]
  ------------------
 2110|  2.71k|            U32 current = nextRankStart;
 2111|  2.71k|            nextRankStart += rankStats[w];
 2112|  2.71k|            rankStart[w] = current;
 2113|  2.71k|        }
 2114|    499|        rankStart[0] = nextRankStart;   /* put all 0w symbols at the end of sorted list*/
 2115|    499|        sizeOfSort = nextRankStart;
 2116|    499|    }
 2117|       |
 2118|       |    /* sort symbols by weight */
 2119|    499|    {   U32 s;
 2120|  40.3k|        for (s=0; s<nbSymbols; s++) {
  ------------------
  |  Branch (2120:19): [True: 39.8k, False: 499]
  ------------------
 2121|  39.8k|            U32 const w = weightList[s];
 2122|  39.8k|            U32 const r = rankStart[w]++;
 2123|  39.8k|            sortedSymbol[r].symbol = (BYTE)s;
 2124|  39.8k|            sortedSymbol[r].weight = (BYTE)w;
 2125|  39.8k|        }
 2126|    499|        rankStart[0] = 0;   /* forget 0w symbols; this is beginning of weight(1) */
 2127|    499|    }
 2128|       |
 2129|       |    /* Build rankVal */
 2130|    499|    {   U32* const rankVal0 = rankVal[0];
 2131|    499|        {   int const rescale = (maxTableLog-tableLog) - 1;   /* tableLog <= maxTableLog */
 2132|    499|            U32 nextRankVal = 0;
 2133|    499|            U32 w;
 2134|  3.21k|            for (w=1; w<maxW+1; w++) {
  ------------------
  |  Branch (2134:23): [True: 2.71k, False: 499]
  ------------------
 2135|  2.71k|                U32 current = nextRankVal;
 2136|  2.71k|                nextRankVal += rankStats[w] << (w+rescale);
 2137|  2.71k|                rankVal0[w] = current;
 2138|  2.71k|        }   }
 2139|    499|        {   U32 const minBits = tableLog+1 - maxW;
 2140|    499|            U32 consumed;
 2141|  4.53k|            for (consumed = minBits; consumed < maxTableLog - minBits + 1; consumed++) {
  ------------------
  |  Branch (2141:38): [True: 4.03k, False: 499]
  ------------------
 2142|  4.03k|                U32* const rankValPtr = rankVal[consumed];
 2143|  4.03k|                U32 w;
 2144|  29.4k|                for (w = 1; w < maxW+1; w++) {
  ------------------
  |  Branch (2144:29): [True: 25.3k, False: 4.03k]
  ------------------
 2145|  25.3k|                    rankValPtr[w] = rankVal0[w] >> consumed;
 2146|  25.3k|    }   }   }   }
 2147|       |
 2148|    499|    HUFv07_fillDTableX4(dt, maxTableLog,
 2149|    499|                   sortedSymbol, sizeOfSort,
 2150|    499|                   rankStart0, rankVal, maxW,
 2151|    499|                   tableLog+1);
 2152|       |
 2153|    499|    dtd.tableLog = (BYTE)maxTableLog;
 2154|    499|    dtd.tableType = 1;
 2155|    499|    memcpy(DTable, &dtd, sizeof(dtd));
 2156|    499|    return iSize;
 2157|    499|}
HUFv07_decompress1X4_usingDTable:
 2252|     91|{
 2253|     91|    DTableDesc dtd = HUFv07_getDTableDesc(DTable);
 2254|     91|    if (dtd.tableType != 1) 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 (2254:9): [True: 0, False: 91]
  ------------------
 2255|     91|    return HUFv07_decompress1X4_usingDTable_internal(dst, dstSize, cSrc, cSrcSize, DTable);
 2256|     91|}
HUFv07_decompress4X4_DCtx:
 2381|     42|{
 2382|     42|    const BYTE* ip = (const BYTE*) cSrc;
 2383|       |
 2384|     42|    size_t hSize = HUFv07_readDTableX4 (dctx, cSrc, cSrcSize);
 2385|     42|    if (HUFv07_isError(hSize)) return hSize;
  ------------------
  |  Branch (2385:9): [True: 3, False: 39]
  ------------------
 2386|     39|    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 (2386:9): [True: 0, False: 39]
  ------------------
 2387|     39|    ip += hSize; cSrcSize -= hSize;
 2388|       |
 2389|     39|    return HUFv07_decompress4X4_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx);
 2390|     39|}
HUFv07_selectDecoder:
 2450|    441|{
 2451|       |    /* decoder timing evaluation */
 2452|    441|    U32 const Q = (U32)(cSrcSize * 16 / dstSize);   /* Q < 16 since dstSize > cSrcSize */
 2453|    441|    U32 const D256 = (U32)(dstSize >> 8);
 2454|    441|    U32 const DTime0 = algoTime[Q][0].tableTime + (algoTime[Q][0].decode256Time * D256);
 2455|    441|    U32 DTime1 = algoTime[Q][1].tableTime + (algoTime[Q][1].decode256Time * D256);
 2456|    441|    DTime1 += DTime1 >> 3;  /* advantage to algorithm using less memory, for cache eviction */
 2457|       |
 2458|    441|    return DTime1 < DTime0;
 2459|    441|}
HUFv07_decompress4X_hufOnly:
 2497|    464|{
 2498|       |    /* validation checks */
 2499|    464|    if (dstSize == 0) 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 (2499:9): [True: 3, False: 461]
  ------------------
 2500|    461|    if ((cSrcSize >= dstSize) || (cSrcSize <= 1)) return ERROR(corruption_detected);   /* invalid */
  ------------------
  |  |   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 (2500:9): [True: 10, False: 451]
  |  Branch (2500:34): [True: 10, False: 441]
  ------------------
 2501|       |
 2502|    441|    {   U32 const algoNb = HUFv07_selectDecoder(dstSize, cSrcSize);
 2503|    441|        return algoNb ? HUFv07_decompress4X4_DCtx(dctx, dst, dstSize, cSrc, cSrcSize) :
  ------------------
  |  Branch (2503:16): [True: 42, False: 399]
  ------------------
 2504|    441|                        HUFv07_decompress4X2_DCtx(dctx, dst, dstSize, cSrc, cSrcSize) ;
 2505|    461|    }
 2506|    461|}
ZSTDv07_decompressBegin:
 2908|  4.42k|{
 2909|  4.42k|    dctx->expected = ZSTDv07_frameHeaderSize_min;
 2910|  4.42k|    dctx->stage = ZSTDds_getFrameHeaderSize;
 2911|  4.42k|    dctx->previousDstEnd = NULL;
 2912|  4.42k|    dctx->base = NULL;
 2913|  4.42k|    dctx->vBase = NULL;
 2914|  4.42k|    dctx->dictEnd = NULL;
 2915|  4.42k|    dctx->hufTable[0] = (HUFv07_DTable)((ZSTD_HUFFDTABLE_CAPACITY_LOG)*0x1000001);
  ------------------
  |  | 2665|  4.42k|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
 2916|  4.42k|    dctx->litEntropy = dctx->fseEntropy = 0;
 2917|  4.42k|    dctx->dictID = 0;
 2918|  17.7k|    { int i; for (i=0; i<ZSTDv07_REP_NUM; i++) dctx->rep[i] = repStartValue[i]; }
  ------------------
  |  | 2638|  17.7k|#define ZSTDv07_REP_NUM    3
  ------------------
  |  Branch (2918:24): [True: 13.2k, False: 4.42k]
  ------------------
 2919|  4.42k|    return 0;
 2920|  4.42k|}
ZSTDv07_createDCtx_advanced:
 2923|  2.21k|{
 2924|  2.21k|    ZSTDv07_DCtx* dctx;
 2925|       |
 2926|  2.21k|    if (!customMem.customAlloc && !customMem.customFree)
  ------------------
  |  Branch (2926:9): [True: 0, False: 2.21k]
  |  Branch (2926:35): [True: 0, False: 0]
  ------------------
 2927|      0|        customMem = defaultCustomMem;
 2928|       |
 2929|  2.21k|    if (!customMem.customAlloc || !customMem.customFree)
  ------------------
  |  Branch (2929:9): [True: 0, False: 2.21k]
  |  Branch (2929:35): [True: 0, False: 2.21k]
  ------------------
 2930|      0|        return NULL;
 2931|       |
 2932|  2.21k|    dctx = (ZSTDv07_DCtx*) customMem.customAlloc(customMem.opaque, sizeof(ZSTDv07_DCtx));
 2933|  2.21k|    if (!dctx) return NULL;
  ------------------
  |  Branch (2933:9): [True: 0, False: 2.21k]
  ------------------
 2934|  2.21k|    memcpy(&dctx->customMem, &customMem, sizeof(ZSTDv07_customMem));
 2935|  2.21k|    ZSTDv07_decompressBegin(dctx);
 2936|  2.21k|    return dctx;
 2937|  2.21k|}
ZSTDv07_createDCtx:
 2940|  2.21k|{
 2941|  2.21k|    return ZSTDv07_createDCtx_advanced(defaultCustomMem);
 2942|  2.21k|}
ZSTDv07_freeDCtx:
 2945|  2.21k|{
 2946|  2.21k|    if (dctx==NULL) return 0;   /* support free on NULL */
  ------------------
  |  Branch (2946:9): [True: 0, False: 2.21k]
  ------------------
 2947|  2.21k|    dctx->customMem.customFree(dctx->customMem.opaque, dctx);
 2948|  2.21k|    return 0;   /* reserved as a potential error code in the future */
 2949|  2.21k|}
ZSTDv07_getFrameParams:
 3096|  2.78k|{
 3097|  2.78k|    const BYTE* ip = (const BYTE*)src;
 3098|       |
 3099|  2.78k|    if (srcSize < ZSTDv07_frameHeaderSize_min) return ZSTDv07_frameHeaderSize_min;
  ------------------
  |  Branch (3099:9): [True: 0, False: 2.78k]
  ------------------
 3100|  2.78k|    memset(fparamsPtr, 0, sizeof(*fparamsPtr));
 3101|  2.78k|    if (MEM_readLE32(src) != ZSTDv07_MAGICNUMBER) {
  ------------------
  |  |  180|  2.78k|#define ZSTDv07_MAGICNUMBER            0xFD2FB527   /* v0.7 */
  ------------------
  |  Branch (3101:9): [True: 0, False: 2.78k]
  ------------------
 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|  2.78k|    { size_t const fhsize = ZSTDv07_frameHeaderSize(src, srcSize);
 3113|  2.78k|      if (srcSize < fhsize) return fhsize; }
  ------------------
  |  Branch (3113:11): [True: 0, False: 2.78k]
  ------------------
 3114|       |
 3115|  2.78k|    {   BYTE const fhdByte = ip[4];
 3116|  2.78k|        size_t pos = 5;
 3117|  2.78k|        U32 const dictIDSizeCode = fhdByte&3;
 3118|  2.78k|        U32 const checksumFlag = (fhdByte>>2)&1;
 3119|  2.78k|        U32 const directMode = (fhdByte>>5)&1;
 3120|  2.78k|        U32 const fcsID = fhdByte>>6;
 3121|  2.78k|        U32 const windowSizeMax = 1U << ZSTDv07_WINDOWLOG_MAX;
  ------------------
  |  |   45|  2.78k|#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|  2.78k|#define ZSTDv07_WINDOWLOG_MAX_64  27
  |  |  ------------------
  |  |  |  Branch (45:41): [True: 0, False: 2.78k]
  |  |  ------------------
  ------------------
 3122|  2.78k|        U32 windowSize = 0;
 3123|  2.78k|        U32 dictID = 0;
 3124|  2.78k|        U64 frameContentSize = 0;
 3125|  2.78k|        if ((fhdByte & 0x08) != 0)   /* reserved bits, which must be zero */
  ------------------
  |  Branch (3125:13): [True: 18, False: 2.76k]
  ------------------
 3126|     18|            return ERROR(frameParameter_unsupported);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3127|  2.76k|        if (!directMode) {
  ------------------
  |  Branch (3127:13): [True: 1.98k, False: 777]
  ------------------
 3128|  1.98k|            BYTE const wlByte = ip[pos++];
 3129|  1.98k|            U32 const windowLog = (wlByte >> 3) + ZSTDv07_WINDOWLOG_ABSOLUTEMIN;
  ------------------
  |  | 2654|  1.98k|#define ZSTDv07_WINDOWLOG_ABSOLUTEMIN 10
  ------------------
 3130|  1.98k|            if (windowLog > ZSTDv07_WINDOWLOG_MAX)
  ------------------
  |  |   45|  1.98k|#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.98k|#define ZSTDv07_WINDOWLOG_MAX_64  27
  |  |  ------------------
  |  |  |  Branch (45:41): [True: 0, False: 1.98k]
  |  |  ------------------
  ------------------
  |  Branch (3130:17): [True: 26, False: 1.96k]
  ------------------
 3131|     26|                return ERROR(frameParameter_unsupported);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3132|  1.96k|            windowSize = (1U << windowLog);
 3133|  1.96k|            windowSize += (windowSize >> 3) * (wlByte&7);
 3134|  1.96k|        }
 3135|       |
 3136|  2.74k|        switch(dictIDSizeCode)
 3137|  2.74k|        {
 3138|      0|            default:   /* impossible */
  ------------------
  |  Branch (3138:13): [True: 0, False: 2.74k]
  ------------------
 3139|  2.11k|            case 0 : break;
  ------------------
  |  Branch (3139:13): [True: 2.11k, False: 626]
  ------------------
 3140|    506|            case 1 : dictID = ip[pos]; pos++; break;
  ------------------
  |  Branch (3140:13): [True: 506, False: 2.23k]
  ------------------
 3141|     66|            case 2 : dictID = MEM_readLE16(ip+pos); pos+=2; break;
  ------------------
  |  Branch (3141:13): [True: 66, False: 2.67k]
  ------------------
 3142|     54|            case 3 : dictID = MEM_readLE32(ip+pos); pos+=4; break;
  ------------------
  |  Branch (3142:13): [True: 54, False: 2.68k]
  ------------------
 3143|  2.74k|        }
 3144|  2.74k|        switch(fcsID)
 3145|  2.74k|        {
 3146|      0|            default:   /* impossible */
  ------------------
  |  Branch (3146:13): [True: 0, False: 2.74k]
  ------------------
 3147|  2.52k|            case 0 : if (directMode) frameContentSize = ip[pos]; break;
  ------------------
  |  Branch (3147:13): [True: 2.52k, False: 219]
  |  Branch (3147:26): [True: 642, False: 1.87k]
  ------------------
 3148|     73|            case 1 : frameContentSize = MEM_readLE16(ip+pos)+256; break;
  ------------------
  |  Branch (3148:13): [True: 73, False: 2.66k]
  ------------------
 3149|     69|            case 2 : frameContentSize = MEM_readLE32(ip+pos); break;
  ------------------
  |  Branch (3149:13): [True: 69, False: 2.67k]
  ------------------
 3150|     77|            case 3 : frameContentSize = MEM_readLE64(ip+pos); break;
  ------------------
  |  Branch (3150:13): [True: 77, False: 2.66k]
  ------------------
 3151|  2.74k|        }
 3152|  2.74k|        if (!windowSize) windowSize = (U32)frameContentSize;
  ------------------
  |  Branch (3152:13): [True: 777, False: 1.96k]
  ------------------
 3153|  2.74k|        if (windowSize > windowSizeMax)
  ------------------
  |  Branch (3153:13): [True: 10, False: 2.73k]
  ------------------
 3154|     10|            return ERROR(frameParameter_unsupported);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3155|  2.73k|        fparamsPtr->frameContentSize = frameContentSize;
 3156|  2.73k|        fparamsPtr->windowSize = windowSize;
 3157|  2.73k|        fparamsPtr->dictID = dictID;
 3158|  2.73k|        fparamsPtr->checksumFlag = checksumFlag;
 3159|  2.73k|    }
 3160|      0|    return 0;
 3161|  2.74k|}
ZSTDv07_decompress_usingDict:
 3824|  2.21k|{
 3825|  2.21k|    ZSTDv07_decompressBegin_usingDict(dctx, dict, dictSize);
 3826|  2.21k|    ZSTDv07_checkContinuity(dctx, dst);
 3827|  2.21k|    return ZSTDv07_decompressFrame(dctx, dst, dstCapacity, src, srcSize);
 3828|  2.21k|}
ZSTDv07_findFrameSizeInfoLegacy:
 3861|  2.28k|{
 3862|  2.28k|    const BYTE* ip = (const BYTE*)src;
 3863|  2.28k|    size_t remainingSize = srcSize;
 3864|  2.28k|    size_t nbBlocks = 0;
 3865|       |
 3866|       |    /* check */
 3867|  2.28k|    if (srcSize < ZSTDv07_frameHeaderSize_min+ZSTDv07_blockHeaderSize) {
  ------------------
  |  Branch (3867:9): [True: 2, False: 2.28k]
  ------------------
 3868|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3869|      2|        return;
 3870|      2|    }
 3871|       |
 3872|       |    /* Frame Header */
 3873|  2.28k|    {   size_t const frameHeaderSize = ZSTDv07_frameHeaderSize(src, srcSize);
 3874|  2.28k|        if (ZSTDv07_isError(frameHeaderSize)) {
  ------------------
  |  | 2856|  2.28k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3874:13): [True: 0, False: 2.28k]
  ------------------
 3875|      0|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, frameHeaderSize);
 3876|      0|            return;
 3877|      0|        }
 3878|  2.28k|        if (MEM_readLE32(src) != ZSTDv07_MAGICNUMBER) {
  ------------------
  |  |  180|  2.28k|#define ZSTDv07_MAGICNUMBER            0xFD2FB527   /* v0.7 */
  ------------------
  |  Branch (3878:13): [True: 0, False: 2.28k]
  ------------------
 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|  2.28k|        if (srcSize < frameHeaderSize+ZSTDv07_blockHeaderSize) {
  ------------------
  |  Branch (3882:13): [True: 8, False: 2.27k]
  ------------------
 3883|      8|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, 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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3884|      8|            return;
 3885|      8|        }
 3886|  2.27k|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3887|  2.27k|    }
 3888|       |
 3889|       |    /* Loop on each block */
 3890|  6.11k|    while (1) {
  ------------------
  |  Branch (3890:12): [True: 6.11k, Folded]
  ------------------
 3891|  6.11k|        blockProperties_t blockProperties;
 3892|  6.11k|        size_t const cBlockSize = ZSTDv07_getcBlockSize(ip, remainingSize, &blockProperties);
 3893|  6.11k|        if (ZSTDv07_isError(cBlockSize)) {
  ------------------
  |  | 2856|  6.11k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3893:13): [True: 8, False: 6.11k]
  ------------------
 3894|      8|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, cBlockSize);
 3895|      8|            return;
 3896|      8|        }
 3897|       |
 3898|  6.11k|        ip += ZSTDv07_blockHeaderSize;
 3899|  6.11k|        remainingSize -= ZSTDv07_blockHeaderSize;
 3900|       |
 3901|  6.11k|        if (blockProperties.blockType == bt_end) break;
  ------------------
  |  Branch (3901:13): [True: 2.21k, False: 3.89k]
  ------------------
 3902|       |
 3903|  3.89k|        if (cBlockSize > remainingSize) {
  ------------------
  |  Branch (3903:13): [True: 52, False: 3.84k]
  ------------------
 3904|     52|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(srcSize_wrong));
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3905|     52|            return;
 3906|     52|        }
 3907|       |
 3908|  3.84k|        ip += cBlockSize;
 3909|  3.84k|        remainingSize -= cBlockSize;
 3910|  3.84k|        nbBlocks++;
 3911|  3.84k|    }
 3912|       |
 3913|  2.21k|    *cSize = ip - (const BYTE*)src;
 3914|  2.21k|    *dBound = nbBlocks * ZSTDv07_BLOCKSIZE_ABSOLUTEMAX;
  ------------------
  |  |  175|  2.21k|#define ZSTDv07_BLOCKSIZE_ABSOLUTEMAX (128 * 1024)   /* define, for static allocation */
  ------------------
 3915|  2.21k|}
ZSTDv07_decompressBegin_usingDict:
 4115|  2.21k|{
 4116|  2.21k|    { size_t const errorCode = ZSTDv07_decompressBegin(dctx);
 4117|  2.21k|      if (ZSTDv07_isError(errorCode)) return errorCode; }
  ------------------
  |  | 2856|  2.21k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (4117:11): [True: 0, False: 2.21k]
  ------------------
 4118|       |
 4119|  2.21k|    if (dict && dictSize) {
  ------------------
  |  Branch (4119:9): [True: 2.21k, False: 0]
  |  Branch (4119:17): [True: 690, False: 1.52k]
  ------------------
 4120|    690|        size_t const errorCode = ZSTDv07_decompress_insertDictionary(dctx, dict, dictSize);
 4121|    690|        if (ZSTDv07_isError(errorCode)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2856|    690|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
                      if (ZSTDv07_isError(errorCode)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   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 (4121:13): [True: 19, False: 671]
  ------------------
 4122|    690|    }
 4123|       |
 4124|  2.19k|    return 0;
 4125|  2.21k|}
zstd_v07.c:MEM_readLE32:
  350|  31.6k|{
  351|  31.6k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (351:9): [True: 31.6k, False: 0]
  ------------------
  352|  31.6k|        return MEM_read32(memPtr);
  353|      0|    else
  354|      0|        return MEM_swap32(MEM_read32(memPtr));
  355|  31.6k|}
zstd_v07.c:MEM_isLittleEndian:
  268|   423k|{
  269|   423k|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  270|   423k|    return one.c[0];
  271|   423k|}
zstd_v07.c:MEM_read32:
  279|  31.6k|{
  280|  31.6k|    U32 val; memcpy(&val, memPtr, sizeof(val)); return val;
  281|  31.6k|}
zstd_v07.c:FSEv07_abs:
 1150|  19.7k|static short FSEv07_abs(short a) { return (short)(a<0 ? -a : a); }
  ------------------
  |  Branch (1150:51): [True: 7.66k, False: 12.0k]
  ------------------
zstd_v07.c:BITv07_highbit32:
  473|   333k|{
  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|   333k|}
zstd_v07.c:FSEv07_decompress_usingDTable_generic:
 1536|    600|{
 1537|    600|    BYTE* const ostart = (BYTE*) dst;
 1538|    600|    BYTE* op = ostart;
 1539|    600|    BYTE* const omax = op + maxDstSize;
 1540|    600|    BYTE* const olimit = omax-3;
 1541|       |
 1542|    600|    BITv07_DStream_t bitD;
 1543|    600|    FSEv07_DState_t state1;
 1544|    600|    FSEv07_DState_t state2;
 1545|       |
 1546|       |    /* Init */
 1547|    600|    { size_t const errorCode = BITv07_initDStream(&bitD, cSrc, cSrcSize);   /* replaced last arg by maxCompressed Size */
 1548|    600|      if (FSEv07_isError(errorCode)) return errorCode; }
  ------------------
  |  | 1378|    600|#define FSEv07_isError ERR_isError
  ------------------
  |  Branch (1548:11): [True: 5, False: 595]
  ------------------
 1549|       |
 1550|    595|    FSEv07_initDState(&state1, &bitD, dt);
 1551|    595|    FSEv07_initDState(&state2, &bitD, dt);
 1552|       |
 1553|    595|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
 1554|       |
 1555|       |    /* 4 symbols per loop */
 1556|  6.24k|    for ( ; (BITv07_reloadDStream(&bitD)==BITv07_DStream_unfinished) && (op<olimit) ; op+=4) {
  ------------------
  |  Branch (1556:13): [True: 5.66k, False: 579]
  |  Branch (1556:73): [True: 5.65k, False: 16]
  ------------------
 1557|  5.65k|        op[0] = FSEv07_GETSYMBOL(&state1);
  ------------------
  |  | 1553|  5.65k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 1.61k, False: 4.03k]
  |  |  ------------------
  ------------------
 1558|       |
 1559|  5.65k|        if (FSEv07_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  |  899|  5.65k|#define FSEv07_MAX_TABLELOG  (FSEv07_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  876|  5.65k|#define FSEv07_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1559:13): [Folded, False: 5.65k]
  ------------------
 1560|      0|            BITv07_reloadDStream(&bitD);
 1561|       |
 1562|  5.65k|        op[1] = FSEv07_GETSYMBOL(&state2);
  ------------------
  |  | 1553|  5.65k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 1.61k, False: 4.03k]
  |  |  ------------------
  ------------------
 1563|       |
 1564|  5.65k|        if (FSEv07_MAX_TABLELOG*4+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  |  899|  5.65k|#define FSEv07_MAX_TABLELOG  (FSEv07_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  876|  5.65k|#define FSEv07_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1564:13): [Folded, False: 5.65k]
  ------------------
 1565|      0|            { if (BITv07_reloadDStream(&bitD) > BITv07_DStream_unfinished) { op+=2; break; } }
  ------------------
  |  Branch (1565:19): [True: 0, False: 0]
  ------------------
 1566|       |
 1567|  5.65k|        op[2] = FSEv07_GETSYMBOL(&state1);
  ------------------
  |  | 1553|  5.65k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 1.61k, False: 4.03k]
  |  |  ------------------
  ------------------
 1568|       |
 1569|  5.65k|        if (FSEv07_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  |  899|  5.65k|#define FSEv07_MAX_TABLELOG  (FSEv07_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  876|  5.65k|#define FSEv07_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1569:13): [Folded, False: 5.65k]
  ------------------
 1570|      0|            BITv07_reloadDStream(&bitD);
 1571|       |
 1572|  5.65k|        op[3] = FSEv07_GETSYMBOL(&state2);
  ------------------
  |  | 1553|  5.65k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 1.61k, False: 4.03k]
  |  |  ------------------
  ------------------
 1573|  5.65k|    }
 1574|       |
 1575|       |    /* tail */
 1576|       |    /* note : BITv07_reloadDStream(&bitD) >= FSEv07_DStream_partiallyFilled; Ends at exactly BITv07_DStream_completed */
 1577|  12.0k|    while (1) {
  ------------------
  |  Branch (1577:12): [True: 12.0k, Folded]
  ------------------
 1578|  12.0k|        if (op>(omax-2)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   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 (1578:13): [True: 24, False: 12.0k]
  ------------------
 1579|       |
 1580|  12.0k|        *op++ = FSEv07_GETSYMBOL(&state1);
  ------------------
  |  | 1553|  12.0k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 2.61k, False: 9.38k]
  |  |  ------------------
  ------------------
 1581|       |
 1582|  12.0k|        if (BITv07_reloadDStream(&bitD)==BITv07_DStream_overflow) {
  ------------------
  |  Branch (1582:13): [True: 266, False: 11.7k]
  ------------------
 1583|    266|            *op++ = FSEv07_GETSYMBOL(&state2);
  ------------------
  |  | 1553|    266|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 113, False: 153]
  |  |  ------------------
  ------------------
 1584|    266|            break;
 1585|    266|        }
 1586|       |
 1587|  11.7k|        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: 11.7k]
  ------------------
 1588|       |
 1589|  11.7k|        *op++ = FSEv07_GETSYMBOL(&state2);
  ------------------
  |  | 1553|  11.7k|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 2.50k, False: 9.23k]
  |  |  ------------------
  ------------------
 1590|       |
 1591|  11.7k|        if (BITv07_reloadDStream(&bitD)==BITv07_DStream_overflow) {
  ------------------
  |  Branch (1591:13): [True: 305, False: 11.4k]
  ------------------
 1592|    305|            *op++ = FSEv07_GETSYMBOL(&state1);
  ------------------
  |  | 1553|    305|#define FSEv07_GETSYMBOL(statePtr) fast ? FSEv07_decodeSymbolFast(statePtr, &bitD) : FSEv07_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1553:36): [True: 76, False: 229]
  |  |  ------------------
  ------------------
 1593|    305|            break;
 1594|    305|    }   }
 1595|       |
 1596|    571|    return op-ostart;
 1597|    595|}
zstd_v07.c:BITv07_initDStream:
  503|  2.18k|{
  504|  2.18k|    if (srcSize < 1) { memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   49|     65|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     65|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     65|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (504:9): [True: 65, False: 2.11k]
  ------------------
  505|       |
  506|  2.11k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (506:9): [True: 1.33k, False: 780]
  ------------------
  507|  1.33k|        bitD->start = (const char*)srcBuffer;
  508|  1.33k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  509|  1.33k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  510|  1.33k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  511|  1.33k|          bitD->bitsConsumed = lastByte ? 8 - BITv07_highbit32(lastByte) : 0;
  ------------------
  |  Branch (511:32): [True: 1.06k, False: 275]
  ------------------
  512|  1.33k|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|    275|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    275|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    275|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (512:15): [True: 275, False: 1.06k]
  ------------------
  513|  1.33k|    } else {
  514|    780|        bitD->start = (const char*)srcBuffer;
  515|    780|        bitD->ptr   = bitD->start;
  516|    780|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  517|    780|        switch(srcSize)
  518|    780|        {
  519|     42|            case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);/* fall-through */
  ------------------
  |  Branch (519:13): [True: 42, False: 738]
  ------------------
  520|     67|            case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);/* fall-through */
  ------------------
  |  Branch (520:13): [True: 25, False: 755]
  ------------------
  521|    110|            case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);/* fall-through */
  ------------------
  |  Branch (521:13): [True: 43, False: 737]
  ------------------
  522|    180|            case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24; /* fall-through */
  ------------------
  |  Branch (522:13): [True: 70, False: 710]
  ------------------
  523|    306|            case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16; /* fall-through */
  ------------------
  |  Branch (523:13): [True: 126, False: 654]
  ------------------
  524|    447|            case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) <<  8; /* fall-through */
  ------------------
  |  Branch (524:13): [True: 141, False: 639]
  ------------------
  525|    780|            default: break;
  ------------------
  |  Branch (525:13): [True: 333, False: 447]
  ------------------
  526|    780|        }
  527|    780|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  528|    780|          bitD->bitsConsumed = lastByte ? 8 - BITv07_highbit32(lastByte) : 0;
  ------------------
  |  Branch (528:32): [True: 757, False: 23]
  ------------------
  529|    780|          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: 757]
  ------------------
  530|    757|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  531|    757|    }
  532|       |
  533|  1.81k|    return srcSize;
  534|  2.11k|}
zstd_v07.c:MEM_readLEST:
  367|  26.7k|{
  368|  26.7k|    if (MEM_32bits())
  ------------------
  |  Branch (368:9): [True: 0, False: 26.7k]
  ------------------
  369|      0|        return (size_t)MEM_readLE32(memPtr);
  370|  26.7k|    else
  371|  26.7k|        return (size_t)MEM_readLE64(memPtr);
  372|  26.7k|}
zstd_v07.c:FSEv07_initDState:
  818|  2.48k|{
  819|  2.48k|    const void* ptr = dt;
  820|  2.48k|    const FSEv07_DTableHeader* const DTableH = (const FSEv07_DTableHeader*)ptr;
  821|  2.48k|    DStatePtr->state = BITv07_readBits(bitD, DTableH->tableLog);
  822|  2.48k|    BITv07_reloadDStream(bitD);
  823|  2.48k|    DStatePtr->table = dt + 1;
  824|  2.48k|}
zstd_v07.c:BITv07_readBits:
  557|  78.9k|{
  558|  78.9k|    size_t const value = BITv07_lookBits(bitD, nbBits);
  559|  78.9k|    BITv07_skipBits(bitD, nbBits);
  560|  78.9k|    return value;
  561|  78.9k|}
zstd_v07.c:BITv07_lookBits:
  538|  78.9k|{
  539|  78.9k|    U32 const bitMask = sizeof(bitD->bitContainer)*8 - 1;
  540|  78.9k|    return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask);
  541|  78.9k|}
zstd_v07.c:BITv07_skipBits:
  552|  1.42M|{
  553|  1.42M|    bitD->bitsConsumed += nbBits;
  554|  1.42M|}
zstd_v07.c:BITv07_reloadDStream:
  573|  52.6k|{
  574|  52.6k|    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))  /* should not happen => corruption detected */
  ------------------
  |  Branch (574:9): [True: 707, False: 51.9k]
  ------------------
  575|    707|        return BITv07_DStream_overflow;
  576|       |
  577|  51.9k|    if (bitD->ptr >= bitD->start + sizeof(bitD->bitContainer)) {
  ------------------
  |  Branch (577:9): [True: 18.2k, False: 33.7k]
  ------------------
  578|  18.2k|        bitD->ptr -= bitD->bitsConsumed >> 3;
  579|  18.2k|        bitD->bitsConsumed &= 7;
  580|  18.2k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  581|  18.2k|        return BITv07_DStream_unfinished;
  582|  18.2k|    }
  583|  33.7k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (583:9): [True: 26.5k, False: 7.14k]
  ------------------
  584|  26.5k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BITv07_DStream_endOfBuffer;
  ------------------
  |  Branch (584:13): [True: 25.9k, False: 609]
  ------------------
  585|    609|        return BITv07_DStream_completed;
  586|  26.5k|    }
  587|  7.14k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  588|  7.14k|        BITv07_DStream_status result = BITv07_DStream_unfinished;
  589|  7.14k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (589:13): [True: 217, False: 6.93k]
  ------------------
  590|    217|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  591|    217|            result = BITv07_DStream_endOfBuffer;
  592|    217|        }
  593|  7.14k|        bitD->ptr -= nbBytes;
  594|  7.14k|        bitD->bitsConsumed -= nbBytes*8;
  595|  7.14k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD) */
  596|  7.14k|        return result;
  597|  33.7k|    }
  598|  33.7k|}
zstd_v07.c:FSEv07_decodeSymbolFast:
  854|  11.7k|{
  855|  11.7k|    FSEv07_decode_t const DInfo = ((const FSEv07_decode_t*)(DStatePtr->table))[DStatePtr->state];
  856|  11.7k|    U32 const nbBits = DInfo.nbBits;
  857|  11.7k|    BYTE const symbol = DInfo.symbol;
  858|  11.7k|    size_t const lowBits = BITv07_readBitsFast(bitD, nbBits);
  859|       |
  860|  11.7k|    DStatePtr->state = DInfo.newState + lowBits;
  861|  11.7k|    return symbol;
  862|  11.7k|}
zstd_v07.c:BITv07_readBitsFast:
  566|  11.7k|{
  567|  11.7k|    size_t const value = BITv07_lookBitsFast(bitD, nbBits);
  568|  11.7k|    BITv07_skipBits(bitD, nbBits);
  569|  11.7k|    return value;
  570|  11.7k|}
zstd_v07.c:BITv07_lookBitsFast:
  546|  1.34M|{
  547|  1.34M|    U32 const bitMask = sizeof(bitD->bitContainer)*8 - 1;
  548|  1.34M|    return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask);
  549|  1.34M|}
zstd_v07.c:FSEv07_decodeSymbol:
  841|  35.1k|{
  842|  35.1k|    FSEv07_decode_t const DInfo = ((const FSEv07_decode_t*)(DStatePtr->table))[DStatePtr->state];
  843|  35.1k|    U32 const nbBits = DInfo.nbBits;
  844|  35.1k|    BYTE const symbol = DInfo.symbol;
  845|  35.1k|    size_t const lowBits = BITv07_readBits(bitD, nbBits);
  846|       |
  847|  35.1k|    DStatePtr->state = DInfo.newState + lowBits;
  848|  35.1k|    return symbol;
  849|  35.1k|}
zstd_v07.c:HUFv07_getDTableDesc:
 1708|  1.58k|{
 1709|  1.58k|    DTableDesc dtd;
 1710|  1.58k|    memcpy(&dtd, table, sizeof(dtd));
 1711|  1.58k|    return dtd;
 1712|  1.58k|}
zstd_v07.c:HUFv07_decompress1X2_usingDTable_internal:
 1816|    125|{
 1817|    125|    BYTE* op = (BYTE*)dst;
 1818|    125|    BYTE* const oend = op + dstSize;
 1819|    125|    const void* dtPtr = DTable + 1;
 1820|    125|    const HUFv07_DEltX2* const dt = (const HUFv07_DEltX2*)dtPtr;
 1821|    125|    BITv07_DStream_t bitD;
 1822|    125|    DTableDesc const dtd = HUFv07_getDTableDesc(DTable);
 1823|    125|    U32 const dtLog = dtd.tableLog;
 1824|       |
 1825|    125|    { size_t const errorCode = BITv07_initDStream(&bitD, cSrc, cSrcSize);
 1826|    125|      if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1826:11): [True: 45, False: 80]
  ------------------
 1827|       |
 1828|     80|    HUFv07_decodeStreamX2(op, &bitD, oend, dt, dtLog);
 1829|       |
 1830|       |    /* check */
 1831|     80|    if (!BITv07_endOfDStream(&bitD)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     71|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     71|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     71|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1831:9): [True: 71, False: 9]
  ------------------
 1832|       |
 1833|      9|    return dstSize;
 1834|     80|}
zstd_v07.c:HUFv07_decodeStreamX2:
 1790|    472|{
 1791|    472|    BYTE* const pStart = p;
 1792|       |
 1793|       |    /* up to 4 symbols at a time */
 1794|  1.51k|    while ((BITv07_reloadDStream(bitDPtr) == BITv07_DStream_unfinished) && (p <= pEnd-4)) {
  ------------------
  |  Branch (1794:12): [True: 1.10k, False: 411]
  |  Branch (1794:76): [True: 1.03k, False: 61]
  ------------------
 1795|  1.03k|        HUFv07_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1786|  1.03k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 1.03k, False: 0]
  |  |  ------------------
  |  | 1787|  1.03k|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|  1.03k|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1796|  1.03k|        HUFv07_DECODE_SYMBOLX2_1(p, bitDPtr);
  ------------------
  |  | 1782|  1.03k|    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.03k, False: 0]
  |  |  |  Branch (1782:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1783|  1.03k|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|  1.03k|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1797|  1.03k|        HUFv07_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1786|  1.03k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 1.03k, False: 0]
  |  |  ------------------
  |  | 1787|  1.03k|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|  1.03k|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1798|  1.03k|        HUFv07_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1779|  1.03k|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1799|  1.03k|    }
 1800|       |
 1801|       |    /* closer to the end */
 1802|    557|    while ((BITv07_reloadDStream(bitDPtr) == BITv07_DStream_unfinished) && (p < pEnd))
  ------------------
  |  Branch (1802:12): [True: 133, False: 424]
  |  Branch (1802:76): [True: 85, False: 48]
  ------------------
 1803|     85|        HUFv07_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1779|     85|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1804|       |
 1805|       |    /* no more data to retrieve from bitstream, hence no need to reload */
 1806|  1.25M|    while (p < pEnd)
  ------------------
  |  Branch (1806:12): [True: 1.25M, False: 472]
  ------------------
 1807|  1.25M|        HUFv07_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1779|  1.25M|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1808|       |
 1809|    472|    return pEnd-pStart;
 1810|    472|}
zstd_v07.c:MEM_64bits:
  265|  23.2k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_v07.c:HUFv07_decodeSymbolX2:
 1771|  1.26M|{
 1772|  1.26M|    size_t const val = BITv07_lookBitsFast(Dstream, dtLog); /* note : dtLog >= 1 */
 1773|  1.26M|    BYTE const c = dt[val].byte;
 1774|  1.26M|    BITv07_skipBits(Dstream, dt[val].nbBits);
 1775|  1.26M|    return c;
 1776|  1.26M|}
zstd_v07.c:BITv07_endOfDStream:
  604|    545|{
  605|    545|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (605:13): [True: 485, False: 60]
  |  Branch (605:49): [True: 24, False: 461]
  ------------------
  606|    545|}
zstd_v07.c:HUFv07_decompress4X2_usingDTable_internal:
 1869|    299|{
 1870|       |    /* Check */
 1871|    299|    if (cSrcSize < 10) return ERROR(corruption_detected);  /* strict minimum : jump table + 1 byte per stream */
  ------------------
  |  |   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 (1871:9): [True: 10, False: 289]
  ------------------
 1872|       |
 1873|    289|    {   const BYTE* const istart = (const BYTE*) cSrc;
 1874|    289|        BYTE* const ostart = (BYTE*) dst;
 1875|    289|        BYTE* const oend = ostart + dstSize;
 1876|    289|        const void* const dtPtr = DTable + 1;
 1877|    289|        const HUFv07_DEltX2* const dt = (const HUFv07_DEltX2*)dtPtr;
 1878|       |
 1879|       |        /* Init */
 1880|    289|        BITv07_DStream_t bitD1;
 1881|    289|        BITv07_DStream_t bitD2;
 1882|    289|        BITv07_DStream_t bitD3;
 1883|    289|        BITv07_DStream_t bitD4;
 1884|    289|        size_t const length1 = MEM_readLE16(istart);
 1885|    289|        size_t const length2 = MEM_readLE16(istart+2);
 1886|    289|        size_t const length3 = MEM_readLE16(istart+4);
 1887|    289|        size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);
 1888|    289|        const BYTE* const istart1 = istart + 6;  /* jumpTable */
 1889|    289|        const BYTE* const istart2 = istart1 + length1;
 1890|    289|        const BYTE* const istart3 = istart2 + length2;
 1891|    289|        const BYTE* const istart4 = istart3 + length3;
 1892|    289|        const size_t segmentSize = (dstSize+3) / 4;
 1893|    289|        BYTE* const opStart2 = ostart + segmentSize;
 1894|    289|        BYTE* const opStart3 = opStart2 + segmentSize;
 1895|    289|        BYTE* const opStart4 = opStart3 + segmentSize;
 1896|    289|        BYTE* op1 = ostart;
 1897|    289|        BYTE* op2 = opStart2;
 1898|    289|        BYTE* op3 = opStart3;
 1899|    289|        BYTE* op4 = opStart4;
 1900|    289|        U32 endSignal;
 1901|    289|        DTableDesc const dtd = HUFv07_getDTableDesc(DTable);
 1902|    289|        U32 const dtLog = dtd.tableLog;
 1903|       |
 1904|    289|        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 (1904:13): [True: 17, False: 272]
  ------------------
 1905|    272|        { size_t const errorCode = BITv07_initDStream(&bitD1, istart1, length1);
 1906|    272|          if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1906:15): [True: 47, False: 225]
  ------------------
 1907|    225|        { size_t const errorCode = BITv07_initDStream(&bitD2, istart2, length2);
 1908|    225|          if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1908:15): [True: 59, False: 166]
  ------------------
 1909|    166|        { size_t const errorCode = BITv07_initDStream(&bitD3, istart3, length3);
 1910|    166|          if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1910:15): [True: 63, False: 103]
  ------------------
 1911|    103|        { size_t const errorCode = BITv07_initDStream(&bitD4, istart4, length4);
 1912|    103|          if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1912:15): [True: 5, False: 98]
  ------------------
 1913|       |
 1914|       |        /* 16-32 symbols per loop (4-8 symbols per stream) */
 1915|     98|        endSignal = BITv07_reloadDStream(&bitD1) | BITv07_reloadDStream(&bitD2) | BITv07_reloadDStream(&bitD3) | BITv07_reloadDStream(&bitD4);
 1916|    257|        for ( ; (endSignal==BITv07_DStream_unfinished) && (op4<(oend-7)) ; ) {
  ------------------
  |  Branch (1916:17): [True: 165, False: 92]
  |  Branch (1916:59): [True: 159, False: 6]
  ------------------
 1917|    159|            HUFv07_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 1786|    159|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 159, False: 0]
  |  |  ------------------
  |  | 1787|    159|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|    159|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1918|    159|            HUFv07_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 1786|    159|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 159, False: 0]
  |  |  ------------------
  |  | 1787|    159|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|    159|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1919|    159|            HUFv07_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 1786|    159|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 159, False: 0]
  |  |  ------------------
  |  | 1787|    159|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|    159|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1920|    159|            HUFv07_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 1786|    159|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 159, False: 0]
  |  |  ------------------
  |  | 1787|    159|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|    159|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1921|    159|            HUFv07_DECODE_SYMBOLX2_1(op1, &bitD1);
  ------------------
  |  | 1782|    159|    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: 159, False: 0]
  |  |  |  Branch (1782:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1783|    159|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|    159|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1922|    159|            HUFv07_DECODE_SYMBOLX2_1(op2, &bitD2);
  ------------------
  |  | 1782|    159|    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: 159, False: 0]
  |  |  |  Branch (1782:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1783|    159|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|    159|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1923|    159|            HUFv07_DECODE_SYMBOLX2_1(op3, &bitD3);
  ------------------
  |  | 1782|    159|    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: 159, False: 0]
  |  |  |  Branch (1782:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1783|    159|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|    159|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1924|    159|            HUFv07_DECODE_SYMBOLX2_1(op4, &bitD4);
  ------------------
  |  | 1782|    159|    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: 159, False: 0]
  |  |  |  Branch (1782:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1783|    159|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|    159|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1925|    159|            HUFv07_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 1786|    159|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 159, False: 0]
  |  |  ------------------
  |  | 1787|    159|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|    159|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1926|    159|            HUFv07_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 1786|    159|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 159, False: 0]
  |  |  ------------------
  |  | 1787|    159|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|    159|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1927|    159|            HUFv07_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 1786|    159|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 159, False: 0]
  |  |  ------------------
  |  | 1787|    159|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|    159|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1928|    159|            HUFv07_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 1786|    159|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1786:9): [True: 159, False: 0]
  |  |  ------------------
  |  | 1787|    159|        HUFv07_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1779|    159|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1929|    159|            HUFv07_DECODE_SYMBOLX2_0(op1, &bitD1);
  ------------------
  |  | 1779|    159|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1930|    159|            HUFv07_DECODE_SYMBOLX2_0(op2, &bitD2);
  ------------------
  |  | 1779|    159|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1931|    159|            HUFv07_DECODE_SYMBOLX2_0(op3, &bitD3);
  ------------------
  |  | 1779|    159|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1932|    159|            HUFv07_DECODE_SYMBOLX2_0(op4, &bitD4);
  ------------------
  |  | 1779|    159|    *ptr++ = HUFv07_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1933|    159|            endSignal = BITv07_reloadDStream(&bitD1) | BITv07_reloadDStream(&bitD2) | BITv07_reloadDStream(&bitD3) | BITv07_reloadDStream(&bitD4);
 1934|    159|        }
 1935|       |
 1936|       |        /* check corruption */
 1937|     98|        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: 98]
  ------------------
 1938|     98|        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: 98]
  ------------------
 1939|     98|        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: 98]
  ------------------
 1940|       |        /* note : op4 supposed already verified within main loop */
 1941|       |
 1942|       |        /* finish bitStreams one by one */
 1943|     98|        HUFv07_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog);
 1944|     98|        HUFv07_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog);
 1945|     98|        HUFv07_decodeStreamX2(op3, &bitD3, opStart4, dt, dtLog);
 1946|     98|        HUFv07_decodeStreamX2(op4, &bitD4, oend,     dt, dtLog);
 1947|       |
 1948|       |        /* check */
 1949|     98|        endSignal = BITv07_endOfDStream(&bitD1) & BITv07_endOfDStream(&bitD2) & BITv07_endOfDStream(&bitD3) & BITv07_endOfDStream(&bitD4);
 1950|     98|        if (!endSignal) return ERROR(corruption_detected);
  ------------------
  |  |   49|     98|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     98|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     98|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1950:13): [True: 98, False: 0]
  ------------------
 1951|       |
 1952|       |        /* decoded size */
 1953|      0|        return dstSize;
 1954|     98|    }
 1955|     98|}
zstd_v07.c:HUFv07_fillDTableX4:
 2041|    499|{
 2042|    499|    U32 rankVal[HUFv07_TABLELOG_ABSOLUTEMAX + 1];
 2043|    499|    const int scaleLog = nbBitsBaseline - targetLog;   /* note : targetLog >= srcLog, hence scaleLog <= 1 */
 2044|    499|    const U32 minBits  = nbBitsBaseline - maxWeight;
 2045|    499|    U32 s;
 2046|       |
 2047|    499|    memcpy(rankVal, rankValOrigin, sizeof(rankVal));
 2048|       |
 2049|       |    /* fill DTable */
 2050|  26.0k|    for (s=0; s<sortedListSize; s++) {
  ------------------
  |  Branch (2050:15): [True: 25.5k, False: 499]
  ------------------
 2051|  25.5k|        const U16 symbol = sortedList[s].symbol;
 2052|  25.5k|        const U32 weight = sortedList[s].weight;
 2053|  25.5k|        const U32 nbBits = nbBitsBaseline - weight;
 2054|  25.5k|        const U32 start = rankVal[weight];
 2055|  25.5k|        const U32 length = 1 << (targetLog-nbBits);
 2056|       |
 2057|  25.5k|        if (targetLog-nbBits >= minBits) {   /* enough room for a second symbol */
  ------------------
  |  Branch (2057:13): [True: 20.5k, False: 4.97k]
  ------------------
 2058|  20.5k|            U32 sortedRank;
 2059|  20.5k|            int minWeight = nbBits + scaleLog;
 2060|  20.5k|            if (minWeight < 1) minWeight = 1;
  ------------------
  |  Branch (2060:17): [True: 3.64k, False: 16.8k]
  ------------------
 2061|  20.5k|            sortedRank = rankStart[minWeight];
 2062|  20.5k|            HUFv07_fillDTableX4Level2(DTable+start, targetLog-nbBits, nbBits,
 2063|  20.5k|                           rankValOrigin[nbBits], minWeight,
 2064|  20.5k|                           sortedList+sortedRank, sortedListSize-sortedRank,
 2065|  20.5k|                           nbBitsBaseline, symbol);
 2066|  20.5k|        } else {
 2067|  4.97k|            HUFv07_DEltX4 DElt;
 2068|  4.97k|            MEM_writeLE16(&(DElt.sequence), symbol);
 2069|  4.97k|            DElt.nbBits = (BYTE)(nbBits);
 2070|  4.97k|            DElt.length = 1;
 2071|  4.97k|            {   U32 u;
 2072|  4.97k|                const U32 end = start + length;
 2073|  98.9k|                for (u = start; u < end; u++) DTable[u] = DElt;
  ------------------
  |  Branch (2073:33): [True: 93.9k, False: 4.97k]
  ------------------
 2074|  4.97k|        }   }
 2075|  25.5k|        rankVal[weight] += length;
 2076|  25.5k|    }
 2077|    499|}
zstd_v07.c:HUFv07_fillDTableX4Level2:
 1999|  20.5k|{
 2000|  20.5k|    HUFv07_DEltX4 DElt;
 2001|  20.5k|    U32 rankVal[HUFv07_TABLELOG_ABSOLUTEMAX + 1];
 2002|       |
 2003|       |    /* get pre-calculated rankVal */
 2004|  20.5k|    memcpy(rankVal, rankValOrigin, sizeof(rankVal));
 2005|       |
 2006|       |    /* fill skipped values */
 2007|  20.5k|    if (minWeight>1) {
  ------------------
  |  Branch (2007:9): [True: 14.2k, False: 6.32k]
  ------------------
 2008|  14.2k|        U32 i, skipSize = rankVal[minWeight];
 2009|  14.2k|        MEM_writeLE16(&(DElt.sequence), baseSeq);
 2010|  14.2k|        DElt.nbBits   = (BYTE)(consumed);
 2011|  14.2k|        DElt.length   = 1;
 2012|   145k|        for (i = 0; i < skipSize; i++)
  ------------------
  |  Branch (2012:21): [True: 131k, False: 14.2k]
  ------------------
 2013|   131k|            DTable[i] = DElt;
 2014|  14.2k|    }
 2015|       |
 2016|       |    /* fill DTable */
 2017|   365k|    { U32 s; for (s=0; s<sortedListSize; s++) {   /* note : sortedSymbols already skipped */
  ------------------
  |  Branch (2017:24): [True: 344k, False: 20.5k]
  ------------------
 2018|   344k|        const U32 symbol = sortedSymbols[s].symbol;
 2019|   344k|        const U32 weight = sortedSymbols[s].weight;
 2020|   344k|        const U32 nbBits = nbBitsBaseline - weight;
 2021|   344k|        const U32 length = 1 << (sizeLog-nbBits);
 2022|   344k|        const U32 start = rankVal[weight];
 2023|   344k|        U32 i = start;
 2024|   344k|        const U32 end = start + length;
 2025|       |
 2026|   344k|        MEM_writeLE16(&(DElt.sequence), (U16)(baseSeq + (symbol << 8)));
 2027|   344k|        DElt.nbBits = (BYTE)(nbBits + consumed);
 2028|   344k|        DElt.length = 2;
 2029|  1.81M|        do { DTable[i++] = DElt; } while (i<end);   /* since length >= 1 */
  ------------------
  |  Branch (2029:43): [True: 1.47M, False: 344k]
  ------------------
 2030|       |
 2031|   344k|        rankVal[weight] += length;
 2032|   344k|    }}
 2033|  20.5k|}
zstd_v07.c:MEM_writeLE16:
  339|   363k|{
  340|   363k|    if (MEM_isLittleEndian()) {
  ------------------
  |  Branch (340:9): [True: 363k, False: 0]
  ------------------
  341|   363k|        MEM_write16(memPtr, val);
  342|   363k|    } else {
  343|      0|        BYTE* p = (BYTE*)memPtr;
  344|      0|        p[0] = (BYTE)val;
  345|      0|        p[1] = (BYTE)(val>>8);
  346|      0|    }
  347|   363k|}
zstd_v07.c:MEM_write16:
  289|   363k|{
  290|   363k|    memcpy(memPtr, &value, sizeof(value));
  291|   363k|}
zstd_v07.c:HUFv07_decompress1X4_usingDTable_internal:
 2224|     91|{
 2225|     91|    BITv07_DStream_t bitD;
 2226|       |
 2227|       |    /* Init */
 2228|     91|    {   size_t const errorCode = BITv07_initDStream(&bitD, cSrc, cSrcSize);
 2229|     91|        if (HUFv07_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2229:13): [True: 38, False: 53]
  ------------------
 2230|     91|    }
 2231|       |
 2232|       |    /* decode */
 2233|     53|    {   BYTE* const ostart = (BYTE*) dst;
 2234|     53|        BYTE* const oend = ostart + dstSize;
 2235|     53|        const void* const dtPtr = DTable+1;   /* force compiler to not use strict-aliasing */
 2236|     53|        const HUFv07_DEltX4* const dt = (const HUFv07_DEltX4*)dtPtr;
 2237|     53|        DTableDesc const dtd = HUFv07_getDTableDesc(DTable);
 2238|     53|        HUFv07_decodeStreamX4(ostart, &bitD, oend, dt, dtd.tableLog);
 2239|     53|    }
 2240|       |
 2241|       |    /* check */
 2242|     53|    if (!BITv07_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 (2242:9): [True: 49, False: 4]
  ------------------
 2243|       |
 2244|       |    /* decoded size */
 2245|      4|    return dstSize;
 2246|     53|}
zstd_v07.c:HUFv07_decodeStreamX4:
 2195|     73|{
 2196|     73|    BYTE* const pStart = p;
 2197|       |
 2198|       |    /* up to 8 symbols at a time */
 2199|  6.13k|    while ((BITv07_reloadDStream(bitDPtr) == BITv07_DStream_unfinished) && (p < pEnd-7)) {
  ------------------
  |  Branch (2199:12): [True: 6.08k, False: 50]
  |  Branch (2199:76): [True: 6.06k, False: 23]
  ------------------
 2200|  6.06k|        HUFv07_DECODE_SYMBOLX4_2(p, bitDPtr);
  ------------------
  |  | 2191|  6.06k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2191:9): [True: 6.06k, False: 0]
  |  |  ------------------
  |  | 2192|  6.06k|        ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2201|  6.06k|        HUFv07_DECODE_SYMBOLX4_1(p, bitDPtr);
  ------------------
  |  | 2187|  6.06k|    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 (2187:9): [True: 6.06k, False: 0]
  |  |  |  Branch (2187:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2188|  6.06k|        ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2202|  6.06k|        HUFv07_DECODE_SYMBOLX4_2(p, bitDPtr);
  ------------------
  |  | 2191|  6.06k|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2191:9): [True: 6.06k, False: 0]
  |  |  ------------------
  |  | 2192|  6.06k|        ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2203|  6.06k|        HUFv07_DECODE_SYMBOLX4_0(p, bitDPtr);
  ------------------
  |  | 2184|  6.06k|    ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2204|  6.06k|    }
 2205|       |
 2206|       |    /* closer to end : up to 2 symbols at a time */
 2207|    117|    while ((BITv07_reloadDStream(bitDPtr) == BITv07_DStream_unfinished) && (p <= pEnd-2))
  ------------------
  |  Branch (2207:12): [True: 64, False: 53]
  |  Branch (2207:76): [True: 44, False: 20]
  ------------------
 2208|     44|        HUFv07_DECODE_SYMBOLX4_0(p, bitDPtr);
  ------------------
  |  | 2184|     44|    ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2209|       |
 2210|  49.7k|    while (p <= pEnd-2)
  ------------------
  |  Branch (2210:12): [True: 49.6k, False: 73]
  ------------------
 2211|  49.6k|        HUFv07_DECODE_SYMBOLX4_0(p, bitDPtr);   /* no need to reload : reached the end of DStream */
  ------------------
  |  | 2184|  49.6k|    ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2212|       |
 2213|     73|    if (p < pEnd)
  ------------------
  |  Branch (2213:9): [True: 50, False: 23]
  ------------------
 2214|     50|        p += HUFv07_decodeLastSymbolX4(p, bitDPtr, dt, dtLog);
 2215|       |
 2216|     73|    return p-pStart;
 2217|     73|}
zstd_v07.c:HUFv07_decodeSymbolX4:
 2161|  73.9k|{
 2162|  73.9k|    const size_t val = BITv07_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */
 2163|  73.9k|    memcpy(op, dt+val, 2);
 2164|  73.9k|    BITv07_skipBits(DStream, dt[val].nbBits);
 2165|  73.9k|    return dt[val].length;
 2166|  73.9k|}
zstd_v07.c:HUFv07_decodeLastSymbolX4:
 2169|     50|{
 2170|     50|    const size_t val = BITv07_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */
 2171|     50|    memcpy(op, dt+val, 1);
 2172|     50|    if (dt[val].length==1) BITv07_skipBits(DStream, dt[val].nbBits);
  ------------------
  |  Branch (2172:9): [True: 18, False: 32]
  ------------------
 2173|     32|    else {
 2174|     32|        if (DStream->bitsConsumed < (sizeof(DStream->bitContainer)*8)) {
  ------------------
  |  Branch (2174:13): [True: 18, False: 14]
  ------------------
 2175|     18|            BITv07_skipBits(DStream, dt[val].nbBits);
 2176|     18|            if (DStream->bitsConsumed > (sizeof(DStream->bitContainer)*8))
  ------------------
  |  Branch (2176:17): [True: 2, False: 16]
  ------------------
 2177|      2|                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 */
 2178|     18|    }   }
 2179|     50|    return 1;
 2180|     50|}
zstd_v07.c:HUFv07_decompress4X4_usingDTable_internal:
 2280|     39|{
 2281|     39|    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 (2281:9): [True: 0, False: 39]
  ------------------
 2282|       |
 2283|     39|    {   const BYTE* const istart = (const BYTE*) cSrc;
 2284|     39|        BYTE* const ostart = (BYTE*) dst;
 2285|     39|        BYTE* const oend = ostart + dstSize;
 2286|     39|        const void* const dtPtr = DTable+1;
 2287|     39|        const HUFv07_DEltX4* const dt = (const HUFv07_DEltX4*)dtPtr;
 2288|       |
 2289|       |        /* Init */
 2290|     39|        BITv07_DStream_t bitD1;
 2291|     39|        BITv07_DStream_t bitD2;
 2292|     39|        BITv07_DStream_t bitD3;
 2293|     39|        BITv07_DStream_t bitD4;
 2294|     39|        size_t const length1 = MEM_readLE16(istart);
 2295|     39|        size_t const length2 = MEM_readLE16(istart+2);
 2296|     39|        size_t const length3 = MEM_readLE16(istart+4);
 2297|     39|        size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);
 2298|     39|        const BYTE* const istart1 = istart + 6;  /* jumpTable */
 2299|     39|        const BYTE* const istart2 = istart1 + length1;
 2300|     39|        const BYTE* const istart3 = istart2 + length2;
 2301|     39|        const BYTE* const istart4 = istart3 + length3;
 2302|     39|        size_t const segmentSize = (dstSize+3) / 4;
 2303|     39|        BYTE* const opStart2 = ostart + segmentSize;
 2304|     39|        BYTE* const opStart3 = opStart2 + segmentSize;
 2305|     39|        BYTE* const opStart4 = opStart3 + segmentSize;
 2306|     39|        BYTE* op1 = ostart;
 2307|     39|        BYTE* op2 = opStart2;
 2308|     39|        BYTE* op3 = opStart3;
 2309|     39|        BYTE* op4 = opStart4;
 2310|     39|        U32 endSignal;
 2311|     39|        DTableDesc const dtd = HUFv07_getDTableDesc(DTable);
 2312|     39|        U32 const dtLog = dtd.tableLog;
 2313|       |
 2314|     39|        if (length4 > cSrcSize) return ERROR(corruption_detected);   /* overflow */
  ------------------
  |  |   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 (2314:13): [True: 3, False: 36]
  ------------------
 2315|     36|        { size_t const errorCode = BITv07_initDStream(&bitD1, istart1, length1);
 2316|     36|          if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (2316:15): [True: 3, False: 33]
  ------------------
 2317|     33|        { size_t const errorCode = BITv07_initDStream(&bitD2, istart2, length2);
 2318|     33|          if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (2318:15): [True: 11, False: 22]
  ------------------
 2319|     22|        { size_t const errorCode = BITv07_initDStream(&bitD3, istart3, length3);
 2320|     22|          if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (2320:15): [True: 15, False: 7]
  ------------------
 2321|      7|        { size_t const errorCode = BITv07_initDStream(&bitD4, istart4, length4);
 2322|      7|          if (HUFv07_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (2322:15): [True: 2, False: 5]
  ------------------
 2323|       |
 2324|       |        /* 16-32 symbols per loop (4-8 symbols per stream) */
 2325|      5|        endSignal = BITv07_reloadDStream(&bitD1) | BITv07_reloadDStream(&bitD2) | BITv07_reloadDStream(&bitD3) | BITv07_reloadDStream(&bitD4);
 2326|      5|        for ( ; (endSignal==BITv07_DStream_unfinished) && (op4<(oend-7)) ; ) {
  ------------------
  |  Branch (2326:17): [True: 0, False: 5]
  |  Branch (2326:59): [True: 0, False: 0]
  ------------------
 2327|      0|            HUFv07_DECODE_SYMBOLX4_2(op1, &bitD1);
  ------------------
  |  | 2191|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2191:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 2192|      0|        ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2328|      0|            HUFv07_DECODE_SYMBOLX4_2(op2, &bitD2);
  ------------------
  |  | 2191|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2191:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 2192|      0|        ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2329|      0|            HUFv07_DECODE_SYMBOLX4_2(op3, &bitD3);
  ------------------
  |  | 2191|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2191:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 2192|      0|        ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2330|      0|            HUFv07_DECODE_SYMBOLX4_2(op4, &bitD4);
  ------------------
  |  | 2191|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2191:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 2192|      0|        ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2331|      0|            HUFv07_DECODE_SYMBOLX4_1(op1, &bitD1);
  ------------------
  |  | 2187|      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 (2187:9): [True: 0, False: 0]
  |  |  |  Branch (2187:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2188|      0|        ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2332|      0|            HUFv07_DECODE_SYMBOLX4_1(op2, &bitD2);
  ------------------
  |  | 2187|      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 (2187:9): [True: 0, False: 0]
  |  |  |  Branch (2187:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2188|      0|        ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2333|      0|            HUFv07_DECODE_SYMBOLX4_1(op3, &bitD3);
  ------------------
  |  | 2187|      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 (2187:9): [True: 0, False: 0]
  |  |  |  Branch (2187:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2188|      0|        ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2334|      0|            HUFv07_DECODE_SYMBOLX4_1(op4, &bitD4);
  ------------------
  |  | 2187|      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 (2187:9): [True: 0, False: 0]
  |  |  |  Branch (2187:25): [True: 0, Folded]
  |  |  ------------------
  |  | 2188|      0|        ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2335|      0|            HUFv07_DECODE_SYMBOLX4_2(op1, &bitD1);
  ------------------
  |  | 2191|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2191:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 2192|      0|        ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2336|      0|            HUFv07_DECODE_SYMBOLX4_2(op2, &bitD2);
  ------------------
  |  | 2191|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2191:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 2192|      0|        ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2337|      0|            HUFv07_DECODE_SYMBOLX4_2(op3, &bitD3);
  ------------------
  |  | 2191|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2191:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 2192|      0|        ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2338|      0|            HUFv07_DECODE_SYMBOLX4_2(op4, &bitD4);
  ------------------
  |  | 2191|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (2191:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 2192|      0|        ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2339|      0|            HUFv07_DECODE_SYMBOLX4_0(op1, &bitD1);
  ------------------
  |  | 2184|      0|    ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2340|      0|            HUFv07_DECODE_SYMBOLX4_0(op2, &bitD2);
  ------------------
  |  | 2184|      0|    ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2341|      0|            HUFv07_DECODE_SYMBOLX4_0(op3, &bitD3);
  ------------------
  |  | 2184|      0|    ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2342|      0|            HUFv07_DECODE_SYMBOLX4_0(op4, &bitD4);
  ------------------
  |  | 2184|      0|    ptr += HUFv07_decodeSymbolX4(ptr, DStreamPtr, dt, dtLog)
  ------------------
 2343|       |
 2344|      0|            endSignal = BITv07_reloadDStream(&bitD1) | BITv07_reloadDStream(&bitD2) | BITv07_reloadDStream(&bitD3) | BITv07_reloadDStream(&bitD4);
 2345|      0|        }
 2346|       |
 2347|       |        /* check corruption */
 2348|      5|        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 (2348:13): [True: 0, False: 5]
  ------------------
 2349|      5|        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 (2349:13): [True: 0, False: 5]
  ------------------
 2350|      5|        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 (2350:13): [True: 0, False: 5]
  ------------------
 2351|       |        /* note : op4 supposed already verified within main loop */
 2352|       |
 2353|       |        /* finish bitStreams one by one */
 2354|      5|        HUFv07_decodeStreamX4(op1, &bitD1, opStart2, dt, dtLog);
 2355|      5|        HUFv07_decodeStreamX4(op2, &bitD2, opStart3, dt, dtLog);
 2356|      5|        HUFv07_decodeStreamX4(op3, &bitD3, opStart4, dt, dtLog);
 2357|      5|        HUFv07_decodeStreamX4(op4, &bitD4, oend,     dt, dtLog);
 2358|       |
 2359|       |        /* check */
 2360|      5|        { U32 const endCheck = BITv07_endOfDStream(&bitD1) & BITv07_endOfDStream(&bitD2) & BITv07_endOfDStream(&bitD3) & BITv07_endOfDStream(&bitD4);
 2361|      5|          if (!endCheck) 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 (2361:15): [True: 5, False: 0]
  ------------------
 2362|       |
 2363|       |        /* decoded size */
 2364|      0|        return dstSize;
 2365|      5|    }
 2366|      5|}
zstd_v07.c:ZSTDv07_defaultAllocFunction:
 2577|  2.21k|{
 2578|  2.21k|    void* address = malloc(size);
 2579|  2.21k|    (void)opaque;
 2580|       |    /* printf("alloc %p, %d opaque=%p \n", address, (int)size, opaque); */
 2581|  2.21k|    return address;
 2582|  2.21k|}
zstd_v07.c:ZSTDv07_defaultFreeFunction:
 2585|  2.21k|{
 2586|  2.21k|    (void)opaque;
 2587|       |    /* if (address) printf("free %p opaque=%p \n", address, opaque); */
 2588|  2.21k|    free(address);
 2589|  2.21k|}
zstd_v07.c:ZSTDv07_frameHeaderSize:
 3078|  7.28k|{
 3079|  7.28k|    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: 7.28k]
  ------------------
 3080|  7.28k|    {   BYTE const fhd = ((const BYTE*)src)[4];
 3081|  7.28k|        U32 const dictID= fhd & 3;
 3082|  7.28k|        U32 const directMode = (fhd >> 5) & 1;
 3083|  7.28k|        U32 const fcsId = fhd >> 6;
 3084|  7.28k|        return ZSTDv07_frameHeaderSize_min + !directMode + ZSTDv07_did_fieldSize[dictID] + ZSTDv07_fcs_fieldSize[fcsId]
 3085|  7.28k|                + (directMode && !ZSTDv07_fcs_fieldSize[fcsId]);
  ------------------
  |  Branch (3085:20): [True: 2.17k, False: 5.10k]
  |  Branch (3085:34): [True: 1.79k, False: 386]
  ------------------
 3086|  7.28k|    }
 3087|  7.28k|}
zstd_v07.c:MEM_32bits:
  264|  70.0k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_v07.c:MEM_readLE16:
  329|  1.17k|{
  330|  1.17k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (330:9): [True: 1.17k, False: 0]
  ------------------
  331|  1.17k|        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|  1.17k|}
zstd_v07.c:MEM_read16:
  274|  1.17k|{
  275|  1.17k|    U16 val; memcpy(&val, memPtr, sizeof(val)); return val;
  276|  1.17k|}
zstd_v07.c:MEM_readLE64:
  359|  26.7k|{
  360|  26.7k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (360:9): [True: 26.7k, False: 0]
  ------------------
  361|  26.7k|        return MEM_read64(memPtr);
  362|      0|    else
  363|      0|        return MEM_swap64(MEM_read64(memPtr));
  364|  26.7k|}
zstd_v07.c:MEM_read64:
  284|  26.7k|{
  285|  26.7k|    U64 val; memcpy(&val, memPtr, sizeof(val)); return val;
  286|  26.7k|}
zstd_v07.c:ZSTDv07_checkContinuity:
 3678|  2.21k|{
 3679|  2.21k|    if (dst != dctx->previousDstEnd) {   /* not contiguous */
  ------------------
  |  Branch (3679:9): [True: 2.21k, False: 0]
  ------------------
 3680|  2.21k|        dctx->dictEnd = dctx->previousDstEnd;
 3681|  2.21k|        dctx->vBase = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3682|  2.21k|        dctx->base = dst;
 3683|  2.21k|        dctx->previousDstEnd = dst;
 3684|  2.21k|    }
 3685|  2.21k|}
zstd_v07.c:ZSTDv07_decompressBlock_internal:
 3691|  1.63k|{   /* blockType == blockCompressed */
 3692|  1.63k|    const BYTE* ip = (const BYTE*)src;
 3693|       |
 3694|  1.63k|    if (srcSize >= ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) return ERROR(srcSize_wrong);
  ------------------
  |  |  175|  1.63k|#define ZSTDv07_BLOCKSIZE_ABSOLUTEMAX (128 * 1024)   /* define, for static allocation */
  ------------------
                  if (srcSize >= ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) 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 (3694:9): [True: 9, False: 1.62k]
  ------------------
 3695|       |
 3696|       |    /* Decode literals sub-block */
 3697|  1.62k|    {   size_t const litCSize = ZSTDv07_decodeLiteralsBlock(dctx, src, srcSize);
 3698|  1.62k|        if (ZSTDv07_isError(litCSize)) return litCSize;
  ------------------
  |  | 2856|  1.62k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3698:13): [True: 875, False: 753]
  ------------------
 3699|    753|        ip += litCSize;
 3700|    753|        srcSize -= litCSize;
 3701|    753|    }
 3702|      0|    return ZSTDv07_decompressSequences(dctx, dst, dstCapacity, ip, srcSize);
 3703|  1.62k|}
zstd_v07.c:ZSTDv07_decodeLiteralsBlock:
 3231|  1.62k|{
 3232|  1.62k|    const BYTE* const istart = (const BYTE*) src;
 3233|       |
 3234|  1.62k|    if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  | 2663|  1.62k|#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */ + MIN_SEQUENCES_SIZE /* nbSeq==0 */)   /* for a non-null block */
  |  |  ------------------
  |  |  |  | 2662|  1.62k|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  |  |  ------------------
  ------------------
                  if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  |   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 (3234:9): [True: 23, False: 1.60k]
  ------------------
 3235|       |
 3236|  1.60k|    switch((litBlockType_t)(istart[0]>> 6))
 3237|  1.60k|    {
 3238|    717|    case lbt_huffman:
  ------------------
  |  Branch (3238:5): [True: 717, False: 888]
  ------------------
 3239|    717|        {   size_t litSize, litCSize, singleStream=0;
 3240|    717|            U32 lhSize = (istart[0] >> 4) & 3;
 3241|    717|            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: 716]
  ------------------
 3242|    716|            switch(lhSize)
 3243|    716|            {
 3244|    539|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3244:13): [True: 335, False: 381]
  |  Branch (3244:21): [True: 204, False: 512]
  |  Branch (3244:29): [True: 0, False: 716]
  ------------------
 3245|       |                /* 2 - 2 - 10 - 10 */
 3246|    539|                lhSize=3;
 3247|    539|                singleStream = istart[0] & 16;
 3248|    539|                litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 3249|    539|                litCSize = ((istart[1] &  3) << 8) + istart[2];
 3250|    539|                break;
 3251|     96|            case 2:
  ------------------
  |  Branch (3251:13): [True: 96, False: 620]
  ------------------
 3252|       |                /* 2 - 2 - 14 - 14 */
 3253|     96|                lhSize=4;
 3254|     96|                litSize  = ((istart[0] & 15) << 10) + (istart[1] << 2) + (istart[2] >> 6);
 3255|     96|                litCSize = ((istart[2] & 63) <<  8) + istart[3];
 3256|     96|                break;
 3257|     81|            case 3:
  ------------------
  |  Branch (3257:13): [True: 81, False: 635]
  ------------------
 3258|       |                /* 2 - 2 - 18 - 18 */
 3259|     81|                lhSize=5;
 3260|     81|                litSize  = ((istart[0] & 15) << 14) + (istart[1] << 6) + (istart[2] >> 2);
 3261|     81|                litCSize = ((istart[2] &  3) << 16) + (istart[3] << 8) + istart[4];
 3262|     81|                break;
 3263|    716|            }
 3264|    716|            if (litSize > ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) return ERROR(corruption_detected);
  ------------------
  |  |  175|    716|#define ZSTDv07_BLOCKSIZE_ABSOLUTEMAX (128 * 1024)   /* define, for static allocation */
  ------------------
                          if (litSize > ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) 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 (3264:17): [True: 3, False: 713]
  ------------------
 3265|    713|            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: 668]
  ------------------
 3266|       |
 3267|    668|            if (HUFv07_isError(singleStream ?
  ------------------
  |  | 2858|    668|#define HUFv07_isError  ERR_isError
  ------------------
  |  Branch (3267:17): [True: 659, False: 9]
  |  Branch (3267:32): [True: 204, False: 464]
  ------------------
 3268|    204|                            HUFv07_decompress1X2_DCtx(dctx->hufTable, dctx->litBuffer, litSize, istart+lhSize, litCSize) :
 3269|    668|                            HUFv07_decompress4X_hufOnly (dctx->hufTable, dctx->litBuffer, litSize, istart+lhSize, litCSize) ))
 3270|    659|                return ERROR(corruption_detected);
  ------------------
  |  |   49|    659|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    659|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    659|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3271|       |
 3272|      9|            dctx->litPtr = dctx->litBuffer;
 3273|      9|            dctx->litSize = litSize;
 3274|      9|            dctx->litEntropy = 1;
 3275|      9|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  | 2721|      9|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3276|      9|            return litCSize + lhSize;
 3277|    668|        }
 3278|    104|    case lbt_repeat:
  ------------------
  |  Branch (3278:5): [True: 104, False: 1.50k]
  ------------------
 3279|    104|        {   size_t litSize, litCSize;
 3280|    104|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3281|    104|            if (lhSize != 1)  /* only case supported for now : small litSize, single stream */
  ------------------
  |  Branch (3281:17): [True: 3, False: 101]
  ------------------
 3282|      3|                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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3283|    101|            if (dctx->litEntropy==0)
  ------------------
  |  Branch (3283:17): [True: 4, False: 97]
  ------------------
 3284|      4|                return ERROR(dictionary_corrupted);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3285|       |
 3286|       |            /* 2 - 2 - 10 - 10 */
 3287|     97|            lhSize=3;
 3288|     97|            litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 3289|     97|            litCSize = ((istart[1] &  3) << 8) + istart[2];
 3290|     97|            if (litCSize + lhSize > srcSize) 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 (3290:17): [True: 6, False: 91]
  ------------------
 3291|       |
 3292|     91|            {   size_t const errorCode = HUFv07_decompress1X4_usingDTable(dctx->litBuffer, litSize, istart+lhSize, litCSize, dctx->hufTable);
 3293|     91|                if (HUFv07_isError(errorCode)) return ERROR(corruption_detected);
  ------------------
  |  | 2858|     91|#define HUFv07_isError  ERR_isError
  ------------------
                              if (HUFv07_isError(errorCode)) 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 (3293:21): [True: 87, False: 4]
  ------------------
 3294|     91|            }
 3295|      4|            dctx->litPtr = dctx->litBuffer;
 3296|      4|            dctx->litSize = litSize;
 3297|      4|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  | 2721|      4|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3298|      4|            return litCSize + lhSize;
 3299|     91|        }
 3300|    332|    case lbt_raw:
  ------------------
  |  Branch (3300:5): [True: 332, False: 1.27k]
  ------------------
 3301|    332|        {   size_t litSize;
 3302|    332|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3303|    332|            switch(lhSize)
 3304|    332|            {
 3305|    273|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3305:13): [True: 251, False: 81]
  |  Branch (3305:21): [True: 22, False: 310]
  |  Branch (3305:29): [True: 0, False: 332]
  ------------------
 3306|    273|                lhSize=1;
 3307|    273|                litSize = istart[0] & 31;
 3308|    273|                break;
 3309|     38|            case 2:
  ------------------
  |  Branch (3309:13): [True: 38, False: 294]
  ------------------
 3310|     38|                litSize = ((istart[0] & 15) << 8) + istart[1];
 3311|     38|                break;
 3312|     21|            case 3:
  ------------------
  |  Branch (3312:13): [True: 21, False: 311]
  ------------------
 3313|     21|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 3314|     21|                break;
 3315|    332|            }
 3316|       |
 3317|    332|            if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */
  ------------------
  |  | 2721|    332|#define WILDCOPY_OVERLENGTH 8
  ------------------
  |  Branch (3317:17): [True: 187, False: 145]
  ------------------
 3318|    187|                if (litSize+lhSize > srcSize) 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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3318:21): [True: 30, False: 157]
  ------------------
 3319|    157|                memcpy(dctx->litBuffer, istart+lhSize, litSize);
 3320|    157|                dctx->litPtr = dctx->litBuffer;
 3321|    157|                dctx->litSize = litSize;
 3322|    157|                memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  | 2721|    157|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3323|    157|                return lhSize+litSize;
 3324|    187|            }
 3325|       |            /* direct reference into compressed stream */
 3326|    145|            dctx->litPtr = istart+lhSize;
 3327|    145|            dctx->litSize = litSize;
 3328|    145|            return lhSize+litSize;
 3329|    332|        }
 3330|    452|    case lbt_rle:
  ------------------
  |  Branch (3330:5): [True: 452, False: 1.15k]
  ------------------
 3331|    452|        {   size_t litSize;
 3332|    452|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3333|    452|            switch(lhSize)
 3334|    452|            {
 3335|    212|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3335:13): [True: 85, False: 367]
  |  Branch (3335:21): [True: 127, False: 325]
  |  Branch (3335:29): [True: 0, False: 452]
  ------------------
 3336|    212|                lhSize = 1;
 3337|    212|                litSize = istart[0] & 31;
 3338|    212|                break;
 3339|    161|            case 2:
  ------------------
  |  Branch (3339:13): [True: 161, False: 291]
  ------------------
 3340|    161|                litSize = ((istart[0] & 15) << 8) + istart[1];
 3341|    161|                break;
 3342|     79|            case 3:
  ------------------
  |  Branch (3342:13): [True: 79, False: 373]
  ------------------
 3343|     79|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 3344|     79|                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: 78]
  ------------------
 3345|     78|                break;
 3346|    452|            }
 3347|    451|            if (litSize > ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) return ERROR(corruption_detected);
  ------------------
  |  |  175|    451|#define ZSTDv07_BLOCKSIZE_ABSOLUTEMAX (128 * 1024)   /* define, for static allocation */
  ------------------
                          if (litSize > ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) 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 (3347:17): [True: 13, False: 438]
  ------------------
 3348|    438|            memset(dctx->litBuffer, istart[lhSize], litSize + WILDCOPY_OVERLENGTH);
  ------------------
  |  | 2721|    438|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3349|    438|            dctx->litPtr = dctx->litBuffer;
 3350|    438|            dctx->litSize = litSize;
 3351|    438|            return lhSize+1;
 3352|    451|        }
 3353|      0|    default:
  ------------------
  |  Branch (3353:5): [True: 0, False: 1.60k]
  ------------------
 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|  1.60k|    }
 3356|  1.60k|}
zstd_v07.c:ZSTDv07_decompressSequences:
 3616|    753|{
 3617|    753|    const BYTE* ip = (const BYTE*)seqStart;
 3618|    753|    const BYTE* const iend = ip + seqSize;
 3619|    753|    BYTE* const ostart = (BYTE*)dst;
 3620|    753|    BYTE* const oend = ostart + maxDstSize;
 3621|    753|    BYTE* op = ostart;
 3622|    753|    const BYTE* litPtr = dctx->litPtr;
 3623|    753|    const BYTE* const litEnd = litPtr + dctx->litSize;
 3624|    753|    FSEv07_DTable* DTableLL = dctx->LLTable;
 3625|    753|    FSEv07_DTable* DTableML = dctx->MLTable;
 3626|    753|    FSEv07_DTable* DTableOffb = dctx->OffTable;
 3627|    753|    const BYTE* const base = (const BYTE*) (dctx->base);
 3628|    753|    const BYTE* const vBase = (const BYTE*) (dctx->vBase);
 3629|    753|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 3630|    753|    int nbSeq;
 3631|       |
 3632|       |    /* Build Decoding Tables */
 3633|    753|    {   size_t const seqHSize = ZSTDv07_decodeSeqHeaders(&nbSeq, DTableLL, DTableML, DTableOffb, dctx->fseEntropy, ip, seqSize);
 3634|    753|        if (ZSTDv07_isError(seqHSize)) return seqHSize;
  ------------------
  |  | 2856|    753|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3634:13): [True: 135, False: 618]
  ------------------
 3635|    618|        ip += seqHSize;
 3636|    618|    }
 3637|       |
 3638|       |    /* Regen sequences */
 3639|    618|    if (nbSeq) {
  ------------------
  |  Branch (3639:9): [True: 502, False: 116]
  ------------------
 3640|    502|        seqState_t seqState;
 3641|    502|        dctx->fseEntropy = 1;
 3642|  2.00k|        { U32 i; for (i=0; i<ZSTDv07_REP_INIT; i++) seqState.prevOffset[i] = dctx->rep[i]; }
  ------------------
  |  | 2639|  2.00k|#define ZSTDv07_REP_INIT   ZSTDv07_REP_NUM
  |  |  ------------------
  |  |  |  | 2638|  2.00k|#define ZSTDv07_REP_NUM    3
  |  |  ------------------
  ------------------
  |  Branch (3642:28): [True: 1.50k, False: 502]
  ------------------
 3643|    502|        { size_t const errorCode = BITv07_initDStream(&(seqState.DStream), ip, iend-ip);
 3644|    502|          if (ERR_isError(errorCode)) 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 (3644:15): [True: 70, False: 432]
  ------------------
 3645|    432|        FSEv07_initDState(&(seqState.stateLL), &(seqState.DStream), DTableLL);
 3646|    432|        FSEv07_initDState(&(seqState.stateOffb), &(seqState.DStream), DTableOffb);
 3647|    432|        FSEv07_initDState(&(seqState.stateML), &(seqState.DStream), DTableML);
 3648|       |
 3649|  10.7k|        for ( ; (BITv07_reloadDStream(&(seqState.DStream)) <= BITv07_DStream_completed) && nbSeq ; ) {
  ------------------
  |  Branch (3649:17): [True: 10.6k, False: 66]
  |  Branch (3649:92): [True: 10.6k, False: 52]
  ------------------
 3650|  10.6k|            nbSeq--;
 3651|  10.6k|            {   seq_t const sequence = ZSTDv07_decodeSequence(&seqState);
 3652|  10.6k|                size_t const oneSeqSize = ZSTDv07_execSequence(op, oend, sequence, &litPtr, litEnd, base, vBase, dictEnd);
 3653|  10.6k|                if (ZSTDv07_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  | 2856|  10.6k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3653:21): [True: 314, False: 10.3k]
  ------------------
 3654|  10.3k|                op += oneSeqSize;
 3655|  10.3k|        }   }
 3656|       |
 3657|       |        /* check if reached exact end */
 3658|    118|        if (nbSeq) 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 (3658:13): [True: 51, False: 67]
  ------------------
 3659|       |        /* save reps for next block */
 3660|    268|        { U32 i; for (i=0; i<ZSTDv07_REP_INIT; i++) dctx->rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  | 2639|    268|#define ZSTDv07_REP_INIT   ZSTDv07_REP_NUM
  |  |  ------------------
  |  |  |  | 2638|    268|#define ZSTDv07_REP_NUM    3
  |  |  ------------------
  ------------------
  |  Branch (3660:28): [True: 201, False: 67]
  ------------------
 3661|     67|    }
 3662|       |
 3663|       |    /* last literal segment */
 3664|    183|    {   size_t const lastLLSize = litEnd - litPtr;
 3665|       |        /* if (litPtr > litEnd) return ERROR(corruption_detected); */   /* too many literals already used */
 3666|    183|        if (lastLLSize > (size_t)(oend-op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   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 (3666:13): [True: 22, False: 161]
  ------------------
 3667|    161|        if (lastLLSize > 0) {
  ------------------
  |  Branch (3667:13): [True: 126, False: 35]
  ------------------
 3668|    126|            memcpy(op, litPtr, lastLLSize);
 3669|    126|            op += lastLLSize;
 3670|    126|        }
 3671|    161|    }
 3672|       |
 3673|      0|    return op-ostart;
 3674|    183|}
zstd_v07.c:ZSTDv07_decodeSeqHeaders:
 3396|    753|{
 3397|    753|    const BYTE* const istart = (const BYTE*)src;
 3398|    753|    const BYTE* const iend = istart + srcSize;
 3399|    753|    const BYTE* ip = istart;
 3400|       |
 3401|       |    /* check */
 3402|    753|    if (srcSize < MIN_SEQUENCES_SIZE) return ERROR(srcSize_wrong);
  ------------------
  |  | 2662|    753|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  ------------------
                  if (srcSize < MIN_SEQUENCES_SIZE) 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 (3402:9): [True: 9, False: 744]
  ------------------
 3403|       |
 3404|       |    /* SeqHead */
 3405|    744|    {   int nbSeq = *ip++;
 3406|    744|        if (!nbSeq) { *nbSeqPtr=0; return 1; }
  ------------------
  |  Branch (3406:13): [True: 82, False: 662]
  ------------------
 3407|    662|        if (nbSeq > 0x7F) {
  ------------------
  |  Branch (3407:13): [True: 209, False: 453]
  ------------------
 3408|    209|            if (nbSeq == 0xFF) {
  ------------------
  |  Branch (3408:17): [True: 59, False: 150]
  ------------------
 3409|     59|                if (ip+2 > iend) 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 (3409:21): [True: 3, False: 56]
  ------------------
 3410|     56|                nbSeq = MEM_readLE16(ip) + LONGNBSEQ, ip+=2;
  ------------------
  |  | 2668|     56|#define LONGNBSEQ 0x7F00
  ------------------
 3411|    150|            } else {
 3412|    150|                if (ip >= iend) 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 (3412:21): [True: 3, False: 147]
  ------------------
 3413|    147|                nbSeq = ((nbSeq-0x80)<<8) + *ip++;
 3414|    147|            }
 3415|    209|        }
 3416|    656|        *nbSeqPtr = nbSeq;
 3417|    656|    }
 3418|       |
 3419|       |    /* FSE table descriptors */
 3420|    656|    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|     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 (3420:9): [True: 12, False: 644]
  ------------------
 3421|    644|    {   U32 const LLtype  = *ip >> 6;
 3422|    644|        U32 const OFtype = (*ip >> 4) & 3;
 3423|    644|        U32 const MLtype  = (*ip >> 2) & 3;
 3424|    644|        ip++;
 3425|       |
 3426|       |        /* Build DTables */
 3427|    644|        {   size_t const llhSize = ZSTDv07_buildSeqTable(DTableLL, LLtype, MaxLL, LLFSELog, ip, iend-ip, LL_defaultNorm, LL_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2676|    644|#define MaxLL  35
  ------------------
                      {   size_t const llhSize = ZSTDv07_buildSeqTable(DTableLL, LLtype, MaxLL, LLFSELog, ip, iend-ip, LL_defaultNorm, LL_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2680|    644|#define LLFSELog    9
  ------------------
 3428|    644|            if (ZSTDv07_isError(llhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2856|    644|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
                          if (ZSTDv07_isError(llhSize)) return ERROR(corruption_detected);
  ------------------
  |  |   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 (3428:17): [True: 31, False: 613]
  ------------------
 3429|    613|            ip += llhSize;
 3430|    613|        }
 3431|    613|        {   size_t const ofhSize = ZSTDv07_buildSeqTable(DTableOffb, OFtype, MaxOff, OffFSELog, ip, iend-ip, OF_defaultNorm, OF_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2677|    613|#define MaxOff 28
  ------------------
                      {   size_t const ofhSize = ZSTDv07_buildSeqTable(DTableOffb, OFtype, MaxOff, OffFSELog, ip, iend-ip, OF_defaultNorm, OF_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2681|    613|#define OffFSELog   8
  ------------------
 3432|    613|            if (ZSTDv07_isError(ofhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2856|    613|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
                          if (ZSTDv07_isError(ofhSize)) return ERROR(corruption_detected);
  ------------------
  |  |   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 (3432:17): [True: 46, False: 567]
  ------------------
 3433|    567|            ip += ofhSize;
 3434|    567|        }
 3435|    567|        {   size_t const mlhSize = ZSTDv07_buildSeqTable(DTableML, MLtype, MaxML, MLFSELog, ip, iend-ip, ML_defaultNorm, ML_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2675|    567|#define MaxML  52
  ------------------
                      {   size_t const mlhSize = ZSTDv07_buildSeqTable(DTableML, MLtype, MaxML, MLFSELog, ip, iend-ip, ML_defaultNorm, ML_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2679|    567|#define MLFSELog    9
  ------------------
 3436|    567|            if (ZSTDv07_isError(mlhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2856|    567|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
                          if (ZSTDv07_isError(mlhSize)) return ERROR(corruption_detected);
  ------------------
  |  |   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 (3436:17): [True: 31, False: 536]
  ------------------
 3437|    536|            ip += mlhSize;
 3438|    536|    }   }
 3439|       |
 3440|      0|    return ip-istart;
 3441|    567|}
zstd_v07.c:ZSTDv07_buildSeqTable:
 3366|  1.82k|{
 3367|  1.82k|    switch(type)
 3368|  1.82k|    {
 3369|    315|    case FSEv07_ENCODING_RLE :
  ------------------
  |  | 2684|    315|#define FSEv07_ENCODING_RLE     1
  ------------------
  |  Branch (3369:5): [True: 315, False: 1.50k]
  ------------------
 3370|    315|        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 (3370:13): [True: 12, False: 303]
  ------------------
 3371|    303|        if ( (*(const BYTE*)src) > max) 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 (3371:14): [True: 12, False: 291]
  ------------------
 3372|    291|        FSEv07_buildDTable_rle(DTable, *(const BYTE*)src);   /* if *src > max, data is corrupted */
 3373|    291|        return 1;
 3374|    938|    case FSEv07_ENCODING_RAW :
  ------------------
  |  | 2683|    938|#define FSEv07_ENCODING_RAW     0
  ------------------
  |  Branch (3374:5): [True: 938, False: 886]
  ------------------
 3375|    938|        FSEv07_buildDTable(DTable, defaultNorm, max, defaultLog);
 3376|    938|        return 0;
 3377|     33|    case FSEv07_ENCODING_STATIC:
  ------------------
  |  | 2685|     33|#define FSEv07_ENCODING_STATIC  2
  ------------------
  |  Branch (3377:5): [True: 33, False: 1.79k]
  ------------------
 3378|     33|        if (!flagRepeatTable) 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 (3378:13): [True: 7, False: 26]
  ------------------
 3379|     26|        return 0;
 3380|      0|    default :   /* impossible */
  ------------------
  |  Branch (3380:5): [True: 0, False: 1.82k]
  ------------------
 3381|    538|    case FSEv07_ENCODING_DYNAMIC :
  ------------------
  |  | 2686|    538|#define FSEv07_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3381:5): [True: 538, False: 1.28k]
  ------------------
 3382|    538|        {   U32 tableLog;
 3383|    538|            S16 norm[MaxSeq+1];
 3384|    538|            size_t const headerSize = FSEv07_readNCount(norm, &max, &tableLog, src, srcSize);
 3385|    538|            if (FSEv07_isError(headerSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2857|    538|#define FSEv07_isError  ERR_isError
  ------------------
                          if (FSEv07_isError(headerSize)) return ERROR(corruption_detected);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3385:17): [True: 67, False: 471]
  ------------------
 3386|    471|            if (tableLog > maxLog) 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 (3386:17): [True: 10, False: 461]
  ------------------
 3387|    461|            FSEv07_buildDTable(DTable, norm, max, tableLog);
 3388|    461|            return headerSize;
 3389|    471|    }   }
 3390|  1.82k|}
zstd_v07.c:ZSTDv07_decodeSequence:
 3460|  10.6k|{
 3461|  10.6k|    seq_t seq;
 3462|       |
 3463|  10.6k|    U32 const llCode = FSEv07_peekSymbol(&(seqState->stateLL));
 3464|  10.6k|    U32 const mlCode = FSEv07_peekSymbol(&(seqState->stateML));
 3465|  10.6k|    U32 const ofCode = FSEv07_peekSymbol(&(seqState->stateOffb));   /* <= maxOff, by table construction */
 3466|       |
 3467|  10.6k|    U32 const llBits = LL_bits[llCode];
 3468|  10.6k|    U32 const mlBits = ML_bits[mlCode];
 3469|  10.6k|    U32 const ofBits = ofCode;
 3470|  10.6k|    U32 const totalBits = llBits+mlBits+ofBits;
 3471|       |
 3472|  10.6k|    static const U32 LL_base[MaxLL+1] = {
 3473|  10.6k|                             0,  1,  2,  3,  4,  5,  6,  7,  8,  9,   10,    11,    12,    13,    14,     15,
 3474|  10.6k|                            16, 18, 20, 22, 24, 28, 32, 40, 48, 64, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000,
 3475|  10.6k|                            0x2000, 0x4000, 0x8000, 0x10000 };
 3476|       |
 3477|  10.6k|    static const U32 ML_base[MaxML+1] = {
 3478|  10.6k|                             3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13,   14,    15,    16,    17,    18,
 3479|  10.6k|                            19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,   30,    31,    32,    33,    34,
 3480|  10.6k|                            35, 37, 39, 41, 43, 47, 51, 59, 67, 83, 99, 0x83, 0x103, 0x203, 0x403, 0x803,
 3481|  10.6k|                            0x1003, 0x2003, 0x4003, 0x8003, 0x10003 };
 3482|       |
 3483|  10.6k|    static const U32 OF_base[MaxOff+1] = {
 3484|  10.6k|                 0,        1,       1,       5,     0xD,     0x1D,     0x3D,     0x7D,
 3485|  10.6k|                 0xFD,   0x1FD,   0x3FD,   0x7FD,   0xFFD,   0x1FFD,   0x3FFD,   0x7FFD,
 3486|  10.6k|                 0xFFFD, 0x1FFFD, 0x3FFFD, 0x7FFFD, 0xFFFFD, 0x1FFFFD, 0x3FFFFD, 0x7FFFFD,
 3487|  10.6k|                 0xFFFFFD, 0x1FFFFFD, 0x3FFFFFD, 0x7FFFFFD, 0xFFFFFFD };
 3488|       |
 3489|       |    /* sequence */
 3490|  10.6k|    {   size_t offset;
 3491|  10.6k|        if (!ofCode)
  ------------------
  |  Branch (3491:13): [True: 3.93k, False: 6.67k]
  ------------------
 3492|  3.93k|            offset = 0;
 3493|  6.67k|        else {
 3494|  6.67k|            offset = OF_base[ofCode] + BITv07_readBits(&(seqState->DStream), ofBits);   /* <=  (ZSTDv07_WINDOWLOG_MAX-1) bits */
 3495|  6.67k|            if (MEM_32bits()) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3495:17): [True: 0, False: 6.67k]
  ------------------
 3496|  6.67k|        }
 3497|       |
 3498|  10.6k|        if (ofCode <= 1) {
  ------------------
  |  Branch (3498:13): [True: 6.14k, False: 4.46k]
  ------------------
 3499|  6.14k|            if ((llCode == 0) & (offset <= 1)) offset = 1-offset;
  ------------------
  |  Branch (3499:17): [True: 4.41k, False: 1.73k]
  ------------------
 3500|  6.14k|            if (offset) {
  ------------------
  |  Branch (3500:17): [True: 4.01k, False: 2.13k]
  ------------------
 3501|  4.01k|                size_t const temp = seqState->prevOffset[offset];
 3502|  4.01k|                if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1];
  ------------------
  |  Branch (3502:21): [True: 550, False: 3.46k]
  ------------------
 3503|  4.01k|                seqState->prevOffset[1] = seqState->prevOffset[0];
 3504|  4.01k|                seqState->prevOffset[0] = offset = temp;
 3505|  4.01k|            } else {
 3506|  2.13k|                offset = seqState->prevOffset[0];
 3507|  2.13k|            }
 3508|  6.14k|        } else {
 3509|  4.46k|            seqState->prevOffset[2] = seqState->prevOffset[1];
 3510|  4.46k|            seqState->prevOffset[1] = seqState->prevOffset[0];
 3511|  4.46k|            seqState->prevOffset[0] = offset;
 3512|  4.46k|        }
 3513|  10.6k|        seq.offset = offset;
 3514|  10.6k|    }
 3515|       |
 3516|  10.6k|    seq.matchLength = ML_base[mlCode] + ((mlCode>31) ? BITv07_readBits(&(seqState->DStream), mlBits) : 0);   /* <=  16 bits */
  ------------------
  |  Branch (3516:42): [True: 1.61k, False: 8.99k]
  ------------------
 3517|  10.6k|    if (MEM_32bits() && (mlBits+llBits>24)) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3517:9): [True: 0, False: 10.6k]
  |  Branch (3517:25): [True: 0, False: 0]
  ------------------
 3518|       |
 3519|  10.6k|    seq.litLength = LL_base[llCode] + ((llCode>15) ? BITv07_readBits(&(seqState->DStream), llBits) : 0);   /* <=  16 bits */
  ------------------
  |  Branch (3519:40): [True: 1.17k, False: 9.44k]
  ------------------
 3520|  10.6k|    if (MEM_32bits() ||
  ------------------
  |  Branch (3520:9): [True: 0, False: 10.6k]
  ------------------
 3521|  10.6k|       (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  | 2680|  10.6k|#define LLFSELog    9
  ------------------
                     (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  | 2679|  10.6k|#define MLFSELog    9
  ------------------
                     (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  | 2681|  10.6k|#define OffFSELog   8
  ------------------
  |  Branch (3521:8): [True: 66, False: 10.5k]
  ------------------
 3522|       |
 3523|       |    /* ANS state update */
 3524|  10.6k|    FSEv07_updateState(&(seqState->stateLL), &(seqState->DStream));   /* <=  9 bits */
 3525|  10.6k|    FSEv07_updateState(&(seqState->stateML), &(seqState->DStream));   /* <=  9 bits */
 3526|  10.6k|    if (MEM_32bits()) BITv07_reloadDStream(&(seqState->DStream));     /* <= 18 bits */
  ------------------
  |  Branch (3526:9): [True: 0, False: 10.6k]
  ------------------
 3527|  10.6k|    FSEv07_updateState(&(seqState->stateOffb), &(seqState->DStream)); /* <=  8 bits */
 3528|       |
 3529|  10.6k|    return seq;
 3530|  10.6k|}
zstd_v07.c:FSEv07_peekSymbol:
  827|  31.8k|{
  828|  31.8k|    FSEv07_decode_t const DInfo = ((const FSEv07_decode_t*)(DStatePtr->table))[DStatePtr->state];
  829|  31.8k|    return DInfo.symbol;
  830|  31.8k|}
zstd_v07.c:FSEv07_updateState:
  833|  31.8k|{
  834|  31.8k|    FSEv07_decode_t const DInfo = ((const FSEv07_decode_t*)(DStatePtr->table))[DStatePtr->state];
  835|  31.8k|    U32 const nbBits = DInfo.nbBits;
  836|  31.8k|    size_t const lowBits = BITv07_readBits(bitD, nbBits);
  837|  31.8k|    DStatePtr->state = DInfo.newState + lowBits;
  838|  31.8k|}
zstd_v07.c:ZSTDv07_execSequence:
 3538|  10.6k|{
 3539|  10.6k|    BYTE* const oLitEnd = op + sequence.litLength;
 3540|  10.6k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 3541|  10.6k|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 3542|  10.6k|    BYTE* const oend_w = oend-WILDCOPY_OVERLENGTH;
  ------------------
  |  | 2721|  10.6k|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3543|  10.6k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 3544|  10.6k|    const BYTE* match = oLitEnd - sequence.offset;
 3545|       |
 3546|       |    /* check */
 3547|  10.6k|    assert(oend >= op);
  ------------------
  |  |   70|  10.6k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 3548|  10.6k|    if (sequence.litLength + WILDCOPY_OVERLENGTH > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  | 2721|  10.6k|#define WILDCOPY_OVERLENGTH 8
  ------------------
                  if (sequence.litLength + WILDCOPY_OVERLENGTH > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|    155|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    155|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    155|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3548:9): [True: 155, False: 10.4k]
  ------------------
 3549|  10.4k|    if (sequenceLength > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   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 (3549:9): [True: 53, False: 10.4k]
  ------------------
 3550|  10.4k|    assert(litLimit >= *litPtr);
  ------------------
  |  |   70|  10.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 3551|  10.4k|    if (sequence.litLength > (size_t)(litLimit - *litPtr)) 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 (3551:9): [True: 33, False: 10.3k]
  ------------------
 3552|       |
 3553|       |    /* copy Literals */
 3554|  10.3k|    ZSTDv07_wildcopy(op, *litPtr, (ptrdiff_t)sequence.litLength);   /* note : since oLitEnd <= oend-WILDCOPY_OVERLENGTH, no risk of overwrite beyond oend */
 3555|  10.3k|    op = oLitEnd;
 3556|  10.3k|    *litPtr = iLitEnd;   /* update for next sequence */
 3557|       |
 3558|       |    /* copy Match */
 3559|  10.3k|    if (sequence.offset > (size_t)(oLitEnd - base)) {
  ------------------
  |  Branch (3559:9): [True: 363, False: 10.0k]
  ------------------
 3560|       |        /* offset beyond prefix */
 3561|    363|        if (sequence.offset > (size_t)(oLitEnd - vBase)) 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 (3561:13): [True: 73, False: 290]
  ------------------
 3562|    290|        match = dictEnd - (base-match);
 3563|    290|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (3563:13): [True: 224, False: 66]
  ------------------
 3564|    224|            memmove(oLitEnd, match, sequence.matchLength);
 3565|    224|            return sequenceLength;
 3566|    224|        }
 3567|       |        /* span extDict & currentPrefixSegment */
 3568|     66|        {   size_t const length1 = (size_t)(dictEnd - match);
 3569|     66|            memmove(oLitEnd, match, length1);
 3570|     66|            op = oLitEnd + length1;
 3571|     66|            sequence.matchLength -= length1;
 3572|     66|            match = base;
 3573|     66|            if (op > oend_w || sequence.matchLength < MINMATCH) {
  ------------------
  |  | 2670|     63|#define MINMATCH 3
  ------------------
  |  Branch (3573:17): [True: 3, False: 63]
  |  Branch (3573:32): [True: 25, False: 38]
  ------------------
 3574|     90|              while (op < oMatchEnd) *op++ = *match++;
  ------------------
  |  Branch (3574:22): [True: 62, False: 28]
  ------------------
 3575|     28|              return sequenceLength;
 3576|     28|            }
 3577|     66|    }   }
 3578|       |    /* Requirement: op <= oend_w */
 3579|       |
 3580|       |    /* match within prefix */
 3581|  10.0k|    if (sequence.offset < 8) {
  ------------------
  |  Branch (3581:9): [True: 4.85k, False: 5.19k]
  ------------------
 3582|       |        /* close range match, overlap */
 3583|  4.85k|        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
 3584|  4.85k|        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
 3585|  4.85k|        int const sub2 = dec64table[sequence.offset];
 3586|  4.85k|        op[0] = match[0];
 3587|  4.85k|        op[1] = match[1];
 3588|  4.85k|        op[2] = match[2];
 3589|  4.85k|        op[3] = match[3];
 3590|  4.85k|        match += dec32table[sequence.offset];
 3591|  4.85k|        ZSTDv07_copy4(op+4, match);
 3592|  4.85k|        match -= sub2;
 3593|  5.19k|    } else {
 3594|  5.19k|        ZSTDv07_copy8(op, match);
 3595|  5.19k|    }
 3596|  10.0k|    op += 8; match += 8;
 3597|       |
 3598|  10.0k|    if (oMatchEnd > oend-(16-MINMATCH)) {
  ------------------
  |  | 2670|  10.0k|#define MINMATCH 3
  ------------------
  |  Branch (3598:9): [True: 168, False: 9.88k]
  ------------------
 3599|    168|        if (op < oend_w) {
  ------------------
  |  Branch (3599:13): [True: 40, False: 128]
  ------------------
 3600|     40|            ZSTDv07_wildcopy(op, match, oend_w - op);
 3601|     40|            match += oend_w - op;
 3602|     40|            op = oend_w;
 3603|     40|        }
 3604|    284|        while (op < oMatchEnd) *op++ = *match++;
  ------------------
  |  Branch (3604:16): [True: 116, False: 168]
  ------------------
 3605|  9.88k|    } else {
 3606|  9.88k|        ZSTDv07_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8);   /* works even if matchLength < 8 */
 3607|  9.88k|    }
 3608|  10.0k|    return sequenceLength;
 3609|  10.3k|}
zstd_v07.c:ZSTDv07_wildcopy:
 2723|  20.2k|{
 2724|  20.2k|    const BYTE* ip = (const BYTE*)src;
 2725|  20.2k|    BYTE* op = (BYTE*)dst;
 2726|  20.2k|    BYTE* const oend = op + length;
 2727|  20.2k|    do
 2728|   567k|        COPY8(op, ip)
  ------------------
  |  | 2717|   567k|#define COPY8(d,s) { ZSTDv07_copy8(d,s); d+=8; s+=8; }
  ------------------
 2729|   567k|    while (op < oend);
  ------------------
  |  Branch (2729:12): [True: 546k, False: 20.2k]
  ------------------
 2730|  20.2k|}
zstd_v07.c:ZSTDv07_copy4:
 2864|  4.85k|static void ZSTDv07_copy4(void* dst, const void* src) { memcpy(dst, src, 4); }
zstd_v07.c:ZSTDv07_copy8:
 2716|   572k|static void ZSTDv07_copy8(void* dst, const void* src) { memcpy(dst, src, 8); }
zstd_v07.c:ZSTDv07_decompressFrame:
 3743|  2.21k|{
 3744|  2.21k|    const BYTE* ip = (const BYTE*)src;
 3745|  2.21k|    const BYTE* const iend = ip + srcSize;
 3746|  2.21k|    BYTE* const ostart = (BYTE*)dst;
 3747|  2.21k|    BYTE* const oend = ostart + dstCapacity;
 3748|  2.21k|    BYTE* op = ostart;
 3749|  2.21k|    size_t remainingSize = srcSize;
 3750|       |
 3751|       |    /* check */
 3752|  2.21k|    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: 2.21k]
  ------------------
 3753|       |
 3754|       |    /* Frame Header */
 3755|  2.21k|    {   size_t const frameHeaderSize = ZSTDv07_frameHeaderSize(src, ZSTDv07_frameHeaderSize_min);
 3756|  2.21k|        if (ZSTDv07_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  | 2856|  2.21k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3756:13): [True: 0, False: 2.21k]
  ------------------
 3757|  2.21k|        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: 2.21k]
  ------------------
 3758|  2.21k|        if (ZSTDv07_decodeFrameHeader(dctx, src, frameHeaderSize)) return ERROR(corruption_detected);
  ------------------
  |  |   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 (3758:13): [True: 134, False: 2.08k]
  ------------------
 3759|  2.08k|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3760|  2.08k|    }
 3761|       |
 3762|       |    /* Loop on each block */
 3763|  2.65k|    while (1) {
  ------------------
  |  Branch (3763:12): [True: 2.65k, Folded]
  ------------------
 3764|  2.65k|        size_t decodedSize;
 3765|  2.65k|        blockProperties_t blockProperties;
 3766|  2.65k|        size_t const cBlockSize = ZSTDv07_getcBlockSize(ip, iend-ip, &blockProperties);
 3767|  2.65k|        if (ZSTDv07_isError(cBlockSize)) return cBlockSize;
  ------------------
  |  | 2856|  2.65k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3767:13): [True: 0, False: 2.65k]
  ------------------
 3768|       |
 3769|  2.65k|        ip += ZSTDv07_blockHeaderSize;
 3770|  2.65k|        remainingSize -= ZSTDv07_blockHeaderSize;
 3771|  2.65k|        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: 2.65k]
  ------------------
 3772|       |
 3773|  2.65k|        switch(blockProperties.blockType)
 3774|  2.65k|        {
 3775|  1.63k|        case bt_compressed:
  ------------------
  |  Branch (3775:9): [True: 1.63k, False: 1.01k]
  ------------------
 3776|  1.63k|            decodedSize = ZSTDv07_decompressBlock_internal(dctx, op, oend-op, ip, cBlockSize);
 3777|  1.63k|            break;
 3778|    282|        case bt_raw :
  ------------------
  |  Branch (3778:9): [True: 282, False: 2.37k]
  ------------------
 3779|    282|            decodedSize = ZSTDv07_copyRawBlock(op, oend-op, ip, cBlockSize);
 3780|    282|            break;
 3781|    164|        case bt_rle :
  ------------------
  |  Branch (3781:9): [True: 164, False: 2.48k]
  ------------------
 3782|    164|            decodedSize = ZSTDv07_generateNxBytes(op, oend-op, *ip, blockProperties.origSize);
 3783|    164|            break;
 3784|    570|        case bt_end :
  ------------------
  |  Branch (3784:9): [True: 570, False: 2.08k]
  ------------------
 3785|       |            /* end of frame */
 3786|    570|            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: 570]
  ------------------
 3787|    570|            decodedSize = 0;
 3788|    570|            break;
 3789|      0|        default:
  ------------------
  |  Branch (3789:9): [True: 0, False: 2.65k]
  ------------------
 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|  2.65k|        }
 3792|  2.65k|        if (blockProperties.blockType == bt_end) break;   /* bt_end */
  ------------------
  |  Branch (3792:13): [True: 570, False: 2.08k]
  ------------------
 3793|       |
 3794|  2.08k|        if (ZSTDv07_isError(decodedSize)) return decodedSize;
  ------------------
  |  | 2856|  2.08k|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3794:13): [True: 1.51k, False: 573]
  ------------------
 3795|    573|        if (dctx->fParams.checksumFlag) XXH64_update(&dctx->xxhState, op, decodedSize);
  ------------------
  |  |  460|    412|#  define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update)
  |  |  ------------------
  |  |  |  |  443|    412|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|    412|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3795:13): [True: 412, False: 161]
  ------------------
 3796|    573|        op += decodedSize;
 3797|    573|        ip += cBlockSize;
 3798|    573|        remainingSize -= cBlockSize;
 3799|    573|    }
 3800|       |
 3801|    570|    return op-ostart;
 3802|  2.08k|}
zstd_v07.c:ZSTDv07_generateNxBytes:
 3729|    164|{
 3730|    164|    if (length > dstCapacity) 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 (3730:9): [True: 19, False: 145]
  ------------------
 3731|    145|    if (length > 0) {
  ------------------
  |  Branch (3731:9): [True: 124, False: 21]
  ------------------
 3732|    124|        memset(dst, byte, length);
 3733|    124|    }
 3734|    145|    return length;
 3735|    164|}
zstd_v07.c:ZSTD_errorFrameSizeInfoLegacy:
 3855|     70|{
 3856|     70|    *cSize = ret;
 3857|     70|    *dBound = ZSTD_CONTENTSIZE_ERROR;
  ------------------
  |  | 2688|     70|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
 3858|     70|}
zstd_v07.c:ZSTDv07_getcBlockSize:
 3201|  8.77k|{
 3202|  8.77k|    const BYTE* const in = (const BYTE*)src;
 3203|  8.77k|    U32 cSize;
 3204|       |
 3205|  8.77k|    if (srcSize < ZSTDv07_blockHeaderSize) 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 (3205:9): [True: 8, False: 8.76k]
  ------------------
 3206|       |
 3207|  8.76k|    bpPtr->blockType = (blockType_t)((*in) >> 6);
 3208|  8.76k|    cSize = in[2] + (in[1]<<8) + ((in[0] & 7)<<16);
 3209|  8.76k|    bpPtr->origSize = (bpPtr->blockType == bt_rle) ? cSize : 0;
  ------------------
  |  Branch (3209:23): [True: 833, False: 7.93k]
  ------------------
 3210|       |
 3211|  8.76k|    if (bpPtr->blockType == bt_end) return 0;
  ------------------
  |  Branch (3211:9): [True: 2.78k, False: 5.98k]
  ------------------
 3212|  5.98k|    if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (3212:9): [True: 833, False: 5.14k]
  ------------------
 3213|  5.14k|    return cSize;
 3214|  5.98k|}
zstd_v07.c:ZSTDv07_decodeFrameHeader:
 3184|  2.21k|{
 3185|  2.21k|    size_t const result = ZSTDv07_getFrameParams(&(dctx->fParams), src, srcSize);
 3186|  2.21k|    if (dctx->fParams.dictID && (dctx->dictID != dctx->fParams.dictID)) return ERROR(dictionary_wrong);
  ------------------
  |  |   49|     80|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     80|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     80|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3186:9): [True: 83, False: 2.13k]
  |  Branch (3186:33): [True: 80, False: 3]
  ------------------
 3187|  2.13k|    if (dctx->fParams.checksumFlag) XXH64_reset(&dctx->xxhState, 0);
  ------------------
  |  |  459|    739|#  define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset)
  |  |  ------------------
  |  |  |  |  443|    739|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|    739|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3187:9): [True: 739, False: 1.39k]
  ------------------
 3188|  2.13k|    return result;
 3189|  2.21k|}
zstd_v07.c:ZSTDv07_copyRawBlock:
 3218|    282|{
 3219|    282|    if (srcSize > dstCapacity) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   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 (3219:9): [True: 15, False: 267]
  ------------------
 3220|    267|    if (srcSize > 0) {
  ------------------
  |  Branch (3220:9): [True: 225, False: 42]
  ------------------
 3221|    225|        memcpy(dst, src, srcSize);
 3222|    225|    }
 3223|    267|    return srcSize;
 3224|    282|}
zstd_v07.c:ZSTDv07_decompress_insertDictionary:
 4092|    690|{
 4093|    690|    if (dictSize < 8) return ZSTDv07_refDictContent(dctx, dict, dictSize);
  ------------------
  |  Branch (4093:9): [True: 20, False: 670]
  ------------------
 4094|    670|    {   U32 const magic = MEM_readLE32(dict);
 4095|    670|        if (magic != ZSTDv07_DICT_MAGIC) {
  ------------------
  |  | 2636|    670|#define ZSTDv07_DICT_MAGIC  0xEC30A437   /* v0.7 */
  ------------------
  |  Branch (4095:13): [True: 199, False: 471]
  ------------------
 4096|    199|            return ZSTDv07_refDictContent(dctx, dict, dictSize);   /* pure content mode */
 4097|    199|    }   }
 4098|    471|    dctx->dictID = MEM_readLE32((const char*)dict + 4);
 4099|       |
 4100|       |    /* load entropy tables */
 4101|    471|    dict = (const char*)dict + 8;
 4102|    471|    dictSize -= 8;
 4103|    471|    {   size_t const eSize = ZSTDv07_loadEntropy(dctx, dict, dictSize);
 4104|    471|        if (ZSTDv07_isError(eSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2856|    471|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
                      if (ZSTDv07_isError(eSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   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 (4104:13): [True: 19, False: 452]
  ------------------
 4105|    452|        dict = (const char*)dict + eSize;
 4106|    452|        dictSize -= eSize;
 4107|    452|    }
 4108|       |
 4109|       |    /* reference dictionary content */
 4110|      0|    return ZSTDv07_refDictContent(dctx, dict, dictSize);
 4111|    471|}
zstd_v07.c:ZSTDv07_refDictContent:
 4033|    671|{
 4034|    671|    dctx->dictEnd = dctx->previousDstEnd;
 4035|    671|    dctx->vBase = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 4036|    671|    dctx->base = dict;
 4037|    671|    dctx->previousDstEnd = (const char*)dict + dictSize;
 4038|    671|    return 0;
 4039|    671|}
zstd_v07.c:ZSTDv07_loadEntropy:
 4042|    471|{
 4043|    471|    const BYTE* dictPtr = (const BYTE*)dict;
 4044|    471|    const BYTE* const dictEnd = dictPtr + dictSize;
 4045|       |
 4046|    471|    {   size_t const hSize = HUFv07_readDTableX4(dctx->hufTable, dict, dictSize);
 4047|    471|        if (HUFv07_isError(hSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2858|    471|#define HUFv07_isError  ERR_isError
  ------------------
                      if (HUFv07_isError(hSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   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 (4047:13): [True: 11, False: 460]
  ------------------
 4048|    460|        dictPtr += hSize;
 4049|    460|    }
 4050|       |
 4051|      0|    {   short offcodeNCount[MaxOff+1];
 4052|    460|        U32 offcodeMaxValue=MaxOff, offcodeLog;
  ------------------
  |  | 2677|    460|#define MaxOff 28
  ------------------
 4053|    460|        size_t const offcodeHeaderSize = FSEv07_readNCount(offcodeNCount, &offcodeMaxValue, &offcodeLog, dictPtr, dictEnd-dictPtr);
 4054|    460|        if (FSEv07_isError(offcodeHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2857|    460|#define FSEv07_isError  ERR_isError
  ------------------
                      if (FSEv07_isError(offcodeHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   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 (4054:13): [True: 8, False: 452]
  ------------------
 4055|    452|        if (offcodeLog > OffFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2681|    452|#define OffFSELog   8
  ------------------
                      if (offcodeLog > OffFSELog) 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 (4055:13): [True: 0, False: 452]
  ------------------
 4056|    452|        { size_t const errorCode = FSEv07_buildDTable(dctx->OffTable, offcodeNCount, offcodeMaxValue, offcodeLog);
 4057|    452|          if (FSEv07_isError(errorCode)) return ERROR(dictionary_corrupted); }
  ------------------
  |  | 2857|    452|#define FSEv07_isError  ERR_isError
  ------------------
                        if (FSEv07_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 (4057:15): [True: 0, False: 452]
  ------------------
 4058|    452|        dictPtr += offcodeHeaderSize;
 4059|    452|    }
 4060|       |
 4061|      0|    {   short matchlengthNCount[MaxML+1];
 4062|    452|        unsigned matchlengthMaxValue = MaxML, matchlengthLog;
  ------------------
  |  | 2675|    452|#define MaxML  52
  ------------------
 4063|    452|        size_t const matchlengthHeaderSize = FSEv07_readNCount(matchlengthNCount, &matchlengthMaxValue, &matchlengthLog, dictPtr, dictEnd-dictPtr);
 4064|    452|        if (FSEv07_isError(matchlengthHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2857|    452|#define FSEv07_isError  ERR_isError
  ------------------
                      if (FSEv07_isError(matchlengthHeaderSize)) 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 (4064:13): [True: 0, False: 452]
  ------------------
 4065|    452|        if (matchlengthLog > MLFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2679|    452|#define MLFSELog    9
  ------------------
                      if (matchlengthLog > MLFSELog) 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 (4065:13): [True: 0, False: 452]
  ------------------
 4066|    452|        { size_t const errorCode = FSEv07_buildDTable(dctx->MLTable, matchlengthNCount, matchlengthMaxValue, matchlengthLog);
 4067|    452|          if (FSEv07_isError(errorCode)) return ERROR(dictionary_corrupted); }
  ------------------
  |  | 2857|    452|#define FSEv07_isError  ERR_isError
  ------------------
                        if (FSEv07_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 (4067:15): [True: 0, False: 452]
  ------------------
 4068|    452|        dictPtr += matchlengthHeaderSize;
 4069|    452|    }
 4070|       |
 4071|      0|    {   short litlengthNCount[MaxLL+1];
 4072|    452|        unsigned litlengthMaxValue = MaxLL, litlengthLog;
  ------------------
  |  | 2676|    452|#define MaxLL  35
  ------------------
 4073|    452|        size_t const litlengthHeaderSize = FSEv07_readNCount(litlengthNCount, &litlengthMaxValue, &litlengthLog, dictPtr, dictEnd-dictPtr);
 4074|    452|        if (FSEv07_isError(litlengthHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2857|    452|#define FSEv07_isError  ERR_isError
  ------------------
                      if (FSEv07_isError(litlengthHeaderSize)) 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 (4074:13): [True: 0, False: 452]
  ------------------
 4075|    452|        if (litlengthLog > LLFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2680|    452|#define LLFSELog    9
  ------------------
                      if (litlengthLog > LLFSELog) 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 (4075:13): [True: 0, False: 452]
  ------------------
 4076|    452|        { size_t const errorCode = FSEv07_buildDTable(dctx->LLTable, litlengthNCount, litlengthMaxValue, litlengthLog);
 4077|    452|          if (FSEv07_isError(errorCode)) return ERROR(dictionary_corrupted); }
  ------------------
  |  | 2857|    452|#define FSEv07_isError  ERR_isError
  ------------------
                        if (FSEv07_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 (4077:15): [True: 0, False: 452]
  ------------------
 4078|    452|        dictPtr += litlengthHeaderSize;
 4079|    452|    }
 4080|       |
 4081|    452|    if (dictPtr+12 > dictEnd) 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 (4081:9): [True: 0, False: 452]
  ------------------
 4082|    452|    dctx->rep[0] = MEM_readLE32(dictPtr+0); if (dctx->rep[0] == 0 || dctx->rep[0] >= dictSize) 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 (4082:49): [True: 0, False: 452]
  |  Branch (4082:70): [True: 0, False: 452]
  ------------------
 4083|    452|    dctx->rep[1] = MEM_readLE32(dictPtr+4); if (dctx->rep[1] == 0 || dctx->rep[1] >= dictSize) 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 (4083:49): [True: 0, False: 452]
  |  Branch (4083:70): [True: 0, False: 452]
  ------------------
 4084|    452|    dctx->rep[2] = MEM_readLE32(dictPtr+8); if (dctx->rep[2] == 0 || dctx->rep[2] >= dictSize) 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 (4084:49): [True: 0, False: 452]
  |  Branch (4084:70): [True: 0, False: 452]
  ------------------
 4085|    452|    dictPtr += 12;
 4086|       |
 4087|    452|    dctx->litEntropy = dctx->fseEntropy = 1;
 4088|    452|    return dictPtr - (const BYTE*)dict;
 4089|    452|}

bshuf_trans_byte_bitrow_AVX:
  131|    325|                                    const size_t elem_size) {
  132|       |
  133|    325|  size_t hh, ii, jj, kk, mm;
  134|    325|  const char* in_b = (const char*) in;
  135|    325|  char* out_b = (char*) out;
  136|       |
  137|    325|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|    325|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 325]
  |  |  ------------------
  ------------------
  138|       |
  139|    325|  size_t nrows = 8 * elem_size;
  140|    325|  size_t nbyte_row = size / 8;
  141|       |
  142|    325|  if (elem_size % 4) return bshuf_trans_byte_bitrow_SSE(in, out, size,
  ------------------
  |  Branch (142:7): [True: 212, False: 113]
  ------------------
  143|    212|                                                        elem_size);
  144|       |
  145|    113|  __m256i ymm_0[8];
  146|    113|  __m256i ymm_1[8];
  147|    113|  __m256i ymm_storeage[8][4];
  148|       |
  149|    196|  for (jj = 0; jj + 31 < nbyte_row; jj += 32) {
  ------------------
  |  Branch (149:16): [True: 83, False: 113]
  ------------------
  150|    707|    for (ii = 0; ii + 3 < elem_size; ii += 4) {
  ------------------
  |  Branch (150:18): [True: 624, False: 83]
  ------------------
  151|  3.12k|      for (hh = 0; hh < 4; hh ++) {
  ------------------
  |  Branch (151:20): [True: 2.49k, False: 624]
  ------------------
  152|       |
  153|  22.4k|        for (kk = 0; kk < 8; kk ++){
  ------------------
  |  Branch (153:22): [True: 19.9k, False: 2.49k]
  ------------------
  154|  19.9k|          ymm_0[kk] = _mm256_loadu_si256((__m256i *) &in_b[
  155|  19.9k|              (ii * 8 + hh * 8 + kk) * nbyte_row + jj]);
  156|  19.9k|        }
  157|       |
  158|  12.4k|        for (kk = 0; kk < 4; kk ++){
  ------------------
  |  Branch (158:22): [True: 9.98k, False: 2.49k]
  ------------------
  159|  9.98k|          ymm_1[kk] = _mm256_unpacklo_epi8(ymm_0[kk * 2],
  160|  9.98k|                                           ymm_0[kk * 2 + 1]);
  161|  9.98k|          ymm_1[kk + 4] = _mm256_unpackhi_epi8(ymm_0[kk * 2],
  162|  9.98k|                                               ymm_0[kk * 2 + 1]);
  163|  9.98k|        }
  164|       |
  165|  7.48k|        for (kk = 0; kk < 2; kk ++){
  ------------------
  |  Branch (165:22): [True: 4.99k, False: 2.49k]
  ------------------
  166|  14.9k|          for (mm = 0; mm < 2; mm ++){
  ------------------
  |  Branch (166:24): [True: 9.98k, False: 4.99k]
  ------------------
  167|  9.98k|            ymm_0[kk * 4 + mm] = _mm256_unpacklo_epi16(
  168|  9.98k|                ymm_1[kk * 4 + mm * 2],
  169|  9.98k|                ymm_1[kk * 4 + mm * 2 + 1]);
  170|  9.98k|            ymm_0[kk * 4 + mm + 2] = _mm256_unpackhi_epi16(
  171|  9.98k|                ymm_1[kk * 4 + mm * 2],
  172|  9.98k|                ymm_1[kk * 4 + mm * 2 + 1]);
  173|  9.98k|          }
  174|  4.99k|        }
  175|       |
  176|  12.4k|        for (kk = 0; kk < 4; kk ++){
  ------------------
  |  Branch (176:22): [True: 9.98k, False: 2.49k]
  ------------------
  177|  9.98k|          ymm_1[kk * 2] = _mm256_unpacklo_epi32(ymm_0[kk * 2],
  178|  9.98k|                                                ymm_0[kk * 2 + 1]);
  179|  9.98k|          ymm_1[kk * 2 + 1] = _mm256_unpackhi_epi32(ymm_0[kk * 2],
  180|  9.98k|                                                    ymm_0[kk * 2 + 1]);
  181|  9.98k|        }
  182|       |
  183|  22.4k|        for (kk = 0; kk < 8; kk ++){
  ------------------
  |  Branch (183:22): [True: 19.9k, False: 2.49k]
  ------------------
  184|  19.9k|          ymm_storeage[kk][hh] = ymm_1[kk];
  185|  19.9k|        }
  186|  2.49k|      }
  187|       |
  188|  5.61k|      for (mm = 0; mm < 8; mm ++) {
  ------------------
  |  Branch (188:20): [True: 4.99k, False: 624]
  ------------------
  189|       |
  190|  24.9k|        for (kk = 0; kk < 4; kk ++){
  ------------------
  |  Branch (190:22): [True: 19.9k, False: 4.99k]
  ------------------
  191|  19.9k|          ymm_0[kk] = ymm_storeage[mm][kk];
  192|  19.9k|        }
  193|       |
  194|  4.99k|        ymm_1[0] = _mm256_unpacklo_epi64(ymm_0[0], ymm_0[1]);
  195|  4.99k|        ymm_1[1] = _mm256_unpacklo_epi64(ymm_0[2], ymm_0[3]);
  196|  4.99k|        ymm_1[2] = _mm256_unpackhi_epi64(ymm_0[0], ymm_0[1]);
  197|  4.99k|        ymm_1[3] = _mm256_unpackhi_epi64(ymm_0[2], ymm_0[3]);
  198|       |
  199|  4.99k|        ymm_0[0] = _mm256_permute2x128_si256(ymm_1[0], ymm_1[1], 32);
  200|  4.99k|        ymm_0[1] = _mm256_permute2x128_si256(ymm_1[2], ymm_1[3], 32);
  201|  4.99k|        ymm_0[2] = _mm256_permute2x128_si256(ymm_1[0], ymm_1[1], 49);
  202|  4.99k|        ymm_0[3] = _mm256_permute2x128_si256(ymm_1[2], ymm_1[3], 49);
  203|       |
  204|  4.99k|        _mm256_storeu_si256((__m256i *) &out_b[
  205|  4.99k|            (jj + mm * 2 + 0 * 16) * nrows + ii * 8], ymm_0[0]);
  206|  4.99k|        _mm256_storeu_si256((__m256i *) &out_b[
  207|  4.99k|            (jj + mm * 2 + 0 * 16 + 1) * nrows + ii * 8], ymm_0[1]);
  208|  4.99k|        _mm256_storeu_si256((__m256i *) &out_b[
  209|  4.99k|            (jj + mm * 2 + 1 * 16) * nrows + ii * 8], ymm_0[2]);
  210|  4.99k|        _mm256_storeu_si256((__m256i *) &out_b[
  211|  4.99k|            (jj + mm * 2 + 1 * 16 + 1) * nrows + ii * 8], ymm_0[3]);
  212|  4.99k|      }
  213|    624|    }
  214|     83|  }
  215|  23.2k|  for (ii = 0; ii < nrows; ii ++ ) {
  ------------------
  |  Branch (215:16): [True: 23.1k, False: 113]
  ------------------
  216|   162k|    for (jj = nbyte_row - nbyte_row % 32; jj < nbyte_row; jj ++) {
  ------------------
  |  Branch (216:43): [True: 139k, False: 23.1k]
  ------------------
  217|   139k|      out_b[jj * nrows + ii] = in_b[ii * nbyte_row + jj];
  218|   139k|    }
  219|  23.1k|  }
  220|    113|  return size * elem_size;
  221|    325|}
bshuf_shuffle_bit_eightelem_AVX:
  242|    325|                                        const size_t elem_size) {
  243|       |
  244|    325|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|    325|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 325]
  |  |  ------------------
  ------------------
  245|       |
  246|       |  // With a bit of care, this could be written such that such that it is
  247|       |  // in_buf = out_buf safe.
  248|    325|  const char* in_b = (const char*) in;
  249|    325|  char* out_b = (char*) out;
  250|       |
  251|    325|  size_t ii, jj, kk;
  252|    325|  size_t nbyte = elem_size * size;
  253|       |
  254|    325|  __m256i ymm;
  255|    325|  int32_t bt;
  256|       |
  257|    325|  if (elem_size <= 2) {
  ------------------
  |  Branch (257:7): [True: 0, False: 325]
  ------------------
  258|       |    // Each 8-byte word holds the 8 bit rows of 8 one-byte elements, or of
  259|       |    // the low or the high bytes of 8 two-byte elements: transposing its
  260|       |    // bits gives those bytes.
  261|      0|    for (ii = 0; ii + 31 < nbyte; ii += 32) {
  ------------------
  |  Branch (261:18): [True: 0, False: 0]
  ------------------
  262|      0|      ymm = trans_bit_8x8_AVX(_mm256_loadu_si256((__m256i *) &in_b[ii]));
  263|      0|      if (elem_size == 2) {
  ------------------
  |  Branch (263:11): [True: 0, False: 0]
  ------------------
  264|       |        // Each 128-bit lane is [low bytes, high bytes] for ONE group of
  265|       |        // eight elements, not [low0, low1, high0, high1] across the vector.
  266|       |        // Lane-local unpacks therefore pair the corresponding bytes.
  267|      0|        ymm = _mm256_unpacklo_epi8(ymm, _mm256_unpackhi_epi64(ymm, ymm));
  268|      0|      }
  269|      0|      _mm256_storeu_si256((__m256i *) &out_b[ii], ymm);
  270|      0|    }
  271|      0|    if (ii < nbyte) {
  ------------------
  |  Branch (271:9): [True: 0, False: 0]
  ------------------
  272|      0|      bshuf_shuffle_bit_eightelem_SSE(&in_b[ii], &out_b[ii],
  273|      0|                                      (nbyte - ii) / elem_size, elem_size);
  274|      0|    }
  275|    325|  } else if (elem_size % 4) {
  ------------------
  |  Branch (275:14): [True: 212, False: 113]
  ------------------
  276|    212|    return bshuf_shuffle_bit_eightelem_SSE(in, out, size, elem_size);
  277|    212|  } else {
  278|    837|    for (jj = 0; jj + 31 < 8 * elem_size; jj += 32) {
  ------------------
  |  Branch (278:18): [True: 724, False: 113]
  ------------------
  279|  25.0k|      for (ii = 0; ii + 8 * elem_size - 1 < nbyte;
  ------------------
  |  Branch (279:20): [True: 24.3k, False: 724]
  ------------------
  280|  24.3k|           ii += 8 * elem_size) {
  281|  24.3k|        ymm = _mm256_loadu_si256((__m256i *) &in_b[ii + jj]);
  282|   219k|        for (kk = 0; kk < 8; kk++) {
  ------------------
  |  Branch (282:22): [True: 194k, False: 24.3k]
  ------------------
  283|   194k|          bt = _mm256_movemask_epi8(ymm);
  284|   194k|          ymm = _mm256_slli_epi16(ymm, 1);
  285|   194k|          size_t ind = (ii + jj / 8 + (7 - kk) * elem_size);
  286|   194k|          * (int32_t *) &out_b[ind] = bt;
  287|   194k|        }
  288|  24.3k|      }
  289|    724|    }
  290|    113|  }
  291|    113|  return size * elem_size;
  292|    325|}
bshuf_untrans_bit_elem_AVX:
  297|  1.20k|                                   const size_t elem_size, void* tmp_buf) {
  298|       |
  299|  1.20k|  int64_t count;
  300|       |
  301|  1.20k|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|  1.20k|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 1.20k]
  |  |  ------------------
  ------------------
  302|       |
  303|  1.20k|  if (elem_size == 1) return bshuf_untrans_bit_byte_SSE(in, out, size);
  ------------------
  |  Branch (303:7): [True: 463, False: 743]
  ------------------
  304|    743|  if ((elem_size == 2 || elem_size == 4 || elem_size == 8 || elem_size == 16)
  ------------------
  |  Branch (304:8): [True: 159, False: 584]
  |  Branch (304:26): [True: 158, False: 426]
  |  Branch (304:44): [True: 78, False: 348]
  |  Branch (304:62): [True: 23, False: 325]
  ------------------
  305|    418|      && size <= INT32_MAX / elem_size) {
  ------------------
  |  Branch (305:10): [True: 418, False: 0]
  ------------------
  306|  2.36k|    for (size_t j = 0; j < elem_size; ++j) {
  ------------------
  |  Branch (306:24): [True: 1.94k, False: 418]
  ------------------
  307|  1.94k|      bshuf_untrans_bit_byte_SSE((const uint8_t*)in + j * size, (uint8_t*)tmp_buf + j * size, size);
  308|  1.94k|    }
  309|    418|    unshuffle_avx2((int32_t)elem_size, (int32_t)(size * elem_size), tmp_buf, out);
  310|    418|    return size * elem_size;
  311|    418|  }
  312|    325|  count = bshuf_trans_byte_bitrow_AVX(in, tmp_buf, size, elem_size);
  313|    325|  CHECK_ERR(count);
  ------------------
  |  |   40|    325|        do {                              \
  |  |   41|    325|          if ((count) < 0)                \
  |  |  ------------------
  |  |  |  Branch (41:15): [True: 0, False: 325]
  |  |  ------------------
  |  |   42|    325|            return count;                 \
  |  |   43|    325|         } while (0)
  |  |  ------------------
  |  |  |  Branch (43:19): [Folded, False: 325]
  |  |  ------------------
  ------------------
  314|    325|  count =  bshuf_shuffle_bit_eightelem_AVX(tmp_buf, out, size, elem_size);
  315|       |
  316|    325|  return count;
  317|    325|}

bshuf_shuffle_bit_eightelem_scal:
  194|    121|        const size_t size, const size_t elem_size) {
  195|       |
  196|    121|  const char *in_b;
  197|    121|  char *out_b;
  198|    121|  uint64_t x, t;
  199|    121|  size_t ii, jj, kk;
  200|    121|  size_t nbyte, out_index;
  201|       |
  202|    121|  uint64_t e=1;
  203|    121|  const int little_endian = *(uint8_t *) &e == 1;
  204|    121|  const size_t elem_skip = little_endian ? elem_size : -elem_size;
  ------------------
  |  Branch (204:28): [True: 121, False: 0]
  ------------------
  205|    121|  const uint64_t elem_offset = little_endian ? 0 : 7 * elem_size;
  ------------------
  |  Branch (205:32): [True: 121, False: 0]
  ------------------
  206|       |
  207|    121|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|    121|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 121]
  |  |  ------------------
  ------------------
  208|       |
  209|    121|  in_b = (const char*) in;
  210|    121|  out_b = (char*) out;
  211|       |
  212|    121|  nbyte = elem_size * size;
  213|       |
  214|  1.60k|  for (jj = 0; jj < 8 * elem_size; jj += 8) {
  ------------------
  |  Branch (214:16): [True: 1.48k, False: 121]
  ------------------
  215|   592k|    for (ii = 0; ii + 8 * elem_size - 1 < nbyte; ii += 8 * elem_size) {
  ------------------
  |  Branch (215:18): [True: 590k, False: 1.48k]
  ------------------
  216|   590k|      x = *((uint64_t*) &in_b[ii + jj]);
  217|   590k|      if (little_endian) {
  ------------------
  |  Branch (217:11): [True: 590k, False: 0]
  ------------------
  218|   590k|        TRANS_BIT_8X8(x, t);
  ------------------
  |  |   54|   590k|#define TRANS_BIT_8X8(x, t) {                                               \
  |  |   55|   590k|        t = (x ^ (x >> 7)) & 0x00AA00AA00AA00AALL;                          \
  |  |   56|   590k|        x = x ^ t ^ (t << 7);                                               \
  |  |   57|   590k|        t = (x ^ (x >> 14)) & 0x0000CCCC0000CCCCLL;                         \
  |  |   58|   590k|        x = x ^ t ^ (t << 14);                                              \
  |  |   59|   590k|        t = (x ^ (x >> 28)) & 0x00000000F0F0F0F0LL;                         \
  |  |   60|   590k|        x = x ^ t ^ (t << 28);                                              \
  |  |   61|   590k|    }
  ------------------
  219|   590k|      } else {
  220|      0|        TRANS_BIT_8X8_BE(x, t);
  ------------------
  |  |   65|      0|#define TRANS_BIT_8X8_BE(x, t) {                                            \
  |  |   66|      0|        t = (x ^ (x >> 9)) & 0x0055005500550055LL;                          \
  |  |   67|      0|        x = x ^ t ^ (t << 9);                                               \
  |  |   68|      0|        t = (x ^ (x >> 18)) & 0x0000333300003333LL;                         \
  |  |   69|      0|        x = x ^ t ^ (t << 18);                                              \
  |  |   70|      0|        t = (x ^ (x >> 36)) & 0x000000000F0F0F0FLL;                         \
  |  |   71|      0|        x = x ^ t ^ (t << 36);                                              \
  |  |   72|      0|    }
  ------------------
  221|      0|      }
  222|  5.31M|      for (kk = 0; kk < 8; kk++) {
  ------------------
  |  Branch (222:20): [True: 4.72M, False: 590k]
  ------------------
  223|  4.72M|        out_index = ii + jj / 8 + elem_offset + kk * elem_skip;
  224|  4.72M|        *((uint8_t*) &out_b[out_index]) = x;
  225|  4.72M|        x = x >> 8;
  226|  4.72M|      }
  227|   590k|    }
  228|  1.48k|  }
  229|    121|  return size * elem_size;
  230|    121|}

bshuf_trans_byte_bitrow_SSE:
  456|    212|                                  const size_t elem_size) {
  457|       |  return trans_byte_bitrow_SSE(in, out, size, elem_size, false);
  458|    212|}
bshuf_untrans_bit_byte_SSE:
  461|  2.40k|int64_t bshuf_untrans_bit_byte_SSE(const void* in, void* out, const size_t size) {
  462|       |  return trans_byte_bitrow_SSE(in, out, size, 1, true);
  463|  2.40k|}
bshuf_shuffle_bit_eightelem_SSE:
  483|    212|                                        const size_t elem_size) {
  484|       |
  485|    212|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|    212|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 212]
  |  |  ------------------
  ------------------
  486|       |
  487|       |  // With a bit of care, this could be written such that such that it is
  488|       |  // in_buf = out_buf safe.
  489|    212|  const char* in_b = (const char*) in;
  490|    212|  char* out_b = (char*) out;
  491|    212|  uint16_t* out_ui16 = (uint16_t*) out;
  492|       |
  493|    212|  size_t ii, jj, kk;
  494|    212|  size_t nbyte = elem_size * size;
  495|       |
  496|    212|  __m128i xmm;
  497|    212|  int32_t bt;
  498|       |
  499|    212|  if (elem_size <= 2) {
  ------------------
  |  Branch (499:7): [True: 0, False: 212]
  ------------------
  500|       |    // Each 8-byte word holds the 8 bit rows of 8 one-byte elements, or of
  501|       |    // the low or the high bytes of 8 two-byte elements: transposing its
  502|       |    // bits gives those bytes.
  503|      0|    for (ii = 0; ii + 15 < nbyte; ii += 16) {
  ------------------
  |  Branch (503:18): [True: 0, False: 0]
  ------------------
  504|      0|      xmm = trans_bit_8x8_SSE(_mm_loadu_si128((__m128i *) &in_b[ii]));
  505|      0|      if (elem_size == 2) {
  ------------------
  |  Branch (505:11): [True: 0, False: 0]
  ------------------
  506|       |        // interleave the low bytes (first word) and high bytes (second word)
  507|      0|        xmm = _mm_unpacklo_epi8(xmm, _mm_unpackhi_epi64(xmm, xmm));
  508|      0|      }
  509|      0|      _mm_storeu_si128((__m128i *) &out_b[ii], xmm);
  510|      0|    }
  511|      0|    if (ii < nbyte) {
  ------------------
  |  Branch (511:9): [True: 0, False: 0]
  ------------------
  512|      0|      bshuf_shuffle_bit_eightelem_scal(&in_b[ii], &out_b[ii],
  513|      0|                                       (nbyte - ii) / elem_size, elem_size);
  514|      0|    }
  515|    212|  } else if (elem_size % 2) {
  ------------------
  |  Branch (515:14): [True: 121, False: 91]
  ------------------
  516|    121|    bshuf_shuffle_bit_eightelem_scal(in, out, size, elem_size);
  517|    121|  } else {
  518|  3.55k|    for (ii = 0; ii + 8 * elem_size - 1 < nbyte;
  ------------------
  |  Branch (518:18): [True: 3.46k, False: 91]
  ------------------
  519|  3.46k|         ii += 8 * elem_size) {
  520|   195k|      for (jj = 0; jj + 15 < 8 * elem_size; jj += 16) {
  ------------------
  |  Branch (520:20): [True: 192k, False: 3.46k]
  ------------------
  521|   192k|        xmm = _mm_loadu_si128((__m128i *) &in_b[ii + jj]);
  522|  1.73M|        for (kk = 0; kk < 8; kk++) {
  ------------------
  |  Branch (522:22): [True: 1.53M, False: 192k]
  ------------------
  523|  1.53M|          bt = _mm_movemask_epi8(xmm);
  524|  1.53M|          xmm = _mm_slli_epi16(xmm, 1);
  525|  1.53M|          size_t ind = (ii + jj / 8 + (7 - kk) * elem_size);
  526|  1.53M|          out_ui16[ind / 2] = bt;
  527|  1.53M|        }
  528|   192k|      }
  529|  3.46k|    }
  530|     91|  }
  531|    212|  return size * elem_size;
  532|    212|}
bitshuffle-sse2.c:trans_byte_bitrow_SSE:
  337|  2.61k|                                     const size_t elem_size, const bool transpose_bits) {
  338|       |
  339|  2.61k|  size_t ii, jj;
  340|  2.61k|  const char* in_b = (const char*) in;
  341|  2.61k|  char* out_b = (char*) out;
  342|       |
  343|  2.61k|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|  2.61k|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 2.61k]
  |  |  ------------------
  ------------------
  344|       |
  345|  2.61k|  size_t nrows = 8 * elem_size;
  346|  2.61k|  size_t nbyte_row = size / 8;
  347|       |
  348|  2.61k|  __m128i a0, b0, c0, d0, e0, f0, g0, h0;
  349|  2.61k|  __m128i a1, b1, c1, d1, e1, f1, g1, h1;
  350|  2.61k|  __m128 *as, *bs, *cs, *ds, *es, *fs, *gs, *hs;
  351|       |
  352|  7.79k|  for (ii = 0; ii + 7 < nrows; ii += 8) {
  ------------------
  |  Branch (352:16): [True: 5.17k, False: 2.61k]
  ------------------
  353|   185k|    for (jj = 0; jj + 15 < nbyte_row; jj += 16) {
  ------------------
  |  Branch (353:18): [True: 180k, False: 5.17k]
  ------------------
  354|   180k|      a0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 0)*nbyte_row + jj]);
  355|   180k|      b0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 1)*nbyte_row + jj]);
  356|   180k|      c0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 2)*nbyte_row + jj]);
  357|   180k|      d0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 3)*nbyte_row + jj]);
  358|   180k|      e0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 4)*nbyte_row + jj]);
  359|   180k|      f0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 5)*nbyte_row + jj]);
  360|   180k|      g0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 6)*nbyte_row + jj]);
  361|   180k|      h0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 7)*nbyte_row + jj]);
  362|       |
  363|       |
  364|   180k|      a1 = _mm_unpacklo_epi8(a0, b0);
  365|   180k|      b1 = _mm_unpacklo_epi8(c0, d0);
  366|   180k|      c1 = _mm_unpacklo_epi8(e0, f0);
  367|   180k|      d1 = _mm_unpacklo_epi8(g0, h0);
  368|   180k|      e1 = _mm_unpackhi_epi8(a0, b0);
  369|   180k|      f1 = _mm_unpackhi_epi8(c0, d0);
  370|   180k|      g1 = _mm_unpackhi_epi8(e0, f0);
  371|   180k|      h1 = _mm_unpackhi_epi8(g0, h0);
  372|       |
  373|       |
  374|   180k|      a0 = _mm_unpacklo_epi16(a1, b1);
  375|   180k|      b0 = _mm_unpacklo_epi16(c1, d1);
  376|   180k|      c0 = _mm_unpackhi_epi16(a1, b1);
  377|   180k|      d0 = _mm_unpackhi_epi16(c1, d1);
  378|       |
  379|   180k|      e0 = _mm_unpacklo_epi16(e1, f1);
  380|   180k|      f0 = _mm_unpacklo_epi16(g1, h1);
  381|   180k|      g0 = _mm_unpackhi_epi16(e1, f1);
  382|   180k|      h0 = _mm_unpackhi_epi16(g1, h1);
  383|       |
  384|       |
  385|   180k|      a1 = _mm_unpacklo_epi32(a0, b0);
  386|   180k|      b1 = _mm_unpackhi_epi32(a0, b0);
  387|       |
  388|   180k|      c1 = _mm_unpacklo_epi32(c0, d0);
  389|   180k|      d1 = _mm_unpackhi_epi32(c0, d0);
  390|       |
  391|   180k|      e1 = _mm_unpacklo_epi32(e0, f0);
  392|   180k|      f1 = _mm_unpackhi_epi32(e0, f0);
  393|       |
  394|   180k|      g1 = _mm_unpacklo_epi32(g0, h0);
  395|   180k|      h1 = _mm_unpackhi_epi32(g0, h0);
  396|       |
  397|   180k|      if (transpose_bits) {
  ------------------
  |  Branch (397:11): [True: 120k, False: 60.1k]
  ------------------
  398|   120k|#define STORE_BYTES(v, k) _mm_storeu_si128((__m128i*)(out_b + (jj + (k)) * 8), trans_bit_8x8_SSE(v))
  399|   120k|        STORE_BYTES(a1, 0); STORE_BYTES(b1, 2);
  ------------------
  |  |  398|   120k|#define STORE_BYTES(v, k) _mm_storeu_si128((__m128i*)(out_b + (jj + (k)) * 8), trans_bit_8x8_SSE(v))
  ------------------
                      STORE_BYTES(a1, 0); STORE_BYTES(b1, 2);
  ------------------
  |  |  398|   120k|#define STORE_BYTES(v, k) _mm_storeu_si128((__m128i*)(out_b + (jj + (k)) * 8), trans_bit_8x8_SSE(v))
  ------------------
  400|   120k|        STORE_BYTES(c1, 4); STORE_BYTES(d1, 6);
  ------------------
  |  |  398|   120k|#define STORE_BYTES(v, k) _mm_storeu_si128((__m128i*)(out_b + (jj + (k)) * 8), trans_bit_8x8_SSE(v))
  ------------------
                      STORE_BYTES(c1, 4); STORE_BYTES(d1, 6);
  ------------------
  |  |  398|   120k|#define STORE_BYTES(v, k) _mm_storeu_si128((__m128i*)(out_b + (jj + (k)) * 8), trans_bit_8x8_SSE(v))
  ------------------
  401|   120k|        STORE_BYTES(e1, 8); STORE_BYTES(f1, 10);
  ------------------
  |  |  398|   120k|#define STORE_BYTES(v, k) _mm_storeu_si128((__m128i*)(out_b + (jj + (k)) * 8), trans_bit_8x8_SSE(v))
  ------------------
                      STORE_BYTES(e1, 8); STORE_BYTES(f1, 10);
  ------------------
  |  |  398|   120k|#define STORE_BYTES(v, k) _mm_storeu_si128((__m128i*)(out_b + (jj + (k)) * 8), trans_bit_8x8_SSE(v))
  ------------------
  402|   120k|        STORE_BYTES(g1, 12); STORE_BYTES(h1, 14);
  ------------------
  |  |  398|   120k|#define STORE_BYTES(v, k) _mm_storeu_si128((__m128i*)(out_b + (jj + (k)) * 8), trans_bit_8x8_SSE(v))
  ------------------
                      STORE_BYTES(g1, 12); STORE_BYTES(h1, 14);
  ------------------
  |  |  398|   120k|#define STORE_BYTES(v, k) _mm_storeu_si128((__m128i*)(out_b + (jj + (k)) * 8), trans_bit_8x8_SSE(v))
  ------------------
  403|   120k|#undef STORE_BYTES
  404|   120k|        continue;
  405|   120k|      }
  406|       |      // We don't have a storeh instruction for integers, so interpret
  407|       |      // as a float. Have a storel (_mm_storel_epi64).
  408|  60.1k|      as = (__m128 *) &a1;
  409|  60.1k|      bs = (__m128 *) &b1;
  410|  60.1k|      cs = (__m128 *) &c1;
  411|  60.1k|      ds = (__m128 *) &d1;
  412|  60.1k|      es = (__m128 *) &e1;
  413|  60.1k|      fs = (__m128 *) &f1;
  414|  60.1k|      gs = (__m128 *) &g1;
  415|  60.1k|      hs = (__m128 *) &h1;
  416|       |
  417|  60.1k|      _mm_storel_pi((__m64 *) &out_b[(jj + 0) * nrows + ii], *as);
  418|  60.1k|      _mm_storel_pi((__m64 *) &out_b[(jj + 2) * nrows + ii], *bs);
  419|  60.1k|      _mm_storel_pi((__m64 *) &out_b[(jj + 4) * nrows + ii], *cs);
  420|  60.1k|      _mm_storel_pi((__m64 *) &out_b[(jj + 6) * nrows + ii], *ds);
  421|  60.1k|      _mm_storel_pi((__m64 *) &out_b[(jj + 8) * nrows + ii], *es);
  422|  60.1k|      _mm_storel_pi((__m64 *) &out_b[(jj + 10) * nrows + ii], *fs);
  423|  60.1k|      _mm_storel_pi((__m64 *) &out_b[(jj + 12) * nrows + ii], *gs);
  424|  60.1k|      _mm_storel_pi((__m64 *) &out_b[(jj + 14) * nrows + ii], *hs);
  425|       |
  426|  60.1k|      _mm_storeh_pi((__m64 *) &out_b[(jj + 1) * nrows + ii], *as);
  427|  60.1k|      _mm_storeh_pi((__m64 *) &out_b[(jj + 3) * nrows + ii], *bs);
  428|  60.1k|      _mm_storeh_pi((__m64 *) &out_b[(jj + 5) * nrows + ii], *cs);
  429|  60.1k|      _mm_storeh_pi((__m64 *) &out_b[(jj + 7) * nrows + ii], *ds);
  430|  60.1k|      _mm_storeh_pi((__m64 *) &out_b[(jj + 9) * nrows + ii], *es);
  431|  60.1k|      _mm_storeh_pi((__m64 *) &out_b[(jj + 11) * nrows + ii], *fs);
  432|  60.1k|      _mm_storeh_pi((__m64 *) &out_b[(jj + 13) * nrows + ii], *gs);
  433|  60.1k|      _mm_storeh_pi((__m64 *) &out_b[(jj + 15) * nrows + ii], *hs);
  434|  60.1k|    }
  435|  25.8k|    for (jj = nbyte_row - nbyte_row % 16; jj < nbyte_row; jj ++) {
  ------------------
  |  Branch (435:43): [True: 20.6k, False: 5.17k]
  ------------------
  436|  20.6k|      out_b[jj * nrows + ii + 0] = in_b[(ii + 0)*nbyte_row + jj];
  437|  20.6k|      out_b[jj * nrows + ii + 1] = in_b[(ii + 1)*nbyte_row + jj];
  438|  20.6k|      out_b[jj * nrows + ii + 2] = in_b[(ii + 2)*nbyte_row + jj];
  439|  20.6k|      out_b[jj * nrows + ii + 3] = in_b[(ii + 3)*nbyte_row + jj];
  440|  20.6k|      out_b[jj * nrows + ii + 4] = in_b[(ii + 4)*nbyte_row + jj];
  441|  20.6k|      out_b[jj * nrows + ii + 5] = in_b[(ii + 5)*nbyte_row + jj];
  442|  20.6k|      out_b[jj * nrows + ii + 6] = in_b[(ii + 6)*nbyte_row + jj];
  443|  20.6k|      out_b[jj * nrows + ii + 7] = in_b[(ii + 7)*nbyte_row + jj];
  444|  20.6k|      if (transpose_bits) {
  ------------------
  |  Branch (444:11): [True: 8.21k, False: 12.4k]
  ------------------
  445|  8.21k|        uint64_t x, t;
  446|  8.21k|        memcpy(&x, out_b + jj * 8, 8);
  447|  8.21k|        TRANS_BIT_8X8(x, t);
  ------------------
  |  |   54|  8.21k|#define TRANS_BIT_8X8(x, t) {                                               \
  |  |   55|  8.21k|        t = (x ^ (x >> 7)) & 0x00AA00AA00AA00AALL;                          \
  |  |   56|  8.21k|        x = x ^ t ^ (t << 7);                                               \
  |  |   57|  8.21k|        t = (x ^ (x >> 14)) & 0x0000CCCC0000CCCCLL;                         \
  |  |   58|  8.21k|        x = x ^ t ^ (t << 14);                                              \
  |  |   59|  8.21k|        t = (x ^ (x >> 28)) & 0x00000000F0F0F0F0LL;                         \
  |  |   60|  8.21k|        x = x ^ t ^ (t << 28);                                              \
  |  |   61|  8.21k|    }
  ------------------
  448|  8.21k|        memcpy(out_b + jj * 8, &x, 8);
  449|  8.21k|      }
  450|  20.6k|    }
  451|  5.17k|  }
  452|  2.61k|  return size * elem_size;
  453|  2.61k|}
bitshuffle-sse2.c:trans_bit_8x8_SSE:
  466|   962k|static inline __m128i trans_bit_8x8_SSE(__m128i x) {
  467|   962k|  __m128i t;
  468|   962k|  t = _mm_and_si128(_mm_xor_si128(x, _mm_srli_epi64(x, 7)),
  469|   962k|                    _mm_set1_epi64x(0x00AA00AA00AA00AALL));
  470|   962k|  x = _mm_xor_si128(x, _mm_xor_si128(t, _mm_slli_epi64(t, 7)));
  471|   962k|  t = _mm_and_si128(_mm_xor_si128(x, _mm_srli_epi64(x, 14)),
  472|   962k|                    _mm_set1_epi64x(0x0000CCCC0000CCCCLL));
  473|   962k|  x = _mm_xor_si128(x, _mm_xor_si128(t, _mm_slli_epi64(t, 14)));
  474|   962k|  t = _mm_and_si128(_mm_xor_si128(x, _mm_srli_epi64(x, 28)),
  475|   962k|                    _mm_set1_epi64x(0x00000000F0F0F0F0LL));
  476|   962k|  x = _mm_xor_si128(x, _mm_xor_si128(t, _mm_slli_epi64(t, 28)));
  477|   962k|  return x;
  478|   962k|}

blosc2.c:blosc2_checked_mul_size:
   41|  15.8k|static inline bool blosc2_checked_mul_size(size_t a, size_t b, size_t *out) {
   42|  15.8k|  if (a != 0 && b > SIZE_MAX / a) {
  ------------------
  |  Branch (42:7): [True: 15.8k, False: 0]
  |  Branch (42:17): [True: 0, False: 15.8k]
  ------------------
   43|      0|    return false;
   44|      0|  }
   45|  15.8k|  if (out != NULL) {
  ------------------
  |  Branch (45:7): [True: 15.8k, False: 0]
  ------------------
   46|  15.8k|    *out = a * b;
   47|  15.8k|  }
   48|       |  return true;
   49|  15.8k|}
blosc2.c:blosc2_checked_add_size:
   31|  15.9k|static inline bool blosc2_checked_add_size(size_t a, size_t b, size_t *out) {
   32|  15.9k|  if (a > SIZE_MAX - b) {
  ------------------
  |  Branch (32:7): [True: 0, False: 15.9k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|  15.9k|  if (out != NULL) {
  ------------------
  |  Branch (35:7): [True: 15.9k, False: 0]
  ------------------
   36|  15.9k|    *out = a + b;
   37|  15.9k|  }
   38|       |  return true;
   39|  15.9k|}

blosc2.c:is_little_endian:
   42|   133k|static bool is_little_endian(void) {
   43|   133k|  static const int i = 1;
   44|   133k|  char* p = (char*)&i;
   45|       |
   46|   133k|  if (p[0] == 1) {
  ------------------
  |  Branch (46:7): [True: 133k, False: 0]
  ------------------
   47|   133k|    return true;
   48|   133k|  }
   49|      0|  else {
   50|       |    return false;
   51|      0|  }
   52|   133k|}
blosc2.c:load_lib:
  439|      4|static inline void* load_lib(char *plugin_name, char *libpath) {
  440|      4|  if (!blosc2_valid_plugin_name(plugin_name)) {
  ------------------
  |  Branch (440:7): [True: 0, False: 4]
  ------------------
  441|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  442|      0|    return NULL;
  443|      0|  }
  444|       |    // Attempt to directly load the library by name
  445|       |#if defined(_WIN32)
  446|       |    // Windows dynamic library (DLL) format
  447|       |    snprintf(libpath, PATH_MAX, "blosc2_%s.dll", plugin_name);
  448|       |#else
  449|       |    // Unix/Linux/Mac OS dynamic library (.so) format
  450|      4|    snprintf(libpath, PATH_MAX, "libblosc2_%s.so", plugin_name);
  451|      4|#endif
  452|      4|    void* loaded_lib = dlopen(libpath, RTLD_LAZY);
  453|      4|    if (loaded_lib != NULL) {
  ------------------
  |  Branch (453:9): [True: 0, False: 4]
  ------------------
  454|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  455|      0|        return loaded_lib;
  456|      4|    } else {
  457|       |#if defined(_WIN32)
  458|       |        BLOSC_TRACE_INFO("Failed to load %s directly, error: %lu\n", libpath, GetLastError());
  459|       |#else
  460|      4|        BLOSC_TRACE_INFO("Failed to load %s directly, error: %s\n", libpath, dlerror());
  ------------------
  |  |   95|      4|#define BLOSC_TRACE_INFO(msg, ...) BLOSC_TRACE(info, 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  461|      4|#endif
  462|      4|    }
  463|       |    // If direct loading fails, fallback to using Python to find the library path
  464|      4|    if (get_libpath(plugin_name, libpath, "") < 0 && get_libpath(plugin_name, libpath, "3") < 0) {
  ------------------
  |  Branch (464:9): [True: 4, False: 0]
  |  Branch (464:54): [True: 4, False: 0]
  ------------------
  465|      4|        BLOSC_TRACE_ERROR("Problems when running python or python3 for getting plugin path");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  466|      4|        return NULL;
  467|      4|    }
  468|       |
  469|      0|    if (strlen(libpath) == 0) {
  ------------------
  |  Branch (469:9): [True: 0, False: 0]
  ------------------
  470|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  471|      0|        return NULL;
  472|      0|    }
  473|       |
  474|       |    // Try to load the library again with the path from Python
  475|      0|    loaded_lib = dlopen(libpath, RTLD_LAZY);
  476|      0|    if (loaded_lib == NULL) {
  ------------------
  |  Branch (476:9): [True: 0, False: 0]
  ------------------
  477|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  478|      0|    } else {
  479|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  480|      0|    }
  481|       |
  482|      0|    return loaded_lib;
  483|      0|}
blosc2.c:blosc2_valid_plugin_name:
  397|     12|static inline bool blosc2_valid_plugin_name(const char *plugin_name) {
  398|     12|  if (plugin_name == NULL || plugin_name[0] == '\0') {
  ------------------
  |  Branch (398:7): [True: 0, False: 12]
  |  Branch (398:30): [True: 0, False: 12]
  ------------------
  399|      0|    return false;
  400|      0|  }
  401|     78|  for (const unsigned char *p = (const unsigned char *)plugin_name; *p != '\0'; ++p) {
  ------------------
  |  Branch (401:69): [True: 66, False: 12]
  ------------------
  402|     66|    if (!isalnum(*p) && *p != '_') {
  ------------------
  |  Branch (402:9): [True: 0, False: 66]
  |  Branch (402:25): [True: 0, False: 0]
  ------------------
  403|      0|      return false;
  404|      0|    }
  405|     66|  }
  406|     12|  return true;
  407|     12|}
blosc2.c:get_libpath:
  410|      8|static inline int get_libpath(char *plugin_name, char *libpath, char *python_version) {
  411|      8|  BLOSC_TRACE_INFO("Trying to get plugin path with python%s\n", python_version);
  ------------------
  |  |   95|      8|#define BLOSC_TRACE_INFO(msg, ...) BLOSC_TRACE(info, 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  412|      8|  char python_cmd[PATH_MAX] = {0};
  413|      8|  if (!blosc2_valid_plugin_name(plugin_name)) {
  ------------------
  |  Branch (413:7): [True: 0, False: 8]
  ------------------
  414|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  415|      0|    return BLOSC2_ERROR_INVALID_PARAM;
  416|      0|  }
  417|      8|  int written = snprintf(python_cmd, sizeof(python_cmd),
  418|      8|                         "python%s -c \"import blosc2_%s; blosc2_%s.print_libpath()\"",
  419|      8|                         python_version, plugin_name, plugin_name);
  420|      8|  if (written < 0 || (size_t)written >= sizeof(python_cmd)) {
  ------------------
  |  Branch (420:7): [True: 0, False: 8]
  |  Branch (420:22): [True: 0, False: 8]
  ------------------
  421|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  422|      0|    return BLOSC2_ERROR_FAILURE;
  423|      0|  }
  424|      8|  FILE *fp = popen(python_cmd, "r");
  425|      8|  if (fp == NULL) {
  ------------------
  |  Branch (425:7): [True: 0, False: 8]
  ------------------
  426|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  427|      0|    return BLOSC2_ERROR_FAILURE;
  428|      0|  }
  429|      8|  if (fgets(libpath, PATH_MAX, fp) == NULL) {
  ------------------
  |  Branch (429:7): [True: 8, False: 0]
  ------------------
  430|      8|    BLOSC_TRACE_ERROR("Could not read python output");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  431|      8|    pclose(fp);
  432|      8|    return BLOSC2_ERROR_FAILURE;
  433|      8|  }
  434|      0|  pclose(fp);
  435|       |
  436|      0|  return BLOSC2_ERROR_SUCCESS;
  437|      8|}
blosc2.c:sw32_:
  216|  56.6k|static inline int32_t sw32_(const void* pa) {
  217|  56.6k|  int32_t idest;
  218|       |
  219|  56.6k|  bool little_endian = is_little_endian();
  220|  56.6k|  if (little_endian) {
  ------------------
  |  Branch (220:7): [True: 56.6k, False: 0]
  ------------------
  221|  56.6k|    memcpy(&idest, pa, sizeof(idest));
  222|  56.6k|  }
  223|      0|  else {
  224|      0|#if defined (__GNUC__)
  225|      0|    return __builtin_bswap32(*(unsigned int *)pa);
  226|       |#elif defined (_MSC_VER) /* Visual Studio */
  227|       |    return _byteswap_ulong(*(unsigned int *)pa);
  228|       |#else
  229|       |    const uint8_t *pa_ = (const uint8_t *)pa;
  230|       |    uint8_t *dest = (uint8_t *)&idest;
  231|       |    dest[0] = pa_[3];
  232|       |    dest[1] = pa_[2];
  233|       |    dest[2] = pa_[1];
  234|       |    dest[3] = pa_[0];
  235|       |#endif
  236|      0|  }
  237|  56.6k|  return idest;
  238|  56.6k|}

do_nothing:
  797|   295k|int do_nothing(const blosc2_context* context, int i, char cmode) {
  798|   295k|  uint8_t filter = context->filters[i];
  799|   295k|  if (filter == BLOSC_SHUFFLE) {
  ------------------
  |  Branch (799:7): [True: 50.1k, False: 244k]
  ------------------
  800|       |    // Shuffling single bytes is the identity, so skip it instead of copying the block
  801|  50.1k|    return shuffle_size(context, i) == 1;
  802|  50.1k|  }
  803|   244k|  if (cmode == 'c') {
  ------------------
  |  Branch (803:7): [True: 0, False: 244k]
  ------------------
  804|      0|    return (filter == BLOSC_NOFILTER);
  805|   244k|  } else {
  806|       |    // TRUNC_PREC do not have to be applied during decompression
  807|   244k|    return ((filter == BLOSC_NOFILTER) || (filter == BLOSC_TRUNC_PREC));
  ------------------
  |  Branch (807:13): [True: 126k, False: 118k]
  |  Branch (807:43): [True: 20.7k, False: 97.2k]
  ------------------
  808|   244k|  }
  809|   244k|}
next_filter:
  812|  44.0k|int next_filter(const blosc2_context* context, int current_filter, char cmode) {
  813|  85.7k|  for (int i = current_filter - 1; i >= 0; i--) {
  ------------------
  |  Branch (813:36): [True: 85.7k, False: 0]
  ------------------
  814|  85.7k|    if (!do_nothing(context, i, cmode)) {
  ------------------
  |  Branch (814:9): [True: 44.0k, False: 41.7k]
  ------------------
  815|  44.0k|      return context->filters[i];
  816|  44.0k|    }
  817|  85.7k|  }
  818|      0|  return BLOSC_NOFILTER;
  819|  44.0k|}
last_filter:
  822|  25.5k|int last_filter(const blosc2_context* context, char cmode) {
  823|  25.5k|  int last_index = -1;
  824|   178k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (824:40): [True: 153k, False: 25.5k]
  ------------------
  825|   153k|    if (!do_nothing(context, i, cmode))  {
  ------------------
  |  Branch (825:9): [True: 62.3k, False: 90.7k]
  ------------------
  826|  62.3k|      last_index = i;
  827|  62.3k|    }
  828|   153k|  }
  829|  25.5k|  return last_index;
  830|  25.5k|}
read_chunk_header:
  909|  76.8k|{
  910|  76.8k|  memset(header, 0, sizeof(blosc_header));
  911|       |
  912|  76.8k|  if (srcsize < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (912:7): [True: 0, False: 76.8k]
  ------------------
  913|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  914|      0|    return BLOSC2_ERROR_READ_BUFFER;
  915|      0|  }
  916|       |
  917|  76.8k|  memcpy(header, src, BLOSC_MIN_HEADER_LENGTH);
  918|       |
  919|  76.8k|  bool little_endian = is_little_endian();
  920|       |
  921|  76.8k|  if (!little_endian) {
  ------------------
  |  Branch (921:7): [True: 0, False: 76.8k]
  ------------------
  922|      0|    header->nbytes = bswap32_(header->nbytes);
  923|      0|    header->blocksize = bswap32_(header->blocksize);
  924|      0|    header->cbytes = bswap32_(header->cbytes);
  925|      0|  }
  926|       |
  927|  76.8k|  if (header->cbytes < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (927:7): [True: 31, False: 76.8k]
  ------------------
  928|     31|    BLOSC_TRACE_ERROR("`cbytes` is too small to read min header.");
  ------------------
  |  |   93|     31|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     31|    do {                                            \
  |  |  |  |   98|     31|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     31|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 31, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     31|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  929|     31|    return BLOSC2_ERROR_INVALID_HEADER;
  930|     31|  }
  931|  76.8k|  if (header->blocksize <= 0) {
  ------------------
  |  Branch (931:7): [True: 36, False: 76.8k]
  ------------------
  932|     36|    BLOSC_TRACE_ERROR("`blocksize` is zero");
  ------------------
  |  |   93|     36|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     36|    do {                                            \
  |  |  |  |   98|     36|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     36|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 36, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     36|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  933|     36|    return BLOSC2_ERROR_INVALID_HEADER;
  934|     36|  }
  935|  76.8k|  if (header->blocksize > BLOSC2_MAXBLOCKSIZE) {
  ------------------
  |  Branch (935:7): [True: 6, False: 76.7k]
  ------------------
  936|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  937|      6|    return BLOSC2_ERROR_INVALID_HEADER;
  938|      6|  }
  939|  76.7k|  if (header->typesize == 0) {
  ------------------
  |  Branch (939:7): [True: 6, False: 76.7k]
  ------------------
  940|      6|    BLOSC_TRACE_ERROR("`typesize` is zero.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  941|      6|    return BLOSC2_ERROR_INVALID_HEADER;
  942|      6|  }
  943|       |
  944|       |  /* Read extended header if it is wanted */
  945|  76.7k|  if ((extended_header) && (header->flags & BLOSC_DOSHUFFLE) && (header->flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (945:7): [True: 16.1k, False: 60.6k]
  |  Branch (945:28): [True: 9.71k, False: 6.43k]
  |  Branch (945:65): [True: 7.44k, False: 2.27k]
  ------------------
  946|  7.44k|    if (header->cbytes < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (946:9): [True: 15, False: 7.43k]
  ------------------
  947|     15|      BLOSC_TRACE_ERROR("`cbytes` is too small to read extended header.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  948|     15|      return BLOSC2_ERROR_INVALID_HEADER;
  949|     15|    }
  950|  7.43k|    if (srcsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (950:9): [True: 0, False: 7.43k]
  ------------------
  951|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  952|      0|      return BLOSC2_ERROR_READ_BUFFER;
  953|      0|    }
  954|       |
  955|  7.43k|    memcpy((uint8_t *)header + BLOSC_MIN_HEADER_LENGTH, src + BLOSC_MIN_HEADER_LENGTH,
  956|  7.43k|      BLOSC_EXTENDED_HEADER_LENGTH - BLOSC_MIN_HEADER_LENGTH);
  957|       |
  958|  7.43k|    if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) && (header->blosc2_flags != 0)) {
  ------------------
  |  Branch (958:9): [True: 318, False: 7.11k]
  |  Branch (958:55): [True: 151, False: 167]
  ------------------
  959|    151|      int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  960|    151|      if (special_type != 0) {
  ------------------
  |  Branch (960:11): [True: 5, False: 146]
  ------------------
  961|      5|        BLOSC_TRACE_ERROR("VL-block chunks cannot use special chunk encodings.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  962|      5|        return BLOSC2_ERROR_INVALID_HEADER;
  963|      5|      }
  964|    151|    }
  965|       |
  966|  7.42k|    int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  967|  7.42k|    if (special_type != 0) {
  ------------------
  |  Branch (967:9): [True: 248, False: 7.17k]
  ------------------
  968|    248|      if (special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (968:11): [True: 112, False: 136]
  ------------------
  969|       |        // In this case, the actual type size must be derived from the cbytes
  970|    112|        int32_t typesize = header->cbytes - BLOSC_EXTENDED_HEADER_LENGTH;
  971|    112|        if (typesize <= 0) {
  ------------------
  |  Branch (971:13): [True: 1, False: 111]
  ------------------
  972|      1|          BLOSC_TRACE_ERROR("`typesize` is zero or negative");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  973|      1|          return BLOSC2_ERROR_INVALID_HEADER;
  974|      1|        }
  975|    111|        if (typesize > BLOSC2_MAXTYPESIZE) {
  ------------------
  |  Branch (975:13): [True: 0, False: 111]
  ------------------
  976|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  977|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  978|      0|        }
  979|    111|        if (typesize > header->nbytes) {
  ------------------
  |  Branch (979:13): [True: 9, False: 102]
  ------------------
  980|      9|          BLOSC_TRACE_ERROR("`typesize` is greater than `nbytes`");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  981|      9|          return BLOSC2_ERROR_INVALID_HEADER;
  982|      9|        }
  983|    102|        if (header->nbytes % typesize != 0) {
  ------------------
  |  Branch (983:13): [True: 5, False: 97]
  ------------------
  984|      5|          BLOSC_TRACE_ERROR("`nbytes` is not a multiple of typesize");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  985|      5|          return BLOSC2_ERROR_INVALID_HEADER;
  986|      5|        }
  987|    102|      }
  988|    136|      else {
  989|       |        // All-zero chunks fill with memset, which works regardless of element alignment.
  990|    136|        if (special_type != BLOSC2_SPECIAL_ZERO
  ------------------
  |  Branch (990:13): [True: 90, False: 46]
  ------------------
  991|     90|            && header->nbytes % header->typesize != 0) {
  ------------------
  |  Branch (991:16): [True: 1, False: 89]
  ------------------
  992|      1|          BLOSC_TRACE_ERROR("`nbytes` is not a multiple of typesize");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  993|      1|          return BLOSC2_ERROR_INVALID_HEADER;
  994|      1|        }
  995|    136|      }
  996|    248|    }
  997|       |    // The number of filters depends on the version of the header. Blosc2 alpha series
  998|       |    // did not initialize filters to zero beyond the max supported.
  999|  7.41k|    if (header->version == BLOSC2_VERSION_FORMAT_ALPHA) {
  ------------------
  |  Branch (999:9): [True: 1.04k, False: 6.37k]
  ------------------
 1000|  1.04k|      header->filters[5] = 0;
 1001|  1.04k|      header->filters_meta[5] = 0;
 1002|  1.04k|    }
 1003|  7.41k|  }
 1004|  69.3k|  else {
 1005|  69.3k|    flags_to_filters(header->flags, header->filters);
 1006|  69.3k|  }
 1007|  76.7k|  if (header->version > BLOSC2_VERSION_FORMAT &&
  ------------------
  |  Branch (1007:7): [True: 24.8k, False: 51.8k]
  ------------------
 1008|  24.8k|      (header->blosc2_flags2 & (uint8_t)~BLOSC2_VL_BLOCKS) != 0) {
  ------------------
  |  Branch (1008:7): [True: 12, False: 24.8k]
  ------------------
 1009|       |    /* Version from future with unsupported chunk features. */
 1010|     12|    return BLOSC2_ERROR_VERSION_SUPPORT;
 1011|     12|  }
 1012|  76.7k|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0 &&
  ------------------
  |  Branch (1012:7): [True: 310, False: 76.4k]
  ------------------
 1013|    310|      (header->flags & (uint8_t)BLOSC_MEMCPYED) != 0) {
  ------------------
  |  Branch (1013:7): [True: 2, False: 308]
  ------------------
 1014|      2|    BLOSC_TRACE_ERROR("VL-block chunks cannot be memcpyed.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1015|      2|    return BLOSC2_ERROR_INVALID_HEADER;
 1016|      2|  }
 1017|  76.7k|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) == 0 &&
  ------------------
  |  Branch (1017:7): [True: 76.4k, False: 308]
  ------------------
 1018|  76.4k|      header->nbytes > 0 && header->blocksize > header->nbytes) {
  ------------------
  |  Branch (1018:7): [True: 76.3k, False: 114]
  |  Branch (1018:29): [True: 42.2k, False: 34.0k]
  ------------------
 1019|  42.2k|    header->blocksize = header->nbytes;
 1020|  42.2k|  }
 1021|  76.7k|  return 0;
 1022|  76.7k|}
fill_codec:
 1178|      4|int fill_codec(blosc2_codec *codec) {
 1179|      4|  int rc = BLOSC2_ERROR_SUCCESS;
 1180|      4|  static_lock(&g_plugin_lock);
  ------------------
  |  |  132|      4|#define static_lock(l) pthread_mutex_lock(l)
  ------------------
 1181|       |  /* Unless another thread loaded it meanwhile */
 1182|      4|  if (codec->encoder == NULL || codec->decoder == NULL) {
  ------------------
  |  Branch (1182:7): [True: 4, False: 0]
  |  Branch (1182:33): [True: 0, False: 0]
  ------------------
 1183|      4|    rc = load_codec_locked(codec);
 1184|      4|  }
 1185|      4|  static_unlock(&g_plugin_lock);
  ------------------
  |  |  133|      4|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 1186|      4|  return rc;
 1187|      4|}
pipeline_backward:
 1824|  10.5k|                      uint8_t* tmp2, int last_filter_index, int32_t nblock) {
 1825|  10.5k|  (void)tmp2;
 1826|  10.5k|  blosc2_context* context = thread_context->parent_context;
 1827|  10.5k|  int32_t typesize = context->typesize;
 1828|  10.5k|  uint8_t* filters = context->filters;
 1829|  10.5k|  uint8_t* filters_meta = context->filters_meta;
 1830|  10.5k|  uint8_t* _src = (next_filter(context, BLOSC2_MAX_FILTERS, 'd') == BLOSC_DELTA &&
  ------------------
  |  Branch (1830:20): [True: 2.91k, False: 7.68k]
  ------------------
 1831|  7.68k|                   context->postfilter == NULL) ? (dest + offset) : src;
  ------------------
  |  Branch (1831:20): [True: 2.91k, False: 0]
  ------------------
 1832|  10.5k|  uint8_t* _dest = tmp;
 1833|  10.5k|  int errcode = 0;
 1834|       |
 1835|  56.2k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (1835:40): [True: 56.2k, False: 0]
  ------------------
 1836|  56.2k|    if (do_nothing(context, i, 'd')) {
  ------------------
  |  Branch (1836:9): [True: 23.0k, False: 33.2k]
  ------------------
 1837|  23.0k|      continue;
 1838|  23.0k|    }
 1839|  33.2k|    int first_index = i;
 1840|  33.2k|#ifdef BLOSC_USE_FUSED_SHUFFLE_BYTEDELTA
 1841|  33.2k|    int fused_size = fused_shuffle_bytedelta_size(context, i - 1);
 1842|  33.2k|    if (fused_size) {
  ------------------
  |  Branch (1842:9): [True: 580, False: 32.6k]
  ------------------
 1843|    580|      first_index = i - 1;
 1844|    580|    }
 1845|  33.2k|#endif
 1846|       |    // Delta filter requires the whole chunk ready. A fused inverse ends at
 1847|       |    // SHUFFLE's position, so select its sink using the pair's first index.
 1848|  33.2k|    int last_copy_filter = (last_filter_index == first_index) || (filters[i] == BLOSC_DELTA) ||
  ------------------
  |  Branch (1848:28): [True: 10.4k, False: 22.7k]
  |  Branch (1848:66): [True: 8.16k, False: 14.5k]
  ------------------
 1849|  14.5k|                           (next_filter(context, first_index, 'd') == BLOSC_DELTA);
  ------------------
  |  Branch (1849:28): [True: 4.03k, False: 10.5k]
  ------------------
 1850|  33.2k|    if (last_copy_filter && context->postfilter == NULL &&
  ------------------
  |  Branch (1850:9): [True: 22.6k, False: 10.5k]
  |  Branch (1850:29): [True: 22.6k, False: 0]
  ------------------
 1851|  22.6k|        (filters[i] == BLOSC_DELTA || _src != dest + offset)) {
  ------------------
  |  Branch (1851:10): [True: 11.7k, False: 10.9k]
  |  Branch (1851:39): [True: 8.64k, False: 2.33k]
  ------------------
 1852|  20.3k|      _dest = dest + offset;
 1853|  20.3k|    } else {
 1854|  12.8k|      _dest = (_src == src) ? tmp : src;
  ------------------
  |  Branch (1854:15): [True: 6.14k, False: 6.72k]
  ------------------
 1855|  12.8k|    }
 1856|  33.2k|    int rc = BLOSC2_ERROR_SUCCESS;
 1857|  33.2k|#ifdef BLOSC_USE_FUSED_SHUFFLE_BYTEDELTA
 1858|  33.2k|    if (fused_size && shuffle_bytedelta_backward(_src, _dest, bsize, fused_size)) {
  ------------------
  |  Branch (1858:9): [True: 580, False: 32.6k]
  |  Branch (1858:23): [True: 580, False: 0]
  ------------------
 1859|    580|      i--;
 1860|    580|      _src = _dest;
 1861|    580|      if (last_filter_index == i) {
  ------------------
  |  Branch (1861:11): [True: 420, False: 160]
  ------------------
 1862|    420|        break;
 1863|    420|      }
 1864|    160|      continue;
 1865|    580|    }
 1866|  32.6k|#endif
 1867|  32.6k|    if (filters[i] <= BLOSC2_DEFINED_FILTERS_STOP) {
  ------------------
  |  Branch (1867:9): [True: 26.3k, False: 6.30k]
  ------------------
 1868|  26.3k|      switch (filters[i]) {
 1869|  10.7k|        case BLOSC_SHUFFLE:
  ------------------
  |  Branch (1869:9): [True: 10.7k, False: 15.5k]
  ------------------
 1870|  10.7k|          blosc2_unshuffle(shuffle_size(context, i), bsize, _src, _dest);
 1871|  10.7k|          break;
 1872|  3.71k|        case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (1872:9): [True: 3.71k, False: 22.6k]
  ------------------
 1873|  3.71k|          if (bitunshuffle(typesize, bsize, _src, _dest, bitshuffle_scratch(thread_context, bsize),
  ------------------
  |  Branch (1873:15): [True: 0, False: 3.71k]
  ------------------
 1874|  3.71k|                           context->src[BLOSC2_CHUNK_VERSION]) < 0) {
 1875|      0|            return BLOSC2_ERROR_FILTER_PIPELINE;
 1876|      0|          }
 1877|  3.71k|          break;
 1878|  11.7k|        case BLOSC_DELTA:
  ------------------
  |  Branch (1878:9): [True: 11.7k, False: 14.6k]
  ------------------
 1879|  11.7k|          if (_src != _dest) {
  ------------------
  |  Branch (1879:15): [True: 1.24k, False: 10.4k]
  ------------------
 1880|  1.24k|            memcpy(_dest, _src, (size_t)bsize);
 1881|  1.24k|          }
 1882|  11.7k|          if (offset != 0 && !thread_context->serial) {
  ------------------
  |  Branch (1882:15): [True: 9.69k, False: 2.00k]
  |  Branch (1882:30): [True: 0, False: 9.69k]
  ------------------
 1883|      0|            delta_wait_dref(context);
 1884|      0|          }
 1885|  11.7k|          delta_decoder(offset == 0 ? _dest : dest, offset, bsize, typesize, _dest);
  ------------------
  |  Branch (1885:25): [True: 2.00k, False: 9.69k]
  ------------------
 1886|  11.7k|          break;
 1887|    161|        default:
  ------------------
  |  Branch (1887:9): [True: 161, False: 26.1k]
  ------------------
 1888|    161|          BLOSC_TRACE_ERROR("Filter %d not handled during decompression.", filters[i]);
  ------------------
  |  |   93|    161|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    161|    do {                                            \
  |  |  |  |   98|    161|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    161|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 161, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    161|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1889|    161|          errcode = -1;
 1890|  26.3k|      }
 1891|  26.3k|    } else {
 1892|       |        // Look for the filters_meta in user filters and run it
 1893|  26.3k|        for (uint64_t j = 0; j < g_nfilters; ++j) {
  ------------------
  |  Branch (1893:30): [True: 26.2k, False: 142]
  ------------------
 1894|  26.2k|          if (g_filters[j].id == filters[i]) {
  ------------------
  |  Branch (1894:15): [True: 6.16k, False: 20.0k]
  ------------------
 1895|  6.16k|            if (load_acquire_ptr(&g_filters[j].backward) == NULL) {
  ------------------
  |  |  144|  6.16k|#define load_acquire_ptr(p) __atomic_load_n((p), __ATOMIC_ACQUIRE)
  ------------------
  |  Branch (1895:17): [True: 0, False: 6.16k]
  ------------------
 1896|       |              // Dynamically load filter
 1897|      0|              if (fill_filter(&g_filters[j]) < 0) {
  ------------------
  |  Branch (1897:19): [True: 0, False: 0]
  ------------------
 1898|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1899|      0|                return BLOSC2_ERROR_FILTER_PIPELINE;
 1900|      0|              }
 1901|      0|            }
 1902|  6.16k|            if (g_filters[j].backward != NULL) {
  ------------------
  |  Branch (1902:17): [True: 6.16k, False: 0]
  ------------------
 1903|  6.16k|              blosc2_dparams dparams;
 1904|  6.16k|              blosc2_ctx_get_dparams(context, &dparams);
 1905|  6.16k|              rc = g_filters[j].backward(_src, _dest, bsize, filters_meta[i], &dparams, g_filters[j].id);
 1906|  6.16k|            } else {
 1907|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1908|      0|              return BLOSC2_ERROR_FILTER_PIPELINE;
 1909|      0|            }
 1910|  6.16k|            if (rc != BLOSC2_ERROR_SUCCESS) {
  ------------------
  |  Branch (1910:17): [True: 42, False: 6.12k]
  ------------------
 1911|     42|              BLOSC_TRACE_ERROR("User-defined filter %d failed during decompression.", filters[i]);
  ------------------
  |  |   93|     42|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     42|    do {                                            \
  |  |  |  |   98|     42|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     42|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 42, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     42|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1912|     42|              return rc;
 1913|     42|            }
 1914|  6.12k|            goto urfiltersuccess;
 1915|  6.16k|          }
 1916|  26.2k|        }
 1917|    142|      BLOSC_TRACE_ERROR("User-defined filter %d not found during decompression.", filters[i]);
  ------------------
  |  |   93|    142|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    142|    do {                                            \
  |  |  |  |   98|    142|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    142|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 142, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    142|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1918|    142|      return BLOSC2_ERROR_FILTER_PIPELINE;
 1919|  6.12k|      urfiltersuccess:;
 1920|  6.12k|    }
 1921|       |
 1922|       |    // do_nothing() skipped the filters that leave the block as it is (TRUNC_PREC is not undone);
 1923|       |    // the output of this filter is the input of the next one
 1924|  32.4k|    _src = _dest;
 1925|  32.4k|    if (last_filter_index == i) {
  ------------------
  |  Branch (1925:9): [True: 9.99k, False: 22.4k]
  ------------------
 1926|  9.99k|      break;
 1927|  9.99k|    }
 1928|  32.4k|  }
 1929|       |
 1930|  10.4k|  if (context->postfilter == NULL && _src != dest + offset) {
  ------------------
  |  Branch (1930:7): [True: 10.4k, False: 0]
  |  Branch (1930:38): [True: 1.06k, False: 9.34k]
  ------------------
 1931|  1.06k|    memcpy(dest + offset, _src, (unsigned int)bsize);
 1932|  1.06k|  }
 1933|       |
 1934|       |  /* Postfilter function */
 1935|  10.4k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (1935:7): [True: 0, False: 10.4k]
  ------------------
 1936|       |    // Create new postfilter parameters for this block (must be private for each thread)
 1937|      0|    blosc2_postfilter_params postparams;
 1938|      0|    memcpy(&postparams, context->postparams, sizeof(postparams));
 1939|      0|    postparams.input = _src;
 1940|      0|    postparams.output = dest + offset;
 1941|      0|    postparams.size = bsize;
 1942|      0|    postparams.typesize = typesize;
 1943|      0|    postparams.offset = nblock * context->blocksize;
 1944|      0|    postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (1944:25): [True: 0, False: 0]
  ------------------
 1945|      0|    postparams.nblock = nblock;
 1946|      0|    postparams.tid = thread_context->tid;
 1947|      0|    postparams.ttmp = thread_context->tmp;
 1948|      0|    postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 1949|      0|    postparams.ctx = context;
 1950|       |
 1951|      0|    if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (1951:9): [True: 0, False: 0]
  ------------------
 1952|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1953|      0|      return BLOSC2_ERROR_POSTFILTER;
 1954|      0|    }
 1955|      0|  }
 1956|       |
 1957|  10.4k|  return errcode;
 1958|  10.4k|}
free_thread_context:
 2648|  15.1k|void free_thread_context(struct thread_context* thread_context) {
 2649|  15.1k|  destroy_thread_context(thread_context);
 2650|  15.1k|  my_free(thread_context);
 2651|  15.1k|}
blosc2_decompress:
 4809|  16.1k|int blosc2_decompress(const void* src, int32_t srcsize, void* dest, int32_t destsize) {
 4810|  16.1k|  int result;
 4811|  16.1k|  char* envvar;
 4812|  16.1k|  long nthreads;
 4813|  16.1k|  blosc2_context *dctx;
 4814|  16.1k|  blosc2_dparams dparams = BLOSC2_DPARAMS_DEFAULTS;
 4815|       |
 4816|       |  /* Check whether the library should be initialized */
 4817|  16.1k|  blosc2_init();
 4818|       |
 4819|       |  /* Check for a BLOSC_NTHREADS environment variable */
 4820|  16.1k|  envvar = getenv("BLOSC_NTHREADS");
 4821|  16.1k|  if (envvar != NULL) {
  ------------------
  |  Branch (4821:7): [True: 0, False: 16.1k]
  ------------------
 4822|      0|    errno = 0; /* To distinguish success/failure after call */
 4823|      0|    nthreads = strtol(envvar, NULL, 10);
 4824|      0|    if ((errno != EINVAL)) {
  ------------------
  |  Branch (4824:9): [True: 0, False: 0]
  ------------------
 4825|      0|      if ((nthreads <= 0) || (nthreads > INT16_MAX)) {
  ------------------
  |  Branch (4825:11): [True: 0, False: 0]
  |  Branch (4825:30): [True: 0, False: 0]
  ------------------
 4826|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 4826|      0|        BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4827|      0|        return BLOSC2_ERROR_INVALID_PARAM;
 4828|      0|      }
 4829|      0|      result = blosc2_set_nthreads((int16_t) nthreads);
 4830|      0|      if (result < 0) {
  ------------------
  |  Branch (4830:11): [True: 0, False: 0]
  ------------------
 4831|      0|        return result;
 4832|      0|      }
 4833|      0|    }
 4834|      0|  }
 4835|       |
 4836|       |  /* Check for a BLOSC_NOLOCK environment variable.  It is important
 4837|       |     that this should be the last env var so that it can take the
 4838|       |     previous ones into account */
 4839|  16.1k|  envvar = getenv("BLOSC_NOLOCK");
 4840|  16.1k|  if (envvar != NULL) {
  ------------------
  |  Branch (4840:7): [True: 0, False: 16.1k]
  ------------------
 4841|      0|    dparams.nthreads = g_nthreads;
 4842|      0|    dctx = blosc2_create_dctx(dparams);
 4843|      0|    if (dctx == NULL) {
  ------------------
  |  Branch (4843:9): [True: 0, False: 0]
  ------------------
 4844|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4845|      0|      return BLOSC2_ERROR_NULL_POINTER;
 4846|      0|    }
 4847|      0|    result = blosc2_decompress_ctx(dctx, src, srcsize, dest, destsize);
 4848|      0|    blosc2_free_ctx(dctx);
 4849|      0|    return result;
 4850|      0|  }
 4851|       |
 4852|  16.1k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  16.1k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 4853|       |
 4854|  16.1k|  result = blosc_run_decompression_with_context(
 4855|  16.1k|          g_global_context, src, srcsize, dest, destsize);
 4856|       |
 4857|  16.1k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  16.1k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 4858|       |
 4859|  16.1k|  return result;
 4860|  16.1k|}
blosc2_set_nthreads:
 6256|  16.3k|int16_t blosc2_set_nthreads(int16_t nthreads) {
 6257|  16.3k|  int16_t ret;          /* the previous number of threads */
 6258|       |
 6259|       |  /* Check whether the library should be initialized */
 6260|  16.3k|  blosc2_init();
 6261|       |
 6262|  16.3k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  16.3k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 6263|  16.3k|  ret = g_nthreads;
 6264|  16.3k|  if (nthreads != ret) {
  ------------------
  |  Branch (6264:7): [True: 0, False: 16.3k]
  ------------------
 6265|      0|    int16_t old_new_nthreads = g_global_context->new_nthreads;
 6266|      0|    int16_t old_nthreads = g_global_context->nthreads;
 6267|      0|    g_nthreads = nthreads;
 6268|      0|    g_global_context->new_nthreads = nthreads;
 6269|      0|    int16_t ret2 = check_nthreads(g_global_context, true);
 6270|      0|    if (ret2 < 0) {
  ------------------
  |  Branch (6270:9): [True: 0, False: 0]
  ------------------
 6271|      0|      g_nthreads = ret;
 6272|      0|      g_global_context->new_nthreads = old_new_nthreads;
 6273|      0|      g_global_context->nthreads = old_nthreads;
 6274|      0|      check_nthreads(g_global_context, true);
 6275|      0|      blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 6276|      0|      return ret2;
 6277|      0|    }
 6278|      0|  }
 6279|  16.3k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  16.3k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 6280|       |
 6281|  16.3k|  return ret;
 6282|  16.3k|}
blosc1_cbuffer_sizes:
 6391|  16.3k|void blosc1_cbuffer_sizes(const void* cbuffer, size_t* nbytes, size_t* cbytes, size_t* blocksize) {
 6392|  16.3k|  int32_t nbytes32, cbytes32, blocksize32;
 6393|  16.3k|  blosc2_cbuffer_sizes(cbuffer, &nbytes32, &cbytes32, &blocksize32);
 6394|  16.3k|  *nbytes = nbytes32;
 6395|  16.3k|  *cbytes = cbytes32;
 6396|  16.3k|  *blocksize = blocksize32;
 6397|  16.3k|}
blosc2_cbuffer_sizes:
 6399|  60.7k|int blosc2_cbuffer_sizes(const void* cbuffer, int32_t* nbytes, int32_t* cbytes, int32_t* blocksize) {
 6400|  60.7k|  blosc_header header;
 6401|  60.7k|  int rc = read_chunk_header((uint8_t *) cbuffer, BLOSC_MIN_HEADER_LENGTH, false, &header);
 6402|  60.7k|  if (rc < 0) {
  ------------------
  |  Branch (6402:7): [True: 79, False: 60.6k]
  ------------------
 6403|       |    /* Return zeros if error reading header */
 6404|     79|    memset(&header, 0, sizeof(header));
 6405|     79|  }
 6406|       |
 6407|       |  /* Read the interesting values */
 6408|  60.7k|  if (nbytes != NULL)
  ------------------
  |  Branch (6408:7): [True: 60.6k, False: 33]
  ------------------
 6409|  60.6k|    *nbytes = header.nbytes;
 6410|  60.7k|  if (cbytes != NULL)
  ------------------
  |  Branch (6410:7): [True: 60.7k, False: 0]
  ------------------
 6411|  60.7k|    *cbytes = header.cbytes;
 6412|  60.7k|  if (blocksize != NULL)
  ------------------
  |  Branch (6412:7): [True: 16.3k, False: 44.3k]
  ------------------
 6413|  16.3k|    *blocksize = header.blocksize;
 6414|  60.7k|  return rc;
 6415|  60.7k|}
blosc1_cbuffer_validate:
 6417|  16.1k|int blosc1_cbuffer_validate(const void* cbuffer, size_t cbytes, size_t* nbytes) {
 6418|  16.1k|  int32_t header_cbytes;
 6419|  16.1k|  int32_t header_nbytes;
 6420|  16.1k|  if (cbytes < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (6420:7): [True: 0, False: 16.1k]
  ------------------
 6421|       |    /* Compressed data should contain enough space for header */
 6422|      0|    *nbytes = 0;
 6423|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 6424|      0|  }
 6425|  16.1k|  int rc = blosc2_cbuffer_sizes(cbuffer, &header_nbytes, &header_cbytes, NULL);
 6426|  16.1k|  if (rc < 0) {
  ------------------
  |  Branch (6426:7): [True: 0, False: 16.1k]
  ------------------
 6427|      0|    *nbytes = 0;
 6428|      0|    return rc;
 6429|      0|  }
 6430|  16.1k|  *nbytes = header_nbytes;
 6431|  16.1k|  if (header_cbytes != (int32_t)cbytes) {
  ------------------
  |  Branch (6431:7): [True: 0, False: 16.1k]
  ------------------
 6432|       |    /* Compressed size from header does not match `cbytes` */
 6433|      0|    *nbytes = 0;
 6434|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 6435|      0|  }
 6436|  16.1k|  if (*nbytes > BLOSC2_MAX_BUFFERSIZE) {
  ------------------
  |  Branch (6436:7): [True: 43, False: 16.1k]
  ------------------
 6437|       |    /* Uncompressed size is larger than allowed */
 6438|     43|    *nbytes = 0;
 6439|     43|    return BLOSC2_ERROR_MEMORY_ALLOC;
 6440|     43|  }
 6441|  16.1k|  return 0;
 6442|  16.1k|}
blosc2_init:
 6605|  48.8k|void blosc2_init(void) {
 6606|       |  /* Return if Blosc is already initialized */
 6607|  48.8k|  if (load_acquire_int(&g_initlib) == BLOSC_STATE_INITIALIZED) return;
  ------------------
  |  |  142|  48.8k|#define load_acquire_int(p) __atomic_load_n((p), __ATOMIC_ACQUIRE)
  ------------------
                if (load_acquire_int(&g_initlib) == BLOSC_STATE_INITIALIZED) return;
  ------------------
  |  |  104|  48.8k|#define BLOSC_STATE_INITIALIZED   1
  ------------------
  |  Branch (6607:7): [True: 32.5k, False: 16.3k]
  ------------------
 6608|       |
 6609|  16.3k|#if !defined(_WIN32)
 6610|       |  /* Before g_init_lock is taken: from now on a fork() waits for it */
 6611|  16.3k|  pthread_once(&atfork_once, register_atfork);
 6612|  16.3k|#endif
 6613|  16.3k|  static_lock(&g_init_lock);
  ------------------
  |  |  132|  16.3k|#define static_lock(l) pthread_mutex_lock(l)
  ------------------
 6614|       |  /* Teardown drops this lock while joining prefetch workers.  Wait without
 6615|       |     holding it so the destroyer can finish; never reinitialize live globals. */
 6616|  16.3k|  while (g_initlib == BLOSC_STATE_TEARDOWN) {
  ------------------
  |  |  105|  16.3k|#define BLOSC_STATE_TEARDOWN      2
  ------------------
  |  Branch (6616:10): [True: 0, False: 16.3k]
  ------------------
 6617|       |#if defined(_WIN32)
 6618|       |    SleepConditionVariableSRW(&g_init_cv, &g_init_lock, INFINITE, 0);
 6619|       |#else
 6620|      0|    pthread_cond_wait(&g_init_cv, &g_init_lock);
 6621|      0|#endif
 6622|      0|  }
 6623|       |  /* Unless another thread initialized it meanwhile */
 6624|  16.3k|  if (g_initlib != BLOSC_STATE_INITIALIZED) {
  ------------------
  |  |  104|  16.3k|#define BLOSC_STATE_INITIALIZED   1
  ------------------
  |  Branch (6624:7): [True: 16.3k, False: 0]
  ------------------
 6625|  16.3k|    blosc2_init_locked();
 6626|  16.3k|  }
 6627|  16.3k|  static_unlock(&g_init_lock);
  ------------------
  |  |  133|  16.3k|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 6628|  16.3k|}
blosc2_tmp_cache_clear:
 6861|  32.7k|void blosc2_tmp_cache_clear(void) {
 6862|  32.7k|#if !defined(_WIN32)
 6863|  32.7k|  tmp_cache_t *cache = tmp_cache_get(false);
 6864|  32.7k|  if (cache != NULL) {
  ------------------
  |  Branch (6864:7): [True: 32.1k, False: 588]
  ------------------
 6865|   160k|    for (int i = 0; i < BLOSC2_TMP_CACHE_SLOTS; ++i) {
  ------------------
  |  | 6658|   160k|#define BLOSC2_TMP_CACHE_SLOTS 4
  ------------------
  |  Branch (6865:21): [True: 128k, False: 32.1k]
  ------------------
 6866|   128k|      free(cache->ptr[i]);
 6867|   128k|      cache->ptr[i] = NULL;
 6868|   128k|      cache->size[i] = 0;
 6869|   128k|    }
 6870|  32.1k|    if (cache->serial != NULL && !cache->serial_busy) {
  ------------------
  |  Branch (6870:9): [True: 15.1k, False: 17.0k]
  |  Branch (6870:34): [True: 15.1k, False: 0]
  ------------------
 6871|  15.1k|      free_thread_context(cache->serial);
 6872|       |      cache->serial = NULL;
 6873|  15.1k|    }
 6874|  32.1k|  }
 6875|  32.7k|#endif
 6876|  32.7k|}
blosc2_destroy:
 6914|  16.3k|void blosc2_destroy(void) {
 6915|       |  /* Return if Blosc is not initialized */
 6916|  16.3k|  if (load_acquire_int(&g_initlib) != BLOSC_STATE_INITIALIZED) return;
  ------------------
  |  |  142|  16.3k|#define load_acquire_int(p) __atomic_load_n((p), __ATOMIC_ACQUIRE)
  ------------------
                if (load_acquire_int(&g_initlib) != BLOSC_STATE_INITIALIZED) return;
  ------------------
  |  |  104|  16.3k|#define BLOSC_STATE_INITIALIZED   1
  ------------------
  |  Branch (6916:7): [True: 0, False: 16.3k]
  ------------------
 6917|       |
 6918|  16.3k|  static_lock(&g_init_lock);
  ------------------
  |  |  132|  16.3k|#define static_lock(l) pthread_mutex_lock(l)
  ------------------
 6919|  16.3k|  if (g_initlib != BLOSC_STATE_INITIALIZED) {
  ------------------
  |  |  104|  16.3k|#define BLOSC_STATE_INITIALIZED   1
  ------------------
  |  Branch (6919:7): [True: 0, False: 16.3k]
  ------------------
 6920|      0|    static_unlock(&g_init_lock);
  ------------------
  |  |  133|      0|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 6921|      0|    return;
 6922|      0|  }
 6923|  16.3k|  store_release_int(&g_initlib, BLOSC_STATE_TEARDOWN);
  ------------------
  |  |  143|  16.3k|#define store_release_int(p, v) __atomic_store_n((p), (v), __ATOMIC_RELEASE)
  ------------------
 6924|  16.3k|  static_unlock(&g_init_lock);
  ------------------
  |  |  133|  16.3k|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 6925|       |
 6926|       |  /* Not under g_init_lock: a fork() holds the read-ahead pool's lock while it
 6927|       |     waits for g_init_lock (prefetch.c registers its fork handlers later).
 6928|       |     New prefetch operations and threads are blocked by blosc2_is_initialized(). */
 6929|  16.3k|  prefetch_destroy();
 6930|       |
 6931|  16.3k|  static_lock(&g_init_lock);
  ------------------
  |  |  132|  16.3k|#define static_lock(l) pthread_mutex_lock(l)
  ------------------
 6932|  16.3k|  blosc2_destroy_locked();
 6933|  16.3k|  store_release_int(&g_initlib, BLOSC_STATE_UNINITIALIZED);
  ------------------
  |  |  143|  16.3k|#define store_release_int(p, v) __atomic_store_n((p), (v), __ATOMIC_RELEASE)
  ------------------
 6934|       |#if defined(_WIN32)
 6935|       |  WakeAllConditionVariable(&g_init_cv);
 6936|       |#else
 6937|  16.3k|  pthread_cond_broadcast(&g_init_cv);
 6938|  16.3k|#endif
 6939|  16.3k|  static_unlock(&g_init_lock);
  ------------------
  |  |  133|  16.3k|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 6940|  16.3k|}
blosc2_free_ctx:
 7207|  16.3k|void blosc2_free_ctx(blosc2_context* context) {
 7208|  16.3k|  if (load_acquire_int(&g_initlib) == BLOSC_STATE_INITIALIZED ||
  ------------------
  |  |  142|  16.3k|#define load_acquire_int(p) __atomic_load_n((p), __ATOMIC_ACQUIRE)
  ------------------
                if (load_acquire_int(&g_initlib) == BLOSC_STATE_INITIALIZED ||
  ------------------
  |  |  104|  32.7k|#define BLOSC_STATE_INITIALIZED   1
  ------------------
  |  Branch (7208:7): [True: 0, False: 16.3k]
  ------------------
 7209|  16.3k|      context->thread_backend == BLOSC_BACKEND_PER_CONTEXT ||
  ------------------
  |  |   36|  32.7k|#define BLOSC_BACKEND_PER_CONTEXT 3   /* per-context threads; used on Windows */
  ------------------
  |  Branch (7209:7): [True: 0, False: 16.3k]
  ------------------
 7210|  16.3k|      context->thread_backend == BLOSC_BACKEND_CALLBACK) {
  ------------------
  |  |   35|  16.3k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (7210:7): [True: 0, False: 16.3k]
  ------------------
 7211|      0|    release_thread_backend(context);
 7212|      0|  }
 7213|  16.3k|  if (context->serial_context != NULL) {
  ------------------
  |  Branch (7213:7): [True: 0, False: 16.3k]
  ------------------
 7214|      0|    free_thread_context(context->serial_context);
 7215|      0|  }
 7216|  16.3k|  blosc2_pthread_mutex_destroy(&context->nchunk_mutex);
  ------------------
  |  |   91|  16.3k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 7217|  16.3k|  release_context_dict_buffer(context);
 7218|  16.3k|  if (context->dict_cdict != NULL) {
  ------------------
  |  Branch (7218:7): [True: 0, False: 16.3k]
  ------------------
 7219|      0|    if (context->compcode == BLOSC_LZ4) {
  ------------------
  |  Branch (7219:9): [True: 0, False: 0]
  ------------------
 7220|      0|      LZ4_freeStream((LZ4_stream_t*)context->dict_cdict);
 7221|      0|    } else if (context->compcode == BLOSC_LZ4HC) {
  ------------------
  |  Branch (7221:16): [True: 0, False: 0]
  ------------------
 7222|      0|      LZ4_freeStreamHC((LZ4_streamHC_t*)context->dict_cdict);
 7223|      0|    }
 7224|      0|#ifdef HAVE_ZSTD
 7225|      0|    else if (context->compcode == BLOSC_ZSTD) {
  ------------------
  |  Branch (7225:14): [True: 0, False: 0]
  ------------------
 7226|      0|      ZSTD_freeCDict(context->dict_cdict);
 7227|      0|    }
 7228|      0|#endif
 7229|      0|  }
 7230|  16.3k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (7230:7): [True: 3.25k, False: 13.1k]
  ------------------
 7231|  3.25k|#ifdef HAVE_ZSTD
 7232|  3.25k|    ZSTD_freeDDict(context->dict_ddict);
 7233|  3.25k|#endif
 7234|  3.25k|  }
 7235|  16.3k|  if (context->tuner_params != NULL) {
  ------------------
  |  Branch (7235:7): [True: 0, False: 16.3k]
  ------------------
 7236|      0|    int rc;
 7237|      0|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|      0|#define BLOSC_STUNE 0
  ------------------
  |  Branch (7237:9): [True: 0, False: 0]
  |  Branch (7237:49): [True: 0, False: 0]
  ------------------
 7238|      0|      rc = blosc_stune_free(context);
 7239|      0|    } else {
 7240|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (7240:23): [True: 0, False: 0]
  ------------------
 7241|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (7241:13): [True: 0, False: 0]
  ------------------
 7242|      0|          if (load_acquire_ptr(&g_tuners[i].init) == NULL) {
  ------------------
  |  |  144|      0|#define load_acquire_ptr(p) __atomic_load_n((p), __ATOMIC_ACQUIRE)
  ------------------
  |  Branch (7242:15): [True: 0, False: 0]
  ------------------
 7243|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (7243:17): [True: 0, False: 0]
  ------------------
 7244|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7245|      0|              return;
 7246|      0|            }
 7247|      0|          }
 7248|      0|          rc = g_tuners[i].free(context);
 7249|      0|          goto urtunersuccess;
 7250|      0|        }
 7251|      0|      }
 7252|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7253|      0|      return;
 7254|      0|      urtunersuccess:;
 7255|      0|    }
 7256|      0|    if (rc < 0) {
  ------------------
  |  Branch (7256:9): [True: 0, False: 0]
  ------------------
 7257|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7258|      0|      return;
 7259|      0|    }
 7260|      0|  }
 7261|       |  /* May be needed if codec_params ever contains nested objects
 7262|       |  if (context->codec_params != NULL) {
 7263|       |    int rc;
 7264|       |    for (int i = 0; i < g_ncodecs; ++i) {
 7265|       |      if (g_codecs[i].compcode == context->compcode) {
 7266|       |        if (g_codecs[i].free == NULL) {
 7267|       |          // Dynamically load codec plugin
 7268|       |          if (fill_codec(&g_codecs[i]) < 0) {
 7269|       |            BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
 7270|       |            return BLOSC2_ERROR_CODEC_SUPPORT;
 7271|       |          }
 7272|       |        }
 7273|       |        if (g_codecs[i].free == NULL){
 7274|       |          // no free func, codec_params is simple
 7275|       |          my_free(context->codec_params);
 7276|       |        }
 7277|       |        else{ // has free function for codec_params (e.g. openzl)
 7278|       |        rc = g_codecs[i].free(context->codec_params);
 7279|       |          goto urcodecsuccess;
 7280|       |        }
 7281|       |      }
 7282|       |    }
 7283|       |      BLOSC_TRACE_ERROR("User-defined compressor codec %d not found", context->compcode);
 7284|       |      return BLOSC2_ERROR_CODEC_SUPPORT;
 7285|       |    urcodecsuccess:;
 7286|       |    if (rc < 0) {
 7287|       |      BLOSC_TRACE_ERROR("Error in user-defined codec free function\n");
 7288|       |      return;
 7289|       |    }
 7290|       |  }
 7291|       |  */
 7292|  16.3k|  if (context->prefilter != NULL) {
  ------------------
  |  Branch (7292:7): [True: 0, False: 16.3k]
  ------------------
 7293|      0|    my_free(context->preparams);
 7294|      0|  }
 7295|  16.3k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (7295:7): [True: 0, False: 16.3k]
  ------------------
 7296|      0|    my_free(context->postparams);
 7297|      0|  }
 7298|       |
 7299|  16.3k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (7299:7): [True: 0, False: 16.3k]
  ------------------
 7300|      0|    free(context->block_maskout);
 7301|      0|  }
 7302|  16.3k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (7302:7): [True: 245, False: 16.1k]
  ------------------
 7303|    245|    free(context->blocknbytes);
 7304|    245|  }
 7305|  16.3k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (7305:7): [True: 245, False: 16.1k]
  ------------------
 7306|    245|    free(context->blockoffsets);
 7307|    245|  }
 7308|  16.3k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (7308:7): [True: 245, False: 16.1k]
  ------------------
 7309|    245|    free(context->blockcbytes);
 7310|    245|  }
 7311|  16.3k|  my_free(context);
 7312|  16.3k|}
blosc2_ctx_get_dparams:
 7339|  7.73k|int blosc2_ctx_get_dparams(blosc2_context *ctx, blosc2_dparams *dparams) {
 7340|  7.73k|  dparams->nthreads = ctx->nthreads;
 7341|  7.73k|  dparams->schunk = ctx->schunk;
 7342|  7.73k|  dparams->postfilter = ctx->postfilter;
 7343|  7.73k|  dparams->postparams = ctx->postparams;
 7344|  7.73k|  dparams->typesize = ctx->typesize;
 7345|       |
 7346|  7.73k|  return BLOSC2_ERROR_SUCCESS;
 7347|  7.73k|}
register_filter_private:
 7565|  81.8k|int register_filter_private(blosc2_filter *filter) {
 7566|  81.8k|    BLOSC_ERROR_NULL(filter, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  81.8k|    do {                                            \
  |  |  105|  81.8k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 81.8k]
  |  |  ------------------
  |  |  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|  81.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 81.8k]
  |  |  ------------------
  ------------------
 7567|  81.8k|    if (g_nfilters == UINT8_MAX) {
  ------------------
  |  Branch (7567:9): [True: 0, False: 81.8k]
  ------------------
 7568|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7569|      0|        return BLOSC2_ERROR_CODEC_SUPPORT;
 7570|      0|    }
 7571|  81.8k|    if (filter->id < BLOSC2_GLOBAL_REGISTERED_FILTERS_START) {
  ------------------
  |  Branch (7571:9): [True: 0, False: 81.8k]
  ------------------
 7572|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7573|      0|        return BLOSC2_ERROR_FAILURE;
 7574|      0|    }
 7575|       |    /* This condition can never be fulfilled
 7576|       |    if (filter->id > BLOSC2_USER_REGISTERED_FILTERS_STOP) {
 7577|       |        BLOSC_TRACE_ERROR("The id must be less than or equal to %d", BLOSC2_USER_REGISTERED_FILTERS_STOP);
 7578|       |        return BLOSC2_ERROR_FAILURE;
 7579|       |    }
 7580|       |    */
 7581|       |
 7582|   245k|    for (uint64_t i = 0; i < g_nfilters; ++i) {
  ------------------
  |  Branch (7582:26): [True: 163k, False: 81.8k]
  ------------------
 7583|   163k|      if (g_filters[i].id == filter->id) {
  ------------------
  |  Branch (7583:11): [True: 0, False: 163k]
  ------------------
 7584|      0|        if (strcmp(g_filters[i].name, filter->name) != 0) {
  ------------------
  |  Branch (7584:13): [True: 0, False: 0]
  ------------------
 7585|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7586|      0|                            "  Choose another one !", filter->id, g_filters[i].name);
 7587|      0|          return BLOSC2_ERROR_FAILURE;
 7588|      0|        }
 7589|      0|        else {
 7590|       |          // Already registered, so no more actions needed
 7591|      0|          return BLOSC2_ERROR_SUCCESS;
 7592|      0|        }
 7593|      0|      }
 7594|   163k|    }
 7595|       |
 7596|  81.8k|    blosc2_filter *filter_new = &g_filters[g_nfilters++];
 7597|  81.8k|    memcpy(filter_new, filter, sizeof(blosc2_filter));
 7598|       |
 7599|  81.8k|    return BLOSC2_ERROR_SUCCESS;
 7600|  81.8k|}
register_codec_private:
 7615|   147k|int register_codec_private(blosc2_codec *codec) {
 7616|   147k|    BLOSC_ERROR_NULL(codec, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|   147k|    do {                                            \
  |  |  105|   147k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 147k]
  |  |  ------------------
  |  |  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|   147k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 147k]
  |  |  ------------------
  ------------------
 7617|   147k|    if (g_ncodecs == UINT8_MAX) {
  ------------------
  |  Branch (7617:9): [True: 0, False: 147k]
  ------------------
 7618|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7619|      0|      return BLOSC2_ERROR_CODEC_SUPPORT;
 7620|      0|    }
 7621|   147k|    if (codec->compcode < BLOSC2_GLOBAL_REGISTERED_CODECS_START) {
  ------------------
  |  Branch (7621:9): [True: 0, False: 147k]
  ------------------
 7622|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7623|      0|      return BLOSC2_ERROR_FAILURE;
 7624|      0|    }
 7625|       |    /* This condition can never be fulfilled
 7626|       |    if (codec->compcode > BLOSC2_USER_REGISTERED_CODECS_STOP) {
 7627|       |      BLOSC_TRACE_ERROR("The id must be less or equal to %d", BLOSC2_USER_REGISTERED_CODECS_STOP);
 7628|       |      return BLOSC2_ERROR_FAILURE;
 7629|       |    }
 7630|       |     */
 7631|       |
 7632|   736k|    for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (7632:21): [True: 589k, False: 147k]
  ------------------
 7633|   589k|      if (g_codecs[i].compcode == codec->compcode) {
  ------------------
  |  Branch (7633:11): [True: 0, False: 589k]
  ------------------
 7634|      0|        if (strcmp(g_codecs[i].compname, codec->compname) != 0) {
  ------------------
  |  Branch (7634:13): [True: 0, False: 0]
  ------------------
 7635|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7636|      0|                            "  Choose another one !", codec->compcode, codec->compname);
 7637|      0|          return BLOSC2_ERROR_CODEC_PARAM;
 7638|      0|        }
 7639|      0|        else {
 7640|       |          // Already registered, so no more actions needed
 7641|      0|          return BLOSC2_ERROR_SUCCESS;
 7642|      0|        }
 7643|      0|      }
 7644|   589k|    }
 7645|       |
 7646|   147k|    blosc2_codec *codec_new = &g_codecs[g_ncodecs++];
 7647|   147k|    memcpy(codec_new, codec, sizeof(blosc2_codec));
 7648|       |
 7649|   147k|    return BLOSC2_ERROR_SUCCESS;
 7650|   147k|}
register_tuner_private:
 7665|  16.3k|int register_tuner_private(blosc2_tuner *tuner) {
 7666|  16.3k|  BLOSC_ERROR_NULL(tuner, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  16.3k|    do {                                            \
  |  |  105|  16.3k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |  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|  16.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 16.3k]
  |  |  ------------------
  ------------------
 7667|  16.3k|  if (g_ntuners == UINT8_MAX) {
  ------------------
  |  Branch (7667:7): [True: 0, False: 16.3k]
  ------------------
 7668|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7669|      0|    return BLOSC2_ERROR_CODEC_SUPPORT;
 7670|      0|  }
 7671|  16.3k|  if (tuner->id < BLOSC2_GLOBAL_REGISTERED_TUNER_START) {
  ------------------
  |  Branch (7671:7): [True: 0, False: 16.3k]
  ------------------
 7672|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7673|      0|    return BLOSC2_ERROR_FAILURE;
 7674|      0|  }
 7675|       |
 7676|  16.3k|  for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (7676:19): [True: 0, False: 16.3k]
  ------------------
 7677|      0|    if (g_tuners[i].id == tuner->id) {
  ------------------
  |  Branch (7677:9): [True: 0, False: 0]
  ------------------
 7678|      0|      if (strcmp(g_tuners[i].name, tuner->name) != 0) {
  ------------------
  |  Branch (7678:11): [True: 0, False: 0]
  ------------------
 7679|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7680|      0|                          "  Choose another one !", tuner->id, g_tuners[i].name);
 7681|      0|        return BLOSC2_ERROR_FAILURE;
 7682|      0|      }
 7683|      0|      else {
 7684|       |        // Already registered, so no more actions needed
 7685|      0|        return BLOSC2_ERROR_SUCCESS;
 7686|      0|      }
 7687|      0|    }
 7688|      0|  }
 7689|       |
 7690|  16.3k|  blosc2_tuner *tuner_new = &g_tuners[g_ntuners++];
 7691|  16.3k|  memcpy(tuner_new, tuner, sizeof(blosc2_tuner));
 7692|       |
 7693|  16.3k|  return BLOSC2_ERROR_SUCCESS;
 7694|  16.3k|}
_blosc2_register_io_cb:
 7707|  32.7k|int _blosc2_register_io_cb(const blosc2_io_cb *io) {
 7708|       |
 7709|  49.1k|  for (uint64_t i = 0; i < g_nio; ++i) {
  ------------------
  |  Branch (7709:24): [True: 49.1k, False: 2]
  ------------------
 7710|  49.1k|    if (g_ios[i].id == io->id) {
  ------------------
  |  Branch (7710:9): [True: 32.7k, False: 16.3k]
  ------------------
 7711|  32.7k|      if (strcmp(g_ios[i].name, io->name) != 0) {
  ------------------
  |  Branch (7711:11): [True: 0, False: 32.7k]
  ------------------
 7712|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7713|      0|                          "  Choose another one !", io->id, g_ios[i].name);
 7714|      0|        return BLOSC2_ERROR_PLUGIN_IO;
 7715|      0|      }
 7716|  32.7k|      else {
 7717|       |        // Already registered, so no more actions needed
 7718|  32.7k|        return BLOSC2_ERROR_SUCCESS;
 7719|  32.7k|      }
 7720|  32.7k|    }
 7721|  49.1k|  }
 7722|       |
 7723|      2|  blosc2_io_cb *io_new = &g_ios[g_nio++];
 7724|      2|  memcpy(io_new, io, sizeof(blosc2_io_cb));
 7725|       |
 7726|      2|  return BLOSC2_ERROR_SUCCESS;
 7727|  32.7k|}
blosc2_error_string:
 7842|     41|const char *blosc2_error_string(int error_code) {
 7843|     41|  switch (error_code) {
 7844|     25|    case BLOSC2_ERROR_FAILURE:
  ------------------
  |  Branch (7844:5): [True: 25, False: 16]
  ------------------
 7845|     25|      return "Generic failure";
 7846|      0|    case BLOSC2_ERROR_STREAM:
  ------------------
  |  Branch (7846:5): [True: 0, False: 41]
  ------------------
 7847|      0|      return "Bad stream";
 7848|     13|    case BLOSC2_ERROR_DATA:
  ------------------
  |  Branch (7848:5): [True: 13, False: 28]
  ------------------
 7849|     13|      return "Invalid data";
 7850|      0|    case BLOSC2_ERROR_MEMORY_ALLOC:
  ------------------
  |  Branch (7850:5): [True: 0, False: 41]
  ------------------
 7851|      0|      return "Memory alloc/realloc failure";
 7852|      0|    case BLOSC2_ERROR_READ_BUFFER:
  ------------------
  |  Branch (7852:5): [True: 0, False: 41]
  ------------------
 7853|      0|      return "Not enough space to read";
 7854|      3|    case BLOSC2_ERROR_WRITE_BUFFER:
  ------------------
  |  Branch (7854:5): [True: 3, False: 38]
  ------------------
 7855|      3|      return "Not enough space to write";
 7856|      0|    case BLOSC2_ERROR_CODEC_SUPPORT:
  ------------------
  |  Branch (7856:5): [True: 0, False: 41]
  ------------------
 7857|      0|      return "Codec not supported";
 7858|      0|    case BLOSC2_ERROR_CODEC_PARAM:
  ------------------
  |  Branch (7858:5): [True: 0, False: 41]
  ------------------
 7859|      0|      return "Invalid parameter supplied to codec";
 7860|      0|    case BLOSC2_ERROR_CODEC_DICT:
  ------------------
  |  Branch (7860:5): [True: 0, False: 41]
  ------------------
 7861|      0|      return "Codec dictionary error";
 7862|      0|    case BLOSC2_ERROR_VERSION_SUPPORT:
  ------------------
  |  Branch (7862:5): [True: 0, False: 41]
  ------------------
 7863|      0|      return "Version not supported";
 7864|      0|    case BLOSC2_ERROR_INVALID_HEADER:
  ------------------
  |  Branch (7864:5): [True: 0, False: 41]
  ------------------
 7865|      0|      return "Invalid value in header";
 7866|      0|    case BLOSC2_ERROR_INVALID_PARAM:
  ------------------
  |  Branch (7866:5): [True: 0, False: 41]
  ------------------
 7867|      0|      return "Invalid parameter supplied to function";
 7868|      0|    case BLOSC2_ERROR_FILE_READ:
  ------------------
  |  Branch (7868:5): [True: 0, False: 41]
  ------------------
 7869|      0|      return "File read failure";
 7870|      0|    case BLOSC2_ERROR_FILE_WRITE:
  ------------------
  |  Branch (7870:5): [True: 0, False: 41]
  ------------------
 7871|      0|      return "File write failure";
 7872|      0|    case BLOSC2_ERROR_FILE_OPEN:
  ------------------
  |  Branch (7872:5): [True: 0, False: 41]
  ------------------
 7873|      0|      return "File open failure";
 7874|      0|    case BLOSC2_ERROR_NOT_FOUND:
  ------------------
  |  Branch (7874:5): [True: 0, False: 41]
  ------------------
 7875|      0|      return "Not found";
 7876|      0|    case BLOSC2_ERROR_RUN_LENGTH:
  ------------------
  |  Branch (7876:5): [True: 0, False: 41]
  ------------------
 7877|      0|      return "Bad run length encoding";
 7878|      0|    case BLOSC2_ERROR_FILTER_PIPELINE:
  ------------------
  |  Branch (7878:5): [True: 0, False: 41]
  ------------------
 7879|      0|      return "Filter pipeline error";
 7880|      0|    case BLOSC2_ERROR_CHUNK_INSERT:
  ------------------
  |  Branch (7880:5): [True: 0, False: 41]
  ------------------
 7881|      0|      return "Chunk insert failure";
 7882|      0|    case BLOSC2_ERROR_CHUNK_APPEND:
  ------------------
  |  Branch (7882:5): [True: 0, False: 41]
  ------------------
 7883|      0|      return "Chunk append failure";
 7884|      0|    case BLOSC2_ERROR_CHUNK_UPDATE:
  ------------------
  |  Branch (7884:5): [True: 0, False: 41]
  ------------------
 7885|      0|      return "Chunk update failure";
 7886|      0|    case BLOSC2_ERROR_2GB_LIMIT:
  ------------------
  |  Branch (7886:5): [True: 0, False: 41]
  ------------------
 7887|      0|      return "Sizes larger than 2gb not supported";
 7888|      0|    case BLOSC2_ERROR_SCHUNK_COPY:
  ------------------
  |  Branch (7888:5): [True: 0, False: 41]
  ------------------
 7889|      0|      return "Super-chunk copy failure";
 7890|      0|    case BLOSC2_ERROR_FRAME_TYPE:
  ------------------
  |  Branch (7890:5): [True: 0, False: 41]
  ------------------
 7891|      0|      return "Wrong type for frame";
 7892|      0|    case BLOSC2_ERROR_FILE_TRUNCATE:
  ------------------
  |  Branch (7892:5): [True: 0, False: 41]
  ------------------
 7893|      0|      return "File truncate failure";
 7894|      0|    case BLOSC2_ERROR_LOCK:
  ------------------
  |  Branch (7894:5): [True: 0, False: 41]
  ------------------
 7895|      0|      return "Frame lock failure";
 7896|      0|    case BLOSC2_ERROR_THREAD_CREATE:
  ------------------
  |  Branch (7896:5): [True: 0, False: 41]
  ------------------
 7897|      0|      return "Thread or thread context creation failure";
 7898|      0|    case BLOSC2_ERROR_POSTFILTER:
  ------------------
  |  Branch (7898:5): [True: 0, False: 41]
  ------------------
 7899|      0|      return "Postfilter failure";
 7900|      0|    case BLOSC2_ERROR_FRAME_SPECIAL:
  ------------------
  |  Branch (7900:5): [True: 0, False: 41]
  ------------------
 7901|      0|      return "Special frame failure";
 7902|      0|    case BLOSC2_ERROR_SCHUNK_SPECIAL:
  ------------------
  |  Branch (7902:5): [True: 0, False: 41]
  ------------------
 7903|      0|      return "Special super-chunk failure";
 7904|      0|    case BLOSC2_ERROR_PLUGIN_IO:
  ------------------
  |  Branch (7904:5): [True: 0, False: 41]
  ------------------
 7905|      0|      return "IO plugin error";
 7906|      0|    case BLOSC2_ERROR_FILE_REMOVE:
  ------------------
  |  Branch (7906:5): [True: 0, False: 41]
  ------------------
 7907|      0|      return "Remove file failure";
 7908|      0|    case BLOSC2_ERROR_NULL_POINTER:
  ------------------
  |  Branch (7908:5): [True: 0, False: 41]
  ------------------
 7909|      0|      return "Pointer is null";
 7910|      0|    case BLOSC2_ERROR_INVALID_INDEX:
  ------------------
  |  Branch (7910:5): [True: 0, False: 41]
  ------------------
 7911|      0|      return "Invalid index";
 7912|      0|    case BLOSC2_ERROR_METALAYER_NOT_FOUND:
  ------------------
  |  Branch (7912:5): [True: 0, False: 41]
  ------------------
 7913|      0|      return "Metalayer has not been found";
 7914|      0|    case BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED:
  ------------------
  |  Branch (7914:5): [True: 0, False: 41]
  ------------------
 7915|      0|      return "Maximum buffersize exceeded";
 7916|      0|    case BLOSC2_ERROR_TUNER:
  ------------------
  |  Branch (7916:5): [True: 0, False: 41]
  ------------------
 7917|      0|      return "Tuner failure";
 7918|      0|    default:
  ------------------
  |  Branch (7918:5): [True: 0, False: 41]
  ------------------
 7919|      0|      return "Unknown error";
 7920|     41|  }
 7921|     41|}
blosc2.c:shuffle_size:
  773|  62.3k|static int32_t shuffle_size(const blosc2_context* context, int i) {
  774|  62.3k|  return context->filters_meta[i] == 0 ? context->typesize : context->filters_meta[i];
  ------------------
  |  Branch (774:10): [True: 34.3k, False: 27.9k]
  ------------------
  775|  62.3k|}
blosc2.c:flags_to_filters:
  857|  77.9k|static void flags_to_filters(const uint8_t flags, uint8_t* filters) {
  858|       |  /* Initialize the filter pipeline */
  859|  77.9k|  memset(filters, 0, BLOSC2_MAX_FILTERS);
  860|       |  /* Fill the filter pipeline */
  861|  77.9k|  if (flags & BLOSC_DOSHUFFLE)
  ------------------
  |  Branch (861:7): [True: 45.2k, False: 32.7k]
  ------------------
  862|  45.2k|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_SHUFFLE;
  863|  77.9k|  if (flags & BLOSC_DOBITSHUFFLE)
  ------------------
  |  Branch (863:7): [True: 44.6k, False: 33.3k]
  ------------------
  864|  44.6k|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_BITSHUFFLE;
  865|  77.9k|  if (flags & BLOSC_DODELTA)
  ------------------
  |  Branch (865:7): [True: 34.4k, False: 43.5k]
  ------------------
  866|  34.4k|    filters[BLOSC2_MAX_FILTERS - 2] = BLOSC_DELTA;
  867|  77.9k|}
blosc2.c:load_codec_locked:
 1137|      4|static int load_codec_locked(blosc2_codec *codec) {
 1138|      4|  char libpath[PATH_MAX];
 1139|      4|  void *lib = load_lib(codec->compname, libpath);
 1140|      4|  if(lib == NULL) {
  ------------------
  |  Branch (1140:6): [True: 4, False: 0]
  ------------------
 1141|      4|    BLOSC_TRACE_ERROR("Error while loading the library for codec `%s`", codec->compname);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1142|      4|    return BLOSC2_ERROR_FAILURE;
 1143|      4|  }
 1144|       |
 1145|      0|  codec_info *info = dlsym(lib, "info");
 1146|      0|  if (info == NULL) {
  ------------------
  |  Branch (1146:7): [True: 0, False: 0]
  ------------------
 1147|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1148|      0|    dlclose(lib);
 1149|      0|    return BLOSC2_ERROR_FAILURE;
 1150|      0|  }
 1151|      0|  void *encoder = plugin_dlsym(lib, info->encoder);
 1152|      0|  void *decoder = plugin_dlsym(lib, info->decoder);
 1153|       |
 1154|      0|  if (encoder == NULL || decoder == NULL) {
  ------------------
  |  Branch (1154:7): [True: 0, False: 0]
  |  Branch (1154:26): [True: 0, False: 0]
  ------------------
 1155|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1156|      0|    dlclose(lib);
 1157|      0|    return BLOSC2_ERROR_FAILURE;
 1158|      0|  }
 1159|      0|  codec->encoder = encoder;
 1160|      0|  store_release_ptr(&codec->decoder, decoder);
  ------------------
  |  |  145|      0|#define store_release_ptr(p, v) __atomic_store_n((p), (v), __ATOMIC_RELEASE)
  ------------------
 1161|       |
 1162|       |  /* If ever add .free function in future for codec params
 1163|       |  codecparams_info *info2 = dlsym(lib, "info2");
 1164|       |  if (info2 != NULL) {
 1165|       |    // New plugin (e.g. openzl) with free function for codec_params defined
 1166|       |    // will be used when destroying context in blosc2_free_ctx
 1167|       |      codec->free = dlsym(lib, info2->free);
 1168|       |  }
 1169|       |  else{
 1170|       |    codec->free = NULL;
 1171|       |  }
 1172|       |  */
 1173|       |
 1174|      0|  return BLOSC2_ERROR_SUCCESS;
 1175|      0|}
blosc2.c:fused_shuffle_bytedelta_size:
  781|  33.2k|static int fused_shuffle_bytedelta_size(const blosc2_context *context, int i) {
  782|  33.2k|  if (i < 0 || i + 1 >= BLOSC2_MAX_FILTERS || context->filters[i] != BLOSC_SHUFFLE ||
  ------------------
  |  Branch (782:7): [True: 7.01k, False: 26.2k]
  |  Branch (782:16): [True: 0, False: 26.2k]
  |  Branch (782:47): [True: 20.5k, False: 5.64k]
  ------------------
  783|  31.7k|      context->filters[i + 1] != BLOSC_FILTER_BYTEDELTA) {
  ------------------
  |  Branch (783:7): [True: 4.20k, False: 1.43k]
  ------------------
  784|  31.7k|    return 0;
  785|  31.7k|  }
  786|  1.43k|  int delta_size = context->filters_meta[i + 1];
  787|  1.43k|  if (delta_size == 0 && context->schunk != NULL) {
  ------------------
  |  Branch (787:7): [True: 5, False: 1.43k]
  |  Branch (787:26): [True: 0, False: 5]
  ------------------
  788|      0|    delta_size = context->schunk->typesize;
  789|      0|  }
  790|  1.43k|  int size = shuffle_size(context, i);
  791|  1.43k|  return (size == 2 || size == 4 || size == 8) && size == delta_size &&
  ------------------
  |  Branch (791:11): [True: 338, False: 1.09k]
  |  Branch (791:24): [True: 477, False: 622]
  |  Branch (791:37): [True: 235, False: 387]
  |  Branch (791:51): [True: 580, False: 470]
  ------------------
  792|    857|         shuffle_bytedelta_available() ? size : 0;
  ------------------
  |  Branch (792:10): [True: 580, False: 0]
  ------------------
  793|  33.2k|}
blosc2.c:bitshuffle_scratch:
 1304|  3.71k|static uint8_t* bitshuffle_scratch(struct thread_context* thread_context, int32_t bsize) {
 1305|  3.71k|  size_t offset = (size_t)(thread_context->tmp4 - thread_context->tmp);
 1306|  3.71k|  size_t shift = (16 - ((uintptr_t)thread_context->tmp4 & 15)) & 15;
 1307|  3.71k|  if (offset + shift + (size_t)bsize <= thread_context->tmp_nbytes) {
  ------------------
  |  Branch (1307:7): [True: 3.03k, False: 681]
  ------------------
 1308|  3.03k|    return thread_context->tmp4 + shift;
 1309|  3.03k|  }
 1310|    681|  if (offset + (size_t)bsize <= thread_context->tmp_nbytes) {
  ------------------
  |  Branch (1310:7): [True: 681, False: 0]
  ------------------
 1311|    681|    return thread_context->tmp4;
 1312|    681|  }
 1313|      0|  return NULL;
 1314|    681|}
blosc2.c:destroy_thread_context:
 2629|  15.1k|static void destroy_thread_context(struct thread_context* thread_context) {
 2630|  15.1k|  my_free(thread_context->tmp);
 2631|  15.1k|  free(thread_context->blosclz_state);
 2632|  15.1k|#if defined(HAVE_ZSTD)
 2633|  15.1k|  if (thread_context->zstd_cctx != NULL) {
  ------------------
  |  Branch (2633:7): [True: 0, False: 15.1k]
  ------------------
 2634|      0|    ZSTD_freeCCtx(thread_context->zstd_cctx);
 2635|      0|  }
 2636|  15.1k|  if (thread_context->zstd_dctx != NULL) {
  ------------------
  |  Branch (2636:7): [True: 10.2k, False: 4.81k]
  ------------------
 2637|  10.2k|    ZSTD_freeDCtx(thread_context->zstd_dctx);
 2638|  10.2k|  }
 2639|  15.1k|#endif
 2640|  15.1k|  if (thread_context->lz4_cstream != NULL) {
  ------------------
  |  Branch (2640:7): [True: 0, False: 15.1k]
  ------------------
 2641|      0|    LZ4_freeStream((LZ4_stream_t*)thread_context->lz4_cstream);
 2642|      0|  }
 2643|  15.1k|  if (thread_context->lz4hc_cstream != NULL) {
  ------------------
  |  Branch (2643:7): [True: 0, False: 15.1k]
  ------------------
 2644|      0|    LZ4_freeStreamHC((LZ4_streamHC_t*)thread_context->lz4hc_cstream);
 2645|      0|  }
 2646|  15.1k|}
blosc2.c:my_free:
  394|  46.5k|static void my_free(void* block) {
  395|       |#if defined(_WIN32)
  396|       |  _aligned_free(block);
  397|       |#else
  398|  46.5k|  free(block);
  399|  46.5k|#endif  /* _WIN32 */
  400|  46.5k|}
blosc2.c:filters_to_flags:
  834|  7.37k|static uint8_t filters_to_flags(const uint8_t* filters) {
  835|  7.37k|  uint8_t flags = 0;
  836|       |
  837|  51.6k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (837:19): [True: 44.2k, False: 7.37k]
  ------------------
  838|  44.2k|    switch (filters[i]) {
  839|  3.71k|      case BLOSC_SHUFFLE:
  ------------------
  |  Branch (839:7): [True: 3.71k, False: 40.5k]
  ------------------
  840|  3.71k|        flags |= BLOSC_DOSHUFFLE;
  841|  3.71k|        break;
  842|  1.58k|      case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (842:7): [True: 1.58k, False: 42.6k]
  ------------------
  843|  1.58k|        flags |= BLOSC_DOBITSHUFFLE;
  844|  1.58k|        break;
  845|  2.65k|      case BLOSC_DELTA:
  ------------------
  |  Branch (845:7): [True: 2.65k, False: 41.5k]
  ------------------
  846|  2.65k|        flags |= BLOSC_DODELTA;
  847|  2.65k|        break;
  848|  36.2k|      default :
  ------------------
  |  Branch (848:7): [True: 36.2k, False: 7.94k]
  ------------------
  849|  36.2k|        break;
  850|  44.2k|    }
  851|  44.2k|  }
  852|  7.37k|  return flags;
  853|  7.37k|}
blosc2.c:blosc2_calculate_blocks:
 1024|  15.7k|static inline void blosc2_calculate_blocks(blosc2_context* context) {
 1025|       |  /* Compute number of blocks in buffer */
 1026|  15.7k|  context->nblocks = context->sourcesize / context->blocksize;
 1027|  15.7k|  context->leftover = context->sourcesize % context->blocksize;
 1028|  15.7k|  context->nblocks = (context->leftover > 0) ?
  ------------------
  |  Branch (1028:22): [True: 3.62k, False: 12.0k]
  ------------------
 1029|  12.0k|                     (context->nblocks + 1) : context->nblocks;
 1030|  15.7k|}
blosc2.c:clibcode_to_clibname:
  427|      6|static const char* clibcode_to_clibname(int clibcode) {
  428|      6|  if (clibcode == BLOSC_BLOSCLZ_LIB) return BLOSC_BLOSCLZ_LIBNAME;
  ------------------
  |  |  367|      0|#define BLOSC_BLOSCLZ_LIBNAME   "BloscLZ"
  ------------------
  |  Branch (428:7): [True: 0, False: 6]
  ------------------
  429|      6|  if (clibcode == BLOSC_LZ4_LIB) return BLOSC_LZ4_LIBNAME;
  ------------------
  |  |  368|      0|#define BLOSC_LZ4_LIBNAME       "LZ4"
  ------------------
  |  Branch (429:7): [True: 0, False: 6]
  ------------------
  430|      6|  if (clibcode == BLOSC_ZLIB_LIB) return BLOSC_ZLIB_LIBNAME;
  ------------------
  |  |  369|      0|#define BLOSC_ZLIB_LIBNAME      "Zlib"
  ------------------
  |  Branch (430:7): [True: 0, False: 6]
  ------------------
  431|      6|  if (clibcode == BLOSC_ZSTD_LIB) return BLOSC_ZSTD_LIBNAME;
  ------------------
  |  |  370|      0|#define BLOSC_ZSTD_LIBNAME      "Zstd"
  ------------------
  |  Branch (431:7): [True: 0, False: 6]
  ------------------
  432|     60|  for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (432:19): [True: 54, False: 6]
  ------------------
  433|     54|    if (clibcode == g_codecs[i].complib)
  ------------------
  |  Branch (433:9): [True: 0, False: 54]
  ------------------
  434|      0|      return g_codecs[i].compname;
  435|     54|  }
  436|      6|  return NULL;                  /* should never happen */
  437|      6|}
blosc2.c:blosc_run_decompression_with_context:
 4453|  16.1k|                                                void* dest, int32_t destsize) {
 4454|  16.1k|  blosc_header header;
 4455|  16.1k|  int32_t ntbytes;
 4456|  16.1k|  int rc;
 4457|       |
 4458|  16.1k|  rc = read_chunk_header(src, srcsize, true, &header);
 4459|  16.1k|  if (rc < 0) {
  ------------------
  |  Branch (4459:7): [True: 50, False: 16.1k]
  ------------------
 4460|     50|    return rc;
 4461|     50|  }
 4462|       |
 4463|  16.1k|  if (header.nbytes > destsize) {
  ------------------
  |  Branch (4463:7): [True: 83, False: 16.0k]
  ------------------
 4464|       |    // Not enough space for writing into the destination
 4465|     83|    return BLOSC2_ERROR_WRITE_BUFFER;
 4466|     83|  }
 4467|       |
 4468|  16.0k|  rc = initialize_context_decompression(context, &header, src, srcsize, dest, destsize);
 4469|  16.0k|  if (rc < 0) {
  ------------------
  |  Branch (4469:7): [True: 908, False: 15.1k]
  ------------------
 4470|    908|    return rc;
 4471|    908|  }
 4472|       |
 4473|       |  /* Do the actual decompression */
 4474|  15.1k|  ntbytes = do_job(context);
 4475|  15.1k|  if (ntbytes < 0) {
  ------------------
  |  Branch (4475:7): [True: 14.0k, False: 1.02k]
  ------------------
 4476|  14.0k|    return ntbytes;
 4477|  14.0k|  }
 4478|       |
 4479|  15.1k|  assert(ntbytes <= (int32_t)destsize);
 4480|  1.02k|  return ntbytes;
 4481|  15.1k|}
blosc2.c:initialize_context_decompression:
 3146|  16.0k|                                            int32_t srcsize, void* dest, int32_t destsize) {
 3147|  16.0k|  int32_t bstarts_end;
 3148|  16.0k|  bool vlblocks;
 3149|       |
 3150|  16.0k|  context->do_compress = 0;
 3151|  16.0k|  context->src = (const uint8_t*)src;
 3152|  16.0k|  context->srcsize = srcsize;
 3153|  16.0k|  context->dest = (uint8_t*)dest;
 3154|  16.0k|  context->destsize = destsize;
 3155|  16.0k|  context->output_bytes = 0;
 3156|  16.0k|  context->vlblock_sources = NULL;
 3157|  16.0k|  context->vlblock_dests = NULL;
 3158|  16.0k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (3158:7): [True: 0, False: 16.0k]
  ------------------
 3159|      0|    free(context->blocknbytes);
 3160|      0|    context->blocknbytes = NULL;
 3161|      0|  }
 3162|  16.0k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (3162:7): [True: 0, False: 16.0k]
  ------------------
 3163|      0|    free(context->blockoffsets);
 3164|      0|    context->blockoffsets = NULL;
 3165|      0|  }
 3166|  16.0k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (3166:7): [True: 0, False: 16.0k]
  ------------------
 3167|      0|    free(context->blockcbytes);
 3168|      0|    context->blockcbytes = NULL;
 3169|      0|  }
 3170|       |
 3171|  16.0k|  int rc = blosc2_initialize_context_from_header(context, header);
 3172|  16.0k|  if (rc < 0) {
  ------------------
  |  Branch (3172:7): [True: 0, False: 16.0k]
  ------------------
 3173|      0|    return rc;
 3174|      0|  }
 3175|  16.0k|  clear_context_decompression_dict(context);
 3176|  16.0k|  vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 3177|  16.0k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (3177:19): [True: 7.37k, False: 8.64k]
  ------------------
 3178|  7.37k|                  (context->blosc2_flags & 0x08u));
  ------------------
  |  Branch (3178:19): [True: 191, False: 7.18k]
  ------------------
 3179|       |
 3180|       |  /* Check that we have enough space to decompress */
 3181|  16.0k|  if (context->sourcesize > (int32_t)context->destsize) {
  ------------------
  |  Branch (3181:7): [True: 0, False: 16.0k]
  ------------------
 3182|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 3183|      0|  }
 3184|       |
 3185|  16.0k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (3185:7): [True: 0, False: 16.0k]
  ------------------
 3186|      0|    if (context->block_maskout_nitems != context->nblocks) {
  ------------------
  |  Branch (3186:9): [True: 0, False: 0]
  ------------------
 3187|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3188|      0|                        " of blocks in chunk (%d).",
 3189|      0|                        context->block_maskout_nitems, context->nblocks);
 3190|      0|      return BLOSC2_ERROR_DATA;
 3191|      0|    }
 3192|      0|    if (filters_contain(context->filters, BLOSC_DELTA)) {
  ------------------
  |  Branch (3192:9): [True: 0, False: 0]
  ------------------
 3193|      0|      bool any_needed = false;
 3194|      0|      for (int i = 0; i < context->block_maskout_nitems; ++i) {
  ------------------
  |  Branch (3194:23): [True: 0, False: 0]
  ------------------
 3195|      0|        if (!context->block_maskout[i]) {
  ------------------
  |  Branch (3195:13): [True: 0, False: 0]
  ------------------
 3196|      0|          any_needed = true;
 3197|      0|          break;
 3198|      0|        }
 3199|      0|      }
 3200|      0|      if (any_needed) {
  ------------------
  |  Branch (3200:11): [True: 0, False: 0]
  ------------------
 3201|       |        // Delta filter encodes subsequent blocks relative to block 0; block 0 must be unmasked.
 3202|      0|        context->block_maskout[0] = false;
 3203|      0|      }
 3204|      0|    }
 3205|      0|  }
 3206|       |
 3207|  16.0k|  context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
 3208|  16.0k|  if (context->special_type > BLOSC2_SPECIAL_LASTID) {
  ------------------
  |  Branch (3208:7): [True: 1, False: 16.0k]
  ------------------
 3209|      1|    BLOSC_TRACE_ERROR("Unknown special values ID (%d) ",
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3210|      1|                      context->special_type);
 3211|      1|    return BLOSC2_ERROR_DATA;
 3212|      1|  }
 3213|       |
 3214|  16.0k|  int memcpyed = (context->header_flags & (uint8_t) BLOSC_MEMCPYED);
 3215|  16.0k|  if (memcpyed && (header->cbytes != header->nbytes + context->header_overhead)) {
  ------------------
  |  Branch (3215:7): [True: 45, False: 15.9k]
  |  Branch (3215:19): [True: 19, False: 26]
  ------------------
 3216|     19|    BLOSC_TRACE_ERROR("Wrong header info for this memcpyed chunk");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3217|     19|    return BLOSC2_ERROR_DATA;
 3218|     19|  }
 3219|       |
 3220|  16.0k|  if ((header->nbytes == 0) && (header->cbytes == context->header_overhead) &&
  ------------------
  |  Branch (3220:7): [True: 0, False: 16.0k]
  |  Branch (3220:32): [True: 0, False: 0]
  ------------------
 3221|      0|      !context->special_type) {
  ------------------
  |  Branch (3221:7): [True: 0, False: 0]
  ------------------
 3222|       |    // A compressed buffer with only a header can only contain a zero-length buffer
 3223|      0|    return 0;
 3224|      0|  }
 3225|       |
 3226|  16.0k|  context->bstarts = (int32_t *) (context->src + context->header_overhead);
 3227|  16.0k|  bstarts_end = context->header_overhead;
 3228|  16.0k|  if (!context->special_type && !memcpyed) {
  ------------------
  |  Branch (3228:7): [True: 15.8k, False: 203]
  |  Branch (3228:33): [True: 15.7k, False: 26]
  ------------------
 3229|  15.7k|    size_t bstarts_end_tmp;
 3230|  15.7k|    size_t bstarts_nbytes;
 3231|  15.7k|    if (context->nblocks < 0 ||
  ------------------
  |  Branch (3231:9): [True: 0, False: 15.7k]
  ------------------
 3232|  15.7k|        !blosc2_checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (3232:9): [True: 0, False: 15.7k]
  ------------------
 3233|  15.7k|        !blosc2_checked_add_size((size_t)context->header_overhead, bstarts_nbytes, &bstarts_end_tmp) ||
  ------------------
  |  Branch (3233:9): [True: 0, False: 15.7k]
  ------------------
 3234|  15.7k|        bstarts_end_tmp > (size_t)INT32_MAX) {
  ------------------
  |  Branch (3234:9): [True: 0, False: 15.7k]
  ------------------
 3235|      0|      BLOSC_TRACE_ERROR("Invalid bstarts size in 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3236|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 3237|      0|    }
 3238|       |    /* If chunk is not special or a memcpyed, we do have a bstarts section */
 3239|  15.7k|    bstarts_end = (int32_t)bstarts_end_tmp;
 3240|  15.7k|  }
 3241|       |
 3242|  16.0k|  if (srcsize < bstarts_end) {
  ------------------
  |  Branch (3242:7): [True: 68, False: 15.9k]
  ------------------
 3243|     68|    BLOSC_TRACE_ERROR("`bstarts` exceeds length of source buffer.");
  ------------------
  |  |   93|     68|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     68|    do {                                            \
  |  |  |  |   98|     68|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     68|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 68, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     68|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3244|     68|    return BLOSC2_ERROR_READ_BUFFER;
 3245|     68|  }
 3246|       |
 3247|  15.9k|  if (vlblocks && is_lazy && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (3247:7): [True: 256, False: 15.6k]
  |  Branch (3247:19): [True: 94, False: 162]
  |  Branch (3247:30): [True: 94, False: 0]
  |  Branch (3247:56): [True: 94, False: 0]
  ------------------
 3248|     94|    size_t block_csizes_nbytes;
 3249|     94|    size_t trailer_meta_nbytes;
 3250|     94|    size_t lazy_trailer_end;
 3251|     94|    if (context->srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (3251:9): [True: 0, False: 94]
  |  Branch (3251:33): [True: 0, False: 94]
  ------------------
 3252|     94|        !blosc2_checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (3252:9): [True: 0, False: 94]
  ------------------
 3253|     94|        !blosc2_checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (3253:9): [True: 0, False: 94]
  ------------------
 3254|     94|        !blosc2_checked_add_size((size_t)bstarts_end, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (3254:9): [True: 0, False: 94]
  ------------------
 3255|     94|        (size_t)context->srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (3255:9): [True: 8, False: 86]
  ------------------
 3256|      8|      BLOSC_TRACE_ERROR("Lazy trailer exceeds source buffer.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3257|      8|      return BLOSC2_ERROR_READ_BUFFER;
 3258|      8|    }
 3259|     94|  }
 3260|  15.9k|  srcsize -= bstarts_end;
 3261|       |
 3262|       |  /* Read optional dictionary if flag set.  A memcpyed chunk has none, even if the flag says so
 3263|       |     (older versions left it on chunks with a dictionary that did not compress) */
 3264|  15.9k|  if ((context->blosc2_flags & BLOSC2_USEDICT) && !memcpyed && !is_lazy) {
  ------------------
  |  Branch (3264:7): [True: 4.41k, False: 11.5k]
  |  Branch (3264:51): [True: 4.40k, False: 1]
  |  Branch (3264:64): [True: 4.37k, False: 36]
  ------------------
 3265|  4.37k|    context->use_dict = 1;
 3266|       |    // The dictionary section is after the bstarts block: [int32 size | raw bytes]
 3267|  4.37k|    if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (3267:9): [True: 3, False: 4.37k]
  ------------------
 3268|      3|      BLOSC_TRACE_ERROR("Not enough space to read size of dictionary.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3269|      3|      return BLOSC2_ERROR_READ_BUFFER;
 3270|      3|    }
 3271|  4.37k|    srcsize -= sizeof(int32_t);
 3272|       |    // Read dictionary size
 3273|  4.37k|    context->dict_size = sw32_(context->src + bstarts_end);
 3274|  4.37k|    if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (3274:9): [True: 32, False: 4.33k]
  |  Branch (3274:36): [True: 19, False: 4.31k]
  ------------------
 3275|     51|      BLOSC_TRACE_ERROR("Dictionary size is smaller than minimum or larger than maximum allowed.");
  ------------------
  |  |   93|     51|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     51|    do {                                            \
  |  |  |  |   98|     51|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     51|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 51, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     51|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3276|     51|      return BLOSC2_ERROR_CODEC_DICT;
 3277|     51|    }
 3278|  4.31k|    if (srcsize < (int32_t)context->dict_size) {
  ------------------
  |  Branch (3278:9): [True: 13, False: 4.30k]
  ------------------
 3279|     13|      BLOSC_TRACE_ERROR("Not enough space to read entire dictionary.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3280|     13|      return BLOSC2_ERROR_READ_BUFFER;
 3281|     13|    }
 3282|  4.30k|    srcsize -= context->dict_size;
 3283|       |    // dict_buffer points directly into the source chunk — no copy needed
 3284|  4.30k|    context->dict_buffer = (void*)(context->src + bstarts_end + sizeof(int32_t));
 3285|  4.30k|    context->dict_buffer_owned = false;
 3286|  4.30k|#if defined(HAVE_ZSTD)
 3287|       |    // context->compcode during decompression holds the format code (flags >> 5),
 3288|       |    // so compare against BLOSC_ZSTD_FORMAT (not BLOSC_ZSTD).
 3289|  4.30k|    if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (3289:9): [True: 3.73k, False: 576]
  ------------------
 3290|  3.73k|      context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 3291|  3.73k|      if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (3291:11): [True: 472, False: 3.25k]
  ------------------
 3292|    472|        BLOSC_TRACE_ERROR("Cannot create ZSTD dictionary for chunk.");
  ------------------
  |  |   93|    472|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    472|    do {                                            \
  |  |  |  |   98|    472|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    472|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 472, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    472|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3293|    472|        return BLOSC2_ERROR_CODEC_DICT;
 3294|    472|      }
 3295|  3.73k|    }
 3296|  4.30k|#endif   // HAVE_ZSTD
 3297|       |    // For LZ4/LZ4HC: dict_buffer and dict_size are sufficient; no digested object needed.
 3298|  4.30k|  }
 3299|  11.5k|  else if ((context->blosc2_flags & BLOSC2_USEDICT) && !memcpyed && is_lazy) {
  ------------------
  |  Branch (3299:12): [True: 37, False: 11.5k]
  |  Branch (3299:56): [True: 36, False: 1]
  |  Branch (3299:69): [True: 36, False: 0]
  ------------------
 3300|     36|    rc = load_lazy_chunk_dict(context, header, bstarts_end);
 3301|     36|    if (rc < 0) {
  ------------------
  |  Branch (3301:9): [True: 36, False: 0]
  ------------------
 3302|     36|      return rc;
 3303|     36|    }
 3304|     36|  }
 3305|       |
 3306|  15.3k|  if (vlblocks && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (3306:7): [True: 245, False: 15.1k]
  |  Branch (3306:19): [True: 245, False: 0]
  |  Branch (3306:45): [True: 245, False: 0]
  ------------------
 3307|    245|    context->blocknbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 3308|    245|    BLOSC_ERROR_NULL(context->blocknbytes, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    245|    do {                                            \
  |  |  105|    245|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 245]
  |  |  ------------------
  |  |  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|    245|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 245]
  |  |  ------------------
  ------------------
 3309|    245|    context->blockoffsets = malloc((size_t)context->nblocks * sizeof(int32_t));
 3310|    245|    BLOSC_ERROR_NULL(context->blockoffsets, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    245|    do {                                            \
  |  |  105|    245|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 245]
  |  |  ------------------
  |  |  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|    245|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 245]
  |  |  ------------------
  ------------------
 3311|    245|    context->blockcbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 3312|    245|    BLOSC_ERROR_NULL(context->blockcbytes, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    245|    do {                                            \
  |  |  105|    245|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 245]
  |  |  ------------------
  |  |  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|    245|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 245]
  |  |  ------------------
  ------------------
 3313|       |
 3314|    245|    if (is_lazy) {
  ------------------
  |  Branch (3314:9): [True: 85, False: 160]
  ------------------
 3315|       |      // Lazy VL: block data is on disk, so blocknbytes is unknown at this point.
 3316|       |      // Populate blockcbytes from bstarts differences; blocksize gets max(blockcbytes)
 3317|       |      // as a safe upper bound so tmp buffers are large enough for the lazy block read.
 3318|     85|      int32_t max_csize = 0;
 3319|    112|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (3319:27): [True: 107, False: 5]
  ------------------
 3320|    107|        int32_t bstart = sw32_(context->bstarts + i);
 3321|    107|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (3321:31): [True: 69, False: 38]
  ------------------
 3322|     69|            sw32_(context->bstarts + i + 1) : header->cbytes;
 3323|    107|        if (bstart < bstarts_end || next_bstart <= bstart ||
  ------------------
  |  Branch (3323:13): [True: 5, False: 102]
  |  Branch (3323:37): [True: 32, False: 70]
  ------------------
 3324|     80|            next_bstart > header->cbytes) {
  ------------------
  |  Branch (3324:13): [True: 43, False: 27]
  ------------------
 3325|     80|          BLOSC_TRACE_ERROR("Invalid VL-block offsets in lazy chunk.");
  ------------------
  |  |   93|     80|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     80|    do {                                            \
  |  |  |  |   98|     80|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     80|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 80, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     80|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3326|     80|          return BLOSC2_ERROR_INVALID_HEADER;
 3327|     80|        }
 3328|     27|        context->blocknbytes[i] = 0;   // unknown until block is read from disk
 3329|     27|        context->blockoffsets[i] = 0;  // unknown
 3330|     27|        context->blockcbytes[i] = next_bstart - bstart;
 3331|     27|        if (context->blockcbytes[i] > max_csize) {
  ------------------
  |  Branch (3331:13): [True: 17, False: 10]
  ------------------
 3332|     17|          max_csize = context->blockcbytes[i];
 3333|     17|        }
 3334|     27|      }
 3335|      5|      context->blocksize = max_csize;
 3336|      5|      context->leftover = 0;
 3337|      5|    }
 3338|    160|    else {
 3339|    160|      int32_t max_blocksize = 0;
 3340|    160|      int64_t total_nbytes = 0;
 3341|    160|      int32_t prev_bstart = 0;
 3342|    181|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (3342:27): [True: 175, False: 6]
  ------------------
 3343|    175|        int32_t bstart = sw32_(context->bstarts + i);
 3344|    175|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (3344:31): [True: 65, False: 110]
  ------------------
 3345|    110|            sw32_(context->bstarts + i + 1) : header->cbytes;
 3346|    175|        if (bstart < bstarts_end || bstart <= prev_bstart || next_bstart <= bstart ||
  ------------------
  |  Branch (3346:13): [True: 4, False: 171]
  |  Branch (3346:37): [True: 0, False: 171]
  |  Branch (3346:62): [True: 47, False: 124]
  ------------------
 3347|    124|            next_bstart > header->cbytes || bstart > context->srcsize - (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (3347:13): [True: 39, False: 85]
  |  Branch (3347:45): [True: 2, False: 83]
  ------------------
 3348|     92|          BLOSC_TRACE_ERROR("Invalid VL-block offsets in chunk.");
  ------------------
  |  |   93|     92|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     92|    do {                                            \
  |  |  |  |   98|     92|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     92|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 92, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     92|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3349|     92|          return BLOSC2_ERROR_INVALID_HEADER;
 3350|     92|        }
 3351|     83|        context->blocknbytes[i] = sw32_(context->src + bstart);
 3352|     83|        context->blockcbytes[i] = next_bstart - bstart;
 3353|     83|        if (context->blocknbytes[i] <= 0) {
  ------------------
  |  Branch (3353:13): [True: 19, False: 64]
  ------------------
 3354|     19|          BLOSC_TRACE_ERROR("Invalid VL-block uncompressed size in chunk.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3355|     19|          return BLOSC2_ERROR_INVALID_HEADER;
 3356|     19|        }
 3357|     64|        if (total_nbytes > INT32_MAX) {
  ------------------
  |  Branch (3357:13): [True: 0, False: 64]
  ------------------
 3358|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3359|      0|          return BLOSC2_ERROR_INVALID_HEADER;
 3360|      0|        }
 3361|     64|        context->blockoffsets[i] = (int32_t)total_nbytes;
 3362|     64|        total_nbytes += context->blocknbytes[i];
 3363|     64|        if (total_nbytes > context->sourcesize) {
  ------------------
  |  Branch (3363:13): [True: 43, False: 21]
  ------------------
 3364|     43|          BLOSC_TRACE_ERROR("VL-block sizes exceed chunk nbytes.");
  ------------------
  |  |   93|     43|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     43|    do {                                            \
  |  |  |  |   98|     43|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     43|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 43, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     43|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3365|     43|          return BLOSC2_ERROR_INVALID_HEADER;
 3366|     43|        }
 3367|     21|        if (context->blocknbytes[i] > max_blocksize) {
  ------------------
  |  Branch (3367:13): [True: 16, False: 5]
  ------------------
 3368|     16|          max_blocksize = context->blocknbytes[i];
 3369|     16|        }
 3370|     21|        prev_bstart = bstart;
 3371|     21|      }
 3372|      6|      if (total_nbytes != context->sourcesize) {
  ------------------
  |  Branch (3372:11): [True: 3, False: 3]
  ------------------
 3373|      3|        BLOSC_TRACE_ERROR("VL-block sizes do not add up to chunk nbytes.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3374|      3|        return BLOSC2_ERROR_INVALID_HEADER;
 3375|      3|      }
 3376|      3|      context->blocksize = max_blocksize;
 3377|      3|      context->leftover = 0;
 3378|      3|    }
 3379|    245|  }
 3380|       |
 3381|  15.1k|  return 0;
 3382|  15.3k|}
blosc2.c:load_lazy_chunk_dict:
 3092|     36|static int load_lazy_chunk_dict(blosc2_context* context, blosc_header* header, int32_t bstarts_end) {
 3093|     36|  int32_t dict_offset = bstarts_end;
 3094|     36|  if (header->cbytes < dict_offset + (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (3094:7): [True: 3, False: 33]
  ------------------
 3095|      3|    BLOSC_TRACE_ERROR("Lazy chunk dictionary header exceeds chunk length.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3096|      3|    return BLOSC2_ERROR_INVALID_HEADER;
 3097|      3|  }
 3098|       |
 3099|     33|  uint8_t dict_size_buf[sizeof(int32_t)];
 3100|     33|  int rc = read_lazy_chunk_bytes(context, dict_offset, dict_size_buf, (int32_t)sizeof(dict_size_buf),
 3101|     33|                                 "Cannot open frame file for lazy chunk dictionary read.",
 3102|     33|                                 "Cannot read lazy chunk dictionary size from disk.");
 3103|     33|  if (rc < 0) {
  ------------------
  |  Branch (3103:7): [True: 33, False: 0]
  ------------------
 3104|     33|    return rc;
 3105|     33|  }
 3106|       |
 3107|      0|  context->dict_size = sw32_(dict_size_buf);
 3108|      0|  if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (3108:7): [True: 0, False: 0]
  |  Branch (3108:34): [True: 0, False: 0]
  ------------------
 3109|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3110|      0|    return BLOSC2_ERROR_CODEC_DICT;
 3111|      0|  }
 3112|      0|  if (header->cbytes < dict_offset + (int32_t)sizeof(int32_t) + context->dict_size) {
  ------------------
  |  Branch (3112:7): [True: 0, False: 0]
  ------------------
 3113|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3114|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 3115|      0|  }
 3116|       |
 3117|      0|  context->dict_buffer = malloc((size_t)context->dict_size);
 3118|      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]
  |  |  ------------------
  ------------------
 3119|      0|  context->dict_buffer_owned = true;
 3120|      0|  rc = read_lazy_chunk_bytes(context, dict_offset + (int32_t)sizeof(int32_t),
 3121|      0|                             context->dict_buffer, context->dict_size,
 3122|      0|                             "Cannot open frame file for lazy chunk dictionary read.",
 3123|      0|                             "Cannot read lazy chunk dictionary from disk.");
 3124|      0|  if (rc < 0) {
  ------------------
  |  Branch (3124:7): [True: 0, False: 0]
  ------------------
 3125|      0|    release_context_dict_buffer(context);
 3126|      0|    return rc;
 3127|      0|  }
 3128|       |
 3129|      0|  context->use_dict = 1;
 3130|      0|#if defined(HAVE_ZSTD)
 3131|      0|  if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (3131:7): [True: 0, False: 0]
  ------------------
 3132|      0|    context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 3133|      0|    if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (3133:9): [True: 0, False: 0]
  ------------------
 3134|      0|      release_context_dict_buffer(context);
 3135|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3136|      0|      return BLOSC2_ERROR_CODEC_DICT;
 3137|      0|    }
 3138|      0|  }
 3139|      0|#endif
 3140|       |
 3141|      0|  return 0;
 3142|      0|}
blosc2.c:do_job:
 2776|  15.1k|static int do_job(blosc2_context* context) {
 2777|  15.1k|  int32_t ntbytes;
 2778|       |
 2779|       |  /* Set sentinels */
 2780|  15.1k|  context->dref_not_init = 1;
 2781|       |
 2782|       |  /* Apply thread-count changes before deciding whether this operation actually
 2783|       |     needs a parallel backend.  POSIX defers backend startup for serial jobs.
 2784|       |     Windows keeps its existing per-context thread lifecycle and starts/rebinds
 2785|       |     the backend eagerly. */
 2786|       |#if defined(_WIN32)
 2787|       |  int rc = check_nthreads(context, true);
 2788|       |#else
 2789|  15.1k|  int rc = check_nthreads(context, false);
 2790|  15.1k|#endif
 2791|       |
 2792|       |  /* Run serially with one thread, with fewer than two full blocks of source
 2793|       |     data, or if thread configuration/backend setup fails. */
 2794|  15.1k|  if (context->nthreads == 1 || (context->sourcesize / context->blocksize) <= 1 || rc < 0) {
  ------------------
  |  Branch (2794:7): [True: 15.1k, False: 0]
  |  Branch (2794:33): [True: 0, False: 0]
  |  Branch (2794:84): [True: 0, False: 0]
  ------------------
 2795|  15.1k|    ntbytes = run_serial_job(context);
 2796|  15.1k|  }
 2797|      0|  else {
 2798|      0|    rc = check_nthreads(context, true);
 2799|      0|    if (rc < 0) {
  ------------------
  |  Branch (2799:9): [True: 0, False: 0]
  ------------------
 2800|       |      /* Backend startup failed; run serially and retry on the next parallel job. */
 2801|      0|      ntbytes = run_serial_job(context);
 2802|      0|    }
 2803|      0|    else {
 2804|      0|      ntbytes = parallel_blosc(context);
 2805|      0|    }
 2806|      0|  }
 2807|       |
 2808|  15.1k|  return ntbytes;
 2809|  15.1k|}
blosc2.c:run_serial_job:
 2764|  15.1k|static int run_serial_job(blosc2_context* context) {
 2765|  15.1k|  struct thread_context* thread_context = serial_context_get(context);
 2766|  15.1k|  if (thread_context == NULL) {
  ------------------
  |  Branch (2766:7): [True: 0, False: 15.1k]
  ------------------
 2767|      0|    return BLOSC2_ERROR_THREAD_CREATE;
 2768|      0|  }
 2769|  15.1k|  int ntbytes = serial_blosc(thread_context);
 2770|  15.1k|  serial_context_put(thread_context);
 2771|  15.1k|  return ntbytes;
 2772|  15.1k|}
blosc2.c:serial_blosc:
 2511|  15.1k|static int serial_blosc(struct thread_context* thread_context) {
 2512|  15.1k|  blosc2_context* context = thread_context->parent_context;
 2513|  15.1k|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2514|  15.1k|  int32_t j, bsize, leftoverblock;
 2515|  15.1k|  int32_t cbytes;
 2516|  15.1k|  int32_t ntbytes = context->output_bytes;
 2517|  15.1k|  int32_t* bstarts = context->bstarts;
 2518|  15.1k|  uint8_t* tmp = thread_context->tmp;
 2519|  15.1k|  uint8_t* tmp2 = thread_context->tmp2;
 2520|  15.1k|  int dict_training = context->use_dict && (context->dict_cdict == NULL);
  ------------------
  |  Branch (2520:23): [True: 3.83k, False: 11.2k]
  |  Branch (2520:44): [True: 3.83k, False: 0]
  ------------------
 2521|  15.1k|  bool memcpyed = context->header_flags & (uint8_t)BLOSC_MEMCPYED;
 2522|  15.1k|  if (!context->do_compress && context->special_type) {
  ------------------
  |  Branch (2522:7): [True: 15.1k, False: 0]
  |  Branch (2522:32): [True: 147, False: 14.9k]
  ------------------
 2523|       |    // Fake a runlen as if it was a memcpyed chunk
 2524|    147|    memcpyed = true;
 2525|    147|  }
 2526|       |
 2527|  29.1k|  for (j = 0; j < context->nblocks; j++) {
  ------------------
  |  Branch (2527:15): [True: 28.1k, False: 1.02k]
  ------------------
 2528|  28.1k|    if (context->do_compress && !memcpyed && !dict_training) {
  ------------------
  |  Branch (2528:9): [True: 0, False: 28.1k]
  |  Branch (2528:33): [True: 0, False: 0]
  |  Branch (2528:46): [True: 0, False: 0]
  ------------------
 2529|      0|      _sw32(bstarts + j, ntbytes);
 2530|      0|    }
 2531|  28.1k|    bsize = vlblocks ? context->blocknbytes[j] : context->blocksize;
  ------------------
  |  Branch (2531:13): [True: 9, False: 28.1k]
  ------------------
 2532|  28.1k|    leftoverblock = 0;
 2533|  28.1k|    if (!vlblocks && (j == context->nblocks - 1) && (context->leftover > 0)) {
  ------------------
  |  Branch (2533:9): [True: 28.1k, False: 9]
  |  Branch (2533:22): [True: 12.0k, False: 16.0k]
  |  Branch (2533:53): [True: 535, False: 11.5k]
  ------------------
 2534|    535|      bsize = context->leftover;
 2535|    535|      leftoverblock = 1;
 2536|    535|    }
 2537|  28.1k|    if (context->do_compress) {
  ------------------
  |  Branch (2537:9): [True: 0, False: 28.1k]
  ------------------
 2538|      0|      if (memcpyed && !context->prefilter) {
  ------------------
  |  Branch (2538:11): [True: 0, False: 0]
  |  Branch (2538:23): [True: 0, False: 0]
  ------------------
 2539|       |        /* We want to memcpy only */
 2540|      0|        memcpy(context->dest + context->header_overhead + j * context->blocksize,
 2541|      0|               context->src + j * context->blocksize, (unsigned int)bsize);
 2542|      0|        cbytes = (int32_t)bsize;
 2543|      0|      }
 2544|      0|      else {
 2545|       |        /* Regular compression */
 2546|      0|        cbytes = blosc_c(thread_context, bsize, leftoverblock, ntbytes,
 2547|      0|                         context->destsize,
 2548|      0|                         vlblocks ? context->vlblock_sources[j] : context->src,
  ------------------
  |  Branch (2548:26): [True: 0, False: 0]
  ------------------
 2549|      0|                         vlblocks ? 0 : j * context->blocksize,
  ------------------
  |  Branch (2549:26): [True: 0, False: 0]
  ------------------
 2550|      0|                         context->dest + ntbytes, tmp, tmp2);
 2551|      0|        if (cbytes == 0) {
  ------------------
  |  Branch (2551:13): [True: 0, False: 0]
  ------------------
 2552|      0|          ntbytes = 0;              /* incompressible data */
 2553|      0|          break;
 2554|      0|        }
 2555|      0|      }
 2556|      0|    }
 2557|  28.1k|    else {
 2558|       |      /* Regular decompression */
 2559|       |      // If memcpyed we don't have a bstarts section (because it is not needed)
 2560|  28.1k|      int32_t src_offset = memcpyed ?
  ------------------
  |  Branch (2560:28): [True: 2.02k, False: 26.0k]
  ------------------
 2561|  26.0k|          context->header_overhead + j * context->blocksize : sw32_(bstarts + j);
 2562|  28.1k|      uint8_t *dest_block = (vlblocks && context->vlblock_dests != NULL) ? context->vlblock_dests[j] : context->dest;
  ------------------
  |  Branch (2562:30): [True: 9, False: 28.1k]
  |  Branch (2562:42): [True: 0, False: 9]
  ------------------
 2563|  28.1k|      int32_t dest_offset = (vlblocks && context->vlblock_dests != NULL) ? 0 :
  ------------------
  |  Branch (2563:30): [True: 9, False: 28.1k]
  |  Branch (2563:42): [True: 0, False: 9]
  ------------------
 2564|  28.1k|                            (vlblocks ? context->blockoffsets[j] : j * context->blocksize);
  ------------------
  |  Branch (2564:30): [True: 9, False: 28.1k]
  ------------------
 2565|  28.1k|      cbytes = blosc_d(thread_context, bsize, leftoverblock, memcpyed,
 2566|  28.1k|                       context->src, context->srcsize, src_offset, j,
 2567|  28.1k|                       dest_block, dest_offset, tmp, tmp2);
 2568|  28.1k|    }
 2569|       |
 2570|  28.1k|    if (cbytes < 0) {
  ------------------
  |  Branch (2570:9): [True: 14.0k, False: 14.0k]
  ------------------
 2571|  14.0k|      ntbytes = cbytes;         /* error in blosc_c or blosc_d */
 2572|  14.0k|      break;
 2573|  14.0k|    }
 2574|  14.0k|    ntbytes += cbytes;
 2575|  14.0k|  }
 2576|       |
 2577|  15.1k|  return ntbytes;
 2578|  15.1k|}
blosc2.c:read_lazy_chunk_bytes:
 3004|     33|                                 const char* open_error, const char* read_error) {
 3005|     33|  int32_t chunk_cbytes;
 3006|     33|  if (context->src == NULL || context->srcsize < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3006:7): [True: 0, False: 33]
  |  Branch (3006:31): [True: 0, False: 33]
  ------------------
 3007|     33|      offset < 0 || nbytes < 0 || context->nblocks <= 0 ||
  ------------------
  |  Branch (3007:7): [True: 0, False: 33]
  |  Branch (3007:21): [True: 0, False: 33]
  |  Branch (3007:35): [True: 0, False: 33]
  ------------------
 3008|     33|      blosc2_cbuffer_sizes(context->src, NULL, &chunk_cbytes, NULL) < 0 ||
  ------------------
  |  Branch (3008:7): [True: 0, False: 33]
  ------------------
 3009|     33|      offset > chunk_cbytes || nbytes > chunk_cbytes - offset) {
  ------------------
  |  Branch (3009:7): [True: 0, False: 33]
  |  Branch (3009:32): [True: 0, False: 33]
  ------------------
 3010|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 3011|      0|  }
 3012|     33|  int64_t trailer_end = BLOSC_EXTENDED_HEADER_LENGTH +
 3013|     33|      (int64_t)context->nblocks * sizeof(int32_t) + sizeof(int32_t) + sizeof(int64_t);
 3014|     33|  if (trailer_end > context->srcsize) return BLOSC2_ERROR_READ_BUFFER;
  ------------------
  |  Branch (3014:7): [True: 14, False: 19]
  ------------------
 3015|     19|  if (context->schunk == NULL || context->schunk->frame == NULL) {
  ------------------
  |  Branch (3015:7): [True: 19, False: 0]
  |  Branch (3015:34): [True: 0, False: 0]
  ------------------
 3016|     19|    BLOSC_TRACE_ERROR("Lazy chunk needs an associated super-chunk with a frame.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3017|     19|    return BLOSC2_ERROR_INVALID_PARAM;
 3018|     19|  }
 3019|       |
 3020|      0|  blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 3021|      0|  blosc2_io_cb* io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 3022|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (3022:7): [True: 0, False: 0]
  ------------------
 3023|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3024|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 3025|      0|  }
 3026|       |
 3027|      0|  int32_t trailer_offset = BLOSC_EXTENDED_HEADER_LENGTH +
 3028|      0|                           context->nblocks * (int32_t)sizeof(int32_t);
 3029|      0|  int32_t nchunk_lazy;
 3030|      0|  int64_t chunk_offset;
 3031|      0|  memcpy(&nchunk_lazy, context->src + trailer_offset, sizeof(nchunk_lazy));
 3032|      0|  memcpy(&chunk_offset, context->src + trailer_offset + (int32_t)sizeof(int32_t), sizeof(chunk_offset));
 3033|      0|  if (nchunk_lazy < 0 || chunk_offset < 0 || frame->file_offset < 0 ||
  ------------------
  |  Branch (3033:7): [True: 0, False: 0]
  |  Branch (3033:26): [True: 0, False: 0]
  |  Branch (3033:46): [True: 0, False: 0]
  ------------------
 3034|      0|      (!frame->sframe && (chunk_offset < 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 (3034:8): [True: 0, False: 0]
  |  Branch (3034:27): [True: 0, False: 0]
  ------------------
 3035|      0|       chunk_offset > frame->len || chunk_cbytes > frame->len - chunk_offset))) {
  ------------------
  |  Branch (3035:8): [True: 0, False: 0]
  |  Branch (3035:37): [True: 0, False: 0]
  ------------------
 3036|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 3037|      0|  }
 3038|       |
 3039|      0|  void* fp = NULL;
 3040|      0|  int64_t io_pos;
 3041|      0|  if (frame->sframe) {
  ------------------
  |  Branch (3041:7): [True: 0, False: 0]
  ------------------
 3042|      0|    fp = sframe_open_chunk(frame->urlpath, nchunk_lazy, "rb", context->schunk->storage->io);
 3043|      0|    io_pos = offset;
 3044|      0|  }
 3045|      0|  else {
 3046|      0|    if (chunk_offset < 0 || offset < 0) {
  ------------------
  |  Branch (3046:9): [True: 0, False: 0]
  |  Branch (3046:29): [True: 0, False: 0]
  ------------------
 3047|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3048|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 3049|      0|    }
 3050|      0|    fp = frame_reader_acquire(frame, context->schunk->storage->io);
 3051|      0|    if (!blosc2_checked_add_i64(frame->file_offset, chunk_offset, &io_pos)) {
  ------------------
  |  Branch (3051:9): [True: 0, False: 0]
  ------------------
 3052|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3053|      0|      if (fp != NULL) {
  ------------------
  |  Branch (3053:11): [True: 0, False: 0]
  ------------------
 3054|      0|        frame_reader_release(frame, io_cb, fp);
 3055|      0|      }
 3056|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 3057|      0|    }
 3058|      0|    if (!blosc2_checked_add_i64(io_pos, offset, &io_pos)) {
  ------------------
  |  Branch (3058:9): [True: 0, False: 0]
  ------------------
 3059|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3060|      0|      if (fp != NULL) {
  ------------------
  |  Branch (3060:11): [True: 0, False: 0]
  ------------------
 3061|      0|        frame_reader_release(frame, io_cb, fp);
 3062|      0|      }
 3063|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 3064|      0|    }
 3065|      0|  }
 3066|      0|  if (fp == NULL) {
  ------------------
  |  Branch (3066:7): [True: 0, False: 0]
  ------------------
 3067|      0|    BLOSC_TRACE_ERROR("%s", open_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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3068|      0|    return BLOSC2_ERROR_FILE_OPEN;
 3069|      0|  }
 3070|      0|  if (!blosc2_checked_add_i64(io_pos, nbytes, NULL)) {
  ------------------
  |  Branch (3070:7): [True: 0, False: 0]
  ------------------
 3071|      0|    frame_reader_release(frame, io_cb, fp);
 3072|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 3073|      0|  }
 3074|       |
 3075|      0|  uint8_t* read_buffer = buffer;
 3076|      0|  int64_t rbytes = io_cb->read((void**)&read_buffer, 1, nbytes, io_pos, fp);
 3077|      0|  bool complete = rbytes == nbytes && read_buffer != NULL;
  ------------------
  |  Branch (3077:19): [True: 0, False: 0]
  |  Branch (3077:39): [True: 0, False: 0]
  ------------------
 3078|      0|  if (complete && read_buffer != buffer) {
  ------------------
  |  Branch (3078:7): [True: 0, False: 0]
  |  Branch (3078:19): [True: 0, False: 0]
  ------------------
 3079|       |    // An io that hands out its own memory (mmap) keeps owning it
 3080|      0|    memcpy(buffer, read_buffer, (size_t)nbytes);
 3081|      0|  }
 3082|      0|  frame_reader_release(frame, io_cb, fp);
 3083|      0|  if (!complete) {
  ------------------
  |  Branch (3083:7): [True: 0, False: 0]
  ------------------
 3084|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3085|      0|    return BLOSC2_ERROR_FILE_READ;
 3086|      0|  }
 3087|       |
 3088|      0|  return 0;
 3089|      0|}
blosc2.c:serial_context_get:
 2736|  15.1k|static struct thread_context* serial_context_get(blosc2_context* context) {
 2737|  15.1k|  struct thread_context* thread_context = NULL;
 2738|  15.1k|  if (context->serial_context == NULL) {
  ------------------
  |  Branch (2738:7): [True: 15.1k, False: 0]
  ------------------
 2739|  15.1k|    thread_context = serial_context_take_tls(context);
 2740|  15.1k|  }
 2741|  15.1k|  if (thread_context == NULL) {
  ------------------
  |  Branch (2741:7): [True: 0, False: 15.1k]
  ------------------
 2742|      0|    if (context->serial_context != NULL &&
  ------------------
  |  Branch (2742:9): [True: 0, False: 0]
  ------------------
 2743|      0|        context->serial_context->tmp_blocksize != context->blocksize) {
  ------------------
  |  Branch (2743:9): [True: 0, False: 0]
  ------------------
 2744|      0|      free_thread_context(context->serial_context);
 2745|      0|      context->serial_context = NULL;
 2746|      0|    }
 2747|      0|    if (context->serial_context == NULL) {
  ------------------
  |  Branch (2747:9): [True: 0, False: 0]
  ------------------
 2748|      0|      context->serial_context = create_thread_context(context, 0);
 2749|      0|      if (context->serial_context == NULL) {
  ------------------
  |  Branch (2749:11): [True: 0, False: 0]
  ------------------
 2750|      0|        return NULL;
 2751|      0|      }
 2752|      0|    }
 2753|      0|    else if (fit_thread_context(context->serial_context, context) < 0) {
  ------------------
  |  Branch (2753:14): [True: 0, False: 0]
  ------------------
 2754|      0|      return NULL;
 2755|      0|    }
 2756|      0|    thread_context = context->serial_context;
 2757|      0|  }
 2758|  15.1k|  thread_context->parent_context = context;
 2759|  15.1k|  thread_context->tid = 0;
 2760|       |  thread_context->serial = true;
 2761|  15.1k|  return thread_context;
 2762|  15.1k|}
blosc2.c:serial_context_take_tls:
 6741|  15.1k|static struct thread_context* serial_context_take_tls(blosc2_context* context) {
 6742|  15.1k|#if !defined(_WIN32)
 6743|  15.1k|  int32_t ebsize = context->blocksize + context->typesize * (int32_t)sizeof(int32_t);
 6744|  15.1k|  if ((size_t)4 * ebsize > BLOSC2_SERIAL_TLS_MAX) {
  ------------------
  |  | 6664|  15.1k|#define BLOSC2_SERIAL_TLS_MAX (16 * 1024 * 1024)
  ------------------
  |  Branch (6744:7): [True: 0, False: 15.1k]
  ------------------
 6745|      0|    return NULL;
 6746|      0|  }
 6747|  15.1k|  tmp_cache_t *cache = tmp_cache_get(true);
 6748|  15.1k|  if (cache == NULL || cache->serial_busy) {
  ------------------
  |  Branch (6748:7): [True: 0, False: 15.1k]
  |  Branch (6748:24): [True: 0, False: 15.1k]
  ------------------
 6749|      0|    return NULL;
 6750|      0|  }
 6751|  15.1k|  if (cache->serial == NULL) {
  ------------------
  |  Branch (6751:7): [True: 15.1k, False: 0]
  ------------------
 6752|  15.1k|    cache->serial = create_thread_context(context, 0);
 6753|  15.1k|    if (cache->serial == NULL) {
  ------------------
  |  Branch (6753:9): [True: 0, False: 15.1k]
  ------------------
 6754|      0|      return NULL;
 6755|      0|    }
 6756|  15.1k|  }
 6757|      0|  else if (fit_thread_context(cache->serial, context) < 0) {
  ------------------
  |  Branch (6757:12): [True: 0, False: 0]
  ------------------
 6758|      0|    return NULL;
 6759|      0|  }
 6760|  15.1k|  cache->serial_busy = true;
 6761|  15.1k|  return cache->serial;
 6762|       |#else
 6763|       |  BLOSC_UNUSED_PARAM(context);
 6764|       |  return NULL;
 6765|       |#endif
 6766|  15.1k|}
blosc2.c:create_thread_context:
 2616|  15.1k|create_thread_context(blosc2_context* context, int32_t tid) {
 2617|  15.1k|  struct thread_context* thread_context;
 2618|  15.1k|  thread_context = (struct thread_context*)my_malloc(sizeof(struct thread_context));
 2619|  15.1k|  BLOSC_ERROR_NULL(thread_context, NULL);
  ------------------
  |  |  104|  15.1k|    do {                                            \
  |  |  105|  15.1k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 15.1k]
  |  |  ------------------
  |  |  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|  15.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 15.1k]
  |  |  ------------------
  ------------------
 2620|  15.1k|  int rc = init_thread_context(thread_context, context, tid);
 2621|  15.1k|  if (rc < 0) {
  ------------------
  |  Branch (2621:7): [True: 0, False: 15.1k]
  ------------------
 2622|      0|    my_free(thread_context);
 2623|      0|    return NULL;
 2624|      0|  }
 2625|  15.1k|  return thread_context;
 2626|  15.1k|}
blosc2.c:init_thread_context:
 2584|  15.1k|{
 2585|  15.1k|  int32_t ebsize;
 2586|       |
 2587|  15.1k|  thread_context->parent_context = context;
 2588|  15.1k|  thread_context->owner_pool = NULL;
 2589|  15.1k|  thread_context->tid = tid;
 2590|  15.1k|  thread_context->serial = false;
 2591|  15.1k|  thread_context->blosclz_state = NULL;
 2592|       |
 2593|  15.1k|  int32_t blocksize = context != NULL ? context->blocksize : 0;
  ------------------
  |  Branch (2593:23): [True: 15.1k, False: 0]
  ------------------
 2594|  15.1k|  int32_t typesize = context != NULL ? context->typesize : 0;
  ------------------
  |  Branch (2594:22): [True: 15.1k, False: 0]
  ------------------
 2595|  15.1k|  ebsize = blocksize + typesize * (signed)sizeof(int32_t);
 2596|  15.1k|  thread_context->tmp_nbytes = (size_t)4 * ebsize;
 2597|  15.1k|  thread_context->tmp = my_malloc(thread_context->tmp_nbytes);
 2598|  15.1k|  BLOSC_ERROR_NULL(thread_context->tmp, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|  15.1k|    do {                                            \
  |  |  105|  15.1k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 15.1k]
  |  |  ------------------
  |  |  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|  15.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 15.1k]
  |  |  ------------------
  ------------------
 2599|  15.1k|  thread_context->tmp2 = thread_context->tmp + ebsize;
 2600|  15.1k|  thread_context->tmp3 = thread_context->tmp2 + ebsize;
 2601|  15.1k|  thread_context->tmp4 = thread_context->tmp3 + ebsize;
 2602|  15.1k|  thread_context->tmp_blocksize = blocksize;
 2603|  15.1k|  thread_context->zfp_cell_nitems = 0;
 2604|  15.1k|  thread_context->zfp_cell_start = 0;
 2605|  15.1k|  #if defined(HAVE_ZSTD)
 2606|  15.1k|  thread_context->zstd_cctx = NULL;
 2607|  15.1k|  thread_context->zstd_dctx = NULL;
 2608|  15.1k|  #endif
 2609|  15.1k|  thread_context->lz4_cstream = NULL;
 2610|  15.1k|  thread_context->lz4hc_cstream = NULL;
 2611|       |
 2612|  15.1k|  return 0;
 2613|  15.1k|}
blosc2.c:blosc_d:
 2062|  28.1k|    int32_t nblock, uint8_t* dest, int32_t dest_offset, uint8_t* tmp, uint8_t* tmp2) {
 2063|  28.1k|  blosc2_context* context = thread_context->parent_context;
 2064|  28.1k|  uint8_t *tmp3 = thread_context->tmp4;
 2065|  28.1k|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2066|  28.1k|  int32_t compformat = (context->header_flags & (uint8_t)0xe0) >> 5u;
 2067|  28.1k|  int dont_split = (context->header_flags & 0x10) >> 4;
 2068|  28.1k|  int32_t chunk_nbytes;
 2069|  28.1k|  int32_t chunk_cbytes;
 2070|  28.1k|  int nstreams;
 2071|  28.1k|  int32_t neblock;
 2072|  28.1k|  int32_t nbytes;                /* number of decompressed bytes in split */
 2073|  28.1k|  int32_t cbytes;                /* number of compressed bytes in split */
 2074|       |  // int32_t ctbytes = 0;           /* number of compressed bytes in block */
 2075|  28.1k|  int32_t ntbytes = 0;           /* number of uncompressed bytes in block */
 2076|  28.1k|  uint8_t* _dest;
 2077|  28.1k|  int32_t typesize = context->typesize;
 2078|  28.1k|  bool instr_codec = context->blosc2_flags & BLOSC2_INSTR_CODEC;
 2079|  28.1k|  const char* compname;
 2080|  28.1k|  int rc;
 2081|       |
 2082|  28.1k|  if (context->block_maskout != NULL && context->block_maskout[nblock]) {
  ------------------
  |  Branch (2082:7): [True: 0, False: 28.1k]
  |  Branch (2082:41): [True: 0, False: 0]
  ------------------
 2083|       |    // Do not decompress, but act as if we successfully decompressed everything
 2084|      0|    return bsize;
 2085|      0|  }
 2086|       |
 2087|  28.1k|  rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 2088|  28.1k|  if (rc < 0) {
  ------------------
  |  Branch (2088:7): [True: 0, False: 28.1k]
  ------------------
 2089|      0|    return rc;
 2090|      0|  }
 2091|  28.1k|  if (context->special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (2091:7): [True: 199, False: 27.9k]
  ------------------
 2092|       |    // We need the actual typesize in this case, but it cannot be encoded in the header, so derive it from cbytes
 2093|    199|    typesize = chunk_cbytes - context->header_overhead;
 2094|    199|  }
 2095|       |
 2096|       |  // In some situations (lazychunks) the context can arrive uninitialized
 2097|       |  // (but BITSHUFFLE needs it for accessing the format of the chunk)
 2098|  28.1k|  if (context->src == NULL) {
  ------------------
  |  Branch (2098:7): [True: 0, False: 28.1k]
  ------------------
 2099|      0|    context->src = src;
 2100|      0|  }
 2101|       |
 2102|       |  // Chunks with special values cannot be lazy
 2103|  28.1k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (2103:19): [True: 18.6k, False: 9.42k]
  ------------------
 2104|  18.6k|          (context->blosc2_flags & 0x08u) && !context->special_type);
  ------------------
  |  Branch (2104:11): [True: 728, False: 17.9k]
  |  Branch (2104:46): [True: 6, False: 722]
  ------------------
 2105|  28.1k|  if (is_lazy) {
  ------------------
  |  Branch (2105:7): [True: 6, False: 28.1k]
  ------------------
 2106|       |    // The chunk is on disk, so just lazily load the block
 2107|      6|    if (context->schunk == NULL) {
  ------------------
  |  Branch (2107:9): [True: 6, False: 0]
  ------------------
 2108|      6|      BLOSC_TRACE_ERROR("Lazy chunk needs an associated super-chunk.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2109|      6|      return BLOSC2_ERROR_INVALID_PARAM;
 2110|      6|    }
 2111|      0|    if (context->schunk->frame == NULL) {
  ------------------
  |  Branch (2111:9): [True: 0, False: 0]
  ------------------
 2112|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2113|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 2114|      0|    }
 2115|      0|    blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 2116|      0|    size_t bstarts_nbytes;
 2117|      0|    size_t trailer_offset;
 2118|      0|    size_t block_csizes_nbytes;
 2119|      0|    size_t trailer_meta_nbytes;
 2120|      0|    size_t lazy_trailer_end;
 2121|      0|    if (srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (2121:9): [True: 0, False: 0]
  |  Branch (2121:24): [True: 0, False: 0]
  ------------------
 2122|      0|        !blosc2_checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (2122:9): [True: 0, False: 0]
  ------------------
 2123|      0|        !blosc2_checked_add_size((size_t)BLOSC_EXTENDED_HEADER_LENGTH, bstarts_nbytes, &trailer_offset) ||
  ------------------
  |  Branch (2123:9): [True: 0, False: 0]
  ------------------
 2124|      0|        !blosc2_checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (2124:9): [True: 0, False: 0]
  ------------------
 2125|      0|        !blosc2_checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (2125:9): [True: 0, False: 0]
  ------------------
 2126|      0|        !blosc2_checked_add_size(trailer_offset, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (2126:9): [True: 0, False: 0]
  ------------------
 2127|      0|        (size_t)srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (2127:9): [True: 0, False: 0]
  ------------------
 2128|      0|      BLOSC_TRACE_ERROR("Lazy trailer exceeds source 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2129|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2130|      0|    }
 2131|      0|    int32_t nchunk;
 2132|      0|    int64_t chunk_offset;
 2133|       |    // The nchunk and the offset of the current chunk are in the trailer
 2134|      0|    memcpy(&nchunk, src + trailer_offset, sizeof(nchunk));
 2135|      0|    memcpy(&chunk_offset, src + trailer_offset + sizeof(int32_t), sizeof(chunk_offset));
 2136|       |    // Get the csize of the nblock
 2137|      0|    if (nblock < 0 || nblock >= context->nblocks) {
  ------------------
  |  Branch (2137:9): [True: 0, False: 0]
  |  Branch (2137:23): [True: 0, False: 0]
  ------------------
 2138|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2139|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2140|      0|    }
 2141|      0|    int32_t *block_csizes = (int32_t *)(src + trailer_offset + sizeof(int32_t) + sizeof(int64_t));
 2142|      0|    int32_t block_csize = block_csizes[nblock];
 2143|      0|    int32_t max_lazy_block_csize = context->blocksize + context->typesize * (signed)sizeof(int32_t);
 2144|      0|    if (block_csize <= 0 || block_csize > max_lazy_block_csize) {
  ------------------
  |  Branch (2144:9): [True: 0, False: 0]
  |  Branch (2144:29): [True: 0, False: 0]
  ------------------
 2145|      0|      BLOSC_TRACE_ERROR("Invalid lazy block size in 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2146|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2147|      0|    }
 2148|      0|    if (vlblocks && block_csize <= (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (2148:9): [True: 0, False: 0]
  |  Branch (2148:21): [True: 0, False: 0]
  ------------------
 2149|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2150|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2151|      0|    }
 2152|       |    // Read the lazy block on disk
 2153|      0|    void* fp = NULL;
 2154|      0|    blosc2_io_cb *io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 2155|      0|    if (io_cb == NULL) {
  ------------------
  |  Branch (2155:9): [True: 0, False: 0]
  ------------------
 2156|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2157|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 2158|      0|    }
 2159|       |
 2160|      0|    int64_t io_pos = 0;
 2161|      0|    if (frame->sframe) {
  ------------------
  |  Branch (2161:9): [True: 0, False: 0]
  ------------------
 2162|       |      // The chunk is not in the frame
 2163|      0|      fp = sframe_open_chunk(frame->urlpath, nchunk, "rb", context->schunk->storage->io);
 2164|      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]
  |  |  ------------------
  ------------------
 2165|       |      // The offset of the block is src_offset
 2166|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (2166:11): [True: 0, False: 0]
  ------------------
 2167|      0|        frame_reader_release(frame, io_cb, fp);
 2168|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2169|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 2170|      0|      }
 2171|      0|      io_pos = src_offset;
 2172|      0|    }
 2173|      0|    else {
 2174|      0|      fp = frame_reader_acquire(frame, context->schunk->storage->io);
 2175|      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]
  |  |  ------------------
  ------------------
 2176|       |      // The offset of the block is src_offset
 2177|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (2177:11): [True: 0, False: 0]
  ------------------
 2178|      0|        frame_reader_release(frame, io_cb, fp);
 2179|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2180|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 2181|      0|      }
 2182|      0|      if (chunk_offset < 0) {
  ------------------
  |  Branch (2182:11): [True: 0, False: 0]
  ------------------
 2183|      0|        frame_reader_release(frame, io_cb, fp);
 2184|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2185|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 2186|      0|      }
 2187|      0|      if (!blosc2_checked_add_i64(frame->file_offset, chunk_offset, &io_pos)) {
  ------------------
  |  Branch (2187:11): [True: 0, False: 0]
  ------------------
 2188|      0|        frame_reader_release(frame, io_cb, fp);
 2189|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2190|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 2191|      0|      }
 2192|      0|      if (!blosc2_checked_add_i64(io_pos, src_offset, &io_pos)) {
  ------------------
  |  Branch (2192:11): [True: 0, False: 0]
  ------------------
 2193|      0|        frame_reader_release(frame, io_cb, fp);
 2194|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2195|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 2196|      0|      }
 2197|      0|    }
 2198|       |    // We can make use of tmp3 because it will be used after src is not needed anymore
 2199|      0|    int64_t rbytes = io_cb->read((void**)&tmp3, 1, block_csize, io_pos, fp);
 2200|      0|    frame_reader_release(frame, io_cb, fp);
 2201|      0|    if ((int32_t)rbytes != block_csize) {
  ------------------
  |  Branch (2201:9): [True: 0, False: 0]
  ------------------
 2202|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2203|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2204|      0|    }
 2205|      0|    src = tmp3;
 2206|      0|    src_offset = 0;
 2207|      0|    srcsize = block_csize;
 2208|      0|  }
 2209|       |
 2210|       |  // If the chunk is memcpyed, we just have to copy the block to dest and return
 2211|  28.1k|  if (memcpyed) {
  ------------------
  |  Branch (2211:7): [True: 2.02k, False: 26.0k]
  ------------------
 2212|  2.02k|    int bsize_ = leftoverblock ? chunk_nbytes % context->blocksize : bsize;
  ------------------
  |  Branch (2212:18): [True: 37, False: 1.99k]
  ------------------
 2213|  2.02k|    if (!context->special_type) {
  ------------------
  |  Branch (2213:9): [True: 289, False: 1.73k]
  ------------------
 2214|    289|      if (chunk_nbytes + context->header_overhead != chunk_cbytes) {
  ------------------
  |  Branch (2214:11): [True: 0, False: 289]
  ------------------
 2215|      0|        return BLOSC2_ERROR_WRITE_BUFFER;
 2216|      0|      }
 2217|    289|      if (chunk_cbytes < context->header_overhead + (nblock * context->blocksize) + bsize_) {
  ------------------
  |  Branch (2217:11): [True: 0, False: 289]
  ------------------
 2218|       |        /* Not enough input to copy block */
 2219|      0|        return BLOSC2_ERROR_READ_BUFFER;
 2220|      0|      }
 2221|    289|    }
 2222|  2.02k|    if (!is_lazy) {
  ------------------
  |  Branch (2222:9): [True: 2.02k, False: 0]
  ------------------
 2223|  2.02k|      src += context->header_overhead + nblock * context->blocksize;
 2224|  2.02k|    }
 2225|  2.02k|    _dest = dest + dest_offset;
 2226|  2.02k|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (2226:9): [True: 0, False: 2.02k]
  ------------------
 2227|       |      // We are making use of a postfilter, so use a temp for destination
 2228|      0|      _dest = tmp;
 2229|      0|    }
 2230|  2.02k|    rc = 0;
 2231|  2.02k|    switch (context->special_type) {
 2232|    199|      case BLOSC2_SPECIAL_VALUE:
  ------------------
  |  Branch (2232:7): [True: 199, False: 1.82k]
  ------------------
 2233|       |        // All repeated values
 2234|    199|        rc = set_values(typesize, context->src, _dest, bsize_);
 2235|    199|        if (rc < 0) {
  ------------------
  |  Branch (2235:13): [True: 2, False: 197]
  ------------------
 2236|      2|          BLOSC_TRACE_ERROR("set_values failed");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2237|      2|          return BLOSC2_ERROR_DATA;
 2238|      2|        }
 2239|    197|        break;
 2240|    821|      case BLOSC2_SPECIAL_NAN:
  ------------------
  |  Branch (2240:7): [True: 821, False: 1.20k]
  ------------------
 2241|    821|        rc = set_nans(context->typesize, _dest, bsize_);
 2242|    821|        if (rc < 0) {
  ------------------
  |  Branch (2242:13): [True: 7, False: 814]
  ------------------
 2243|      7|          BLOSC_TRACE_ERROR("set_nans failed");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2244|      7|          return BLOSC2_ERROR_DATA;
 2245|      7|        }
 2246|    814|        break;
 2247|    814|      case BLOSC2_SPECIAL_ZERO:
  ------------------
  |  Branch (2247:7): [True: 502, False: 1.52k]
  ------------------
 2248|    502|        memset(_dest, 0, bsize_);
 2249|    502|        break;
 2250|    216|      case BLOSC2_SPECIAL_UNINIT:
  ------------------
  |  Branch (2250:7): [True: 216, False: 1.81k]
  ------------------
 2251|       |        // We do nothing here
 2252|    216|        break;
 2253|    289|      default:
  ------------------
  |  Branch (2253:7): [True: 289, False: 1.73k]
  ------------------
 2254|    289|        memcpy(_dest, src, bsize_);
 2255|  2.02k|    }
 2256|  2.01k|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (2256:9): [True: 0, False: 2.01k]
  ------------------
 2257|       |      // Create new postfilter parameters for this block (must be private for each thread)
 2258|      0|      blosc2_postfilter_params postparams;
 2259|      0|      memcpy(&postparams, context->postparams, sizeof(postparams));
 2260|      0|      postparams.input = tmp;
 2261|      0|      postparams.output = dest + dest_offset;
 2262|      0|      postparams.size = bsize;
 2263|      0|      postparams.typesize = typesize;
 2264|      0|      postparams.offset = nblock * context->blocksize;
 2265|      0|      postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (2265:27): [True: 0, False: 0]
  ------------------
 2266|      0|      postparams.nblock = nblock;
 2267|      0|      postparams.tid = thread_context->tid;
 2268|      0|      postparams.ttmp = thread_context->tmp;
 2269|      0|      postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 2270|      0|      postparams.ctx = context;
 2271|       |
 2272|       |      // Execute the postfilter (the processed block will be copied to dest)
 2273|      0|      if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (2273:11): [True: 0, False: 0]
  ------------------
 2274|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2275|      0|        return BLOSC2_ERROR_POSTFILTER;
 2276|      0|      }
 2277|      0|    }
 2278|  2.01k|    thread_context->zfp_cell_nitems = 0;
 2279|       |
 2280|  2.01k|    return bsize_;
 2281|  2.01k|  }
 2282|       |
 2283|  26.0k|  if (!is_lazy && (src_offset <= 0 || src_offset >= srcsize)) {
  ------------------
  |  Branch (2283:7): [True: 26.0k, False: 0]
  |  Branch (2283:20): [True: 190, False: 25.8k]
  |  Branch (2283:39): [True: 372, False: 25.5k]
  ------------------
 2284|       |    /* Invalid block src offset encountered */
 2285|    562|    return BLOSC2_ERROR_DATA;
 2286|    562|  }
 2287|       |
 2288|  25.5k|  src += src_offset;
 2289|  25.5k|  if (vlblocks) {
  ------------------
  |  Branch (2289:7): [True: 4, False: 25.5k]
  ------------------
 2290|      4|    if (context->blockcbytes == NULL || nblock >= context->nblocks ||
  ------------------
  |  Branch (2290:9): [True: 0, False: 4]
  |  Branch (2290:41): [True: 0, False: 4]
  ------------------
 2291|      4|        context->blockcbytes[nblock] <= (int32_t)sizeof(int32_t) ||
  ------------------
  |  Branch (2291:9): [True: 1, False: 3]
  ------------------
 2292|      3|        src_offset > srcsize - context->blockcbytes[nblock]) {
  ------------------
  |  Branch (2292:9): [True: 0, False: 3]
  ------------------
 2293|      1|      return BLOSC2_ERROR_DATA;
 2294|      1|    }
 2295|      3|    srcsize = context->blockcbytes[nblock];
 2296|      3|  }
 2297|  25.5k|  else {
 2298|  25.5k|    srcsize -= src_offset;
 2299|  25.5k|  }
 2300|       |
 2301|  25.5k|  int last_filter_index = last_filter(context, 'd');
 2302|  25.5k|  if (instr_codec) {
  ------------------
  |  Branch (2302:7): [True: 3.05k, False: 22.4k]
  ------------------
 2303|       |    // If instrumented, we don't want to run the filters
 2304|  3.05k|    _dest = dest + dest_offset;
 2305|  3.05k|  }
 2306|  22.4k|  else if (((last_filter_index >= 0) &&
  ------------------
  |  Branch (2306:13): [True: 18.9k, False: 3.56k]
  ------------------
 2307|  18.9k|       (next_filter(context, BLOSC2_MAX_FILTERS, 'd') != BLOSC_DELTA)) ||
  ------------------
  |  Branch (2307:8): [True: 14.2k, False: 4.63k]
  ------------------
 2308|  14.2k|    context->postfilter != NULL) {
  ------------------
  |  Branch (2308:5): [True: 0, False: 8.19k]
  ------------------
 2309|       |    // We are making use of some filter, so use a temp for destination
 2310|  14.2k|    _dest = tmp;
 2311|  14.2k|  }
 2312|  8.19k|  else {
 2313|       |    // If no filters, or only DELTA in pipeline
 2314|  8.19k|    _dest = dest + dest_offset;
 2315|  8.19k|  }
 2316|       |
 2317|       |  /* The number of compressed data streams for this block */
 2318|  25.5k|  if (vlblocks) {
  ------------------
  |  Branch (2318:7): [True: 3, False: 25.5k]
  ------------------
 2319|      3|    nstreams = 1;
 2320|      3|  }
 2321|  25.5k|  else if (!dont_split && !leftoverblock) {
  ------------------
  |  Branch (2321:12): [True: 3.24k, False: 22.2k]
  |  Branch (2321:27): [True: 3.21k, False: 22]
  ------------------
 2322|  3.21k|    nstreams = context->typesize;
 2323|  3.21k|  }
 2324|  22.2k|  else {
 2325|  22.2k|    nstreams = 1;
 2326|  22.2k|  }
 2327|       |
 2328|  25.5k|  neblock = bsize / nstreams;
 2329|  25.5k|  if (neblock == 0) {
  ------------------
  |  Branch (2329:7): [True: 3, False: 25.5k]
  ------------------
 2330|       |    /* Not enough space to output bytes */
 2331|      3|    BLOSC_ERROR(BLOSC2_ERROR_WRITE_BUFFER);
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 2332|      3|  }
 2333|       |  /* The splits must cover the whole block, or part of tmp is left unwritten */
 2334|  25.5k|  if (neblock * nstreams != bsize) {
  ------------------
  |  Branch (2334:7): [True: 13, False: 25.5k]
  ------------------
 2335|     13|    BLOSC_ERROR(BLOSC2_ERROR_DATA);
  ------------------
  |  |  111|     13|    do {                                            \
  |  |  112|     13|        int rc_ = (rc);                             \
  |  |  113|     13|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 13, False: 0]
  |  |  ------------------
  |  |  114|     13|            char *error_msg = print_error(rc_);     \
  |  |  115|     13|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|     13|            return rc_;                             \
  |  |  117|     13|        }                                           \
  |  |  118|     13|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2336|     13|  }
 2337|  38.0k|  for (int j = 0; j < nstreams; j++) {
  ------------------
  |  Branch (2337:19): [True: 25.7k, False: 12.2k]
  ------------------
 2338|  25.7k|    if (vlblocks) {
  ------------------
  |  Branch (2338:9): [True: 3, False: 25.7k]
  ------------------
 2339|      3|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2339:11): [True: 0, False: 3]
  ------------------
 2340|       |        /* Not enough input to read compressed bytes */
 2341|      0|        return BLOSC2_ERROR_READ_BUFFER;
 2342|      0|      }
 2343|      3|      neblock = sw32_(src);
 2344|      3|      if (neblock != bsize) {
  ------------------
  |  Branch (2344:11): [True: 0, False: 3]
  ------------------
 2345|      0|        return BLOSC2_ERROR_DATA;
 2346|      0|      }
 2347|      3|      src += sizeof(int32_t);
 2348|      3|      cbytes = srcsize - (int32_t)sizeof(int32_t);
 2349|      3|      srcsize = 0;
 2350|      3|    }
 2351|  25.7k|    else {
 2352|  25.7k|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2352:11): [True: 8, False: 25.7k]
  ------------------
 2353|       |        /* Not enough input to read compressed size */
 2354|      8|        return BLOSC2_ERROR_READ_BUFFER;
 2355|      8|      }
 2356|  25.7k|      srcsize -= sizeof(int32_t);
 2357|  25.7k|      cbytes = sw32_(src);      /* amount of compressed bytes */
 2358|  25.7k|      if (cbytes > 0) {
  ------------------
  |  Branch (2358:11): [True: 22.9k, False: 2.80k]
  ------------------
 2359|  22.9k|        if (srcsize < cbytes) {
  ------------------
  |  Branch (2359:13): [True: 97, False: 22.8k]
  ------------------
 2360|       |          /* Not enough input to read compressed bytes */
 2361|     97|          return BLOSC2_ERROR_READ_BUFFER;
 2362|     97|        }
 2363|  22.8k|        srcsize -= cbytes;
 2364|  22.8k|      }
 2365|  25.6k|      src += sizeof(int32_t);
 2366|  25.6k|    }
 2367|       |    // ctbytes += (signed)sizeof(int32_t);
 2368|       |
 2369|       |    /* Uncompress */
 2370|  25.6k|    if (!vlblocks && cbytes == 0) {
  ------------------
  |  Branch (2370:9): [True: 25.6k, False: 3]
  |  Branch (2370:22): [True: 2.15k, False: 23.4k]
  ------------------
 2371|       |      // A run of 0's
 2372|  2.15k|      memset(_dest, 0, (unsigned int)neblock);
 2373|  2.15k|      nbytes = neblock;
 2374|  2.15k|    }
 2375|  23.4k|    else if (!vlblocks && cbytes < 0) {
  ------------------
  |  Branch (2375:14): [True: 23.4k, False: 3]
  |  Branch (2375:27): [True: 649, False: 22.8k]
  ------------------
 2376|       |      // A negative number means some encoding depending on the token that comes next
 2377|    649|      uint8_t token;
 2378|       |
 2379|    649|      if (srcsize < (signed)sizeof(uint8_t)) {
  ------------------
  |  Branch (2379:11): [True: 12, False: 637]
  ------------------
 2380|       |        // Not enough input to read token */
 2381|     12|        return BLOSC2_ERROR_READ_BUFFER;
 2382|     12|      }
 2383|    637|      srcsize -= sizeof(uint8_t);
 2384|       |
 2385|    637|      token = src[0];
 2386|    637|      src += 1;
 2387|       |      // ctbytes += 1;
 2388|       |
 2389|    637|      if (token & 0x1) {
  ------------------
  |  Branch (2389:11): [True: 618, False: 19]
  ------------------
 2390|       |        // A run of bytes that are different than 0
 2391|    618|        if (cbytes < -255) {
  ------------------
  |  Branch (2391:13): [True: 69, False: 549]
  ------------------
 2392|       |          // Runs can only encode a byte
 2393|     69|          return BLOSC2_ERROR_RUN_LENGTH;
 2394|     69|        }
 2395|    549|        uint8_t value = -cbytes;
 2396|    549|        memset(_dest, value, (unsigned int)neblock);
 2397|    549|      } else {
 2398|     19|        BLOSC_TRACE_ERROR("Invalid or unsupported compressed stream token value - %d", token);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2399|     19|        return BLOSC2_ERROR_RUN_LENGTH;
 2400|     19|      }
 2401|    549|      nbytes = neblock;
 2402|    549|      cbytes = 0;  // everything is encoded in the cbytes token
 2403|    549|    }
 2404|  22.8k|    else if (cbytes == neblock) {
  ------------------
  |  Branch (2404:14): [True: 6.06k, False: 16.7k]
  ------------------
 2405|  6.06k|      memcpy(_dest, src, (unsigned int)neblock);
 2406|  6.06k|      nbytes = (int32_t)neblock;
 2407|  6.06k|    }
 2408|  16.7k|    else {
 2409|  16.7k|      if (compformat == BLOSC_BLOSCLZ_FORMAT) {
  ------------------
  |  Branch (2409:11): [True: 671, False: 16.0k]
  ------------------
 2410|    671|        nbytes = blosclz_decompress(src, cbytes, _dest, (int)neblock);
 2411|    671|      }
 2412|  16.0k|      else if (compformat == BLOSC_LZ4_FORMAT) {
  ------------------
  |  Branch (2412:16): [True: 1.04k, False: 15.0k]
  ------------------
 2413|  1.04k|        nbytes = lz4_wrap_decompress((char*)src, (size_t)cbytes,
 2414|  1.04k|                                     (char*)_dest, (size_t)neblock,
 2415|  1.04k|                                     thread_context);
 2416|  1.04k|      }
 2417|  15.0k|  #if defined(HAVE_ZLIB)
 2418|  15.0k|      else if (compformat == BLOSC_ZLIB_FORMAT) {
  ------------------
  |  Branch (2418:16): [True: 1.09k, False: 13.9k]
  ------------------
 2419|  1.09k|        nbytes = zlib_wrap_decompress((char*)src, (size_t)cbytes,
 2420|  1.09k|                                      (char*)_dest, (size_t)neblock);
 2421|  1.09k|      }
 2422|  13.9k|  #endif /*  HAVE_ZLIB */
 2423|  13.9k|  #if defined(HAVE_ZSTD)
 2424|  13.9k|      else if (compformat == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2424:16): [True: 12.3k, False: 1.59k]
  ------------------
 2425|  12.3k|        nbytes = zstd_wrap_decompress(thread_context,
 2426|  12.3k|                                      (char*)src, (size_t)cbytes,
 2427|  12.3k|                                      (char*)_dest, (size_t)neblock);
 2428|  12.3k|      }
 2429|  1.59k|  #endif /*  HAVE_ZSTD */
 2430|  1.59k|      else if (compformat == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (2430:16): [True: 1.59k, False: 6]
  ------------------
 2431|  1.59k|        bool getcell = false;
 2432|       |
 2433|  1.59k|#if defined(HAVE_ZFP)
 2434|  1.59k|        if ((context->compcode == BLOSC_CODEC_ZFP_FIXED_RATE) &&
  ------------------
  |  Branch (2434:13): [True: 2, False: 1.58k]
  ------------------
 2435|      2|            (thread_context->zfp_cell_nitems > 0)) {
  ------------------
  |  Branch (2435:13): [True: 0, False: 2]
  ------------------
 2436|      0|          nbytes = zfp_getcell(thread_context, src, cbytes, _dest, neblock);
 2437|      0|          if (nbytes < 0) {
  ------------------
  |  Branch (2437:15): [True: 0, False: 0]
  ------------------
 2438|      0|            return BLOSC2_ERROR_DATA;
 2439|      0|          }
 2440|      0|          if (nbytes == thread_context->zfp_cell_nitems * typesize) {
  ------------------
  |  Branch (2440:15): [True: 0, False: 0]
  ------------------
 2441|      0|            getcell = true;
 2442|      0|          }
 2443|      0|        }
 2444|  1.59k|#endif /* HAVE_ZFP */
 2445|  1.59k|        if (!getcell) {
  ------------------
  |  Branch (2445:13): [True: 1.59k, False: 0]
  ------------------
 2446|  1.59k|          thread_context->zfp_cell_nitems = 0;
 2447|  1.79k|          for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (2447:27): [True: 1.77k, False: 19]
  ------------------
 2448|  1.77k|            if (g_codecs[i].compcode == context->compcode) {
  ------------------
  |  Branch (2448:17): [True: 1.57k, False: 205]
  ------------------
 2449|  1.57k|              if (load_acquire_ptr(&g_codecs[i].decoder) == NULL) {
  ------------------
  |  |  144|  1.57k|#define load_acquire_ptr(p) __atomic_load_n((p), __ATOMIC_ACQUIRE)
  ------------------
  |  Branch (2449:19): [True: 4, False: 1.56k]
  ------------------
 2450|       |                // Dynamically load codec plugin
 2451|      4|                if (fill_codec(&g_codecs[i]) < 0) {
  ------------------
  |  Branch (2451:21): [True: 4, False: 0]
  ------------------
 2452|      4|                  BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2453|      4|                  return BLOSC2_ERROR_CODEC_SUPPORT;
 2454|      4|                }
 2455|      4|              }
 2456|  1.56k|              blosc2_dparams dparams;
 2457|  1.56k|              blosc2_ctx_get_dparams(context, &dparams);
 2458|  1.56k|              nbytes = g_codecs[i].decoder(src,
 2459|  1.56k|                                           cbytes,
 2460|  1.56k|                                           _dest,
 2461|  1.56k|                                           neblock,
 2462|  1.56k|                                           context->compcode_meta,
 2463|  1.56k|                                           &dparams,
 2464|  1.56k|                                           context->src);
 2465|  1.56k|              goto urcodecsuccess;
 2466|  1.57k|            }
 2467|  1.77k|          }
 2468|     19|          BLOSC_TRACE_ERROR("User-defined compressor codec %d not found during decompression", context->compcode);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2469|     19|          return BLOSC2_ERROR_CODEC_SUPPORT;
 2470|  1.59k|        }
 2471|  1.56k|      urcodecsuccess:
 2472|  1.56k|        ;
 2473|  1.56k|      }
 2474|      6|      else {
 2475|      6|        compname = clibcode_to_clibname(compformat);
 2476|      6|        BLOSC_TRACE_ERROR(
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2477|      6|                "Blosc has not been compiled with decompression "
 2478|      6|                "support for '%s' format.  "
 2479|      6|                "Please recompile for adding this support.", compname);
 2480|      6|        return BLOSC2_ERROR_CODEC_SUPPORT;
 2481|      6|      }
 2482|       |
 2483|       |      /* Check that decompressed bytes number is correct */
 2484|  16.7k|      if ((nbytes != neblock) && (thread_context->zfp_cell_nitems == 0)) {
  ------------------
  |  Branch (2484:11): [True: 12.9k, False: 3.74k]
  |  Branch (2484:34): [True: 12.9k, False: 0]
  ------------------
 2485|  12.9k|        return BLOSC2_ERROR_DATA;
 2486|  12.9k|      }
 2487|       |
 2488|  16.7k|    }
 2489|  12.5k|    src += cbytes;
 2490|       |    // ctbytes += cbytes;
 2491|  12.5k|    _dest += nbytes;
 2492|  12.5k|    ntbytes += nbytes;
 2493|  12.5k|  } /* Closes j < nstreams */
 2494|       |
 2495|  12.2k|  if (!instr_codec) {
  ------------------
  |  Branch (2495:7): [True: 10.9k, False: 1.33k]
  ------------------
 2496|  10.9k|    if (last_filter_index >= 0 || context->postfilter != NULL) {
  ------------------
  |  Branch (2496:9): [True: 10.5k, False: 354]
  |  Branch (2496:35): [True: 0, False: 354]
  ------------------
 2497|       |      /* Apply regular filter pipeline */
 2498|  10.5k|      int errcode = pipeline_backward(thread_context, bsize, dest, dest_offset, tmp, tmp2, tmp3,
 2499|  10.5k|                                      last_filter_index, nblock);
 2500|  10.5k|      if (errcode < 0)
  ------------------
  |  Branch (2500:11): [True: 279, False: 10.3k]
  ------------------
 2501|    279|        return errcode;
 2502|  10.5k|    }
 2503|  10.9k|  }
 2504|       |
 2505|       |  /* Return the number of uncompressed bytes */
 2506|  12.0k|  return (int)ntbytes;
 2507|  12.2k|}
blosc2.c:lz4_wrap_decompress:
  641|  1.04k|                               struct thread_context* thread_context) {
  642|  1.04k|  int nbytes;
  643|  1.04k|  blosc2_context* context = thread_context->parent_context;
  644|  1.04k|  if (context->use_dict && context->dict_buffer != NULL && context->dict_size > 0) {
  ------------------
  |  Branch (644:7): [True: 436, False: 611]
  |  Branch (644:28): [True: 436, False: 0]
  |  Branch (644:60): [True: 436, False: 0]
  ------------------
  645|    436|    nbytes = LZ4_decompress_safe_usingDict(input, output,
  646|    436|                                           (int)compressed_length, (int)maxout,
  647|    436|                                           (const char*)context->dict_buffer,
  648|    436|                                           (int)context->dict_size);
  649|    611|  } else {
  650|    611|    nbytes = LZ4_decompress_safe(input, output, (int)compressed_length, (int)maxout);
  651|    611|  }
  652|  1.04k|  if (nbytes != (int)maxout) {
  ------------------
  |  Branch (652:7): [True: 812, False: 235]
  ------------------
  653|    812|    return 0;
  654|    812|  }
  655|    235|  return (int)maxout;
  656|  1.04k|}
blosc2.c:zlib_wrap_decompress:
  680|  1.09k|                                char* output, size_t maxout) {
  681|  1.09k|  int status;
  682|  1.09k|#if defined(HAVE_ZLIB_NG) && ! defined(ZLIB_COMPAT)
  683|  1.09k|  size_t ul = maxout;
  684|  1.09k|  status = zng_uncompress(
  685|  1.09k|      (uint8_t*)output, &ul, (uint8_t*)input, compressed_length);
  686|       |#else
  687|       |  uLongf ul = (uLongf)maxout;
  688|       |  status = uncompress(
  689|       |      (Bytef*)output, &ul, (Bytef*)input, (uLong)compressed_length);
  690|       |#endif
  691|  1.09k|  if (status != Z_OK) {
  ------------------
  |  |  180|  1.09k|#define Z_OK            0
  ------------------
  |  Branch (691:7): [True: 1.09k, False: 2]
  ------------------
  692|  1.09k|    return 0;
  693|  1.09k|  }
  694|      2|  return (int)ul;
  695|  1.09k|}
blosc2.c:zstd_wrap_decompress:
  732|  12.3k|                                char* output, size_t maxout) {
  733|  12.3k|  size_t code;
  734|  12.3k|  blosc2_context* context = thread_context->parent_context;
  735|       |
  736|  12.3k|  if (thread_context->zstd_dctx == NULL) {
  ------------------
  |  Branch (736:7): [True: 10.2k, False: 2.04k]
  ------------------
  737|  10.2k|    thread_context->zstd_dctx = ZSTD_createDCtx();
  738|  10.2k|  }
  739|       |
  740|  12.3k|  if (context->use_dict) {
  ------------------
  |  Branch (740:7): [True: 3.53k, False: 8.80k]
  ------------------
  741|  3.53k|    assert(context->dict_ddict != NULL);
  742|  3.53k|    code = ZSTD_decompress_usingDDict(
  743|  3.53k|            thread_context->zstd_dctx, (void*)output, maxout, (void*)input,
  744|  3.53k|            compressed_length, context->dict_ddict);
  745|  8.80k|  } else {
  746|  8.80k|    code = ZSTD_decompressDCtx(thread_context->zstd_dctx,
  747|  8.80k|        (void*)output, maxout, (void*)input, compressed_length);
  748|  8.80k|  }
  749|  12.3k|  if (ZSTD_isError(code) != ZSTD_error_no_error) {
  ------------------
  |  Branch (749:7): [True: 9.94k, False: 2.39k]
  ------------------
  750|  9.94k|    BLOSC_TRACE_ERROR("Error in ZSTD decompression: '%s'.  Giving up.",
  ------------------
  |  |   93|  9.94k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  9.94k|    do {                                            \
  |  |  |  |   98|  9.94k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  9.94k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 9.94k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  9.94k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  751|  9.94k|                      ZDICT_getErrorName(code));
  752|  9.94k|    return 0;
  753|  9.94k|  }
  754|  2.39k|  return (int)code;
  755|  12.3k|}
blosc2.c:set_values:
 1993|    199|static int32_t set_values(int32_t typesize, const uint8_t* src, uint8_t* dest, int32_t destsize) {
 1994|       |#if defined(BLOSC_STRICT_ALIGN)
 1995|       |  if (destsize % typesize != 0) {
 1996|       |    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
 1997|       |  }
 1998|       |  int32_t nitems = destsize / typesize;
 1999|       |  if (nitems == 0) {
 2000|       |    return 0;
 2001|       |  }
 2002|       |  for (int i = 0; i < nitems; i++) {
 2003|       |    memcpy(dest + i * typesize, src + BLOSC_EXTENDED_HEADER_LENGTH, typesize);
 2004|       |  }
 2005|       |#else
 2006|    199|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (2006:7): [True: 2, False: 197]
  ------------------
 2007|      2|    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  111|      2|    do {                                            \
  |  |  112|      2|        int rc_ = (rc);                             \
  |  |  113|      2|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 2, False: 0]
  |  |  ------------------
  |  |  114|      2|            char *error_msg = print_error(rc_);     \
  |  |  115|      2|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      2|            return rc_;                             \
  |  |  117|      2|        }                                           \
  |  |  118|      2|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2008|      2|  }
 2009|    197|  int32_t nitems = destsize / typesize;
 2010|    197|  if (nitems == 0) {
  ------------------
  |  Branch (2010:7): [True: 0, False: 197]
  ------------------
 2011|      0|    return 0;
 2012|      0|  }
 2013|       |
 2014|    197|  switch (typesize) {
 2015|     14|    case 8: {
  ------------------
  |  Branch (2015:5): [True: 14, False: 183]
  ------------------
 2016|     14|      int64_t val8 = ((int64_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 2017|     14|      int64_t* dest8 = (int64_t*)dest;
 2018|     42|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (2018:23): [True: 28, False: 14]
  ------------------
 2019|     28|        dest8[i] = val8;
 2020|     28|      }
 2021|     14|      break;
 2022|      0|    }
 2023|     25|    case 4: {
  ------------------
  |  Branch (2023:5): [True: 25, False: 172]
  ------------------
 2024|     25|      int32_t val4 = ((int32_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 2025|     25|      int32_t* dest4 = (int32_t*)dest;
 2026|     92|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (2026:23): [True: 67, False: 25]
  ------------------
 2027|     67|        dest4[i] = val4;
 2028|     67|      }
 2029|     25|      break;
 2030|      0|    }
 2031|     58|    case 2: {
  ------------------
  |  Branch (2031:5): [True: 58, False: 139]
  ------------------
 2032|     58|      int16_t val2 = ((int16_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 2033|     58|      int16_t* dest2 = (int16_t*)dest;
 2034|    280|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (2034:23): [True: 222, False: 58]
  ------------------
 2035|    222|        dest2[i] = val2;
 2036|    222|      }
 2037|     58|      break;
 2038|      0|    }
 2039|     78|    case 1: {
  ------------------
  |  Branch (2039:5): [True: 78, False: 119]
  ------------------
 2040|     78|      int8_t val1 = ((int8_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 2041|     78|      int8_t* dest1 = (int8_t*)dest;
 2042|    294|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (2042:23): [True: 216, False: 78]
  ------------------
 2043|    216|        dest1[i] = val1;
 2044|    216|      }
 2045|     78|      break;
 2046|      0|    }
 2047|     22|    default:
  ------------------
  |  Branch (2047:5): [True: 22, False: 175]
  ------------------
 2048|     78|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (2048:23): [True: 56, False: 22]
  ------------------
 2049|     56|        memcpy(dest + i * typesize, src + BLOSC_EXTENDED_HEADER_LENGTH, typesize);
 2050|     56|      }
 2051|    197|  }
 2052|    197|#endif
 2053|       |
 2054|    197|  return nitems;
 2055|    197|}
blosc2.c:set_nans:
 1961|    821|static int32_t set_nans(int32_t typesize, uint8_t* dest, int32_t destsize) {
 1962|    821|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (1962:7): [True: 1, False: 820]
  ------------------
 1963|      1|    BLOSC_TRACE_ERROR("destsize can only be a multiple of typesize");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1964|      1|    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 1965|      1|  }
 1966|    820|  int32_t nitems = destsize / typesize;
 1967|    820|  if (nitems == 0) {
  ------------------
  |  Branch (1967:7): [True: 0, False: 820]
  ------------------
 1968|      0|    return 0;
 1969|      0|  }
 1970|       |
 1971|    820|  if (typesize == 4) {
  ------------------
  |  Branch (1971:7): [True: 421, False: 399]
  ------------------
 1972|    421|    float* dest_ = (float*)dest;
 1973|    421|    float val = nanf("");
 1974|  3.84k|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1974:21): [True: 3.42k, False: 421]
  ------------------
 1975|  3.42k|      dest_[i] = val;
 1976|  3.42k|    }
 1977|    421|    return nitems;
 1978|    421|  }
 1979|    399|  else if (typesize == 8) {
  ------------------
  |  Branch (1979:12): [True: 393, False: 6]
  ------------------
 1980|    393|    double* dest_ = (double*)dest;
 1981|    393|    double val = nan("");
 1982|  2.08k|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1982:21): [True: 1.69k, False: 393]
  ------------------
 1983|  1.69k|      dest_[i] = val;
 1984|  1.69k|    }
 1985|    393|    return nitems;
 1986|    393|  }
 1987|       |
 1988|      6|  BLOSC_TRACE_ERROR("Unsupported typesize for NaN");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1989|      6|  return BLOSC2_ERROR_DATA;
 1990|    820|}
blosc2.c:blosc2_initialize_context_from_header:
 1032|  16.0k|static int blosc2_initialize_context_from_header(blosc2_context* context, blosc_header* header) {
 1033|  16.0k|  context->header_flags = header->flags;
 1034|  16.0k|  context->typesize = header->typesize;
 1035|  16.0k|  context->sourcesize = header->nbytes;
 1036|  16.0k|  context->header_blocksize = header->blocksize;
 1037|  16.0k|  context->blocksize = header->blocksize;
 1038|  16.0k|  context->blosc2_flags2 = header->blosc2_flags2;
 1039|  16.0k|  context->blosc2_flags = header->blosc2_flags;
 1040|  16.0k|  context->compcode = header->flags >> 5;
 1041|  16.0k|  if (context->compcode == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (1041:7): [True: 1.10k, False: 14.9k]
  ------------------
 1042|  1.10k|    context->compcode = header->udcompcode;
 1043|  1.10k|  }
 1044|  16.0k|  if (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) {
  ------------------
  |  Branch (1044:7): [True: 308, False: 15.7k]
  ------------------
 1045|    308|    context->nblocks = header->blocksize;
 1046|    308|    context->leftover = 0;
 1047|    308|    context->blocksize = 0;
 1048|    308|  }
 1049|  15.7k|  else {
 1050|  15.7k|    blosc2_calculate_blocks(context);
 1051|  15.7k|  }
 1052|       |
 1053|  16.0k|  bool is_lazy = false;
 1054|  16.0k|  if ((context->header_flags & BLOSC_DOSHUFFLE) &&
  ------------------
  |  Branch (1054:7): [True: 9.62k, False: 6.39k]
  ------------------
 1055|  9.62k|      (context->header_flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (1055:7): [True: 7.37k, False: 2.25k]
  ------------------
 1056|       |    /* Extended header */
 1057|  7.37k|    context->header_overhead = BLOSC_EXTENDED_HEADER_LENGTH;
 1058|       |
 1059|  7.37k|    memcpy(context->filters, header->filters, BLOSC2_MAX_FILTERS);
 1060|  7.37k|    memcpy(context->filters_meta, header->filters_meta, BLOSC2_MAX_FILTERS);
 1061|  7.37k|    context->compcode_meta = header->compcode_meta;
 1062|       |
 1063|  7.37k|    context->filter_flags = filters_to_flags(header->filters);
 1064|  7.37k|    context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
 1065|       |
 1066|       |    // Chunks with special values cannot be lazy (as in blosc_d()), and their
 1067|       |    // value is read from the buffer, so the cbytes check below must apply
 1068|  7.37k|    is_lazy = (context->blosc2_flags & 0x08u) && !context->special_type;
  ------------------
  |  Branch (1068:15): [True: 191, False: 7.18k]
  |  Branch (1068:50): [True: 109, False: 82]
  ------------------
 1069|  7.37k|  }
 1070|  8.64k|  else {
 1071|  8.64k|    context->header_overhead = BLOSC_MIN_HEADER_LENGTH;
 1072|  8.64k|    context->filter_flags = get_filter_flags(context->header_flags, context->typesize);
 1073|  8.64k|    flags_to_filters(context->header_flags, context->filters);
 1074|  8.64k|  }
 1075|       |
 1076|       |  // Some checks for malformed headers
 1077|  16.0k|  if (!is_lazy && header->cbytes > context->srcsize) {
  ------------------
  |  Branch (1077:7): [True: 15.9k, False: 109]
  |  Branch (1077:19): [True: 0, False: 15.9k]
  ------------------
 1078|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 1079|      0|  }
 1080|       |
 1081|  16.0k|  return 0;
 1082|  16.0k|}
blosc2.c:get_filter_flags:
  872|  8.64k|                                const int32_t typesize) {
  873|  8.64k|  uint8_t flags = 0;
  874|       |
  875|  8.64k|  if ((header_flags & BLOSC_DOSHUFFLE) && (typesize > 1)) {
  ------------------
  |  Branch (875:7): [True: 2.25k, False: 6.39k]
  |  Branch (875:43): [True: 1.70k, False: 547]
  ------------------
  876|  1.70k|    flags |= BLOSC_DOSHUFFLE;
  877|  1.70k|  }
  878|  8.64k|  if (header_flags & BLOSC_DOBITSHUFFLE) {
  ------------------
  |  Branch (878:7): [True: 2.12k, False: 6.52k]
  ------------------
  879|  2.12k|    flags |= BLOSC_DOBITSHUFFLE;
  880|  2.12k|  }
  881|  8.64k|  if (header_flags & BLOSC_DODELTA) {
  ------------------
  |  Branch (881:7): [True: 2.87k, False: 5.77k]
  ------------------
  882|  2.87k|    flags |= BLOSC_DODELTA;
  883|  2.87k|  }
  884|  8.64k|  if (header_flags & BLOSC_MEMCPYED) {
  ------------------
  |  Branch (884:7): [True: 42, False: 8.60k]
  ------------------
  885|     42|    flags |= BLOSC_MEMCPYED;
  886|     42|  }
  887|  8.64k|  return flags;
  888|  8.64k|}
blosc2.c:clear_context_decompression_dict:
 2989|  16.0k|static void clear_context_decompression_dict(blosc2_context* context) {
 2990|  16.0k|  context->use_dict = 0;
 2991|  16.0k|  release_context_dict_buffer(context);
 2992|  16.0k|#if defined(HAVE_ZSTD)
 2993|  16.0k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (2993:7): [True: 0, False: 16.0k]
  ------------------
 2994|      0|    ZSTD_freeDDict(context->dict_ddict);
 2995|      0|    context->dict_ddict = NULL;
 2996|      0|  }
 2997|       |#else
 2998|       |  context->dict_ddict = NULL;
 2999|       |#endif
 3000|  16.0k|}
blosc2.c:check_nthreads:
 2654|  15.1k|static int check_nthreads(blosc2_context* context, bool start_backend) {
 2655|  15.1k|  if (context->new_nthreads != context->nthreads && context->new_nthreads <= 0) {
  ------------------
  |  Branch (2655:7): [True: 0, False: 15.1k]
  |  Branch (2655:53): [True: 0, False: 0]
  ------------------
 2656|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2656|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2657|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2658|      0|  }
 2659|  15.1k|  if (context->nthreads <= 0) {
  ------------------
  |  Branch (2659:7): [True: 0, False: 15.1k]
  ------------------
 2660|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2660|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2661|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2662|      0|  }
 2663|       |
 2664|       |  /* Detect a pool that was torn down by blosc2_destroy() while this context
 2665|       |   * was still alive, or that belongs to the parent of a forked process.  The
 2666|       |   * epoch mismatch tells us the pool pointer is dangling or has no threads;
 2667|       |   * clear it so the re-attach logic below creates a fresh one. */
 2668|  15.1k|  if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL &&
  ------------------
  |  |   34|  30.2k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (2668:7): [True: 0, False: 15.1k]
  ------------------
 2669|      0|      context->pool_epoch != load_acquire_int(&g_destroy_count)) {
  ------------------
  |  |  142|      0|#define load_acquire_int(p) __atomic_load_n((p), __ATOMIC_ACQUIRE)
  ------------------
  |  Branch (2669:7): [True: 0, False: 0]
  ------------------
 2670|      0|    context->thread_pool = NULL;
 2671|      0|    context->threads_started = 0;
 2672|      0|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   33|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2673|      0|  }
 2674|       |
 2675|  15.1k|  if (context->new_nthreads != context->nthreads) {
  ------------------
  |  Branch (2675:7): [True: 0, False: 15.1k]
  ------------------
 2676|      0|    release_thread_backend(context);
 2677|      0|    context->nthreads = context->new_nthreads;
 2678|      0|  }
 2679|  15.1k|  if (start_backend && context->nthreads > 1 && context->threads_started == 0) {
  ------------------
  |  Branch (2679:7): [True: 0, False: 15.1k]
  |  Branch (2679:24): [True: 0, False: 0]
  |  Branch (2679:49): [True: 0, False: 0]
  ------------------
 2680|      0|    int rc;
 2681|      0|    if (threads_callback) {
  ------------------
  |  Branch (2681:9): [True: 0, False: 0]
  ------------------
 2682|      0|      rc = init_callback_threads(context);
 2683|      0|    }
 2684|      0|    else {
 2685|       |#if defined(_WIN32)
 2686|       |      rc = init_threadpool(context);
 2687|       |#else
 2688|      0|      rc = attach_shared_pool(context);
 2689|      0|#endif
 2690|      0|    }
 2691|      0|    if (rc < 0) {
  ------------------
  |  Branch (2691:9): [True: 0, False: 0]
  ------------------
 2692|      0|      return rc;
 2693|      0|    }
 2694|      0|  }
 2695|  15.1k|  if (context->nthreads <= 1) {
  ------------------
  |  Branch (2695:7): [True: 15.1k, False: 0]
  ------------------
 2696|  15.1k|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   33|  15.1k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2697|  15.1k|  }
 2698|       |
 2699|  15.1k|  return context->nthreads;
 2700|  15.1k|}
blosc2.c:register_atfork:
  293|      1|static void register_atfork(void) {
  294|      1|  if (pthread_atfork(atfork_prepare, atfork_parent, atfork_child) != 0) {
  ------------------
  |  Branch (294:7): [True: 0, False: 1]
  ------------------
  295|       |    BLOSC_TRACE_WARNING("pthread_atfork() failed: a fork()ed child may hang or crash with more than one thread");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  296|      0|  }
  297|      1|}
blosc2.c:blosc2_init_locked:
 6543|  16.3k|static void blosc2_init_locked(void) {
 6544|  16.3k|  BLOSC2_IO_CB_DEFAULTS.id = BLOSC2_IO_FILESYSTEM;
 6545|  16.3k|  BLOSC2_IO_CB_DEFAULTS.name = "filesystem";
 6546|  16.3k|  BLOSC2_IO_CB_DEFAULTS.is_allocation_necessary = true;
 6547|  16.3k|  BLOSC2_IO_CB_DEFAULTS.open = (blosc2_open_cb) blosc2_stdio_open;
 6548|  16.3k|  BLOSC2_IO_CB_DEFAULTS.close = (blosc2_close_cb) blosc2_stdio_close;
 6549|  16.3k|  BLOSC2_IO_CB_DEFAULTS.size = (blosc2_size_cb) blosc2_stdio_size;
 6550|  16.3k|  BLOSC2_IO_CB_DEFAULTS.write = (blosc2_write_cb) blosc2_stdio_write;
 6551|  16.3k|  BLOSC2_IO_CB_DEFAULTS.read = (blosc2_read_cb) blosc2_stdio_read;
 6552|  16.3k|  BLOSC2_IO_CB_DEFAULTS.truncate = (blosc2_truncate_cb) blosc2_stdio_truncate;
 6553|  16.3k|  BLOSC2_IO_CB_DEFAULTS.destroy = (blosc2_destroy_cb) blosc2_stdio_destroy;
 6554|       |
 6555|  16.3k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_DEFAULTS);
 6556|       |
 6557|  16.3k|  BLOSC2_IO_CB_MMAP.id = BLOSC2_IO_FILESYSTEM_MMAP;
 6558|  16.3k|  BLOSC2_IO_CB_MMAP.name = "filesystem_mmap";
 6559|  16.3k|  BLOSC2_IO_CB_MMAP.is_allocation_necessary = false;
 6560|  16.3k|  BLOSC2_IO_CB_MMAP.open = (blosc2_open_cb) blosc2_stdio_mmap_open;
 6561|  16.3k|  BLOSC2_IO_CB_MMAP.close = (blosc2_close_cb) blosc2_stdio_mmap_close;
 6562|  16.3k|  BLOSC2_IO_CB_MMAP.read = (blosc2_read_cb) blosc2_stdio_mmap_read;
 6563|  16.3k|  BLOSC2_IO_CB_MMAP.size = (blosc2_size_cb) blosc2_stdio_mmap_size;
 6564|  16.3k|  BLOSC2_IO_CB_MMAP.write = (blosc2_write_cb) blosc2_stdio_mmap_write;
 6565|  16.3k|  BLOSC2_IO_CB_MMAP.truncate = (blosc2_truncate_cb) blosc2_stdio_mmap_truncate;
 6566|  16.3k|  BLOSC2_IO_CB_MMAP.destroy = (blosc2_destroy_cb) blosc2_stdio_mmap_destroy;
 6567|       |
 6568|  16.3k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_MMAP);
 6569|       |
 6570|       |  // BLOSC_PREFETCH=<nthreads> turns read-ahead on without touching the sources (see blosc2_set_prefetch())
 6571|  16.3k|  const char *prefetch_env = getenv("BLOSC_PREFETCH");
 6572|  16.3k|  if (prefetch_env != NULL && prefetch_env[0] != '\0') {
  ------------------
  |  Branch (6572:7): [True: 0, False: 16.3k]
  |  Branch (6572:31): [True: 0, False: 0]
  ------------------
 6573|      0|    long nthreads = strtol(prefetch_env, NULL, 10);
 6574|      0|    if (nthreads > 0 && nthreads <= BLOSC2_PREFETCH_MAX_NTHREADS) {
  ------------------
  |  |  786|      0|#define BLOSC2_PREFETCH_MAX_NTHREADS 256
  ------------------
  |  Branch (6574:9): [True: 0, False: 0]
  |  Branch (6574:25): [True: 0, False: 0]
  ------------------
 6575|      0|      blosc2_set_prefetch((int) nthreads, 0, 0);
 6576|      0|    }
 6577|      0|  }
 6578|       |  // BLOSC_PREFETCH_POPULATE: of which memory-mapped frames read-ahead populates the mapping: of all (1), of none (0),
 6579|       |  // or, if unset or empty, of those on GPFS
 6580|  16.3k|  const char *populate_env = getenv("BLOSC_PREFETCH_POPULATE");
 6581|  16.3k|  prefetch_set_populate(populate_env != NULL && populate_env[0] != '\0' ? strtol(populate_env, NULL, 10) != 0 : -1);
  ------------------
  |  Branch (6581:25): [True: 0, False: 16.3k]
  |  Branch (6581:49): [True: 0, False: 0]
  ------------------
 6582|       |
 6583|  16.3k|  g_ncodecs = 0;
 6584|  16.3k|  g_nfilters = 0;
 6585|  16.3k|  g_ntuners = 0;
 6586|       |
 6587|  16.3k|#if defined(HAVE_PLUGINS)
 6588|  16.3k|  #include "blosc2/blosc2-common.h"
 6589|  16.3k|  #include "blosc2/blosc2-stdio.h"
 6590|  16.3k|  register_codecs();
 6591|  16.3k|  register_filters();
 6592|  16.3k|  register_tuners();
 6593|  16.3k|#endif
 6594|  16.3k|  blosc2_pthread_mutex_init(&global_comp_mutex, NULL);
  ------------------
  |  |   90|  16.3k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 6595|       |  /* Create a global context */
 6596|  16.3k|  g_global_context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 6597|  16.3k|  memset(g_global_context, 0, sizeof(blosc2_context));
 6598|  16.3k|  g_global_context->nthreads = g_nthreads;
 6599|  16.3k|  g_global_context->new_nthreads = g_nthreads;
 6600|  16.3k|  blosc2_pthread_mutex_init(&g_global_context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  16.3k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 6601|  16.3k|  store_release_int(&g_initlib, BLOSC_STATE_INITIALIZED);
  ------------------
  |  |  143|  16.3k|#define store_release_int(p, v) __atomic_store_n((p), (v), __ATOMIC_RELEASE)
  ------------------
 6602|  16.3k|}
blosc2.c:blosc2_free_resources_locked:
 6631|  16.3k|static int blosc2_free_resources_locked(void) {
 6632|       |  /* The calling thread's temporaries (other threads free theirs at exit) */
 6633|  16.3k|  blosc2_tmp_cache_clear();
 6634|  16.3k|  int rc = release_thread_backend(g_global_context);
 6635|       |  /* The thread pools that no context uses (kept for reuse) */
 6636|  16.3k|  static_lock(&pool_registry_mutex);
  ------------------
  |  |  132|  16.3k|#define static_lock(l) pthread_mutex_lock(l)
  ------------------
 6637|  16.3k|  struct blosc_shared_pool *unused = unlink_unused_pools_locked(0);
 6638|  16.3k|  static_unlock(&pool_registry_mutex);
  ------------------
  |  |  133|  16.3k|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 6639|  16.3k|  destroy_shared_pools(unused);
 6640|  16.3k|  return rc;
 6641|  16.3k|}
blosc2.c:unlink_unused_pools_locked:
 5894|  16.3k|static struct blosc_shared_pool *unlink_unused_pools_locked(int keep) {
 5895|  16.3k|  struct blosc_shared_pool *unused = NULL;
 5896|  16.3k|  struct blosc_shared_pool **prev = &shared_pools;
 5897|  16.3k|  while (*prev != NULL) {
  ------------------
  |  Branch (5897:10): [True: 0, False: 16.3k]
  ------------------
 5898|      0|    struct blosc_shared_pool *pool = *prev;
 5899|      0|    if (pool->context_refs == 0) {
  ------------------
  |  Branch (5899:9): [True: 0, False: 0]
  ------------------
 5900|      0|      if (keep == 0) {
  ------------------
  |  Branch (5900:11): [True: 0, False: 0]
  ------------------
 5901|      0|        *prev = pool->next;
 5902|      0|        pool->next = unused;
 5903|      0|        unused = pool;
 5904|      0|        continue;
 5905|      0|      }
 5906|      0|      keep--;
 5907|      0|    }
 5908|      0|    prev = &pool->next;
 5909|      0|  }
 5910|  16.3k|  return unused;
 5911|  16.3k|}
blosc2.c:destroy_shared_pools:
 5881|  32.7k|static void destroy_shared_pools(struct blosc_shared_pool *pool) {
 5882|  32.7k|  while (pool != NULL) {
  ------------------
  |  Branch (5882:10): [True: 0, False: 32.7k]
  ------------------
 5883|      0|    struct blosc_shared_pool *next = pool->next;
 5884|      0|    destroy_shared_pool(pool);
 5885|      0|    pool = next;
 5886|      0|  }
 5887|  32.7k|}
blosc2.c:serial_context_put:
 6768|  15.1k|static void serial_context_put(struct thread_context* thread_context) {
 6769|  15.1k|#if !defined(_WIN32)
 6770|  15.1k|  tmp_cache_t *cache = tmp_cache_get(false);
 6771|  15.1k|  if (cache != NULL && cache->serial == thread_context) {
  ------------------
  |  Branch (6771:7): [True: 15.1k, False: 0]
  |  Branch (6771:24): [True: 15.1k, False: 0]
  ------------------
 6772|  15.1k|    blosc2_context* context = thread_context->parent_context;
 6773|  15.1k|    if (context->serial_context == NULL &&
  ------------------
  |  Branch (6773:9): [True: 15.1k, False: 0]
  ------------------
 6774|  15.1k|        thread_context_nbytes(thread_context) > BLOSC2_SERIAL_TLS_MAX) {
  ------------------
  |  | 6664|  15.1k|#define BLOSC2_SERIAL_TLS_MAX (16 * 1024 * 1024)
  ------------------
  |  Branch (6774:9): [True: 0, False: 15.1k]
  ------------------
 6775|       |      /* Grown too large to keep per thread (e.g. ZSTD compression state for
 6776|       |         large blocks at high levels): the context that needed it keeps it, as
 6777|       |         if it had always been its own, and the thread starts a new one */
 6778|      0|      thread_context->tmp_blocksize = context->blocksize;
 6779|      0|      context->serial_context = thread_context;
 6780|      0|      cache->serial = NULL;
 6781|      0|    }
 6782|  15.1k|    else {
 6783|  15.1k|      thread_context->parent_context = NULL;
 6784|  15.1k|    }
 6785|  15.1k|    cache->serial_busy = false;
 6786|  15.1k|  }
 6787|       |#else
 6788|       |  BLOSC_UNUSED_PARAM(thread_context);
 6789|       |#endif
 6790|  15.1k|}
blosc2.c:thread_context_nbytes:
 6714|  15.1k|static size_t thread_context_nbytes(const struct thread_context* thread_context) {
 6715|  15.1k|  size_t nbytes = thread_context->tmp_nbytes +
 6716|  15.1k|                  (thread_context->blosclz_state != NULL ? sizeof(blosclz_state) : 0);
  ------------------
  |  Branch (6716:20): [True: 0, False: 15.1k]
  ------------------
 6717|  15.1k|#if defined(HAVE_ZSTD)
 6718|  15.1k|  if (thread_context->zstd_cctx != NULL) {
  ------------------
  |  Branch (6718:7): [True: 0, False: 15.1k]
  ------------------
 6719|      0|    nbytes += ZSTD_sizeof_CCtx(thread_context->zstd_cctx);
 6720|      0|  }
 6721|  15.1k|  if (thread_context->zstd_dctx != NULL) {
  ------------------
  |  Branch (6721:7): [True: 10.2k, False: 4.81k]
  ------------------
 6722|  10.2k|    nbytes += ZSTD_sizeof_DCtx(thread_context->zstd_dctx);
 6723|  10.2k|  }
 6724|  15.1k|#endif
 6725|  15.1k|  if (thread_context->lz4_cstream != NULL) {
  ------------------
  |  Branch (6725:7): [True: 0, False: 15.1k]
  ------------------
 6726|      0|    nbytes += sizeof(LZ4_stream_t);
 6727|      0|  }
 6728|  15.1k|  if (thread_context->lz4hc_cstream != NULL) {
  ------------------
  |  Branch (6728:7): [True: 0, False: 15.1k]
  ------------------
 6729|      0|    nbytes += sizeof(LZ4_streamHC_t);
 6730|      0|  }
 6731|  15.1k|  return nbytes;
 6732|  15.1k|}
blosc2.c:tmp_cache_get:
 6695|  62.9k|static tmp_cache_t *tmp_cache_get(bool create) {
 6696|  62.9k|  pthread_once(&tmp_cache_once, tmp_cache_init);
 6697|  62.9k|  if (!tmp_cache_ready) {
  ------------------
  |  Branch (6697:7): [True: 0, False: 62.9k]
  ------------------
 6698|      0|    return NULL;
 6699|      0|  }
 6700|  62.9k|  tmp_cache_t *cache = pthread_getspecific(tmp_cache_key);
 6701|  62.9k|  if (cache == NULL && create) {
  ------------------
  |  Branch (6701:7): [True: 589, False: 62.3k]
  |  Branch (6701:24): [True: 1, False: 588]
  ------------------
 6702|      1|    cache = calloc(1, sizeof(tmp_cache_t));
 6703|      1|    if (cache != NULL && pthread_setspecific(tmp_cache_key, cache) != 0) {
  ------------------
  |  Branch (6703:9): [True: 1, False: 0]
  |  Branch (6703:26): [True: 0, False: 1]
  ------------------
 6704|      0|      free(cache);
 6705|       |      cache = NULL;
 6706|      0|    }
 6707|      1|  }
 6708|  62.9k|  return cache;
 6709|  62.9k|}
blosc2.c:tmp_cache_init:
 6691|      1|static void tmp_cache_init(void) {
 6692|      1|  tmp_cache_ready = pthread_key_create(&tmp_cache_key, tmp_cache_release) == 0;
 6693|      1|}
blosc2.c:blosc2_destroy_locked:
 6892|  16.3k|static void blosc2_destroy_locked(void) {
 6893|  16.3k|  blosc2_free_resources_locked();
 6894|  16.3k|  blosc2_free_ctx(g_global_context);
 6895|  16.3k|  blosc2_tmp_cache_clear();
 6896|       |
 6897|       |  /* Atomically invalidate outstanding context pointers and detach the registry.
 6898|       |   * A release either finishes its refcount update before this, or observes the
 6899|       |   * new epoch without dereferencing its stale pool.  Join outside the lock. */
 6900|  16.3k|  static_lock(&pool_registry_mutex);
  ------------------
  |  |  132|  16.3k|#define static_lock(l) pthread_mutex_lock(l)
  ------------------
 6901|  16.3k|  store_release_int(&g_destroy_count, load_acquire_int(&g_destroy_count) + 1);
  ------------------
  |  |  143|  16.3k|#define store_release_int(p, v) __atomic_store_n((p), (v), __ATOMIC_RELEASE)
  ------------------
 6902|  16.3k|  struct blosc_shared_pool *pools = shared_pools;
 6903|  16.3k|  shared_pools = NULL;
 6904|  16.3k|  static_unlock(&pool_registry_mutex);
  ------------------
  |  |  133|  16.3k|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 6905|  16.3k|  destroy_shared_pools(pools);
 6906|       |
 6907|  16.3k|  blosc2_pthread_mutex_destroy(&global_comp_mutex);
  ------------------
  |  |   91|  16.3k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6908|  16.3k|}
blosc2.c:my_malloc:
  365|  46.5k|static uint8_t* my_malloc(size_t size) {
  366|  46.5k|  void* block = NULL;
  367|  46.5k|  int res = 0;
  368|       |  /* Keep aligned allocations valid under Valgrind and POSIX wrappers. */
  369|  46.5k|  if (size == 0) {
  ------------------
  |  Branch (369:7): [True: 0, False: 46.5k]
  ------------------
  370|      0|    size = 1;
  371|      0|  }
  372|       |
  373|       |/* Do an alignment to 32 bytes because AVX2 is supported */
  374|       |#if defined(_WIN32)
  375|       |  /* A (void *) cast needed for avoiding a warning with MINGW :-/ */
  376|       |  block = (void *)_aligned_malloc(size, 32);
  377|       |#elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600
  378|       |  /* Platform does have an implementation of posix_memalign */
  379|  46.5k|  res = posix_memalign(&block, 32, size);
  380|       |#else
  381|       |  block = malloc(size);
  382|       |#endif  /* _WIN32 */
  383|       |
  384|  46.5k|  if (block == NULL || res != 0) {
  ------------------
  |  Branch (384:7): [True: 0, False: 46.5k]
  |  Branch (384:24): [True: 0, False: 46.5k]
  ------------------
  385|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  386|      0|    return NULL;
  387|      0|  }
  388|       |
  389|  46.5k|  return (uint8_t*)block;
  390|  46.5k|}
blosc2.c:release_thread_backend:
 6049|  16.3k|static int release_thread_backend(blosc2_context *context) {
 6050|  16.3k|  if (context->thread_backend == BLOSC_BACKEND_CALLBACK && context->threads_started > 0) {
  ------------------
  |  |   35|  32.7k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (6050:7): [True: 0, False: 16.3k]
  |  Branch (6050:60): [True: 0, False: 0]
  ------------------
 6051|      0|    for (int32_t t = 0; t < context->threads_started; t++) {
  ------------------
  |  Branch (6051:25): [True: 0, False: 0]
  ------------------
 6052|      0|      destroy_thread_context(context->thread_contexts + t);
 6053|      0|    }
 6054|      0|    my_free(context->thread_contexts);
 6055|      0|    context->thread_contexts = NULL;
 6056|      0|    blosc2_pthread_mutex_destroy(&context->count_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6057|      0|    blosc2_pthread_mutex_destroy(&context->delta_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6058|      0|    blosc2_pthread_cond_destroy(&context->delta_cv);
  ------------------
  |  |   97|      0|#define blosc2_pthread_cond_destroy(a) pthread_cond_destroy((a))
  ------------------
 6059|      0|  }
 6060|       |#if defined(_WIN32)
 6061|       |  else if (context->thread_backend == BLOSC_BACKEND_PER_CONTEXT && context->threads_started > 0) {
 6062|       |    /* Signal all workers to exit. */
 6063|       |    blosc2_pthread_mutex_lock(&context->jobs_mutex);
 6064|       |    context->end_threads = 1;
 6065|       |    blosc2_pthread_cond_broadcast(&context->jobs_ready);
 6066|       |    blosc2_pthread_mutex_unlock(&context->jobs_mutex);
 6067|       |
 6068|       |    for (int32_t t = 0; t < context->threads_started; t++) {
 6069|       |      blosc2_pthread_join(context->threads[t], NULL);
 6070|       |    }
 6071|       |    my_free(context->threads);
 6072|       |    context->threads = NULL;
 6073|       |    blosc2_pthread_cond_destroy(&context->jobs_done);
 6074|       |    blosc2_pthread_cond_destroy(&context->jobs_ready);
 6075|       |    blosc2_pthread_mutex_destroy(&context->jobs_mutex);
 6076|       |    blosc2_pthread_cond_destroy(&context->delta_cv);
 6077|       |    blosc2_pthread_mutex_destroy(&context->delta_mutex);
 6078|       |    blosc2_pthread_mutex_destroy(&context->count_mutex);
 6079|       |  }
 6080|       |#endif  /* _WIN32 */
 6081|  16.3k|  else if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL && context->thread_pool != NULL) {
  ------------------
  |  |   34|  32.7k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (6081:12): [True: 0, False: 16.3k]
  |  Branch (6081:68): [True: 0, False: 0]
  ------------------
 6082|      0|    struct blosc_shared_pool *pool = context->thread_pool;
 6083|       |
 6084|      0|    static_lock(&pool_registry_mutex);
  ------------------
  |  |  132|      0|#define static_lock(l) pthread_mutex_lock(l)
  ------------------
 6085|      0|    if (context->pool_epoch != load_acquire_int(&g_destroy_count)) {
  ------------------
  |  |  142|      0|#define load_acquire_int(p) __atomic_load_n((p), __ATOMIC_ACQUIRE)
  ------------------
  |  Branch (6085:9): [True: 0, False: 0]
  ------------------
 6086|       |      /* Check under the process-lifetime registry lock: destruction cannot
 6087|       |       * invalidate the pool between this check and the refcount update. */
 6088|      0|      static_unlock(&pool_registry_mutex);
  ------------------
  |  |  133|      0|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 6089|      0|      context->thread_pool = NULL;
 6090|      0|      context->threads_started = 0;
 6091|      0|      context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   33|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 6092|      0|      return 0;
 6093|      0|    }
 6094|       |
 6095|       |    /* A pool that no context uses any more stays registered for the next
 6096|       |     * contexts with the same nthreads: contexts that live for one call
 6097|       |     * (python-blosc2's compress2()/decompress2(), BLOSC_NOLOCK) would otherwise
 6098|       |     * start and join all of its threads every time.  The most recently
 6099|       |     * released unused pools are kept, the others destroyed (the pool moves to
 6100|       |     * the front of the registry); blosc2_free_resources() destroys all. */
 6101|      0|    struct blosc_shared_pool *unused = NULL;
 6102|      0|    pool->context_refs--;
 6103|      0|    if (pool->context_refs == 0) {
  ------------------
  |  Branch (6103:9): [True: 0, False: 0]
  ------------------
 6104|      0|      struct blosc_shared_pool **prev = &shared_pools;
 6105|      0|      while (*prev != NULL && *prev != pool) {
  ------------------
  |  Branch (6105:14): [True: 0, False: 0]
  |  Branch (6105:31): [True: 0, False: 0]
  ------------------
 6106|      0|        prev = &(*prev)->next;
 6107|      0|      }
 6108|      0|      if (*prev == pool) {
  ------------------
  |  Branch (6108:11): [True: 0, False: 0]
  ------------------
 6109|      0|        *prev = pool->next;
 6110|      0|        pool->next = shared_pools;
 6111|      0|        shared_pools = pool;
 6112|      0|      }
 6113|      0|      unused = unlink_unused_pools_locked(BLOSC2_UNUSED_POOLS_MAX);
  ------------------
  |  |  187|      0|#define BLOSC2_UNUSED_POOLS_MAX 2
  ------------------
 6114|      0|    }
 6115|      0|    static_unlock(&pool_registry_mutex);
  ------------------
  |  |  133|      0|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 6116|      0|    destroy_shared_pools(unused);
 6117|      0|    context->thread_pool = NULL;
 6118|      0|  }
 6119|       |
 6120|  16.3k|  context->threads_started = 0;
 6121|  16.3k|  context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   33|  16.3k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 6122|  16.3k|  return 0;
 6123|  16.3k|}
blosc2.c:release_context_dict_buffer:
 2979|  32.3k|static void release_context_dict_buffer(blosc2_context* context) {
 2980|  32.3k|  if (context->dict_buffer_owned && context->dict_buffer != NULL) {
  ------------------
  |  Branch (2980:7): [True: 0, False: 32.3k]
  |  Branch (2980:37): [True: 0, False: 0]
  ------------------
 2981|      0|    free(context->dict_buffer);
 2982|      0|  }
 2983|  32.3k|  context->dict_buffer = NULL;
 2984|       |  context->dict_buffer_owned = false;
 2985|  32.3k|  context->dict_size = 0;
 2986|  32.3k|}

blosclz_decompress:
  833|    671|int blosclz_decompress(const void* input, int length, void* output, int maxout) {
  834|    671|  const uint8_t* ip = (const uint8_t*)input;
  835|    671|  const uint8_t* ip_limit = ip + length;
  836|    671|  uint8_t* op = (uint8_t*)output;
  837|    671|  uint32_t ctrl;
  838|    671|  uint8_t* op_limit = op + maxout;
  839|    671|  if (BLOSCLZ_UNLIKELY(length == 0)) {
  ------------------
  |  |   39|    671|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (39:30): [True: 0, False: 671]
  |  |  ------------------
  ------------------
  840|      0|    return 0;
  841|      0|  }
  842|    671|  ctrl = (*ip++) & 31U;
  843|       |
  844|   655k|  while (1) {
  ------------------
  |  Branch (844:10): [True: 655k, Folded]
  ------------------
  845|   655k|    if (ctrl >= 32) {
  ------------------
  |  Branch (845:9): [True: 122k, False: 532k]
  ------------------
  846|       |      // match
  847|   122k|      int32_t len = (int32_t)(ctrl >> 5U) - 1 ;
  848|   122k|      int32_t ofs = (int32_t)(ctrl & 31U) << 8U;
  849|   122k|      uint8_t code;
  850|   122k|      const uint8_t* ref = op - ofs;
  851|       |
  852|   122k|      if (len == 7 - 1) {
  ------------------
  |  Branch (852:11): [True: 33.7k, False: 89.0k]
  ------------------
  853|  33.7k|#ifdef BLOSCLZ_WIDE_DECODE
  854|       |        /* Long runs encode their lengths as consecutive 255-byte extensions.
  855|       |         * Consume eight together, keeping an offset byte in reserve. */
  856|  34.0k|        while (ip_limit - ip >= 9) {
  ------------------
  |  Branch (856:16): [True: 33.8k, False: 144]
  ------------------
  857|  33.8k|          uint64_t extensions;
  858|  33.8k|          memcpy(&extensions, ip, sizeof(extensions));
  859|  33.8k|          if (extensions != UINT64_MAX) {
  ------------------
  |  Branch (859:15): [True: 33.6k, False: 229]
  ------------------
  860|  33.6k|            break;
  861|  33.6k|          }
  862|    229|          if (BLOSCLZ_UNLIKELY(len > maxout - 8 * 255)) {
  ------------------
  |  |   39|    229|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (39:30): [True: 1, False: 228]
  |  |  ------------------
  ------------------
  863|      1|            return 0;
  864|      1|          }
  865|    228|          len += 8 * 255;
  866|    228|          ip += 8;
  867|    228|        }
  868|  33.7k|#endif
  869|  39.8k|        do {
  870|  39.8k|          if (BLOSCLZ_UNLIKELY(ip + 1 >= ip_limit)) {
  ------------------
  |  |   39|  39.8k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (39:30): [True: 17, False: 39.7k]
  |  |  ------------------
  ------------------
  871|     17|            return 0;
  872|     17|          }
  873|  39.7k|          code = *ip++;
  874|       |          /* Guard before the addition so that `len` can never wrap past
  875|       |             INT32_MAX.  The subsequent `len += 3` adds at most 3 more,
  876|       |             so capping at maxout here is safe and sufficient. */
  877|  39.7k|          if (BLOSCLZ_UNLIKELY(len > maxout - code)) {
  ------------------
  |  |   39|  39.7k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (39:30): [True: 21, False: 39.7k]
  |  |  ------------------
  ------------------
  878|     21|            return 0;
  879|     21|          }
  880|  39.7k|          len += code;
  881|  39.7k|        } while (code == 255);
  ------------------
  |  Branch (881:18): [True: 6.02k, False: 33.7k]
  ------------------
  882|  33.7k|      }
  883|  89.0k|      else {
  884|  89.0k|        if (BLOSCLZ_UNLIKELY(ip + 1 >= ip_limit)) {
  ------------------
  |  |   39|  89.0k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (39:30): [True: 37, False: 89.0k]
  |  |  ------------------
  ------------------
  885|     37|          return 0;
  886|     37|        }
  887|  89.0k|      }
  888|   122k|      code = *ip++;
  889|   122k|      len += 3;
  890|   122k|      ref -= code;
  891|       |
  892|       |      /* match from 16-bit distance */
  893|   122k|      if (BLOSCLZ_UNLIKELY(code == 255)) {
  ------------------
  |  |   39|   122k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (39:30): [True: 8.16k, False: 114k]
  |  |  ------------------
  ------------------
  894|  8.16k|        if (ofs == (31U << 8U)) {
  ------------------
  |  Branch (894:13): [True: 818, False: 7.34k]
  ------------------
  895|    818|          if (ip + 1 >= ip_limit) {
  ------------------
  |  Branch (895:15): [True: 1, False: 817]
  ------------------
  896|      1|            return 0;
  897|      1|          }
  898|    817|          ofs = (*ip++) << 8U;
  899|    817|          ofs += *ip++;
  900|    817|          ref = op - ofs - MAX_DISTANCE;
  ------------------
  |  |   50|    817|#define MAX_DISTANCE 8191
  ------------------
  901|    817|        }
  902|  8.16k|      }
  903|       |
  904|   122k|      if (BLOSCLZ_UNLIKELY(len > op_limit - op)) {
  ------------------
  |  |   39|   122k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (39:30): [True: 86, False: 122k]
  |  |  ------------------
  ------------------
  905|     86|        return 0;
  906|     86|      }
  907|       |
  908|   122k|      if (BLOSCLZ_UNLIKELY(ref <= (uint8_t*)output)) {
  ------------------
  |  |   39|   122k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (39:30): [True: 52, False: 122k]
  |  |  ------------------
  ------------------
  909|     52|        return 0;
  910|     52|      }
  911|       |
  912|   122k|      if (BLOSCLZ_UNLIKELY(ip >= ip_limit)) break;
  ------------------
  |  |   39|   122k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (39:30): [True: 1, False: 122k]
  |  |  ------------------
  ------------------
  913|   122k|      ctrl = *ip++;
  914|       |
  915|   122k|      ref--;
  916|   122k|      if (ref == op - 1) {
  ------------------
  |  Branch (916:11): [True: 17.0k, False: 105k]
  ------------------
  917|       |        /* optimized copy for a run */
  918|  17.0k|        memset(op, *ref, len);
  919|  17.0k|        op += len;
  920|  17.0k|      }
  921|   105k|#ifdef BLOSCLZ_WIDE_DECODE
  922|   105k|      else if ((op - ref >= 16) && (op_limit - op - len >= 16)) {
  ------------------
  |  Branch (922:16): [True: 69.0k, False: 36.5k]
  |  Branch (922:36): [True: 68.7k, False: 336]
  ------------------
  923|  68.7k|        wild_copy_16(op, ref, op + len);
  924|  68.7k|        op += len;
  925|  68.7k|      }
  926|  36.8k|#endif
  927|  36.8k|      else if ((op - ref >= 8) && (op_limit - op - len >= 8)) {
  ------------------
  |  Branch (927:16): [True: 2.99k, False: 33.8k]
  |  Branch (927:35): [True: 2.59k, False: 397]
  ------------------
  928|       |        // copy with an overlap not larger than 8
  929|  2.59k|        wild_copy(op, ref, op + len);
  930|  2.59k|        op += len;
  931|  2.59k|      }
  932|  34.2k|      else {
  933|       |        // general copy with any overlap
  934|       |#if 0 && defined(__AVX2__)
  935|       |        if (op - ref <= 16) {
  936|       |          // This is not faster on a combination of compilers (clang, gcc, icc) or machines, but
  937|       |          // it is not too slower either.
  938|       |          op = copy_match_16(op, ref, len);
  939|       |        }
  940|       |        else {
  941|       |#endif
  942|  34.2k|          op = copy_match(op, ref, (unsigned) len);
  943|       |#if 0 && defined(__AVX2__)
  944|       |        }
  945|       |#endif
  946|  34.2k|      }
  947|   122k|    }
  948|   532k|    else {
  949|       |      // literal
  950|   532k|      ctrl++;
  951|   532k|      if (BLOSCLZ_UNLIKELY(ctrl > op_limit - op)) {
  ------------------
  |  |   39|   532k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (39:30): [True: 56, False: 532k]
  |  |  ------------------
  ------------------
  952|     56|        return 0;
  953|     56|      }
  954|   532k|      if (BLOSCLZ_UNLIKELY(ctrl > ip_limit - ip)) {
  ------------------
  |  |   39|   532k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (39:30): [True: 20, False: 532k]
  |  |  ------------------
  ------------------
  955|     20|        return 0;
  956|     20|      }
  957|       |
  958|   532k|#ifdef BLOSCLZ_WIDE_DECODE
  959|       |      /* Fixed-size copies can inline.  Overcopy only within both buffers;
  960|       |       * subsequent tokens overwrite the extra output bytes. */
  961|   532k|      if (ctrl <= 16 && op_limit - op >= 16 && ip_limit - ip >= 16) {
  ------------------
  |  Branch (961:11): [True: 522k, False: 10.4k]
  |  Branch (961:25): [True: 520k, False: 1.46k]
  |  Branch (961:48): [True: 520k, False: 610]
  ------------------
  962|   520k|        memcpy(op, ip, 16);
  963|   520k|      }
  964|  12.4k|      else if (op_limit - op >= 32 && ip_limit - ip >= 32) {
  ------------------
  |  Branch (964:16): [True: 10.9k, False: 1.53k]
  |  Branch (964:39): [True: 10.4k, False: 537]
  ------------------
  965|  10.4k|        memcpy(op, ip, 32);
  966|  10.4k|      }
  967|  2.07k|      else
  968|  2.07k|#endif
  969|  2.07k|      {
  970|  2.07k|        memcpy(op, ip, ctrl);
  971|  2.07k|      }
  972|   532k|      op += ctrl; ip += ctrl;
  973|       |      // On GCC-6, fastcopy this is still faster than plain memcpy
  974|       |      // However, using recent CLANG/LLVM 9.0, there is almost no difference
  975|       |      // in performance.
  976|       |      // And starting on CLANG/LLVM 10 and GCC 9, memcpy is generally faster.
  977|       |      // op = fastcopy(op, ip, (unsigned) ctrl); ip += ctrl;
  978|       |
  979|   532k|      if (BLOSCLZ_UNLIKELY(ip >= ip_limit)) break;
  ------------------
  |  |   39|   532k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (39:30): [True: 379, False: 532k]
  |  |  ------------------
  ------------------
  980|   532k|      ctrl = *ip++;
  981|   532k|    }
  982|   655k|  }
  983|       |
  984|    380|  return (int)(op - (uint8_t*)output);
  985|    671|}
blosclz.c:wild_copy_16:
  828|  68.7k|static inline void wild_copy_16(uint8_t *out, const uint8_t *from, uint8_t *end) {
  829|   257k|  do { memcpy(out, from, 16); out += 16; from += 16; } while (out < end);
  ------------------
  |  Branch (829:63): [True: 188k, False: 68.7k]
  ------------------
  830|  68.7k|}
blosclz.c:wild_copy:
  813|  2.59k|static inline void wild_copy(uint8_t *out, const uint8_t* from, uint8_t* end) {
  814|  2.59k|  uint8_t* d = out;
  815|  2.59k|  const uint8_t* s = from;
  816|  2.59k|  uint8_t* const e = end;
  817|       |
  818|  7.54k|  do { memcpy(d,s,8); d+=8; s+=8; } while (d<e);
  ------------------
  |  Branch (818:44): [True: 4.94k, False: 2.59k]
  ------------------
  819|  2.59k|}

delta_decoder:
   97|  17.1k|                   int32_t typesize, uint8_t* dest) {
   98|  17.1k|  int32_t i;
   99|       |
  100|  17.1k|  if (offset == 0) {
  ------------------
  |  Branch (100:7): [True: 2.88k, False: 14.2k]
  ------------------
  101|       |    /* Decode delta for the reference block */
  102|  2.88k|    switch (typesize) {
  103|    856|      case 1:
  ------------------
  |  Branch (103:7): [True: 856, False: 2.02k]
  ------------------
  104|  10.6M|        for (i = 1; i < nbytes; i++) {
  ------------------
  |  Branch (104:21): [True: 10.6M, False: 856]
  ------------------
  105|  10.6M|          dest[i] ^= dref[i-1];
  106|  10.6M|        }
  107|    856|        break;
  108|    318|      case 2:
  ------------------
  |  Branch (108:7): [True: 318, False: 2.56k]
  ------------------
  109|   416k|        for (i = 1; i < nbytes / 2; i++) {
  ------------------
  |  Branch (109:21): [True: 415k, False: 318]
  ------------------
  110|   415k|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i-1];
  111|   415k|        }
  112|    318|        break;
  113|    266|      case 4:
  ------------------
  |  Branch (113:7): [True: 266, False: 2.61k]
  ------------------
  114|   503k|        for (i = 1; i < nbytes / 4; i++) {
  ------------------
  |  Branch (114:21): [True: 502k, False: 266]
  ------------------
  115|   502k|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i-1];
  116|   502k|        }
  117|    266|        break;
  118|    566|      case 8:
  ------------------
  |  Branch (118:7): [True: 566, False: 2.31k]
  ------------------
  119|   304k|        for (i = 1; i < nbytes / 8; i++) {
  ------------------
  |  Branch (119:21): [True: 303k, False: 566]
  ------------------
  120|   303k|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i-1];
  121|   303k|        }
  122|    566|        break;
  123|    878|      default:
  ------------------
  |  Branch (123:7): [True: 878, False: 2.00k]
  ------------------
  124|    878|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (124:13): [True: 316, False: 562]
  ------------------
  125|    316|          delta_decoder(dref, offset, nbytes, 8, dest);
  126|    562|        } else {
  127|    562|          delta_decoder(dref, offset, nbytes, 1, dest);
  128|    562|        }
  129|  2.88k|    }
  130|  14.2k|  } else {
  131|       |    /* Decode delta for the non-reference blocks */
  132|  14.2k|    switch (typesize) {
  133|  4.55k|      case 1:
  ------------------
  |  Branch (133:7): [True: 4.55k, False: 9.68k]
  ------------------
  134|  2.76M|        for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (134:21): [True: 2.76M, False: 4.55k]
  ------------------
  135|  2.76M|          dest[i] ^= dref[i];
  136|  2.76M|        }
  137|  4.55k|        break;
  138|  1.19k|      case 2:
  ------------------
  |  Branch (138:7): [True: 1.19k, False: 13.0k]
  ------------------
  139|  15.2k|        for (i = 0; i < nbytes / 2; i++) {
  ------------------
  |  Branch (139:21): [True: 14.0k, False: 1.19k]
  ------------------
  140|  14.0k|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i];
  141|  14.0k|        }
  142|  1.19k|        break;
  143|  1.83k|      case 4:
  ------------------
  |  Branch (143:7): [True: 1.83k, False: 12.4k]
  ------------------
  144|   167k|        for (i = 0; i < nbytes / 4; i++) {
  ------------------
  |  Branch (144:21): [True: 166k, False: 1.83k]
  ------------------
  145|   166k|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i];
  146|   166k|        }
  147|  1.83k|        break;
  148|  2.11k|      case 8:
  ------------------
  |  Branch (148:7): [True: 2.11k, False: 12.1k]
  ------------------
  149|   113k|        for (i = 0; i < nbytes / 8; i++) {
  ------------------
  |  Branch (149:21): [True: 111k, False: 2.11k]
  ------------------
  150|   111k|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i];
  151|   111k|        }
  152|  2.11k|        break;
  153|  4.54k|      default:
  ------------------
  |  Branch (153:7): [True: 4.54k, False: 9.69k]
  ------------------
  154|  4.54k|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (154:13): [True: 1.10k, False: 3.44k]
  ------------------
  155|  1.10k|          delta_decoder(dref, offset, nbytes, 8, dest);
  156|  3.44k|        } else {
  157|  3.44k|          delta_decoder(dref, offset, nbytes, 1, dest);
  158|  3.44k|        }
  159|  14.2k|    }
  160|  14.2k|  }
  161|  17.1k|}

fastcopy:
  504|    217|unsigned char *fastcopy(unsigned char *out, const unsigned char *from, unsigned len) {
  505|    217|  switch (len) {
  506|     10|    case 32:
  ------------------
  |  Branch (506:5): [True: 10, False: 207]
  ------------------
  507|     10|      return copy_32_bytes(out, from);
  508|      3|    case 16:
  ------------------
  |  Branch (508:5): [True: 3, False: 214]
  ------------------
  509|      3|      return copy_16_bytes(out, from);
  510|     11|    case 8:
  ------------------
  |  Branch (510:5): [True: 11, False: 206]
  ------------------
  511|     11|      return copy_8_bytes(out, from);
  512|    193|    default: {
  ------------------
  |  Branch (512:5): [True: 193, False: 24]
  ------------------
  513|    193|    }
  514|    217|  }
  515|    193|  if (len < 8) {
  ------------------
  |  Branch (515:7): [True: 100, False: 93]
  ------------------
  516|    100|    return copy_bytes(out, from, len);
  517|    100|  }
  518|     93|#if defined(__SSE2__)
  519|     93|  if (len < 16) {
  ------------------
  |  Branch (519:7): [True: 4, False: 89]
  ------------------
  520|      4|    return chunk_memcpy(out, from, len);
  521|      4|  }
  522|     89|#if !defined(__AVX2__)
  523|     89|  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|     93|}
copy_match:
  537|  34.2k|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|  34.2k|  unsigned overlap_dist = (unsigned) (out - from);
  556|  34.2k|  if (overlap_dist > sz) {
  ------------------
  |  Branch (556:7): [True: 217, False: 34.0k]
  ------------------
  557|    217|    return fastcopy(out, from, len);
  558|    217|  }
  559|       |
  560|       |  // Otherwise we need to be more careful so as not to overwrite destination
  561|  34.0k|  switch (overlap_dist) {
  562|      0|    case 32:
  ------------------
  |  Branch (562:5): [True: 0, False: 34.0k]
  ------------------
  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: 34.0k]
  ------------------
  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: 34.0k]
  ------------------
  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: 34.0k]
  ------------------
  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: 34.0k]
  ------------------
  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: 34.0k]
  ------------------
  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: 34.0k]
  ------------------
  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: 34.0k]
  ------------------
  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|     75|    case 16:
  ------------------
  |  Branch (614:5): [True: 75, False: 34.0k]
  ------------------
  615|    443|      for (; len >= 16; len -= 16) {
  ------------------
  |  Branch (615:14): [True: 368, False: 75]
  ------------------
  616|    368|        out = copy_16_bytes(out, from);
  617|    368|      }
  618|     75|      break;
  619|     97|    case 8:
  ------------------
  |  Branch (619:5): [True: 97, False: 33.9k]
  ------------------
  620|  1.55k|      for (; len >= 8; len -= 8) {
  ------------------
  |  Branch (620:14): [True: 1.46k, False: 97]
  ------------------
  621|  1.46k|        out = copy_8_bytes(out, from);
  622|  1.46k|      }
  623|     97|      break;
  624|  7.72k|    case 4:
  ------------------
  |  Branch (624:5): [True: 7.72k, False: 26.3k]
  ------------------
  625|   132k|      for (; len >= 4; len -= 4) {
  ------------------
  |  Branch (625:14): [True: 124k, False: 7.72k]
  ------------------
  626|   124k|        out = copy_4_bytes(out, from);
  627|   124k|      }
  628|  7.72k|      break;
  629|  11.0k|    case 2:
  ------------------
  |  Branch (629:5): [True: 11.0k, False: 23.0k]
  ------------------
  630|   157k|      for (; len >= 2; len -= 2) {
  ------------------
  |  Branch (630:14): [True: 146k, False: 11.0k]
  ------------------
  631|   146k|        out = copy_2_bytes(out, from);
  632|   146k|      }
  633|  11.0k|      break;
  634|  15.1k|    default:
  ------------------
  |  Branch (634:5): [True: 15.1k, False: 18.9k]
  ------------------
  635|   192k|      for (; len > 0; len--) {
  ------------------
  |  Branch (635:14): [True: 177k, False: 15.1k]
  ------------------
  636|   177k|        *out++ = *from++;
  637|   177k|      }
  638|  34.0k|  }
  639|       |
  640|       |  // Copy the leftovers
  641|  57.5k|  for (; len > 0; len--) {
  ------------------
  |  Branch (641:10): [True: 23.4k, False: 34.0k]
  ------------------
  642|  23.4k|    *out++ = *from++;
  643|  23.4k|  }
  644|       |
  645|  34.0k|  return out;
  646|  34.0k|}
fastcopy.c:copy_32_bytes:
  118|     10|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|     10|  chunk = _mm_loadu_si128((__m128i*)from);
  127|     10|  _mm_storeu_si128((__m128i*)out, chunk);
  128|     10|  from += 16; out += 16;
  129|     10|  chunk = _mm_loadu_si128((__m128i*)from);
  130|     10|  _mm_storeu_si128((__m128i*)out, chunk);
  131|     10|  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|     10|  return out;
  148|     10|}
fastcopy.c:copy_16_bytes:
   98|  2.00k|static inline unsigned char *copy_16_bytes(unsigned char *out, const unsigned char *from) {
   99|  2.00k|#if defined(__SSE2__)
  100|  2.00k|  __m128i chunk;
  101|  2.00k|  chunk = _mm_loadu_si128((__m128i*)from);
  102|  2.00k|  _mm_storeu_si128((__m128i*)out, chunk);
  103|  2.00k|  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|  2.00k|  return out;
  116|  2.00k|}
fastcopy.c:copy_8_bytes:
   86|  1.47k|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|  1.47k|  *(uint64_t *) out = *(uint64_t *) from;
   93|  1.47k|#endif
   94|  1.47k|  return out + 8;
   95|  1.47k|}
fastcopy.c:copy_bytes:
  161|    100|static inline unsigned char *copy_bytes(unsigned char *out, const unsigned char *from, unsigned len) {
  162|    100|  assert(len < 8);
  163|       |
  164|       |#ifdef BLOSC_STRICT_ALIGN
  165|       |  while (len--) {
  166|       |    *out++ = *from++;
  167|       |  }
  168|       |#else
  169|    100|  switch (len) {
  170|     11|    case 7:
  ------------------
  |  Branch (170:5): [True: 11, False: 89]
  ------------------
  171|     11|      return copy_7_bytes(out, from);
  172|     15|    case 6:
  ------------------
  |  Branch (172:5): [True: 15, False: 85]
  ------------------
  173|     15|      return copy_6_bytes(out, from);
  174|     27|    case 5:
  ------------------
  |  Branch (174:5): [True: 27, False: 73]
  ------------------
  175|     27|      return copy_5_bytes(out, from);
  176|     10|    case 4:
  ------------------
  |  Branch (176:5): [True: 10, False: 90]
  ------------------
  177|     10|      return copy_4_bytes(out, from);
  178|     37|    case 3:
  ------------------
  |  Branch (178:5): [True: 37, False: 63]
  ------------------
  179|     37|      return copy_3_bytes(out, from);
  180|      0|    case 2:
  ------------------
  |  Branch (180:5): [True: 0, False: 100]
  ------------------
  181|      0|      return copy_2_bytes(out, from);
  182|      0|    case 1:
  ------------------
  |  Branch (182:5): [True: 0, False: 100]
  ------------------
  183|      0|      return copy_1_bytes(out, from);
  184|      0|    case 0:
  ------------------
  |  Branch (184:5): [True: 0, False: 100]
  ------------------
  185|      0|      return out;
  186|      0|    default:
  ------------------
  |  Branch (186:5): [True: 0, False: 100]
  ------------------
  187|      0|      assert(0);
  188|    100|  }
  189|      0|#endif /* BLOSC_STRICT_ALIGN */
  190|      0|  return out;
  191|    100|}
fastcopy.c:copy_7_bytes:
   80|     11|static inline unsigned char *copy_7_bytes(unsigned char *out, const unsigned char *from) {
   81|     11|  out = copy_3_bytes(out, from);
   82|     11|  return copy_4_bytes(out, from + 3);
   83|     11|}
fastcopy.c:copy_6_bytes:
   75|     15|static inline unsigned char *copy_6_bytes(unsigned char *out, const unsigned char *from) {
   76|     15|  out = copy_2_bytes(out, from);
   77|     15|  return copy_4_bytes(out, from + 2);
   78|     15|}
fastcopy.c:copy_5_bytes:
   70|     27|static inline unsigned char *copy_5_bytes(unsigned char *out, const unsigned char *from) {
   71|     27|  out = copy_1_bytes(out, from);
   72|     27|  return copy_4_bytes(out, from + 1);
   73|     27|}
fastcopy.c:copy_3_bytes:
   65|     48|static inline unsigned char *copy_3_bytes(unsigned char *out, const unsigned char *from) {
   66|     48|  out = copy_1_bytes(out, from);
   67|     48|  return copy_2_bytes(out, from + 1);
   68|     48|}
fastcopy.c:copy_1_bytes:
   60|     75|static inline unsigned char *copy_1_bytes(unsigned char *out, const unsigned char *from) {
   61|     75|  *out++ = *from;
   62|     75|  return out;
   63|     75|}
fastcopy.c:chunk_memcpy:
  200|      4|static inline unsigned char *chunk_memcpy(unsigned char *out, const unsigned char *from, unsigned len) {
  201|      4|  unsigned sz = sizeof(uint64_t);
  202|      4|  unsigned rem = len % sz;
  203|      4|  unsigned by8;
  204|       |
  205|      4|  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|      4|  copy_8_bytes(out, from);
  209|       |
  210|      4|  len /= sz;
  211|      4|  out += rem;
  212|      4|  from += rem;
  213|       |
  214|      4|  by8 = len % 8;
  215|      4|  len -= by8;
  216|      4|  switch (by8) {
  217|      0|    case 7:
  ------------------
  |  Branch (217:5): [True: 0, False: 4]
  ------------------
  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: 4]
  ------------------
  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: 4]
  ------------------
  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: 4]
  ------------------
  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: 4]
  ------------------
  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: 4]
  ------------------
  248|      0|      out = copy_8_bytes(out, from);
  249|      0|      from += sz;
  250|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  251|       |      __attribute__ ((fallthrough));
  252|       |      #endif
  253|      4|    case 1:
  ------------------
  |  Branch (253:5): [True: 4, False: 0]
  ------------------
  254|      4|      out = copy_8_bytes(out, from);
  255|      4|      from += sz;
  256|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  257|       |      __attribute__ ((fallthrough));
  258|       |      #endif
  259|      4|    default:
  ------------------
  |  Branch (259:5): [True: 0, False: 4]
  ------------------
  260|      4|      break;
  261|      4|  }
  262|       |
  263|      4|  while (len) {
  ------------------
  |  Branch (263:10): [True: 0, False: 4]
  ------------------
  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|      4|  return out;
  285|      4|}
fastcopy.c:chunk_memcpy_unaligned:
  410|     89|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|     89|#endif
  416|     89|  unsigned rem = len % sz;
  417|     89|  unsigned ilen;
  418|       |
  419|     89|  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|     89|#endif
  427|       |
  428|     89|  len /= sz;
  429|     89|  out += rem;
  430|     89|  from += rem;
  431|       |
  432|  1.63k|  for (ilen = 0; ilen < len; ilen++) {
  ------------------
  |  Branch (432:18): [True: 1.54k, False: 89]
  ------------------
  433|       |#if defined(__AVX2__)
  434|       |    copy_32_bytes(out, from);
  435|       |#elif defined(__SSE2__)
  436|       |    copy_16_bytes(out, from);
  437|  1.54k|#endif
  438|  1.54k|    out += sz;
  439|  1.54k|    from += sz;
  440|  1.54k|  }
  441|       |
  442|     89|  return out;
  443|     89|}
fastcopy.c:copy_4_bytes:
   48|   124k|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|   124k|  *(uint32_t *) out = *(uint32_t *) from;
   55|   124k|#endif
   56|   124k|  return out + 4;
   57|   124k|}
fastcopy.c:copy_2_bytes:
   37|   147k|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|   147k|  *(uint16_t *) out = *(uint16_t *) from;
   44|   147k|#endif
   45|   147k|  return out + 2;
   46|   147k|}

prefetch_set_populate:
   85|  16.3k|void prefetch_set_populate(int mode) {
   86|  16.3k|  g_populate = mode < 0 ? -1 : (mode > 0);
  ------------------
  |  Branch (86:16): [True: 16.3k, False: 0]
  ------------------
   87|  16.3k|}
prefetch_destroy:
  338|  16.3k|void prefetch_destroy(void) {
  339|  16.3k|  pthread_mutex_lock(&destroy_mutex);
  340|  16.3k|  pthread_mutex_lock(&pool.mutex);
  341|  16.3k|  if (pool.threads == NULL) {
  ------------------
  |  Branch (341:7): [True: 16.3k, False: 0]
  ------------------
  342|  16.3k|    pthread_mutex_unlock(&pool.mutex);
  343|  16.3k|    pthread_mutex_unlock(&destroy_mutex);
  344|  16.3k|    return;
  345|  16.3k|  }
  346|      0|  pool.stop = true;
  347|      0|  pthread_cond_broadcast(&pool.work);
  348|      0|  int nthreads = pool.nthreads;
  349|      0|  pthread_t *threads = pool.threads;
  350|      0|  pool.threads = NULL;
  351|      0|  pool.nthreads = 0;
  352|      0|  pthread_mutex_unlock(&pool.mutex);
  353|       |
  354|      0|  for (int i = 0; i < nthreads; ++i) {
  ------------------
  |  Branch (354:19): [True: 0, False: 0]
  ------------------
  355|      0|    pthread_join(threads[i], NULL);
  356|      0|  }
  357|      0|  free(threads);
  358|       |
  359|      0|  pthread_mutex_lock(&pool.mutex);
  360|       |  pool.stop = false;
  361|      0|  pthread_mutex_unlock(&pool.mutex);
  362|      0|  pthread_mutex_unlock(&destroy_mutex);
  363|      0|}

unshuffle_avx2:
  777|  11.1k|               const uint8_t *_src, uint8_t *_dest) {
  778|  11.1k|  const int32_t vectorized_chunk_size = bytesoftype * (int32_t)sizeof(__m256i);
  779|       |
  780|       |  /* If the block size is too small to be vectorized,
  781|       |     use the generic implementation. */
  782|  11.1k|  if (blocksize < vectorized_chunk_size) {
  ------------------
  |  Branch (782:7): [True: 10.2k, False: 950]
  ------------------
  783|  10.2k|    unshuffle_generic(bytesoftype, blocksize, _src, _dest);
  784|  10.2k|    return;
  785|  10.2k|  }
  786|       |
  787|       |  /* If the blocksize is not a multiple of both the typesize and
  788|       |     the vector size, round the blocksize down to the next value
  789|       |     which is a multiple of both. The vectorized unshuffle can be
  790|       |     used for that portion of the data, and the naive implementation
  791|       |     can be used for the remaining portion. */
  792|    950|  const int32_t vectorizable_bytes = blocksize - (blocksize % vectorized_chunk_size);
  793|       |
  794|    950|  const int32_t vectorizable_elements = vectorizable_bytes / bytesoftype;
  795|    950|  const int32_t total_elements = blocksize / bytesoftype;
  796|       |
  797|       |  /* Optimized unshuffle implementations */
  798|    950|  switch (bytesoftype) {
  799|    371|    case 2:
  ------------------
  |  Branch (799:5): [True: 371, False: 579]
  ------------------
  800|    371|      unshuffle2_avx2(_dest, _src, vectorizable_elements, total_elements);
  801|    371|      break;
  802|    231|    case 4:
  ------------------
  |  Branch (802:5): [True: 231, False: 719]
  ------------------
  803|    231|      unshuffle4_avx2(_dest, _src, vectorizable_elements, total_elements);
  804|    231|      break;
  805|    128|    case 8:
  ------------------
  |  Branch (805:5): [True: 128, False: 822]
  ------------------
  806|    128|      unshuffle8_avx2(_dest, _src, vectorizable_elements, total_elements);
  807|    128|      break;
  808|     39|    case 12:
  ------------------
  |  Branch (808:5): [True: 39, False: 911]
  ------------------
  809|     39|      unshuffle12_avx2(_dest, _src, vectorizable_elements, total_elements);
  810|     39|      break;
  811|     61|    case 16:
  ------------------
  |  Branch (811:5): [True: 61, False: 889]
  ------------------
  812|     61|      unshuffle16_avx2(_dest, _src, vectorizable_elements, total_elements);
  813|     61|      break;
  814|    120|    default:
  ------------------
  |  Branch (814:5): [True: 120, False: 830]
  ------------------
  815|       |      /* For types larger than 16 bytes, use the AVX2 tiled unshuffle. */
  816|    120|      if (bytesoftype > (int32_t)sizeof(__m128i)) {
  ------------------
  |  Branch (816:11): [True: 75, False: 45]
  ------------------
  817|     75|        unshuffle16_tiled_avx2(_dest, _src, vectorizable_elements, total_elements, bytesoftype);
  818|     75|      }
  819|     45|      else {
  820|       |        /* Non-optimized unshuffle */
  821|     45|        unshuffle_generic(bytesoftype, blocksize, _src, _dest);
  822|       |        /* The non-optimized function covers the whole buffer,
  823|       |           so we're done processing here. */
  824|     45|        return;
  825|     45|      }
  826|    950|  }
  827|       |
  828|       |  /* If the buffer had any bytes at the end which couldn't be handled
  829|       |     by the vectorized implementations, use the non-optimized version
  830|       |     to finish them up. */
  831|    905|  if (vectorizable_bytes < blocksize) {
  ------------------
  |  Branch (831:7): [True: 627, False: 278]
  ------------------
  832|    627|    unshuffle_generic_inline(bytesoftype, vectorizable_bytes, blocksize, _src, _dest);
  833|    627|  }
  834|    905|}
shuffle-avx2.c:unshuffle2_avx2:
  331|    371|                const int32_t vectorizable_elements, const int32_t total_elements) {
  332|    371|  static const int32_t bytesoftype = 2;
  333|    371|  int32_t i;
  334|    371|  int j;
  335|    371|  __m256i ymm0[2], ymm1[2];
  336|       |
  337|  18.1k|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (337:15): [True: 17.7k, False: 371]
  ------------------
  338|       |    /* Load 32 elements (64 bytes) into 2 YMM registers. */
  339|  17.7k|    const uint8_t* const src_for_ith_element = src + i;
  340|  53.1k|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (340:17): [True: 35.4k, False: 17.7k]
  ------------------
  341|  35.4k|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  342|  35.4k|    }
  343|       |    /* Shuffle bytes */
  344|  53.1k|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (344:17): [True: 35.4k, False: 17.7k]
  ------------------
  345|  35.4k|      ymm0[j] = _mm256_permute4x64_epi64(ymm0[j], 0xd8);
  346|  35.4k|    }
  347|       |    /* Compute the low 64 bytes */
  348|  17.7k|    ymm1[0] = _mm256_unpacklo_epi8(ymm0[0], ymm0[1]);
  349|       |    /* Compute the hi 64 bytes */
  350|  17.7k|    ymm1[1] = _mm256_unpackhi_epi8(ymm0[0], ymm0[1]);
  351|       |    /* Store the result vectors in proper order */
  352|  17.7k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * sizeof(__m256i))), ymm1[0]);
  353|  17.7k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * sizeof(__m256i))), ymm1[1]);
  354|  17.7k|  }
  355|    371|}
shuffle-avx2.c:unshuffle4_avx2:
  360|    231|                const int32_t vectorizable_elements, const int32_t total_elements) {
  361|    231|  static const int32_t bytesoftype = 4;
  362|    231|  int32_t i;
  363|    231|  int j;
  364|    231|  __m256i ymm0[4], ymm1[4];
  365|       |
  366|  21.7k|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (366:15): [True: 21.5k, False: 231]
  ------------------
  367|       |    /* Load 32 elements (128 bytes) into 4 YMM registers. */
  368|  21.5k|    const uint8_t* const src_for_ith_element = src + i;
  369|   107k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (369:17): [True: 86.2k, False: 21.5k]
  ------------------
  370|  86.2k|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  371|  86.2k|    }
  372|       |    /* Shuffle bytes */
  373|  64.6k|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (373:17): [True: 43.1k, False: 21.5k]
  ------------------
  374|       |      /* Compute the low 64 bytes */
  375|  43.1k|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  376|       |      /* Compute the hi 64 bytes */
  377|  43.1k|      ymm1[2 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  378|  43.1k|    }
  379|       |    /* Shuffle 2-byte words */
  380|  64.6k|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (380:17): [True: 43.1k, False: 21.5k]
  ------------------
  381|       |      /* Compute the low 64 bytes */
  382|  43.1k|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  383|       |      /* Compute the hi 64 bytes */
  384|  43.1k|      ymm0[2 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  385|  43.1k|    }
  386|  21.5k|    ymm1[0] = _mm256_permute2x128_si256(ymm0[0], ymm0[2], 0x20);
  387|  21.5k|    ymm1[1] = _mm256_permute2x128_si256(ymm0[1], ymm0[3], 0x20);
  388|  21.5k|    ymm1[2] = _mm256_permute2x128_si256(ymm0[0], ymm0[2], 0x31);
  389|  21.5k|    ymm1[3] = _mm256_permute2x128_si256(ymm0[1], ymm0[3], 0x31);
  390|       |
  391|       |    /* Store the result vectors in proper order */
  392|   107k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (392:17): [True: 86.2k, False: 21.5k]
  ------------------
  393|  86.2k|      _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (j * sizeof(__m256i))), ymm1[j]);
  394|  86.2k|    }
  395|  21.5k|  }
  396|    231|}
shuffle-avx2.c:unshuffle8_avx2:
  401|    128|                const int32_t vectorizable_elements, const int32_t total_elements) {
  402|    128|  static const int32_t bytesoftype = 8;
  403|    128|  int32_t i;
  404|    128|  int j;
  405|    128|  __m256i ymm0[8], ymm1[8];
  406|       |
  407|  1.17k|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (407:15): [True: 1.04k, False: 128]
  ------------------
  408|       |    /* Fetch 32 elements (256 bytes) into 8 YMM registers. */
  409|  1.04k|    const uint8_t* const src_for_ith_element = src + i;
  410|  9.44k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (410:17): [True: 8.39k, False: 1.04k]
  ------------------
  411|  8.39k|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  412|  8.39k|    }
  413|       |    /* Shuffle bytes */
  414|  5.24k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (414:17): [True: 4.19k, False: 1.04k]
  ------------------
  415|       |      /* Compute the low 32 bytes */
  416|  4.19k|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  417|       |      /* Compute the hi 32 bytes */
  418|  4.19k|      ymm1[4 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  419|  4.19k|    }
  420|       |    /* Shuffle words */
  421|  5.24k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (421:17): [True: 4.19k, False: 1.04k]
  ------------------
  422|       |      /* Compute the low 32 bytes */
  423|  4.19k|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  424|       |      /* Compute the hi 32 bytes */
  425|  4.19k|      ymm0[4 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  426|  4.19k|    }
  427|  9.44k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (427:17): [True: 8.39k, False: 1.04k]
  ------------------
  428|  8.39k|      ymm0[j] = _mm256_permute4x64_epi64(ymm0[j], 0xd8);
  429|  8.39k|    }
  430|       |
  431|       |    /* Shuffle 4-byte dwords */
  432|  5.24k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (432:17): [True: 4.19k, False: 1.04k]
  ------------------
  433|       |      /* Compute the low 32 bytes */
  434|  4.19k|      ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  435|       |      /* Compute the hi 32 bytes */
  436|  4.19k|      ymm1[4 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  437|  4.19k|    }
  438|       |
  439|       |    /* Store the result vectors in proper order */
  440|  1.04k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * sizeof(__m256i))), ymm1[0]);
  441|  1.04k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * sizeof(__m256i))), ymm1[2]);
  442|  1.04k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (2 * sizeof(__m256i))), ymm1[1]);
  443|  1.04k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (3 * sizeof(__m256i))), ymm1[3]);
  444|  1.04k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (4 * sizeof(__m256i))), ymm1[4]);
  445|  1.04k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (5 * sizeof(__m256i))), ymm1[6]);
  446|  1.04k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (6 * sizeof(__m256i))), ymm1[5]);
  447|  1.04k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (7 * sizeof(__m256i))), ymm1[7]);
  448|  1.04k|  }
  449|    128|}
shuffle-avx2.c:unshuffle12_avx2:
  526|     39|    const int32_t vectorizable_elements, const int32_t total_elements) {
  527|     39|  static const int32_t bytesoftype = 12;
  528|     39|  int32_t i;
  529|     39|  int j;
  530|     39|  __m256i ymm0[16], ymm1[16];
  531|       |
  532|     39|  __m256i permute = _mm256_set_epi32(0,0,6,5,4,2,1,0);
  533|     39|  __m256i store_mask = _mm256_set_epi32(0x0, 0x0, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
  534|     39|  int32_t jump = 2*bytesoftype;
  535|    348|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (535:15): [True: 309, False: 39]
  ------------------
  536|       |    /* Fetch 24 elements (384 bytes) into 12 YMM registers. */
  537|    309|    const uint8_t* const src_for_ith_element = src + i;
  538|  4.01k|    for (j = 0; j < bytesoftype; j++) {
  ------------------
  |  Branch (538:17): [True: 3.70k, False: 309]
  ------------------
  539|  3.70k|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  540|  3.70k|    }
  541|       |    /* Initialize the last 4 registers (128 bytes) to null */
  542|  1.54k|    for (j = bytesoftype; j < 16; j++) {
  ------------------
  |  Branch (542:27): [True: 1.23k, False: 309]
  ------------------
  543|  1.23k|      ymm0[j] = _mm256_setzero_si256();
  544|  1.23k|    }
  545|       |
  546|       |    /* Shuffle bytes */
  547|  2.78k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (547:17): [True: 2.47k, False: 309]
  ------------------
  548|       |      /* Compute the low 32 bytes */
  549|  2.47k|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  550|       |      /* Compute the hi 32 bytes */
  551|  2.47k|      ymm1[8 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  552|  2.47k|    }
  553|       |    /* Shuffle 2-byte words */
  554|  2.78k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (554:17): [True: 2.47k, False: 309]
  ------------------
  555|       |      /* Compute the low 32 bytes */
  556|  2.47k|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  557|       |      /* Compute the hi 32 bytes */
  558|  2.47k|      ymm0[8 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  559|  2.47k|    }
  560|       |    /* Shuffle 4-byte dwords */
  561|  2.78k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (561:17): [True: 2.47k, False: 309]
  ------------------
  562|       |      /* Compute the low 32 bytes */
  563|  2.47k|      ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  564|       |      /* Compute the hi 32 bytes */
  565|  2.47k|      ymm1[8 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  566|  2.47k|    }
  567|       |
  568|       |    /* Shuffle 8-byte qwords */
  569|  2.78k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (569:17): [True: 2.47k, False: 309]
  ------------------
  570|       |      /* Compute the low 32 bytes */
  571|  2.47k|      ymm0[j] = _mm256_unpacklo_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  572|       |      /* Compute the hi 32 bytes */
  573|  2.47k|      ymm0[8 + j] = _mm256_unpackhi_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  574|  2.47k|    }
  575|       |
  576|       |
  577|  2.78k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (577:17): [True: 2.47k, False: 309]
  ------------------
  578|  2.47k|      ymm1[j] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x20);
  579|  2.47k|      ymm1[j + 8] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x31);
  580|  2.47k|      ymm1[j] = _mm256_permutevar8x32_epi32(ymm1[j], permute);
  581|  2.47k|      ymm1[j+8] = _mm256_permutevar8x32_epi32(ymm1[j+8], permute);
  582|       |
  583|       |
  584|  2.47k|    }
  585|    309|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * jump)), ymm1[0]);
  586|    309|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * jump)), ymm1[4]);
  587|    309|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (2 * jump)), ymm1[2]);
  588|    309|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (3 * jump)), ymm1[6]);
  589|    309|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (4 * jump)), ymm1[1]);
  590|    309|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (5 * jump)), ymm1[5]);
  591|    309|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (6 * jump)), ymm1[3]);
  592|    309|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (7 * jump)), ymm1[7]);
  593|    309|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (8 * jump)), ymm1[8]);
  594|    309|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (9 * jump)), ymm1[12]);
  595|    309|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (10 * jump)), ymm1[10]);
  596|    309|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (11 * jump)), ymm1[14]);
  597|    309|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (12 * jump)), ymm1[9]);
  598|    309|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (13 * jump)), ymm1[13]);
  599|    309|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (14 * jump)), ymm1[11]);
  600|    309|    _mm256_maskstore_epi32((int *)(dest + (i * bytesoftype) + (15 * jump)), store_mask, ymm1[15]);
  601|    309|  }
  602|     39|}
shuffle-avx2.c:unshuffle16_avx2:
  454|     61|                 const int32_t vectorizable_elements, const int32_t total_elements) {
  455|     61|  static const int32_t bytesoftype = 16;
  456|     61|  int32_t i;
  457|     61|  int j;
  458|     61|  __m256i ymm0[16], ymm1[16];
  459|       |
  460|  5.67k|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (460:15): [True: 5.61k, False: 61]
  ------------------
  461|       |    /* Fetch 32 elements (512 bytes) into 16 YMM registers. */
  462|  5.61k|    const uint8_t* const src_for_ith_element = src + i;
  463|  95.5k|    for (j = 0; j < 16; j++) {
  ------------------
  |  Branch (463:17): [True: 89.8k, False: 5.61k]
  ------------------
  464|  89.8k|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  465|  89.8k|    }
  466|       |
  467|       |    /* Shuffle bytes */
  468|  50.5k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (468:17): [True: 44.9k, False: 5.61k]
  ------------------
  469|       |      /* Compute the low 32 bytes */
  470|  44.9k|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  471|       |      /* Compute the hi 32 bytes */
  472|  44.9k|      ymm1[8 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  473|  44.9k|    }
  474|       |    /* Shuffle 2-byte words */
  475|  50.5k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (475:17): [True: 44.9k, False: 5.61k]
  ------------------
  476|       |      /* Compute the low 32 bytes */
  477|  44.9k|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  478|       |      /* Compute the hi 32 bytes */
  479|  44.9k|      ymm0[8 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  480|  44.9k|    }
  481|       |    /* Shuffle 4-byte dwords */
  482|  50.5k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (482:17): [True: 44.9k, False: 5.61k]
  ------------------
  483|       |      /* Compute the low 32 bytes */
  484|  44.9k|      ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  485|       |      /* Compute the hi 32 bytes */
  486|  44.9k|      ymm1[8 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  487|  44.9k|    }
  488|       |
  489|       |    /* Shuffle 8-byte qwords */
  490|  50.5k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (490:17): [True: 44.9k, False: 5.61k]
  ------------------
  491|       |      /* Compute the low 32 bytes */
  492|  44.9k|      ymm0[j] = _mm256_unpacklo_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  493|       |      /* Compute the hi 32 bytes */
  494|  44.9k|      ymm0[8 + j] = _mm256_unpackhi_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  495|  44.9k|    }
  496|       |
  497|  50.5k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (497:17): [True: 44.9k, False: 5.61k]
  ------------------
  498|  44.9k|      ymm1[j] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x20);
  499|  44.9k|      ymm1[j + 8] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x31);
  500|  44.9k|    }
  501|       |
  502|       |    /* Store the result vectors in proper order */
  503|  5.61k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * sizeof(__m256i))), ymm1[0]);
  504|  5.61k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * sizeof(__m256i))), ymm1[4]);
  505|  5.61k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (2 * sizeof(__m256i))), ymm1[2]);
  506|  5.61k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (3 * sizeof(__m256i))), ymm1[6]);
  507|  5.61k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (4 * sizeof(__m256i))), ymm1[1]);
  508|  5.61k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (5 * sizeof(__m256i))), ymm1[5]);
  509|  5.61k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (6 * sizeof(__m256i))), ymm1[3]);
  510|  5.61k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (7 * sizeof(__m256i))), ymm1[7]);
  511|  5.61k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (8 * sizeof(__m256i))), ymm1[8]);
  512|  5.61k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (9 * sizeof(__m256i))), ymm1[12]);
  513|  5.61k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (10 * sizeof(__m256i))), ymm1[10]);
  514|  5.61k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (11 * sizeof(__m256i))), ymm1[14]);
  515|  5.61k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (12 * sizeof(__m256i))), ymm1[9]);
  516|  5.61k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (13 * sizeof(__m256i))), ymm1[13]);
  517|  5.61k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (14 * sizeof(__m256i))), ymm1[11]);
  518|  5.61k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (15 * sizeof(__m256i))), ymm1[15]);
  519|  5.61k|  }
  520|     61|}
shuffle-avx2.c:unshuffle16_tiled_avx2:
  606|     75|                       const int32_t vectorizable_elements, const int32_t total_elements, const int32_t bytesoftype) {
  607|     75|  int32_t i;
  608|     75|  int j;
  609|     75|  __m256i ymm0[16], ymm1[16];
  610|       |
  611|     75|  const lldiv_t vecs_per_el = lldiv(bytesoftype, sizeof(__m128i));
  612|     75|  const int32_t vecs_rem = (int32_t)vecs_per_el.rem;
  613|       |
  614|       |  /* The unshuffle loops are inverted (compared to shuffle_tiled16_avx2)
  615|       |     to optimize cache utilization. */
  616|     75|  int32_t offset_into_type;
  617|    289|  for (offset_into_type = 0; offset_into_type < bytesoftype;
  ------------------
  |  Branch (617:30): [True: 214, False: 75]
  ------------------
  618|    214|       offset_into_type += (offset_into_type == 0 && vecs_rem > 0 ? vecs_rem : (int32_t)sizeof(__m128i))) {
  ------------------
  |  Branch (618:29): [True: 75, False: 139]
  |  Branch (618:54): [True: 65, False: 10]
  ------------------
  619|  1.14k|    for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (619:17): [True: 929, False: 214]
  ------------------
  620|       |      /* Load the first 16 bytes of 32 adjacent elements (512 bytes) into 16 YMM registers */
  621|    929|      const uint8_t* const src_for_ith_element = src + i;
  622|  15.7k|      for (j = 0; j < 16; j++) {
  ------------------
  |  Branch (622:19): [True: 14.8k, False: 929]
  ------------------
  623|  14.8k|        ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (total_elements * (offset_into_type + j))));
  624|  14.8k|      }
  625|       |
  626|       |      /* Shuffle bytes */
  627|  8.36k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (627:19): [True: 7.43k, False: 929]
  ------------------
  628|       |        /* Compute the low 32 bytes */
  629|  7.43k|        ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  630|       |        /* Compute the hi 32 bytes */
  631|  7.43k|        ymm1[8 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  632|  7.43k|      }
  633|       |      /* Shuffle 2-byte words */
  634|  8.36k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (634:19): [True: 7.43k, False: 929]
  ------------------
  635|       |        /* Compute the low 32 bytes */
  636|  7.43k|        ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  637|       |        /* Compute the hi 32 bytes */
  638|  7.43k|        ymm0[8 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  639|  7.43k|      }
  640|       |      /* Shuffle 4-byte dwords */
  641|  8.36k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (641:19): [True: 7.43k, False: 929]
  ------------------
  642|       |        /* Compute the low 32 bytes */
  643|  7.43k|        ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  644|       |        /* Compute the hi 32 bytes */
  645|  7.43k|        ymm1[8 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  646|  7.43k|      }
  647|       |
  648|       |      /* Shuffle 8-byte qwords */
  649|  8.36k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (649:19): [True: 7.43k, False: 929]
  ------------------
  650|       |        /* Compute the low 32 bytes */
  651|  7.43k|        ymm0[j] = _mm256_unpacklo_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  652|       |        /* Compute the hi 32 bytes */
  653|  7.43k|        ymm0[8 + j] = _mm256_unpackhi_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  654|  7.43k|      }
  655|       |
  656|  8.36k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (656:19): [True: 7.43k, False: 929]
  ------------------
  657|  7.43k|        ymm1[j] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x20);
  658|  7.43k|        ymm1[j + 8] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x31);
  659|  7.43k|      }
  660|       |
  661|       |      /* Store the result vectors in proper order */
  662|    929|      const uint8_t* const dest_with_offset = dest + offset_into_type;
  663|    929|      _mm256_storeu2_m128i(
  664|    929|          (__m128i*)(dest_with_offset + (i + 0x01) * bytesoftype),
  665|    929|          (__m128i*)(dest_with_offset + (i + 0x00) * bytesoftype), ymm1[0]);
  666|    929|      _mm256_storeu2_m128i(
  667|    929|          (__m128i*)(dest_with_offset + (i + 0x03) * bytesoftype),
  668|    929|          (__m128i*)(dest_with_offset + (i + 0x02) * bytesoftype), ymm1[4]);
  669|    929|      _mm256_storeu2_m128i(
  670|    929|          (__m128i*)(dest_with_offset + (i + 0x05) * bytesoftype),
  671|    929|          (__m128i*)(dest_with_offset + (i + 0x04) * bytesoftype), ymm1[2]);
  672|    929|      _mm256_storeu2_m128i(
  673|    929|          (__m128i*)(dest_with_offset + (i + 0x07) * bytesoftype),
  674|    929|          (__m128i*)(dest_with_offset + (i + 0x06) * bytesoftype), ymm1[6]);
  675|    929|      _mm256_storeu2_m128i(
  676|    929|          (__m128i*)(dest_with_offset + (i + 0x09) * bytesoftype),
  677|    929|          (__m128i*)(dest_with_offset + (i + 0x08) * bytesoftype), ymm1[1]);
  678|    929|      _mm256_storeu2_m128i(
  679|    929|          (__m128i*)(dest_with_offset + (i + 0x0b) * bytesoftype),
  680|    929|          (__m128i*)(dest_with_offset + (i + 0x0a) * bytesoftype), ymm1[5]);
  681|    929|      _mm256_storeu2_m128i(
  682|    929|          (__m128i*)(dest_with_offset + (i + 0x0d) * bytesoftype),
  683|    929|          (__m128i*)(dest_with_offset + (i + 0x0c) * bytesoftype), ymm1[3]);
  684|    929|      _mm256_storeu2_m128i(
  685|    929|          (__m128i*)(dest_with_offset + (i + 0x0f) * bytesoftype),
  686|    929|          (__m128i*)(dest_with_offset + (i + 0x0e) * bytesoftype), ymm1[7]);
  687|    929|      _mm256_storeu2_m128i(
  688|    929|          (__m128i*)(dest_with_offset + (i + 0x11) * bytesoftype),
  689|    929|          (__m128i*)(dest_with_offset + (i + 0x10) * bytesoftype), ymm1[8]);
  690|    929|      _mm256_storeu2_m128i(
  691|    929|          (__m128i*)(dest_with_offset + (i + 0x13) * bytesoftype),
  692|    929|          (__m128i*)(dest_with_offset + (i + 0x12) * bytesoftype), ymm1[12]);
  693|    929|      _mm256_storeu2_m128i(
  694|    929|          (__m128i*)(dest_with_offset + (i + 0x15) * bytesoftype),
  695|    929|          (__m128i*)(dest_with_offset + (i + 0x14) * bytesoftype), ymm1[10]);
  696|    929|      _mm256_storeu2_m128i(
  697|    929|          (__m128i*)(dest_with_offset + (i + 0x17) * bytesoftype),
  698|    929|          (__m128i*)(dest_with_offset + (i + 0x16) * bytesoftype), ymm1[14]);
  699|    929|      _mm256_storeu2_m128i(
  700|    929|          (__m128i*)(dest_with_offset + (i + 0x19) * bytesoftype),
  701|    929|          (__m128i*)(dest_with_offset + (i + 0x18) * bytesoftype), ymm1[9]);
  702|    929|      _mm256_storeu2_m128i(
  703|    929|          (__m128i*)(dest_with_offset + (i + 0x1b) * bytesoftype),
  704|    929|          (__m128i*)(dest_with_offset + (i + 0x1a) * bytesoftype), ymm1[13]);
  705|    929|      _mm256_storeu2_m128i(
  706|    929|          (__m128i*)(dest_with_offset + (i + 0x1d) * bytesoftype),
  707|    929|          (__m128i*)(dest_with_offset + (i + 0x1c) * bytesoftype), ymm1[11]);
  708|    929|      _mm256_storeu2_m128i(
  709|    929|          (__m128i*)(dest_with_offset + (i + 0x1f) * bytesoftype),
  710|    929|          (__m128i*)(dest_with_offset + (i + 0x1e) * bytesoftype), ymm1[15]);
  711|    929|    }
  712|    214|  }
  713|     75|}

shuffle_bytedelta_ssse3_backward:
  164|    580|int shuffle_bytedelta_ssse3_backward(const uint8_t *input, uint8_t *output, int32_t length, int typesize) {
  165|    580|  switch (typesize) {
  166|    140|    case 2: return backward2(input, output, length);
  ------------------
  |  Branch (166:5): [True: 140, False: 440]
  ------------------
  167|    275|    case 4: return backward4(input, output, length);
  ------------------
  |  Branch (167:5): [True: 275, False: 305]
  ------------------
  168|    165|    case 8: return backward8(input, output, length);
  ------------------
  |  Branch (168:5): [True: 165, False: 415]
  ------------------
  169|      0|    default: return 0;
  ------------------
  |  Branch (169:5): [True: 0, False: 580]
  ------------------
  170|    580|  }
  171|    580|}
shuffle-bytedelta-ssse3.c:prefix_sum16:
   94|    364|static inline __m128i prefix_sum16(__m128i value) {
   95|    364|  value = _mm_add_epi8(value, _mm_slli_si128(value, 1));
   96|    364|  value = _mm_add_epi8(value, _mm_slli_si128(value, 2));
   97|    364|  value = _mm_add_epi8(value, _mm_slli_si128(value, 4));
   98|       |  return _mm_add_epi8(value, _mm_slli_si128(value, 8));
   99|    364|}
shuffle-bytedelta-ssse3.c:store_planes16:
   59|    112|static inline void store_planes16(uint8_t *output, const __m128i *planes, int typesize) {
   60|    112|  if (typesize == 2) {
  ------------------
  |  Branch (60:7): [True: 68, False: 44]
  ------------------
   61|     68|    _mm_storeu_si128((__m128i *)output, _mm_unpacklo_epi8(planes[0], planes[1]));
   62|     68|    _mm_storeu_si128((__m128i *)(output + 16), _mm_unpackhi_epi8(planes[0], planes[1]));
   63|     68|  }
   64|     44|  else if (typesize == 4) {
  ------------------
  |  Branch (64:12): [True: 31, False: 13]
  ------------------
   65|     31|    __m128i a[4];
   66|     31|    a[0] = _mm_unpacklo_epi8(planes[0], planes[1]);
   67|     31|    a[1] = _mm_unpackhi_epi8(planes[0], planes[1]);
   68|     31|    a[2] = _mm_unpacklo_epi8(planes[2], planes[3]);
   69|     31|    a[3] = _mm_unpackhi_epi8(planes[2], planes[3]);
   70|     31|    _mm_storeu_si128((__m128i *)output, _mm_unpacklo_epi16(a[0], a[2]));
   71|     31|    _mm_storeu_si128((__m128i *)(output + 16), _mm_unpackhi_epi16(a[0], a[2]));
   72|     31|    _mm_storeu_si128((__m128i *)(output + 32), _mm_unpacklo_epi16(a[1], a[3]));
   73|     31|    _mm_storeu_si128((__m128i *)(output + 48), _mm_unpackhi_epi16(a[1], a[3]));
   74|     31|  }
   75|     13|  else {
   76|     13|    __m128i a[8], b[8];
   77|     65|    for (int p = 0; p < 4; p++) {
  ------------------
  |  Branch (77:21): [True: 52, False: 13]
  ------------------
   78|     52|      a[p * 2] = _mm_unpacklo_epi8(planes[p * 2], planes[p * 2 + 1]);
   79|     52|      a[p * 2 + 1] = _mm_unpackhi_epi8(planes[p * 2], planes[p * 2 + 1]);
   80|     52|    }
   81|     39|    for (int p = 0; p < 2; p++) {
  ------------------
  |  Branch (81:21): [True: 26, False: 13]
  ------------------
   82|     26|      b[p * 2] = _mm_unpacklo_epi16(a[p], a[p + 2]);
   83|     26|      b[p * 2 + 1] = _mm_unpackhi_epi16(a[p], a[p + 2]);
   84|     26|      b[p * 2 + 4] = _mm_unpacklo_epi16(a[p + 4], a[p + 6]);
   85|     26|      b[p * 2 + 5] = _mm_unpackhi_epi16(a[p + 4], a[p + 6]);
   86|     26|    }
   87|     65|    for (int p = 0; p < 4; p++) {
  ------------------
  |  Branch (87:21): [True: 52, False: 13]
  ------------------
   88|     52|      _mm_storeu_si128((__m128i *)(output + p * 32), _mm_unpacklo_epi32(b[p], b[p + 4]));
   89|     52|      _mm_storeu_si128((__m128i *)(output + p * 32 + 16), _mm_unpackhi_epi32(b[p], b[p + 4]));
   90|     52|    }
   91|     13|  }
   92|    112|}

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

shuffle-generic.c:unshuffle_generic_inline:
   64|  10.2k|                                     const uint8_t *_src, uint8_t *_dest) {
   65|  10.2k|  int32_t i, j;
   66|       |
   67|       |  /* Calculate the number of elements in the block. */
   68|  10.2k|  const int32_t neblock_quot = blocksize / type_size;
   69|  10.2k|  const int32_t neblock_rem = blocksize % type_size;
   70|  10.2k|  const int32_t vectorizable_elements = vectorizable_blocksize / type_size;
   71|       |
   72|       |  /* Non-optimized unshuffle */
   73|  27.3k|  for (i = vectorizable_elements; i < (int32_t)neblock_quot; i++) {
  ------------------
  |  Branch (73:35): [True: 17.0k, False: 10.2k]
  ------------------
   74|   187k|    for (j = 0; j < type_size; j++) {
  ------------------
  |  Branch (74:17): [True: 170k, False: 17.0k]
  ------------------
   75|   170k|      _dest[i * type_size + j] = _src[j * neblock_quot + i];
   76|   170k|    }
   77|  17.0k|  }
   78|       |
   79|       |  /* Copy any leftover bytes in the block without unshuffling them. */
   80|  10.2k|  memcpy(_dest + (blocksize - neblock_rem), _src + (blocksize - neblock_rem), neblock_rem);
   81|  10.2k|}
shuffle-avx2.c:unshuffle_generic_inline:
   64|    627|                                     const uint8_t *_src, uint8_t *_dest) {
   65|    627|  int32_t i, j;
   66|       |
   67|       |  /* Calculate the number of elements in the block. */
   68|    627|  const int32_t neblock_quot = blocksize / type_size;
   69|    627|  const int32_t neblock_rem = blocksize % type_size;
   70|    627|  const int32_t vectorizable_elements = vectorizable_blocksize / type_size;
   71|       |
   72|       |  /* Non-optimized unshuffle */
   73|  5.51k|  for (i = vectorizable_elements; i < (int32_t)neblock_quot; i++) {
  ------------------
  |  Branch (73:35): [True: 4.88k, False: 627]
  ------------------
   74|  54.0k|    for (j = 0; j < type_size; j++) {
  ------------------
  |  Branch (74:17): [True: 49.1k, False: 4.88k]
  ------------------
   75|  49.1k|      _dest[i * type_size + j] = _src[j * neblock_quot + i];
   76|  49.1k|    }
   77|  4.88k|  }
   78|       |
   79|       |  /* Copy any leftover bytes in the block without unshuffling them. */
   80|    627|  memcpy(_dest + (blocksize - neblock_rem), _src + (blocksize - neblock_rem), neblock_rem);
   81|    627|}

shuffle_bytedelta_available:
  432|    580|int shuffle_bytedelta_available(void) {
  433|    580|  init_shuffle_implementation();
  434|       |  return host_shuffle_bytedelta_forward != NULL;
  435|    580|}
shuffle_bytedelta_backward:
  446|    580|int shuffle_bytedelta_backward(const uint8_t *input, uint8_t *output, int32_t length, int typesize) {
  447|    580|  init_shuffle_implementation();
  448|    580|  if ((typesize != 2 && typesize != 4 && typesize != 8) || length < 0 || input == output ||
  ------------------
  |  Branch (448:8): [True: 440, False: 140]
  |  Branch (448:25): [True: 165, False: 275]
  |  Branch (448:42): [True: 0, False: 165]
  |  Branch (448:60): [True: 0, False: 580]
  |  Branch (448:74): [True: 0, False: 580]
  ------------------
  449|    580|      host_shuffle_bytedelta_backward == NULL) {
  ------------------
  |  Branch (449:7): [True: 0, False: 580]
  ------------------
  450|      0|    return 0;
  451|      0|  }
  452|    580|  return host_shuffle_bytedelta_backward(input, output, length, typesize);
  453|    580|}
blosc2_unshuffle:
  486|  10.7k|                 const void* src, void* dest) {
  487|       |  /* Initialize the shuffle implementation if necessary. */
  488|  10.7k|  init_shuffle_implementation();
  489|       |
  490|  10.7k|  if (typesize < 1 || typesize > 256 || blocksize < 0) {
  ------------------
  |  Branch (490:7): [True: 0, False: 10.7k]
  |  Branch (490:23): [True: 0, False: 10.7k]
  |  Branch (490:41): [True: 0, False: 10.7k]
  ------------------
  491|      0|    return BLOSC2_ERROR_INVALID_PARAM;
  492|      0|  }
  493|       |
  494|       |  /* Unshuffling single bytes is the identity (see blosc2_shuffle). */
  495|  10.7k|  if (typesize == 1) {
  ------------------
  |  Branch (495:7): [True: 0, False: 10.7k]
  ------------------
  496|      0|    if (dest != src) {
  ------------------
  |  Branch (496:9): [True: 0, False: 0]
  ------------------
  497|      0|      memcpy(dest, src, (size_t)blocksize);
  498|      0|    }
  499|      0|    return blocksize;
  500|      0|  }
  501|       |
  502|       |  /* The implementation is initialized.
  503|       |     Dispatch to it's unshuffle routine. */
  504|  10.7k|  (host_implementation.unshuffle)(typesize, blocksize, src, dest);
  505|       |
  506|  10.7k|  return blocksize;
  507|  10.7k|}
bitunshuffle:
  566|  3.71k|                     const uint8_t format_version) {
  567|       |  /* Initialize the shuffle implementation if necessary. */
  568|  3.71k|  init_shuffle_implementation();
  569|  3.71k|  size_t size = blocksize / typesize;
  570|       |
  571|  3.71k|  if (format_version == 2) {
  ------------------
  |  Branch (571:7): [True: 881, False: 2.83k]
  ------------------
  572|       |    /* Starting from version 3, bitshuffle() works differently */
  573|    881|    if ((size % 8) == 0) {
  ------------------
  |  Branch (573:9): [True: 455, False: 426]
  ------------------
  574|       |      /* The number of elems is a multiple of 8 which is supported by
  575|       |         bitshuffle. */
  576|    455|      int ret = (int) run_bitshuffle(host_implementation.bitunshuffle,
  577|    455|                                     src, dest, size, typesize, tmp);
  578|    455|      if (ret < 0) {
  ------------------
  |  Branch (578:11): [True: 0, False: 455]
  ------------------
  579|       |        // Some error in bitshuffle (should not happen)
  580|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  581|      0|        return ret;
  582|      0|      }
  583|       |      /* Copy the leftovers (the bytes that do not make up a whole element), as
  584|       |         Blosc1 does when it writes them after the shuffled part. */
  585|    455|      size_t offset = size * typesize;
  586|    455|      memcpy((uint8_t *) dest + offset, (const uint8_t *) src + offset, blocksize - offset);
  587|    455|    }
  588|    426|    else {
  589|    426|      memcpy(dest, src, blocksize);
  590|    426|    }
  591|    881|  }
  592|  2.83k|  else {
  593|       |    /* bitshuffle only supports a number of bytes that is a multiple of 8. */
  594|  2.83k|    size -= size % 8;
  595|  2.83k|    int ret = (int) run_bitshuffle(host_implementation.bitunshuffle, src, dest, size, typesize, tmp);
  596|  2.83k|    if (ret < 0) {
  ------------------
  |  Branch (596:9): [True: 0, False: 2.83k]
  ------------------
  597|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  598|      0|      return ret;
  599|      0|    }
  600|       |
  601|       |    /* Copy the leftovers */
  602|  2.83k|    size_t offset = size * typesize;
  603|  2.83k|    memcpy((uint8_t *) dest + offset, (const uint8_t *) src + offset, blocksize - offset);
  604|  2.83k|  }
  605|       |
  606|  3.71k|  return blocksize;
  607|  3.71k|}
shuffle.c:init_shuffle_implementation:
  425|  15.6k|static void init_shuffle_implementation(void) {
  426|  15.6k|  pthread_once(&implementation_once, set_host_implementation);
  427|  15.6k|}
shuffle.c:set_host_implementation:
  391|      1|static void set_host_implementation(void) {
  392|      1|  host_implementation = get_shuffle_implementation();
  393|      1|#if defined(SHUFFLE_BYTEDELTA_SSSE3_ENABLED)
  394|       |  /* SSSE3 needs only the legacy XMM state, not AVX/XSAVE or YMM support. */
  395|      1|  if (blosc_get_cpu_features() & BLOSC_HAVE_SSSE3) {
  ------------------
  |  Branch (395:7): [True: 1, False: 0]
  ------------------
  396|      1|    host_shuffle_bytedelta_forward = shuffle_bytedelta_ssse3_forward;
  397|      1|    host_shuffle_bytedelta_backward = shuffle_bytedelta_ssse3_backward;
  398|      1|  }
  399|       |#elif defined(__aarch64__) || defined(_M_ARM64)
  400|       |  host_shuffle_bytedelta_forward = shuffle_bytedelta_neon_forward;
  401|       |  host_shuffle_bytedelta_backward = shuffle_bytedelta_neon_backward;
  402|       |#endif
  403|      1|}
shuffle.c:get_shuffle_implementation:
  303|      1|static shuffle_implementation_t get_shuffle_implementation(void) {
  304|      1|#if defined(SHUFFLE_AVX512_ENABLED) || defined(SHUFFLE_AVX2_ENABLED) || defined(SHUFFLE_SSE2_ENABLED) || defined(SHUFFLE_NEON_ENABLED) || defined(SHUFFLE_ALTIVEC_ENABLED)
  305|      1|  blosc_cpu_features cpu_features = blosc_get_cpu_features();
  306|      1|#endif
  307|      1|#if defined(SHUFFLE_AVX512_ENABLED)
  308|      1|  if (cpu_features & BLOSC_HAVE_AVX512 && is_shuffle_avx2 && is_bshuf_AVX512) {
  ------------------
  |  Branch (308:7): [True: 0, False: 1]
  |  Branch (308:43): [True: 0, False: 0]
  |  Branch (308:62): [True: 0, False: 0]
  ------------------
  309|      0|    shuffle_implementation_t impl_avx512;
  310|      0|    impl_avx512.name = "avx512";
  311|      0|    impl_avx512.shuffle = (shuffle_func)shuffle_avx2;
  312|      0|    impl_avx512.unshuffle = (unshuffle_func)unshuffle_avx2;
  313|      0|    impl_avx512.bitshuffle = (bitshuffle_func) bshuf_trans_bit_elem_AVX512;
  314|      0|    impl_avx512.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_AVX512;
  315|      0|    return impl_avx512;
  316|      0|  }
  317|      1|#endif  /* defined(SHUFFLE_AVX512_ENABLED) */
  318|       |
  319|      1|#if defined(SHUFFLE_AVX2_ENABLED)
  320|      1|  if (cpu_features & BLOSC_HAVE_AVX2 && is_shuffle_avx2 && is_bshuf_AVX) {
  ------------------
  |  Branch (320:7): [True: 1, False: 0]
  |  Branch (320:41): [True: 1, False: 0]
  |  Branch (320:60): [True: 1, False: 0]
  ------------------
  321|      1|    shuffle_implementation_t impl_avx2;
  322|      1|    impl_avx2.name = "avx2";
  323|      1|    impl_avx2.shuffle = (shuffle_func)shuffle_avx2;
  324|      1|    impl_avx2.unshuffle = (unshuffle_func)unshuffle_avx2;
  325|      1|    impl_avx2.bitshuffle = (bitshuffle_func) bshuf_trans_bit_elem_AVX;
  326|      1|    impl_avx2.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_AVX;
  327|      1|    return impl_avx2;
  328|      1|  }
  329|      0|#endif  /* defined(SHUFFLE_AVX2_ENABLED) */
  330|       |
  331|      0|#if defined(SHUFFLE_SSE2_ENABLED)
  332|      0|  if (cpu_features & BLOSC_HAVE_SSE2 && is_shuffle_sse2 && is_bshuf_SSE) {
  ------------------
  |  Branch (332:7): [True: 0, False: 0]
  |  Branch (332:41): [True: 0, False: 0]
  |  Branch (332:60): [True: 0, False: 0]
  ------------------
  333|      0|    shuffle_implementation_t impl_sse2;
  334|      0|    impl_sse2.name = "sse2";
  335|      0|    impl_sse2.shuffle = (shuffle_func)shuffle_sse2;
  336|      0|    impl_sse2.unshuffle = (unshuffle_func)unshuffle_sse2;
  337|      0|    impl_sse2.bitshuffle = (bitshuffle_func)bshuf_trans_bit_elem_SSE;
  338|      0|    impl_sse2.bitunshuffle = (bitunshuffle_func) bshuf_untrans_bit_elem_SSE;
  339|      0|    return impl_sse2;
  340|      0|  }
  341|      0|#endif  /* defined(SHUFFLE_SSE2_ENABLED) */
  342|       |
  343|       |#if defined(SHUFFLE_NEON_ENABLED)
  344|       |  if (cpu_features & BLOSC_HAVE_NEON && is_shuffle_neon) {
  345|       |    shuffle_implementation_t impl_neon;
  346|       |    impl_neon.name = "neon";
  347|       |    impl_neon.shuffle = (shuffle_func)shuffle_neon;
  348|       |    impl_neon.unshuffle = (unshuffle_func)unshuffle_neon;
  349|       |#if defined(BITSHUFFLE_NEON_ENABLED)
  350|       |    impl_neon.bitshuffle = (bitshuffle_func)bshuf_trans_bit_elem_NEON;
  351|       |    impl_neon.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_NEON;
  352|       |#else
  353|       |    // The optimized bitshuffle transpose requires AArch64; ARMv7 stays scalar.
  354|       |    impl_neon.bitshuffle = (bitshuffle_func)bshuf_trans_bit_elem_scal;
  355|       |    impl_neon.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_scal;
  356|       |#endif
  357|       |    return impl_neon;
  358|       |  }
  359|       |#endif  /* defined(SHUFFLE_NEON_ENABLED) */
  360|       |
  361|       |#if defined(SHUFFLE_ALTIVEC_ENABLED)
  362|       |  if (cpu_features & BLOSC_HAVE_ALTIVEC && is_shuffle_altivec && is_bshuf_altivec) {
  363|       |    shuffle_implementation_t impl_altivec;
  364|       |    impl_altivec.name = "altivec";
  365|       |    impl_altivec.shuffle = (shuffle_func)shuffle_altivec;
  366|       |    impl_altivec.unshuffle = (unshuffle_func)unshuffle_altivec;
  367|       |    impl_altivec.bitshuffle = (bitshuffle_func)bshuf_trans_bit_elem_altivec;
  368|       |    impl_altivec.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_altivec;
  369|       |    return impl_altivec;
  370|       |  }
  371|       |#endif  /* defined(SHUFFLE_ALTIVEC_ENABLED) */
  372|       |
  373|       |  /* Processor doesn't support any of the hardware-accelerated implementations,
  374|       |     so use the generic implementation. */
  375|      0|  shuffle_implementation_t impl_generic;
  376|      0|  impl_generic.name = "generic";
  377|      0|  impl_generic.shuffle = (shuffle_func)shuffle_generic;
  378|      0|  impl_generic.unshuffle = (unshuffle_func)unshuffle_generic;
  379|      0|  impl_generic.bitshuffle = (bitshuffle_func)bshuf_trans_bit_elem_scal;
  380|      0|  impl_generic.bitunshuffle = (bitunshuffle_func)bshuf_untrans_bit_elem_scal;
  381|      0|  return impl_generic;
  382|      0|}
shuffle.c:blosc_get_cpu_features:
  107|      2|static blosc_cpu_features blosc_get_cpu_features(void) {
  108|      2|  blosc_cpu_features cpu_features = BLOSC_HAVE_NOTHING;
  109|      2|  if (__builtin_cpu_supports("sse2")) {
  ------------------
  |  Branch (109:7): [True: 2, False: 0]
  ------------------
  110|      2|    cpu_features |= BLOSC_HAVE_SSE2;
  111|      2|  }
  112|      2|  if (__builtin_cpu_supports("ssse3")) {
  ------------------
  |  Branch (112:7): [True: 2, False: 0]
  ------------------
  113|      2|    cpu_features |= BLOSC_HAVE_SSSE3;
  114|      2|  }
  115|      2|  if (__builtin_cpu_supports("avx2")) {
  ------------------
  |  Branch (115:7): [True: 2, False: 0]
  ------------------
  116|      2|    cpu_features |= BLOSC_HAVE_AVX2;
  117|      2|  }
  118|      2|  if (__builtin_cpu_supports("avx512f") && __builtin_cpu_supports("avx512bw")) {
  ------------------
  |  Branch (118:7): [True: 0, False: 2]
  |  Branch (118:44): [True: 0, False: 0]
  ------------------
  119|      0|    cpu_features |= BLOSC_HAVE_AVX512;
  120|      0|  }
  121|      2|  return cpu_features;
  122|      2|}
shuffle.c:run_bitshuffle:
  512|  3.28k|                              const size_t size, const size_t typesize, void* tmp) {
  513|  3.28k|  if (size == 0) {
  ------------------
  |  Branch (513:7): [True: 2.08k, False: 1.20k]
  ------------------
  514|  2.08k|    return 0;  /* fewer than 8 elements: only leftovers */
  515|  2.08k|  }
  516|  1.20k|  void* scratch = (tmp != NULL) ? tmp : malloc(size * typesize);
  ------------------
  |  Branch (516:19): [True: 1.20k, False: 0]
  ------------------
  517|  1.20k|  if (scratch == NULL) {
  ------------------
  |  Branch (517:7): [True: 0, False: 1.20k]
  ------------------
  518|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
  519|      0|  }
  520|  1.20k|  int64_t ret = routine(src, dest, size, typesize, scratch);
  521|  1.20k|  if (scratch != tmp) {
  ------------------
  |  Branch (521:7): [True: 0, False: 1.20k]
  ------------------
  522|      0|    free(scratch);
  523|      0|  }
  524|  1.20k|  return ret;
  525|  1.20k|}

blosc2.c:print_error:
  525|     19|static char *print_error(int rc) {
  526|       |  // TODO: remove this function, use blosc2_error_string only
  527|     19|  return (char *) blosc2_error_string(rc);
  528|     19|}
ndcell.c:blosc2_meta_get:
 2754|      6|                                  int32_t *content_len) {
 2755|      6|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2755:7): [True: 6, False: 0]
  |  Branch (2755:25): [True: 0, False: 0]
  |  Branch (2755:41): [True: 0, False: 0]
  |  Branch (2755:60): [True: 0, False: 0]
  ------------------
 2756|      6|    BLOSC_TRACE_ERROR("Invalid parameters.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2757|      6|    return BLOSC2_ERROR_INVALID_PARAM;
 2758|      6|  }
 2759|       |
 2760|      0|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2761|      0|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2761:7): [True: 0, False: 0]
  ------------------
 2762|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2763|      0|    return nmetalayer;
 2764|      0|  }
 2765|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2766|      0|  if (len < 0) {
  ------------------
  |  Branch (2766:7): [True: 0, False: 0]
  ------------------
 2767|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2768|      0|    return BLOSC2_ERROR_DATA;
 2769|      0|  }
 2770|      0|  *content_len = len;
 2771|      0|  if (len == 0) {
  ------------------
  |  Branch (2771:7): [True: 0, False: 0]
  ------------------
 2772|      0|    *content = NULL;
 2773|      0|    return nmetalayer;
 2774|      0|  }
 2775|      0|  *content = (uint8_t*)malloc((size_t)len);
 2776|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2776:7): [True: 0, False: 0]
  ------------------
 2777|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2778|      0|    *content_len = 0;
 2779|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2780|      0|  }
 2781|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2781:7): [True: 0, False: 0]
  |  Branch (2781:18): [True: 0, False: 0]
  ------------------
 2782|      0|    free(*content);
 2783|      0|    *content = NULL;
 2784|      0|    *content_len = 0;
 2785|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2786|      0|    return BLOSC2_ERROR_DATA;
 2787|      0|  }
 2788|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2789|      0|  return nmetalayer;
 2790|      0|}
ndmean.c:blosc2_meta_get:
 2754|     14|                                  int32_t *content_len) {
 2755|     14|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2755:7): [True: 14, False: 0]
  |  Branch (2755:25): [True: 0, False: 0]
  |  Branch (2755:41): [True: 0, False: 0]
  |  Branch (2755:60): [True: 0, False: 0]
  ------------------
 2756|     14|    BLOSC_TRACE_ERROR("Invalid parameters.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2757|     14|    return BLOSC2_ERROR_INVALID_PARAM;
 2758|     14|  }
 2759|       |
 2760|      0|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2761|      0|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2761:7): [True: 0, False: 0]
  ------------------
 2762|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2763|      0|    return nmetalayer;
 2764|      0|  }
 2765|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2766|      0|  if (len < 0) {
  ------------------
  |  Branch (2766:7): [True: 0, False: 0]
  ------------------
 2767|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2768|      0|    return BLOSC2_ERROR_DATA;
 2769|      0|  }
 2770|      0|  *content_len = len;
 2771|      0|  if (len == 0) {
  ------------------
  |  Branch (2771:7): [True: 0, False: 0]
  ------------------
 2772|      0|    *content = NULL;
 2773|      0|    return nmetalayer;
 2774|      0|  }
 2775|      0|  *content = (uint8_t*)malloc((size_t)len);
 2776|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2776:7): [True: 0, False: 0]
  ------------------
 2777|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2778|      0|    *content_len = 0;
 2779|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2780|      0|  }
 2781|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2781:7): [True: 0, False: 0]
  |  Branch (2781:18): [True: 0, False: 0]
  ------------------
 2782|      0|    free(*content);
 2783|      0|    *content = NULL;
 2784|      0|    *content_len = 0;
 2785|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2786|      0|    return BLOSC2_ERROR_DATA;
 2787|      0|  }
 2788|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2789|      0|  return nmetalayer;
 2790|      0|}
bytedelta.c:print_error:
  525|     22|static char *print_error(int rc) {
  526|       |  // TODO: remove this function, use blosc2_error_string only
  527|     22|  return (char *) blosc2_error_string(rc);
  528|     22|}

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

ndlz_decompress:
   42|  1.56k|                    uint8_t meta, blosc2_dparams *dparams, const void *chunk) {
   43|  1.56k|  NDLZ_ERROR_NULL(input);
  ------------------
  |  |   19|  1.56k|  do {                           \
  |  |   20|  1.56k|    if ((pointer) == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (20:9): [True: 0, False: 1.56k]
  |  |  ------------------
  |  |   21|      0|      return 0;                  \
  |  |   22|      0|    }                            \
  |  |   23|  1.56k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (23:12): [Folded, False: 1.56k]
  |  |  ------------------
  ------------------
   44|  1.56k|  NDLZ_ERROR_NULL(output);
  ------------------
  |  |   19|  1.56k|  do {                           \
  |  |   20|  1.56k|    if ((pointer) == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (20:9): [True: 0, False: 1.56k]
  |  |  ------------------
  |  |   21|      0|      return 0;                  \
  |  |   22|      0|    }                            \
  |  |   23|  1.56k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (23:12): [Folded, False: 1.56k]
  |  |  ------------------
  ------------------
   45|  1.56k|  NDLZ_ERROR_NULL(dparams);
  ------------------
  |  |   19|  1.56k|  do {                           \
  |  |   20|  1.56k|    if ((pointer) == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (20:9): [True: 0, False: 1.56k]
  |  |  ------------------
  |  |   21|      0|      return 0;                  \
  |  |   22|      0|    }                            \
  |  |   23|  1.56k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (23:12): [Folded, False: 1.56k]
  |  |  ------------------
  ------------------
   46|  1.56k|  BLOSC_UNUSED_PARAM(chunk);
  ------------------
  |  |   28|  1.56k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
   47|       |
   48|  1.56k|  switch (meta) {
   49|  1.01k|    case 4:
  ------------------
  |  Branch (49:5): [True: 1.01k, False: 548]
  ------------------
   50|  1.01k|      return ndlz4_decompress(input, input_len, output, output_len, meta, dparams);
   51|    546|    case 8:
  ------------------
  |  Branch (51:5): [True: 546, False: 1.01k]
  ------------------
   52|    546|      return ndlz8_decompress(input, input_len, output, output_len, meta, dparams);
   53|      2|    default:
  ------------------
  |  Branch (53:5): [True: 2, False: 1.55k]
  ------------------
   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|  1.56k|  }
   56|      2|  return BLOSC2_ERROR_FAILURE;
   57|  1.56k|}

ndlz4_decompress:
  526|  1.01k|                     uint8_t meta, blosc2_dparams *dparams) {
  527|  1.01k|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|  1.01k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  528|  1.01k|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|  1.01k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  529|  1.01k|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|  1.01k|    do {                                            \
  |  |  105|  1.01k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 1.01k]
  |  |  ------------------
  |  |  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|  1.01k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 1.01k]
  |  |  ------------------
  ------------------
  530|  1.01k|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|  1.01k|    do {                                            \
  |  |  105|  1.01k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 1.01k]
  |  |  ------------------
  |  |  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|  1.01k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 1.01k]
  |  |  ------------------
  ------------------
  531|       |
  532|  1.01k|  uint8_t *ip = (uint8_t *) input;
  533|  1.01k|  uint8_t *op = (uint8_t *) output;
  534|  1.01k|  uint8_t ndim;
  535|  1.01k|  int32_t blockshape[2];
  536|  1.01k|  int32_t eshape[2];
  537|  1.01k|  uint8_t *buffercpy;
  538|  1.01k|  uint8_t local_buffer[16];
  539|  1.01k|  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|  1.01k|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < (int32_t) (1 + 2 * sizeof(int32_t)))) {
  ------------------
  |  |   30|  1.01k|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 4, False: 1.00k]
  |  |  ------------------
  ------------------
  546|      4|    return 0;
  547|      4|  }
  548|  1.00k|  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|  1.00k|#define NDLZ4_CHECK_RANGE(pos, len)                                              \
  560|  1.00k|  do {                                                                           \
  561|  1.00k|    int64_t _pos = (int64_t) (pos);                                              \
  562|  1.00k|    int64_t _len = (int64_t) (len);                                              \
  563|  1.00k|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  564|  1.00k|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  565|  1.00k|      return BLOSC2_ERROR_FAILURE;                                               \
  566|  1.00k|    }                                                                            \
  567|  1.00k|  } while (0)
  568|       |
  569|       |  /* we start with literal copy */
  570|  1.00k|  ndim = *ip;
  571|  1.00k|  ip++;
  572|  1.00k|  if (ndim != 2) {
  ------------------
  |  Branch (572:7): [True: 7, False: 1.00k]
  ------------------
  573|      7|    BLOSC_TRACE_ERROR("This codec only works for ndim = 2");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  574|      7|    return BLOSC2_ERROR_FAILURE;
  575|      7|  }
  576|  1.00k|  memcpy(&blockshape[0], ip, 4);
  577|  1.00k|  ip += 4;
  578|  1.00k|  memcpy(&blockshape[1], ip, 4);
  579|  1.00k|  ip += 4;
  580|       |
  581|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3204
  582|  1.00k|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (582:7): [True: 0, False: 1.00k]
  |  Branch (582:25): [True: 30, False: 972]
  |  Branch (582:46): [True: 30, False: 942]
  ------------------
  583|     60|    BLOSC_TRACE_ERROR("Output length or blockshape is negative");
  ------------------
  |  |   93|     60|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     60|    do {                                            \
  |  |  |  |   98|     60|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     60|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 60, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     60|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  584|     60|    return BLOSC2_ERROR_FAILURE;
  585|     60|  }
  586|       |
  587|    942|  eshape[0] = ((blockshape[0] + 3) / 4) * 4;
  588|    942|  eshape[1] = ((blockshape[1] + 3) / 4) * 4;
  589|       |
  590|    942|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|    942|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 85, False: 857]
  |  |  ------------------
  ------------------
  591|     85|    BLOSC_TRACE_ERROR("The blockshape is bigger than the output buffer");
  ------------------
  |  |   93|     85|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     85|    do {                                            \
  |  |  |  |   98|     85|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     85|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 85, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     85|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  592|     85|    return 0;
  593|     85|  }
  594|    857|  memset(op, 0, blockshape[0] * blockshape[1]);
  595|       |
  596|    857|  uint32_t i_stop[2];
  597|  2.57k|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (597:19): [True: 1.71k, False: 857]
  ------------------
  598|  1.71k|    i_stop[i] = eshape[i] / 4;
  599|  1.71k|  }
  600|       |
  601|       |  /* main loop */
  602|    857|  uint32_t ii[2];
  603|    857|  uint32_t padding[2] = {0};
  604|    857|  uint32_t ind = 0;
  605|    857|  uint8_t cell_aux[16];
  606|  4.48G|  for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
  ------------------
  |  Branch (606:19): [True: 4.48G, False: 661]
  ------------------
  607|  4.48G|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (607:21): [True: 1.83k, False: 4.48G]
  ------------------
  608|  1.83k|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|  1.83k|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 1.83k]
  |  |  ------------------
  ------------------
  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|  1.83k|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (612:11): [True: 970, False: 864]
  ------------------
  613|    970|        padding[0] = (blockshape[0] % 4 == 0) ? 4 : blockshape[0] % 4;
  ------------------
  |  Branch (613:22): [True: 84, False: 886]
  ------------------
  614|    970|      } else {
  615|    864|        padding[0] = 4;
  616|    864|      }
  617|  1.83k|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (617:11): [True: 1.50k, False: 331]
  ------------------
  618|  1.50k|        padding[1] = (blockshape[1] % 4 == 0) ? 4 : blockshape[1] % 4;
  ------------------
  |  Branch (618:22): [True: 93, False: 1.41k]
  ------------------
  619|  1.50k|      } else {
  620|    331|        padding[1] = 4;
  621|    331|      }
  622|  1.83k|      int64_t cur = ip - (const uint8_t *) input;   // in-range: ip is within [input, ip_limit]
  623|  1.83k|      NDLZ4_CHECK_RANGE(cur, 1);
  ------------------
  |  |  560|  1.83k|  do {                                                                           \
  |  |  561|  1.83k|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|  1.83k|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|  1.83k|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 1.83k]
  |  |  |  Branch (563:21): [True: 0, False: 1.83k]
  |  |  |  Branch (563:33): [True: 10, False: 1.82k]
  |  |  ------------------
  |  |  564|     10|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     10|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     10|    }                                                                            \
  |  |  567|  1.83k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 1.82k]
  |  |  ------------------
  ------------------
  624|  1.82k|      token = *ip++;
  625|  1.82k|      if (token == 0) {    // no match
  ------------------
  |  Branch (625:11): [True: 387, False: 1.43k]
  ------------------
  626|    387|        NDLZ4_CHECK_RANGE(cur + 1, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  560|    387|  do {                                                                           \
  |  |  561|    387|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    387|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    387|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 387]
  |  |  |  Branch (563:21): [True: 0, False: 387]
  |  |  |  Branch (563:33): [True: 11, False: 376]
  |  |  ------------------
  |  |  564|     11|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     11|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     11|    }                                                                            \
  |  |  567|    387|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 376]
  |  |  ------------------
  ------------------
  627|    376|        buffercpy = ip;
  628|    376|        ip += padding[0] * padding[1];
  629|  1.43k|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (629:18): [True: 122, False: 1.31k]
  ------------------
  630|    122|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    122|  do {                                                                           \
  |  |  561|    122|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    122|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    122|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 122]
  |  |  |  Branch (563:21): [True: 0, False: 122]
  |  |  |  Branch (563:33): [True: 1, False: 121]
  |  |  ------------------
  |  |  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|    122|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 121]
  |  |  ------------------
  ------------------
  631|    121|        uint16_t offset;
  632|    121|        memcpy(&offset, ip, sizeof(offset));
  633|    121|        int64_t bpos = (cur + 1) - (int64_t) offset - 1;   // back-reference start offset
  634|    121|        NDLZ4_CHECK_RANGE(bpos, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  560|    121|  do {                                                                           \
  |  |  561|    121|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    121|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    121|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 19, False: 102]
  |  |  |  Branch (563:21): [True: 0, False: 102]
  |  |  |  Branch (563:33): [True: 1, False: 101]
  |  |  ------------------
  |  |  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|    121|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 101]
  |  |  ------------------
  ------------------
  635|    101|        buffercpy = (uint8_t *) input + bpos;
  636|    101|        ip += 2;
  637|  1.31k|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (637:18): [True: 193, False: 1.12k]
  ------------------
  638|    193|        NDLZ4_CHECK_RANGE(cur + 1, 1);
  ------------------
  |  |  560|    193|  do {                                                                           \
  |  |  561|    193|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    193|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    193|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 193]
  |  |  |  Branch (563:21): [True: 0, False: 193]
  |  |  |  Branch (563:33): [True: 1, False: 192]
  |  |  ------------------
  |  |  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|    193|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 192]
  |  |  ------------------
  ------------------
  639|    192|        buffercpy = cell_aux;
  640|    192|        memset(buffercpy, *ip, 16);
  641|    192|        ip++;
  642|  1.12k|      } else if (token >= 224) { // three rows match
  ------------------
  |  Branch (642:18): [True: 362, False: 760]
  ------------------
  643|    362|        buffercpy = local_buffer;
  644|    362|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    362|  do {                                                                           \
  |  |  561|    362|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    362|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    362|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 362]
  |  |  |  Branch (563:21): [True: 0, False: 362]
  |  |  |  Branch (563:33): [True: 4, False: 358]
  |  |  ------------------
  |  |  564|      4|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      4|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      4|    }                                                                            \
  |  |  567|    362|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 358]
  |  |  ------------------
  ------------------
  645|    358|        uint16_t offset;
  646|    358|        memcpy(&offset, ip, sizeof(offset));
  647|    358|        offset += 3;
  648|    358|        ip += 2;
  649|    358|        int i, j, k;
  650|    358|        if ((token >> 3U) == 28) {
  ------------------
  |  Branch (650:13): [True: 79, False: 279]
  ------------------
  651|     79|          i = 1;
  652|     79|          j = 2;
  653|     79|          k = 3;
  654|    279|        } else {
  655|    279|          i = 0;
  656|    279|          if ((token >> 3U) < 30) {
  ------------------
  |  Branch (656:15): [True: 79, False: 200]
  ------------------
  657|     79|            j = 1;
  658|     79|            k = 2;
  659|    200|          } else {
  660|    200|            k = 3;
  661|    200|            if ((token >> 3U) == 30) {
  ------------------
  |  Branch (661:17): [True: 86, False: 114]
  ------------------
  662|     86|              j = 1;
  663|    114|            } else {
  664|    114|              j = 2;
  665|    114|            }
  666|    200|          }
  667|    279|        }
  668|    358|        int64_t bpos = (cur + 3) - (int64_t) offset;   // == (ip - offset) as an offset
  669|    358|        NDLZ4_CHECK_RANGE(bpos, 12);
  ------------------
  |  |  560|    358|  do {                                                                           \
  |  |  561|    358|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    358|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    358|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 21, False: 337]
  |  |  |  Branch (563:21): [True: 0, False: 337]
  |  |  |  Branch (563:33): [True: 9, False: 328]
  |  |  ------------------
  |  |  564|     30|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     30|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     30|    do {                                            \
  |  |  |  |  |  |   98|     30|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     30|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 30, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     30|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     30|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     30|    }                                                                            \
  |  |  567|    358|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 328]
  |  |  ------------------
  ------------------
  670|    328|        const uint8_t *ref = (const uint8_t *) input + bpos;
  671|    328|        memcpy(&buffercpy[i * 4], ref, 4);
  672|    328|        memcpy(&buffercpy[j * 4], ref + 4, 4);
  673|    328|        memcpy(&buffercpy[k * 4], ref + 8, 4);
  674|    810|        for (int l = 0; l < 4; l++) {
  ------------------
  |  Branch (674:25): [True: 810, False: 0]
  ------------------
  675|    810|          if ((l != i) && (l != j) && (l != k)) {
  ------------------
  |  Branch (675:15): [True: 557, False: 253]
  |  Branch (675:27): [True: 403, False: 154]
  |  Branch (675:39): [True: 328, False: 75]
  ------------------
  676|    328|            NDLZ4_CHECK_RANGE(ip - (const uint8_t *) input, 4);
  ------------------
  |  |  560|    328|  do {                                                                           \
  |  |  561|    328|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    328|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    328|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 328]
  |  |  |  Branch (563:21): [True: 0, False: 328]
  |  |  |  Branch (563:33): [True: 4, False: 324]
  |  |  ------------------
  |  |  564|      4|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      4|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      4|    }                                                                            \
  |  |  567|    328|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 324]
  |  |  ------------------
  ------------------
  677|    324|            memcpy(&buffercpy[l * 4], ip, 4);
  678|    324|            ip += 4;
  679|    324|            break;
  680|    328|          }
  681|    810|        }
  682|       |
  683|    760|      } else if ((token >= 128) && (token <= 191)) { // rows pair match
  ------------------
  |  Branch (683:18): [True: 435, False: 325]
  |  Branch (683:36): [True: 434, False: 1]
  ------------------
  684|    434|        buffercpy = local_buffer;
  685|    434|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    434|  do {                                                                           \
  |  |  561|    434|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    434|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    434|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 434]
  |  |  |  Branch (563:21): [True: 0, False: 434]
  |  |  |  Branch (563:33): [True: 3, False: 431]
  |  |  ------------------
  |  |  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|    434|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 431]
  |  |  ------------------
  ------------------
  686|    431|        uint16_t offset;
  687|    431|        memcpy(&offset, ip, sizeof(offset));
  688|    431|        offset += 3;
  689|    431|        ip += 2;
  690|    431|        int i, j;
  691|    431|        if (token == 128) {
  ------------------
  |  Branch (691:13): [True: 110, False: 321]
  ------------------
  692|    110|          i = 2;
  693|    110|          j = 3;
  694|    321|        } else {
  695|    321|          i = (token - 128) >> 5U;
  696|    321|          j = ((token - 128) >> 3U) - (i << 2U);
  697|    321|        }
  698|    431|        int64_t bpos = (cur + 3) - (int64_t) offset;
  699|    431|        NDLZ4_CHECK_RANGE(bpos, 8);
  ------------------
  |  |  560|    431|  do {                                                                           \
  |  |  561|    431|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    431|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    431|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 25, False: 406]
  |  |  |  Branch (563:21): [True: 0, False: 406]
  |  |  |  Branch (563:33): [True: 1, False: 405]
  |  |  ------------------
  |  |  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|    431|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 405]
  |  |  ------------------
  ------------------
  700|    405|        const uint8_t *ref = (const uint8_t *) input + bpos;
  701|    405|        memcpy(&buffercpy[i * 4], ref, 4);
  702|    405|        memcpy(&buffercpy[j * 4], ref + 4, 4);
  703|  2.00k|        for (int k = 0; k < 4; k++) {
  ------------------
  |  Branch (703:25): [True: 1.61k, False: 393]
  ------------------
  704|  1.61k|          if ((k != i) && (k != j)) {
  ------------------
  |  Branch (704:15): [True: 1.21k, False: 403]
  |  Branch (704:27): [True: 817, False: 393]
  ------------------
  705|    817|            NDLZ4_CHECK_RANGE(ip - (const uint8_t *) input, 4);
  ------------------
  |  |  560|    817|  do {                                                                           \
  |  |  561|    817|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    817|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    817|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 817]
  |  |  |  Branch (563:21): [True: 0, False: 817]
  |  |  |  Branch (563:33): [True: 12, False: 805]
  |  |  ------------------
  |  |  564|     12|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     12|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     12|    }                                                                            \
  |  |  567|    817|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 805]
  |  |  ------------------
  ------------------
  706|    805|            memcpy(&buffercpy[k * 4], ip, 4);
  707|    805|            ip += 4;
  708|    805|          }
  709|  1.61k|        }
  710|    405|      } else if ((token >= 40) && (token <= 63)) {  // 2 rows pair matches
  ------------------
  |  Branch (710:18): [True: 311, False: 15]
  |  Branch (710:35): [True: 304, False: 7]
  ------------------
  711|    304|        buffercpy = local_buffer;
  712|    304|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    304|  do {                                                                           \
  |  |  561|    304|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    304|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    304|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 304]
  |  |  |  Branch (563:21): [True: 0, False: 304]
  |  |  |  Branch (563:33): [True: 2, False: 302]
  |  |  ------------------
  |  |  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|    304|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 302]
  |  |  ------------------
  ------------------
  713|    302|        uint16_t offset_1;
  714|    302|        memcpy(&offset_1, ip, sizeof(offset_1));
  715|    302|        offset_1 += 5;
  716|    302|        ip += 2;
  717|    302|        NDLZ4_CHECK_RANGE(cur + 3, 2);
  ------------------
  |  |  560|    302|  do {                                                                           \
  |  |  561|    302|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    302|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    302|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 302]
  |  |  |  Branch (563:21): [True: 0, False: 302]
  |  |  |  Branch (563:33): [True: 1, False: 301]
  |  |  ------------------
  |  |  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|    302|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 301]
  |  |  ------------------
  ------------------
  718|    301|        uint16_t offset_2;
  719|    301|        memcpy(&offset_2, ip, sizeof(offset_2));
  720|    301|        offset_2 += 5;
  721|    301|        ip += 2;
  722|    301|        int i, j, k, l, m;
  723|    301|        i = 0;
  724|    301|        j = ((token - 32) >> 3U);
  725|    301|        l = -1;
  726|  1.20k|        for (k = 1; k < 4; k++) {
  ------------------
  |  Branch (726:21): [True: 903, False: 301]
  ------------------
  727|    903|          if ((k != i) && (k != j)) {
  ------------------
  |  Branch (727:15): [True: 903, False: 0]
  |  Branch (727:27): [True: 602, False: 301]
  ------------------
  728|    602|            if (l == -1) {
  ------------------
  |  Branch (728:17): [True: 301, False: 301]
  ------------------
  729|    301|              l = k;
  730|    301|            } else {
  731|    301|              m = k;
  732|    301|            }
  733|    602|          }
  734|    903|        }
  735|    301|        int64_t bpos1 = (cur + 5) - (int64_t) offset_1;
  736|    301|        NDLZ4_CHECK_RANGE(bpos1, 8);
  ------------------
  |  |  560|    301|  do {                                                                           \
  |  |  561|    301|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    301|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    301|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 21, False: 280]
  |  |  |  Branch (563:21): [True: 0, False: 280]
  |  |  |  Branch (563:33): [True: 3, False: 277]
  |  |  ------------------
  |  |  564|     24|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     24|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     24|    do {                                            \
  |  |  |  |  |  |   98|     24|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     24|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 24, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     24|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     24|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     24|    }                                                                            \
  |  |  567|    301|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 277]
  |  |  ------------------
  ------------------
  737|    277|        const uint8_t *ref1 = (const uint8_t *) input + bpos1;
  738|    277|        memcpy(&buffercpy[i * 4], ref1, 4);
  739|    277|        memcpy(&buffercpy[j * 4], ref1 + 4, 4);
  740|    277|        int64_t bpos2 = (cur + 5) - (int64_t) offset_2;
  741|    277|        NDLZ4_CHECK_RANGE(bpos2, 8);
  ------------------
  |  |  560|    277|  do {                                                                           \
  |  |  561|    277|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    277|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    277|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 23, False: 254]
  |  |  |  Branch (563:21): [True: 0, False: 254]
  |  |  |  Branch (563:33): [True: 2, False: 252]
  |  |  ------------------
  |  |  564|     25|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     25|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     25|    }                                                                            \
  |  |  567|    277|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 252]
  |  |  ------------------
  ------------------
  742|    252|        const uint8_t *ref2 = (const uint8_t *) input + bpos2;
  743|    252|        memcpy(&buffercpy[l * 4], ref2, 4);
  744|    252|        memcpy(&buffercpy[m * 4], ref2 + 4, 4);
  745|       |
  746|    252|      } else {
  747|     22|        BLOSC_TRACE_ERROR("Invalid token: %u at cell [%d, %d]\n", token, ii[0], ii[1]);
  ------------------
  |  |   93|     22|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     22|    do {                                            \
  |  |  |  |   98|     22|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     22|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 22, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     22|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  748|     22|        return BLOSC2_ERROR_FAILURE;
  749|     22|      }
  750|       |      // fill op with buffercpy
  751|  1.63k|      uint32_t orig = ii[0] * 4 * blockshape[1] + ii[1] * 4;
  752|  8.19k|      for (uint32_t i = 0; i < 4; i++) {
  ------------------
  |  Branch (752:28): [True: 6.55k, False: 1.63k]
  ------------------
  753|  6.55k|        if (i < padding[0]) {
  ------------------
  |  Branch (753:13): [True: 4.83k, False: 1.71k]
  ------------------
  754|  4.83k|          ind = orig + i * blockshape[1];
  755|  4.83k|          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|  4.83k|          buffercpy += padding[1];
  762|  4.83k|        }
  763|  6.55k|      }
  764|  1.63k|      if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (764:11): [True: 0, False: 1.63k]
  ------------------
  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|  1.63k|    }
  769|  4.48G|  }
  770|    661|  ind += padding[1];
  771|       |
  772|    661|  if ((int32_t)ind != (blockshape[0] * blockshape[1])) {
  ------------------
  |  Branch (772:7): [True: 0, False: 661]
  ------------------
  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|    661|  if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (776:7): [True: 0, False: 661]
  ------------------
  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|    661|  return (int) ind;
  782|    661|#undef NDLZ4_CHECK_RANGE
  783|    661|}

ndlz8_decompress:
  444|    546|                     uint8_t meta, blosc2_dparams *dparams) {
  445|    546|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|    546|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  446|    546|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|    546|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  447|    546|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    546|    do {                                            \
  |  |  105|    546|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 546]
  |  |  ------------------
  |  |  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|    546|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 546]
  |  |  ------------------
  ------------------
  448|    546|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    546|    do {                                            \
  |  |  105|    546|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 546]
  |  |  ------------------
  |  |  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|    546|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 546]
  |  |  ------------------
  ------------------
  449|       |
  450|    546|  const int cell_shape = 8;
  451|    546|  const int cell_size = 64;
  452|    546|  uint8_t *ip = (uint8_t *) input;
  453|    546|  uint8_t *op = (uint8_t *) output;
  454|    546|  uint8_t ndim;
  455|    546|  int32_t blockshape[2];
  456|    546|  int32_t eshape[2];
  457|    546|  uint8_t *buffercpy;
  458|    546|  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|    546|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < (int32_t) (1 + 2 * sizeof(int32_t)))) {
  ------------------
  |  |   30|    546|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 4, False: 542]
  |  |  ------------------
  ------------------
  465|      4|    return 0;
  466|      4|  }
  467|    542|  uint8_t *ip_limit = ip + input_len;
  468|       |
  469|       |  /* we start with literal copy */
  470|    542|  ndim = *ip;
  471|    542|  ip++;
  472|    542|  if (ndim != 2) {
  ------------------
  |  Branch (472:7): [True: 4, False: 538]
  ------------------
  473|      4|    BLOSC_TRACE_ERROR("This codec only works for ndim = 2");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  474|      4|    return BLOSC2_ERROR_FAILURE;
  475|      4|  }
  476|    538|  memcpy(&blockshape[0], ip, 4);
  477|    538|  ip += 4;
  478|    538|  memcpy(&blockshape[1], ip, 4);
  479|    538|  ip += 4;
  480|       |
  481|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3203
  482|    538|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (482:7): [True: 0, False: 538]
  |  Branch (482:25): [True: 20, False: 518]
  |  Branch (482:46): [True: 32, False: 486]
  ------------------
  483|     52|    BLOSC_TRACE_ERROR("Output length or blockshape is negative");
  ------------------
  |  |   93|     52|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     52|    do {                                            \
  |  |  |  |   98|     52|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     52|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 52, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     52|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  484|     52|    return BLOSC2_ERROR_FAILURE;
  485|     52|  }
  486|       |
  487|    486|  eshape[0] = ((blockshape[0] + 7) / cell_shape) * cell_shape;
  488|    486|  eshape[1] = ((blockshape[1] + 7) / cell_shape) * cell_shape;
  489|       |
  490|    486|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|    486|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 82, False: 404]
  |  |  ------------------
  ------------------
  491|     82|    BLOSC_TRACE_ERROR("The blockshape is bigger than the output buffer");
  ------------------
  |  |   93|     82|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     82|    do {                                            \
  |  |  |  |   98|     82|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     82|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 82, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     82|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  492|     82|    return 0;
  493|     82|  }
  494|    404|  memset(op, 0, blockshape[0] * blockshape[1]);
  495|       |
  496|    404|  int32_t i_stop[2];
  497|  1.21k|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (497:19): [True: 808, False: 404]
  ------------------
  498|    808|    i_stop[i] = eshape[i] / cell_shape;
  499|    808|  }
  500|       |
  501|       |  /* main loop */
  502|    404|  int32_t ii[2];
  503|    404|  int32_t padding[2] = {0};
  504|    404|  int32_t ind = 0;
  505|    404|  uint8_t *local_buffer = malloc(cell_size);
  506|    404|  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|    404|#define NDLZ8_CHECK_RANGE(pos, len)                                              \
  518|    404|  do {                                                                           \
  519|    404|    int64_t _pos = (int64_t) (pos);                                              \
  520|    404|    int64_t _len = (int64_t) (len);                                              \
  521|    404|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  522|    404|      free(local_buffer);                                                        \
  523|    404|      free(cell_aux);                                                            \
  524|    404|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  525|    404|      return BLOSC2_ERROR_FAILURE;                                               \
  526|    404|    }                                                                            \
  527|    404|  } while (0)
  528|       |
  529|  2.38G|  for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
  ------------------
  |  Branch (529:19): [True: 2.38G, False: 267]
  ------------------
  530|  2.38G|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (530:21): [True: 590, False: 2.38G]
  ------------------
  531|    590|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|    590|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 590]
  |  |  ------------------
  ------------------
  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|    590|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (537:11): [True: 402, False: 188]
  ------------------
  538|    402|        padding[0] = (blockshape[0] % cell_shape == 0) ? cell_shape : blockshape[0] % cell_shape;
  ------------------
  |  Branch (538:22): [True: 7, False: 395]
  ------------------
  539|    402|      } else {
  540|    188|        padding[0] = cell_shape;
  541|    188|      }
  542|    590|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (542:11): [True: 449, False: 141]
  ------------------
  543|    449|        padding[1] = (blockshape[1] % cell_shape == 0) ? cell_shape : blockshape[1] % cell_shape;
  ------------------
  |  Branch (543:22): [True: 14, False: 435]
  ------------------
  544|    449|      } else {
  545|    141|        padding[1] = cell_shape;
  546|    141|      }
  547|    590|      int64_t cur = ip - (const uint8_t *) input;   // in-range: ip is within [input, ip_limit]
  548|    590|      NDLZ8_CHECK_RANGE(cur, 1);
  ------------------
  |  |  518|    590|  do {                                                                           \
  |  |  519|    590|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    590|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    590|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 590]
  |  |  |  Branch (521:21): [True: 0, False: 590]
  |  |  |  Branch (521:33): [True: 4, False: 586]
  |  |  ------------------
  |  |  522|      4|      free(local_buffer);                                                        \
  |  |  523|      4|      free(cell_aux);                                                            \
  |  |  524|      4|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      4|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      4|    }                                                                            \
  |  |  527|    590|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 586]
  |  |  ------------------
  ------------------
  549|    586|      token = *ip++;
  550|    586|      uint8_t match_type = (token >> 3U);
  551|    586|      if (token == 0) {    // no match
  ------------------
  |  Branch (551:11): [True: 169, False: 417]
  ------------------
  552|    169|        NDLZ8_CHECK_RANGE(cur + 1, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  518|    169|  do {                                                                           \
  |  |  519|    169|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    169|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    169|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 169]
  |  |  |  Branch (521:21): [True: 0, False: 169]
  |  |  |  Branch (521:33): [True: 14, False: 155]
  |  |  ------------------
  |  |  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|    169|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 155]
  |  |  ------------------
  ------------------
  553|    155|        buffercpy = ip;
  554|    155|        ip += padding[0] * padding[1];
  555|    417|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (555:18): [True: 99, False: 318]
  ------------------
  556|     99|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     99|  do {                                                                           \
  |  |  519|     99|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     99|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     99|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 99]
  |  |  |  Branch (521:21): [True: 0, False: 99]
  |  |  |  Branch (521:33): [True: 1, False: 98]
  |  |  ------------------
  |  |  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|     99|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 98]
  |  |  ------------------
  ------------------
  557|     98|        uint16_t offset;
  558|     98|        memcpy(&offset, ip, sizeof(offset));
  559|     98|        int64_t bpos = (cur + 1) - (int64_t) offset - 1;
  560|     98|        NDLZ8_CHECK_RANGE(bpos, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  518|     98|  do {                                                                           \
  |  |  519|     98|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     98|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     98|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 18, False: 80]
  |  |  |  Branch (521:21): [True: 0, False: 80]
  |  |  |  Branch (521:33): [True: 1, False: 79]
  |  |  ------------------
  |  |  522|     19|      free(local_buffer);                                                        \
  |  |  523|     19|      free(cell_aux);                                                            \
  |  |  524|     19|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     19|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     19|    }                                                                            \
  |  |  527|     98|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 79]
  |  |  ------------------
  ------------------
  561|     79|        buffercpy = (uint8_t *) input + bpos;
  562|     79|        ip += 2;
  563|    318|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (563:18): [True: 180, False: 138]
  ------------------
  564|    180|        NDLZ8_CHECK_RANGE(cur + 1, 1);
  ------------------
  |  |  518|    180|  do {                                                                           \
  |  |  519|    180|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    180|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    180|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 180]
  |  |  |  Branch (521:21): [True: 0, False: 180]
  |  |  |  Branch (521:33): [True: 1, False: 179]
  |  |  ------------------
  |  |  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|    180|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 179]
  |  |  ------------------
  ------------------
  565|    179|        buffercpy = cell_aux;
  566|    179|        memset(buffercpy, *ip, cell_size);
  567|    179|        ip++;
  568|    179|      } else if (match_type == 21) {    // triple match
  ------------------
  |  Branch (568:18): [True: 61, False: 77]
  ------------------
  569|     61|        buffercpy = local_buffer;
  570|     61|        int row = (int) (token & 7);
  571|     61|        if (row + 2 >= cell_shape) {
  ------------------
  |  Branch (571:13): [True: 2, False: 59]
  ------------------
  572|      2|          free(local_buffer);
  573|      2|          free(cell_aux);
  574|      2|          BLOSC_TRACE_ERROR("Triple match row out of bounds");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  575|      2|          return BLOSC2_ERROR_FAILURE;
  576|      2|        }
  577|     59|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     59|  do {                                                                           \
  |  |  519|     59|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     59|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     59|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 59]
  |  |  |  Branch (521:21): [True: 0, False: 59]
  |  |  |  Branch (521:33): [True: 1, False: 58]
  |  |  ------------------
  |  |  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|     59|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 58]
  |  |  ------------------
  ------------------
  578|     58|        uint16_t offset;
  579|     58|        memcpy(&offset, ip, sizeof(offset));
  580|     58|        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|     58|        int64_t bpos = cur - (int64_t) offset;
  584|     58|        NDLZ8_CHECK_RANGE(bpos, 3 * cell_shape);
  ------------------
  |  |  518|     58|  do {                                                                           \
  |  |  519|     58|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     58|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     58|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 16, False: 42]
  |  |  |  Branch (521:21): [True: 0, False: 42]
  |  |  |  Branch (521:33): [True: 2, False: 40]
  |  |  ------------------
  |  |  522|     18|      free(local_buffer);                                                        \
  |  |  523|     18|      free(cell_aux);                                                            \
  |  |  524|     18|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     18|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     18|    }                                                                            \
  |  |  527|     58|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 40]
  |  |  ------------------
  ------------------
  585|     40|        const uint8_t *ref = (const uint8_t *) input + bpos;
  586|    160|        for (int l = 0; l < 3; l++) {
  ------------------
  |  Branch (586:25): [True: 120, False: 40]
  ------------------
  587|    120|          memcpy(&buffercpy[(row + l) * cell_shape], ref + l * cell_shape, cell_shape);
  588|    120|        }
  589|    301|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (589:25): [True: 277, False: 24]
  ------------------
  590|    277|          if ((l < row) || (l > row + 2)) {
  ------------------
  |  Branch (590:15): [True: 82, False: 195]
  |  Branch (590:28): [True: 90, False: 105]
  ------------------
  591|    172|            NDLZ8_CHECK_RANGE(ip - (const uint8_t *) input, cell_shape);
  ------------------
  |  |  518|    172|  do {                                                                           \
  |  |  519|    172|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    172|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    172|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 172]
  |  |  |  Branch (521:21): [True: 0, False: 172]
  |  |  |  Branch (521:33): [True: 16, False: 156]
  |  |  ------------------
  |  |  522|     16|      free(local_buffer);                                                        \
  |  |  523|     16|      free(cell_aux);                                                            \
  |  |  524|     16|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     16|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     16|    do {                                            \
  |  |  |  |  |  |   98|     16|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     16|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 16, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     16|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     16|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     16|    }                                                                            \
  |  |  527|    172|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 156]
  |  |  ------------------
  ------------------
  592|    156|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  593|    156|            ip += cell_shape;
  594|    156|          }
  595|    277|        }
  596|     77|      } else if (match_type == 17) {    // pair match
  ------------------
  |  Branch (596:18): [True: 57, False: 20]
  ------------------
  597|     57|        buffercpy = local_buffer;
  598|     57|        int row = (int) (token & 7);
  599|     57|        if (row + 1 >= cell_shape) {
  ------------------
  |  Branch (599:13): [True: 1, False: 56]
  ------------------
  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|     56|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     56|  do {                                                                           \
  |  |  519|     56|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     56|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     56|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 56]
  |  |  |  Branch (521:21): [True: 0, False: 56]
  |  |  |  Branch (521:33): [True: 1, False: 55]
  |  |  ------------------
  |  |  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|     56|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 55]
  |  |  ------------------
  ------------------
  606|     55|        uint16_t offset;
  607|     55|        memcpy(&offset, ip, sizeof(offset));
  608|     55|        ip += 2;
  609|       |        // back-reference base == cur - offset (see triple-match note above).
  610|     55|        int64_t bpos = cur - (int64_t) offset;
  611|     55|        NDLZ8_CHECK_RANGE(bpos, 2 * cell_shape);
  ------------------
  |  |  518|     55|  do {                                                                           \
  |  |  519|     55|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     55|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     55|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 18, False: 37]
  |  |  |  Branch (521:21): [True: 0, False: 37]
  |  |  |  Branch (521:33): [True: 3, False: 34]
  |  |  ------------------
  |  |  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|     55|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 34]
  |  |  ------------------
  ------------------
  612|     34|        const uint8_t *ref = (const uint8_t *) input + bpos;
  613|    102|        for (int l = 0; l < 2; l++) {
  ------------------
  |  Branch (613:25): [True: 68, False: 34]
  ------------------
  614|     68|          memcpy(&buffercpy[(row + l) * cell_shape], ref + l * cell_shape, cell_shape);
  615|     68|        }
  616|    229|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (616:25): [True: 213, False: 16]
  ------------------
  617|    213|          if ((l < row) || (l > row + 1)) {
  ------------------
  |  Branch (617:15): [True: 86, False: 127]
  |  Branch (617:28): [True: 71, False: 56]
  ------------------
  618|    157|            NDLZ8_CHECK_RANGE(ip - (const uint8_t *) input, cell_shape);
  ------------------
  |  |  518|    157|  do {                                                                           \
  |  |  519|    157|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    157|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    157|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 157]
  |  |  |  Branch (521:21): [True: 0, False: 157]
  |  |  |  Branch (521:33): [True: 18, False: 139]
  |  |  ------------------
  |  |  522|     18|      free(local_buffer);                                                        \
  |  |  523|     18|      free(cell_aux);                                                            \
  |  |  524|     18|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     18|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     18|    }                                                                            \
  |  |  527|    157|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 139]
  |  |  ------------------
  ------------------
  619|    139|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  620|    139|            ip += cell_shape;
  621|    139|          }
  622|    213|        }
  623|     34|      } else {
  624|     20|        free(local_buffer);
  625|     20|        free(cell_aux);
  626|     20|        BLOSC_TRACE_ERROR("Invalid token: %u at cell [%d, %d]\n", token, ii[0], ii[1]);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  627|     20|        return BLOSC2_ERROR_FAILURE;
  628|     20|      }
  629|       |
  630|    453|      int32_t orig = ii[0] * cell_shape * blockshape[1] + ii[1] * cell_shape;
  631|  4.07k|      for (int32_t i = 0; i < (int32_t) cell_shape; i++) {
  ------------------
  |  Branch (631:27): [True: 3.62k, False: 453]
  ------------------
  632|  3.62k|        if (i < padding[0]) {
  ------------------
  |  Branch (632:13): [True: 2.13k, False: 1.48k]
  ------------------
  633|  2.13k|          ind = orig + i * blockshape[1];
  634|  2.13k|          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|  2.13k|          buffercpy += padding[1];
  641|  2.13k|        }
  642|  3.62k|      }
  643|    453|      if (ind > output_len) {
  ------------------
  |  Branch (643:11): [True: 0, False: 453]
  ------------------
  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|    453|    }
  650|  2.38G|  }
  651|    267|  ind += padding[1];
  652|       |
  653|    267|  free(cell_aux);
  654|    267|  free(local_buffer);
  655|       |
  656|    267|  if (ind != (blockshape[0] * blockshape[1])) {
  ------------------
  |  Branch (656:7): [True: 0, False: 267]
  ------------------
  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|    267|  if (ind > output_len) {
  ------------------
  |  Branch (660:7): [True: 0, False: 267]
  ------------------
  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|    267|  return (int) ind;
  666|    267|#undef NDLZ8_CHECK_RANGE
  667|    267|}

zfp_acc_decompress:
  294|      2|                       int32_t output_len, uint8_t meta, blosc2_dparams *dparams, const void *chunk) {
  295|      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]
  |  |  ------------------
  ------------------
  296|      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]
  |  |  ------------------
  ------------------
  297|      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]
  |  |  ------------------
  ------------------
  298|      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]
  |  |  ------------------
  ------------------
  299|      0|  BLOSC_UNUSED_PARAM(chunk);
  ------------------
  |  |   28|      0|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  300|       |
  301|      0|  blosc2_schunk *sc = dparams->schunk;
  302|      0|  int32_t typesize = sc->typesize;
  303|       |
  304|      0|  double tol = (int8_t) meta;
  305|      0|  int8_t ndim;
  306|      0|  int64_t *shape = malloc(B2ND_MAX_DIM * sizeof(int64_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  307|      0|  int32_t *chunkshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  308|      0|  int32_t *blockshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  309|      0|  uint8_t *smeta;
  310|      0|  int32_t smeta_len;
  311|      0|  if (blosc2_meta_get(sc, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (311:7): [True: 0, False: 0]
  ------------------
  312|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  313|      0|    free(shape);
  314|      0|    free(chunkshape);
  315|      0|    free(blockshape);
  316|      0|    return BLOSC2_ERROR_FAILURE;
  317|      0|  }
  318|      0|  int deserialize_rc = b2nd_deserialize_meta(smeta, smeta_len, &ndim, shape, chunkshape, blockshape, NULL, NULL);
  319|      0|  free(smeta);
  320|       |
  321|      0|  if (zfp_check_output_size(deserialize_rc, ndim, blockshape, typesize, output_len) < 0) {
  ------------------
  |  Branch (321:7): [True: 0, False: 0]
  ------------------
  322|      0|    free(shape);
  323|      0|    free(chunkshape);
  324|      0|    free(blockshape);
  325|      0|    return BLOSC2_ERROR_FAILURE;
  326|      0|  }
  327|       |
  328|      0|  zfp_type type;     /* array scalar type */
  329|      0|  zfp_field *field;  /* array meta data */
  330|      0|  zfp_stream *zfp;   /* compressed stream */
  331|      0|  bitstream *stream = NULL; /* bit stream to write to or read from */
  332|      0|  uint8_t *padded_input = NULL;
  333|      0|  size_t zfpsize;    /* byte size of compressed stream */
  334|      0|  double tolerance = pow(10, tol);
  335|       |
  336|      0|  switch (typesize) {
  337|      0|    case sizeof(float):
  ------------------
  |  Branch (337:5): [True: 0, False: 0]
  ------------------
  338|      0|      type = zfp_type_float;
  339|      0|      break;
  340|      0|    case sizeof(double):
  ------------------
  |  Branch (340:5): [True: 0, False: 0]
  ------------------
  341|      0|      type = zfp_type_double;
  342|      0|      break;
  343|      0|    default:
  ------------------
  |  Branch (343:5): [True: 0, False: 0]
  ------------------
  344|      0|      free(shape);
  345|      0|      free(chunkshape);
  346|      0|      free(blockshape);
  347|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  348|      0|      return BLOSC2_ERROR_FAILURE;
  349|      0|  }
  350|       |
  351|      0|  zfp = zfp_stream_open(NULL);
  352|      0|  zfp_stream_set_accuracy(zfp, tolerance);
  353|       |
  354|      0|  switch (ndim) {
  355|      0|    case 1:
  ------------------
  |  Branch (355:5): [True: 0, False: 0]
  ------------------
  356|      0|      field = zfp_field_1d((void *) output, type, blockshape[0]);
  357|      0|      break;
  358|      0|    case 2:
  ------------------
  |  Branch (358:5): [True: 0, False: 0]
  ------------------
  359|      0|      field = zfp_field_2d((void *) output, type, blockshape[1], blockshape[0]);
  360|      0|      break;
  361|      0|    case 3:
  ------------------
  |  Branch (361:5): [True: 0, False: 0]
  ------------------
  362|      0|      field = zfp_field_3d((void *) output, type, blockshape[2], blockshape[1], blockshape[0]);
  363|      0|      break;
  364|      0|    case 4:
  ------------------
  |  Branch (364:5): [True: 0, False: 0]
  ------------------
  365|      0|      field = zfp_field_4d((void *) output, type, blockshape[3], blockshape[2], blockshape[1], blockshape[0]);
  366|      0|      break;
  367|      0|    default:
  ------------------
  |  Branch (367:5): [True: 0, False: 0]
  ------------------
  368|      0|      free(shape);
  369|      0|      free(chunkshape);
  370|      0|      free(blockshape);
  371|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  372|      0|      return BLOSC2_ERROR_FAILURE;
  373|      0|  }
  374|       |
  375|      0|  size_t blocks = zfp_field_blocks(field);
  376|      0|  size_t min_bytes = (blocks + CHAR_BIT - 1) / CHAR_BIT;
  377|      0|  if (min_bytes < sizeof(uint64_t)) {
  ------------------
  |  Branch (377:7): [True: 0, False: 0]
  ------------------
  378|      0|    min_bytes = sizeof(uint64_t);
  379|      0|  }
  380|      0|  if (input_len < (int32_t) min_bytes) {
  ------------------
  |  Branch (380:7): [True: 0, False: 0]
  ------------------
  381|      0|    BLOSC_TRACE_ERROR("ZFP acc: input too small (%d bytes) for the required "
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  382|      0|                      "bitstream size (%zu bytes)", input_len, min_bytes);
  383|      0|    zfp_field_free(field);
  384|      0|    zfp_stream_close(zfp);
  385|      0|    free(shape);
  386|      0|    free(chunkshape);
  387|      0|    free(blockshape);
  388|      0|    return BLOSC2_ERROR_FAILURE;
  389|      0|  }
  390|       |
  391|      0|  if (zfp_open_padded_stream(input, input_len, zfp, field, &stream, &padded_input) != BLOSC2_ERROR_SUCCESS) {
  ------------------
  |  Branch (391:7): [True: 0, False: 0]
  ------------------
  392|      0|    zfp_field_free(field);
  393|      0|    zfp_stream_close(zfp);
  394|      0|    free(shape);
  395|      0|    free(chunkshape);
  396|      0|    free(blockshape);
  397|      0|    return BLOSC2_ERROR_FAILURE;
  398|      0|  }
  399|       |
  400|      0|  zfpsize = zfp_decompress(zfp, field);
  401|       |
  402|       |  /* clean up */
  403|      0|  zfp_field_free(field);
  404|      0|  zfp_stream_close(zfp);
  405|      0|  zfp_close_padded_stream(stream, padded_input);
  406|      0|  free(shape);
  407|      0|  free(chunkshape);
  408|      0|  free(blockshape);
  409|       |
  410|      0|  if (zfpsize == 0) {
  ------------------
  |  Branch (410:7): [True: 0, False: 0]
  ------------------
  411|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  412|      0|    return (int) zfpsize;
  413|      0|  }
  414|       |
  415|      0|  return (int) output_len;
  416|      0|}
zfp_prec_decompress:
  593|      2|                        int32_t output_len, uint8_t meta, blosc2_dparams *dparams, const void *chunk) {
  594|      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]
  |  |  ------------------
  ------------------
  595|      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]
  |  |  ------------------
  ------------------
  596|      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]
  |  |  ------------------
  ------------------
  597|      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]
  |  |  ------------------
  ------------------
  598|      0|  BLOSC_UNUSED_PARAM(chunk);
  ------------------
  |  |   28|      0|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  599|       |
  600|      0|  blosc2_schunk *sc = dparams->schunk;
  601|      0|  int32_t typesize = sc->typesize;
  602|      0|  int8_t ndim;
  603|      0|  int64_t *shape = malloc(B2ND_MAX_DIM * sizeof(int64_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  604|      0|  int32_t *chunkshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  605|      0|  int32_t *blockshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  606|      0|  uint8_t *smeta;
  607|      0|  int32_t smeta_len;
  608|      0|  if (blosc2_meta_get(sc, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (608:7): [True: 0, False: 0]
  ------------------
  609|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  610|      0|    free(shape);
  611|      0|    free(chunkshape);
  612|      0|    free(blockshape);
  613|      0|    return BLOSC2_ERROR_FAILURE;
  614|      0|  }
  615|      0|  int deserialize_rc = b2nd_deserialize_meta(smeta, smeta_len, &ndim, shape, chunkshape, blockshape, NULL, NULL);
  616|      0|  free(smeta);
  617|       |
  618|      0|  if (zfp_check_output_size(deserialize_rc, ndim, blockshape, typesize, output_len) < 0) {
  ------------------
  |  Branch (618:7): [True: 0, False: 0]
  ------------------
  619|      0|    free(shape);
  620|      0|    free(chunkshape);
  621|      0|    free(blockshape);
  622|      0|    return BLOSC2_ERROR_FAILURE;
  623|      0|  }
  624|       |
  625|      0|  zfp_type type;     /* array scalar type */
  626|      0|  zfp_field *field;  /* array meta data */
  627|      0|  zfp_stream *zfp;   /* compressed stream */
  628|      0|  bitstream *stream = NULL; /* bit stream to write to or read from */
  629|      0|  uint8_t *padded_input = NULL;
  630|      0|  size_t zfpsize;    /* byte size of compressed stream */
  631|       |
  632|      0|  uint prec;
  633|      0|  switch (ndim) {
  634|      0|    case 1:
  ------------------
  |  Branch (634:5): [True: 0, False: 0]
  ------------------
  635|      0|      prec = meta + 5;
  636|      0|      break;
  637|      0|    case 2:
  ------------------
  |  Branch (637:5): [True: 0, False: 0]
  ------------------
  638|      0|      prec = meta + 7;
  639|      0|      break;
  640|      0|    case 3:
  ------------------
  |  Branch (640:5): [True: 0, False: 0]
  ------------------
  641|      0|      prec = meta + 9;
  642|      0|      break;
  643|      0|    case 4:
  ------------------
  |  Branch (643:5): [True: 0, False: 0]
  ------------------
  644|      0|      prec = meta + 11;
  645|      0|      break;
  646|      0|    default:
  ------------------
  |  Branch (646:5): [True: 0, False: 0]
  ------------------
  647|      0|      free(shape);
  648|      0|      free(chunkshape);
  649|      0|      free(blockshape);
  650|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  651|      0|      return BLOSC2_ERROR_FAILURE;
  652|      0|  }
  653|       |
  654|      0|  if (prec > ZFP_MAX_PREC) {
  ------------------
  |  |   20|      0|#define ZFP_MAX_PREC    64 /* maximum precision supported */
  ------------------
  |  Branch (654:7): [True: 0, False: 0]
  ------------------
  655|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  655|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  656|      0|    prec = ZFP_MAX_PREC;
  ------------------
  |  |   20|      0|#define ZFP_MAX_PREC    64 /* maximum precision supported */
  ------------------
  657|      0|  }
  658|       |
  659|      0|  switch (typesize) {
  660|      0|    case sizeof(float):
  ------------------
  |  Branch (660:5): [True: 0, False: 0]
  ------------------
  661|      0|      type = zfp_type_float;
  662|      0|      break;
  663|      0|    case sizeof(double):
  ------------------
  |  Branch (663:5): [True: 0, False: 0]
  ------------------
  664|      0|      type = zfp_type_double;
  665|      0|      break;
  666|      0|    default:
  ------------------
  |  Branch (666:5): [True: 0, False: 0]
  ------------------
  667|      0|      free(shape);
  668|      0|      free(chunkshape);
  669|      0|      free(blockshape);
  670|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  671|      0|      return BLOSC2_ERROR_FAILURE;
  672|      0|  }
  673|       |
  674|      0|  zfp = zfp_stream_open(NULL);
  675|      0|  zfp_stream_set_precision(zfp, prec);
  676|       |
  677|      0|  switch (ndim) {
  678|      0|    case 1:
  ------------------
  |  Branch (678:5): [True: 0, False: 0]
  ------------------
  679|      0|      field = zfp_field_1d((void *) output, type, blockshape[0]);
  680|      0|      break;
  681|      0|    case 2:
  ------------------
  |  Branch (681:5): [True: 0, False: 0]
  ------------------
  682|      0|      field = zfp_field_2d((void *) output, type, blockshape[1], blockshape[0]);
  683|      0|      break;
  684|      0|    case 3:
  ------------------
  |  Branch (684:5): [True: 0, False: 0]
  ------------------
  685|      0|      field = zfp_field_3d((void *) output, type, blockshape[2], blockshape[1], blockshape[0]);
  686|      0|      break;
  687|      0|    case 4:
  ------------------
  |  Branch (687:5): [True: 0, False: 0]
  ------------------
  688|      0|      field = zfp_field_4d((void *) output, type, blockshape[3], blockshape[2], blockshape[1], blockshape[0]);
  689|      0|      break;
  690|      0|    default:
  ------------------
  |  Branch (690:5): [True: 0, False: 0]
  ------------------
  691|      0|      free(shape);
  692|      0|      free(chunkshape);
  693|      0|      free(blockshape);
  694|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  695|      0|      return BLOSC2_ERROR_FAILURE;
  696|      0|  }
  697|       |
  698|      0|  size_t blocks = zfp_field_blocks(field);
  699|      0|  size_t min_bytes = (blocks + CHAR_BIT - 1) / CHAR_BIT;
  700|      0|  if (min_bytes < sizeof(uint64_t)) {
  ------------------
  |  Branch (700:7): [True: 0, False: 0]
  ------------------
  701|      0|    min_bytes = sizeof(uint64_t);
  702|      0|  }
  703|      0|  if (input_len < (int32_t) min_bytes) {
  ------------------
  |  Branch (703:7): [True: 0, False: 0]
  ------------------
  704|      0|    BLOSC_TRACE_ERROR("ZFP prec: input too small (%d bytes) for the required "
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  705|      0|                      "bitstream size (%zu bytes)", input_len, min_bytes);
  706|      0|    zfp_field_free(field);
  707|      0|    zfp_stream_close(zfp);
  708|      0|    free(shape);
  709|      0|    free(chunkshape);
  710|      0|    free(blockshape);
  711|      0|    return BLOSC2_ERROR_FAILURE;
  712|      0|  }
  713|       |
  714|      0|  if (zfp_open_padded_stream(input, input_len, zfp, field, &stream, &padded_input) != BLOSC2_ERROR_SUCCESS) {
  ------------------
  |  Branch (714:7): [True: 0, False: 0]
  ------------------
  715|      0|    zfp_field_free(field);
  716|      0|    zfp_stream_close(zfp);
  717|      0|    free(shape);
  718|      0|    free(chunkshape);
  719|      0|    free(blockshape);
  720|      0|    return BLOSC2_ERROR_FAILURE;
  721|      0|  }
  722|       |
  723|      0|  zfpsize = zfp_decompress(zfp, field);
  724|       |
  725|       |  /* clean up */
  726|      0|  zfp_field_free(field);
  727|      0|  zfp_stream_close(zfp);
  728|      0|  zfp_close_padded_stream(stream, padded_input);
  729|      0|  free(shape);
  730|      0|  free(chunkshape);
  731|      0|  free(blockshape);
  732|       |
  733|      0|  if (zfpsize == 0) {
  ------------------
  |  Branch (733:7): [True: 0, False: 0]
  ------------------
  734|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  735|      0|    return (int) zfpsize;
  736|      0|  }
  737|       |
  738|      0|  return (int) output_len;
  739|      0|}
zfp_rate_decompress:
  903|      2|                        int32_t output_len, uint8_t meta, blosc2_dparams *dparams, const void *chunk) {
  904|      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]
  |  |  ------------------
  ------------------
  905|      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]
  |  |  ------------------
  ------------------
  906|      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]
  |  |  ------------------
  ------------------
  907|      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]
  |  |  ------------------
  ------------------
  908|      0|  BLOSC_UNUSED_PARAM(chunk);
  ------------------
  |  |   28|      0|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  909|       |
  910|      0|  blosc2_schunk *sc = dparams->schunk;
  911|      0|  int32_t typesize = sc->typesize;
  912|       |
  913|      0|  double ratio = (double) meta / 100.0;
  914|      0|  int8_t ndim;
  915|      0|  int64_t *shape = malloc(B2ND_MAX_DIM * sizeof(int64_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  916|      0|  int32_t *chunkshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  917|      0|  int32_t *blockshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      0|#define B2ND_MAX_DIM 16
  ------------------
  918|      0|  uint8_t *smeta;
  919|      0|  int32_t smeta_len;
  920|      0|  if (blosc2_meta_get(sc, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (920:7): [True: 0, False: 0]
  ------------------
  921|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  922|      0|    free(shape);
  923|      0|    free(chunkshape);
  924|      0|    free(blockshape);
  925|      0|    return BLOSC2_ERROR_FAILURE;
  926|      0|  }
  927|      0|  int deserialize_rc = b2nd_deserialize_meta(smeta, smeta_len, &ndim, shape, chunkshape, blockshape, NULL, NULL);
  928|      0|  free(smeta);
  929|       |
  930|      0|  if (zfp_check_output_size(deserialize_rc, ndim, blockshape, typesize, output_len) < 0) {
  ------------------
  |  Branch (930:7): [True: 0, False: 0]
  ------------------
  931|      0|    free(shape);
  932|      0|    free(chunkshape);
  933|      0|    free(blockshape);
  934|      0|    return BLOSC2_ERROR_FAILURE;
  935|      0|  }
  936|       |
  937|      0|  zfp_type type;     /* array scalar type */
  938|      0|  zfp_field *field;  /* array meta data */
  939|      0|  zfp_stream *zfp;   /* compressed stream */
  940|      0|  bitstream *stream = NULL; /* bit stream to write to or read from */
  941|      0|  uint8_t *padded_input = NULL;
  942|      0|  size_t zfpsize;    /* byte size of compressed stream */
  943|       |
  944|      0|  switch (typesize) {
  945|      0|    case sizeof(float):
  ------------------
  |  Branch (945:5): [True: 0, False: 0]
  ------------------
  946|      0|      type = zfp_type_float;
  947|      0|      break;
  948|      0|    case sizeof(double):
  ------------------
  |  Branch (948:5): [True: 0, False: 0]
  ------------------
  949|      0|      type = zfp_type_double;
  950|      0|      break;
  951|      0|    default:
  ------------------
  |  Branch (951:5): [True: 0, False: 0]
  ------------------
  952|      0|      free(shape);
  953|      0|      free(chunkshape);
  954|      0|      free(blockshape);
  955|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  956|      0|      return BLOSC2_ERROR_FAILURE;
  957|      0|  }
  958|      0|  double rate =
  959|      0|      ratio * (double) typesize * 8;     // convert from output size / input size to output bits per input value
  960|      0|  zfp = zfp_stream_open(NULL);
  961|      0|  zfp_stream_set_rate(zfp, rate, type, ndim, zfp_false);
  962|       |
  963|      0|  switch (ndim) {
  964|      0|    case 1:
  ------------------
  |  Branch (964:5): [True: 0, False: 0]
  ------------------
  965|      0|      field = zfp_field_1d((void *) output, type, blockshape[0]);
  966|      0|      break;
  967|      0|    case 2:
  ------------------
  |  Branch (967:5): [True: 0, False: 0]
  ------------------
  968|      0|      field = zfp_field_2d((void *) output, type, blockshape[1], blockshape[0]);
  969|      0|      break;
  970|      0|    case 3:
  ------------------
  |  Branch (970:5): [True: 0, False: 0]
  ------------------
  971|      0|      field = zfp_field_3d((void *) output, type, blockshape[2], blockshape[1], blockshape[0]);
  972|      0|      break;
  973|      0|    case 4:
  ------------------
  |  Branch (973:5): [True: 0, False: 0]
  ------------------
  974|      0|      field = zfp_field_4d((void *) output, type, blockshape[3], blockshape[2], blockshape[1], blockshape[0]);
  975|      0|      break;
  976|      0|    default:
  ------------------
  |  Branch (976:5): [True: 0, False: 0]
  ------------------
  977|      0|      free(shape);
  978|      0|      free(chunkshape);
  979|      0|      free(blockshape);
  980|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  981|      0|      return BLOSC2_ERROR_FAILURE;
  982|      0|  }
  983|       |
  984|      0|  size_t blocks = zfp_field_blocks(field);
  985|      0|  uint n = 1u << (2 * ndim);
  986|      0|  uint bits = (uint) floor(n * rate + 0.5);
  987|      0|  switch (type) {
  988|      0|    case zfp_type_float:
  ------------------
  |  Branch (988:5): [True: 0, False: 0]
  ------------------
  989|      0|      if (bits < 1 + 8u) {
  ------------------
  |  Branch (989:11): [True: 0, False: 0]
  ------------------
  990|      0|        bits = 1 + 8u;
  991|      0|      }
  992|      0|      break;
  993|      0|    case zfp_type_double:
  ------------------
  |  Branch (993:5): [True: 0, False: 0]
  ------------------
  994|      0|      if (bits < 1 + 11u) {
  ------------------
  |  Branch (994:11): [True: 0, False: 0]
  ------------------
  995|      0|        bits = 1 + 11u;
  996|      0|      }
  997|      0|      break;
  998|      0|    default:
  ------------------
  |  Branch (998:5): [True: 0, False: 0]
  ------------------
  999|      0|      break;
 1000|      0|  }
 1001|      0|  if (bits > 0 && blocks > SIZE_MAX / bits) {
  ------------------
  |  Branch (1001:7): [True: 0, False: 0]
  |  Branch (1001:19): [True: 0, False: 0]
  ------------------
 1002|      0|    BLOSC_TRACE_ERROR("ZFP rate: required bits overflow size_t");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1003|      0|    zfp_field_free(field);
 1004|      0|    zfp_stream_close(zfp);
 1005|      0|    free(shape);
 1006|      0|    free(chunkshape);
 1007|      0|    free(blockshape);
 1008|      0|    return BLOSC2_ERROR_FAILURE;
 1009|      0|  }
 1010|      0|  size_t required_bits = blocks * (size_t) bits;
 1011|      0|  size_t required_bytes = (required_bits + CHAR_BIT - 1) / CHAR_BIT;
 1012|      0|  if (required_bytes < sizeof(uint64_t)) {
  ------------------
  |  Branch (1012:7): [True: 0, False: 0]
  ------------------
 1013|      0|    required_bytes = sizeof(uint64_t);
 1014|      0|  }
 1015|      0|  if (input_len < (int32_t) required_bytes) {
  ------------------
  |  Branch (1015:7): [True: 0, False: 0]
  ------------------
 1016|      0|    BLOSC_TRACE_ERROR("ZFP rate: input too small (%d bytes) for the required "
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1017|      0|                      "bitstream size (%zu bytes)", input_len, required_bytes);
 1018|      0|    zfp_field_free(field);
 1019|      0|    zfp_stream_close(zfp);
 1020|      0|    free(shape);
 1021|      0|    free(chunkshape);
 1022|      0|    free(blockshape);
 1023|      0|    return BLOSC2_ERROR_FAILURE;
 1024|      0|  }
 1025|       |
 1026|      0|  if (zfp_open_padded_stream(input, input_len, zfp, field, &stream, &padded_input) != BLOSC2_ERROR_SUCCESS) {
  ------------------
  |  Branch (1026:7): [True: 0, False: 0]
  ------------------
 1027|      0|    zfp_field_free(field);
 1028|      0|    zfp_stream_close(zfp);
 1029|      0|    free(shape);
 1030|      0|    free(chunkshape);
 1031|      0|    free(blockshape);
 1032|      0|    return BLOSC2_ERROR_FAILURE;
 1033|      0|  }
 1034|       |
 1035|      0|  zfpsize = zfp_decompress(zfp, field);
 1036|       |
 1037|       |  /* clean up */
 1038|      0|  zfp_field_free(field);
 1039|      0|  zfp_stream_close(zfp);
 1040|      0|  zfp_close_padded_stream(stream, padded_input);
 1041|      0|  free(shape);
 1042|      0|  free(chunkshape);
 1043|      0|  free(blockshape);
 1044|       |
 1045|      0|  if (zfpsize == 0) {
  ------------------
  |  Branch (1045:7): [True: 0, False: 0]
  ------------------
 1046|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1047|      0|    return (int) zfpsize;
 1048|      0|  }
 1049|       |
 1050|      0|  return (int) output_len;
 1051|      0|}

simd_load:
   34|  3.49k|bytes16 simd_load(const void* ptr) { return _mm_loadu_si128((const __m128i*)ptr); }
simd_store:
   35|  3.49k|void simd_store(void* ptr, bytes16 x) { _mm_storeu_si128((__m128i*)ptr, x); }
simd_add:
   38|  3.49k|bytes16 simd_add(bytes16 a, bytes16 b) { return _mm_add_epi8(a, b); }
simd_duplane15:
   40|  3.49k|bytes16 simd_duplane15(bytes16 x) { return _mm_shuffle_epi8(x, _mm_set1_epi8(15)); }
simd_prefix_sum:
   43|  3.49k|{
   44|       |  // Sklansky-style sum from https://gist.github.com/rygorous/4212be0cd009584e4184e641ca210528
   45|  3.49k|  x = _mm_add_epi8(x, _mm_slli_epi64(x, 8));
   46|  3.49k|  x = _mm_add_epi8(x, _mm_slli_epi64(x, 16));
   47|  3.49k|  x = _mm_add_epi8(x, _mm_slli_epi64(x, 32));
   48|  3.49k|  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|  3.49k|  return x;
   50|  3.49k|}
simd_get_last:
   52|  1.41k|uint8_t simd_get_last(bytes16 x) { return (_mm_extract_epi16(x, 7) >> 8) & 0xFF; }
bytedelta_backward:
  332|  2.81k|                       blosc2_dparams *dparams, uint8_t id) {
  333|  2.81k|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|  2.81k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  334|       |
  335|  2.81k|  int typesize = meta;
  336|  2.81k|  if (typesize == 0) {
  ------------------
  |  Branch (336:7): [True: 19, False: 2.79k]
  ------------------
  337|     19|    if (dparams->schunk == NULL) {
  ------------------
  |  Branch (337:9): [True: 19, False: 0]
  ------------------
  338|     19|      BLOSC_TRACE_ERROR("When meta is 0, you need to be on a schunk!");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  339|     19|      BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  111|     19|    do {                                            \
  |  |  112|     19|        int rc_ = (rc);                             \
  |  |  113|     19|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 19, False: 0]
  |  |  ------------------
  |  |  114|     19|            char *error_msg = print_error(rc_);     \
  |  |  115|     19|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|     19|            return rc_;                             \
  |  |  117|     19|        }                                           \
  |  |  118|     19|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  340|     19|    }
  341|      0|    blosc2_schunk* schunk = (blosc2_schunk*)(dparams->schunk);
  342|      0|    typesize = schunk->typesize;
  343|      0|  }
  344|       |
  345|  2.79k|  const int stream_len = length / typesize;
  346|   156k|  for (int ich = 0; ich < typesize; ++ich) {
  ------------------
  |  Branch (346:21): [True: 153k, False: 2.79k]
  ------------------
  347|   153k|    int ip = 0;
  348|   153k|    uint8_t _v2 = 0;
  349|       |    // SIMD fetch 16 bytes from each channel, prefix-sum un-delta
  350|   153k|#if defined(CPU_HAS_SIMD)
  351|   153k|    bytes16 v2 = {0};
  352|   155k|    for (; ip < stream_len - 15; ip += 16) {
  ------------------
  |  Branch (352:12): [True: 1.90k, False: 153k]
  ------------------
  353|  1.90k|      bytes16 v = simd_load(input);
  354|  1.90k|      input += 16;
  355|       |      // un-delta via prefix sum
  356|  1.90k|      v2 = simd_add(simd_prefix_sum(v), simd_duplane15(v2));
  357|  1.90k|      simd_store(output, v2);
  358|  1.90k|      output += 16;
  359|  1.90k|    }
  360|   153k|    if (stream_len > 15) {
  ------------------
  |  Branch (360:9): [True: 1.41k, False: 151k]
  ------------------
  361|  1.41k|      _v2 = simd_get_last(v2);
  362|  1.41k|    }
  363|   153k|#endif // #if defined(CPU_HAS_SIMD)
  364|       |    // scalar leftover
  365|   176k|    for (; ip < stream_len; ip++) {
  ------------------
  |  Branch (365:12): [True: 23.2k, False: 153k]
  ------------------
  366|  23.2k|      uint8_t v = *input + _v2;
  367|  23.2k|      input++;
  368|  23.2k|      *output = v;
  369|  23.2k|      output++;
  370|  23.2k|      _v2 = v;
  371|  23.2k|    }
  372|   153k|  }
  373|       |
  374|       |  // Mirror of the forward pass: restore the trailing bytes verbatim.
  375|  2.79k|  memcpy(output, input, (size_t)(length - stream_len * typesize));
  376|       |
  377|  2.79k|  return BLOSC2_ERROR_SUCCESS;
  378|  2.81k|}
bytedelta_backward_buggy:
  428|  1.22k|                             uint8_t meta, blosc2_dparams *dparams, uint8_t id) {
  429|  1.22k|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|  1.22k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  430|       |
  431|  1.22k|  int typesize = meta;
  432|  1.22k|  if (typesize == 0) {
  ------------------
  |  Branch (432:7): [True: 3, False: 1.22k]
  ------------------
  433|      3|    if (dparams->schunk == NULL) {
  ------------------
  |  Branch (433:9): [True: 3, False: 0]
  ------------------
  434|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  435|      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]
  |  |  ------------------
  ------------------
  436|      3|    }
  437|      0|    blosc2_schunk* schunk = (blosc2_schunk*)(dparams->schunk);
  438|      0|    typesize = schunk->typesize;
  439|      0|  }
  440|       |
  441|  1.22k|  const int stream_len = length / typesize;
  442|   134k|  for (int ich = 0; ich < typesize; ++ich) {
  ------------------
  |  Branch (442:21): [True: 133k, False: 1.22k]
  ------------------
  443|   133k|    int ip = 0;
  444|       |    // SIMD fetch 16 bytes from each channel, prefix-sum un-delta
  445|   133k|#if defined(CPU_HAS_SIMD)
  446|   133k|    bytes16 v2 = {0};
  447|   134k|    for (; ip < stream_len - 15; ip += 16) {
  ------------------
  |  Branch (447:12): [True: 1.58k, False: 133k]
  ------------------
  448|  1.58k|      bytes16 v = simd_load(input);
  449|  1.58k|      input += 16;
  450|       |      // un-delta via prefix sum
  451|  1.58k|      v2 = simd_add(simd_prefix_sum(v), simd_duplane15(v2));
  452|  1.58k|      simd_store(output, v2);
  453|  1.58k|      output += 16;
  454|  1.58k|    }
  455|   133k|#endif // #if defined(CPU_HAS_SIMD)
  456|       |    // scalar leftover
  457|   133k|    uint8_t _v2 = 0;
  458|   154k|    for (; ip < stream_len; ip++) {
  ------------------
  |  Branch (458:12): [True: 20.8k, False: 133k]
  ------------------
  459|  20.8k|      uint8_t v = *input + _v2;
  460|  20.8k|      input++;
  461|  20.8k|      *output = v;
  462|  20.8k|      output++;
  463|  20.8k|      _v2 = v;
  464|  20.8k|    }
  465|   133k|  }
  466|       |
  467|  1.22k|  return BLOSC2_ERROR_SUCCESS;
  468|  1.22k|}

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

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

ndcell_backward:
  205|      6|                   uint8_t id) {
  206|      6|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|      6|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  207|      6|  blosc2_schunk *schunk = dparams->schunk;
  208|      6|  int8_t ndim;
  209|      6|  int64_t *shape = malloc(B2ND_MAX_DIM * sizeof(int64_t));
  ------------------
  |  |   50|      6|#define B2ND_MAX_DIM 16
  ------------------
  210|      6|  int32_t *chunkshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      6|#define B2ND_MAX_DIM 16
  ------------------
  211|      6|  int32_t *blockshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|      6|#define B2ND_MAX_DIM 16
  ------------------
  212|      6|  uint8_t *smeta;
  213|      6|  int32_t smeta_len;
  214|      6|  if (blosc2_meta_get(schunk, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (214:7): [True: 6, False: 0]
  ------------------
  215|      6|    free(shape);
  216|      6|    free(chunkshape);
  217|      6|    free(blockshape);
  218|      6|    BLOSC_TRACE_ERROR("b2nd layer not found!");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  219|      6|    return BLOSC2_ERROR_FAILURE;
  220|      6|  }
  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|     14|                   uint8_t id) {
  244|     14|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|     14|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  245|     14|  blosc2_schunk *schunk = dparams->schunk;
  246|     14|  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|     14|  int64_t *shape = malloc(B2ND_MAX_DIM * sizeof(int64_t));
  ------------------
  |  |   50|     14|#define B2ND_MAX_DIM 16
  ------------------
  252|     14|  int32_t *chunkshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|     14|#define B2ND_MAX_DIM 16
  ------------------
  253|     14|  int32_t *blockshape = malloc(B2ND_MAX_DIM * sizeof(int32_t));
  ------------------
  |  |   50|     14|#define B2ND_MAX_DIM 16
  ------------------
  254|     14|  uint8_t *smeta;
  255|     14|  int32_t smeta_len;
  256|     14|  if (blosc2_meta_get(schunk, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (256:7): [True: 14, False: 0]
  ------------------
  257|     14|    free(shape);
  258|     14|    free(chunkshape);
  259|     14|    free(blockshape);
  260|     14|    BLOSC_TRACE_ERROR("b2nd layer not found!");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  261|     14|    return BLOSC2_ERROR_FAILURE;
  262|     14|  }
  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|  16.3k|void register_tuners(void) {
   14|       |
   15|  16.3k|  blosc2_tuner btune;
   16|  16.3k|  btune.id = BLOSC_BTUNE;
   17|  16.3k|  btune.name = "btune";
   18|  16.3k|  btune.init = NULL;
   19|  16.3k|  btune.next_cparams = NULL;
   20|  16.3k|  btune.next_blocksize = NULL;
   21|  16.3k|  btune.update = NULL;
   22|  16.3k|  btune.free = NULL;
   23|       |
   24|  16.3k|  register_tuner_private(&btune);
   25|  16.3k|}

LLVMFuzzerTestOneInput:
   10|  16.3k|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   11|  16.3k|  size_t nbytes = 0, cbytes = 0, blocksize = 0;
   12|  16.3k|  void *output = NULL;
   13|       |
   14|  16.3k|  if (size < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (14:7): [True: 6, False: 16.3k]
  ------------------
   15|      6|    return 0;
   16|      6|  }
   17|       |
   18|  16.3k|  blosc2_init();
   19|  16.3k|  blosc2_set_nthreads(1);
   20|  16.3k|  blosc1_cbuffer_sizes(data, &nbytes, &cbytes, &blocksize);
   21|       |
   22|  16.3k|  if (cbytes != size || nbytes == 0) {
  ------------------
  |  Branch (22:7): [True: 169, False: 16.2k]
  |  Branch (22:25): [True: 1, False: 16.1k]
  ------------------
   23|    170|    blosc2_destroy();
   24|    170|    return 0;
   25|    170|  }
   26|  16.1k|  if (blosc1_cbuffer_validate(data, size, &nbytes) != 0) {
  ------------------
  |  Branch (26:7): [True: 43, False: 16.1k]
  ------------------
   27|       |    /* Unexpected `nbytes` specified in blosc header */
   28|     43|    blosc2_destroy();
   29|     43|    return 0;
   30|     43|  }
   31|       |
   32|  16.1k|  output = malloc(cbytes);
   33|  16.1k|  if (output != NULL) {
  ------------------
  |  Branch (33:7): [True: 16.1k, False: 0]
  ------------------
   34|  16.1k|    blosc2_decompress(data, (int32_t)size, output, (int32_t)cbytes);
   35|  16.1k|    free(output);
   36|  16.1k|  }
   37|       |
   38|  16.1k|  blosc2_destroy();
   39|  16.1k|  return 0;
   40|  16.1k|}

