LZ4_decompress_safe:
 2570|    735|{
 2571|    735|    return LZ4_decompress_generic(source, dest, compressedSize, maxDecompressedSize,
 2572|    735|                                  decode_full_block, noDict,
 2573|       |                                  (BYTE*)dest, NULL, 0);
 2574|    735|}
LZ4_decompress_safe_forceExtDict:
 2644|    646|{
 2645|    646|    DEBUGLOG(5, "LZ4_decompress_safe_forceExtDict");
  ------------------
  |  |  289|    646|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2646|    646|    return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize,
 2647|    646|                                  decode_full_block, usingExtDict,
 2648|    646|                                  (BYTE*)dest, (const BYTE*)dictStart, dictSize);
 2649|    646|}
LZ4_decompress_safe_usingDict:
 2843|    646|{
 2844|    646|    if (dictSize < 0) return -1;
  ------------------
  |  Branch (2844:9): [True: 0, False: 646]
  ------------------
 2845|    646|    if (dictSize==0)
  ------------------
  |  Branch (2845:9): [True: 0, False: 646]
  ------------------
 2846|      0|        return LZ4_decompress_safe(source, dest, compressedSize, maxOutputSize);
 2847|    646|    if (dictStart+dictSize == dest) {
  ------------------
  |  Branch (2847:9): [True: 0, False: 646]
  ------------------
 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|    646|    assert(dictSize >= 0);
  ------------------
  |  |  273|    646|#    define assert(condition) ((void)0)
  ------------------
 2855|    646|    return LZ4_decompress_safe_forceExtDict(source, dest, compressedSize, maxOutputSize, dictStart, (size_t)dictSize);
 2856|    646|}
lz4.c:LZ4_isLittleEndian:
  364|   206k|{
  365|   206k|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental */
  366|   206k|    return one.c[0];
  367|   206k|}
lz4.c:LZ4_wildCopy8:
  466|  11.5k|{
  467|  11.5k|    BYTE* d = (BYTE*)dstPtr;
  468|  11.5k|    const BYTE* s = (const BYTE*)srcPtr;
  469|  11.5k|    BYTE* const e = (BYTE*)dstEnd;
  470|       |
  471|  71.5k|    do { LZ4_memcpy(d,s,8); d+=8; s+=8; } while (d<e);
  ------------------
  |  |  349|  71.5k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (471:50): [True: 59.9k, False: 11.5k]
  ------------------
  472|  11.5k|}
lz4.c:LZ4_read16:
  393|   206k|static U16 LZ4_read16(const void* ptr) { return ((const LZ4_unalign16*)ptr)->u16; }
lz4.c:LZ4_write32:
  398|  82.6k|static void LZ4_write32(void* memPtr, U32 value) { ((LZ4_unalign32*)memPtr)->u32 = value; }
lz4.c:LZ4_decompress_generic:
 2225|  1.38k|{
 2226|  1.38k|    if ((src == NULL) || (outputSize < 0)) { return -1; }
  ------------------
  |  Branch (2226:9): [True: 0, False: 1.38k]
  |  Branch (2226:26): [True: 0, False: 1.38k]
  ------------------
 2227|       |
 2228|  1.38k|    {   const BYTE* ip = (const BYTE*) src;
 2229|  1.38k|        const BYTE* const iend = ip + srcSize;
 2230|       |
 2231|  1.38k|        BYTE* op = (BYTE*) dst;
 2232|  1.38k|        BYTE* const oend = op + outputSize;
 2233|       |
 2234|  1.38k|        const BYTE* const dictEnd = (dictStart == NULL) ? NULL : dictStart + dictSize;
  ------------------
  |  Branch (2234:37): [True: 735, False: 646]
  ------------------
 2235|       |
 2236|       |        /* withPrefix64k : offset <= 65535 can't reach beyond the 64 KB prefix */
 2237|  1.38k|        const int checkOffset = (dict != withPrefix64k) && (dictSize < (int)(64 KB));
  ------------------
  |  |  251|  1.38k|#define KB *(1 <<10)
  ------------------
  |  Branch (2237:33): [True: 1.38k, False: 0]
  |  Branch (2237:60): [True: 1.38k, False: 0]
  ------------------
 2238|       |
 2239|       |
 2240|       |        /* Set up the "end" pointers for the shortcut. */
 2241|  1.38k|        const BYTE* const shortiend = iend - 14 /*maxLL*/ - 2 /*offset*/;
 2242|  1.38k|        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.38k|        const BYTE* match;
 2246|  1.38k|        size_t offset;
 2247|  1.38k|        size_t ml;   /* match length */
 2248|       |
 2249|       |
 2250|  1.38k|        DEBUGLOG(5, "LZ4_decompress_generic (srcSize:%i, dstSize:%i)", srcSize, outputSize);
  ------------------
  |  |  289|  1.38k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2251|       |
 2252|       |        /* Special cases */
 2253|  1.38k|        assert(lowPrefix <= op);
  ------------------
  |  |  273|  1.38k|#    define assert(condition) ((void)0)
  ------------------
 2254|  1.38k|        if (unlikely(outputSize==0)) {
  ------------------
  |  |  180|  1.38k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.38k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 1.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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.38k|        if (unlikely(srcSize<=0)) { return -1; }
  ------------------
  |  |  180|  1.38k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.38k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 1.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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.38k|#if LZ4_FAST_DEC_LOOP
 2267|  1.38k|        if ((oend - op) < FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|  1.38k|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2267:13): [True: 316, False: 1.06k]
  ------------------
 2268|    316|            DEBUGLOG(6, "move to safe decode loop");
  ------------------
  |  |  289|    316|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2269|    316|            goto safe_decode;
 2270|    316|        }
 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|  1.06k|        if ( (dict==usingExtDict)
  ------------------
  |  Branch (2276:14): [True: 509, False: 556]
  ------------------
 2277|    509|          && ((uptrval)dictEnd - (uptrval)lowPrefix - LZ4_DISTANCE_ABSOLUTE_MAX < FASTLOOP_SAFE_DISTANCE) ) {
  ------------------
  |  |  255|    509|#define LZ4_DISTANCE_ABSOLUTE_MAX 65535
  ------------------
                        && ((uptrval)dictEnd - (uptrval)lowPrefix - LZ4_DISTANCE_ABSOLUTE_MAX < FASTLOOP_SAFE_DISTANCE) ) {
  ------------------
  |  |  248|    509|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2277:14): [True: 0, False: 509]
  ------------------
 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|  1.06k|        DEBUGLOG(6, "using fast decode loop");
  ------------------
  |  |  289|  1.06k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2287|   204k|        while (1) {
  ------------------
  |  Branch (2287:16): [True: 204k, Folded]
  ------------------
 2288|   204k|            unsigned token;
 2289|   204k|            size_t ll;   /* literal length */
 2290|   204k|            BYTE* cpy;
 2291|       |            /* Main fastloop assertion: We can always wildcopy FASTLOOP_SAFE_DISTANCE */
 2292|   204k|            assert(oend - op >= FASTLOOP_SAFE_DISTANCE);
  ------------------
  |  |  273|   204k|#    define assert(condition) ((void)0)
  ------------------
 2293|   204k|            assert(ip < iend);
  ------------------
  |  |  273|   204k|#    define assert(condition) ((void)0)
  ------------------
 2294|   204k|            token = *ip++;
 2295|   204k|            ll = token >> ML_BITS;
  ------------------
  |  |  260|   204k|#define ML_BITS  4
  ------------------
 2296|   204k|            DEBUGLOG(7, "blockPos%6u: litLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)ll);
  ------------------
  |  |  289|   204k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2297|       |
 2298|       |            /* too close to input end : the safe loop restarts this sequence */
 2299|   204k|            if (ip > iend-(16 + 1/*max lit + offset + nextToken*/)) { ip--; break; }
  ------------------
  |  Branch (2299:17): [True: 21, False: 204k]
  ------------------
 2300|       |
 2301|       |            /* decode literal length */
 2302|   204k|            if (ll == RUN_MASK) {
  ------------------
  |  |  263|   204k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|   204k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|   204k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2302:17): [True: 18.1k, False: 186k]
  ------------------
 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|  18.1k|                const BYTE* const tokenPos = ip-1;
 2306|  18.1k|                size_t const addl = read_variable_length(&ip, iend - RUN_MASK);
  ------------------
  |  |  263|  18.1k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|  18.1k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|  18.1k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2307|  18.1k|                if (addl == rvl_error) {
  ------------------
  |  Branch (2307:21): [True: 7, False: 18.1k]
  ------------------
 2308|      7|                    DEBUGLOG(6, "error reading long literal length");
  ------------------
  |  |  289|      7|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2309|      7|                    goto _output_error;
 2310|      7|                }
 2311|  18.1k|                ll += addl;
 2312|  18.1k|                if (unlikely((uptrval)(op)+ll<(uptrval)(op))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  18.1k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  18.1k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 18.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2313|  18.1k|                if (unlikely((uptrval)(ip)+ll<(uptrval)(ip))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  18.1k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  18.1k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 18.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|  18.1k|                cpy = op+ll;
 2318|  18.1k|                LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH);
  ------------------
  |  |  277|  18.1k|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
 2319|  18.1k|              #if LZ4_WILDCOPY64
 2320|  18.1k|                if ((cpy>oend-64) || (ip+ll>iend-64)) { ip = tokenPos; break; }
  ------------------
  |  Branch (2320:21): [True: 258, False: 17.9k]
  |  Branch (2320:38): [True: 103, False: 17.8k]
  ------------------
 2321|  17.8k|                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|  17.8k|                ip += ll; op = cpy;
 2327|   186k|            } else {
 2328|   186k|                DEBUGLOG(7, "copy %u bytes in a 16-bytes stripe", (unsigned)ll);
  ------------------
  |  |  289|   186k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2329|       |                /* Literals can only be <= 14, but hope compilers optimize better when copy by a register size */
 2330|   186k|                LZ4_memcpy(op, ip, 16);
  ------------------
  |  |  349|   186k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2331|   186k|                ip += ll; op += ll;
 2332|   186k|            }
 2333|       |
 2334|       |            /* get offset */
 2335|   203k|            offset = LZ4_readLE16(ip); ip+=2;
 2336|   203k|            DEBUGLOG(6, "blockPos%6u: offset = %u", (unsigned)(op-(BYTE*)dst), (unsigned)offset);
  ------------------
  |  |  289|   203k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2337|   203k|            match = op - offset;
 2338|   203k|            assert(match <= op);  /* overflow check */
  ------------------
  |  |  273|   203k|#    define assert(condition) ((void)0)
  ------------------
 2339|       |
 2340|       |            /* get matchlength */
 2341|   203k|            ml = token & ML_MASK;
  ------------------
  |  |  261|   203k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|   203k|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2342|   203k|            DEBUGLOG(7, "  match length token = %u (len==%u)", (unsigned)ml, (unsigned)ml+MINMATCH);
  ------------------
  |  |  289|   203k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2343|       |
 2344|   203k|            if (ml == ML_MASK) {
  ------------------
  |  |  261|   203k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|   203k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2344:17): [True: 21.9k, False: 182k]
  ------------------
 2345|       |                /* after match length extension bytes, at least 1 token + LASTLITERALS literals must remain */
 2346|  21.9k|                size_t const addl = read_variable_length(&ip, iend - (1 + LASTLITERALS));
  ------------------
  |  |  245|  21.9k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2347|  21.9k|                if (addl == rvl_error) {
  ------------------
  |  Branch (2347:21): [True: 14, False: 21.8k]
  ------------------
 2348|     14|                    DEBUGLOG(5, "error reading long match length");
  ------------------
  |  |  289|     14|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2349|     14|                    goto _output_error;
 2350|     14|                }
 2351|  21.8k|                ml += addl;
 2352|  21.8k|                DEBUGLOG(7, "  long match length == %u", (unsigned)ml + MINMATCH);
  ------------------
  |  |  289|  21.8k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2353|  21.8k|                if (unlikely((uptrval)(op)+ml<(uptrval)op)) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  21.8k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  21.8k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 21.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2354|  21.8k|            }
 2355|   203k|            ml += MINMATCH;
  ------------------
  |  |  242|   203k|#define MINMATCH 4
  ------------------
 2356|       |
 2357|   203k|            if (op + ml >= oend - FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|   203k|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2357:17): [True: 560, False: 203k]
  ------------------
 2358|    560|                DEBUGLOG(7, "moving to safe_match_copy (ml==%u)", (unsigned)ml);
  ------------------
  |  |  289|    560|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2359|    560|                goto safe_match_copy;
 2360|    560|            }
 2361|       |
 2362|       |            /* match length from token only (<= 18), no overlap, within prefix : copy 18 bytes */
 2363|   203k|            if ( ((token & ML_MASK) != ML_MASK) && (offset >= 8)
  ------------------
  |  |  261|   203k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|   203k|#define ML_BITS  4
  |  |  ------------------
  ------------------
                          if ( ((token & ML_MASK) != ML_MASK) && (offset >= 8)
  ------------------
  |  |  261|   203k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|   203k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2363:18): [True: 181k, False: 21.7k]
  |  Branch (2363:52): [True: 95.8k, False: 85.7k]
  ------------------
 2364|  95.8k|              && ((dict == withPrefix64k) || (match >= lowPrefix)) ) {
  ------------------
  |  Branch (2364:19): [True: 0, False: 95.8k]
  |  Branch (2364:46): [True: 95.1k, False: 672]
  ------------------
 2365|  95.1k|                assert(match >= lowPrefix);
  ------------------
  |  |  273|  95.1k|#    define assert(condition) ((void)0)
  ------------------
 2366|  95.1k|                assert(match <= op);
  ------------------
  |  |  273|  95.1k|#    define assert(condition) ((void)0)
  ------------------
 2367|  95.1k|                assert(op + 18 <= oend);
  ------------------
  |  |  273|  95.1k|#    define assert(condition) ((void)0)
  ------------------
 2368|  95.1k|                LZ4_memcpy(op, match, 8);
  ------------------
  |  |  349|  95.1k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2369|  95.1k|                LZ4_memcpy(op+8, match+8, 8);
  ------------------
  |  |  349|  95.1k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2370|  95.1k|                LZ4_memcpy(op+16, match+16, 2);
  ------------------
  |  |  349|  95.1k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2371|  95.1k|                op += ml;
 2372|  95.1k|                continue;
 2373|  95.1k|            }
 2374|       |
 2375|       |            /* match ends far from oend : no end-of-block condition to check */
 2376|   108k|            assert(op + ml < oend - FASTLOOP_SAFE_DISTANCE);
  ------------------
  |  |  273|   108k|#    define assert(condition) ((void)0)
  ------------------
 2377|       |
 2378|   108k|            if ( checkOffset && (unlikely(match + dictSize < lowPrefix)) ) {
  ------------------
  |  |  180|   108k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|   108k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  ------------------
  ------------------
  |  Branch (2378:18): [True: 108k, False: 0]
  |  Branch (2378:33): [True: 102, False: 108k]
  ------------------
 2379|    102|                DEBUGLOG(5, "Error : pos=%zi, offset=%zi => outside buffers", op-lowPrefix, op-match);
  ------------------
  |  |  289|    102|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2380|    102|                goto _offset_error;
 2381|    102|            }
 2382|       |            /* match starting within external dictionary */
 2383|   108k|            if ((dict==usingExtDict) && (match < lowPrefix)) {
  ------------------
  |  Branch (2383:17): [True: 5.45k, False: 102k]
  |  Branch (2383:41): [True: 840, False: 4.61k]
  ------------------
 2384|    840|                assert(dictEnd != NULL);
  ------------------
  |  |  273|    840|#    define assert(condition) ((void)0)
  ------------------
 2385|    840|                op = LZ4_copyExtDictMatch(op, match, ml, lowPrefix, dictEnd);
 2386|    840|                continue;
 2387|    840|            }
 2388|       |
 2389|       |            /* copy match within block */
 2390|   107k|            cpy = op + ml;
 2391|       |
 2392|   107k|            assert((op <= oend) && (oend-op >= 64));
  ------------------
  |  |  273|   107k|#    define assert(condition) ((void)0)
  ------------------
 2393|   107k|            if (unlikely(offset<16)) {
  ------------------
  |  |  180|   107k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|   107k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 102k, False: 5.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2394|   102k|                LZ4_memcpy_using_offset(op, match, cpy, offset);
 2395|   102k|    #if LZ4_WILDCOPY64
 2396|   102k|            } else if (offset >= 64) {
  ------------------
  |  Branch (2396:24): [True: 3.59k, False: 1.55k]
  ------------------
 2397|  3.59k|                LZ4_wildCopy64(op, match, cpy);
 2398|  3.59k|    #endif
 2399|  3.59k|            } else {
 2400|  1.55k|                LZ4_wildCopy32(op, match, cpy);
 2401|  1.55k|            }
 2402|       |
 2403|   107k|            op = cpy;   /* wildcopy correction */
 2404|   107k|        }
 2405|    698|    safe_decode:
 2406|    698|#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|    698|        DEBUGLOG(6, "using safe decode loop");
  ------------------
  |  |  289|    698|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2413|  3.79k|        while (1) {
  ------------------
  |  Branch (2413:16): [True: 3.79k, Folded]
  ------------------
 2414|  3.79k|            unsigned token;
 2415|  3.79k|            size_t ll;   /* literal length */
 2416|  3.79k|            BYTE* cpy;
 2417|  3.79k|            assert(ip < iend);
  ------------------
  |  |  273|  3.79k|#    define assert(condition) ((void)0)
  ------------------
 2418|  3.79k|            token = *ip++;
 2419|  3.79k|            ll = token >> ML_BITS;
  ------------------
  |  |  260|  3.79k|#define ML_BITS  4
  ------------------
 2420|  3.79k|            DEBUGLOG(7, "blockPos%6u: litLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)ll);
  ------------------
  |  |  289|  3.79k|#  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|  3.79k|            if ( (ll != RUN_MASK)
  ------------------
  |  |  263|  3.79k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|  3.79k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|  3.79k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2430:18): [True: 2.98k, False: 802]
  ------------------
 2431|       |                /* strictly "less than" on input, to re-enter the loop with at least one byte */
 2432|  2.98k|              && likely((ip < shortiend) & (op <= shortoend)) ) {
  ------------------
  |  |  177|  2.98k|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|  2.98k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 1.50k, False: 1.48k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2433|       |                /* Copy the literals */
 2434|  1.50k|                LZ4_memcpy(op, ip, 16);
  ------------------
  |  |  349|  1.50k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2435|  1.50k|                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.50k|                offset = LZ4_readLE16(ip); ip += 2;
 2440|  1.50k|                match = op - offset;
 2441|  1.50k|                assert(match <= op); /* check overflow */
  ------------------
  |  |  273|  1.50k|#    define assert(condition) ((void)0)
  ------------------
 2442|  1.50k|                ml = token & ML_MASK;
  ------------------
  |  |  261|  1.50k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|  1.50k|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2443|  1.50k|                DEBUGLOG(7, "blockPos%6u: matchLength token = %u (len=%u)", (unsigned)(op-(BYTE*)dst), (unsigned)ml, (unsigned)ml + 4);
  ------------------
  |  |  289|  1.50k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2444|       |
 2445|       |                /* Do not deal with overlapping matches. */
 2446|  1.50k|                if ( (ml != ML_MASK)
  ------------------
  |  |  261|  1.50k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|  1.50k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2446:22): [True: 1.15k, False: 346]
  ------------------
 2447|  1.15k|                  && (offset >= 8)
  ------------------
  |  Branch (2447:22): [True: 572, False: 584]
  ------------------
 2448|    572|                  && (dict==withPrefix64k || match >= lowPrefix) ) {
  ------------------
  |  Branch (2448:23): [True: 0, False: 572]
  |  Branch (2448:46): [True: 408, False: 164]
  ------------------
 2449|       |                    /* Copy the match. */
 2450|    408|                    LZ4_memcpy(op + 0, match + 0, 8);
  ------------------
  |  |  349|    408|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2451|    408|                    LZ4_memcpy(op + 8, match + 8, 8);
  ------------------
  |  |  349|    408|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2452|    408|                    LZ4_memcpy(op +16, match +16, 2);
  ------------------
  |  |  349|    408|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2453|    408|                    op += ml + MINMATCH;
  ------------------
  |  |  242|    408|#define MINMATCH 4
  ------------------
 2454|       |                    /* Both stages worked, load the next token. */
 2455|    408|                    continue;
 2456|    408|                }
 2457|       |                /* The second stage didn't work out, but the info is ready for the match copy below. */
 2458|  2.28k|            } else {
 2459|       |                /* decode literal length */
 2460|  2.28k|                if (ll == RUN_MASK) {
  ------------------
  |  |  263|  2.28k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|  2.28k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|  2.28k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2460:21): [True: 802, False: 1.48k]
  ------------------
 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|    802|                    size_t const addl = read_variable_length(&ip, iend-RUN_MASK);
  ------------------
  |  |  263|    802|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|    802|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|    802|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2464|    802|                    if (addl == rvl_error) { goto _output_error; }
  ------------------
  |  Branch (2464:25): [True: 37, False: 765]
  ------------------
 2465|    765|                    ll += addl;
 2466|    765|                    if (unlikely((uptrval)(op)+ll<(uptrval)(op))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|    765|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    765|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 765]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2467|    765|                    if (unlikely((uptrval)(ip)+ll<(uptrval)(ip))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|    765|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    765|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 765]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2468|    765|                }
 2469|       |
 2470|       |                /* copy literals */
 2471|  2.25k|                cpy = op+ll;
 2472|  2.25k|                LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH);
  ------------------
  |  |  277|  2.25k|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
 2473|  2.25k|                if ((cpy>oend-MFLIMIT) || (ip+ll>iend-(2+1+LASTLITERALS))) {
  ------------------
  |  |  246|  2.25k|#define MFLIMIT       12   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
                              if ((cpy>oend-MFLIMIT) || (ip+ll>iend-(2+1+LASTLITERALS))) {
  ------------------
  |  |  245|  1.63k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (2473:21): [True: 619, False: 1.63k]
  |  Branch (2473:43): [True: 97, False: 1.53k]
  ------------------
 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|    716|                    if (partialDecoding) {
  ------------------
  |  Branch (2476:25): [True: 0, False: 716]
  ------------------
 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|    716|                    } else if ((ip+ll != iend) || (cpy > oend)) {
  ------------------
  |  Branch (2480:32): [True: 403, False: 313]
  |  Branch (2480:51): [True: 8, False: 305]
  ------------------
 2481|       |                        /* last literals must end exactly at input end, within output */
 2482|    411|                        DEBUGLOG(5, "invalid last literals : they end at iend%+zi and oend%+zi", (ip+ll)-iend, cpy-oend);
  ------------------
  |  |  289|    411|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2483|    411|                        if ((ip+ll <= iend) && (cpy > oend-MFLIMIT)) goto _dst_too_small;   /* output full, input left */
  ------------------
  |  |  246|    222|#define MFLIMIT       12   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (2483:29): [True: 222, False: 189]
  |  Branch (2483:48): [True: 148, False: 74]
  ------------------
 2484|    263|                        goto _output_error;
 2485|    411|                    }
 2486|    305|                    LZ4_memmove(op, ip, ll);  /* supports overlapping memory regions, for in-place decompression scenarios */
  ------------------
  |  |  357|    305|#    define LZ4_memmove __builtin_memmove
  ------------------
 2487|    305|                    ip += ll;
 2488|    305|                    op += ll;
 2489|       |                    /* end of block, unless partialDecoding can go on : output not full, input left for a match */
 2490|    305|                    if (!partialDecoding || (op == oend) || (ip >= (iend-2))) {
  ------------------
  |  Branch (2490:25): [True: 305, False: 0]
  |  Branch (2490:45): [True: 0, False: 0]
  |  Branch (2490:61): [True: 0, False: 0]
  ------------------
 2491|    305|                        break;
 2492|    305|                    }
 2493|  1.53k|                } else {
 2494|  1.53k|                    LZ4_wildCopy8(op, ip, cpy);   /* can overwrite up to 8 bytes beyond cpy */
 2495|  1.53k|                    ip += ll; op = cpy;
 2496|  1.53k|                }
 2497|       |
 2498|       |                /* get offset */
 2499|  1.53k|                offset = LZ4_readLE16(ip); ip+=2;
 2500|  1.53k|                match = op - offset;
 2501|       |
 2502|       |                /* get matchlength */
 2503|  1.53k|                ml = token & ML_MASK;
  ------------------
  |  |  261|  1.53k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|  1.53k|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2504|  1.53k|                DEBUGLOG(7, "blockPos%6u: matchLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)ml);
  ------------------
  |  |  289|  1.53k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2505|  1.53k|            }
 2506|       |
 2507|       |            /* literals copied, offset decoded, ml == match length token */
 2508|  2.62k|            if (ml == ML_MASK) {
  ------------------
  |  |  261|  2.62k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|  2.62k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2508:17): [True: 667, False: 1.96k]
  ------------------
 2509|       |                /* after match length extension bytes, at least 1 token + LASTLITERALS literals must remain */
 2510|    667|                size_t const addl = read_variable_length(&ip, iend - (1 + LASTLITERALS));
  ------------------
  |  |  245|    667|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2511|    667|                if (addl == rvl_error) { goto _output_error; }
  ------------------
  |  Branch (2511:21): [True: 27, False: 640]
  ------------------
 2512|    640|                ml += addl;
 2513|    640|                if (unlikely((uptrval)(op)+ml<(uptrval)op)) goto _output_error;   /* overflow detection */
  ------------------
  |  |  180|    640|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    640|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 640]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2514|    640|            }
 2515|  2.60k|            ml += MINMATCH;
  ------------------
  |  |  242|  2.60k|#define MINMATCH 4
  ------------------
 2516|       |
 2517|  2.60k|#if LZ4_FAST_DEC_LOOP
 2518|  3.16k|        safe_match_copy:
 2519|  3.16k|#endif
 2520|       |            /* literals copied, match fully decoded (ml includes MINMATCH), offset not validated yet */
 2521|  3.16k|            if ((checkOffset) && (unlikely(match + dictSize < lowPrefix))) goto _offset_error;   /* Error : offset outside buffers */
  ------------------
  |  |  180|  3.16k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  3.16k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  ------------------
  ------------------
  |  Branch (2521:17): [True: 3.16k, False: 0]
  |  Branch (2521:34): [True: 391, False: 2.77k]
  ------------------
 2522|       |
 2523|       |            /* end of block : the last LASTLITERALS bytes must be literals */
 2524|  2.77k|            assert(op <= oend);
  ------------------
  |  |  273|  2.77k|#    define assert(condition) ((void)0)
  ------------------
 2525|  2.77k|            if (unlikely(op+ml > oend-LASTLITERALS)) {
  ------------------
  |  |  180|  2.77k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  2.77k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 87, False: 2.68k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2526|     87|                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: 87]
  ------------------
 2527|     87|                else goto _dst_too_small;
 2528|     87|            }
 2529|       |
 2530|       |            /* match starting within external dictionary */
 2531|  2.68k|            if ((dict==usingExtDict) && (match < lowPrefix)) {
  ------------------
  |  Branch (2531:17): [True: 1.10k, False: 1.58k]
  |  Branch (2531:41): [True: 160, False: 940]
  ------------------
 2532|    160|                assert(dictEnd != NULL);
  ------------------
  |  |  273|    160|#    define assert(condition) ((void)0)
  ------------------
 2533|    160|                op = LZ4_copyExtDictMatch(op, match, ml, lowPrefix, dictEnd);
 2534|    160|                continue;
 2535|    160|            }
 2536|  2.52k|            assert(match >= lowPrefix);
  ------------------
  |  |  273|  2.52k|#    define assert(condition) ((void)0)
  ------------------
 2537|       |
 2538|       |            /* close to block end : no wild copy */
 2539|  2.52k|            if (unlikely(op+ml > oend-MATCH_SAFEGUARD_DISTANCE)) {
  ------------------
  |  |  180|  2.52k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  2.52k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 100, False: 2.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2540|    100|                op = LZ4_copyMatchExact(op, match, ml);
 2541|    100|                if (op == oend) { break; }   /* partialDecoding : output buffer full */
  ------------------
  |  Branch (2541:21): [True: 0, False: 100]
  ------------------
 2542|    100|                continue;
 2543|    100|            }
 2544|       |
 2545|       |            /* copy match within block */
 2546|  2.42k|            cpy = op + ml;
 2547|  2.42k|            LZ4_memcpy_using_offset_base(op, match, cpy, offset);
 2548|  2.42k|            op = cpy;   /* wildcopy correction */
 2549|  2.42k|        }
 2550|       |
 2551|       |        /* end of decoding */
 2552|    305|        DEBUGLOG(5, "decoded %i bytes", (int) (((char*)op)-dst));
  ------------------
  |  |  289|    305|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2553|    305|        return (int) (((char*)op)-dst);     /* Nb of output bytes decoded */
 2554|       |
 2555|       |        /* errors : see LZ4_decompress_safe() in lz4.h */
 2556|    348|    _output_error:
 2557|    348|        return -1;
 2558|    235|    _dst_too_small:
 2559|    235|        return -2;
 2560|    493|    _offset_error:
 2561|    493|        return -3;
 2562|    698|    }
 2563|    698|}
lz4.c:read_variable_length:
 2132|  41.5k|{
 2133|  41.5k|    Rvl_t s, length = 0;
 2134|  41.5k|    assert(ipPtr != NULL);
  ------------------
  |  |  273|  41.5k|#    define assert(condition) ((void)0)
  ------------------
 2135|  41.5k|    assert(*ipPtr !=  NULL);
  ------------------
  |  |  273|  41.5k|#    define assert(condition) ((void)0)
  ------------------
 2136|  41.5k|    assert(ilimit != NULL);
  ------------------
  |  |  273|  41.5k|#    define assert(condition) ((void)0)
  ------------------
 2137|  41.5k|    if (unlikely((*ipPtr) >= ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  41.5k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  41.5k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 47, False: 41.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2138|     47|        return rvl_error;
 2139|     47|    }
 2140|  41.5k|    s = **ipPtr;
 2141|  41.5k|    (*ipPtr)++;
 2142|  41.5k|    length += s;
 2143|  41.5k|    if (likely(s != 255)) return length;
  ------------------
  |  |  177|  41.5k|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|  41.5k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 39.0k, False: 2.44k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2144|  12.3k|    do {
 2145|  12.3k|        if (unlikely((*ipPtr) >= ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  12.3k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  12.3k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 38, False: 12.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2146|     38|            return rvl_error;
 2147|     38|        }
 2148|  12.2k|        s = **ipPtr;
 2149|  12.2k|        (*ipPtr)++;
 2150|  12.2k|        length += s;
 2151|       |        /* accumulator overflow detection (32-bit mode only) */
 2152|  12.2k|        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: 12.2k]
  ------------------
 2153|      0|            return rvl_error;
 2154|      0|        }
 2155|  12.2k|    } while (s == 255);
  ------------------
  |  Branch (2155:14): [True: 9.85k, False: 2.40k]
  ------------------
 2156|       |
 2157|  2.40k|    return length;
 2158|  2.44k|}
lz4.c:LZ4_wildCopy64:
  537|  21.4k|{
  538|  21.4k|    BYTE* d = (BYTE*)dstPtr;
  539|  21.4k|    const BYTE* s = (const BYTE*)srcPtr;
  540|  21.4k|    BYTE* const e = (BYTE*)dstEnd;
  541|       |
  542|  46.3k|    do { LZ4_memcpy(d,s,64); d+=64; s+=64; } while (d<e);
  ------------------
  |  |  349|  46.3k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (542:53): [True: 24.9k, False: 21.4k]
  ------------------
  543|  21.4k|}
lz4.c:LZ4_readLE16:
  431|   206k|{
  432|   206k|    if (LZ4_isLittleEndian()) {
  ------------------
  |  Branch (432:9): [True: 206k, False: 0]
  ------------------
  433|   206k|        return LZ4_read16(memPtr);
  434|   206k|    } else {
  435|      0|        const BYTE* p = (const BYTE*)memPtr;
  436|      0|        return (U16)((U16)p[0] | (p[1]<<8));
  437|      0|    }
  438|   206k|}
lz4.c:LZ4_copyExtDictMatch:
 2193|  1.00k|{
 2194|  1.00k|    if (length <= (size_t)(lowPrefix-match)) {
  ------------------
  |  Branch (2194:9): [True: 861, False: 139]
  ------------------
 2195|       |        /* match fits entirely within external dictionary : just copy */
 2196|    861|        LZ4_memmove(op, dictEnd - (lowPrefix-match), length);
  ------------------
  |  |  357|    861|#    define LZ4_memmove __builtin_memmove
  ------------------
 2197|    861|        return op + length;
 2198|    861|    } else {
 2199|       |        /* match stretches into both external dictionary and current block */
 2200|    139|        size_t const copySize = (size_t)(lowPrefix - match);
 2201|    139|        LZ4_memcpy(op, dictEnd - copySize, copySize);
  ------------------
  |  |  349|    139|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2202|    139|        return LZ4_copyMatchExact(op + copySize, lowPrefix, length - copySize);
 2203|    139|    }
 2204|  1.00k|}
lz4.c:LZ4_memcpy_using_offset:
  564|   102k|{
  565|   102k|    BYTE v[8];
  566|       |
  567|   102k|    assert(dstEnd >= dstPtr + MINMATCH);
  ------------------
  |  |  273|   102k|#    define assert(condition) ((void)0)
  ------------------
  568|       |
  569|   102k|    switch(offset) {
  570|  12.2k|    case 1:
  ------------------
  |  Branch (570:5): [True: 12.2k, False: 89.8k]
  ------------------
  571|  12.2k|        MEM_INIT(v, *srcPtr, 8);
  ------------------
  |  |  236|  12.2k|#define MEM_INIT(p,v,s)   LZ4_memset((p),(v),(s))
  |  |  ------------------
  |  |  |  |  234|  12.2k|#  define LZ4_memset(p,v,s) memset((p),(v),(s))
  |  |  ------------------
  ------------------
  572|  12.2k|        break;
  573|  3.12k|    case 2:
  ------------------
  |  Branch (573:5): [True: 3.12k, False: 98.9k]
  ------------------
  574|  3.12k|        LZ4_memcpy(v, srcPtr, 2);
  ------------------
  |  |  349|  3.12k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  575|  3.12k|        LZ4_memcpy(&v[2], srcPtr, 2);
  ------------------
  |  |  349|  3.12k|#    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|  3.12k|        LZ4_memcpy(&v[4], v, 4);
  ------------------
  |  |  349|  3.12k|#    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|  3.12k|        break;
  585|  4.26k|    case 4:
  ------------------
  |  Branch (585:5): [True: 4.26k, False: 97.8k]
  ------------------
  586|  4.26k|        LZ4_memcpy(v, srcPtr, 4);
  ------------------
  |  |  349|  4.26k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  587|  4.26k|        LZ4_memcpy(&v[4], srcPtr, 4);
  ------------------
  |  |  349|  4.26k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  588|  4.26k|        break;
  589|  82.4k|    default:
  ------------------
  |  Branch (589:5): [True: 82.4k, False: 19.6k]
  ------------------
  590|  82.4k|        LZ4_memcpy_using_offset_base(dstPtr, srcPtr, dstEnd, offset);
  591|  82.4k|        return;
  592|   102k|    }
  593|       |
  594|  19.6k|    LZ4_memcpy(dstPtr, v, 8);
  ------------------
  |  |  349|  19.6k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  595|  19.6k|    dstPtr += 8;
  596|  61.2k|    while (dstPtr < dstEnd) {
  ------------------
  |  Branch (596:12): [True: 41.6k, False: 19.6k]
  ------------------
  597|  41.6k|        LZ4_memcpy(dstPtr, v, 8);
  ------------------
  |  |  349|  41.6k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  598|  41.6k|        dstPtr += 8;
  599|  41.6k|    }
  600|  19.6k|}
lz4.c:LZ4_wildCopy32:
  551|  1.55k|{
  552|  1.55k|    BYTE* d = (BYTE*)dstPtr;
  553|  1.55k|    const BYTE* s = (const BYTE*)srcPtr;
  554|  1.55k|    BYTE* const e = (BYTE*)dstEnd;
  555|       |
  556|  3.16k|    do { LZ4_memcpy(d,s,16); LZ4_memcpy(d+16,s+16,16); d+=32; s+=32; } while (d<e);
  ------------------
  |  |  349|  3.16k|#    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|  3.16k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (556:79): [True: 1.60k, False: 1.55k]
  ------------------
  557|  1.55k|}
lz4.c:LZ4_copyMatchExact:
 2167|    239|{
 2168|    239|    if (unlikely(match == op)) {   /* invalid offset 0 : clear the match segment, see doc/lz4_Block_format.md */
  ------------------
  |  |  180|    239|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    239|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 50, False: 189]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2169|     50|        MEM_INIT(op, 0, length);
  ------------------
  |  |  236|     50|#define MEM_INIT(p,v,s)   LZ4_memset((p),(v),(s))
  |  |  ------------------
  |  |  |  |  234|     50|#  define LZ4_memset(p,v,s) memset((p),(v),(s))
  |  |  ------------------
  ------------------
 2170|     50|        return op + length;
 2171|     50|    }
 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|    365|    while (length > (size_t)(op - match)) {
  ------------------
  |  Branch (2175:12): [True: 176, False: 189]
  ------------------
 2176|    176|        size_t const available = (size_t)(op - match);
 2177|    176|        LZ4_memcpy(op, match, available);
  ------------------
  |  |  349|    176|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2178|    176|        op += available;
 2179|    176|        length -= available;
 2180|    176|        if (available >= 2048) match += available;
  ------------------
  |  Branch (2180:13): [True: 2, False: 174]
  ------------------
 2181|    176|    }
 2182|    189|    LZ4_memcpy(op, match, length);
  ------------------
  |  |  349|    189|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2183|    189|    return op + length;
 2184|    239|}
lz4.c:LZ4_memcpy_using_offset_base:
  497|  84.8k|{
  498|  84.8k|    assert(srcPtr + offset == dstPtr);
  ------------------
  |  |  273|  84.8k|#    define assert(condition) ((void)0)
  ------------------
  499|  84.8k|    if (unlikely(offset < 8)) {
  ------------------
  |  |  180|  84.8k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  84.8k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 82.6k, False: 2.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  500|  82.6k|        LZ4_write32(dstPtr, 0);   /* silence an msan warning when offset==0 */
  501|  82.6k|        dstPtr[0] = srcPtr[0];
  502|  82.6k|        dstPtr[1] = srcPtr[1];
  503|  82.6k|        dstPtr[2] = srcPtr[2];
  504|  82.6k|        dstPtr[3] = srcPtr[3];
  505|  82.6k|        srcPtr += inc32table[offset];
  506|  82.6k|        LZ4_memcpy(dstPtr+4, srcPtr, 4);
  ------------------
  |  |  349|  82.6k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  507|  82.6k|        srcPtr -= dec64table[offset];
  508|  82.6k|    } else {
  509|  2.21k|        LZ4_memcpy(dstPtr, srcPtr, 8);
  ------------------
  |  |  349|  2.21k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  510|  2.21k|        srcPtr += 8;
  511|  2.21k|    }
  512|  84.8k|    dstPtr += 8;
  513|       |
  514|       |    /* srcPtr is now at least 8 bytes behind dstPtr */
  515|  84.8k|    LZ4_memcpy(dstPtr, srcPtr, 8);
  ------------------
  |  |  349|  84.8k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  516|  84.8k|    if (dstEnd > dstPtr + 8) { LZ4_wildCopy8(dstPtr + 8, srcPtr + 8, dstEnd); }
  ------------------
  |  Branch (516:9): [True: 10.0k, False: 74.8k]
  ------------------
  517|  84.8k|}

adler32_ssse3.c:adler32_len_16:
   29|     53|static inline uint32_t adler32_len_16(uint32_t adler, const uint8_t *buf, size_t len, uint32_t sum2) {
   30|    461|    while (len) {
  ------------------
  |  Branch (30:12): [True: 408, False: 53]
  ------------------
   31|    408|        --len;
   32|    408|        adler += *buf++;
   33|    408|        sum2 += adler;
   34|    408|    }
   35|     53|    adler %= BASE;
  ------------------
  |  |   11|     53|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   36|     53|    sum2 %= BASE;            /* only added so many BASE's */
  ------------------
  |  |   11|     53|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   37|       |    /* return recombined sums */
   38|     53|    return adler | (sum2 << 16);
   39|     53|}
adler32_sse42.c:adler32_copy_len_16:
   41|    176|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.62k|    while (len--) {
  ------------------
  |  Branch (42:12): [True: 1.44k, False: 176]
  ------------------
   43|  1.44k|        *dst = *buf++;
   44|  1.44k|        adler += *dst++;
   45|  1.44k|        sum2 += adler;
   46|  1.44k|    }
   47|    176|    adler %= BASE;
  ------------------
  |  |   11|    176|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   48|    176|    sum2 %= BASE;            /* only added so many BASE's */
  ------------------
  |  |   11|    176|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   49|       |    /* return recombined sums */
   50|    176|    return adler | (sum2 << 16);
   51|    176|}
adler32_avx2.c:adler32_copy_len_16:
   41|    230|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.58k|    while (len--) {
  ------------------
  |  Branch (42:12): [True: 1.35k, False: 230]
  ------------------
   43|  1.35k|        *dst = *buf++;
   44|  1.35k|        adler += *dst++;
   45|  1.35k|        sum2 += adler;
   46|  1.35k|    }
   47|    230|    adler %= BASE;
  ------------------
  |  |   11|    230|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   48|    230|    sum2 %= BASE;            /* only added so many BASE's */
  ------------------
  |  |   11|    230|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   49|       |    /* return recombined sums */
   50|    230|    return adler | (sum2 << 16);
   51|    230|}
adler32_avx2.c:adler32_len_16:
   29|     97|static inline uint32_t adler32_len_16(uint32_t adler, const uint8_t *buf, size_t len, uint32_t sum2) {
   30|    737|    while (len) {
  ------------------
  |  Branch (30:12): [True: 640, False: 97]
  ------------------
   31|    640|        --len;
   32|    640|        adler += *buf++;
   33|    640|        sum2 += adler;
   34|    640|    }
   35|     97|    adler %= BASE;
  ------------------
  |  |   11|     97|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   36|     97|    sum2 %= BASE;            /* only added so many BASE's */
  ------------------
  |  |   11|     97|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   37|       |    /* return recombined sums */
   38|     97|    return adler | (sum2 << 16);
   39|     97|}

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

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

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

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

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

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

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|  4.18k|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|  4.18k|    len = MIN(len, left);
  ------------------
  |  |  124|  4.18k|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 0, False: 4.18k]
  |  |  ------------------
  ------------------
  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|  4.18k|#ifndef HAVE_MASKED_READWRITE
  247|  4.18k|    if (UNLIKELY(left < sizeof(chunk_t))) {
  ------------------
  |  |  214|  4.18k|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 622, False: 3.56k]
  |  |  ------------------
  ------------------
  248|  4.85k|        while (len > 0) {
  ------------------
  |  Branch (248:16): [True: 4.22k, False: 622]
  ------------------
  249|  4.22k|            *out++ = *from++;
  250|  4.22k|            --len;
  251|  4.22k|        }
  252|       |
  253|    622|        return out;
  254|    622|    }
  255|  3.56k|#endif
  256|       |
  257|  3.56k|    if (len)
  ------------------
  |  Branch (257:9): [True: 3.56k, False: 0]
  ------------------
  258|  3.56k|        out = CHUNKMEMSET(out, from, len);
  ------------------
  |  |  121|  3.56k|#define CHUNKMEMSET      chunkmemset_avx2
  ------------------
  259|       |
  260|  3.56k|    return out;
  261|  4.18k|}
chunkset_avx2.c:chunkmemset_avx2:
  112|  64.0k|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|  64.0k|    Assert(from != out, "chunkmemset cannot have a distance 0");
  116|       |
  117|  64.0k|    chunk_t chunk_load;
  118|  64.0k|    uint32_t chunk_mod = 0;
  119|  64.0k|    uint32_t adv_amount;
  120|  64.0k|    int64_t sdist = out - from;
  121|  64.0k|    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|  64.0k|    if (sdist < 0 && dist < len) {
  ------------------
  |  Branch (127:9): [True: 0, False: 64.0k]
  |  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|  64.0k|    if (dist == 1) {
  ------------------
  |  Branch (143:9): [True: 12.4k, False: 51.5k]
  ------------------
  144|  12.4k|        memset(out, *from, len);
  145|  12.4k|        return out + len;
  146|  51.5k|    } else if (dist >= sizeof(chunk_t)) {
  ------------------
  |  Branch (146:16): [True: 565, False: 51.0k]
  ------------------
  147|    565|        return CHUNKCOPY(out, from, len);
  ------------------
  |  |  119|    565|#define CHUNKCOPY        chunkcopy_avx2
  ------------------
  148|    565|    }
  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|  51.0k|#ifdef HAVE_HALF_CHUNK
  158|  51.0k|    if (len <= sizeof(halfchunk_t)) {
  ------------------
  |  Branch (158:9): [True: 39.4k, False: 11.5k]
  ------------------
  159|  39.4k|        if (dist >= sizeof(halfchunk_t))
  ------------------
  |  Branch (159:13): [True: 170, False: 39.3k]
  ------------------
  160|    170|            return HALFCHUNKCOPY(out, from, len);
  161|       |
  162|  39.3k|        if ((dist % 2) != 0 || dist == 6) {
  ------------------
  |  Branch (162:13): [True: 13.5k, False: 25.7k]
  |  Branch (162:32): [True: 1.59k, False: 24.1k]
  ------------------
  163|  15.1k|            halfchunk_t halfchunk_load = GET_HALFCHUNK_MAG(from, &chunk_mod, (unsigned)dist);
  164|       |
  165|  15.1k|            if (len == sizeof(halfchunk_t)) {
  ------------------
  |  Branch (165:17): [True: 1.01k, False: 14.1k]
  ------------------
  166|  1.01k|                storehalfchunk(out, &halfchunk_load);
  167|  1.01k|                len -= sizeof(halfchunk_t);
  168|  1.01k|                out += sizeof(halfchunk_t);
  169|  1.01k|            }
  170|       |
  171|  15.1k|            chunk_load = halfchunk2whole(&halfchunk_load);
  172|  15.1k|            goto rem_bytes;
  173|  15.1k|        }
  174|  39.3k|    }
  175|  35.7k|#endif
  176|       |
  177|  35.7k|#ifdef HAVE_CHUNKMEMSET_2
  178|  35.7k|    if (dist == 2) {
  ------------------
  |  Branch (178:9): [True: 9.71k, False: 25.9k]
  ------------------
  179|  9.71k|        chunkmemset_2(from, &chunk_load);
  180|  9.71k|    } else
  181|  25.9k|#endif
  182|  25.9k|#ifdef HAVE_CHUNKMEMSET_4
  183|  25.9k|    if (dist == 4) {
  ------------------
  |  Branch (183:9): [True: 14.5k, False: 11.4k]
  ------------------
  184|  14.5k|        chunkmemset_4(from, &chunk_load);
  185|  14.5k|    } else
  186|  11.4k|#endif
  187|  11.4k|#ifdef HAVE_CHUNKMEMSET_8
  188|  11.4k|    if (dist == 8) {
  ------------------
  |  Branch (188:9): [True: 4.71k, False: 6.72k]
  ------------------
  189|  4.71k|        chunkmemset_8(from, &chunk_load);
  190|  4.71k|    } else
  191|  6.72k|#endif
  192|  6.72k|#ifdef HAVE_CHUNKMEMSET_16
  193|  6.72k|    if (dist == 16) {
  ------------------
  |  Branch (193:9): [True: 3.75k, False: 2.96k]
  ------------------
  194|  3.75k|        chunkmemset_16(from, &chunk_load);
  195|  3.75k|    } else
  196|  2.96k|#endif
  197|  2.96k|    chunk_load = GET_CHUNK_MAG(from, &chunk_mod, (unsigned)dist);
  198|       |
  199|  35.7k|    adv_amount = sizeof(chunk_t) - chunk_mod;
  200|       |
  201|  41.0k|    while (len >= (2 * sizeof(chunk_t))) {
  ------------------
  |  Branch (201:12): [True: 5.35k, False: 35.7k]
  ------------------
  202|  5.35k|        storechunk(out, &chunk_load);
  203|  5.35k|        storechunk(out + adv_amount, &chunk_load);
  204|  5.35k|        out += 2 * adv_amount;
  205|  5.35k|        len -= 2 * adv_amount;
  206|  5.35k|    }
  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|  42.7k|    while (len >= sizeof(chunk_t)) {
  ------------------
  |  Branch (212:12): [True: 7.04k, False: 35.7k]
  ------------------
  213|  7.04k|        storechunk(out, &chunk_load);
  214|  7.04k|        len -= adv_amount;
  215|  7.04k|        out += adv_amount;
  216|  7.04k|    }
  217|       |
  218|  35.7k|#ifdef HAVE_HALF_CHUNK
  219|  50.8k|rem_bytes:
  220|  50.8k|#endif
  221|  50.8k|    if (len) {
  ------------------
  |  Branch (221:9): [True: 49.7k, False: 1.04k]
  ------------------
  222|  49.7k|        memcpy(out, &chunk_load, len);
  223|  49.7k|        out += len;
  224|  49.7k|    }
  225|       |
  226|  50.8k|    return out;
  227|  35.7k|}
chunkset_avx2.c:HALFCHUNKCOPY:
   91|    170|static inline uint8_t* HALFCHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
   92|    170|    halfchunk_t chunk;
   93|    170|    int32_t align = ((len - 1) % sizeof(halfchunk_t)) + 1;
   94|    170|    loadhalfchunk(from, &chunk);
   95|    170|    storehalfchunk(out, &chunk);
   96|    170|    out += align;
   97|    170|    from += align;
   98|    170|    len -= align;
   99|    170|    while (len > 0) {
  ------------------
  |  Branch (99:12): [True: 0, False: 170]
  ------------------
  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|    170|    return out;
  107|    170|}
chunkset_avx2.c:chunksize_avx2:
    9|  61.0k|static inline size_t CHUNKSIZE(void) {
   10|  61.0k|    return sizeof(chunk_t);
   11|  61.0k|}
chunkset_avx2.c:chunkcopy_avx2:
   24|  72.5k|static inline uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
   25|  72.5k|    Assert(len > 0, "chunkcopy should never have a length 0");
   26|  72.5k|    chunk_t chunk;
   27|  72.5k|    int32_t align = ((len - 1) % sizeof(chunk_t)) + 1;
   28|  72.5k|    loadchunk(from, &chunk);
   29|  72.5k|    storechunk(out, &chunk);
   30|  72.5k|    out += align;
   31|  72.5k|    from += align;
   32|  72.5k|    len -= align;
   33|  82.7k|    while (len > 0) {
  ------------------
  |  Branch (33:12): [True: 10.2k, False: 72.5k]
  ------------------
   34|  10.2k|        loadchunk(from, &chunk);
   35|  10.2k|        storechunk(out, &chunk);
   36|  10.2k|        out += sizeof(chunk_t);
   37|  10.2k|        from += sizeof(chunk_t);
   38|  10.2k|        len -= sizeof(chunk_t);
   39|  10.2k|    }
   40|  72.5k|    return out;
   41|  72.5k|}

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

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

inflate_fast_avx2:
   53|  22.1k|void Z_INTERNAL INFLATE_FAST(PREFIX3(stream) *strm, uint32_t start) {
   54|       |    /* start: inflate()'s starting value for strm->avail_out */
   55|  22.1k|    struct inflate_state *state;
   56|  22.1k|    z_const unsigned char *in;  /* local strm->next_in */
  ------------------
  |  |   23|  22.1k|#define z_const const
  ------------------
   57|  22.1k|    const unsigned char *last;  /* have enough input while in < last */
   58|  22.1k|    unsigned char *out;         /* local strm->next_out */
   59|  22.1k|    unsigned char *beg;         /* inflate()'s initial strm->next_out */
   60|  22.1k|    unsigned char *end;         /* while out < end, enough space available */
   61|  22.1k|    unsigned char *safe;        /* can use chunkcopy provided out < safe */
   62|  22.1k|    unsigned char *window;      /* allocated sliding window, if wsize != 0 */
   63|  22.1k|    unsigned wsize;             /* window size or zero if not using window */
   64|  22.1k|    unsigned whave;             /* valid bytes in the window */
   65|  22.1k|    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.1k|    unsigned bits;              /* local strm->bits */
  105|  22.1k|    uint64_t hold;              /* local strm->hold */
  106|  22.1k|    unsigned lmask;             /* mask for first level of length codes */
  107|  22.1k|    unsigned dmask;             /* mask for first level of distance codes */
  108|  22.1k|    code const *lcode;          /* local strm->lencode */
  109|  22.1k|    code const *dcode;          /* local strm->distcode */
  110|  22.1k|    const code *here;           /* retrieved table entry */
  111|  22.1k|    unsigned op;                /* code bits, operation, extra bits, or */
  112|       |                                /*  window position, window bytes to copy */
  113|  22.1k|    unsigned len;               /* match length, unused bytes */
  114|  22.1k|    unsigned char *from;        /* where to copy match from */
  115|  22.1k|    unsigned dist;              /* match distance */
  116|  22.1k|    unsigned extra_safe;        /* copy chunks safely in all cases */
  117|       |
  118|       |    /* copy state to local variables */
  119|  22.1k|    state = (struct inflate_state *)strm->state;
  120|  22.1k|    in = strm->next_in;
  121|  22.1k|    last = in + (strm->avail_in - (INFLATE_FAST_MIN_HAVE - 1));
  ------------------
  |  |  137|  22.1k|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
  122|  22.1k|    out = strm->next_out;
  123|  22.1k|    beg = out - (start - strm->avail_out);
  124|  22.1k|    end = out + (strm->avail_out - (INFLATE_FAST_MIN_LEFT - 1));
  ------------------
  |  |  138|  22.1k|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  125|  22.1k|    safe = out + strm->avail_out;
  126|  22.1k|    wsize = state->wsize;
  127|  22.1k|    whave = state->whave;
  128|  22.1k|    wnext = state->wnext;
  129|  22.1k|    window = state->window;
  130|  22.1k|    hold = state->hold;
  131|  22.1k|    bits = state->bits;
  132|  22.1k|    lcode = state->lencode;
  133|  22.1k|    dcode = state->distcode;
  134|  22.1k|    lmask = (1U << state->lenbits) - 1;
  135|  22.1k|    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.1k|    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.1k]
  |  Branch (140:33): [True: 0, False: 0]
  |  Branch (140:50): [True: 0, False: 0]
  ------------------
  141|       |
  142|  22.1k|#define REFILL() do { \
  143|  22.1k|        hold |= load_64_bits(in, bits); \
  144|  22.1k|        in += 7; \
  145|  22.1k|        in -= ((bits >> 3) & 7); \
  146|  22.1k|        bits |= 56; \
  147|  22.1k|    } while (0)
  148|       |
  149|       |    /* decode literals and length/distances until end-of-block or not enough
  150|       |       input data or output space */
  151|  2.87M|    do {
  152|  2.87M|        REFILL();
  ------------------
  |  |  142|  2.87M|#define REFILL() do { \
  |  |  143|  2.87M|        hold |= load_64_bits(in, bits); \
  |  |  144|  2.87M|        in += 7; \
  |  |  145|  2.87M|        in -= ((bits >> 3) & 7); \
  |  |  146|  2.87M|        bits |= 56; \
  |  |  147|  2.87M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (147:14): [Folded, False: 2.87M]
  |  |  ------------------
  ------------------
  153|  2.87M|        here = lcode + (hold & lmask);
  154|  2.87M|        if (here->op == 0) {
  ------------------
  |  Branch (154:13): [True: 2.70M, False: 161k]
  ------------------
  155|  2.70M|            *out++ = (unsigned char)(here->val);
  156|  2.70M|            DROPBITS(here->bits);
  ------------------
  |  |  118|  2.70M|    do { \
  |  |  119|  2.70M|        hold >>= (n); \
  |  |  120|  2.70M|        bits -= (unsigned)(n); \
  |  |  121|  2.70M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 2.70M]
  |  |  ------------------
  ------------------
  157|  2.70M|            here = lcode + (hold & lmask);
  158|  2.70M|            if (here->op == 0) {
  ------------------
  |  Branch (158:17): [True: 2.63M, False: 78.4k]
  ------------------
  159|  2.63M|                *out++ = (unsigned char)(here->val);
  160|  2.63M|                DROPBITS(here->bits);
  ------------------
  |  |  118|  2.63M|    do { \
  |  |  119|  2.63M|        hold >>= (n); \
  |  |  120|  2.63M|        bits -= (unsigned)(n); \
  |  |  121|  2.63M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 2.63M]
  |  |  ------------------
  ------------------
  161|  2.63M|                here = lcode + (hold & lmask);
  162|  2.63M|            }
  163|  2.70M|        }
  164|  3.05M|      dolen:
  165|  3.05M|        DROPBITS(here->bits);
  ------------------
  |  |  118|  3.05M|    do { \
  |  |  119|  3.05M|        hold >>= (n); \
  |  |  120|  3.05M|        bits -= (unsigned)(n); \
  |  |  121|  3.05M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 3.05M]
  |  |  ------------------
  ------------------
  166|  3.05M|        op = here->op;
  167|  3.05M|        if (op == 0) {                          /* literal */
  ------------------
  |  Branch (167:13): [True: 2.71M, False: 335k]
  ------------------
  168|  2.71M|            Tracevv((stderr, here->val >= 0x20 && here->val < 0x7f ?
  169|  2.71M|                    "inflate:         literal '%c'\n" :
  170|  2.71M|                    "inflate:         literal 0x%02x\n", here->val));
  171|  2.71M|            *out++ = (unsigned char)(here->val);
  172|  2.71M|        } else if (op & 16) {                     /* length base */
  ------------------
  |  Branch (172:20): [True: 132k, False: 202k]
  ------------------
  173|   132k|            len = here->val;
  174|   132k|            op &= MAX_BITS;                       /* number of extra bits */
  ------------------
  |  |   39|   132k|#define MAX_BITS 15
  ------------------
  175|   132k|            len += BITS(op);
  ------------------
  |  |  114|   132k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  176|   132k|            DROPBITS(op);
  ------------------
  |  |  118|   132k|    do { \
  |  |  119|   132k|        hold >>= (n); \
  |  |  120|   132k|        bits -= (unsigned)(n); \
  |  |  121|   132k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 132k]
  |  |  ------------------
  ------------------
  177|   132k|            Tracevv((stderr, "inflate:         length %u\n", len));
  178|   132k|            here = dcode + (hold & dmask);
  179|   132k|            if (bits < MAX_BITS + MAX_DIST_EXTRA_BITS) {
  ------------------
  |  |   39|   132k|#define MAX_BITS 15
  ------------------
                          if (bits < MAX_BITS + MAX_DIST_EXTRA_BITS) {
  ------------------
  |  |   41|   132k|#define MAX_DIST_EXTRA_BITS 13
  ------------------
  |  Branch (179:17): [True: 1.14k, False: 131k]
  ------------------
  180|  1.14k|                REFILL();
  ------------------
  |  |  142|  1.14k|#define REFILL() do { \
  |  |  143|  1.14k|        hold |= load_64_bits(in, bits); \
  |  |  144|  1.14k|        in += 7; \
  |  |  145|  1.14k|        in -= ((bits >> 3) & 7); \
  |  |  146|  1.14k|        bits |= 56; \
  |  |  147|  1.14k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (147:14): [Folded, False: 1.14k]
  |  |  ------------------
  ------------------
  181|  1.14k|            }
  182|   138k|          dodist:
  183|   138k|            DROPBITS(here->bits);
  ------------------
  |  |  118|   138k|    do { \
  |  |  119|   138k|        hold >>= (n); \
  |  |  120|   138k|        bits -= (unsigned)(n); \
  |  |  121|   138k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 138k]
  |  |  ------------------
  ------------------
  184|   138k|            op = here->op;
  185|   138k|            if (op & 16) {                      /* distance base */
  ------------------
  |  Branch (185:17): [True: 132k, False: 6.25k]
  ------------------
  186|   132k|                dist = here->val;
  187|   132k|                op &= MAX_BITS;                 /* number of extra bits */
  ------------------
  |  |   39|   132k|#define MAX_BITS 15
  ------------------
  188|   132k|                dist += BITS(op);
  ------------------
  |  |  114|   132k|    (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|   132k|                DROPBITS(op);
  ------------------
  |  |  118|   132k|    do { \
  |  |  119|   132k|        hold >>= (n); \
  |  |  120|   132k|        bits -= (unsigned)(n); \
  |  |  121|   132k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 132k]
  |  |  ------------------
  ------------------
  196|   132k|                Tracevv((stderr, "inflate:         distance %u\n", dist));
  197|   132k|                op = (unsigned)(out - beg);     /* max distance in output */
  198|   132k|                if (dist > op) {                /* see if copy from window */
  ------------------
  |  Branch (198:21): [True: 24, False: 132k]
  ------------------
  199|     24|                    op = dist - op;             /* distance back in window */
  200|     24|                    if (op > whave) {
  ------------------
  |  Branch (200:25): [True: 24, False: 0]
  ------------------
  201|       |#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
  202|       |                        if (state->sane) {
  203|       |                            SET_BAD("invalid distance too far back");
  204|       |                            break;
  205|       |                        }
  206|       |                        if (len <= op - whave) {
  207|       |                            do {
  208|       |                                *out++ = 0;
  209|       |                            } while (--len);
  210|       |                            continue;
  211|       |                        }
  212|       |                        len -= op - whave;
  213|       |                        do {
  214|       |                            *out++ = 0;
  215|       |                        } while (--op > whave);
  216|       |                        if (op == 0) {
  217|       |                            from = out - dist;
  218|       |                            do {
  219|       |                                *out++ = *from++;
  220|       |                            } while (--len);
  221|       |                            continue;
  222|       |                        }
  223|       |#else
  224|     24|                        SET_BAD("invalid distance too far back");
  ------------------
  |  |  132|     24|    do { \
  |  |  133|     24|        state->mode = BAD; \
  |  |  134|     24|        strm->msg = (char *)errmsg; \
  |  |  135|     24|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 24]
  |  |  ------------------
  ------------------
  225|     24|                        break;
  226|     24|#endif
  227|     24|                    }
  228|      0|                    from = window;
  229|      0|                    if (wnext == 0) {           /* very common case */
  ------------------
  |  Branch (229:25): [True: 0, False: 0]
  ------------------
  230|      0|                        from += wsize - op;
  231|      0|                    } else if (wnext >= op) {   /* contiguous in window */
  ------------------
  |  Branch (231:32): [True: 0, False: 0]
  ------------------
  232|      0|                        from += wnext - op;
  233|      0|                    } else {                    /* wrap around window */
  234|      0|                        op -= wnext;
  235|      0|                        from += wsize - op;
  236|      0|                        if (op < len) {         /* some from end of window */
  ------------------
  |  Branch (236:29): [True: 0, False: 0]
  ------------------
  237|      0|                            len -= op;
  238|      0|                            out = CHUNKCOPY_SAFE(out, from, op, safe);
  239|      0|                            from = window;      /* more from start of window */
  240|      0|                            op = wnext;
  241|       |                            /* This (rare) case can create a situation where
  242|       |                               the first chunkcopy below must be checked.
  243|       |                             */
  244|      0|                        }
  245|      0|                    }
  246|      0|                    if (op < len) {             /* still need some from output */
  ------------------
  |  Branch (246:25): [True: 0, False: 0]
  ------------------
  247|      0|                        len -= op;
  248|      0|                        if (!extra_safe) {
  ------------------
  |  Branch (248:29): [True: 0, False: 0]
  ------------------
  249|      0|                            out = CHUNKCOPY_SAFE(out, from, op, safe);
  250|      0|                            out = CHUNKUNROLL(out, &dist, &len);
  ------------------
  |  |  120|      0|#define CHUNKUNROLL      chunkunroll_avx2
  ------------------
  251|      0|                            out = CHUNKCOPY_SAFE(out, out - dist, len, safe);
  252|      0|                        } else {
  253|      0|                            out = chunkcopy_safe(out, from, op, safe);
  254|      0|                            out = chunkcopy_safe(out, out - dist, len, safe);
  255|      0|                        }
  256|      0|                    } else {
  257|      0|#ifndef HAVE_MASKED_READWRITE
  258|      0|                        if (extra_safe)
  ------------------
  |  Branch (258:29): [True: 0, False: 0]
  ------------------
  259|      0|                            out = chunkcopy_safe(out, from, len, safe);
  260|      0|                        else
  261|      0|#endif
  262|      0|                            out = CHUNKCOPY_SAFE(out, from, len, safe);
  263|      0|                    }
  264|      0|#ifndef HAVE_MASKED_READWRITE
  265|   132k|                } else if (extra_safe) {
  ------------------
  |  Branch (265:28): [True: 0, False: 132k]
  ------------------
  266|       |                    /* Whole reference is in range of current output. */
  267|      0|                        out = chunkcopy_safe(out, out - dist, len, safe);
  268|      0|#endif
  269|   132k|                } 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|   132k|                    if (dist >= len || dist >= CHUNKSIZE())
  ------------------
  |  |  118|  61.0k|#define CHUNKSIZE        chunksize_avx2
  ------------------
  |  Branch (275:25): [True: 71.4k, False: 61.0k]
  |  Branch (275:40): [True: 558, False: 60.4k]
  ------------------
  276|  72.0k|                        out = CHUNKCOPY(out, out - dist, len);
  ------------------
  |  |  119|  72.0k|#define CHUNKCOPY        chunkcopy_avx2
  ------------------
  277|  60.4k|                    else
  278|  60.4k|                        out = CHUNKMEMSET(out, out - dist, len);
  ------------------
  |  |  121|  60.4k|#define CHUNKMEMSET      chunkmemset_avx2
  ------------------
  279|   132k|                }
  280|   132k|            } else if ((op & 64) == 0) {          /* 2nd level distance code */
  ------------------
  |  Branch (280:24): [True: 6.24k, False: 6]
  ------------------
  281|  6.24k|                here = dcode + here->val + BITS(op);
  ------------------
  |  |  114|  6.24k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  282|  6.24k|                goto dodist;
  283|  6.24k|            } else {
  284|      6|                SET_BAD("invalid distance code");
  ------------------
  |  |  132|      6|    do { \
  |  |  133|      6|        state->mode = BAD; \
  |  |  134|      6|        strm->msg = (char *)errmsg; \
  |  |  135|      6|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 6]
  |  |  ------------------
  ------------------
  285|      6|                break;
  286|      6|            }
  287|   202k|        } else if ((op & 64) == 0) {              /* 2nd level length code */
  ------------------
  |  Branch (287:20): [True: 180k, False: 21.6k]
  ------------------
  288|   180k|            here = lcode + here->val + BITS(op);
  ------------------
  |  |  114|   180k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  289|   180k|            goto dolen;
  290|   180k|        } else if (op & 32) {                     /* end-of-block */
  ------------------
  |  Branch (290:20): [True: 21.6k, False: 3]
  ------------------
  291|  21.6k|            Tracevv((stderr, "inflate:         end of block\n"));
  292|  21.6k|            state->mode = TYPE;
  293|  21.6k|            break;
  294|  21.6k|        } 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|  3.05M|    } while (in < last && out < end);
  ------------------
  |  Branch (298:14): [True: 2.84M, False: 220]
  |  Branch (298:27): [True: 2.84M, False: 246]
  ------------------
  299|       |
  300|       |    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
  301|  22.1k|    len = bits >> 3;
  302|  22.1k|    in -= len;
  303|  22.1k|    bits -= len << 3;
  304|  22.1k|    hold &= (UINT64_C(1) << bits) - 1;
  305|       |
  306|       |    /* update state and return */
  307|  22.1k|    strm->next_in = in;
  308|  22.1k|    strm->next_out = out;
  309|  22.1k|    strm->avail_in = (unsigned)(in < last ? (INFLATE_FAST_MIN_HAVE - 1) + (last - in)
  ------------------
  |  |  137|  22.1k|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
  |  Branch (309:33): [True: 22.1k, False: 45]
  ------------------
  310|  22.1k|                                          : (INFLATE_FAST_MIN_HAVE - 1) - (in - last));
  ------------------
  |  |  137|     45|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
  311|  22.1k|    strm->avail_out = (unsigned)(out < end ? (INFLATE_FAST_MIN_LEFT - 1) + (end - out)
  ------------------
  |  |  138|  21.8k|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  |  Branch (311:34): [True: 21.8k, False: 282]
  ------------------
  312|  22.1k|                                           : (INFLATE_FAST_MIN_LEFT - 1) - (out - end));
  ------------------
  |  |  138|    282|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  313|       |
  314|  22.1k|    Assert(bits <= 32, "Remaining bits greater than 32");
  315|  22.1k|    state->hold = (uint32_t)hold;
  316|  22.1k|    state->bits = bits;
  317|  22.1k|    return;
  318|  22.1k|}

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

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

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

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

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

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

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

zstd_ddict.c:ZSTD_customMalloc:
   27|  4.97k|{
   28|  4.97k|    if (customMem.customAlloc)
  ------------------
  |  Branch (28:9): [True: 0, False: 4.97k]
  ------------------
   29|      0|        return customMem.customAlloc(customMem.opaque, size);
   30|  4.97k|    return ZSTD_malloc(size);
  ------------------
  |  |   66|  4.97k|#define ZSTD_malloc(s) malloc(s)
  ------------------
   31|  4.97k|}
zstd_ddict.c:ZSTD_customFree:
   50|  4.97k|{
   51|  4.97k|    if (ptr!=NULL) {
  ------------------
  |  Branch (51:9): [True: 4.97k, False: 0]
  ------------------
   52|  4.97k|        if (customMem.customFree)
  ------------------
  |  Branch (52:13): [True: 0, False: 4.97k]
  ------------------
   53|      0|            customMem.customFree(customMem.opaque, ptr);
   54|  4.97k|        else
   55|  4.97k|            ZSTD_free(ptr);
  ------------------
  |  |   68|  4.97k|#define ZSTD_free(p) free((p))
  ------------------
   56|  4.97k|    }
   57|  4.97k|}
zstd_decompress.c:ZSTD_customFree:
   50|  10.3k|{
   51|  10.3k|    if (ptr!=NULL) {
  ------------------
  |  Branch (51:9): [True: 5.19k, False: 5.19k]
  ------------------
   52|  5.19k|        if (customMem.customFree)
  ------------------
  |  Branch (52:13): [True: 0, False: 5.19k]
  ------------------
   53|      0|            customMem.customFree(customMem.opaque, ptr);
   54|  5.19k|        else
   55|  5.19k|            ZSTD_free(ptr);
  ------------------
  |  |   68|  5.19k|#define ZSTD_free(p) free((p))
  ------------------
   56|  5.19k|    }
   57|  10.3k|}
zstd_decompress.c:ZSTD_customMalloc:
   27|  5.19k|{
   28|  5.19k|    if (customMem.customAlloc)
  ------------------
  |  Branch (28:9): [True: 0, False: 5.19k]
  ------------------
   29|      0|        return customMem.customAlloc(customMem.opaque, size);
   30|  5.19k|    return ZSTD_malloc(size);
  ------------------
  |  |   66|  5.19k|#define ZSTD_malloc(s) malloc(s)
  ------------------
   31|  5.19k|}

zstd_decompress_block.c:ZSTD_highbit32:
  175|  1.02M|{
  176|  1.02M|    assert(val != 0);
  ------------------
  |  |   70|  1.02M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  1.02M|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  1.02M|}
zstd_decompress_block.c:ZSTD_countLeadingZeros32:
   70|  1.02M|{
   71|  1.02M|    assert(val != 0);
  ------------------
  |  |   70|  1.02M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   72|       |#if defined(_MSC_VER)
   73|       |#  if STATIC_BMI2
   74|       |    return (unsigned)_lzcnt_u32(val);
   75|       |#  else
   76|       |    if (val != 0) {
   77|       |        unsigned long r;
   78|       |        _BitScanReverse(&r, val);
   79|       |        return (unsigned)(31 - r);
   80|       |    } else {
   81|       |        __assume(0); /* Should not reach this code path */
   82|       |    }
   83|       |#  endif
   84|       |#elif defined(__GNUC__) && (__GNUC__ >= 4)
   85|       |    return (unsigned)__builtin_clz(val);
   86|       |#elif defined(__ICCARM__)
   87|       |    return (unsigned)__builtin_clz(val);
   88|       |#else
   89|       |    return ZSTD_countLeadingZeros32_fallback(val);
   90|       |#endif
   91|  1.02M|}
entropy_common.c:ZSTD_countTrailingZeros32:
   29|  12.4k|{
   30|  12.4k|    assert(val != 0);
  ------------------
  |  |   70|  12.4k|#    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|  12.4k|}
entropy_common.c:ZSTD_highbit32:
  175|  65.1k|{
  176|  65.1k|    assert(val != 0);
  ------------------
  |  |   70|  65.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  65.1k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  65.1k|}
entropy_common.c:ZSTD_countLeadingZeros32:
   70|  65.1k|{
   71|  65.1k|    assert(val != 0);
  ------------------
  |  |   70|  65.1k|#    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|  65.1k|}
fse_decompress.c:ZSTD_highbit32:
  175|   282k|{
  176|   282k|    assert(val != 0);
  ------------------
  |  |   70|   282k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|   282k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|   282k|}
fse_decompress.c:ZSTD_countLeadingZeros32:
   70|   282k|{
   71|   282k|    assert(val != 0);
  ------------------
  |  |   70|   282k|#    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|   282k|}
huf_decompress.c:ZSTD_highbit32:
  175|  12.3k|{
  176|  12.3k|    assert(val != 0);
  ------------------
  |  |   70|  12.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  12.3k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  12.3k|}
huf_decompress.c:ZSTD_countLeadingZeros32:
   70|  12.3k|{
   71|  12.3k|    assert(val != 0);
  ------------------
  |  |   70|  12.3k|#    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|  12.3k|}
huf_decompress.c:ZSTD_countTrailingZeros64:
   94|  16.2k|{
   95|  16.2k|    assert(val != 0);
  ------------------
  |  |   70|  16.2k|#    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|  16.2k|}

zstd_decompress_block.c:BIT_initDStream:
  255|  5.47k|{
  256|  5.47k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|     36|# 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|     36|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     36|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     36|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (256:9): [True: 36, False: 5.43k]
  ------------------
  257|       |
  258|  5.43k|    bitD->start = (const char*)srcBuffer;
  259|  5.43k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  5.43k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 2.17k, False: 3.26k]
  ------------------
  262|  2.17k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|  2.17k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|  2.17k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|  2.17k|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 2.01k, False: 163]
  ------------------
  266|  2.17k|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|    163|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    163|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    163|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:15): [True: 163, False: 2.01k]
  ------------------
  267|  3.26k|    } else {
  268|  3.26k|        bitD->ptr   = bitD->start;
  269|  3.26k|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|  3.26k|        switch(srcSize)
  271|  3.26k|        {
  272|     81|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 81, False: 3.18k]
  ------------------
  273|     81|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|     81|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|    241|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 160, False: 3.10k]
  ------------------
  276|    241|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|    241|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|    601|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 360, False: 2.90k]
  ------------------
  279|    601|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|    601|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|  1.32k|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 728, False: 2.53k]
  ------------------
  282|  1.32k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|  1.32k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|  1.74k|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 416, False: 2.84k]
  ------------------
  285|  1.74k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|  1.74k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|  2.78k|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 1.03k, False: 2.22k]
  ------------------
  288|  2.78k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|  2.78k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|  3.26k|        default: break;
  ------------------
  |  Branch (290:9): [True: 484, False: 2.78k]
  ------------------
  291|  3.26k|        }
  292|  3.26k|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|  3.26k|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 3.24k, False: 17]
  ------------------
  294|  3.26k|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   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 (294:17): [True: 17, False: 3.24k]
  ------------------
  295|  3.26k|        }
  296|  3.24k|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|  3.24k|    }
  298|       |
  299|  5.25k|    return srcSize;
  300|  5.43k|}
zstd_decompress_block.c:BIT_readBits:
  363|  15.8M|{
  364|  15.8M|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|  15.8M|    BIT_skipBits(bitD, nbBits);
  366|  15.8M|    return value;
  367|  15.8M|}
zstd_decompress_block.c:BIT_lookBits:
  331|  15.8M|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|  15.8M|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|  15.8M|    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|  15.8M|}
zstd_decompress_block.c:BIT_getMiddleBits:
  308|  15.8M|{
  309|  15.8M|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|  15.8M|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|  15.8M|#    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|  15.8M|#if defined(__x86_64__) || defined(_M_X64)
  318|  15.8M|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|  15.8M|}
zstd_decompress_block.c:BIT_skipBits:
  354|  20.6M|{
  355|  20.6M|    bitD->bitsConsumed += nbBits;
  356|  20.6M|}
zstd_decompress_block.c:BIT_reloadDStream:
  413|  5.28M|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|  5.28M|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  196|  5.28M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (196:21): [True: 295k, False: 4.98M]
  |  |  ------------------
  ------------------
  416|   295k|        static const BitContainerType zeroFilled = 0;
  417|   295k|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|   295k|        return BIT_DStream_overflow;
  420|   295k|    }
  421|       |
  422|  4.98M|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  4.98M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|  4.98M|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 4.96M, False: 22.4k]
  ------------------
  425|  4.96M|        return BIT_reloadDStream_internal(bitD);
  426|  4.96M|    }
  427|  22.4k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 18.2k, False: 4.15k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  18.2k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 17.5k, False: 747]
  ------------------
  430|    747|        return BIT_DStream_completed;
  431|  18.2k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  4.15k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  4.15k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  4.15k|        if (nbBytes > (size_t)(bitD->ptr - bitD->start)) {
  ------------------
  |  Branch (435:13): [True: 197, False: 3.96k]
  ------------------
  436|    197|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    197|            result = BIT_DStream_endOfBuffer;
  438|    197|        }
  439|  4.15k|        bitD->ptr -= nbBytes;
  440|  4.15k|        bitD->bitsConsumed -= nbBytes*8;
  441|  4.15k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  4.15k|        return result;
  443|  22.4k|    }
  444|  22.4k|}
zstd_decompress_block.c:BIT_reloadDStream_internal:
  385|  4.96M|{
  386|  4.96M|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  4.96M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  4.96M|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  4.96M|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  4.96M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  4.96M|    bitD->bitsConsumed &= 7;
  390|  4.96M|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  4.96M|    return BIT_DStream_unfinished;
  392|  4.96M|}
zstd_decompress_block.c:BIT_readBitsFast:
  372|  4.78M|{
  373|  4.78M|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  4.78M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  4.78M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  4.78M|    BIT_skipBits(bitD, nbBits);
  376|  4.78M|    return value;
  377|  4.78M|}
zstd_decompress_block.c:BIT_lookBitsFast:
  347|  4.78M|{
  348|  4.78M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  4.78M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  4.78M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  4.78M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  4.78M|}
zstd_decompress_block.c:BIT_endOfDStream:
  450|  3.17k|{
  451|  3.17k|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 3.13k, False: 37]
  |  Branch (451:49): [True: 3.10k, False: 31]
  ------------------
  452|  3.17k|}
fse_decompress.c:BIT_initDStream:
  255|  6.99k|{
  256|  6.99k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|     36|# 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|     36|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     36|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     36|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (256:9): [True: 36, False: 6.96k]
  ------------------
  257|       |
  258|  6.96k|    bitD->start = (const char*)srcBuffer;
  259|  6.96k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  6.96k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 5.56k, False: 1.39k]
  ------------------
  262|  5.56k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|  5.56k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|  5.56k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|  5.56k|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 5.44k, False: 121]
  ------------------
  266|  5.56k|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|    121|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    121|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    121|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:15): [True: 121, False: 5.44k]
  ------------------
  267|  5.56k|    } else {
  268|  1.39k|        bitD->ptr   = bitD->start;
  269|  1.39k|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|  1.39k|        switch(srcSize)
  271|  1.39k|        {
  272|    308|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 308, False: 1.09k]
  ------------------
  273|    308|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|    308|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|    515|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 207, False: 1.19k]
  ------------------
  276|    515|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|    515|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|    707|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 192, False: 1.20k]
  ------------------
  279|    707|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|    707|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|    853|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 146, False: 1.25k]
  ------------------
  282|    853|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|    853|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|  1.10k|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 248, False: 1.15k]
  ------------------
  285|  1.10k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|  1.10k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|  1.38k|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 280, False: 1.11k]
  ------------------
  288|  1.38k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|  1.38k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|  1.39k|        default: break;
  ------------------
  |  Branch (290:9): [True: 18, False: 1.38k]
  ------------------
  291|  1.39k|        }
  292|  1.39k|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|  1.39k|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 1.39k, False: 8]
  ------------------
  294|  1.39k|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   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 (294:17): [True: 8, False: 1.39k]
  ------------------
  295|  1.39k|        }
  296|  1.39k|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|  1.39k|    }
  298|       |
  299|  6.83k|    return srcSize;
  300|  6.96k|}
fse_decompress.c:BIT_readBits:
  363|   570k|{
  364|   570k|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|   570k|    BIT_skipBits(bitD, nbBits);
  366|   570k|    return value;
  367|   570k|}
fse_decompress.c:BIT_lookBits:
  331|   570k|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|   570k|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|   570k|    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|   570k|}
fse_decompress.c:BIT_getMiddleBits:
  308|   570k|{
  309|   570k|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|   570k|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|   570k|#    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|   570k|#if defined(__x86_64__) || defined(_M_X64)
  318|   570k|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|   570k|}
fse_decompress.c:BIT_skipBits:
  354|   646k|{
  355|   646k|    bitD->bitsConsumed += nbBits;
  356|   646k|}
fse_decompress.c:BIT_reloadDStream:
  413|   439k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|   439k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  196|   439k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (196:21): [True: 6.82k, False: 432k]
  |  |  ------------------
  ------------------
  416|  6.82k|        static const BitContainerType zeroFilled = 0;
  417|  6.82k|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|  6.82k|        return BIT_DStream_overflow;
  420|  6.82k|    }
  421|       |
  422|   432k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   432k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|   432k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 22.0k, False: 410k]
  ------------------
  425|  22.0k|        return BIT_reloadDStream_internal(bitD);
  426|  22.0k|    }
  427|   410k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 344k, False: 65.4k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|   344k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 334k, False: 9.90k]
  ------------------
  430|  9.90k|        return BIT_DStream_completed;
  431|   344k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  65.4k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  65.4k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  65.4k|        if (nbBytes > (size_t)(bitD->ptr - bitD->start)) {
  ------------------
  |  Branch (435:13): [True: 389, False: 65.0k]
  ------------------
  436|    389|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    389|            result = BIT_DStream_endOfBuffer;
  438|    389|        }
  439|  65.4k|        bitD->ptr -= nbBytes;
  440|  65.4k|        bitD->bitsConsumed -= nbBytes*8;
  441|  65.4k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  65.4k|        return result;
  443|   410k|    }
  444|   410k|}
fse_decompress.c:BIT_reloadDStream_internal:
  385|  22.0k|{
  386|  22.0k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  22.0k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  22.0k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  22.0k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  22.0k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  22.0k|    bitD->bitsConsumed &= 7;
  390|  22.0k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  22.0k|    return BIT_DStream_unfinished;
  392|  22.0k|}
fse_decompress.c:BIT_readBitsFast:
  372|  76.4k|{
  373|  76.4k|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  76.4k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  76.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  76.4k|    BIT_skipBits(bitD, nbBits);
  376|  76.4k|    return value;
  377|  76.4k|}
fse_decompress.c:BIT_lookBitsFast:
  347|  76.4k|{
  348|  76.4k|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  76.4k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  76.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  76.4k|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  76.4k|}
huf_decompress.c:BIT_initDStream:
  255|  3.88k|{
  256|  3.88k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|     16|# 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|     16|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     16|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     16|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (256:9): [True: 16, False: 3.86k]
  ------------------
  257|       |
  258|  3.86k|    bitD->start = (const char*)srcBuffer;
  259|  3.86k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  3.86k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 1.28k, False: 2.58k]
  ------------------
  262|  1.28k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|  1.28k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|  1.28k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|  1.28k|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 1.26k, False: 17]
  ------------------
  266|  1.28k|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   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 (266:15): [True: 17, False: 1.26k]
  ------------------
  267|  2.58k|    } else {
  268|  2.58k|        bitD->ptr   = bitD->start;
  269|  2.58k|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|  2.58k|        switch(srcSize)
  271|  2.58k|        {
  272|     80|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 80, False: 2.50k]
  ------------------
  273|     80|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|     80|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|    207|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 127, False: 2.46k]
  ------------------
  276|    207|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|    207|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|    298|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 91, False: 2.49k]
  ------------------
  279|    298|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|    298|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|    426|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 128, False: 2.46k]
  ------------------
  282|    426|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|    426|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|  1.36k|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 941, False: 1.64k]
  ------------------
  285|  1.36k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|  1.36k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|  1.50k|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 134, False: 2.45k]
  ------------------
  288|  1.50k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|  1.50k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|  2.58k|        default: break;
  ------------------
  |  Branch (290:9): [True: 1.08k, False: 1.50k]
  ------------------
  291|  2.58k|        }
  292|  2.58k|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|  2.58k|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 2.57k, False: 16]
  ------------------
  294|  2.58k|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|     16|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     16|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     16|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 16, False: 2.57k]
  ------------------
  295|  2.58k|        }
  296|  2.57k|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|  2.57k|    }
  298|       |
  299|  3.83k|    return srcSize;
  300|  3.86k|}
huf_decompress.c:BIT_reloadDStream:
  413|   591k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|   591k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  196|   591k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (196:21): [True: 429, False: 591k]
  |  |  ------------------
  ------------------
  416|    429|        static const BitContainerType zeroFilled = 0;
  417|    429|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|    429|        return BIT_DStream_overflow;
  420|    429|    }
  421|       |
  422|   591k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   591k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|   591k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 567k, False: 23.8k]
  ------------------
  425|   567k|        return BIT_reloadDStream_internal(bitD);
  426|   567k|    }
  427|  23.8k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 4.79k, False: 19.0k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  4.79k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 4.06k, False: 737]
  ------------------
  430|    737|        return BIT_DStream_completed;
  431|  4.79k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  19.0k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  19.0k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  19.0k|        if (nbBytes > (size_t)(bitD->ptr - bitD->start)) {
  ------------------
  |  Branch (435:13): [True: 2.30k, False: 16.7k]
  ------------------
  436|  2.30k|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|  2.30k|            result = BIT_DStream_endOfBuffer;
  438|  2.30k|        }
  439|  19.0k|        bitD->ptr -= nbBytes;
  440|  19.0k|        bitD->bitsConsumed -= nbBytes*8;
  441|  19.0k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  19.0k|        return result;
  443|  23.8k|    }
  444|  23.8k|}
huf_decompress.c:BIT_reloadDStream_internal:
  385|   696k|{
  386|   696k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|   696k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|   696k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|   696k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   696k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|   696k|    bitD->bitsConsumed &= 7;
  390|   696k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|   696k|    return BIT_DStream_unfinished;
  392|   696k|}
huf_decompress.c:BIT_lookBitsFast:
  347|  6.14M|{
  348|  6.14M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  6.14M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  6.14M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  6.14M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  6.14M|}
huf_decompress.c:BIT_skipBits:
  354|  6.14M|{
  355|  6.14M|    bitD->bitsConsumed += nbBits;
  356|  6.14M|}
huf_decompress.c:BIT_endOfDStream:
  450|  3.77k|{
  451|  3.77k|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 3.19k, False: 586]
  |  Branch (451:49): [True: 2.04k, False: 1.14k]
  ------------------
  452|  3.77k|}
huf_decompress.c:BIT_reloadDStreamFast:
  401|   129k|{
  402|   129k|    if (UNLIKELY(bitD->ptr < bitD->limitPtr))
  ------------------
  |  |  196|   129k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (196:21): [True: 791, False: 129k]
  |  |  ------------------
  ------------------
  403|    791|        return BIT_DStream_overflow;
  404|   129k|    return BIT_reloadDStream_internal(bitD);
  405|   129k|}

zstd_decompress_block.c:ZSTD_wrappedPtrDiff:
  375|  11.0k|{
  376|  11.0k|    return lhs - rhs;
  377|  11.0k|}
zstd_decompress_block.c:ZSTD_maybeNullPtrAdd:
  412|  18.5k|{
  413|  18.5k|    return add > 0 ? (char*)ptr + add : ptr;
  ------------------
  |  Branch (413:12): [True: 18.2k, False: 307]
  ------------------
  414|  18.5k|}
zstd_decompress_block.c:ZSTD_wrappedPtrSub:
  400|  2.24M|{
  401|  2.24M|    return (const char*)ptr - sub;
  402|  2.24M|}
zstd_decompress_block.c:ZSTD_wrappedPtrAdd:
  387|  4.48M|{
  388|  4.48M|    return (const char*)ptr + add;
  389|  4.48M|}
huf_decompress.c:ZSTD_maybeNullPtrAdd:
  412|  11.4k|{
  413|  11.4k|    return add > 0 ? (char*)ptr + add : ptr;
  ------------------
  |  Branch (413:12): [True: 10.7k, False: 709]
  ------------------
  414|  11.4k|}

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

FSE_isError:
   32|  9.40k|unsigned FSE_isError(size_t code) { return ERR_isError(code); }
FSE_readNCount_bmi2:
  212|  17.9k|{
  213|  17.9k|    if (ZSTD_USE_BMI2(bmi2)) {
  ------------------
  |  |   36|  17.9k|#  define ZSTD_USE_BMI2(bmi2) (bmi2)
  |  |  ------------------
  |  |  |  Branch (36:31): [True: 6.33k, False: 11.5k]
  |  |  ------------------
  ------------------
  214|  6.33k|        return FSE_readNCount_body_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  215|  6.33k|    }
  216|  11.5k|    (void)bmi2;
  217|  11.5k|    return FSE_readNCount_body_default(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  218|  17.9k|}
FSE_readNCount:
  223|  10.8k|{
  224|  10.8k|    return FSE_readNCount_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize, /* bmi2 */ 0);
  225|  10.8k|}
HUF_readStats_wksp:
  335|  7.66k|{
  336|  7.66k|    if (ZSTD_USE_BMI2(flags & HUF_flags_bmi2)) {
  ------------------
  |  |   36|  7.66k|#  define ZSTD_USE_BMI2(bmi2) (bmi2)
  |  |  ------------------
  |  |  |  Branch (36:31): [True: 6.61k, False: 1.04k]
  |  |  ------------------
  ------------------
  337|  6.61k|        return HUF_readStats_body_bmi2(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize);
  338|  6.61k|    }
  339|  1.04k|    (void)flags;
  340|  1.04k|    return HUF_readStats_body_default(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize);
  341|  7.66k|}
entropy_common.c:FSE_readNCount_body_bmi2:
  202|  6.33k|{
  203|  6.33k|    return FSE_readNCount_body(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  204|  6.33k|}
entropy_common.c:FSE_readNCount_body:
   45|  17.9k|{
   46|  17.9k|    const BYTE* const istart = (const BYTE*) headerBuffer;
   47|  17.9k|    const BYTE* const iend = istart + hbSize;
   48|  17.9k|    const BYTE* ip = istart;
   49|  17.9k|    int nbBits;
   50|  17.9k|    int remaining;
   51|  17.9k|    int threshold;
   52|  17.9k|    U32 bitStream;
   53|  17.9k|    int bitCount;
   54|  17.9k|    unsigned charnum = 0;
   55|  17.9k|    unsigned const maxSV1 = *maxSVPtr + 1;
   56|  17.9k|    int previous0 = 0;
   57|       |
   58|  17.9k|    if (hbSize < 8) {
  ------------------
  |  Branch (58:9): [True: 2.28k, False: 15.6k]
  ------------------
   59|       |        /* This function only works when hbSize >= 8 */
   60|  2.28k|        char buffer[8] = {0};
   61|  2.28k|        ZSTD_memcpy(buffer, headerBuffer, hbSize);
  ------------------
  |  |   44|  2.28k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
   62|  2.28k|        {   size_t const countSize = FSE_readNCount(normalizedCounter, maxSVPtr, tableLogPtr,
   63|  2.28k|                                                    buffer, sizeof(buffer));
   64|  2.28k|            if (FSE_isError(countSize)) return countSize;
  ------------------
  |  Branch (64:17): [True: 105, False: 2.18k]
  ------------------
   65|  2.18k|            if (countSize > hbSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|    220|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    220|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    220|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (65:17): [True: 220, False: 1.96k]
  ------------------
   66|  1.96k|            return countSize;
   67|  2.18k|    }   }
   68|  15.6k|    assert(hbSize >= 8);
  ------------------
  |  |   70|  15.6k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   69|       |
   70|       |    /* init */
   71|  15.6k|    ZSTD_memset(normalizedCounter, 0, (*maxSVPtr+1) * sizeof(normalizedCounter[0]));   /* all symbols not present in NCount have a frequency of 0 */
  ------------------
  |  |   46|  15.6k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
   72|  15.6k|    bitStream = MEM_readLE32(ip);
   73|  15.6k|    nbBits = (bitStream & 0xF) + FSE_MIN_TABLELOG;   /* extract tableLog */
  ------------------
  |  |  616|  15.6k|#define FSE_MIN_TABLELOG 5
  ------------------
   74|  15.6k|    if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |  618|  15.6k|#define FSE_TABLELOG_ABSOLUTE_MAX 15
  ------------------
                  if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   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 (74:9): [True: 40, False: 15.6k]
  ------------------
   75|  15.6k|    bitStream >>= 4;
   76|  15.6k|    bitCount = 4;
   77|  15.6k|    *tableLogPtr = nbBits;
   78|  15.6k|    remaining = (1<<nbBits)+1;
   79|  15.6k|    threshold = 1<<nbBits;
   80|  15.6k|    nbBits++;
   81|       |
   82|   142k|    for (;;) {
   83|   142k|        if (previous0) {
  ------------------
  |  Branch (83:13): [True: 11.8k, False: 130k]
  ------------------
   84|       |            /* Count the number of repeats. Each time the
   85|       |             * 2-bit repeat code is 0b11 there is another
   86|       |             * repeat.
   87|       |             * Avoid UB by setting the high bit to 1.
   88|       |             */
   89|  11.8k|            int repeats = ZSTD_countTrailingZeros32(~bitStream | 0x80000000) >> 1;
   90|  12.4k|            while (repeats >= 12) {
  ------------------
  |  Branch (90:20): [True: 585, False: 11.8k]
  ------------------
   91|    585|                charnum += 3 * 12;
   92|    585|                if (LIKELY(ip <= iend-7)) {
  ------------------
  |  |  195|    585|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (195:19): [True: 487, False: 98]
  |  |  ------------------
  ------------------
   93|    487|                    ip += 3;
   94|    487|                } else {
   95|     98|                    bitCount -= (int)(8 * (iend - 7 - ip));
   96|     98|                    bitCount &= 31;
   97|     98|                    ip = iend - 4;
   98|     98|                }
   99|    585|                bitStream = MEM_readLE32(ip) >> bitCount;
  100|    585|                repeats = ZSTD_countTrailingZeros32(~bitStream | 0x80000000) >> 1;
  101|    585|            }
  102|  11.8k|            charnum += 3 * repeats;
  103|  11.8k|            bitStream >>= 2 * repeats;
  104|  11.8k|            bitCount += 2 * repeats;
  105|       |
  106|       |            /* Add the final repeat which isn't 0b11. */
  107|  11.8k|            assert((bitStream & 3) < 3);
  ------------------
  |  |   70|  11.8k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  108|  11.8k|            charnum += bitStream & 3;
  109|  11.8k|            bitCount += 2;
  110|       |
  111|       |            /* This is an error, but break and return an error
  112|       |             * at the end, because returning out of a loop makes
  113|       |             * it harder for the compiler to optimize.
  114|       |             */
  115|  11.8k|            if (charnum >= maxSV1) break;
  ------------------
  |  Branch (115:17): [True: 23, False: 11.8k]
  ------------------
  116|       |
  117|       |            /* We don't need to set the normalized count to 0
  118|       |             * because we already memset the whole buffer to 0.
  119|       |             */
  120|       |
  121|  11.8k|            if (LIKELY(ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  |  195|  23.6k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (195:19): [True: 8.45k, False: 3.38k]
  |  |  ------------------
  ------------------
  |  Branch (121:41): [True: 1.06k, False: 2.31k]
  ------------------
  122|  9.51k|                assert((bitCount >> 3) <= 3); /* For first condition to work */
  ------------------
  |  |   70|  9.51k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  123|  9.51k|                ip += bitCount>>3;
  124|  9.51k|                bitCount &= 7;
  125|  9.51k|            } else {
  126|  2.31k|                bitCount -= (int)(8 * (iend - 4 - ip));
  127|  2.31k|                bitCount &= 31;
  128|  2.31k|                ip = iend - 4;
  129|  2.31k|            }
  130|  11.8k|            bitStream = MEM_readLE32(ip) >> bitCount;
  131|  11.8k|        }
  132|   142k|        {
  133|   142k|            int const max = (2*threshold-1) - remaining;
  134|   142k|            int count;
  135|       |
  136|   142k|            if ((bitStream & (threshold-1)) < (U32)max) {
  ------------------
  |  Branch (136:17): [True: 96.8k, False: 45.3k]
  ------------------
  137|  96.8k|                count = bitStream & (threshold-1);
  138|  96.8k|                bitCount += nbBits-1;
  139|  96.8k|            } else {
  140|  45.3k|                count = bitStream & (2*threshold-1);
  141|  45.3k|                if (count >= threshold) count -= max;
  ------------------
  |  Branch (141:21): [True: 21.5k, False: 23.8k]
  ------------------
  142|  45.3k|                bitCount += nbBits;
  143|  45.3k|            }
  144|       |
  145|   142k|            count--;   /* extra accuracy */
  146|       |            /* When it matters (small blocks), this is a
  147|       |             * predictable branch, because we don't use -1.
  148|       |             */
  149|   142k|            if (count >= 0) {
  ------------------
  |  Branch (149:17): [True: 76.0k, False: 66.1k]
  ------------------
  150|  76.0k|                remaining -= count;
  151|  76.0k|            } else {
  152|  66.1k|                assert(count == -1);
  ------------------
  |  |   70|  66.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  153|  66.1k|                remaining += count;
  154|  66.1k|            }
  155|   142k|            normalizedCounter[charnum++] = (short)count;
  156|   142k|            previous0 = !count;
  157|       |
  158|   142k|            assert(threshold > 1);
  ------------------
  |  |   70|   142k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  159|   142k|            if (remaining < threshold) {
  ------------------
  |  Branch (159:17): [True: 58.8k, False: 83.3k]
  ------------------
  160|       |                /* This branch can be folded into the
  161|       |                 * threshold update condition because we
  162|       |                 * know that threshold > 1.
  163|       |                 */
  164|  58.8k|                if (remaining <= 1) break;
  ------------------
  |  Branch (164:21): [True: 15.4k, False: 43.3k]
  ------------------
  165|  43.3k|                nbBits = ZSTD_highbit32(remaining) + 1;
  166|  43.3k|                threshold = 1 << (nbBits - 1);
  167|  43.3k|            }
  168|   126k|            if (charnum >= maxSV1) break;
  ------------------
  |  Branch (168:17): [True: 84, False: 126k]
  ------------------
  169|       |
  170|   126k|            if (LIKELY(ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  |  195|   253k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (195:19): [True: 101k, False: 25.6k]
  |  |  ------------------
  ------------------
  |  Branch (170:41): [True: 6.35k, False: 19.2k]
  ------------------
  171|   107k|                ip += bitCount>>3;
  172|   107k|                bitCount &= 7;
  173|   107k|            } else {
  174|  19.2k|                bitCount -= (int)(8 * (iend - 4 - ip));
  175|  19.2k|                bitCount &= 31;
  176|  19.2k|                ip = iend - 4;
  177|  19.2k|            }
  178|   126k|            bitStream = MEM_readLE32(ip) >> bitCount;
  179|   126k|    }   }
  180|  15.6k|    if (remaining != 1) return ERROR(corruption_detected);
  ------------------
  |  |   49|    107|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    107|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    107|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (180:9): [True: 107, False: 15.4k]
  ------------------
  181|       |    /* Only possible when there are too many zeros. */
  182|  15.4k|    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 (182:9): [True: 0, False: 15.4k]
  ------------------
  183|  15.4k|    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 (183:9): [True: 0, False: 15.4k]
  ------------------
  184|  15.4k|    *maxSVPtr = charnum-1;
  185|       |
  186|  15.4k|    ip += (bitCount+7)>>3;
  187|  15.4k|    return ip-istart;
  188|  15.4k|}
entropy_common.c:FSE_readNCount_body_default:
  194|  11.5k|{
  195|  11.5k|    return FSE_readNCount_body(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  196|  11.5k|}
entropy_common.c:HUF_readStats_body_bmi2:
  323|  6.61k|{
  324|  6.61k|    return HUF_readStats_body(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize, 1);
  325|  6.61k|}
entropy_common.c:HUF_readStats_body:
  249|  7.66k|{
  250|  7.66k|    U32 weightTotal;
  251|  7.66k|    const BYTE* ip = (const BYTE*) src;
  252|  7.66k|    size_t iSize;
  253|  7.66k|    size_t oSize;
  254|       |
  255|  7.66k|    if (!srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      8|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      8|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      8|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (255:9): [True: 8, False: 7.65k]
  ------------------
  256|  7.65k|    iSize = ip[0];
  257|       |    /* ZSTD_memset(huffWeight, 0, hwSize);   *//* is not necessary, even though some analyzer complain ... */
  258|       |
  259|  7.65k|    if (iSize >= 128) {  /* special header */
  ------------------
  |  Branch (259:9): [True: 535, False: 7.11k]
  ------------------
  260|    535|        oSize = iSize - 127;
  261|    535|        iSize = ((oSize+1)/2);
  262|    535|        if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      5|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      5|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      5|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (262:13): [True: 5, False: 530]
  ------------------
  263|    530|        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 (263:13): [True: 0, False: 530]
  ------------------
  264|    530|        ip += 1;
  265|    530|        {   U32 n;
  266|  4.30k|            for (n=0; n<oSize; n+=2) {
  ------------------
  |  Branch (266:23): [True: 3.77k, False: 530]
  ------------------
  267|  3.77k|                huffWeight[n]   = ip[n/2] >> 4;
  268|  3.77k|                huffWeight[n+1] = ip[n/2] & 15;
  269|  3.77k|    }   }   }
  270|  7.11k|    else  {   /* header compressed with FSE (normal case) */
  271|  7.11k|        if (iSize+1 > srcSize) 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 (271:13): [True: 7, False: 7.11k]
  ------------------
  272|       |        /* max (hwSize-1) values decoded, as last one is implied */
  273|  7.11k|        oSize = FSE_decompress_wksp_bmi2(huffWeight, hwSize-1, ip+1, iSize, 6, workSpace, wkspSize, bmi2);
  274|  7.11k|        if (FSE_isError(oSize)) return oSize;
  ------------------
  |  Branch (274:13): [True: 321, False: 6.79k]
  ------------------
  275|  7.11k|    }
  276|       |
  277|       |    /* collect weight stats */
  278|  7.32k|    ZSTD_memset(rankStats, 0, (HUF_TABLELOG_MAX + 1) * sizeof(U32));
  ------------------
  |  |   46|  7.32k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  279|  7.32k|    weightTotal = 0;
  280|   638k|    {   U32 n; for (n=0; n<oSize; n++) {
  ------------------
  |  Branch (280:26): [True: 631k, False: 7.29k]
  ------------------
  281|   631k|            if (huffWeight[n] > HUF_TABLELOG_MAX) return ERROR(corruption_detected);
  ------------------
  |  |   37|   631k|#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|     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 (281:17): [True: 31, False: 631k]
  ------------------
  282|   631k|            rankStats[huffWeight[n]]++;
  283|   631k|            weightTotal += (1 << huffWeight[n]) >> 1;
  284|   631k|    }   }
  285|  7.29k|    if (weightTotal == 0) 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 (285:9): [True: 6, False: 7.28k]
  ------------------
  286|       |
  287|       |    /* get last non-null symbol weight (implied, total must be 2^n) */
  288|  7.28k|    {   U32 const tableLog = ZSTD_highbit32(weightTotal) + 1;
  289|  7.28k|        if (tableLog > HUF_TABLELOG_MAX) return ERROR(corruption_detected);
  ------------------
  |  |   37|  7.28k|#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|     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 (289:13): [True: 18, False: 7.26k]
  ------------------
  290|  7.26k|        *tableLogPtr = tableLog;
  291|       |        /* determine last weight */
  292|  7.26k|        {   U32 const total = 1 << tableLog;
  293|  7.26k|            U32 const rest = total - weightTotal;
  294|  7.26k|            U32 const verif = 1 << ZSTD_highbit32(rest);
  295|  7.26k|            U32 const lastWeight = ZSTD_highbit32(rest) + 1;
  296|  7.26k|            if (verif != rest) return ERROR(corruption_detected);    /* last value must be a clean power of 2 */
  ------------------
  |  |   49|     99|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     99|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     99|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (296:17): [True: 99, False: 7.16k]
  ------------------
  297|  7.16k|            huffWeight[oSize] = (BYTE)lastWeight;
  298|  7.16k|            rankStats[lastWeight]++;
  299|  7.16k|    }   }
  300|       |
  301|       |    /* check tree construction validity */
  302|  7.16k|    if ((rankStats[1] < 2) || (rankStats[1] & 1)) return ERROR(corruption_detected);   /* by construction : at least 2 elts of rank 1, must be even */
  ------------------
  |  |   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 (302:9): [True: 14, False: 7.15k]
  |  Branch (302:31): [True: 0, False: 7.15k]
  ------------------
  303|       |
  304|       |    /* results */
  305|  7.15k|    *nbSymbolsPtr = (U32)(oSize+1);
  306|  7.15k|    return iSize+1;
  307|  7.16k|}
entropy_common.c:HUF_readStats_body_default:
  314|  1.04k|{
  315|  1.04k|    return HUF_readStats_body(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize, 0);
  316|  1.04k|}

zstd_common.c:ERR_isError:
   52|  15.4k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  15.4k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  15.4k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  15.4k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_common.c:ERR_getErrorCode:
   54|  8.46k|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: 3.58k, False: 4.88k]
  ------------------
zstd_ddict.c:ERR_isError:
   52|  8.51k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  8.51k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  8.51k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  8.51k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress.c:ERR_isError:
   52|   122k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|   122k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|   122k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   122k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress_block.c:ERR_isError:
   52|  5.32M|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  5.32M|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  5.32M|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  5.32M|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
entropy_common.c:ERR_isError:
   52|  9.40k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  9.40k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  9.40k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  9.40k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
fse_decompress.c:ERR_isError:
   52|  21.1k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  21.1k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  21.1k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  21.1k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
huf_decompress.c:ERR_isError:
   52|  39.0k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  39.0k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  39.0k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  39.0k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------

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

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

zstd_ddict.c:MEM_readLE32:
  322|  3.23k|{
  323|  3.23k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 3.23k, False: 0]
  ------------------
  324|  3.23k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  3.23k|}
zstd_ddict.c:MEM_isLittleEndian:
  141|  3.23k|{
  142|  3.23k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  3.23k|    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|  3.23k|}
zstd_ddict.c:MEM_read32:
  183|  3.23k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE32:
  322|  20.1k|{
  323|  20.1k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 20.1k, False: 0]
  ------------------
  324|  20.1k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  20.1k|}
zstd_decompress.c:MEM_isLittleEndian:
  141|  23.2k|{
  142|  23.2k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  23.2k|    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|  23.2k|}
zstd_decompress.c:MEM_read32:
  183|  20.1k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE16:
  290|  1.24k|{
  291|  1.24k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 1.24k, False: 0]
  ------------------
  292|  1.24k|        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.24k|}
zstd_decompress.c:MEM_read16:
  182|  1.24k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress.c:MEM_readLE64:
  338|  1.86k|{
  339|  1.86k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 1.86k, False: 0]
  ------------------
  340|  1.86k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  1.86k|}
zstd_decompress.c:MEM_read64:
  184|  1.86k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_decompress_block.c:MEM_readLE24:
  311|  35.5k|{
  312|  35.5k|    return (U32)MEM_readLE16(memPtr) + ((U32)(((const BYTE*)memPtr)[2]) << 16);
  313|  35.5k|}
zstd_decompress_block.c:MEM_readLE32:
  322|  7.28k|{
  323|  7.28k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 7.28k, False: 0]
  ------------------
  324|  7.28k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  7.28k|}
zstd_decompress_block.c:MEM_isLittleEndian:
  141|  5.01M|{
  142|  5.01M|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  5.01M|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|  5.01M|}
zstd_decompress_block.c:MEM_read32:
  183|  7.28k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress_block.c:MEM_write64:
  189|  52.2k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
zstd_decompress_block.c:MEM_readLE16:
  290|  36.8k|{
  291|  36.8k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 36.8k, False: 0]
  ------------------
  292|  36.8k|        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|  36.8k|}
zstd_decompress_block.c:MEM_read16:
  182|  36.8k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress_block.c:MEM_32bits:
  137|  35.2M|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_decompress_block.c:MEM_64bits:
  138|  5.28M|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_decompress_block.c:MEM_readLEST:
  354|  4.97M|{
  355|  4.97M|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 4.97M]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  4.97M|    else
  358|  4.97M|        return (size_t)MEM_readLE64(memPtr);
  359|  4.97M|}
zstd_decompress_block.c:MEM_readLE64:
  338|  4.97M|{
  339|  4.97M|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 4.97M, False: 0]
  ------------------
  340|  4.97M|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  4.97M|}
zstd_decompress_block.c:MEM_read64:
  184|  4.97M|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
entropy_common.c:MEM_readLE32:
  322|   154k|{
  323|   154k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 154k, False: 0]
  ------------------
  324|   154k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|   154k|}
entropy_common.c:MEM_isLittleEndian:
  141|   154k|{
  142|   154k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   154k|    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|   154k|}
entropy_common.c:MEM_read32:
  183|   154k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
fse_decompress.c:MEM_write64:
  189|  21.7k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
fse_decompress.c:MEM_readLEST:
  354|  93.0k|{
  355|  93.0k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 93.0k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  93.0k|    else
  358|  93.0k|        return (size_t)MEM_readLE64(memPtr);
  359|  93.0k|}
fse_decompress.c:MEM_32bits:
  137|  93.0k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
fse_decompress.c:MEM_isLittleEndian:
  141|  93.0k|{
  142|  93.0k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  93.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|  93.0k|}
fse_decompress.c:MEM_readLE64:
  338|  93.0k|{
  339|  93.0k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 93.0k, False: 0]
  ------------------
  340|  93.0k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  93.0k|}
fse_decompress.c:MEM_read64:
  184|  93.0k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_isLittleEndian:
  141|  1.35M|{
  142|  1.35M|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  1.35M|    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|  1.35M|}
huf_decompress.c:MEM_write64:
  189|  3.16M|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
huf_decompress.c:MEM_readLEST:
  354|   749k|{
  355|   749k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 749k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|   749k|    else
  358|   749k|        return (size_t)MEM_readLE64(memPtr);
  359|   749k|}
huf_decompress.c:MEM_32bits:
  137|   771k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
huf_decompress.c:MEM_readLE64:
  338|   749k|{
  339|   749k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 749k, False: 0]
  ------------------
  340|   749k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|   749k|}
huf_decompress.c:MEM_read64:
  184|   749k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_64bits:
  138|  1.32M|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
huf_decompress.c:MEM_readLE16:
  290|  14.9k|{
  291|  14.9k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 14.9k, False: 0]
  ------------------
  292|  14.9k|        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|  14.9k|}
huf_decompress.c:MEM_read16:
  182|  14.9k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }

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

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

zstd_decompress.c:ZSTD_cpuSupportsBmi2:
  321|  5.19k|{
  322|  5.19k|    ZSTD_cpuid_t cpuid = ZSTD_cpuid();
  323|  5.19k|    return ZSTD_cpuid_bmi1(cpuid) && ZSTD_cpuid_bmi2(cpuid);
  ------------------
  |  Branch (323:12): [True: 5.19k, False: 0]
  |  Branch (323:38): [True: 5.19k, False: 0]
  ------------------
  324|  5.19k|}
zstd_decompress_block.c:ZSTD_wildcopy:
  219|  3.68M|{
  220|  3.68M|    ptrdiff_t diff = (BYTE*)dst - (const BYTE*)src;
  221|  3.68M|    const BYTE* ip = (const BYTE*)src;
  222|  3.68M|    BYTE* op = (BYTE*)dst;
  223|  3.68M|    BYTE* const oend = op + length;
  224|       |
  225|  3.68M|    if (ovtype == ZSTD_overlap_src_before_dst && diff < WILDCOPY_VECLEN) {
  ------------------
  |  |  202|   181k|#define WILDCOPY_VECLEN 16
  ------------------
  |  Branch (225:9): [True: 181k, False: 3.50M]
  |  Branch (225:50): [True: 181k, False: 90]
  ------------------
  226|       |        /* Handle short offset copies. */
  227|   932k|        do {
  228|   932k|            COPY8(op, ip);
  ------------------
  |  |  177|   932k|#define COPY8(d,s) do { ZSTD_copy8(d,s); d+=8; s+=8; } while (0)
  |  |  ------------------
  |  |  |  Branch (177:63): [Folded, False: 932k]
  |  |  ------------------
  ------------------
  229|   932k|        } while (op < oend);
  ------------------
  |  Branch (229:18): [True: 750k, False: 181k]
  ------------------
  230|  3.50M|    } else {
  231|  3.50M|        assert(diff >= WILDCOPY_VECLEN || diff <= -WILDCOPY_VECLEN);
  ------------------
  |  |   70|  3.50M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  232|       |        /* Separate out the first COPY16() call because the copy length is
  233|       |         * almost certain to be short, so the branches have different
  234|       |         * probabilities. Since it is almost certain to be short, only do
  235|       |         * one COPY16() in the first call. Then, do two calls per loop since
  236|       |         * at that point it is more likely to have a high trip count.
  237|       |         */
  238|  3.50M|        ZSTD_copy16(op, ip);
  239|  3.50M|        if (16 >= length) return;
  ------------------
  |  Branch (239:13): [True: 3.34M, False: 156k]
  ------------------
  240|   156k|        op += 16;
  241|   156k|        ip += 16;
  242|   988k|        do {
  243|   988k|            COPY16(op, ip);
  ------------------
  |  |  199|   988k|#define COPY16(d,s) do { ZSTD_copy16(d,s); d+=16; s+=16; } while (0)
  |  |  ------------------
  |  |  |  Branch (199:67): [Folded, False: 988k]
  |  |  ------------------
  ------------------
  244|   988k|            COPY16(op, ip);
  ------------------
  |  |  199|   988k|#define COPY16(d,s) do { ZSTD_copy16(d,s); d+=16; s+=16; } while (0)
  |  |  ------------------
  |  |  |  Branch (199:67): [Folded, False: 988k]
  |  |  ------------------
  ------------------
  245|   988k|        }
  246|   988k|        while (op < oend);
  ------------------
  |  Branch (246:16): [True: 832k, False: 156k]
  ------------------
  247|   156k|    }
  248|  3.68M|}
zstd_decompress_block.c:ZSTD_copy8:
  170|  1.87M|static void ZSTD_copy8(void* dst, const void* src) {
  171|       |#if defined(ZSTD_ARCH_ARM_NEON) && !defined(__aarch64__)
  172|       |    vst1_u8((uint8_t*)dst, vld1_u8((const uint8_t*)src));
  173|       |#else
  174|  1.87M|    ZSTD_memcpy(dst, src, 8);
  ------------------
  |  |   44|  1.87M|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  175|  1.87M|#endif
  176|  1.87M|}
zstd_decompress_block.c:ZSTD_copy16:
  183|  10.7M|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(ZSTD_ARCH_RISCV_RVV)
  189|       |    __riscv_vse8_v_u8m1((uint8_t*)dst, __riscv_vle8_v_u8m1((const uint8_t*)src, 16), 16);
  190|       |#elif defined(__clang__)
  191|       |    ZSTD_memmove(dst, src, 16);
  192|       |#else
  193|       |    /* ZSTD_memmove is not inlined properly by gcc */
  194|       |    BYTE copy16_buf[16];
  195|       |    ZSTD_memcpy(copy16_buf, src, 16);
  196|       |    ZSTD_memcpy(dst, copy16_buf, 16);
  197|       |#endif
  198|  10.7M|}

HUF_readDTableX1_wksp:
  390|  6.45k|{
  391|  6.45k|    U32 tableLog = 0;
  392|  6.45k|    U32 nbSymbols = 0;
  393|  6.45k|    size_t iSize;
  394|  6.45k|    void* const dtPtr = DTable + 1;
  395|  6.45k|    HUF_DEltX1* const dt = (HUF_DEltX1*)dtPtr;
  396|  6.45k|    HUF_ReadDTableX1_Workspace* wksp = (HUF_ReadDTableX1_Workspace*)workSpace;
  397|       |
  398|  6.45k|    DEBUG_STATIC_ASSERT(HUF_DECOMPRESS_WORKSPACE_SIZE >= sizeof(*wksp));
  ------------------
  |  |   39|  6.45k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  399|  6.45k|    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 (399:9): [True: 0, False: 6.45k]
  ------------------
  400|       |
  401|  6.45k|    DEBUG_STATIC_ASSERT(sizeof(DTableDesc) == sizeof(HUF_DTable));
  ------------------
  |  |   39|  6.45k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  402|       |    /* ZSTD_memset(huffWeight, 0, sizeof(huffWeight)); */   /* is not necessary, even though some analyzer complain ... */
  403|       |
  404|  6.45k|    iSize = HUF_readStats_wksp(wksp->huffWeight, HUF_SYMBOLVALUE_MAX + 1, wksp->rankVal, &nbSymbols, &tableLog, src, srcSize, wksp->statsWksp, sizeof(wksp->statsWksp), flags);
  ------------------
  |  |   39|  6.45k|#define HUF_SYMBOLVALUE_MAX  255
  ------------------
  405|  6.45k|    if (HUF_isError(iSize)) return iSize;
  ------------------
  |  |   80|  6.45k|#define HUF_isError ERR_isError
  ------------------
  |  Branch (405:9): [True: 359, False: 6.09k]
  ------------------
  406|       |
  407|       |
  408|       |    /* Table header */
  409|  6.09k|    {   DTableDesc dtd = HUF_getDTableDesc(DTable);
  410|  6.09k|        U32 const maxTableLog = dtd.maxTableLog + 1;
  411|  6.09k|        U32 const targetTableLog = MIN(maxTableLog, HUF_DECODER_FAST_TABLELOG);
  ------------------
  |  |   54|  6.09k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 0, False: 6.09k]
  |  |  ------------------
  ------------------
  412|  6.09k|        tableLog = HUF_rescaleStats(wksp->huffWeight, wksp->rankVal, nbSymbols, tableLog, targetTableLog);
  413|  6.09k|        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 (413:13): [True: 0, False: 6.09k]
  ------------------
  414|  6.09k|        dtd.tableType = 0;
  415|  6.09k|        dtd.tableLog = (BYTE)tableLog;
  416|  6.09k|        ZSTD_memcpy(DTable, &dtd, sizeof(dtd));
  ------------------
  |  |   44|  6.09k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  417|  6.09k|    }
  418|       |
  419|       |    /* Compute symbols and rankStart given rankVal:
  420|       |     *
  421|       |     * rankVal already contains the number of values of each weight.
  422|       |     *
  423|       |     * symbols contains the symbols ordered by weight. First are the rankVal[0]
  424|       |     * weight 0 symbols, followed by the rankVal[1] weight 1 symbols, and so on.
  425|       |     * symbols[0] is filled (but unused) to avoid a branch.
  426|       |     *
  427|       |     * rankStart contains the offset where each rank belongs in the DTable.
  428|       |     * rankStart[0] is not filled because there are no entries in the table for
  429|       |     * weight 0.
  430|       |     */
  431|      0|    {   int n;
  432|  6.09k|        U32 nextRankStart = 0;
  433|  6.09k|        int const unroll = 4;
  434|  6.09k|        int const nLimit = (int)nbSymbols - unroll + 1;
  435|  79.3k|        for (n=0; n<(int)tableLog+1; n++) {
  ------------------
  |  Branch (435:19): [True: 73.2k, False: 6.09k]
  ------------------
  436|  73.2k|            U32 const curr = nextRankStart;
  437|  73.2k|            nextRankStart += wksp->rankVal[n];
  438|  73.2k|            wksp->rankStart[n] = curr;
  439|  73.2k|        }
  440|   143k|        for (n=0; n < nLimit; n += unroll) {
  ------------------
  |  Branch (440:19): [True: 137k, False: 6.09k]
  ------------------
  441|   137k|            int u;
  442|   687k|            for (u=0; u < unroll; ++u) {
  ------------------
  |  Branch (442:23): [True: 550k, False: 137k]
  ------------------
  443|   550k|                size_t const w = wksp->huffWeight[n+u];
  444|   550k|                wksp->symbols[wksp->rankStart[w]++] = (BYTE)(n+u);
  445|   550k|            }
  446|   137k|        }
  447|  14.2k|        for (; n < (int)nbSymbols; ++n) {
  ------------------
  |  Branch (447:16): [True: 8.14k, False: 6.09k]
  ------------------
  448|  8.14k|            size_t const w = wksp->huffWeight[n];
  449|  8.14k|            wksp->symbols[wksp->rankStart[w]++] = (BYTE)n;
  450|  8.14k|        }
  451|  6.09k|    }
  452|       |
  453|       |    /* fill DTable
  454|       |     * We fill all entries of each weight in order.
  455|       |     * That way length is a constant for each iteration of the outer loop.
  456|       |     * We can switch based on the length to a different inner loop which is
  457|       |     * optimized for that particular case.
  458|       |     */
  459|  6.09k|    {   U32 w;
  460|  6.09k|        int symbol = wksp->rankVal[0];
  461|  6.09k|        int rankStart = 0;
  462|  73.2k|        for (w=1; w<tableLog+1; ++w) {
  ------------------
  |  Branch (462:19): [True: 67.1k, False: 6.09k]
  ------------------
  463|  67.1k|            int const symbolCount = wksp->rankVal[w];
  464|  67.1k|            int const length = (1 << w) >> 1;
  465|  67.1k|            int uStart = rankStart;
  466|  67.1k|            BYTE const nbBits = (BYTE)(tableLog + 1 - w);
  467|  67.1k|            int s;
  468|  67.1k|            int u;
  469|  67.1k|            switch (length) {
  470|  6.09k|            case 1:
  ------------------
  |  Branch (470:13): [True: 6.09k, False: 61.0k]
  ------------------
  471|  14.4k|                for (s=0; s<symbolCount; ++s) {
  ------------------
  |  Branch (471:27): [True: 8.36k, False: 6.09k]
  ------------------
  472|  8.36k|                    HUF_DEltX1 D;
  473|  8.36k|                    D.byte = wksp->symbols[symbol + s];
  474|  8.36k|                    D.nbBits = nbBits;
  475|  8.36k|                    dt[uStart] = D;
  476|  8.36k|                    uStart += 1;
  477|  8.36k|                }
  478|  6.09k|                break;
  479|  6.09k|            case 2:
  ------------------
  |  Branch (479:13): [True: 6.09k, False: 61.0k]
  ------------------
  480|  10.7k|                for (s=0; s<symbolCount; ++s) {
  ------------------
  |  Branch (480:27): [True: 4.62k, False: 6.09k]
  ------------------
  481|  4.62k|                    HUF_DEltX1 D;
  482|  4.62k|                    D.byte = wksp->symbols[symbol + s];
  483|  4.62k|                    D.nbBits = nbBits;
  484|  4.62k|                    dt[uStart+0] = D;
  485|  4.62k|                    dt[uStart+1] = D;
  486|  4.62k|                    uStart += 2;
  487|  4.62k|                }
  488|  6.09k|                break;
  489|  6.09k|            case 4:
  ------------------
  |  Branch (489:13): [True: 6.09k, False: 61.0k]
  ------------------
  490|  11.6k|                for (s=0; s<symbolCount; ++s) {
  ------------------
  |  Branch (490:27): [True: 5.60k, False: 6.09k]
  ------------------
  491|  5.60k|                    U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits);
  492|  5.60k|                    MEM_write64(dt + uStart, D4);
  493|  5.60k|                    uStart += 4;
  494|  5.60k|                }
  495|  6.09k|                break;
  496|  6.09k|            case 8:
  ------------------
  |  Branch (496:13): [True: 6.09k, False: 61.0k]
  ------------------
  497|  22.9k|                for (s=0; s<symbolCount; ++s) {
  ------------------
  |  Branch (497:27): [True: 16.8k, False: 6.09k]
  ------------------
  498|  16.8k|                    U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits);
  499|  16.8k|                    MEM_write64(dt + uStart, D4);
  500|  16.8k|                    MEM_write64(dt + uStart + 4, D4);
  501|  16.8k|                    uStart += 8;
  502|  16.8k|                }
  503|  6.09k|                break;
  504|  42.7k|            default:
  ------------------
  |  Branch (504:13): [True: 42.7k, False: 24.3k]
  ------------------
  505|   325k|                for (s=0; s<symbolCount; ++s) {
  ------------------
  |  Branch (505:27): [True: 283k, False: 42.7k]
  ------------------
  506|   283k|                    U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits);
  507|  1.06M|                    for (u=0; u < length; u += 16) {
  ------------------
  |  Branch (507:31): [True: 782k, False: 283k]
  ------------------
  508|   782k|                        MEM_write64(dt + uStart + u + 0, D4);
  509|   782k|                        MEM_write64(dt + uStart + u + 4, D4);
  510|   782k|                        MEM_write64(dt + uStart + u + 8, D4);
  511|   782k|                        MEM_write64(dt + uStart + u + 12, D4);
  512|   782k|                    }
  513|   283k|                    assert(u == length);
  ------------------
  |  |   70|   283k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  514|   283k|                    uStart += length;
  515|   283k|                }
  516|  42.7k|                break;
  517|  67.1k|            }
  518|  67.1k|            symbol += symbolCount;
  519|  67.1k|            rankStart += symbolCount * length;
  520|  67.1k|        }
  521|  6.09k|    }
  522|  6.09k|    return iSize;
  523|  6.09k|}
HUF_readDTableX2_wksp:
 1186|  1.20k|{
 1187|  1.20k|    U32 tableLog, maxW, nbSymbols;
 1188|  1.20k|    DTableDesc dtd = HUF_getDTableDesc(DTable);
 1189|  1.20k|    U32 maxTableLog = dtd.maxTableLog;
 1190|  1.20k|    size_t iSize;
 1191|  1.20k|    void* dtPtr = DTable+1;   /* force compiler to avoid strict-aliasing */
 1192|  1.20k|    HUF_DEltX2* const dt = (HUF_DEltX2*)dtPtr;
 1193|  1.20k|    U32 *rankStart;
 1194|       |
 1195|  1.20k|    HUF_ReadDTableX2_Workspace* const wksp = (HUF_ReadDTableX2_Workspace*)workSpace;
 1196|       |
 1197|  1.20k|    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 (1197:9): [True: 0, False: 1.20k]
  ------------------
 1198|       |
 1199|  1.20k|    rankStart = wksp->rankStart0 + 1;
 1200|  1.20k|    ZSTD_memset(wksp->rankStats, 0, sizeof(wksp->rankStats));
  ------------------
  |  |   46|  1.20k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
 1201|  1.20k|    ZSTD_memset(wksp->rankStart0, 0, sizeof(wksp->rankStart0));
  ------------------
  |  |   46|  1.20k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
 1202|       |
 1203|  1.20k|    DEBUG_STATIC_ASSERT(sizeof(HUF_DEltX2) == sizeof(HUF_DTable));   /* if compiler fails here, assertion is wrong */
  ------------------
  |  |   39|  1.20k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
 1204|  1.20k|    if (maxTableLog > HUF_TABLELOG_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   37|  1.20k|#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 (1204:9): [True: 0, False: 1.20k]
  ------------------
 1205|       |    /* ZSTD_memset(weightList, 0, sizeof(weightList)); */  /* is not necessary, even though some analyzer complain ... */
 1206|       |
 1207|  1.20k|    iSize = HUF_readStats_wksp(wksp->weightList, HUF_SYMBOLVALUE_MAX + 1, wksp->rankStats, &nbSymbols, &tableLog, src, srcSize, wksp->calleeWksp, sizeof(wksp->calleeWksp), flags);
  ------------------
  |  |   39|  1.20k|#define HUF_SYMBOLVALUE_MAX  255
  ------------------
 1208|  1.20k|    if (HUF_isError(iSize)) return iSize;
  ------------------
  |  |   80|  1.20k|#define HUF_isError ERR_isError
  ------------------
  |  Branch (1208:9): [True: 150, False: 1.05k]
  ------------------
 1209|       |
 1210|       |    /* check result */
 1211|  1.05k|    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 (1211:9): [True: 0, False: 1.05k]
  ------------------
 1212|  1.05k|    if (tableLog <= HUF_DECODER_FAST_TABLELOG && maxTableLog > HUF_DECODER_FAST_TABLELOG) maxTableLog = HUF_DECODER_FAST_TABLELOG;
  ------------------
  |  |   33|  2.11k|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
                  if (tableLog <= HUF_DECODER_FAST_TABLELOG && maxTableLog > HUF_DECODER_FAST_TABLELOG) maxTableLog = HUF_DECODER_FAST_TABLELOG;
  ------------------
  |  |   33|    883|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
                  if (tableLog <= HUF_DECODER_FAST_TABLELOG && maxTableLog > HUF_DECODER_FAST_TABLELOG) maxTableLog = HUF_DECODER_FAST_TABLELOG;
  ------------------
  |  |   33|    883|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
  |  Branch (1212:9): [True: 883, False: 174]
  |  Branch (1212:50): [True: 883, False: 0]
  ------------------
 1213|       |
 1214|       |    /* find maxWeight */
 1215|  2.15k|    for (maxW = tableLog; wksp->rankStats[maxW]==0; maxW--) {}  /* necessarily finds a solution before 0 */
  ------------------
  |  Branch (1215:27): [True: 1.09k, False: 1.05k]
  ------------------
 1216|       |
 1217|       |    /* Get start index of each weight */
 1218|  1.05k|    {   U32 w, nextRankStart = 0;
 1219|  7.70k|        for (w=1; w<maxW+1; w++) {
  ------------------
  |  Branch (1219:19): [True: 6.64k, False: 1.05k]
  ------------------
 1220|  6.64k|            U32 curr = nextRankStart;
 1221|  6.64k|            nextRankStart += wksp->rankStats[w];
 1222|  6.64k|            rankStart[w] = curr;
 1223|  6.64k|        }
 1224|  1.05k|        rankStart[0] = nextRankStart;   /* put all 0w symbols at the end of sorted list*/
 1225|  1.05k|        rankStart[maxW+1] = nextRankStart;
 1226|  1.05k|    }
 1227|       |
 1228|       |    /* sort symbols by weight */
 1229|  1.05k|    {   U32 s;
 1230|  72.5k|        for (s=0; s<nbSymbols; s++) {
  ------------------
  |  Branch (1230:19): [True: 71.5k, False: 1.05k]
  ------------------
 1231|  71.5k|            U32 const w = wksp->weightList[s];
 1232|  71.5k|            U32 const r = rankStart[w]++;
 1233|  71.5k|            wksp->sortedSymbol[r].symbol = (BYTE)s;
 1234|  71.5k|        }
 1235|  1.05k|        rankStart[0] = 0;   /* forget 0w symbols; this is beginning of weight(1) */
 1236|  1.05k|    }
 1237|       |
 1238|       |    /* Build rankVal */
 1239|  1.05k|    {   U32* const rankVal0 = wksp->rankVal[0];
 1240|  1.05k|        {   int const rescale = (maxTableLog-tableLog) - 1;   /* tableLog <= maxTableLog */
 1241|  1.05k|            U32 nextRankVal = 0;
 1242|  1.05k|            U32 w;
 1243|  7.70k|            for (w=1; w<maxW+1; w++) {
  ------------------
  |  Branch (1243:23): [True: 6.64k, False: 1.05k]
  ------------------
 1244|  6.64k|                U32 curr = nextRankVal;
 1245|  6.64k|                nextRankVal += wksp->rankStats[w] << (w+rescale);
 1246|  6.64k|                rankVal0[w] = curr;
 1247|  6.64k|        }   }
 1248|  1.05k|        {   U32 const minBits = tableLog+1 - maxW;
 1249|  1.05k|            U32 consumed;
 1250|  9.64k|            for (consumed = minBits; consumed < maxTableLog - minBits + 1; consumed++) {
  ------------------
  |  Branch (1250:38): [True: 8.58k, False: 1.05k]
  ------------------
 1251|  8.58k|                U32* const rankValPtr = wksp->rankVal[consumed];
 1252|  8.58k|                U32 w;
 1253|  67.0k|                for (w = 1; w < maxW+1; w++) {
  ------------------
  |  Branch (1253:29): [True: 58.4k, False: 8.58k]
  ------------------
 1254|  58.4k|                    rankValPtr[w] = rankVal0[w] >> consumed;
 1255|  58.4k|    }   }   }   }
 1256|       |
 1257|  1.05k|    HUF_fillDTableX2(dt, maxTableLog,
 1258|  1.05k|                   wksp->sortedSymbol,
 1259|  1.05k|                   wksp->rankStart0, wksp->rankVal, maxW,
 1260|  1.05k|                   tableLog+1);
 1261|       |
 1262|  1.05k|    dtd.tableLog = (BYTE)maxTableLog;
 1263|  1.05k|    dtd.tableType = 1;
 1264|  1.05k|    ZSTD_memcpy(DTable, &dtd, sizeof(dtd));
  ------------------
  |  |   44|  1.05k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1265|  1.05k|    return iSize;
 1266|  1.05k|}
HUF_selectDecoder:
 1836|  4.43k|{
 1837|  4.43k|    assert(dstSize > 0);
  ------------------
  |  |   70|  4.43k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1838|  4.43k|    assert(dstSize <= 128*1024);
  ------------------
  |  |   70|  4.43k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1839|       |#if defined(HUF_FORCE_DECOMPRESS_X1)
 1840|       |    (void)dstSize;
 1841|       |    (void)cSrcSize;
 1842|       |    return 0;
 1843|       |#elif defined(HUF_FORCE_DECOMPRESS_X2)
 1844|       |    (void)dstSize;
 1845|       |    (void)cSrcSize;
 1846|       |    return 1;
 1847|       |#else
 1848|       |    /* decoder timing evaluation */
 1849|  4.43k|    {   U32 const Q = (cSrcSize >= dstSize) ? 15 : (U32)(cSrcSize * 16 / dstSize);   /* Q < 16 */
  ------------------
  |  Branch (1849:23): [True: 1.08k, False: 3.35k]
  ------------------
 1850|  4.43k|        U32 const D256 = (U32)(dstSize >> 8);
 1851|  4.43k|        U32 const DTime0 = algoTime[Q][0].tableTime + (algoTime[Q][0].decode256Time * D256);
 1852|  4.43k|        U32 DTime1 = algoTime[Q][1].tableTime + (algoTime[Q][1].decode256Time * D256);
 1853|  4.43k|        DTime1 += DTime1 >> 5;  /* small advantage to algorithm using less memory, to reduce cache eviction */
 1854|  4.43k|        return DTime1 < DTime0;
 1855|  4.43k|    }
 1856|  4.43k|#endif
 1857|  4.43k|}
HUF_decompress1X_usingDTable:
 1891|    252|{
 1892|    252|    DTableDesc const dtd = HUF_getDTableDesc(DTable);
 1893|       |#if defined(HUF_FORCE_DECOMPRESS_X1)
 1894|       |    (void)dtd;
 1895|       |    assert(dtd.tableType == 0);
 1896|       |    return HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);
 1897|       |#elif defined(HUF_FORCE_DECOMPRESS_X2)
 1898|       |    (void)dtd;
 1899|       |    assert(dtd.tableType == 1);
 1900|       |    return HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);
 1901|       |#else
 1902|    252|    return dtd.tableType ? HUF_decompress1X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags) :
  ------------------
  |  Branch (1902:12): [True: 249, False: 3]
  ------------------
 1903|    252|                           HUF_decompress1X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);
 1904|    252|#endif
 1905|    252|}
HUF_decompress1X1_DCtx_wksp:
 1909|  2.18k|{
 1910|  2.18k|    const BYTE* ip = (const BYTE*) cSrc;
 1911|       |
 1912|  2.18k|    size_t const hSize = HUF_readDTableX1_wksp(dctx, cSrc, cSrcSize, workSpace, wkspSize, flags);
 1913|  2.18k|    if (HUF_isError(hSize)) return hSize;
  ------------------
  |  |   80|  2.18k|#define HUF_isError ERR_isError
  ------------------
  |  Branch (1913:9): [True: 235, False: 1.94k]
  ------------------
 1914|  1.94k|    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   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 (1914:9): [True: 49, False: 1.90k]
  ------------------
 1915|  1.90k|    ip += hSize; cSrcSize -= hSize;
 1916|       |
 1917|  1.90k|    return HUF_decompress1X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, flags);
 1918|  1.94k|}
HUF_decompress4X_usingDTable:
 1922|    367|{
 1923|    367|    DTableDesc const dtd = HUF_getDTableDesc(DTable);
 1924|       |#if defined(HUF_FORCE_DECOMPRESS_X1)
 1925|       |    (void)dtd;
 1926|       |    assert(dtd.tableType == 0);
 1927|       |    return HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);
 1928|       |#elif defined(HUF_FORCE_DECOMPRESS_X2)
 1929|       |    (void)dtd;
 1930|       |    assert(dtd.tableType == 1);
 1931|       |    return HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);
 1932|       |#else
 1933|    367|    return dtd.tableType ? HUF_decompress4X2_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags) :
  ------------------
  |  Branch (1933:12): [True: 343, False: 24]
  ------------------
 1934|    367|                           HUF_decompress4X1_usingDTable_internal(dst, maxDstSize, cSrc, cSrcSize, DTable, flags);
 1935|    367|#endif
 1936|    367|}
HUF_decompress4X_hufOnly_wksp:
 1939|  4.43k|{
 1940|       |    /* validation checks */
 1941|  4.43k|    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 (1941:9): [True: 0, False: 4.43k]
  ------------------
 1942|  4.43k|    if (cSrcSize == 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 (1942:9): [True: 5, False: 4.43k]
  ------------------
 1943|       |
 1944|  4.43k|    {   U32 const algoNb = HUF_selectDecoder(dstSize, cSrcSize);
 1945|       |#if defined(HUF_FORCE_DECOMPRESS_X1)
 1946|       |        (void)algoNb;
 1947|       |        assert(algoNb == 0);
 1948|       |        return HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags);
 1949|       |#elif defined(HUF_FORCE_DECOMPRESS_X2)
 1950|       |        (void)algoNb;
 1951|       |        assert(algoNb == 1);
 1952|       |        return HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags);
 1953|       |#else
 1954|  4.43k|        return algoNb ? HUF_decompress4X2_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags) :
  ------------------
  |  Branch (1954:16): [True: 162, False: 4.27k]
  ------------------
 1955|  4.43k|                        HUF_decompress4X1_DCtx_wksp(dctx, dst, dstSize, cSrc, cSrcSize, workSpace, wkspSize, flags);
 1956|  4.43k|#endif
 1957|  4.43k|    }
 1958|  4.43k|}
huf_decompress.c:HUF_getDTableDesc:
  147|  15.2k|{
  148|  15.2k|    DTableDesc dtd;
  149|  15.2k|    ZSTD_memcpy(&dtd, table, sizeof(dtd));
  ------------------
  |  |   44|  15.2k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  150|  15.2k|    return dtd;
  151|  15.2k|}
huf_decompress.c:HUF_rescaleStats:
  357|  6.09k|{
  358|  6.09k|    if (tableLog > targetTableLog)
  ------------------
  |  Branch (358:9): [True: 101, False: 5.99k]
  ------------------
  359|    101|        return tableLog;
  360|  5.99k|    if (tableLog < targetTableLog) {
  ------------------
  |  Branch (360:9): [True: 5.83k, False: 163]
  ------------------
  361|  5.83k|        U32 const scale = targetTableLog - tableLog;
  362|  5.83k|        U32 s;
  363|       |        /* Increase the weight for all non-zero probability symbols by scale. */
  364|   546k|        for (s = 0; s < nbSymbols; ++s) {
  ------------------
  |  Branch (364:21): [True: 540k, False: 5.83k]
  ------------------
  365|   540k|            huffWeight[s] += (BYTE)((huffWeight[s] == 0) ? 0 : scale);
  ------------------
  |  Branch (365:37): [True: 236k, False: 303k]
  ------------------
  366|   540k|        }
  367|       |        /* Update rankVal to reflect the new weights.
  368|       |         * All weights except 0 get moved to weight + scale.
  369|       |         * Weights [1, scale] are empty.
  370|       |         */
  371|  42.6k|        for (s = targetTableLog; s > scale; --s) {
  ------------------
  |  Branch (371:34): [True: 36.8k, False: 5.83k]
  ------------------
  372|  36.8k|            rankVal[s] = rankVal[s - scale];
  373|  36.8k|        }
  374|  33.1k|        for (s = scale; s > 0; --s) {
  ------------------
  |  Branch (374:25): [True: 27.3k, False: 5.83k]
  ------------------
  375|  27.3k|            rankVal[s] = 0;
  376|  27.3k|        }
  377|  5.83k|    }
  378|  5.99k|    return targetTableLog;
  379|  6.09k|}
huf_decompress.c:HUF_DEltX1_set4:
  339|   305k|static U64 HUF_DEltX1_set4(BYTE symbol, BYTE nbBits) {
  340|   305k|    U64 D4;
  341|   305k|    if (MEM_isLittleEndian()) {
  ------------------
  |  Branch (341:9): [True: 305k, False: 0]
  ------------------
  342|   305k|        D4 = (U64)((symbol << 8) + nbBits);
  343|   305k|    } else {
  344|      0|        D4 = (U64)(symbol + (nbBits << 8));
  345|      0|    }
  346|   305k|    assert(D4 < (1U << 16));
  ------------------
  |  |   70|   305k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  347|   305k|    D4 *= 0x0001000100010001ULL;
  348|   305k|    return D4;
  349|   305k|}
huf_decompress.c:HUF_fillDTableX2:
 1132|  1.05k|{
 1133|  1.05k|    U32* const rankVal = rankValOrigin[0];
 1134|  1.05k|    const int scaleLog = nbBitsBaseline - targetLog;   /* note : targetLog >= srcLog, hence scaleLog <= 1 */
 1135|  1.05k|    const U32 minBits  = nbBitsBaseline - maxWeight;
 1136|  1.05k|    int w;
 1137|  1.05k|    int const wEnd = (int)maxWeight + 1;
 1138|       |
 1139|       |    /* Fill DTable in order of weight. */
 1140|  7.70k|    for (w = 1; w < wEnd; ++w) {
  ------------------
  |  Branch (1140:17): [True: 6.64k, False: 1.05k]
  ------------------
 1141|  6.64k|        int const begin = (int)rankStart[w];
 1142|  6.64k|        int const end = (int)rankStart[w+1];
 1143|  6.64k|        U32 const nbBits = nbBitsBaseline - w;
 1144|       |
 1145|  6.64k|        if (targetLog-nbBits >= minBits) {
  ------------------
  |  Branch (1145:13): [True: 5.84k, False: 803]
  ------------------
 1146|       |            /* Enough room for a second symbol. */
 1147|  5.84k|            int start = rankVal[w];
 1148|  5.84k|            U32 const length = 1U << ((targetLog - nbBits) & 0x1F /* quiet static-analyzer */);
 1149|  5.84k|            int minWeight = nbBits + scaleLog;
 1150|  5.84k|            int s;
 1151|  5.84k|            if (minWeight < 1) minWeight = 1;
  ------------------
  |  Branch (1151:17): [True: 1.20k, False: 4.63k]
  ------------------
 1152|       |            /* Fill the DTable for every symbol of weight w.
 1153|       |             * These symbols get at least 1 second symbol.
 1154|       |             */
 1155|  39.9k|            for (s = begin; s != end; ++s) {
  ------------------
  |  Branch (1155:29): [True: 34.1k, False: 5.84k]
  ------------------
 1156|  34.1k|                HUF_fillDTableX2Level2(
 1157|  34.1k|                    DTable + start, targetLog, nbBits,
 1158|  34.1k|                    rankValOrigin[nbBits], minWeight, wEnd,
 1159|  34.1k|                    sortedList, rankStart,
 1160|  34.1k|                    nbBitsBaseline, sortedList[s].symbol);
 1161|  34.1k|                start += length;
 1162|  34.1k|            }
 1163|  5.84k|        } else {
 1164|       |            /* Only a single symbol. */
 1165|    803|            HUF_fillDTableX2ForWeight(
 1166|    803|                DTable + rankVal[w],
 1167|    803|                sortedList + begin, sortedList + end,
 1168|    803|                nbBits, targetLog,
 1169|    803|                /* baseSeq */ 0, /* level */ 1);
 1170|    803|        }
 1171|  6.64k|    }
 1172|  1.05k|}
huf_decompress.c:HUF_fillDTableX2Level2:
 1077|  34.1k|{
 1078|       |    /* Fill skipped values (all positions up to rankVal[minWeight]).
 1079|       |     * These are positions only get a single symbol because the combined weight
 1080|       |     * is too large.
 1081|       |     */
 1082|  34.1k|    if (minWeight>1) {
  ------------------
  |  Branch (1082:9): [True: 30.4k, False: 3.68k]
  ------------------
 1083|  30.4k|        U32 const length = 1U << ((targetLog - consumedBits) & 0x1F /* quiet static-analyzer */);
 1084|  30.4k|        U64 const DEltX2 = HUF_buildDEltX2U64(baseSeq, consumedBits, /* baseSeq */ 0, /* level */ 1);
 1085|  30.4k|        int const skipSize = rankVal[minWeight];
 1086|  30.4k|        assert(length > 1);
  ------------------
  |  |   70|  30.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1087|  30.4k|        assert((U32)skipSize < length);
  ------------------
  |  |   70|  30.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1088|  30.4k|        switch (length) {
 1089|  1.38k|        case 2:
  ------------------
  |  Branch (1089:9): [True: 1.38k, False: 29.0k]
  ------------------
 1090|  1.38k|            assert(skipSize == 1);
  ------------------
  |  |   70|  1.38k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1091|  1.38k|            ZSTD_memcpy(DTable, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  1.38k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1092|  1.38k|            break;
 1093|  1.85k|        case 4:
  ------------------
  |  Branch (1093:9): [True: 1.85k, False: 28.6k]
  ------------------
 1094|  1.85k|            assert(skipSize <= 4);
  ------------------
  |  |   70|  1.85k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1095|  1.85k|            ZSTD_memcpy(DTable + 0, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  1.85k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1096|  1.85k|            ZSTD_memcpy(DTable + 2, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  1.85k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1097|  1.85k|            break;
 1098|  27.2k|        default:
  ------------------
  |  Branch (1098:9): [True: 27.2k, False: 3.24k]
  ------------------
 1099|  27.2k|            {
 1100|  27.2k|                int i;
 1101|  70.8k|                for (i = 0; i < skipSize; i += 8) {
  ------------------
  |  Branch (1101:29): [True: 43.6k, False: 27.2k]
  ------------------
 1102|  43.6k|                    ZSTD_memcpy(DTable + i + 0, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  43.6k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1103|  43.6k|                    ZSTD_memcpy(DTable + i + 2, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  43.6k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1104|  43.6k|                    ZSTD_memcpy(DTable + i + 4, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  43.6k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1105|  43.6k|                    ZSTD_memcpy(DTable + i + 6, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  43.6k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1106|  43.6k|                }
 1107|  27.2k|            }
 1108|  30.4k|        }
 1109|  30.4k|    }
 1110|       |
 1111|       |    /* Fill each of the second level symbols by weight. */
 1112|  34.1k|    {
 1113|  34.1k|        int w;
 1114|   137k|        for (w = minWeight; w < maxWeight1; ++w) {
  ------------------
  |  Branch (1114:29): [True: 102k, False: 34.1k]
  ------------------
 1115|   102k|            int const begin = rankStart[w];
 1116|   102k|            int const end = rankStart[w+1];
 1117|   102k|            U32 const nbBits = nbBitsBaseline - w;
 1118|   102k|            U32 const totalBits = nbBits + consumedBits;
 1119|   102k|            HUF_fillDTableX2ForWeight(
 1120|   102k|                DTable + rankVal[w],
 1121|   102k|                sortedSymbols + begin, sortedSymbols + end,
 1122|   102k|                totalBits, targetLog,
 1123|   102k|                baseSeq, /* level */ 2);
 1124|   102k|        }
 1125|  34.1k|    }
 1126|  34.1k|}
huf_decompress.c:HUF_buildDEltX2U64:
  997|   115k|{
  998|   115k|    U32 DElt = HUF_buildDEltX2U32(symbol, nbBits, baseSeq, level);
  999|   115k|    return (U64)DElt + ((U64)DElt << 32);
 1000|   115k|}
huf_decompress.c:HUF_buildDEltX2U32:
  966|   282k|{
  967|   282k|    U32 seq;
  968|   282k|    DEBUG_STATIC_ASSERT(offsetof(HUF_DEltX2, sequence) == 0);
  ------------------
  |  |   39|   282k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  969|   282k|    DEBUG_STATIC_ASSERT(offsetof(HUF_DEltX2, nbBits) == 2);
  ------------------
  |  |   39|   282k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  970|   282k|    DEBUG_STATIC_ASSERT(offsetof(HUF_DEltX2, length) == 3);
  ------------------
  |  |   39|   282k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  971|   282k|    DEBUG_STATIC_ASSERT(sizeof(HUF_DEltX2) == sizeof(U32));
  ------------------
  |  |   39|   282k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  972|   282k|    if (MEM_isLittleEndian()) {
  ------------------
  |  Branch (972:9): [True: 282k, False: 0]
  ------------------
  973|   282k|        seq = level == 1 ? symbol : (baseSeq + (symbol << 8));
  ------------------
  |  Branch (973:15): [True: 46.3k, False: 235k]
  ------------------
  974|   282k|        return seq + (nbBits << 16) + ((U32)level << 24);
  975|   282k|    } else {
  976|      0|        seq = level == 1 ? (symbol << 8) : ((baseSeq << 8) + symbol);
  ------------------
  |  Branch (976:15): [True: 0, False: 0]
  ------------------
  977|      0|        return (seq << 16) + (nbBits << 8) + (U32)level;
  978|      0|    }
  979|   282k|}
huf_decompress.c:HUF_fillDTableX2ForWeight:
 1019|   103k|{
 1020|   103k|    U32 const length = 1U << ((tableLog - nbBits) & 0x1F /* quiet static-analyzer */);
 1021|   103k|    const sortedSymbol_t* ptr;
 1022|   103k|    assert(level >= 1 && level <= 2);
  ------------------
  |  |   70|   103k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1023|   103k|    switch (length) {
 1024|  31.6k|    case 1:
  ------------------
  |  Branch (1024:5): [True: 31.6k, False: 72.0k]
  ------------------
 1025|   117k|        for (ptr = begin; ptr != end; ++ptr) {
  ------------------
  |  Branch (1025:27): [True: 85.8k, False: 31.6k]
  ------------------
 1026|  85.8k|            HUF_DEltX2 const DElt = HUF_buildDEltX2(ptr->symbol, nbBits, baseSeq, level);
 1027|  85.8k|            *DTableRank++ = DElt;
 1028|  85.8k|        }
 1029|  31.6k|        break;
 1030|  23.8k|    case 2:
  ------------------
  |  Branch (1030:5): [True: 23.8k, False: 79.9k]
  ------------------
 1031|   104k|        for (ptr = begin; ptr != end; ++ptr) {
  ------------------
  |  Branch (1031:27): [True: 80.6k, False: 23.8k]
  ------------------
 1032|  80.6k|            HUF_DEltX2 const DElt = HUF_buildDEltX2(ptr->symbol, nbBits, baseSeq, level);
 1033|  80.6k|            DTableRank[0] = DElt;
 1034|  80.6k|            DTableRank[1] = DElt;
 1035|  80.6k|            DTableRank += 2;
 1036|  80.6k|        }
 1037|  23.8k|        break;
 1038|  18.7k|    case 4:
  ------------------
  |  Branch (1038:5): [True: 18.7k, False: 84.9k]
  ------------------
 1039|  49.4k|        for (ptr = begin; ptr != end; ++ptr) {
  ------------------
  |  Branch (1039:27): [True: 30.6k, False: 18.7k]
  ------------------
 1040|  30.6k|            U64 const DEltX2 = HUF_buildDEltX2U64(ptr->symbol, nbBits, baseSeq, level);
 1041|  30.6k|            ZSTD_memcpy(DTableRank + 0, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  30.6k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1042|  30.6k|            ZSTD_memcpy(DTableRank + 2, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  30.6k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1043|  30.6k|            DTableRank += 4;
 1044|  30.6k|        }
 1045|  18.7k|        break;
 1046|  13.8k|    case 8:
  ------------------
  |  Branch (1046:5): [True: 13.8k, False: 89.9k]
  ------------------
 1047|  43.1k|        for (ptr = begin; ptr != end; ++ptr) {
  ------------------
  |  Branch (1047:27): [True: 29.2k, False: 13.8k]
  ------------------
 1048|  29.2k|            U64 const DEltX2 = HUF_buildDEltX2U64(ptr->symbol, nbBits, baseSeq, level);
 1049|  29.2k|            ZSTD_memcpy(DTableRank + 0, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  29.2k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1050|  29.2k|            ZSTD_memcpy(DTableRank + 2, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  29.2k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1051|  29.2k|            ZSTD_memcpy(DTableRank + 4, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  29.2k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1052|  29.2k|            ZSTD_memcpy(DTableRank + 6, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|  29.2k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1053|  29.2k|            DTableRank += 8;
 1054|  29.2k|        }
 1055|  13.8k|        break;
 1056|  15.6k|    default:
  ------------------
  |  Branch (1056:5): [True: 15.6k, False: 88.0k]
  ------------------
 1057|  41.1k|        for (ptr = begin; ptr != end; ++ptr) {
  ------------------
  |  Branch (1057:27): [True: 25.4k, False: 15.6k]
  ------------------
 1058|  25.4k|            U64 const DEltX2 = HUF_buildDEltX2U64(ptr->symbol, nbBits, baseSeq, level);
 1059|  25.4k|            HUF_DEltX2* const DTableRankEnd = DTableRank + length;
 1060|   229k|            for (; DTableRank != DTableRankEnd; DTableRank += 8) {
  ------------------
  |  Branch (1060:20): [True: 203k, False: 25.4k]
  ------------------
 1061|   203k|                ZSTD_memcpy(DTableRank + 0, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|   203k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1062|   203k|                ZSTD_memcpy(DTableRank + 2, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|   203k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1063|   203k|                ZSTD_memcpy(DTableRank + 4, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|   203k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1064|   203k|                ZSTD_memcpy(DTableRank + 6, &DEltX2, sizeof(DEltX2));
  ------------------
  |  |   44|   203k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1065|   203k|            }
 1066|  25.4k|        }
 1067|  15.6k|        break;
 1068|   103k|    }
 1069|   103k|}
huf_decompress.c:HUF_buildDEltX2:
  985|   166k|{
  986|   166k|    HUF_DEltX2 DElt;
  987|   166k|    U32 const val = HUF_buildDEltX2U32(symbol, nbBits, baseSeq, level);
  988|   166k|    DEBUG_STATIC_ASSERT(sizeof(DElt) == sizeof(val));
  ------------------
  |  |   39|   166k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  ------------------
  989|   166k|    ZSTD_memcpy(&DElt, &val, sizeof(val));
  ------------------
  |  |   44|   166k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  990|   166k|    return DElt;
  991|   166k|}
huf_decompress.c:HUF_decompress1X2_usingDTable_internal:
  120|    249|    {                                                                       \
  121|    249|        if (ZSTD_USE_BMI2(flags & HUF_flags_bmi2)) {                        \
  ------------------
  |  |   36|    249|#  define ZSTD_USE_BMI2(bmi2) (bmi2)
  |  |  ------------------
  |  |  |  Branch (36:31): [True: 249, False: 0]
  |  |  ------------------
  ------------------
  122|    249|            return fn##_bmi2(dst, dstSize, cSrc, cSrcSize, DTable);         \
  123|    249|        }                                                                   \
  124|    249|        (void)flags;                                                        \
  125|      0|        return fn##_default(dst, dstSize, cSrc, cSrcSize, DTable);          \
  126|    249|    }
huf_decompress.c:HUF_decompress1X2_usingDTable_internal_bmi2:
  114|    249|    {                                                                       \
  115|    249|        return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable);             \
  116|    249|    }                                                                       \
huf_decompress.c:HUF_decompress1X2_usingDTable_internal_body:
 1363|    249|{
 1364|    249|    BIT_DStream_t bitD;
 1365|       |
 1366|       |    /* Init */
 1367|    249|    CHECK_F( BIT_initDStream(&bitD, cSrc, cSrcSize) );
  ------------------
  |  |   63|    249|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    249|    size_t const e = f;     \
  |  |  |  |   59|    249|    do {                    \
  |  |  |  |   60|    249|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 7, False: 242]
  |  |  |  |  ------------------
  |  |  |  |   61|    249|            return e;       \
  |  |  |  |   62|    249|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 242]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 242]
  |  |  ------------------
  ------------------
 1368|       |
 1369|       |    /* decode */
 1370|    242|    {   BYTE* const ostart = (BYTE*) dst;
 1371|    242|        BYTE* const oend = (BYTE*)ZSTD_maybeNullPtrAdd(ostart, (ptrdiff_t)dstSize);
 1372|    242|        const void* const dtPtr = DTable+1;   /* force compiler to not use strict-aliasing */
 1373|    242|        const HUF_DEltX2* const dt = (const HUF_DEltX2*)dtPtr;
 1374|    242|        DTableDesc const dtd = HUF_getDTableDesc(DTable);
 1375|    242|        HUF_decodeStreamX2(ostart, &bitD, oend, dt, dtd.tableLog);
 1376|    242|    }
 1377|       |
 1378|       |    /* check */
 1379|    242|    if (!BIT_endOfDStream(&bitD)) return ERROR(corruption_detected);
  ------------------
  |  |   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 (1379:9): [True: 63, False: 179]
  ------------------
 1380|       |
 1381|       |    /* decoded size */
 1382|    179|    return dstSize;
 1383|    242|}
huf_decompress.c:HUF_decodeStreamX2:
 1314|  1.99k|{
 1315|  1.99k|    BYTE* const pStart = p;
 1316|       |
 1317|       |    /* up to 8 symbols at a time */
 1318|  1.99k|    if ((size_t)(pEnd - p) >= sizeof(bitDPtr->bitContainer)) {
  ------------------
  |  Branch (1318:9): [True: 1.62k, False: 369]
  ------------------
 1319|  1.62k|        if (dtLog <= 11 && MEM_64bits()) {
  ------------------
  |  Branch (1319:13): [True: 1.15k, False: 470]
  |  Branch (1319:28): [True: 1.15k, False: 0]
  ------------------
 1320|       |            /* up to 10 symbols at a time */
 1321|       |            /* For an 8-byte output, pEnd - 9 would precede the buffer. */
 1322|  1.15k|            BYTE* const pLimit = (size_t)(pEnd - p) >= 10 ? pEnd - 9 : p;
  ------------------
  |  Branch (1322:34): [True: 994, False: 158]
  ------------------
 1323|   258k|            while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pLimit)) {
  ------------------
  |  Branch (1323:20): [True: 257k, False: 1.15k]
  ------------------
 1324|   257k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1297|   257k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1297:74): [Folded, False: 257k]
  |  |  ------------------
  ------------------
 1325|   257k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1297|   257k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1297:74): [Folded, False: 257k]
  |  |  ------------------
  ------------------
 1326|   257k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1297|   257k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1297:74): [Folded, False: 257k]
  |  |  ------------------
  ------------------
 1327|   257k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1297|   257k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1297:74): [Folded, False: 257k]
  |  |  ------------------
  ------------------
 1328|   257k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1297|   257k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1297:74): [Folded, False: 257k]
  |  |  ------------------
  ------------------
 1329|   257k|            }
 1330|  1.15k|        } else {
 1331|       |            /* up to 8 symbols at a time */
 1332|   125k|            while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-(sizeof(bitDPtr->bitContainer)-1))) {
  ------------------
  |  Branch (1332:20): [True: 125k, False: 470]
  ------------------
 1333|   125k|                HUF_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1306|   125k|    do {                                                           \
  |  | 1307|   125k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1307:13): [True: 125k, False: 0]
  |  |  ------------------
  |  | 1308|   125k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1309|   125k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1309:14): [Folded, False: 125k]
  |  |  ------------------
  ------------------
 1334|   125k|                HUF_DECODE_SYMBOLX2_1(p, bitDPtr);
  ------------------
  |  | 1300|   125k|    do {                                                           \
  |  | 1301|   125k|        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 (1301:13): [True: 125k, False: 0]
  |  |  |  Branch (1301:29): [True: 0, Folded]
  |  |  ------------------
  |  | 1302|   125k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1303|   125k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1303:14): [Folded, False: 125k]
  |  |  ------------------
  ------------------
 1335|   125k|                HUF_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1306|   125k|    do {                                                           \
  |  | 1307|   125k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1307:13): [True: 125k, False: 0]
  |  |  ------------------
  |  | 1308|   125k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1309|   125k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1309:14): [Folded, False: 125k]
  |  |  ------------------
  ------------------
 1336|   125k|                HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1297|   125k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1297:74): [Folded, False: 125k]
  |  |  ------------------
  ------------------
 1337|   125k|            }
 1338|    470|        }
 1339|  1.62k|    } else {
 1340|    369|        BIT_reloadDStream(bitDPtr);
 1341|    369|    }
 1342|       |
 1343|       |    /* closer to end : up to 2 symbols at a time */
 1344|  1.99k|    if ((size_t)(pEnd - p) >= 2) {
  ------------------
  |  Branch (1344:9): [True: 1.81k, False: 179]
  ------------------
 1345|  4.37k|        while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p <= pEnd-2))
  ------------------
  |  Branch (1345:16): [True: 2.55k, False: 1.81k]
  ------------------
 1346|  2.55k|            HUF_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1297|  2.55k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1297:74): [Folded, False: 2.55k]
  |  |  ------------------
  ------------------
 1347|       |
 1348|  2.71M|        while (p <= pEnd-2)
  ------------------
  |  Branch (1348:16): [True: 2.71M, False: 1.81k]
  ------------------
 1349|  2.71M|            HUF_DECODE_SYMBOLX2_0(p, bitDPtr);   /* no need to reload : reached the end of DStream */
  ------------------
  |  | 1297|  2.71M|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1297:74): [Folded, False: 2.71M]
  |  |  ------------------
  ------------------
 1350|  1.81k|    }
 1351|       |
 1352|  1.99k|    if (p < pEnd)
  ------------------
  |  Branch (1352:9): [True: 1.47k, False: 513]
  ------------------
 1353|  1.47k|        p += HUF_decodeLastSymbolX2(p, bitDPtr, dt, dtLog);
 1354|       |
 1355|  1.99k|    return p-pStart;
 1356|  1.99k|}
huf_decompress.c:HUF_decodeSymbolX2:
 1271|  4.84M|{
 1272|  4.84M|    size_t const val = BIT_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */
 1273|  4.84M|    ZSTD_memcpy(op, &dt[val].sequence, 2);
  ------------------
  |  |   44|  4.84M|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1274|  4.84M|    BIT_skipBits(DStream, dt[val].nbBits);
 1275|  4.84M|    return dt[val].length;
 1276|  4.84M|}
huf_decompress.c:HUF_decodeLastSymbolX2:
 1280|  1.47k|{
 1281|  1.47k|    size_t const val = BIT_lookBitsFast(DStream, dtLog);   /* note : dtLog >= 1 */
 1282|  1.47k|    ZSTD_memcpy(op, &dt[val].sequence, 1);
  ------------------
  |  |   44|  1.47k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1283|  1.47k|    if (dt[val].length==1) {
  ------------------
  |  Branch (1283:9): [True: 713, False: 765]
  ------------------
 1284|    713|        BIT_skipBits(DStream, dt[val].nbBits);
 1285|    765|    } else {
 1286|    765|        if (DStream->bitsConsumed < (sizeof(DStream->bitContainer)*8)) {
  ------------------
  |  Branch (1286:13): [True: 491, False: 274]
  ------------------
 1287|    491|            BIT_skipBits(DStream, dt[val].nbBits);
 1288|    491|            if (DStream->bitsConsumed > (sizeof(DStream->bitContainer)*8))
  ------------------
  |  Branch (1288:17): [True: 62, False: 429]
  ------------------
 1289|       |                /* ugly hack; works only because it's the last symbol. Note : can't easily extract nbBits from just this symbol */
 1290|     62|                DStream->bitsConsumed = (sizeof(DStream->bitContainer)*8);
 1291|    491|        }
 1292|    765|    }
 1293|  1.47k|    return 1;
 1294|  1.47k|}
huf_decompress.c:HUF_decompress1X1_usingDTable_internal:
  120|  1.90k|    {                                                                       \
  121|  1.90k|        if (ZSTD_USE_BMI2(flags & HUF_flags_bmi2)) {                        \
  ------------------
  |  |   36|  1.90k|#  define ZSTD_USE_BMI2(bmi2) (bmi2)
  |  |  ------------------
  |  |  |  Branch (36:31): [True: 1.90k, False: 0]
  |  |  ------------------
  ------------------
  122|  1.90k|            return fn##_bmi2(dst, dstSize, cSrc, cSrcSize, DTable);         \
  123|  1.90k|        }                                                                   \
  124|  1.90k|        (void)flags;                                                        \
  125|      0|        return fn##_default(dst, dstSize, cSrc, cSrcSize, DTable);          \
  126|  1.90k|    }
huf_decompress.c:HUF_decompress1X1_usingDTable_internal_bmi2:
  114|  1.90k|    {                                                                       \
  115|  1.90k|        return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable);             \
  116|  1.90k|    }                                                                       \
huf_decompress.c:HUF_decompress1X1_usingDTable_internal_body:
  583|  1.90k|{
  584|  1.90k|    BYTE* op = (BYTE*)dst;
  585|  1.90k|    BYTE* const oend = (BYTE*)ZSTD_maybeNullPtrAdd(op, (ptrdiff_t)dstSize);
  586|  1.90k|    const void* dtPtr = DTable + 1;
  587|  1.90k|    const HUF_DEltX1* const dt = (const HUF_DEltX1*)dtPtr;
  588|  1.90k|    BIT_DStream_t bitD;
  589|  1.90k|    DTableDesc const dtd = HUF_getDTableDesc(DTable);
  590|  1.90k|    U32 const dtLog = dtd.tableLog;
  591|       |
  592|  1.90k|    CHECK_F( BIT_initDStream(&bitD, cSrc, cSrcSize) );
  ------------------
  |  |   63|  1.90k|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|  1.90k|    size_t const e = f;     \
  |  |  |  |   59|  1.90k|    do {                    \
  |  |  |  |   60|  1.90k|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 7, False: 1.89k]
  |  |  |  |  ------------------
  |  |  |  |   61|  1.90k|            return e;       \
  |  |  |  |   62|  1.90k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 1.89k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 1.89k]
  |  |  ------------------
  ------------------
  593|       |
  594|  1.89k|    HUF_decodeStreamX1(op, &bitD, oend, dt, dtLog);
  595|       |
  596|  1.89k|    if (!BIT_endOfDStream(&bitD)) return ERROR(corruption_detected);
  ------------------
  |  |   49|     62|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     62|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     62|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (596:9): [True: 62, False: 1.83k]
  ------------------
  597|       |
  598|  1.83k|    return dstSize;
  599|  1.89k|}
huf_decompress.c:HUF_decodeStreamX1:
  551|  17.9k|{
  552|  17.9k|    BYTE* const pStart = p;
  553|       |
  554|       |    /* up to 4 symbols at a time */
  555|  17.9k|    if ((pEnd - p) > 3) {
  ------------------
  |  Branch (555:9): [True: 16.1k, False: 1.88k]
  ------------------
  556|   200k|        while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd-3)) {
  ------------------
  |  Branch (556:16): [True: 184k, False: 16.1k]
  ------------------
  557|   184k|            HUF_DECODE_SYMBOLX1_2(p, bitDPtr);
  ------------------
  |  |  544|   184k|    do {                                            \
  |  |  545|   184k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (545:13): [True: 184k, False: 0]
  |  |  ------------------
  |  |  546|   184k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  535|   184k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (535:71): [Folded, False: 184k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  547|   184k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (547:14): [Folded, False: 184k]
  |  |  ------------------
  ------------------
  558|   184k|            HUF_DECODE_SYMBOLX1_1(p, bitDPtr);
  ------------------
  |  |  538|   184k|    do {                                            \
  |  |  539|   184k|        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 (539:13): [True: 184k, False: 0]
  |  |  |  Branch (539:29): [True: 0, Folded]
  |  |  ------------------
  |  |  540|   184k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  535|   184k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (535:71): [Folded, False: 184k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  541|   184k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (541:14): [Folded, False: 184k]
  |  |  ------------------
  ------------------
  559|   184k|            HUF_DECODE_SYMBOLX1_2(p, bitDPtr);
  ------------------
  |  |  544|   184k|    do {                                            \
  |  |  545|   184k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (545:13): [True: 184k, False: 0]
  |  |  ------------------
  |  |  546|   184k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  535|   184k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (535:71): [Folded, False: 184k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  547|   184k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (547:14): [Folded, False: 184k]
  |  |  ------------------
  ------------------
  560|   184k|            HUF_DECODE_SYMBOLX1_0(p, bitDPtr);
  ------------------
  |  |  535|   184k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (535:71): [Folded, False: 184k]
  |  |  ------------------
  ------------------
  561|   184k|        }
  562|  16.1k|    } else {
  563|  1.88k|        BIT_reloadDStream(bitDPtr);
  564|  1.88k|    }
  565|       |
  566|       |    /* [0-3] symbols remaining */
  567|  17.9k|    if (MEM_32bits())
  ------------------
  |  Branch (567:9): [True: 0, False: 17.9k]
  ------------------
  568|      0|        while ((BIT_reloadDStream(bitDPtr) == BIT_DStream_unfinished) & (p < pEnd))
  ------------------
  |  Branch (568:16): [True: 0, False: 0]
  ------------------
  569|      0|            HUF_DECODE_SYMBOLX1_0(p, bitDPtr);
  ------------------
  |  |  535|      0|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (535:71): [Folded, False: 0]
  |  |  ------------------
  ------------------
  570|       |
  571|       |    /* no more data to retrieve from bitstream, no need to reload */
  572|   401k|    while (p < pEnd)
  ------------------
  |  Branch (572:12): [True: 383k, False: 17.9k]
  ------------------
  573|   383k|        HUF_DECODE_SYMBOLX1_0(p, bitDPtr);
  ------------------
  |  |  535|   383k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (535:71): [Folded, False: 383k]
  |  |  ------------------
  ------------------
  574|       |
  575|  17.9k|    return (size_t)(pEnd-pStart);
  576|  17.9k|}
huf_decompress.c:HUF_decodeSymbolX1:
  527|  1.30M|{
  528|  1.30M|    size_t const val = BIT_lookBitsFast(Dstream, dtLog); /* note : dtLog >= 1 */
  529|  1.30M|    BYTE const c = dt[val].byte;
  530|  1.30M|    BIT_skipBits(Dstream, dt[val].nbBits);
  531|  1.30M|    return c;
  532|  1.30M|}
huf_decompress.c:HUF_decompress4X2_usingDTable_internal:
 1737|    503|{
 1738|    503|    HUF_DecompressUsingDTableFn fallbackFn = HUF_decompress4X2_usingDTable_internal_default;
 1739|    503|    HUF_DecompressFastLoopFn loopFn = HUF_decompress4X2_usingDTable_internal_fast_c_loop;
 1740|       |
 1741|    503|    if (ZSTD_USE_BMI2(flags & HUF_flags_bmi2)) {
  ------------------
  |  |   36|    503|#  define ZSTD_USE_BMI2(bmi2) (bmi2)
  |  |  ------------------
  |  |  |  Branch (36:31): [True: 503, False: 0]
  |  |  ------------------
  ------------------
 1742|    503|        fallbackFn = HUF_decompress4X2_usingDTable_internal_bmi2;
 1743|    503|# if ZSTD_ENABLE_ASM_X86_64_BMI2
 1744|    503|        if (!(flags & HUF_flags_disableAsm)) {
  ------------------
  |  Branch (1744:13): [True: 503, False: 0]
  ------------------
 1745|    503|            loopFn = HUF_decompress4X2_usingDTable_internal_fast_asm_loop;
 1746|    503|        }
 1747|    503|# endif
 1748|    503|    } else if (DYNAMIC_BMI2) {
  ------------------
  |  |   99|      0|#    define DYNAMIC_BMI2 1
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
 1749|      0|        return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable);
 1750|      0|    }
 1751|       |
 1752|       |#if ZSTD_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__)
 1753|       |    if (!(flags & HUF_flags_disableAsm)) {
 1754|       |        loopFn = HUF_decompress4X2_usingDTable_internal_fast_asm_loop;
 1755|       |    }
 1756|       |#endif
 1757|       |
 1758|    503|    if (HUF_ENABLE_FAST_DECODE && !(flags & HUF_flags_disableFast)) {
  ------------------
  |  |   42|  1.00k|# define HUF_ENABLE_FAST_DECODE 1
  |  |  ------------------
  |  |  |  Branch (42:33): [True: 503, Folded]
  |  |  ------------------
  ------------------
  |  Branch (1758:35): [True: 503, False: 0]
  ------------------
 1759|    503|        size_t const ret = HUF_decompress4X2_usingDTable_internal_fast(dst, dstSize, cSrc, cSrcSize, DTable, loopFn);
 1760|    503|        if (ret != 0)
  ------------------
  |  Branch (1760:13): [True: 209, False: 294]
  ------------------
 1761|    209|            return ret;
 1762|    503|    }
 1763|    294|    return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable);
 1764|    503|}
huf_decompress.c:HUF_decompress4X2_usingDTable_internal_body:
 1394|    294|{
 1395|    294|    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 (1395:9): [True: 0, False: 294]
  ------------------
 1396|    294|    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 (1396:9): [True: 0, False: 294]
  ------------------
 1397|       |
 1398|    294|    {   const BYTE* const istart = (const BYTE*) cSrc;
 1399|    294|        BYTE* const ostart = (BYTE*) dst;
 1400|    294|        BYTE* const oend = ostart + dstSize;
 1401|    294|        BYTE* const olimit = oend - (sizeof(size_t)-1);
 1402|    294|        const void* const dtPtr = DTable+1;
 1403|    294|        const HUF_DEltX2* const dt = (const HUF_DEltX2*)dtPtr;
 1404|       |
 1405|       |        /* Init */
 1406|    294|        BIT_DStream_t bitD1;
 1407|    294|        BIT_DStream_t bitD2;
 1408|    294|        BIT_DStream_t bitD3;
 1409|    294|        BIT_DStream_t bitD4;
 1410|    294|        size_t const length1 = MEM_readLE16(istart);
 1411|    294|        size_t const length2 = MEM_readLE16(istart+2);
 1412|    294|        size_t const length3 = MEM_readLE16(istart+4);
 1413|    294|        size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);
 1414|    294|        const BYTE* const istart1 = istart + 6;  /* jumpTable */
 1415|    294|        const BYTE* const istart2 = istart1 + length1;
 1416|    294|        const BYTE* const istart3 = istart2 + length2;
 1417|    294|        const BYTE* const istart4 = istart3 + length3;
 1418|    294|        size_t const segmentSize = (dstSize+3) / 4;
 1419|    294|        BYTE* const opStart2 = ostart + segmentSize;
 1420|    294|        BYTE* const opStart3 = opStart2 + segmentSize;
 1421|    294|        BYTE* const opStart4 = opStart3 + segmentSize;
 1422|    294|        BYTE* op1 = ostart;
 1423|    294|        BYTE* op2 = opStart2;
 1424|    294|        BYTE* op3 = opStart3;
 1425|    294|        BYTE* op4 = opStart4;
 1426|    294|        U32 endSignal = 1;
 1427|    294|        DTableDesc const dtd = HUF_getDTableDesc(DTable);
 1428|    294|        U32 const dtLog = dtd.tableLog;
 1429|       |
 1430|    294|        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 (1430:13): [True: 24, False: 270]
  ------------------
 1431|    270|        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 (1431:13): [True: 0, False: 270]
  ------------------
 1432|    270|        assert(dstSize >= 6 /* validated above */);
  ------------------
  |  |   70|    270|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1433|    270|        CHECK_F( BIT_initDStream(&bitD1, istart1, length1) );
  ------------------
  |  |   63|    270|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    270|    size_t const e = f;     \
  |  |  |  |   59|    270|    do {                    \
  |  |  |  |   60|    270|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 5, False: 265]
  |  |  |  |  ------------------
  |  |  |  |   61|    270|            return e;       \
  |  |  |  |   62|    270|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 265]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 265]
  |  |  ------------------
  ------------------
 1434|    265|        CHECK_F( BIT_initDStream(&bitD2, istart2, length2) );
  ------------------
  |  |   63|    265|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    265|    size_t const e = f;     \
  |  |  |  |   59|    265|    do {                    \
  |  |  |  |   60|    265|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 3, False: 262]
  |  |  |  |  ------------------
  |  |  |  |   61|    265|            return e;       \
  |  |  |  |   62|    265|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 262]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 262]
  |  |  ------------------
  ------------------
 1435|    262|        CHECK_F( BIT_initDStream(&bitD3, istart3, length3) );
  ------------------
  |  |   63|    262|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    262|    size_t const e = f;     \
  |  |  |  |   59|    262|    do {                    \
  |  |  |  |   60|    262|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 3, False: 259]
  |  |  |  |  ------------------
  |  |  |  |   61|    262|            return e;       \
  |  |  |  |   62|    262|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 259]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 259]
  |  |  ------------------
  ------------------
 1436|    259|        CHECK_F( BIT_initDStream(&bitD4, istart4, length4) );
  ------------------
  |  |   63|    259|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    259|    size_t const e = f;     \
  |  |  |  |   59|    259|    do {                    \
  |  |  |  |   60|    259|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 1, False: 258]
  |  |  |  |  ------------------
  |  |  |  |   61|    259|            return e;       \
  |  |  |  |   62|    259|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 258]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 258]
  |  |  ------------------
  ------------------
 1437|       |
 1438|       |        /* 16-32 symbols per loop (4-8 symbols per stream) */
 1439|    258|        if ((size_t)(oend - op4) >= sizeof(size_t)) {
  ------------------
  |  Branch (1439:13): [True: 231, False: 27]
  ------------------
 1440|  21.2k|            for ( ; (endSignal) & (op4 < olimit); ) {
  ------------------
  |  Branch (1440:21): [True: 21.0k, False: 231]
  ------------------
 1441|  21.0k|#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
 1442|  21.0k|                HUF_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 1306|  21.0k|    do {                                                           \
  |  | 1307|  21.0k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1307:13): [True: 21.0k, False: 0]
  |  |  ------------------
  |  | 1308|  21.0k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1309|  21.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1309:14): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
 1443|  21.0k|                HUF_DECODE_SYMBOLX2_1(op1, &bitD1);
  ------------------
  |  | 1300|  21.0k|    do {                                                           \
  |  | 1301|  21.0k|        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 (1301:13): [True: 21.0k, False: 0]
  |  |  |  Branch (1301:29): [True: 0, Folded]
  |  |  ------------------
  |  | 1302|  21.0k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1303|  21.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1303:14): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
 1444|  21.0k|                HUF_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 1306|  21.0k|    do {                                                           \
  |  | 1307|  21.0k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1307:13): [True: 21.0k, False: 0]
  |  |  ------------------
  |  | 1308|  21.0k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1309|  21.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1309:14): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
 1445|  21.0k|                HUF_DECODE_SYMBOLX2_0(op1, &bitD1);
  ------------------
  |  | 1297|  21.0k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1297:74): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
 1446|  21.0k|                HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 1306|  21.0k|    do {                                                           \
  |  | 1307|  21.0k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1307:13): [True: 21.0k, False: 0]
  |  |  ------------------
  |  | 1308|  21.0k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1309|  21.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1309:14): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
 1447|  21.0k|                HUF_DECODE_SYMBOLX2_1(op2, &bitD2);
  ------------------
  |  | 1300|  21.0k|    do {                                                           \
  |  | 1301|  21.0k|        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 (1301:13): [True: 21.0k, False: 0]
  |  |  |  Branch (1301:29): [True: 0, Folded]
  |  |  ------------------
  |  | 1302|  21.0k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1303|  21.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1303:14): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
 1448|  21.0k|                HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 1306|  21.0k|    do {                                                           \
  |  | 1307|  21.0k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1307:13): [True: 21.0k, False: 0]
  |  |  ------------------
  |  | 1308|  21.0k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1309|  21.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1309:14): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
 1449|  21.0k|                HUF_DECODE_SYMBOLX2_0(op2, &bitD2);
  ------------------
  |  | 1297|  21.0k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1297:74): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
 1450|  21.0k|                endSignal &= BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished;
 1451|  21.0k|                endSignal &= BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished;
 1452|  21.0k|                HUF_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 1306|  21.0k|    do {                                                           \
  |  | 1307|  21.0k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1307:13): [True: 21.0k, False: 0]
  |  |  ------------------
  |  | 1308|  21.0k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1309|  21.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1309:14): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
 1453|  21.0k|                HUF_DECODE_SYMBOLX2_1(op3, &bitD3);
  ------------------
  |  | 1300|  21.0k|    do {                                                           \
  |  | 1301|  21.0k|        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 (1301:13): [True: 21.0k, False: 0]
  |  |  |  Branch (1301:29): [True: 0, Folded]
  |  |  ------------------
  |  | 1302|  21.0k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1303|  21.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1303:14): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
 1454|  21.0k|                HUF_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 1306|  21.0k|    do {                                                           \
  |  | 1307|  21.0k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1307:13): [True: 21.0k, False: 0]
  |  |  ------------------
  |  | 1308|  21.0k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1309|  21.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1309:14): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
 1455|  21.0k|                HUF_DECODE_SYMBOLX2_0(op3, &bitD3);
  ------------------
  |  | 1297|  21.0k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1297:74): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
 1456|  21.0k|                HUF_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 1306|  21.0k|    do {                                                           \
  |  | 1307|  21.0k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1307:13): [True: 21.0k, False: 0]
  |  |  ------------------
  |  | 1308|  21.0k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1309|  21.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1309:14): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
 1457|  21.0k|                HUF_DECODE_SYMBOLX2_1(op4, &bitD4);
  ------------------
  |  | 1300|  21.0k|    do {                                                           \
  |  | 1301|  21.0k|        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 (1301:13): [True: 21.0k, False: 0]
  |  |  |  Branch (1301:29): [True: 0, Folded]
  |  |  ------------------
  |  | 1302|  21.0k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1303|  21.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1303:14): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
 1458|  21.0k|                HUF_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 1306|  21.0k|    do {                                                           \
  |  | 1307|  21.0k|        if (MEM_64bits())                                          \
  |  |  ------------------
  |  |  |  Branch (1307:13): [True: 21.0k, False: 0]
  |  |  ------------------
  |  | 1308|  21.0k|            ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); \
  |  | 1309|  21.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1309:14): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
 1459|  21.0k|                HUF_DECODE_SYMBOLX2_0(op4, &bitD4);
  ------------------
  |  | 1297|  21.0k|    do { ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (1297:74): [Folded, False: 21.0k]
  |  |  ------------------
  ------------------
 1460|  21.0k|                endSignal &= BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished;
 1461|  21.0k|                endSignal &= BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished;
 1462|       |#else
 1463|       |                HUF_DECODE_SYMBOLX2_2(op1, &bitD1);
 1464|       |                HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
 1465|       |                HUF_DECODE_SYMBOLX2_2(op3, &bitD3);
 1466|       |                HUF_DECODE_SYMBOLX2_2(op4, &bitD4);
 1467|       |                HUF_DECODE_SYMBOLX2_1(op1, &bitD1);
 1468|       |                HUF_DECODE_SYMBOLX2_1(op2, &bitD2);
 1469|       |                HUF_DECODE_SYMBOLX2_1(op3, &bitD3);
 1470|       |                HUF_DECODE_SYMBOLX2_1(op4, &bitD4);
 1471|       |                HUF_DECODE_SYMBOLX2_2(op1, &bitD1);
 1472|       |                HUF_DECODE_SYMBOLX2_2(op2, &bitD2);
 1473|       |                HUF_DECODE_SYMBOLX2_2(op3, &bitD3);
 1474|       |                HUF_DECODE_SYMBOLX2_2(op4, &bitD4);
 1475|       |                HUF_DECODE_SYMBOLX2_0(op1, &bitD1);
 1476|       |                HUF_DECODE_SYMBOLX2_0(op2, &bitD2);
 1477|       |                HUF_DECODE_SYMBOLX2_0(op3, &bitD3);
 1478|       |                HUF_DECODE_SYMBOLX2_0(op4, &bitD4);
 1479|       |                endSignal = (U32)LIKELY((U32)
 1480|       |                            (BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished)
 1481|       |                        & (BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished)
 1482|       |                        & (BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished)
 1483|       |                        & (BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished));
 1484|       |#endif
 1485|  21.0k|            }
 1486|    231|        }
 1487|       |
 1488|       |        /* check corruption */
 1489|    258|        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 (1489:13): [True: 1, False: 257]
  ------------------
 1490|    257|        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 (1490:13): [True: 1, False: 256]
  ------------------
 1491|    256|        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 (1491:13): [True: 1, False: 255]
  ------------------
 1492|       |        /* note : op4 already verified within main loop */
 1493|       |
 1494|       |        /* finish bitStreams one by one */
 1495|    255|        HUF_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog);
 1496|    255|        HUF_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog);
 1497|    255|        HUF_decodeStreamX2(op3, &bitD3, opStart4, dt, dtLog);
 1498|    255|        HUF_decodeStreamX2(op4, &bitD4, oend,     dt, dtLog);
 1499|       |
 1500|       |        /* check */
 1501|    255|        { U32 const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4);
 1502|    255|          if (!endCheck) return ERROR(corruption_detected); }
  ------------------
  |  |   49|    254|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    254|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    254|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1502:15): [True: 254, False: 1]
  ------------------
 1503|       |
 1504|       |        /* decoded size */
 1505|      1|        return dstSize;
 1506|    255|    }
 1507|    255|}
huf_decompress.c:HUF_decompress4X2_usingDTable_internal_bmi2:
 1512|    294|                    size_t cSrcSize, HUF_DTable const* DTable) {
 1513|    294|    return HUF_decompress4X2_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable);
 1514|    294|}
huf_decompress.c:HUF_decompress4X2_usingDTable_internal_fast:
 1687|    503|    HUF_DecompressFastLoopFn loopFn) {
 1688|    503|    void const* dt = DTable + 1;
 1689|    503|    const BYTE* const ilowest = (const BYTE*)cSrc;
 1690|    503|    BYTE* const oend = (BYTE*)ZSTD_maybeNullPtrAdd(dst, (ptrdiff_t)dstSize);
 1691|    503|    HUF_DecompressFastArgs args;
 1692|    503|    {
 1693|    503|        size_t const ret = HUF_DecompressFastArgs_init(&args, dst, dstSize, cSrc, cSrcSize, DTable);
 1694|    503|        FORWARD_IF_ERROR(ret, "Failed to init asm args");
  ------------------
  |  |  146|    503|    do {                                                                           \
  |  |  147|    503|        size_t const err_code = (err);                                             \
  |  |  148|    503|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 10, False: 493]
  |  |  ------------------
  |  |  149|     10|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     10|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|     10|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|     10|    do {                                           \
  |  |  |  |   99|     10|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     10|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|     10|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|     10|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|     10|            return err_code;                                                       \
  |  |  155|     10|        }                                                                          \
  |  |  156|    503|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 493]
  |  |  ------------------
  ------------------
 1695|    493|        if (ret == 0)
  ------------------
  |  Branch (1695:13): [True: 294, False: 199]
  ------------------
 1696|    294|            return 0;
 1697|    493|    }
 1698|       |
 1699|    199|    assert(args.ip[0] >= args.ilowest);
  ------------------
  |  |   70|    199|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1700|    199|    loopFn(&args);
 1701|       |
 1702|       |    /* note : op4 already verified within main loop */
 1703|    199|    assert(args.ip[0] >= ilowest);
  ------------------
  |  |   70|    199|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1704|    199|    assert(args.ip[1] >= ilowest);
  ------------------
  |  |   70|    199|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1705|    199|    assert(args.ip[2] >= ilowest);
  ------------------
  |  |   70|    199|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1706|    199|    assert(args.ip[3] >= ilowest);
  ------------------
  |  |   70|    199|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1707|    199|    assert(args.op[3] <= oend);
  ------------------
  |  |   70|    199|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1708|       |
 1709|    199|    assert(ilowest == args.ilowest);
  ------------------
  |  |   70|    199|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1710|    199|    assert(ilowest + 6 == args.iend[0]);
  ------------------
  |  |   70|    199|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1711|    199|    (void)ilowest;
 1712|       |
 1713|       |    /* finish bitStreams one by one */
 1714|    199|    {
 1715|    199|        size_t const segmentSize = (dstSize+3) / 4;
 1716|    199|        BYTE* segmentEnd = (BYTE*)dst;
 1717|    199|        int i;
 1718|    928|        for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (1718:21): [True: 758, False: 170]
  ------------------
 1719|    758|            BIT_DStream_t bit;
 1720|    758|            if (segmentSize <= (size_t)(oend - segmentEnd))
  ------------------
  |  Branch (1720:17): [True: 609, False: 149]
  ------------------
 1721|    609|                segmentEnd += segmentSize;
 1722|    149|            else
 1723|    149|                segmentEnd = oend;
 1724|    758|            FORWARD_IF_ERROR(HUF_initRemainingDStream(&bit, &args, i, segmentEnd), "corruption");
  ------------------
  |  |  146|    758|    do {                                                                           \
  |  |  147|    758|        size_t const err_code = (err);                                             \
  |  |  148|    758|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 29, False: 729]
  |  |  ------------------
  |  |  149|     29|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|     29|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 29]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     29|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|     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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|     29|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|     29|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 29]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|     29|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|     29|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 29]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|     29|            return err_code;                                                       \
  |  |  155|     29|        }                                                                          \
  |  |  156|    758|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 729]
  |  |  ------------------
  ------------------
 1725|    729|            args.op[i] += HUF_decodeStreamX2(args.op[i], &bit, segmentEnd, (HUF_DEltX2 const*)dt, HUF_DECODER_FAST_TABLELOG);
  ------------------
  |  |   33|    729|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
 1726|    729|            if (args.op[i] != segmentEnd)
  ------------------
  |  Branch (1726:17): [True: 0, False: 729]
  ------------------
 1727|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1728|    729|        }
 1729|    199|    }
 1730|       |
 1731|       |    /* decoded size */
 1732|    170|    return dstSize;
 1733|    199|}
huf_decompress.c:HUF_DecompressFastArgs_init:
  195|  4.64k|{
  196|  4.64k|    void const* dt = DTable + 1;
  197|  4.64k|    U32 const dtLog = HUF_getDTableDesc(DTable).tableLog;
  198|       |
  199|  4.64k|    const BYTE* const istart = (const BYTE*)src;
  200|       |
  201|  4.64k|    BYTE* const oend = (BYTE*)ZSTD_maybeNullPtrAdd(dst, (ptrdiff_t)dstSize);
  202|       |
  203|       |    /* The fast decoding loop assumes 64-bit little-endian.
  204|       |     * This condition is false on x32.
  205|       |     */
  206|  4.64k|    if (!MEM_isLittleEndian() || MEM_32bits())
  ------------------
  |  Branch (206:9): [True: 0, False: 4.64k]
  |  Branch (206:34): [True: 0, False: 4.64k]
  ------------------
  207|      0|        return 0;
  208|       |
  209|       |    /* Avoid nullptr addition */
  210|  4.64k|    if (dstSize == 0)
  ------------------
  |  Branch (210:9): [True: 0, False: 4.64k]
  ------------------
  211|      0|        return 0;
  212|  4.64k|    assert(dst != NULL);
  ------------------
  |  |   70|  4.64k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  213|       |
  214|       |    /* strict minimum : jump table + 1 byte per stream */
  215|  4.64k|    if (srcSize < 10)
  ------------------
  |  Branch (215:9): [True: 16, False: 4.62k]
  ------------------
  216|     16|        return ERROR(corruption_detected);
  ------------------
  |  |   49|     16|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     16|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     16|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  217|       |
  218|       |    /* Must have at least 8 bytes per stream because we don't handle initializing smaller bit containers.
  219|       |     * If table log is not correct at this point, fallback to the old decoder.
  220|       |     * On small inputs we don't have enough data to trigger the fast loop, so use the old decoder.
  221|       |     */
  222|  4.62k|    if (dtLog != HUF_DECODER_FAST_TABLELOG)
  ------------------
  |  |   33|  4.62k|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
  |  Branch (222:9): [True: 157, False: 4.47k]
  ------------------
  223|    157|        return 0;
  224|       |
  225|       |    /* Read the jump table. */
  226|  4.47k|    {
  227|  4.47k|        size_t const length1 = MEM_readLE16(istart);
  228|  4.47k|        size_t const length2 = MEM_readLE16(istart+2);
  229|  4.47k|        size_t const length3 = MEM_readLE16(istart+4);
  230|  4.47k|        size_t const length4 = srcSize - (length1 + length2 + length3 + 6);
  231|  4.47k|        args->iend[0] = istart + 6;  /* jumpTable */
  232|  4.47k|        args->iend[1] = args->iend[0] + length1;
  233|  4.47k|        args->iend[2] = args->iend[1] + length2;
  234|  4.47k|        args->iend[3] = args->iend[2] + length3;
  235|       |
  236|       |        /* HUF_initFastDStream() requires this, and this small of an input
  237|       |         * won't benefit from the ASM loop anyways.
  238|       |         */
  239|  4.47k|        if (length1 < 8 || length2 < 8 || length3 < 8 || length4 < 8)
  ------------------
  |  Branch (239:13): [True: 189, False: 4.28k]
  |  Branch (239:28): [True: 67, False: 4.21k]
  |  Branch (239:43): [True: 54, False: 4.16k]
  |  Branch (239:58): [True: 29, False: 4.13k]
  ------------------
  240|    339|            return 0;
  241|  4.13k|        if (length4 > srcSize) return ERROR(corruption_detected);   /* overflow */
  ------------------
  |  |   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 (241:13): [True: 56, False: 4.07k]
  ------------------
  242|  4.13k|    }
  243|       |    /* ip[] contains the position that is currently loaded into bits[]. */
  244|  4.07k|    args->ip[0] = args->iend[1] - sizeof(U64);
  245|  4.07k|    args->ip[1] = args->iend[2] - sizeof(U64);
  246|  4.07k|    args->ip[2] = args->iend[3] - sizeof(U64);
  247|  4.07k|    args->ip[3] = (BYTE const*)src + srcSize - sizeof(U64);
  248|       |
  249|       |    /* op[] contains the output pointers. */
  250|  4.07k|    args->op[0] = (BYTE*)dst;
  251|  4.07k|    args->op[1] = args->op[0] + (dstSize+3)/4;
  252|  4.07k|    args->op[2] = args->op[1] + (dstSize+3)/4;
  253|  4.07k|    args->op[3] = args->op[2] + (dstSize+3)/4;
  254|       |
  255|       |    /* No point to call the ASM loop for tiny outputs. */
  256|  4.07k|    if (args->op[3] >= oend)
  ------------------
  |  Branch (256:9): [True: 3, False: 4.07k]
  ------------------
  257|      3|        return 0;
  258|       |
  259|       |    /* bits[] is the bit container.
  260|       |        * It is read from the MSB down to the LSB.
  261|       |        * It is shifted left as it is read, and zeros are
  262|       |        * shifted in. After the lowest valid bit a 1 is
  263|       |        * set, so that CountTrailingZeros(bits[]) can be used
  264|       |        * to count how many bits we've consumed.
  265|       |        */
  266|  4.07k|    args->bits[0] = HUF_initFastDStream(args->ip[0]);
  267|  4.07k|    args->bits[1] = HUF_initFastDStream(args->ip[1]);
  268|  4.07k|    args->bits[2] = HUF_initFastDStream(args->ip[2]);
  269|  4.07k|    args->bits[3] = HUF_initFastDStream(args->ip[3]);
  270|       |
  271|       |    /* The decoders must be sure to never read beyond ilowest.
  272|       |     * This is lower than iend[0], but allowing decoders to read
  273|       |     * down to ilowest can allow an extra iteration or two in the
  274|       |     * fast loop.
  275|       |     */
  276|  4.07k|    args->ilowest = istart;
  277|       |
  278|  4.07k|    args->oend = oend;
  279|  4.07k|    args->dt = dt;
  280|       |
  281|  4.07k|    return 1;
  282|  4.07k|}
huf_decompress.c:HUF_initFastDStream:
  153|  16.2k|static size_t HUF_initFastDStream(BYTE const* ip) {
  154|  16.2k|    BYTE const lastByte = ip[7];
  155|  16.2k|    size_t const bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (155:33): [True: 8.48k, False: 7.80k]
  ------------------
  156|  16.2k|    size_t const value = MEM_readLEST(ip) | 1;
  157|  16.2k|    assert(bitsConsumed <= 8);
  ------------------
  |  |   70|  16.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  158|  16.2k|    assert(sizeof(size_t) == 8);
  ------------------
  |  |   70|  16.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  159|  16.2k|    return value << bitsConsumed;
  160|  16.2k|}
huf_decompress.c:HUF_initRemainingDStream:
  285|  16.2k|{
  286|       |    /* Validate that we haven't overwritten. */
  287|  16.2k|    if (args->op[stream] > segmentEnd)
  ------------------
  |  Branch (287:9): [True: 0, False: 16.2k]
  ------------------
  288|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  289|       |    /* The MSB is the next bit to read, so ip[] may be up to 8 bytes before
  290|       |     * iend[] when the stream is fully consumed. Compare distances rather than
  291|       |     * forming iend[0] - 8, which can be before the compressed input.
  292|       |     * No loaded word may precede ilowest. */
  293|  16.2k|    if (args->ip[stream] < args->ilowest
  ------------------
  |  Branch (293:9): [True: 0, False: 16.2k]
  ------------------
  294|  16.2k|        || (args->ip[stream] < args->iend[stream]
  ------------------
  |  Branch (294:13): [True: 2.49k, False: 13.7k]
  ------------------
  295|  2.49k|            && (size_t)(args->iend[stream] - args->ip[stream]) > 8))
  ------------------
  |  Branch (295:16): [True: 35, False: 2.46k]
  ------------------
  296|     35|        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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  297|       |
  298|       |    /* Construct the BIT_DStream_t. */
  299|  16.2k|    assert(sizeof(size_t) == 8);
  ------------------
  |  |   70|  16.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  300|  16.2k|    bit->bitContainer = MEM_readLEST(args->ip[stream]);
  301|  16.2k|    bit->bitsConsumed = ZSTD_countTrailingZeros64(args->bits[stream]);
  302|  16.2k|    bit->start = (const char*)args->ilowest;
  303|  16.2k|    bit->limitPtr = bit->start + sizeof(size_t);
  304|  16.2k|    bit->ptr = (const char*)args->ip[stream];
  305|       |
  306|  16.2k|    return 0;
  307|  16.2k|}
huf_decompress.c:HUF_decompress4X1_usingDTable_internal:
  905|  4.14k|{
  906|  4.14k|    HUF_DecompressUsingDTableFn fallbackFn = HUF_decompress4X1_usingDTable_internal_default;
  907|  4.14k|    HUF_DecompressFastLoopFn loopFn = HUF_decompress4X1_usingDTable_internal_fast_c_loop;
  908|       |
  909|  4.14k|    if (ZSTD_USE_BMI2(flags & HUF_flags_bmi2)) {
  ------------------
  |  |   36|  4.14k|#  define ZSTD_USE_BMI2(bmi2) (bmi2)
  |  |  ------------------
  |  |  |  Branch (36:31): [True: 4.14k, False: 0]
  |  |  ------------------
  ------------------
  910|  4.14k|        fallbackFn = HUF_decompress4X1_usingDTable_internal_bmi2;
  911|  4.14k|# if ZSTD_ENABLE_ASM_X86_64_BMI2
  912|  4.14k|        if (!(flags & HUF_flags_disableAsm)) {
  ------------------
  |  Branch (912:13): [True: 4.14k, False: 0]
  ------------------
  913|  4.14k|            loopFn = HUF_decompress4X1_usingDTable_internal_fast_asm_loop;
  914|  4.14k|        }
  915|  4.14k|# endif
  916|  4.14k|    } else if (DYNAMIC_BMI2) {
  ------------------
  |  |   99|      0|#    define DYNAMIC_BMI2 1
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, Folded]
  |  |  ------------------
  ------------------
  917|      0|        return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable);
  918|      0|    }
  919|       |
  920|       |#if ZSTD_ENABLE_ASM_X86_64_BMI2 && defined(__BMI2__)
  921|       |    if (!(flags & HUF_flags_disableAsm)) {
  922|       |        loopFn = HUF_decompress4X1_usingDTable_internal_fast_asm_loop;
  923|       |    }
  924|       |#endif
  925|       |
  926|  4.14k|    if (HUF_ENABLE_FAST_DECODE && !(flags & HUF_flags_disableFast)) {
  ------------------
  |  |   42|  8.28k|# define HUF_ENABLE_FAST_DECODE 1
  |  |  ------------------
  |  |  |  Branch (42:33): [True: 4.14k, Folded]
  |  |  ------------------
  ------------------
  |  Branch (926:35): [True: 4.14k, False: 0]
  ------------------
  927|  4.14k|        size_t const ret = HUF_decompress4X1_usingDTable_internal_fast(dst, dstSize, cSrc, cSrcSize, DTable, loopFn);
  928|  4.14k|        if (ret != 0)
  ------------------
  |  Branch (928:13): [True: 3.93k, False: 205]
  ------------------
  929|  3.93k|            return ret;
  930|  4.14k|    }
  931|    205|    return fallbackFn(dst, dstSize, cSrc, cSrcSize, DTable);
  932|  4.14k|}
huf_decompress.c:HUF_decompress4X1_usingDTable_internal_body:
  610|    205|{
  611|       |    /* Check */
  612|    205|    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 (612:9): [True: 0, False: 205]
  ------------------
  613|    205|    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 (613:9): [True: 0, False: 205]
  ------------------
  614|       |
  615|    205|    {   const BYTE* const istart = (const BYTE*) cSrc;
  616|    205|        BYTE* const ostart = (BYTE*) dst;
  617|    205|        BYTE* const oend = ostart + dstSize;
  618|    205|        BYTE* const olimit = oend - 3;
  619|    205|        const void* const dtPtr = DTable + 1;
  620|    205|        const HUF_DEltX1* const dt = (const HUF_DEltX1*)dtPtr;
  621|       |
  622|       |        /* Init */
  623|    205|        BIT_DStream_t bitD1;
  624|    205|        BIT_DStream_t bitD2;
  625|    205|        BIT_DStream_t bitD3;
  626|    205|        BIT_DStream_t bitD4;
  627|    205|        size_t const length1 = MEM_readLE16(istart);
  628|    205|        size_t const length2 = MEM_readLE16(istart+2);
  629|    205|        size_t const length3 = MEM_readLE16(istart+4);
  630|    205|        size_t const length4 = cSrcSize - (length1 + length2 + length3 + 6);
  631|    205|        const BYTE* const istart1 = istart + 6;  /* jumpTable */
  632|    205|        const BYTE* const istart2 = istart1 + length1;
  633|    205|        const BYTE* const istart3 = istart2 + length2;
  634|    205|        const BYTE* const istart4 = istart3 + length3;
  635|    205|        const size_t segmentSize = (dstSize+3) / 4;
  636|    205|        BYTE* const opStart2 = ostart + segmentSize;
  637|    205|        BYTE* const opStart3 = opStart2 + segmentSize;
  638|    205|        BYTE* const opStart4 = opStart3 + segmentSize;
  639|    205|        BYTE* op1 = ostart;
  640|    205|        BYTE* op2 = opStart2;
  641|    205|        BYTE* op3 = opStart3;
  642|    205|        BYTE* op4 = opStart4;
  643|    205|        DTableDesc const dtd = HUF_getDTableDesc(DTable);
  644|    205|        U32 const dtLog = dtd.tableLog;
  645|    205|        U32 endSignal = 1;
  646|       |
  647|    205|        if (length4 > cSrcSize) return ERROR(corruption_detected);   /* overflow */
  ------------------
  |  |   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 (647:13): [True: 27, False: 178]
  ------------------
  648|    178|        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 (648:13): [True: 0, False: 178]
  ------------------
  649|    178|        assert(dstSize >= 6); /* validated above */
  ------------------
  |  |   70|    178|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  650|    178|        CHECK_F( BIT_initDStream(&bitD1, istart1, length1) );
  ------------------
  |  |   63|    178|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    178|    size_t const e = f;     \
  |  |  |  |   59|    178|    do {                    \
  |  |  |  |   60|    178|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 4, False: 174]
  |  |  |  |  ------------------
  |  |  |  |   61|    178|            return e;       \
  |  |  |  |   62|    178|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 174]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 174]
  |  |  ------------------
  ------------------
  651|    174|        CHECK_F( BIT_initDStream(&bitD2, istart2, length2) );
  ------------------
  |  |   63|    174|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    174|    size_t const e = f;     \
  |  |  |  |   59|    174|    do {                    \
  |  |  |  |   60|    174|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 8, False: 166]
  |  |  |  |  ------------------
  |  |  |  |   61|    174|            return e;       \
  |  |  |  |   62|    174|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 166]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 166]
  |  |  ------------------
  ------------------
  652|    166|        CHECK_F( BIT_initDStream(&bitD3, istart3, length3) );
  ------------------
  |  |   63|    166|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    166|    size_t const e = f;     \
  |  |  |  |   59|    166|    do {                    \
  |  |  |  |   60|    166|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 7, False: 159]
  |  |  |  |  ------------------
  |  |  |  |   61|    166|            return e;       \
  |  |  |  |   62|    166|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 159]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 159]
  |  |  ------------------
  ------------------
  653|    159|        CHECK_F( BIT_initDStream(&bitD4, istart4, length4) );
  ------------------
  |  |   63|    159|#define CHECK_F(f)   do { CHECK_V_F(_var_err__, f); } while (0)
  |  |  ------------------
  |  |  |  |   58|    159|    size_t const e = f;     \
  |  |  |  |   59|    159|    do {                    \
  |  |  |  |   60|    159|        if (ERR_isError(e)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (60:13): [True: 4, False: 155]
  |  |  |  |  ------------------
  |  |  |  |   61|    159|            return e;       \
  |  |  |  |   62|    159|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (62:14): [Folded, False: 155]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (63:62): [Folded, False: 155]
  |  |  ------------------
  ------------------
  654|       |
  655|       |        /* up to 16 symbols per loop (4 symbols per stream) in 64-bit mode */
  656|    155|        if ((size_t)(oend - op4) >= sizeof(size_t)) {
  ------------------
  |  Branch (656:13): [True: 117, False: 38]
  ------------------
  657|  11.5k|            for ( ; (endSignal) & (op4 < olimit) ; ) {
  ------------------
  |  Branch (657:21): [True: 11.4k, False: 117]
  ------------------
  658|  11.4k|                HUF_DECODE_SYMBOLX1_2(op1, &bitD1);
  ------------------
  |  |  544|  11.4k|    do {                                            \
  |  |  545|  11.4k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (545:13): [True: 11.4k, False: 0]
  |  |  ------------------
  |  |  546|  11.4k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  535|  11.4k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (535:71): [Folded, False: 11.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  547|  11.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (547:14): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  659|  11.4k|                HUF_DECODE_SYMBOLX1_2(op2, &bitD2);
  ------------------
  |  |  544|  11.4k|    do {                                            \
  |  |  545|  11.4k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (545:13): [True: 11.4k, False: 0]
  |  |  ------------------
  |  |  546|  11.4k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  535|  11.4k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (535:71): [Folded, False: 11.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  547|  11.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (547:14): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  660|  11.4k|                HUF_DECODE_SYMBOLX1_2(op3, &bitD3);
  ------------------
  |  |  544|  11.4k|    do {                                            \
  |  |  545|  11.4k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (545:13): [True: 11.4k, False: 0]
  |  |  ------------------
  |  |  546|  11.4k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  535|  11.4k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (535:71): [Folded, False: 11.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  547|  11.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (547:14): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  661|  11.4k|                HUF_DECODE_SYMBOLX1_2(op4, &bitD4);
  ------------------
  |  |  544|  11.4k|    do {                                            \
  |  |  545|  11.4k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (545:13): [True: 11.4k, False: 0]
  |  |  ------------------
  |  |  546|  11.4k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  535|  11.4k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (535:71): [Folded, False: 11.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  547|  11.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (547:14): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  662|  11.4k|                HUF_DECODE_SYMBOLX1_1(op1, &bitD1);
  ------------------
  |  |  538|  11.4k|    do {                                            \
  |  |  539|  11.4k|        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 (539:13): [True: 11.4k, False: 0]
  |  |  |  Branch (539:29): [True: 0, Folded]
  |  |  ------------------
  |  |  540|  11.4k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  535|  11.4k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (535:71): [Folded, False: 11.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  541|  11.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (541:14): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  663|  11.4k|                HUF_DECODE_SYMBOLX1_1(op2, &bitD2);
  ------------------
  |  |  538|  11.4k|    do {                                            \
  |  |  539|  11.4k|        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 (539:13): [True: 11.4k, False: 0]
  |  |  |  Branch (539:29): [True: 0, Folded]
  |  |  ------------------
  |  |  540|  11.4k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  535|  11.4k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (535:71): [Folded, False: 11.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  541|  11.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (541:14): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  664|  11.4k|                HUF_DECODE_SYMBOLX1_1(op3, &bitD3);
  ------------------
  |  |  538|  11.4k|    do {                                            \
  |  |  539|  11.4k|        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 (539:13): [True: 11.4k, False: 0]
  |  |  |  Branch (539:29): [True: 0, Folded]
  |  |  ------------------
  |  |  540|  11.4k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  535|  11.4k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (535:71): [Folded, False: 11.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  541|  11.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (541:14): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  665|  11.4k|                HUF_DECODE_SYMBOLX1_1(op4, &bitD4);
  ------------------
  |  |  538|  11.4k|    do {                                            \
  |  |  539|  11.4k|        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 (539:13): [True: 11.4k, False: 0]
  |  |  |  Branch (539:29): [True: 0, Folded]
  |  |  ------------------
  |  |  540|  11.4k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  535|  11.4k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (535:71): [Folded, False: 11.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  541|  11.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (541:14): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  666|  11.4k|                HUF_DECODE_SYMBOLX1_2(op1, &bitD1);
  ------------------
  |  |  544|  11.4k|    do {                                            \
  |  |  545|  11.4k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (545:13): [True: 11.4k, False: 0]
  |  |  ------------------
  |  |  546|  11.4k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  535|  11.4k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (535:71): [Folded, False: 11.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  547|  11.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (547:14): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  667|  11.4k|                HUF_DECODE_SYMBOLX1_2(op2, &bitD2);
  ------------------
  |  |  544|  11.4k|    do {                                            \
  |  |  545|  11.4k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (545:13): [True: 11.4k, False: 0]
  |  |  ------------------
  |  |  546|  11.4k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  535|  11.4k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (535:71): [Folded, False: 11.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  547|  11.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (547:14): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  668|  11.4k|                HUF_DECODE_SYMBOLX1_2(op3, &bitD3);
  ------------------
  |  |  544|  11.4k|    do {                                            \
  |  |  545|  11.4k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (545:13): [True: 11.4k, False: 0]
  |  |  ------------------
  |  |  546|  11.4k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  535|  11.4k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (535:71): [Folded, False: 11.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  547|  11.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (547:14): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  669|  11.4k|                HUF_DECODE_SYMBOLX1_2(op4, &bitD4);
  ------------------
  |  |  544|  11.4k|    do {                                            \
  |  |  545|  11.4k|        if (MEM_64bits())                           \
  |  |  ------------------
  |  |  |  Branch (545:13): [True: 11.4k, False: 0]
  |  |  ------------------
  |  |  546|  11.4k|            HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr); \
  |  |  ------------------
  |  |  |  |  535|  11.4k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (535:71): [Folded, False: 11.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  547|  11.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (547:14): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  670|  11.4k|                HUF_DECODE_SYMBOLX1_0(op1, &bitD1);
  ------------------
  |  |  535|  11.4k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (535:71): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  671|  11.4k|                HUF_DECODE_SYMBOLX1_0(op2, &bitD2);
  ------------------
  |  |  535|  11.4k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (535:71): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  672|  11.4k|                HUF_DECODE_SYMBOLX1_0(op3, &bitD3);
  ------------------
  |  |  535|  11.4k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (535:71): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  673|  11.4k|                HUF_DECODE_SYMBOLX1_0(op4, &bitD4);
  ------------------
  |  |  535|  11.4k|    do { *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog); } while (0)
  |  |  ------------------
  |  |  |  Branch (535:71): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  674|  11.4k|                endSignal &= BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished;
  675|  11.4k|                endSignal &= BIT_reloadDStreamFast(&bitD2) == BIT_DStream_unfinished;
  676|  11.4k|                endSignal &= BIT_reloadDStreamFast(&bitD3) == BIT_DStream_unfinished;
  677|  11.4k|                endSignal &= BIT_reloadDStreamFast(&bitD4) == BIT_DStream_unfinished;
  678|  11.4k|            }
  679|    117|        }
  680|       |
  681|       |        /* check corruption */
  682|       |        /* note : should not be necessary : op# advance in lock step, and we control op4.
  683|       |         *        but curiously, binary generated by gcc 7.2 & 7.3 with -mbmi2 runs faster when >=1 test is present */
  684|    155|        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 (684:13): [True: 0, False: 155]
  ------------------
  685|    155|        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 (685:13): [True: 0, False: 155]
  ------------------
  686|    155|        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 (686:13): [True: 0, False: 155]
  ------------------
  687|       |        /* note : op4 supposed already verified within main loop */
  688|       |
  689|       |        /* finish bitStreams one by one */
  690|    155|        HUF_decodeStreamX1(op1, &bitD1, opStart2, dt, dtLog);
  691|    155|        HUF_decodeStreamX1(op2, &bitD2, opStart3, dt, dtLog);
  692|    155|        HUF_decodeStreamX1(op3, &bitD3, opStart4, dt, dtLog);
  693|    155|        HUF_decodeStreamX1(op4, &bitD4, oend,     dt, dtLog);
  694|       |
  695|       |        /* check */
  696|    155|        { U32 const endCheck = BIT_endOfDStream(&bitD1) & BIT_endOfDStream(&bitD2) & BIT_endOfDStream(&bitD3) & BIT_endOfDStream(&bitD4);
  697|    155|          if (!endCheck) return ERROR(corruption_detected); }
  ------------------
  |  |   49|    154|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    154|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    154|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (697:15): [True: 154, False: 1]
  ------------------
  698|       |
  699|       |        /* decoded size */
  700|      1|        return dstSize;
  701|    155|    }
  702|    155|}
huf_decompress.c:HUF_decompress4X1_usingDTable_internal_bmi2:
  707|    205|                    size_t cSrcSize, HUF_DTable const* DTable) {
  708|    205|    return HUF_decompress4X1_usingDTable_internal_body(dst, dstSize, cSrc, cSrcSize, DTable);
  709|    205|}
huf_decompress.c:HUF_decompress4X1_usingDTable_internal_fast:
  851|  4.14k|{
  852|  4.14k|    void const* dt = DTable + 1;
  853|  4.14k|    BYTE const* const ilowest = (BYTE const*)cSrc;
  854|  4.14k|    BYTE* const oend = (BYTE*)ZSTD_maybeNullPtrAdd(dst, (ptrdiff_t)dstSize);
  855|  4.14k|    HUF_DecompressFastArgs args;
  856|  4.14k|    {   size_t const ret = HUF_DecompressFastArgs_init(&args, dst, dstSize, cSrc, cSrcSize, DTable);
  857|  4.14k|        FORWARD_IF_ERROR(ret, "Failed to init fast loop args");
  ------------------
  |  |  146|  4.14k|    do {                                                                           \
  |  |  147|  4.14k|        size_t const err_code = (err);                                             \
  |  |  148|  4.14k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 62, False: 4.07k]
  |  |  ------------------
  |  |  149|     62|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|     62|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 62]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     62|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|     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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|     62|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|     62|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 62]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|     62|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|     62|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 62]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|     62|            return err_code;                                                       \
  |  |  155|     62|        }                                                                          \
  |  |  156|  4.14k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 4.07k]
  |  |  ------------------
  ------------------
  858|  4.07k|        if (ret == 0)
  ------------------
  |  Branch (858:13): [True: 205, False: 3.87k]
  ------------------
  859|    205|            return 0;
  860|  4.07k|    }
  861|       |
  862|  3.87k|    assert(args.ip[0] >= args.ilowest);
  ------------------
  |  |   70|  3.87k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  863|  3.87k|    loopFn(&args);
  864|       |
  865|       |    /* Our loop guarantees that ip[] >= ilowest and that we haven't
  866|       |    * overwritten any op[].
  867|       |    */
  868|  3.87k|    assert(args.ip[0] >= ilowest);
  ------------------
  |  |   70|  3.87k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  869|  3.87k|    assert(args.ip[0] >= ilowest);
  ------------------
  |  |   70|  3.87k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  870|  3.87k|    assert(args.ip[1] >= ilowest);
  ------------------
  |  |   70|  3.87k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  871|  3.87k|    assert(args.ip[2] >= ilowest);
  ------------------
  |  |   70|  3.87k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  872|  3.87k|    assert(args.ip[3] >= ilowest);
  ------------------
  |  |   70|  3.87k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  873|  3.87k|    assert(args.op[3] <= oend);
  ------------------
  |  |   70|  3.87k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  874|       |
  875|  3.87k|    assert(ilowest == args.ilowest);
  ------------------
  |  |   70|  3.87k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  876|  3.87k|    assert(ilowest + 6 == args.iend[0]);
  ------------------
  |  |   70|  3.87k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  877|  3.87k|    (void)ilowest;
  878|       |
  879|       |    /* finish bit streams one by one. */
  880|  3.87k|    {   size_t const segmentSize = (dstSize+3) / 4;
  881|  3.87k|        BYTE* segmentEnd = (BYTE*)dst;
  882|  3.87k|        int i;
  883|  19.3k|        for (i = 0; i < 4; ++i) {
  ------------------
  |  Branch (883:21): [True: 15.4k, False: 3.86k]
  ------------------
  884|  15.4k|            BIT_DStream_t bit;
  885|  15.4k|            if (segmentSize <= (size_t)(oend - segmentEnd))
  ------------------
  |  Branch (885:17): [True: 14.0k, False: 1.42k]
  ------------------
  886|  14.0k|                segmentEnd += segmentSize;
  887|  1.42k|            else
  888|  1.42k|                segmentEnd = oend;
  889|  15.4k|            FORWARD_IF_ERROR(HUF_initRemainingDStream(&bit, &args, i, segmentEnd), "corruption");
  ------------------
  |  |  146|  15.4k|    do {                                                                           \
  |  |  147|  15.4k|        size_t const err_code = (err);                                             \
  |  |  148|  15.4k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 6, False: 15.4k]
  |  |  ------------------
  |  |  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|  15.4k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 15.4k]
  |  |  ------------------
  ------------------
  890|       |            /* Decompress and validate that we've produced exactly the expected length. */
  891|  15.4k|            args.op[i] += HUF_decodeStreamX1(args.op[i], &bit, segmentEnd, (HUF_DEltX1 const*)dt, HUF_DECODER_FAST_TABLELOG);
  ------------------
  |  |   33|  15.4k|#define HUF_DECODER_FAST_TABLELOG 11
  ------------------
  892|  15.4k|            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 (892:17): [True: 0, False: 15.4k]
  ------------------
  893|  15.4k|        }
  894|  3.87k|    }
  895|       |
  896|       |    /* decoded size */
  897|  3.86k|    assert(dstSize != 0);
  ------------------
  |  |   70|  3.86k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  898|  3.86k|    return dstSize;
  899|  3.87k|}
huf_decompress.c:HUF_decompress4X2_DCtx_wksp:
 1786|    162|{
 1787|    162|    const BYTE* ip = (const BYTE*) cSrc;
 1788|       |
 1789|    162|    size_t hSize = HUF_readDTableX2_wksp(dctx, cSrc, cSrcSize,
 1790|    162|                                         workSpace, wkspSize, flags);
 1791|    162|    if (HUF_isError(hSize)) return hSize;
  ------------------
  |  |   80|    162|#define HUF_isError ERR_isError
  ------------------
  |  Branch (1791:9): [True: 2, False: 160]
  ------------------
 1792|    160|    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 (1792:9): [True: 0, False: 160]
  ------------------
 1793|    160|    ip += hSize; cSrcSize -= hSize;
 1794|       |
 1795|    160|    return HUF_decompress4X2_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, flags);
 1796|    160|}
huf_decompress.c:HUF_decompress4X1_DCtx_wksp:
  937|  4.27k|{
  938|  4.27k|    const BYTE* ip = (const BYTE*) cSrc;
  939|       |
  940|  4.27k|    size_t const hSize = HUF_readDTableX1_wksp(dctx, cSrc, cSrcSize, workSpace, wkspSize, flags);
  941|  4.27k|    if (HUF_isError(hSize)) return hSize;
  ------------------
  |  |   80|  4.27k|#define HUF_isError ERR_isError
  ------------------
  |  Branch (941:9): [True: 124, False: 4.14k]
  ------------------
  942|  4.14k|    if (hSize >= cSrcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|     30|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     30|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     30|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (942:9): [True: 30, False: 4.11k]
  ------------------
  943|  4.11k|    ip += hSize; cSrcSize -= hSize;
  944|       |
  945|  4.11k|    return HUF_decompress4X1_usingDTable_internal(dst, dstSize, ip, cSrcSize, dctx, flags);
  946|  4.14k|}

ZSTD_DDict_dictContent:
   48|  2.36k|{
   49|  2.36k|    assert(ddict != NULL);
  ------------------
  |  |   70|  2.36k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   50|  2.36k|    return ddict->dictContent;
   51|  2.36k|}
ZSTD_DDict_dictSize:
   54|  4.72k|{
   55|  4.72k|    assert(ddict != NULL);
  ------------------
  |  |   70|  4.72k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   56|  4.72k|    return ddict->dictSize;
   57|  4.72k|}
ZSTD_copyDDictParameters:
   60|  2.36k|{
   61|  2.36k|    const void* content;
   62|  2.36k|    DEBUGLOG(4, "ZSTD_copyDDictParameters");
  ------------------
  |  |  104|  2.36k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.36k]
  |  |  ------------------
  ------------------
   63|  2.36k|    assert(dctx != NULL);
  ------------------
  |  |   70|  2.36k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   64|  2.36k|    assert(ddict != NULL);
  ------------------
  |  |   70|  2.36k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   65|  2.36k|    content = ddict->dictHeaderSize != 0
  ------------------
  |  Branch (65:15): [True: 632, False: 1.73k]
  ------------------
   66|  2.36k|            ? (const BYTE*)ddict->dictContent + ddict->dictHeaderSize
   67|  2.36k|            : ddict->dictContent;
   68|  2.36k|    dctx->dictID = ddict->dictID;
   69|  2.36k|    dctx->prefixStart = content;
   70|  2.36k|    dctx->virtualStart = content;
   71|       |    /* An empty DDict may have NULL content. */
   72|  2.36k|    dctx->dictEnd = ddict->dictSize != 0
  ------------------
  |  Branch (72:21): [True: 2.36k, False: 0]
  ------------------
   73|  2.36k|            ? (const BYTE*)ddict->dictContent + ddict->dictSize
   74|  2.36k|            : ddict->dictContent;
   75|  2.36k|    dctx->previousDstEnd = dctx->dictEnd;
   76|  2.36k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   77|  2.36k|    dctx->dictContentBeginForFuzzing = dctx->prefixStart;
   78|  2.36k|    dctx->dictContentEndForFuzzing = dctx->previousDstEnd;
   79|  2.36k|#endif
   80|  2.36k|    if (ddict->entropyPresent) {
  ------------------
  |  Branch (80:9): [True: 632, False: 1.73k]
  ------------------
   81|    632|        dctx->litEntropy = 1;
   82|    632|        dctx->fseEntropy = 1;
   83|    632|        dctx->LLTptr = ddict->entropy.LLTable;
   84|    632|        dctx->MLTptr = ddict->entropy.MLTable;
   85|    632|        dctx->OFTptr = ddict->entropy.OFTable;
   86|    632|        dctx->HUFptr = ddict->entropy.hufTable;
   87|    632|        dctx->entropy.rep[0] = ddict->entropy.rep[0];
   88|    632|        dctx->entropy.rep[1] = ddict->entropy.rep[1];
   89|    632|        dctx->entropy.rep[2] = ddict->entropy.rep[2];
   90|  1.73k|    } else {
   91|  1.73k|        dctx->litEntropy = 0;
   92|  1.73k|        dctx->fseEntropy = 0;
   93|  1.73k|    }
   94|  2.36k|}
ZSTD_createDDict_advanced_internal:
  164|  2.48k|{
  165|  2.48k|    ZSTD_DDict* ddict;
  166|  2.48k|    *ddictPtr = NULL;
  167|  2.48k|    RETURN_ERROR_IF((!customMem.customAlloc) ^ (!customMem.customFree),
  ------------------
  |  |  114|  2.48k|    do {                                                                       \
  |  |  115|  2.48k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 2.48k]
  |  |  ------------------
  |  |  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.48k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.48k]
  |  |  ------------------
  ------------------
  168|  2.48k|                    parameter_combination_unsupported, "Invalid custom allocator");
  169|       |
  170|  2.48k|    ddict = (ZSTD_DDict*) ZSTD_customMalloc(sizeof(ZSTD_DDict), customMem);
  171|  2.48k|    RETURN_ERROR_IF(ddict == NULL, memory_allocation, "");
  ------------------
  |  |  114|  2.48k|    do {                                                                       \
  |  |  115|  2.48k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 2.48k]
  |  |  ------------------
  |  |  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.48k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.48k]
  |  |  ------------------
  ------------------
  172|  2.48k|    ddict->cMem = customMem;
  173|  2.48k|    {   size_t const initResult = ZSTD_initDDict_internal(ddict,
  174|  2.48k|                                        dict, dictSize,
  175|  2.48k|                                        dictLoadMethod, dictContentType);
  176|  2.48k|        if (ZSTD_isError(initResult)) {
  ------------------
  |  |   44|  2.48k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (176:13): [True: 578, False: 1.91k]
  ------------------
  177|    578|            ZSTD_freeDDict(ddict);
  178|    578|            return initResult;
  179|    578|    }   }
  180|  1.91k|    *ddictPtr = ddict;
  181|  1.91k|    return 0;
  182|  2.48k|}
ZSTD_createDDict_advanced:
  188|  2.48k|{
  189|  2.48k|    ZSTD_DDict* ddict;
  190|  2.48k|    size_t const err = ZSTD_createDDict_advanced_internal(&ddict,
  191|  2.48k|                            dict, dictSize, dictLoadMethod, dictContentType, customMem);
  192|  2.48k|    if (ZSTD_isError(err)) return NULL;
  ------------------
  |  |   44|  2.48k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (192:9): [True: 578, False: 1.91k]
  ------------------
  193|  1.91k|    return ddict;
  194|  2.48k|}
ZSTD_createDDict:
  201|  2.48k|{
  202|  2.48k|    ZSTD_customMem const allocator = { NULL, NULL, NULL };
  203|  2.48k|    return ZSTD_createDDict_advanced(dict, dictSize, ZSTD_dlm_byCopy, ZSTD_dct_auto, allocator);
  204|  2.48k|}
ZSTD_freeDDict:
  242|  12.4k|{
  243|  12.4k|    if (ddict==NULL) return 0;   /* support free on NULL */
  ------------------
  |  Branch (243:9): [True: 9.96k, False: 2.48k]
  ------------------
  244|  2.48k|    {   ZSTD_customMem const cMem = ddict->cMem;
  245|  2.48k|        ZSTD_customFree(ddict->dictBuffer, cMem);
  246|  2.48k|        ZSTD_customFree(ddict, cMem);
  247|  2.48k|        return 0;
  248|  12.4k|    }
  249|  12.4k|}
ZSTD_sizeof_DDict:
  263|  5.19k|{
  264|  5.19k|    if (ddict==NULL) return 0;   /* support sizeof on NULL */
  ------------------
  |  Branch (264:9): [True: 5.19k, False: 0]
  ------------------
  265|      0|    return sizeof(*ddict) + (ddict->dictBuffer ? ddict->dictSize : 0) ;
  ------------------
  |  Branch (265:30): [True: 0, False: 0]
  ------------------
  266|  5.19k|}
zstd_ddict.c:ZSTD_initDDict_internal:
  136|  2.48k|{
  137|       |    /* An empty dictionary has no referenced storage, even in by-copy mode. */
  138|  2.48k|    if (dictSize == 0) dict = NULL;
  ------------------
  |  Branch (138:9): [True: 0, False: 2.48k]
  ------------------
  139|  2.48k|    if ((dictLoadMethod == ZSTD_dlm_byRef) || (!dict) || (!dictSize)) {
  ------------------
  |  Branch (139:9): [True: 0, False: 2.48k]
  |  Branch (139:47): [True: 0, False: 2.48k]
  |  Branch (139:58): [True: 0, False: 2.48k]
  ------------------
  140|      0|        ddict->dictBuffer = NULL;
  141|      0|        ddict->dictContent = dict;
  142|      0|        if (!dict) dictSize = 0;
  ------------------
  |  Branch (142:13): [True: 0, False: 0]
  ------------------
  143|  2.48k|    } else {
  144|  2.48k|        void* const internalBuffer = ZSTD_customMalloc(dictSize, ddict->cMem);
  145|  2.48k|        ddict->dictBuffer = internalBuffer;
  146|  2.48k|        ddict->dictContent = internalBuffer;
  147|  2.48k|        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 (147:13): [True: 0, False: 2.48k]
  ------------------
  148|  2.48k|        ZSTD_memcpy(internalBuffer, dict, dictSize);
  ------------------
  |  |   44|  2.48k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  149|  2.48k|    }
  150|  2.48k|    ddict->dictSize = dictSize;
  151|  2.48k|    ddict->entropy.hufTable[0] = (HUF_DTable)((ZSTD_HUFFDTABLE_CAPACITY_LOG)*0x1000001);  /* cover both little and big endian */
  ------------------
  |  |   78|  2.48k|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
  152|       |
  153|       |    /* parse dictionary content */
  154|  2.48k|    FORWARD_IF_ERROR( ZSTD_loadEntropy_intoDDict(ddict, dictContentType) , "");
  ------------------
  |  |  146|  2.48k|    do {                                                                           \
  |  |  147|  2.48k|        size_t const err_code = (err);                                             \
  |  |  148|  2.48k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 578, False: 1.91k]
  |  |  ------------------
  |  |  149|    578|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|    578|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 578]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|    578|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|    578|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|    578|    do {                                           \
  |  |  |  |   99|    578|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 578]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    578|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 578]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|    578|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|    578|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 578]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|    578|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|    578|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 578]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|    578|            return err_code;                                                       \
  |  |  155|    578|        }                                                                          \
  |  |  156|  2.48k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 1.91k]
  |  |  ------------------
  ------------------
  155|       |
  156|  1.91k|    return 0;
  157|  2.48k|}
zstd_ddict.c:ZSTD_loadEntropy_intoDDict:
  100|  2.48k|{
  101|  2.48k|    ddict->dictID = 0;
  102|  2.48k|    ddict->dictHeaderSize = 0;
  103|  2.48k|    ddict->entropyPresent = 0;
  104|  2.48k|    if (dictContentType == ZSTD_dct_rawContent) return 0;
  ------------------
  |  Branch (104:9): [True: 0, False: 2.48k]
  ------------------
  105|       |
  106|  2.48k|    if (ddict->dictSize < 8) {
  ------------------
  |  Branch (106:9): [True: 302, False: 2.18k]
  ------------------
  107|    302|        if (dictContentType == ZSTD_dct_fullDict)
  ------------------
  |  Branch (107:13): [True: 0, False: 302]
  ------------------
  108|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  109|    302|        return 0;   /* pure content mode */
  110|    302|    }
  111|  2.18k|    {   U32 const magic = MEM_readLE32(ddict->dictContent);
  112|  2.18k|        if (magic != ZSTD_MAGIC_DICTIONARY) {
  ------------------
  |  |  143|  2.18k|#define ZSTD_MAGIC_DICTIONARY       0xEC30A437    /* valid since v0.7.0 */
  ------------------
  |  Branch (112:13): [True: 1.14k, False: 1.04k]
  ------------------
  113|  1.14k|            if (dictContentType == ZSTD_dct_fullDict)
  ------------------
  |  Branch (113:17): [True: 0, False: 1.14k]
  ------------------
  114|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  115|  1.14k|            return 0;   /* pure content mode */
  116|  1.14k|        }
  117|  2.18k|    }
  118|  1.04k|    ddict->dictID = MEM_readLE32((const char*)ddict->dictContent + ZSTD_FRAMEIDSIZE);
  ------------------
  |  |   82|  1.04k|#define ZSTD_FRAMEIDSIZE 4   /* magic number size */
  ------------------
  119|       |
  120|       |    /* load entropy tables */
  121|  1.04k|    {   size_t const headerSize = ZSTD_loadDEntropy(
  122|  1.04k|                &ddict->entropy, ddict->dictContent, ddict->dictSize);
  123|  1.04k|        RETURN_ERROR_IF(ZSTD_isError(headerSize), dictionary_corrupted, "");
  ------------------
  |  |  114|  1.04k|    do {                                                                       \
  |  |  115|  1.04k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 578, False: 469]
  |  |  ------------------
  |  |  116|    578|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    578|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 578]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    578|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    578|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    578|    do {                                           \
  |  |  |  |   99|    578|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 578]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    578|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 578]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    578|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    578|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 578]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    578|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    578|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 578]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    578|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    578|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    578|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    578|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    578|        }                                                                      \
  |  |  123|  1.04k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 469]
  |  |  ------------------
  ------------------
  124|    469|        assert(headerSize <= ddict->dictSize);
  ------------------
  |  |   70|    469|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  125|    469|        ddict->dictHeaderSize = headerSize;
  126|    469|    }
  127|      0|    ddict->entropyPresent = 1;
  128|    469|    return 0;
  129|  1.04k|}

ZSTD_sizeof_DCtx:
  218|  5.19k|{
  219|  5.19k|    if (dctx==NULL) return 0;   /* support sizeof NULL */
  ------------------
  |  Branch (219:9): [True: 0, False: 5.19k]
  ------------------
  220|  5.19k|    return sizeof(*dctx)
  221|  5.19k|           + ZSTD_sizeof_DDict(dctx->ddictLocal)
  222|  5.19k|           + dctx->inBuffSize + dctx->outBuffSize;
  223|  5.19k|}
ZSTD_createDCtx:
  309|  5.19k|{
  310|  5.19k|    DEBUGLOG(3, "ZSTD_createDCtx");
  ------------------
  |  |  104|  5.19k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 5.19k]
  |  |  ------------------
  ------------------
  311|  5.19k|    return ZSTD_createDCtx_internal(ZSTD_defaultCMem);
  312|  5.19k|}
ZSTD_freeDCtx:
  349|  5.19k|{
  350|  5.19k|    if (dctx==NULL) return 0;   /* support free on NULL */
  ------------------
  |  Branch (350:9): [True: 0, False: 5.19k]
  ------------------
  351|  5.19k|    RETURN_ERROR_IF(dctx->staticSize, memory_allocation, "not compatible with static DCtx");
  ------------------
  |  |  114|  5.19k|    do {                                                                       \
  |  |  115|  5.19k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 5.19k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  5.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.19k]
  |  |  ------------------
  ------------------
  352|  5.19k|    {   ZSTD_customMem const cMem = dctx->customMem;
  353|  5.19k|        ZSTD_clearDict(dctx);
  354|  5.19k|        ZSTD_customFree(dctx->inBuff, cMem);
  355|  5.19k|        dctx->inBuff = NULL;
  356|       |#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)
  357|       |        if (dctx->legacyContext)
  358|       |            ZSTD_freeLegacyStreamContext(dctx->legacyContext, dctx->previousLegacyVersion);
  359|       |#endif
  360|  5.19k|        ZSTD_clearDDictSet(dctx);
  361|  5.19k|        ZSTD_customFree(dctx, cMem);
  362|  5.19k|        return 0;
  363|  5.19k|    }
  364|  5.19k|}
ZSTD_getFrameHeader_advanced:
  463|  8.43k|{
  464|  8.43k|    const BYTE* ip = (const BYTE*)src;
  465|  8.43k|    size_t const minInputSize = ZSTD_startingInputLength(format);
  466|       |
  467|  8.43k|    DEBUGLOG(5, "ZSTD_getFrameHeader_advanced: minInputSize = %zu, srcSize = %zu", minInputSize, srcSize);
  ------------------
  |  |  104|  8.43k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 8.43k]
  |  |  ------------------
  ------------------
  468|       |
  469|  8.43k|    if (srcSize > 0) {
  ------------------
  |  Branch (469:9): [True: 8.43k, False: 0]
  ------------------
  470|       |        /* note : technically could be considered an assert(), since it's an invalid entry */
  471|  8.43k|        RETURN_ERROR_IF(src==NULL, GENERIC, "invalid parameter : src==NULL, but srcSize>0");
  ------------------
  |  |  114|  8.43k|    do {                                                                       \
  |  |  115|  8.43k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 8.43k]
  |  |  ------------------
  |  |  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.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 8.43k]
  |  |  ------------------
  ------------------
  472|  8.43k|    }
  473|  8.43k|    if (srcSize < minInputSize) {
  ------------------
  |  Branch (473:9): [True: 0, False: 8.43k]
  ------------------
  474|      0|        if (srcSize > 0 && format != ZSTD_f_zstd1_magicless) {
  ------------------
  |  Branch (474:13): [True: 0, False: 0]
  |  Branch (474:28): [True: 0, False: 0]
  ------------------
  475|       |            /* when receiving less than @minInputSize bytes,
  476|       |             * control these bytes at least correspond to a supported magic number
  477|       |             * in order to error out early if they don't.
  478|       |            **/
  479|      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]
  |  |  ------------------
  ------------------
  480|      0|            unsigned char hbuf[4]; MEM_writeLE32(hbuf, ZSTD_MAGICNUMBER);
  ------------------
  |  |  142|      0|#define ZSTD_MAGICNUMBER            0xFD2FB528    /* valid since v0.8.0 */
  ------------------
  481|      0|            assert(src != NULL);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  482|      0|            ZSTD_memcpy(hbuf, src, toCopy);
  ------------------
  |  |   44|      0|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  483|      0|            if ( MEM_readLE32(hbuf) != ZSTD_MAGICNUMBER ) {
  ------------------
  |  |  142|      0|#define ZSTD_MAGICNUMBER            0xFD2FB528    /* valid since v0.8.0 */
  ------------------
  |  Branch (483:18): [True: 0, False: 0]
  ------------------
  484|       |                /* not a zstd frame : let's check if it's a skippable frame */
  485|      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 */
  ------------------
  486|      0|                ZSTD_memcpy(hbuf, src, toCopy);
  ------------------
  |  |   44|      0|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  487|      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 (487:21): [True: 0, False: 0]
  ------------------
  488|      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]
  |  |  ------------------
  ------------------
  489|      0|                                "first bytes don't correspond to any supported magic number");
  490|      0|        }   }   }
  491|      0|        return minInputSize;
  492|      0|    }
  493|       |
  494|  8.43k|    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|  8.43k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  495|  8.43k|    if ( (format != ZSTD_f_zstd1_magicless)
  ------------------
  |  Branch (495:10): [True: 8.43k, False: 0]
  ------------------
  496|  8.43k|      && (MEM_readLE32(src) != ZSTD_MAGICNUMBER) ) {
  ------------------
  |  |  142|  8.43k|#define ZSTD_MAGICNUMBER            0xFD2FB528    /* valid since v0.8.0 */
  ------------------
  |  Branch (496:10): [True: 165, False: 8.26k]
  ------------------
  497|    165|        if ((MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  145|    165|#define ZSTD_MAGIC_SKIPPABLE_MASK   0xFFFFFFF0
  ------------------
                      if ((MEM_readLE32(src) & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  144|    165|#define ZSTD_MAGIC_SKIPPABLE_START  0x184D2A50    /* all 16 values, from 0x184D2A50 to 0x184D2A5F, signal the beginning of a skippable frame */
  ------------------
  |  Branch (497:13): [True: 0, False: 165]
  ------------------
  498|       |            /* skippable frame */
  499|      0|            if (srcSize < ZSTD_SKIPPABLEHEADERSIZE)
  ------------------
  |  | 1360|      0|#define ZSTD_SKIPPABLEHEADERSIZE    8
  ------------------
  |  Branch (499:17): [True: 0, False: 0]
  ------------------
  500|      0|                return ZSTD_SKIPPABLEHEADERSIZE; /* magic number + frame length */
  ------------------
  |  | 1360|      0|#define ZSTD_SKIPPABLEHEADERSIZE    8
  ------------------
  501|      0|            ZSTD_memset(zfhPtr, 0, sizeof(*zfhPtr));
  ------------------
  |  |   46|      0|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  502|      0|            zfhPtr->frameType = ZSTD_skippableFrame;
  503|      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 */
  ------------------
  504|      0|            zfhPtr->headerSize = ZSTD_SKIPPABLEHEADERSIZE;
  ------------------
  |  | 1360|      0|#define ZSTD_SKIPPABLEHEADERSIZE    8
  ------------------
  505|      0|            zfhPtr->frameContentSize = MEM_readLE32((const char *)src + ZSTD_FRAMEIDSIZE);
  ------------------
  |  |   82|      0|#define ZSTD_FRAMEIDSIZE 4   /* magic number size */
  ------------------
  506|      0|            return 0;
  507|      0|        }
  508|    165|        RETURN_ERROR(prefix_unknown, "");
  ------------------
  |  |  131|    165|    do {                                                                     \
  |  |  132|    165|        RAWLOG(3, "%s:%d: ERROR!: unconditional check failed, returning %s", \
  |  |  ------------------
  |  |  |  |  103|    165|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 165]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  133|    165|              __FILE__, __LINE__, ERR_QUOTE(ERROR(err)));                    \
  |  |  134|    165|        _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                               \
  |  |  ------------------
  |  |  |  |   98|    165|    do {                                           \
  |  |  |  |   99|    165|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 165]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    165|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 165]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  135|    165|        RAWLOG(3, ": " __VA_ARGS__);                                         \
  |  |  ------------------
  |  |  |  |  103|    165|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 165]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  136|    165|        RAWLOG(3, "\n");                                                     \
  |  |  ------------------
  |  |  |  |  103|    165|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 165]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  137|    165|        return ERROR(err);                                                   \
  |  |  ------------------
  |  |  |  |   49|    165|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    165|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    165|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  138|    165|    } while(0)
  |  |  ------------------
  |  |  |  Branch (138:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  509|    165|    }
  510|       |
  511|       |    /* ensure there is enough `srcSize` to fully read/decode frame header */
  512|  8.26k|    {   size_t const fhsize = ZSTD_frameHeaderSize_internal(src, srcSize, format);
  513|  8.26k|        if (srcSize < fhsize) return fhsize;
  ------------------
  |  Branch (513:13): [True: 0, False: 8.26k]
  ------------------
  514|  8.26k|        zfhPtr->headerSize = (U32)fhsize;
  515|  8.26k|    }
  516|       |
  517|      0|    {   BYTE const fhdByte = ip[minInputSize-1];
  518|  8.26k|        size_t pos = minInputSize;
  519|  8.26k|        U32 const dictIDSizeCode = fhdByte&3;
  520|  8.26k|        U32 const checksumFlag = (fhdByte>>2)&1;
  521|  8.26k|        U32 const singleSegment = (fhdByte>>5)&1;
  522|  8.26k|        U32 const fcsID = fhdByte>>6;
  523|  8.26k|        U64 windowSize = 0;
  524|  8.26k|        U32 dictID = 0;
  525|  8.26k|        U64 frameContentSize = ZSTD_CONTENTSIZE_UNKNOWN;
  ------------------
  |  |  203|  8.26k|#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
  ------------------
  526|  8.26k|        RETURN_ERROR_IF((fhdByte & 0x08) != 0, frameParameter_unsupported,
  ------------------
  |  |  114|  8.26k|    do {                                                                       \
  |  |  115|  8.26k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 8.26k]
  |  |  ------------------
  |  |  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|  8.26k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 8.26k]
  |  |  ------------------
  ------------------
  527|  8.26k|                        "reserved bits, must be zero");
  528|       |
  529|  8.26k|        if (!singleSegment) {
  ------------------
  |  Branch (529:13): [True: 4.85k, False: 3.41k]
  ------------------
  530|  4.85k|            BYTE const wlByte = ip[pos++];
  531|  4.85k|            U32 const windowLog = (wlByte >> 3) + ZSTD_WINDOWLOG_ABSOLUTEMIN;
  ------------------
  |  |   78|  4.85k|#define ZSTD_WINDOWLOG_ABSOLUTEMIN 10
  ------------------
  532|  4.85k|            RETURN_ERROR_IF(windowLog > ZSTD_WINDOWLOG_MAX, frameParameter_windowTooLarge, "");
  ------------------
  |  |  114|  4.85k|    do {                                                                       \
  |  |  115|  14.5k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [Folded, False: 4.85k]
  |  |  |  Branch (115:13): [True: 1, False: 4.85k]
  |  |  ------------------
  |  |  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|  4.85k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.85k]
  |  |  ------------------
  ------------------
  533|  4.85k|            windowSize = (1ULL << windowLog);
  534|  4.85k|            windowSize += (windowSize >> 3) * (wlByte&7);
  535|  4.85k|        }
  536|  8.26k|        switch(dictIDSizeCode)
  537|  8.26k|        {
  538|      0|            default:
  ------------------
  |  Branch (538:13): [True: 0, False: 8.26k]
  ------------------
  539|      0|                assert(0);  /* impossible */
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  540|      0|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|      0|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  541|  5.42k|            case 0 : break;
  ------------------
  |  Branch (541:13): [True: 5.42k, False: 2.84k]
  ------------------
  542|  1.36k|            case 1 : dictID = ip[pos]; pos++; break;
  ------------------
  |  Branch (542:13): [True: 1.36k, False: 6.90k]
  ------------------
  543|    914|            case 2 : dictID = MEM_readLE16(ip+pos); pos+=2; break;
  ------------------
  |  Branch (543:13): [True: 914, False: 7.35k]
  ------------------
  544|    564|            case 3 : dictID = MEM_readLE32(ip+pos); pos+=4; break;
  ------------------
  |  Branch (544:13): [True: 564, False: 7.70k]
  ------------------
  545|  8.26k|        }
  546|  8.26k|        switch(fcsID)
  547|  8.26k|        {
  548|      0|            default:
  ------------------
  |  Branch (548:13): [True: 0, False: 8.26k]
  ------------------
  549|      0|                assert(0);  /* impossible */
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  550|      0|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|      0|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  551|  5.56k|            case 0 : if (singleSegment) frameContentSize = ip[pos]; break;
  ------------------
  |  Branch (551:13): [True: 5.56k, False: 2.69k]
  |  Branch (551:26): [True: 1.19k, False: 4.37k]
  ------------------
  552|    333|            case 1 : frameContentSize = MEM_readLE16(ip+pos)+256; break;
  ------------------
  |  Branch (552:13): [True: 333, False: 7.93k]
  ------------------
  553|    497|            case 2 : frameContentSize = MEM_readLE32(ip+pos); break;
  ------------------
  |  Branch (553:13): [True: 497, False: 7.76k]
  ------------------
  554|  1.86k|            case 3 : frameContentSize = MEM_readLE64(ip+pos); break;
  ------------------
  |  Branch (554:13): [True: 1.86k, False: 6.39k]
  ------------------
  555|  8.26k|        }
  556|  8.26k|        if (singleSegment) windowSize = frameContentSize;
  ------------------
  |  Branch (556:13): [True: 3.41k, False: 4.85k]
  ------------------
  557|       |
  558|  8.26k|        zfhPtr->frameType = ZSTD_frame;
  559|  8.26k|        zfhPtr->frameContentSize = frameContentSize;
  560|  8.26k|        zfhPtr->windowSize = windowSize;
  561|  8.26k|        zfhPtr->blockSizeMax = (unsigned) MIN(windowSize, ZSTD_BLOCKSIZE_MAX);
  ------------------
  |  |   54|  8.26k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 4.59k, False: 3.66k]
  |  |  ------------------
  ------------------
  562|  8.26k|        zfhPtr->dictID = dictID;
  563|  8.26k|        zfhPtr->checksumFlag = checksumFlag;
  564|  8.26k|    }
  565|      0|    return 0;
  566|  8.26k|}
ZSTD_decompressDCtx:
 1231|  4.76k|{
 1232|       |    /* Reset first: this may discard a prefix abandoned by an unfinished
 1233|       |     * stream, which must happen before the dictionary is resolved. */
 1234|  4.76k|    ZSTD_DCtx_resetSession(dctx);
 1235|  4.76k|    if (dctx->refMultipleDDicts && dctx->ddictSet)
  ------------------
  |  Branch (1235:9): [True: 0, False: 4.76k]
  |  Branch (1235:36): [True: 0, False: 0]
  ------------------
 1236|      0|        return ZSTD_decompressMultiFrame(dctx, dst, dstCapacity, src, srcSize,
 1237|      0|                                         NULL, 0, NULL, 1);
 1238|       |    /* Preserve the single-dictionary behavior: resolve once for the entire
 1239|       |     * call, including concatenated frames and single-use prefixes. */
 1240|  4.76k|    return ZSTD_decompressMultiFrame(dctx, dst, dstCapacity, src, srcSize,
 1241|       |                                     NULL, 0, ZSTD_getDDict(dctx), 0);
 1242|  4.76k|}
ZSTD_loadDEntropy:
 1513|  1.04k|{
 1514|  1.04k|    const BYTE* dictPtr = (const BYTE*)dict;
 1515|  1.04k|    const BYTE* const dictEnd = dictPtr + dictSize;
 1516|       |
 1517|  1.04k|    RETURN_ERROR_IF(dictSize <= 8, dictionary_corrupted, "dict is too small");
  ------------------
  |  |  114|  1.04k|    do {                                                                       \
  |  |  115|  1.04k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 1.04k]
  |  |  ------------------
  |  |  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|  1.04k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.04k]
  |  |  ------------------
  ------------------
 1518|  1.04k|    assert(MEM_readLE32(dict) == ZSTD_MAGIC_DICTIONARY);   /* dict must be valid */
  ------------------
  |  |   70|  1.04k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1519|  1.04k|    dictPtr += 8;   /* skip header = magic + dictID */
 1520|       |
 1521|  1.04k|    ZSTD_STATIC_ASSERT(offsetof(ZSTD_entropyDTables_t, OFTable) == offsetof(ZSTD_entropyDTables_t, LLTable) + sizeof(entropy->LLTable));
  ------------------
  |  |   43|  1.04k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  1.04k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1522|  1.04k|    ZSTD_STATIC_ASSERT(offsetof(ZSTD_entropyDTables_t, MLTable) == offsetof(ZSTD_entropyDTables_t, OFTable) + sizeof(entropy->OFTable));
  ------------------
  |  |   43|  1.04k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  1.04k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1523|  1.04k|    ZSTD_STATIC_ASSERT(sizeof(entropy->LLTable) + sizeof(entropy->OFTable) + sizeof(entropy->MLTable) >= HUF_DECOMPRESS_WORKSPACE_SIZE);
  ------------------
  |  |   43|  1.04k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  1.04k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1524|  1.04k|    {   void* const workspace = &entropy->LLTable;   /* use fse tables as temporary workspace; implies fse tables are grouped together */
 1525|  1.04k|        size_t const workspaceSize = sizeof(entropy->LLTable) + sizeof(entropy->OFTable) + sizeof(entropy->MLTable);
 1526|       |#ifdef HUF_FORCE_DECOMPRESS_X1
 1527|       |        /* in minimal huffman, we always use X1 variants */
 1528|       |        size_t const hSize = HUF_readDTableX1_wksp(entropy->hufTable,
 1529|       |                                                dictPtr, dictEnd - dictPtr,
 1530|       |                                                workspace, workspaceSize, /* flags */ 0);
 1531|       |#else
 1532|  1.04k|        size_t const hSize = HUF_readDTableX2_wksp(entropy->hufTable,
 1533|  1.04k|                                                dictPtr, (size_t)(dictEnd - dictPtr),
 1534|  1.04k|                                                workspace, workspaceSize, /* flags */ 0);
 1535|  1.04k|#endif
 1536|  1.04k|        RETURN_ERROR_IF(HUF_isError(hSize), dictionary_corrupted, "");
  ------------------
  |  |  114|  1.04k|    do {                                                                       \
  |  |  115|  1.04k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 148, False: 897]
  |  |  ------------------
  |  |  116|    148|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    148|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 148]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    148|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    148|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    148|    do {                                           \
  |  |  |  |   99|    148|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 148]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    148|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 148]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    148|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    148|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 148]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    148|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    148|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 148]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    148|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    148|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    148|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    148|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    148|        }                                                                      \
  |  |  123|  1.04k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 897]
  |  |  ------------------
  ------------------
 1537|    897|        dictPtr += hSize;
 1538|    897|    }
 1539|       |
 1540|      0|    {   short offcodeNCount[MaxOff+1];
 1541|    897|        unsigned offcodeMaxValue = MaxOff, offcodeLog;
  ------------------
  |  |  106|    897|#define MaxOff  31
  ------------------
 1542|    897|        size_t const offcodeHeaderSize = FSE_readNCount(offcodeNCount, &offcodeMaxValue, &offcodeLog, dictPtr, (size_t)(dictEnd-dictPtr));
 1543|    897|        RETURN_ERROR_IF(FSE_isError(offcodeHeaderSize), dictionary_corrupted, "");
  ------------------
  |  |  114|    897|    do {                                                                       \
  |  |  115|    897|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 181, False: 716]
  |  |  ------------------
  |  |  116|    181|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    181|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 181]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    181|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    181|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    181|    do {                                           \
  |  |  |  |   99|    181|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 181]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    181|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 181]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    181|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    181|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 181]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    181|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    181|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 181]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    181|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    181|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    181|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    181|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    181|        }                                                                      \
  |  |  123|    897|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 716]
  |  |  ------------------
  ------------------
 1544|    716|        RETURN_ERROR_IF(offcodeMaxValue > MaxOff, dictionary_corrupted, "");
  ------------------
  |  |  114|    716|    do {                                                                       \
  |  |  115|    716|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 716]
  |  |  ------------------
  |  |  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|    716|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 716]
  |  |  ------------------
  ------------------
 1545|    716|        RETURN_ERROR_IF(offcodeLog > OffFSELog, dictionary_corrupted, "");
  ------------------
  |  |  114|    716|    do {                                                                       \
  |  |  115|    716|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 7, False: 709]
  |  |  ------------------
  |  |  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|    716|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 709]
  |  |  ------------------
  ------------------
 1546|    709|        ZSTD_buildFSETable( entropy->OFTable,
 1547|    709|                            offcodeNCount, offcodeMaxValue,
 1548|    709|                            OF_base, OF_bits,
 1549|    709|                            offcodeLog,
 1550|    709|                            entropy->workspace, sizeof(entropy->workspace),
 1551|    709|                            /* bmi2 */0);
 1552|    709|        dictPtr += offcodeHeaderSize;
 1553|    709|    }
 1554|       |
 1555|      0|    {   short matchlengthNCount[MaxML+1];
 1556|    709|        unsigned matchlengthMaxValue = MaxML, matchlengthLog;
  ------------------
  |  |  103|    709|#define MaxML   52
  ------------------
 1557|    709|        size_t const matchlengthHeaderSize = FSE_readNCount(matchlengthNCount, &matchlengthMaxValue, &matchlengthLog, dictPtr, (size_t)(dictEnd-dictPtr));
 1558|    709|        RETURN_ERROR_IF(FSE_isError(matchlengthHeaderSize), dictionary_corrupted, "");
  ------------------
  |  |  114|    709|    do {                                                                       \
  |  |  115|    709|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 25, False: 684]
  |  |  ------------------
  |  |  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|    709|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 684]
  |  |  ------------------
  ------------------
 1559|    684|        RETURN_ERROR_IF(matchlengthMaxValue > MaxML, dictionary_corrupted, "");
  ------------------
  |  |  114|    684|    do {                                                                       \
  |  |  115|    684|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 684]
  |  |  ------------------
  |  |  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|    684|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 684]
  |  |  ------------------
  ------------------
 1560|    684|        RETURN_ERROR_IF(matchlengthLog > MLFSELog, dictionary_corrupted, "");
  ------------------
  |  |  114|    684|    do {                                                                       \
  |  |  115|    684|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4, False: 680]
  |  |  ------------------
  |  |  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|    684|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 680]
  |  |  ------------------
  ------------------
 1561|    680|        ZSTD_buildFSETable( entropy->MLTable,
 1562|    680|                            matchlengthNCount, matchlengthMaxValue,
 1563|    680|                            ML_base, ML_bits,
 1564|    680|                            matchlengthLog,
 1565|    680|                            entropy->workspace, sizeof(entropy->workspace),
 1566|    680|                            /* bmi2 */ 0);
 1567|    680|        dictPtr += matchlengthHeaderSize;
 1568|    680|    }
 1569|       |
 1570|      0|    {   short litlengthNCount[MaxLL+1];
 1571|    680|        unsigned litlengthMaxValue = MaxLL, litlengthLog;
  ------------------
  |  |  104|    680|#define MaxLL   35
  ------------------
 1572|    680|        size_t const litlengthHeaderSize = FSE_readNCount(litlengthNCount, &litlengthMaxValue, &litlengthLog, dictPtr, (size_t)(dictEnd-dictPtr));
 1573|    680|        RETURN_ERROR_IF(FSE_isError(litlengthHeaderSize), dictionary_corrupted, "");
  ------------------
  |  |  114|    680|    do {                                                                       \
  |  |  115|    680|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 34, False: 646]
  |  |  ------------------
  |  |  116|     34|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     34|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 34]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     34|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     34|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     34|    do {                                           \
  |  |  |  |   99|     34|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 34]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     34|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 34]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     34|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     34|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 34]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     34|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     34|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 34]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     34|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     34|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     34|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     34|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     34|        }                                                                      \
  |  |  123|    680|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 646]
  |  |  ------------------
  ------------------
 1574|    646|        RETURN_ERROR_IF(litlengthMaxValue > MaxLL, dictionary_corrupted, "");
  ------------------
  |  |  114|    646|    do {                                                                       \
  |  |  115|    646|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 646]
  |  |  ------------------
  |  |  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|    646|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 646]
  |  |  ------------------
  ------------------
 1575|    646|        RETURN_ERROR_IF(litlengthLog > LLFSELog, dictionary_corrupted, "");
  ------------------
  |  |  114|    646|    do {                                                                       \
  |  |  115|    646|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 643]
  |  |  ------------------
  |  |  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|    646|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 643]
  |  |  ------------------
  ------------------
 1576|    643|        ZSTD_buildFSETable( entropy->LLTable,
 1577|    643|                            litlengthNCount, litlengthMaxValue,
 1578|    643|                            LL_base, LL_bits,
 1579|    643|                            litlengthLog,
 1580|    643|                            entropy->workspace, sizeof(entropy->workspace),
 1581|    643|                            /* bmi2 */ 0);
 1582|    643|        dictPtr += litlengthHeaderSize;
 1583|    643|    }
 1584|       |
 1585|    643|    RETURN_ERROR_IF(dictPtr+12 > dictEnd, dictionary_corrupted, "");
  ------------------
  |  |  114|    643|    do {                                                                       \
  |  |  115|    643|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 22, False: 621]
  |  |  ------------------
  |  |  116|     22|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     22|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     22|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     22|    do {                                           \
  |  |  |  |   99|     22|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     22|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     22|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     22|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     22|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     22|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     22|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     22|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     22|        }                                                                      \
  |  |  123|    643|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 621]
  |  |  ------------------
  ------------------
 1586|    621|    {   int i;
 1587|    621|        size_t const dictContentSize = (size_t)(dictEnd - (dictPtr+12));
 1588|  2.17k|        for (i=0; i<3; i++) {
  ------------------
  |  Branch (1588:19): [True: 1.70k, False: 469]
  ------------------
 1589|  1.70k|            U32 const rep = MEM_readLE32(dictPtr); dictPtr += 4;
 1590|  1.70k|            RETURN_ERROR_IF(rep==0 || rep > dictContentSize,
  ------------------
  |  |  114|  1.70k|    do {                                                                       \
  |  |  115|  5.11k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 1.70k]
  |  |  |  Branch (115:13): [True: 149, False: 1.55k]
  |  |  ------------------
  |  |  116|    152|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    152|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 152]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    152|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    152|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    152|    do {                                           \
  |  |  |  |   99|    152|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 152]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    152|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 152]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    152|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    152|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 152]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    152|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    152|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 152]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    152|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    152|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    152|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    152|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    152|        }                                                                      \
  |  |  123|  1.70k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.55k]
  |  |  ------------------
  ------------------
 1591|  1.70k|                            dictionary_corrupted, "");
 1592|  1.55k|            entropy->rep[i] = rep;
 1593|  1.55k|    }   }
 1594|       |
 1595|    469|    return (size_t)(dictPtr - (const BYTE*)dict);
 1596|    621|}
ZSTD_decompressBegin:
 1620|  8.46k|{
 1621|  8.46k|    assert(dctx != NULL);
  ------------------
  |  |   70|  8.46k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1622|  8.46k|#if ZSTD_TRACE
 1623|  8.46k|    dctx->traceCtx = (ZSTD_trace_decompress_begin != NULL) ? ZSTD_trace_decompress_begin(dctx) : 0;
  ------------------
  |  Branch (1623:22): [True: 0, False: 8.46k]
  ------------------
 1624|  8.46k|    dctx->traceDictSize = 0;
 1625|  8.46k|#endif
 1626|  8.46k|    dctx->expected = ZSTD_startingInputLength(dctx->format);  /* dctx->format must be properly set */
 1627|  8.46k|    dctx->stage = ZSTDds_getFrameHeaderSize;
 1628|  8.46k|    dctx->processedCSize = 0;
 1629|  8.46k|    dctx->decodedSize = 0;
 1630|  8.46k|    dctx->previousDstEnd = NULL;
 1631|  8.46k|    dctx->prefixStart = NULL;
 1632|  8.46k|    dctx->virtualStart = NULL;
 1633|  8.46k|    dctx->dictEnd = NULL;
 1634|  8.46k|    dctx->entropy.hufTable[0] = (HUF_DTable)((ZSTD_HUFFDTABLE_CAPACITY_LOG)*0x1000001);  /* cover both little and big endian */
  ------------------
  |  |   78|  8.46k|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
 1635|  8.46k|    dctx->litEntropy = dctx->fseEntropy = 0;
 1636|  8.46k|    dctx->dictID = 0;
 1637|  8.46k|    dctx->bType = bt_reserved;
 1638|  8.46k|    dctx->isFrameDecompression = 1;
 1639|  8.46k|    ZSTD_STATIC_ASSERT(sizeof(dctx->entropy.rep) == sizeof(repStartValue));
  ------------------
  |  |   43|  8.46k|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  8.46k|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1640|  8.46k|    ZSTD_memcpy(dctx->entropy.rep, repStartValue, sizeof(repStartValue));  /* initial repcodes */
  ------------------
  |  |   44|  8.46k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1641|  8.46k|    dctx->LLTptr = dctx->entropy.LLTable;
 1642|  8.46k|    dctx->MLTptr = dctx->entropy.MLTable;
 1643|  8.46k|    dctx->OFTptr = dctx->entropy.OFTable;
 1644|  8.46k|    dctx->HUFptr = dctx->entropy.hufTable;
 1645|  8.46k|    return 0;
 1646|  8.46k|}
ZSTD_decompressBegin_usingDict:
 1649|  6.10k|{
 1650|  6.10k|    FORWARD_IF_ERROR( ZSTD_decompressBegin(dctx) , "");
  ------------------
  |  |  146|  6.10k|    do {                                                                           \
  |  |  147|  6.10k|        size_t const err_code = (err);                                             \
  |  |  148|  6.10k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 0, False: 6.10k]
  |  |  ------------------
  |  |  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|  6.10k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 6.10k]
  |  |  ------------------
  ------------------
 1651|  6.10k|    if (dict && dictSize)
  ------------------
  |  Branch (1651:9): [True: 0, False: 6.10k]
  |  Branch (1651:17): [True: 0, False: 0]
  ------------------
 1652|      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]
  |  |  ------------------
  ------------------
 1653|  6.10k|            ZSTD_isError(ZSTD_decompress_insertDictionary(dctx, dict, dictSize)),
 1654|  6.10k|            dictionary_corrupted, "");
 1655|  6.10k|#if ZSTD_TRACE
 1656|  6.10k|    dctx->traceDictSize = dict ? dictSize : 0;
  ------------------
  |  Branch (1656:27): [True: 0, False: 6.10k]
  ------------------
 1657|  6.10k|#endif
 1658|  6.10k|    return 0;
 1659|  6.10k|}
ZSTD_decompressBegin_usingDDict:
 1665|  2.36k|{
 1666|  2.36k|    DEBUGLOG(4, "ZSTD_decompressBegin_usingDDict");
  ------------------
  |  |  104|  2.36k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.36k]
  |  |  ------------------
  ------------------
 1667|  2.36k|    assert(dctx != NULL);
  ------------------
  |  |   70|  2.36k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1668|  2.36k|    if (ddict) {
  ------------------
  |  Branch (1668:9): [True: 2.36k, False: 0]
  ------------------
 1669|  2.36k|        const char* const dictStart = (const char*)ZSTD_DDict_dictContent(ddict);
 1670|  2.36k|        size_t const dictSize = ZSTD_DDict_dictSize(ddict);
 1671|       |        /* An empty DDict may have NULL content. */
 1672|  2.36k|        const void* const dictEnd = dictSize != 0 ? dictStart + dictSize : dictStart;
  ------------------
  |  Branch (1672:37): [True: 2.36k, False: 0]
  ------------------
 1673|  2.36k|        dctx->ddictIsCold = (dctx->dictEnd != dictEnd);
 1674|  2.36k|        DEBUGLOG(4, "DDict is %s",
  ------------------
  |  |  104|  2.36k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.36k]
  |  |  ------------------
  ------------------
 1675|  2.36k|                    dctx->ddictIsCold ? "~cold~" : "hot!");
 1676|  2.36k|    }
 1677|  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]
  |  |  ------------------
  ------------------
 1678|  2.36k|    if (ddict) {   /* NULL ddict is equivalent to no dictionary */
  ------------------
  |  Branch (1678:9): [True: 2.36k, False: 0]
  ------------------
 1679|  2.36k|        ZSTD_copyDDictParameters(dctx, ddict);
 1680|  2.36k|#if ZSTD_TRACE
 1681|  2.36k|        dctx->traceDictSize = ZSTD_DDict_dictSize(ddict);
 1682|  2.36k|#endif
 1683|  2.36k|    }
 1684|  2.36k|    return 0;
 1685|  2.36k|}
ZSTD_decompress_usingDDict:
 1727|  2.22k|{
 1728|  2.22k|    ZSTD_DCtx_resetSession(dctx);
 1729|  2.22k|    return ZSTD_decompressMultiFrame(dctx, dst, dstCapacity, src, srcSize,
 1730|       |                                     NULL, 0,
 1731|  2.22k|                                     ddict, 0);
 1732|  2.22k|}
zstd_decompress.c:ZSTD_initDCtx_internal:
  249|  5.19k|{
  250|  5.19k|    dctx->customMem   = customMem;
  251|  5.19k|    dctx->staticSize  = 0;
  252|  5.19k|    dctx->ddict       = NULL;
  253|  5.19k|    dctx->ddictLocal  = NULL;
  254|  5.19k|    dctx->dictEnd     = NULL;
  255|  5.19k|    dctx->ddictIsCold = 0;
  256|  5.19k|    dctx->dictUses = ZSTD_dont_use;
  257|  5.19k|    dctx->inBuff      = NULL;
  258|  5.19k|    dctx->inBuffSize  = 0;
  259|  5.19k|    dctx->outBuffSize = 0;
  260|  5.19k|    dctx->streamStage = zdss_init;
  261|  5.19k|    dctx->stage       = ZSTDds_getFrameHeaderSize;
  262|  5.19k|    dctx->expected    = 0;   /* ZSTD_decompressContinue() requires ZSTD_decompressBegin() first */
  263|       |#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)
  264|       |    dctx->legacyContext = NULL;
  265|       |    dctx->previousLegacyVersion = 0;
  266|       |#endif
  267|  5.19k|    dctx->noForwardProgress = 0;
  268|  5.19k|    dctx->oversizedDuration = 0;
  269|  5.19k|    dctx->isFrameDecompression = 1;
  270|  5.19k|#if DYNAMIC_BMI2
  271|  5.19k|    ZSTD_SET_BMI2(dctx->bmi2, ZSTD_cpuSupportsBmi2());
  ------------------
  |  |   37|  5.19k|#  define ZSTD_SET_BMI2(state, value) do { (state) = (value); } while (0)
  |  |  ------------------
  |  |  |  Branch (37:72): [Folded, False: 5.19k]
  |  |  ------------------
  ------------------
  272|  5.19k|#endif
  273|  5.19k|    dctx->ddictSet = NULL;
  274|  5.19k|    ZSTD_DCtx_resetParameters(dctx);
  275|  5.19k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  276|       |    dctx->dictContentEndForFuzzing = NULL;
  277|  5.19k|#endif
  278|  5.19k|}
zstd_decompress.c:ZSTD_createDCtx_internal:
  293|  5.19k|static ZSTD_DCtx* ZSTD_createDCtx_internal(ZSTD_customMem customMem) {
  294|  5.19k|    if ((!customMem.customAlloc) ^ (!customMem.customFree)) return NULL;
  ------------------
  |  Branch (294:9): [True: 0, False: 5.19k]
  ------------------
  295|       |
  296|  5.19k|    {   ZSTD_DCtx* const dctx = (ZSTD_DCtx*)ZSTD_customMalloc(sizeof(*dctx), customMem);
  297|  5.19k|        if (!dctx) return NULL;
  ------------------
  |  Branch (297:13): [True: 0, False: 5.19k]
  ------------------
  298|  5.19k|        ZSTD_initDCtx_internal(dctx, customMem);
  299|  5.19k|        return dctx;
  300|  5.19k|    }
  301|  5.19k|}
zstd_decompress.c:ZSTD_clearDict:
  315|  9.96k|{
  316|  9.96k|    ZSTD_freeDDict(dctx->ddictLocal);
  317|  9.96k|    dctx->ddictLocal = NULL;
  318|       |    dctx->ddict = NULL;
  319|  9.96k|    dctx->dictUses = ZSTD_dont_use;
  320|  9.96k|}
zstd_decompress.c:ZSTD_clearDDictSet:
  340|  5.19k|{
  341|  5.19k|    if (dctx->ddictSet != NULL) {
  ------------------
  |  Branch (341:9): [True: 0, False: 5.19k]
  ------------------
  342|      0|        assert(!dctx->staticSize);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  343|      0|        ZSTD_freeDDictHashSet(dctx->ddictSet, dctx->customMem);
  344|       |        dctx->ddictSet = NULL;
  345|      0|    }
  346|  5.19k|}
zstd_decompress.c:ZSTD_frameHeaderSize_internal:
  432|  16.7k|{
  433|  16.7k|    size_t const minInputSize = ZSTD_startingInputLength(format);
  434|  16.7k|    RETURN_ERROR_IF(srcSize < minInputSize, srcSize_wrong, "");
  ------------------
  |  |  114|  16.7k|    do {                                                                       \
  |  |  115|  16.7k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 16.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|  16.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  435|       |
  436|  16.7k|    {   BYTE const fhd = ((const BYTE*)src)[minInputSize-1];
  437|  16.7k|        U32 const dictID= fhd & 3;
  438|  16.7k|        U32 const singleSegment = (fhd >> 5) & 1;
  439|  16.7k|        U32 const fcsId = fhd >> 6;
  440|  16.7k|        return minInputSize + !singleSegment
  441|  16.7k|             + ZSTD_did_fieldSize[dictID] + ZSTD_fcs_fieldSize[fcsId]
  442|  16.7k|             + (singleSegment && !fcsId);
  ------------------
  |  Branch (442:17): [True: 6.87k, False: 9.83k]
  |  Branch (442:34): [True: 2.41k, False: 4.46k]
  ------------------
  443|  16.7k|    }
  444|  16.7k|}
zstd_decompress.c:ZSTD_startingInputLength:
  229|  44.2k|{
  230|  44.2k|    size_t const startingInputLength = ZSTD_FRAMEHEADERSIZE_PREFIX(format);
  ------------------
  |  | 1357|  44.2k|#define ZSTD_FRAMEHEADERSIZE_PREFIX(format) ((format) == ZSTD_f_zstd1 ? 5 : 1)   /* minimum input size required to query frame header size */
  |  |  ------------------
  |  |  |  Branch (1357:46): [True: 44.2k, False: 0]
  |  |  ------------------
  ------------------
  231|       |    /* only supports formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless */
  232|  44.2k|    assert( (format == ZSTD_f_zstd1) || (format == ZSTD_f_zstd1_magicless) );
  ------------------
  |  |   70|  44.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  233|  44.2k|    return startingInputLength;
  234|  44.2k|}
zstd_decompress.c:readSkippableFrameSize:
  603|     91|{
  604|     91|    size_t const skippableHeaderSize = ZSTD_SKIPPABLEHEADERSIZE;
  ------------------
  |  | 1360|     91|#define ZSTD_SKIPPABLEHEADERSIZE    8
  ------------------
  605|     91|    U32 sizeU32;
  606|       |
  607|     91|    RETURN_ERROR_IF(srcSize < ZSTD_SKIPPABLEHEADERSIZE, srcSize_wrong, "");
  ------------------
  |  |  114|     91|    do {                                                                       \
  |  |  115|     91|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 89]
  |  |  ------------------
  |  |  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|     91|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 89]
  |  |  ------------------
  ------------------
  608|       |
  609|     89|    sizeU32 = MEM_readLE32((BYTE const*)src + ZSTD_FRAMEIDSIZE);
  ------------------
  |  |   82|     89|#define ZSTD_FRAMEIDSIZE 4   /* magic number size */
  ------------------
  610|     89|    RETURN_ERROR_IF((U32)(sizeU32 + ZSTD_SKIPPABLEHEADERSIZE) < sizeU32,
  ------------------
  |  |  114|     89|    do {                                                                       \
  |  |  115|     89|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 87]
  |  |  ------------------
  |  |  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|     89|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 87]
  |  |  ------------------
  ------------------
  611|     89|                    frameParameter_unsupported, "");
  612|     87|    {   size_t const skippableSize = skippableHeaderSize + sizeU32;
  613|     87|        RETURN_ERROR_IF(skippableSize > srcSize, srcSize_wrong, "");
  ------------------
  |  |  114|     87|    do {                                                                       \
  |  |  115|     87|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 69, False: 18]
  |  |  ------------------
  |  |  116|     69|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     69|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 69]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     69|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     69|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     69|    do {                                           \
  |  |  |  |   99|     69|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 69]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     69|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 69]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     69|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     69|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 69]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     69|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     69|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 69]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     69|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     69|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     69|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     69|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     69|        }                                                                      \
  |  |  123|     87|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 18]
  |  |  ------------------
  ------------------
  614|     18|        return skippableSize;
  615|     87|    }
  616|     87|}
zstd_decompress.c:ZSTD_DCtx_resetSession:
  328|  6.98k|{
  329|       |    /* A prefix is only used once : if a frame was started, it is abandoned now,
  330|       |     * so the prefix must not leak into the next frame */
  331|  6.98k|    if (dctx->streamStage != zdss_init && dctx->dictUses == ZSTD_use_once)
  ------------------
  |  Branch (331:9): [True: 0, False: 6.98k]
  |  Branch (331:43): [True: 0, False: 0]
  ------------------
  332|      0|        ZSTD_clearDict(dctx);
  333|  6.98k|    dctx->streamStage = zdss_init;
  334|  6.98k|    dctx->noForwardProgress = 0;
  335|  6.98k|    dctx->isFrameDecompression = 1;
  336|  6.98k|}
zstd_decompress.c:ZSTD_decompressMultiFrame:
 1093|  6.98k|{
 1094|  6.98k|    void* const dststart = dst;
 1095|  6.98k|    int moreThan1Frame = 0;
 1096|       |
 1097|  6.98k|    DEBUGLOG(5, "ZSTD_decompressMultiFrame");
  ------------------
  |  |  104|  6.98k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 6.98k]
  |  |  ------------------
  ------------------
 1098|  6.98k|    assert(dict==NULL || ddict==NULL);  /* either dict or ddict set, not both */
  ------------------
  |  |   70|  6.98k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1099|       |
 1100|  6.98k|    assert(!useDDictSet || (dctx->refMultipleDDicts && dctx->ddictSet
  ------------------
  |  |   70|  6.98k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1101|  6.98k|                           && dctx->ddictLocal == NULL && dctx->ddict == NULL
 1102|  6.98k|                           && dict == NULL && ddict == NULL));
 1103|       |
 1104|  10.5k|    while (srcSize >= ZSTD_startingInputLength(dctx->format)) {
  ------------------
  |  Branch (1104:12): [True: 8.56k, False: 2.03k]
  ------------------
 1105|  8.56k|        const ZSTD_DDict* frameDDict = ddict;
 1106|       |
 1107|       |#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)
 1108|       |        if (dctx->format == ZSTD_f_zstd1 && ZSTD_isLegacy(src, srcSize)) {
 1109|       |            size_t decodedSize;
 1110|       |            const void* const legacyDict = ddict ? ZSTD_DDict_dictContent(ddict) : dict;
 1111|       |            size_t const legacyDictSize = ddict ? ZSTD_DDict_dictSize(ddict) : dictSize;
 1112|       |            size_t frameSize;
 1113|       |            RETURN_ERROR_IF(useDDictSet, parameter_unsupported,
 1114|       |                            "DDict-set selection is not supported for legacy frames");
 1115|       |            frameSize = ZSTD_findFrameCompressedSizeLegacy(src, srcSize);
 1116|       |            if (ZSTD_isError(frameSize)) return frameSize;
 1117|       |            RETURN_ERROR_IF(dctx->staticSize, memory_allocation,
 1118|       |                "legacy support is not compatible with static dctx");
 1119|       |
 1120|       |            decodedSize = ZSTD_decompressLegacy(dst, dstCapacity, src, frameSize, legacyDict, legacyDictSize);
 1121|       |            if (ZSTD_isError(decodedSize)) return decodedSize;
 1122|       |
 1123|       |            {
 1124|       |                unsigned long long const expectedSize = ZSTD_getFrameContentSize(src, srcSize);
 1125|       |                RETURN_ERROR_IF(expectedSize == ZSTD_CONTENTSIZE_ERROR, corruption_detected, "Corrupted frame header!");
 1126|       |                if (expectedSize != ZSTD_CONTENTSIZE_UNKNOWN) {
 1127|       |                    RETURN_ERROR_IF(expectedSize != decodedSize, corruption_detected,
 1128|       |                        "Frame header size does not match decoded size!");
 1129|       |                }
 1130|       |            }
 1131|       |
 1132|       |            assert(decodedSize <= dstCapacity);
 1133|       |            dst = (BYTE*)dst + decodedSize;
 1134|       |            dstCapacity -= decodedSize;
 1135|       |
 1136|       |            src = (const BYTE*)src + frameSize;
 1137|       |            srcSize -= frameSize;
 1138|       |
 1139|       |            continue;
 1140|       |        }
 1141|       |#endif
 1142|       |
 1143|  8.56k|        if (dctx->format == ZSTD_f_zstd1 && srcSize >= 4) {
  ------------------
  |  Branch (1143:13): [True: 8.56k, False: 0]
  |  Branch (1143:45): [True: 8.56k, False: 0]
  ------------------
 1144|  8.56k|            U32 const magicNumber = MEM_readLE32(src);
 1145|  8.56k|            DEBUGLOG(5, "reading magic number %08X", (unsigned)magicNumber);
  ------------------
  |  |  104|  8.56k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 8.56k]
  |  |  ------------------
  ------------------
 1146|  8.56k|            if ((magicNumber & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  145|  8.56k|#define ZSTD_MAGIC_SKIPPABLE_MASK   0xFFFFFFF0
  ------------------
                          if ((magicNumber & ZSTD_MAGIC_SKIPPABLE_MASK) == ZSTD_MAGIC_SKIPPABLE_START) {
  ------------------
  |  |  144|  8.56k|#define ZSTD_MAGIC_SKIPPABLE_START  0x184D2A50    /* all 16 values, from 0x184D2A50 to 0x184D2A5F, signal the beginning of a skippable frame */
  ------------------
  |  Branch (1146:17): [True: 91, False: 8.46k]
  ------------------
 1147|       |                /* skippable frame detected : skip it */
 1148|     91|                size_t const skippableSize = readSkippableFrameSize(src, srcSize);
 1149|     91|                FORWARD_IF_ERROR(skippableSize, "invalid skippable frame");
  ------------------
  |  |  146|     91|    do {                                                                           \
  |  |  147|     91|        size_t const err_code = (err);                                             \
  |  |  148|     91|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 73, False: 18]
  |  |  ------------------
  |  |  149|     73|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|     73|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 73]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     73|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|     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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|     73|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|     73|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 73]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|     73|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|     73|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 73]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|     73|            return err_code;                                                       \
  |  |  155|     73|        }                                                                          \
  |  |  156|     91|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 18]
  |  |  ------------------
  ------------------
 1150|     18|                assert(skippableSize <= srcSize);
  ------------------
  |  |   70|     18|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1151|       |
 1152|     18|                src = (const BYTE *)src + skippableSize;
 1153|     18|                srcSize -= skippableSize;
 1154|     18|                continue; /* check next frame */
 1155|     91|        }   }
 1156|       |
 1157|  8.46k|        if (useDDictSet) {
  ------------------
  |  Branch (1157:13): [True: 0, False: 8.46k]
  ------------------
 1158|      0|            ZSTD_FrameHeader zfh;
 1159|      0|            size_t const hSize = ZSTD_getFrameHeader_advanced(&zfh, src, srcSize, dctx->format);
 1160|       |            /* Invalid/incomplete headers must not change dictionary selection.
 1161|       |             * ZSTD_decompressFrame() will report the header error. */
 1162|      0|            if (hSize == 0 && zfh.frameType == ZSTD_frame)
  ------------------
  |  Branch (1162:17): [True: 0, False: 0]
  |  Branch (1162:31): [True: 0, False: 0]
  ------------------
 1163|      0|                FORWARD_IF_ERROR(ZSTD_DCtx_getFrameDDict(dctx, zfh.dictID, &frameDDict), "");
  ------------------
  |  |  146|      0|    do {                                                                           \
  |  |  147|      0|        size_t const err_code = (err);                                             \
  |  |  148|      0|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  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|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1164|      0|        }
 1165|  8.46k|        if (frameDDict) {
  ------------------
  |  Branch (1165:13): [True: 2.36k, False: 6.10k]
  ------------------
 1166|       |            /* Use either the explicit DDict or the one selected from the set. */
 1167|  2.36k|            FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDDict(dctx, frameDDict), "");
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 1168|  6.10k|        } else {
 1169|       |            /* this will initialize correctly with no dict if dict == NULL, so
 1170|       |             * use this in all cases but ddict */
 1171|  6.10k|            FORWARD_IF_ERROR(ZSTD_decompressBegin_usingDict(dctx, dict, dictSize), "");
  ------------------
  |  |  146|  6.10k|    do {                                                                           \
  |  |  147|  6.10k|        size_t const err_code = (err);                                             \
  |  |  148|  6.10k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 0, False: 6.10k]
  |  |  ------------------
  |  |  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|  6.10k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 6.10k]
  |  |  ------------------
  ------------------
 1172|  6.10k|        }
 1173|  8.46k|        ZSTD_checkContinuity(dctx, dst, dstCapacity);
 1174|       |
 1175|  8.46k|        {   const size_t res = ZSTD_decompressFrame(dctx, dst, dstCapacity,
 1176|  8.46k|                                                    &src, &srcSize);
 1177|  8.46k|            RETURN_ERROR_IF(
  ------------------
  |  |  114|  8.46k|    do {                                                                       \
  |  |  115|  17.1k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 165, False: 8.30k]
  |  |  |  Branch (115:13): [True: 18, False: 147]
  |  |  ------------------
  |  |  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|  8.46k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 8.45k]
  |  |  ------------------
  ------------------
 1178|  8.46k|                (ZSTD_getErrorCode(res) == ZSTD_error_prefix_unknown)
 1179|  8.46k|             && (moreThan1Frame==1),
 1180|  8.46k|                srcSize_wrong,
 1181|  8.46k|                "At least one frame successfully completed, "
 1182|  8.46k|                "but following bytes are garbage: "
 1183|  8.46k|                "it's more likely to be a srcSize error, "
 1184|  8.46k|                "specifying more input bytes than size of frame(s). "
 1185|  8.46k|                "Note: one could be unlucky, it might be a corruption error instead, "
 1186|  8.46k|                "happening right at the place where we expect zstd magic bytes. "
 1187|  8.46k|                "But this is _much_ less likely than a srcSize field error.");
 1188|  8.45k|            if (ZSTD_isError(res)) return res;
  ------------------
  |  |   44|  8.45k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1188:17): [True: 4.86k, False: 3.58k]
  ------------------
 1189|  3.58k|            assert(res <= dstCapacity);
  ------------------
  |  |   70|  3.58k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1190|  3.58k|            if (res != 0)
  ------------------
  |  Branch (1190:17): [True: 2.45k, False: 1.13k]
  ------------------
 1191|  2.45k|                dst = (BYTE*)dst + res;
 1192|  3.58k|            dstCapacity -= res;
 1193|  3.58k|        }
 1194|      0|        moreThan1Frame = 1;
 1195|  3.58k|    }  /* while (srcSize >= ZSTD_frameHeaderSize_prefix) */
 1196|       |
 1197|  2.03k|    RETURN_ERROR_IF(srcSize, srcSize_wrong, "input not entirely consumed");
  ------------------
  |  |  114|  2.03k|    do {                                                                       \
  |  |  115|  2.03k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 9, False: 2.02k]
  |  |  ------------------
  |  |  116|      9|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      9|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      9|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      9|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      9|    do {                                           \
  |  |  |  |   99|      9|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 9]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      9|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      9|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      9|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      9|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      9|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      9|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      9|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      9|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      9|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      9|        }                                                                      \
  |  |  123|  2.03k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.02k]
  |  |  ------------------
  ------------------
 1198|       |
 1199|  2.02k|    return (size_t)((BYTE*)dst - (BYTE*)dststart);
 1200|  2.03k|}
zstd_decompress.c:ZSTD_decompressFrame:
  972|  8.46k|{
  973|  8.46k|    const BYTE* const istart = (const BYTE*)(*srcPtr);
  974|  8.46k|    const BYTE* ip = istart;
  975|  8.46k|    BYTE* const ostart = (BYTE*)dst;
  976|  8.46k|    BYTE* const oend = dstCapacity != 0 ? ostart + dstCapacity : ostart;
  ------------------
  |  Branch (976:24): [True: 8.08k, False: 383]
  ------------------
  977|  8.46k|    BYTE* op = ostart;
  978|  8.46k|    size_t remainingSrcSize = *srcSizePtr;
  979|       |
  980|  8.46k|    DEBUGLOG(4, "ZSTD_decompressFrame (srcSize:%i)", (int)*srcSizePtr);
  ------------------
  |  |  104|  8.46k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 8.46k]
  |  |  ------------------
  ------------------
  981|       |
  982|       |    /* check */
  983|  8.46k|    RETURN_ERROR_IF(
  ------------------
  |  |  114|  8.46k|    do {                                                                       \
  |  |  115|  25.4k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 8.46k, False: 0]
  |  |  |  Branch (115:13): [True: 29, False: 8.44k]
  |  |  ------------------
  |  |  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|  8.46k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 8.44k]
  |  |  ------------------
  ------------------
  984|  8.46k|        remainingSrcSize < ZSTD_FRAMEHEADERSIZE_MIN(dctx->format)+ZSTD_blockHeaderSize,
  985|  8.46k|        srcSize_wrong, "");
  986|       |
  987|       |    /* Frame Header */
  988|  8.44k|    {   size_t const frameHeaderSize = ZSTD_frameHeaderSize_internal(
  989|  8.44k|                ip, ZSTD_FRAMEHEADERSIZE_PREFIX(dctx->format), dctx->format);
  ------------------
  |  | 1357|  8.44k|#define ZSTD_FRAMEHEADERSIZE_PREFIX(format) ((format) == ZSTD_f_zstd1 ? 5 : 1)   /* minimum input size required to query frame header size */
  |  |  ------------------
  |  |  |  Branch (1357:46): [True: 8.44k, False: 0]
  |  |  ------------------
  ------------------
  990|  8.44k|        if (ZSTD_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  |   44|  8.44k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (990:13): [True: 0, False: 8.44k]
  ------------------
  991|  8.44k|        RETURN_ERROR_IF(remainingSrcSize < frameHeaderSize+ZSTD_blockHeaderSize,
  ------------------
  |  |  114|  8.44k|    do {                                                                       \
  |  |  115|  8.44k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 7, False: 8.43k]
  |  |  ------------------
  |  |  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|  8.44k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 8.43k]
  |  |  ------------------
  ------------------
  992|  8.44k|                        srcSize_wrong, "");
  993|  8.43k|        FORWARD_IF_ERROR( ZSTD_decodeFrameHeader(dctx, ip, frameHeaderSize) , "");
  ------------------
  |  |  146|  8.43k|    do {                                                                           \
  |  |  147|  8.43k|        size_t const err_code = (err);                                             \
  |  |  148|  8.43k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 169, False: 8.26k]
  |  |  ------------------
  |  |  149|    169|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|    169|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 169]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|    169|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|    169|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|    169|    do {                                           \
  |  |  |  |   99|    169|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 169]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    169|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 169]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|    169|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|    169|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 169]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|    169|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|    169|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 169]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|    169|            return err_code;                                                       \
  |  |  155|    169|        }                                                                          \
  |  |  156|  8.43k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 8.26k]
  |  |  ------------------
  ------------------
  994|  8.26k|        ip += frameHeaderSize; remainingSrcSize -= frameHeaderSize;
  995|  8.26k|    }
  996|       |
  997|       |    /* Shrink the blockSizeMax if enabled */
  998|  8.26k|    if (dctx->maxBlockSizeParam != 0)
  ------------------
  |  Branch (998:9): [True: 0, False: 8.26k]
  ------------------
  999|      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]
  |  |  ------------------
  ------------------
 1000|       |
 1001|       |    /* Loop on each block */
 1002|  34.1k|    while (1) {
  ------------------
  |  Branch (1002:12): [True: 34.1k, Folded]
  ------------------
 1003|  34.1k|        BYTE* oBlockEnd = oend;
 1004|  34.1k|        size_t decodedSize;
 1005|  34.1k|        blockProperties_t blockProperties;
 1006|  34.1k|        size_t const cBlockSize = ZSTD_getcBlockSize(ip, remainingSrcSize, &blockProperties);
 1007|  34.1k|        if (ZSTD_isError(cBlockSize)) return cBlockSize;
  ------------------
  |  |   44|  34.1k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1007:13): [True: 68, False: 34.0k]
  ------------------
 1008|       |
 1009|  34.0k|        ip += ZSTD_blockHeaderSize;
 1010|  34.0k|        remainingSrcSize -= ZSTD_blockHeaderSize;
 1011|  34.0k|        RETURN_ERROR_IF(cBlockSize > remainingSrcSize, srcSize_wrong, "");
  ------------------
  |  |  114|  34.0k|    do {                                                                       \
  |  |  115|  34.0k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 117, False: 33.9k]
  |  |  ------------------
  |  |  116|    117|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    117|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 117]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    117|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    117|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    117|    do {                                           \
  |  |  |  |   99|    117|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 117]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    117|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 117]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    117|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    117|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 117]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    117|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    117|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 117]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    117|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    117|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    117|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    117|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    117|        }                                                                      \
  |  |  123|  34.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 33.9k]
  |  |  ------------------
  ------------------
 1012|       |
 1013|  33.9k|        if (ip >= op && ip < oBlockEnd) {
  ------------------
  |  Branch (1013:13): [True: 1.64k, False: 32.2k]
  |  Branch (1013:25): [True: 0, False: 1.64k]
  ------------------
 1014|       |            /* We are decompressing in-place. Limit the output pointer so that we
 1015|       |             * don't overwrite the block that we are currently reading. This will
 1016|       |             * fail decompression if the input & output pointers aren't spaced
 1017|       |             * far enough apart.
 1018|       |             *
 1019|       |             * This is important to set, even when the pointers are far enough
 1020|       |             * apart, because ZSTD_decompressBlock_internal() can decide to store
 1021|       |             * literals in the output buffer, after the block it is decompressing.
 1022|       |             * Since we don't want anything to overwrite our input, we have to tell
 1023|       |             * ZSTD_decompressBlock_internal to never write past ip.
 1024|       |             *
 1025|       |             * See ZSTD_allocateLiteralsBuffer() for reference.
 1026|       |             */
 1027|      0|            oBlockEnd = op + (ip - op);
 1028|      0|        }
 1029|       |
 1030|  33.9k|        switch(blockProperties.blockType)
 1031|  33.9k|        {
 1032|  12.4k|        case bt_compressed:
  ------------------
  |  Branch (1032:9): [True: 12.4k, False: 21.4k]
  ------------------
 1033|  12.4k|            assert(dctx->isFrameDecompression == 1);
  ------------------
  |  |   70|  12.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1034|  12.4k|            decodedSize = ZSTD_decompressBlock_internal(dctx, op, (size_t)(oBlockEnd-op), ip, cBlockSize, not_streaming);
 1035|  12.4k|            break;
 1036|  20.5k|        case bt_raw :
  ------------------
  |  Branch (1036:9): [True: 20.5k, False: 13.4k]
  ------------------
 1037|       |            /* Use oend instead of oBlockEnd because this function is safe to overlap. It uses memmove. */
 1038|  20.5k|            decodedSize = ZSTD_copyRawBlock(op, (size_t)(oend-op), ip, cBlockSize);
 1039|  20.5k|            break;
 1040|    936|        case bt_rle :
  ------------------
  |  Branch (1040:9): [True: 936, False: 32.9k]
  ------------------
 1041|    936|            decodedSize = ZSTD_setRleBlock(op, (size_t)(oBlockEnd-op), *ip, blockProperties.origSize);
 1042|    936|            break;
 1043|      0|        case bt_reserved :
  ------------------
  |  Branch (1043:9): [True: 0, False: 33.9k]
  ------------------
 1044|      0|        default:
  ------------------
  |  Branch (1044:9): [True: 0, False: 33.9k]
  ------------------
 1045|      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]
  |  |  ------------------
  ------------------
 1046|  33.9k|        }
 1047|  33.9k|        FORWARD_IF_ERROR(decodedSize, "Block decompression failure");
  ------------------
  |  |  146|  33.9k|    do {                                                                           \
  |  |  147|  33.9k|        size_t const err_code = (err);                                             \
  |  |  148|  33.9k|        if (ERR_isError(err_code)) {                                               \
  |  |  ------------------
  |  |  |  Branch (148:13): [True: 4.23k, False: 29.6k]
  |  |  ------------------
  |  |  149|  4.23k|            RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s",                 \
  |  |  ------------------
  |  |  |  |  103|  4.23k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  4.23k|                  __FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
  |  |  151|  4.23k|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                                 \
  |  |  ------------------
  |  |  |  |   98|  4.23k|    do {                                           \
  |  |  |  |   99|  4.23k|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 4.23k]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|  4.23k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 4.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|  4.23k|            RAWLOG(3, ": " __VA_ARGS__);                                           \
  |  |  ------------------
  |  |  |  |  103|  4.23k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  4.23k|            RAWLOG(3, "\n");                                                       \
  |  |  ------------------
  |  |  |  |  103|  4.23k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  154|  4.23k|            return err_code;                                                       \
  |  |  155|  4.23k|        }                                                                          \
  |  |  156|  33.9k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (156:13): [Folded, False: 29.6k]
  |  |  ------------------
  ------------------
 1048|  29.6k|        RETURN_ERROR_IF(decodedSize > dctx->fParams.blockSizeMax, corruption_detected, "Decompressed Block Size Exceeds Maximum");
  ------------------
  |  |  114|  29.6k|    do {                                                                       \
  |  |  115|  29.6k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 22, False: 29.6k]
  |  |  ------------------
  |  |  116|     22|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     22|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     22|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     22|    do {                                           \
  |  |  |  |   99|     22|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     22|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     22|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     22|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     22|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     22|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     22|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     22|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     22|        }                                                                      \
  |  |  123|  29.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 29.6k]
  |  |  ------------------
  ------------------
 1049|  29.6k|        DEBUGLOG(5, "Decompressed block of dSize = %u", (unsigned)decodedSize);
  ------------------
  |  |  104|  29.6k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 29.6k]
  |  |  ------------------
  ------------------
 1050|  29.6k|        if (dctx->validateChecksum) {
  ------------------
  |  Branch (1050:13): [True: 21.9k, False: 7.67k]
  ------------------
 1051|  21.9k|            XXH64_update(&dctx->xxhState, op, decodedSize);
  ------------------
  |  |  460|  21.9k|#  define XXH64_update XXH_NAME2(XXH_NAMESPACE, XXH64_update)
  |  |  ------------------
  |  |  |  |  443|  21.9k|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|  21.9k|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1052|  21.9k|        }
 1053|  29.6k|        if (decodedSize) /* support dst = NULL,0 */ {
  ------------------
  |  Branch (1053:13): [True: 16.5k, False: 13.1k]
  ------------------
 1054|  16.5k|            op += decodedSize;
 1055|  16.5k|        }
 1056|  29.6k|        assert(ip != NULL);
  ------------------
  |  |   70|  29.6k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1057|  29.6k|        ip += cBlockSize;
 1058|  29.6k|        remainingSrcSize -= cBlockSize;
 1059|  29.6k|        if (blockProperties.lastBlock) break;
  ------------------
  |  Branch (1059:13): [True: 3.81k, False: 25.8k]
  ------------------
 1060|  29.6k|    }
 1061|       |
 1062|  3.81k|    if (dctx->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN) {
  ------------------
  |  |  203|  3.81k|#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
  ------------------
  |  Branch (1062:9): [True: 894, False: 2.92k]
  ------------------
 1063|    894|        RETURN_ERROR_IF((U64)(op-ostart) != dctx->fParams.frameContentSize,
  ------------------
  |  |  114|    894|    do {                                                                       \
  |  |  115|    894|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 133, False: 761]
  |  |  ------------------
  |  |  116|    133|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    133|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 133]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    133|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    133|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    133|    do {                                           \
  |  |  |  |   99|    133|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 133]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    133|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 133]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    133|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    133|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 133]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    133|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    133|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 133]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    133|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    133|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    133|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    133|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    133|        }                                                                      \
  |  |  123|    894|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 761]
  |  |  ------------------
  ------------------
 1064|    894|                        corruption_detected, "");
 1065|    894|    }
 1066|  3.68k|    if (dctx->fParams.checksumFlag) { /* Frame content checksum verification */
  ------------------
  |  Branch (1066:9): [True: 123, False: 3.56k]
  ------------------
 1067|    123|        RETURN_ERROR_IF(remainingSrcSize<4, checksum_wrong, "");
  ------------------
  |  |  114|    123|    do {                                                                       \
  |  |  115|    123|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 18, False: 105]
  |  |  ------------------
  |  |  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|    123|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 105]
  |  |  ------------------
  ------------------
 1068|    105|        if (!dctx->forceIgnoreChecksum) {
  ------------------
  |  Branch (1068:13): [True: 105, False: 0]
  ------------------
 1069|    105|            U32 const checkCalc = (U32)XXH64_digest(&dctx->xxhState);
  ------------------
  |  |  461|    105|#  define XXH64_digest XXH_NAME2(XXH_NAMESPACE, XXH64_digest)
  |  |  ------------------
  |  |  |  |  443|    105|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|    105|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1070|    105|            U32 checkRead;
 1071|    105|            checkRead = MEM_readLE32(ip);
 1072|    105|            RETURN_ERROR_IF(checkRead != checkCalc, checksum_wrong, "");
  ------------------
  |  |  114|    105|    do {                                                                       \
  |  |  115|    105|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 80, False: 25]
  |  |  ------------------
  |  |  116|     80|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     80|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 80]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     80|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     80|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     80|    do {                                           \
  |  |  |  |   99|     80|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 80]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     80|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 80]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     80|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     80|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 80]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     80|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     80|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 80]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     80|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     80|        }                                                                      \
  |  |  123|    105|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 25]
  |  |  ------------------
  ------------------
 1073|    105|        }
 1074|     25|        ip += 4;
 1075|     25|        remainingSrcSize -= 4;
 1076|     25|    }
 1077|  3.58k|    ZSTD_DCtx_trace_end(dctx, (U64)(op-ostart), (U64)(ip-istart), /* streaming */ 0);
 1078|       |    /* Allow caller to get size read */
 1079|  3.58k|    DEBUGLOG(4, "ZSTD_decompressFrame: decompressed frame of size %i, consuming %i bytes of input", (int)(op-ostart), (int)(ip - (const BYTE*)*srcPtr));
  ------------------
  |  |  104|  3.58k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 3.58k]
  |  |  ------------------
  ------------------
 1080|  3.58k|    *srcPtr = ip;
 1081|  3.58k|    *srcSizePtr = remainingSrcSize;
 1082|  3.58k|    return (size_t)(op-ostart);
 1083|  3.68k|}
zstd_decompress.c:ZSTD_getDDict:
 1213|  4.76k|{
 1214|  4.76k|    assert(dctx->ddictSet == NULL);
  ------------------
  |  |   70|  4.76k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1215|  4.76k|    switch (dctx->dictUses) {
 1216|      0|    default:
  ------------------
  |  Branch (1216:5): [True: 0, False: 4.76k]
  ------------------
 1217|      0|        assert(0 /* Impossible */);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1218|      0|        ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|      0|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
 1219|  4.76k|    case ZSTD_dont_use:
  ------------------
  |  Branch (1219:5): [True: 4.76k, False: 0]
  ------------------
 1220|  4.76k|        ZSTD_clearDict(dctx);
 1221|  4.76k|        return NULL;
 1222|      0|    case ZSTD_use_indefinitely:
  ------------------
  |  Branch (1222:5): [True: 0, False: 4.76k]
  ------------------
 1223|      0|        return dctx->ddict;
 1224|      0|    case ZSTD_use_once:
  ------------------
  |  Branch (1224:5): [True: 0, False: 4.76k]
  ------------------
 1225|      0|        dctx->dictUses = ZSTD_dont_use;
 1226|      0|        return dctx->ddict;
 1227|  4.76k|    }
 1228|  4.76k|}
zstd_decompress.c:ZSTD_decodeFrameHeader:
  718|  8.43k|{
  719|  8.43k|    size_t const result = ZSTD_getFrameHeader_advanced(&(dctx->fParams), src, headerSize, dctx->format);
  720|  8.43k|    if (ZSTD_isError(result)) return result;    /* invalid header */
  ------------------
  |  |   44|  8.43k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (720:9): [True: 169, False: 8.26k]
  ------------------
  721|  8.26k|    RETURN_ERROR_IF(result>0, srcSize_wrong, "headerSize too small");
  ------------------
  |  |  114|  8.26k|    do {                                                                       \
  |  |  115|  8.26k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 8.26k]
  |  |  ------------------
  |  |  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.26k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 8.26k]
  |  |  ------------------
  ------------------
  722|       |
  723|       |#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  724|       |    /* Skip the dictID check in fuzzing mode, because it makes the search
  725|       |     * harder.
  726|       |     */
  727|       |    RETURN_ERROR_IF(dctx->fParams.dictID && (dctx->dictID != dctx->fParams.dictID),
  728|       |                    dictionary_wrong, "");
  729|       |#endif
  730|  8.26k|    dctx->validateChecksum = (dctx->fParams.checksumFlag && !dctx->forceIgnoreChecksum) ? 1 : 0;
  ------------------
  |  Branch (730:31): [True: 2.12k, False: 6.14k]
  |  Branch (730:61): [True: 2.12k, False: 0]
  ------------------
  731|  8.26k|    if (dctx->validateChecksum) XXH64_reset(&dctx->xxhState, 0);
  ------------------
  |  |  459|  2.12k|#  define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset)
  |  |  ------------------
  |  |  |  |  443|  2.12k|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|  2.12k|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (731:9): [True: 2.12k, False: 6.14k]
  ------------------
  732|  8.26k|    return 0;
  733|  8.26k|}
zstd_decompress.c:ZSTD_DCtx_trace_end:
  939|  3.58k|{
  940|  3.58k|#if ZSTD_TRACE
  941|  3.58k|    if (dctx->traceCtx && ZSTD_trace_decompress_end != NULL) {
  ------------------
  |  Branch (941:9): [True: 0, False: 3.58k]
  |  Branch (941:27): [True: 0, False: 0]
  ------------------
  942|      0|        ZSTD_Trace trace;
  943|      0|        ZSTD_memset(&trace, 0, sizeof(trace));
  ------------------
  |  |   46|      0|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  944|      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    6
  |  |  ------------------
  |  |               #define ZSTD_VERSION_NUMBER  (ZSTD_VERSION_MAJOR *100*100 + ZSTD_VERSION_MINOR *100 + ZSTD_VERSION_RELEASE)
  |  |  ------------------
  |  |  |  |  114|      0|#define ZSTD_VERSION_RELEASE  0
  |  |  ------------------
  ------------------
  945|      0|        trace.streaming = streaming;
  946|      0|        if (dctx->traceDictSize != 0) {
  ------------------
  |  Branch (946:13): [True: 0, False: 0]
  ------------------
  947|      0|            trace.dictionaryID = dctx->dictID;
  948|      0|            trace.dictionarySize = dctx->traceDictSize;
  949|      0|            trace.dictionaryIsCold = dctx->ddictIsCold;
  950|      0|        }
  951|      0|        trace.uncompressedSize = (size_t)uncompressedSize;
  952|      0|        trace.compressedSize = (size_t)compressedSize;
  953|      0|        trace.dctx = dctx;
  954|      0|        ZSTD_trace_decompress_end(dctx->traceCtx, &trace);
  955|      0|    }
  956|       |#else
  957|       |    (void)dctx;
  958|       |    (void)uncompressedSize;
  959|       |    (void)compressedSize;
  960|       |    (void)streaming;
  961|       |#endif
  962|  3.58k|}
zstd_decompress.c:ZSTD_copyRawBlock:
  914|  20.5k|{
  915|  20.5k|    DEBUGLOG(5, "ZSTD_copyRawBlock");
  ------------------
  |  |  104|  20.5k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 20.5k]
  |  |  ------------------
  ------------------
  916|  20.5k|    RETURN_ERROR_IF(srcSize > dstCapacity, dstSize_tooSmall, "");
  ------------------
  |  |  114|  20.5k|    do {                                                                       \
  |  |  115|  20.5k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 21, False: 20.4k]
  |  |  ------------------
  |  |  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|  20.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 20.4k]
  |  |  ------------------
  ------------------
  917|  20.4k|    if (dst == NULL) {
  ------------------
  |  Branch (917:9): [True: 0, False: 20.4k]
  ------------------
  918|      0|        if (srcSize == 0) return 0;
  ------------------
  |  Branch (918:13): [True: 0, False: 0]
  ------------------
  919|      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]
  |  |  ------------------
  ------------------
  920|      0|    }
  921|  20.4k|    ZSTD_memmove(dst, src, srcSize);
  ------------------
  |  |   45|  20.4k|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  922|  20.4k|    return srcSize;
  923|  20.4k|}
zstd_decompress.c:ZSTD_setRleBlock:
  928|    936|{
  929|    936|    RETURN_ERROR_IF(regenSize > dstCapacity, dstSize_tooSmall, "");
  ------------------
  |  |  114|    936|    do {                                                                       \
  |  |  115|    936|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 23, False: 913]
  |  |  ------------------
  |  |  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|    936|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 913]
  |  |  ------------------
  ------------------
  930|    913|    if (dst == NULL) {
  ------------------
  |  Branch (930:9): [True: 0, False: 913]
  ------------------
  931|      0|        if (regenSize == 0) return 0;
  ------------------
  |  Branch (931:13): [True: 0, False: 0]
  ------------------
  932|      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]
  |  |  ------------------
  ------------------
  933|      0|    }
  934|    913|    ZSTD_memset(dst, b, regenSize);
  ------------------
  |  |   46|    913|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  935|    913|    return regenSize;
  936|    913|}
zstd_decompress.c:ZSTD_DCtx_resetParameters:
  237|  5.19k|{
  238|  5.19k|    assert(dctx->streamStage == zdss_init);
  ------------------
  |  |   70|  5.19k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  239|  5.19k|    dctx->format = ZSTD_f_zstd1;
  240|  5.19k|    dctx->maxWindowSize = ZSTD_MAXWINDOWSIZE_DEFAULT;
  ------------------
  |  |   40|  5.19k|#  define ZSTD_MAXWINDOWSIZE_DEFAULT (((U32)1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT) + 1)
  |  |  ------------------
  |  |  |  | 1387|  5.19k|#define ZSTD_WINDOWLOG_LIMIT_DEFAULT 27   /* by default, the streaming decoder will refuse any frame
  |  |  ------------------
  ------------------
  241|  5.19k|    dctx->outBufferMode = ZSTD_bm_buffered;
  242|  5.19k|    dctx->forceIgnoreChecksum = ZSTD_d_validateChecksum;
  243|  5.19k|    dctx->refMultipleDDicts = ZSTD_rmd_refSingleDDict;
  244|  5.19k|    dctx->disableHufAsm = 0;
  245|  5.19k|    dctx->maxBlockSizeParam = 0;
  246|  5.19k|}

ZSTD_getcBlockSize:
   65|  34.1k|{
   66|  34.1k|    RETURN_ERROR_IF(srcSize < ZSTD_blockHeaderSize, srcSize_wrong, "");
  ------------------
  |  |  114|  34.1k|    do {                                                                       \
  |  |  115|  34.1k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 44, False: 34.0k]
  |  |  ------------------
  |  |  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|  34.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 34.0k]
  |  |  ------------------
  ------------------
   67|       |
   68|  34.0k|    {   U32 const cBlockHeader = MEM_readLE24(src);
   69|  34.0k|        U32 const cSize = cBlockHeader >> 3;
   70|  34.0k|        bpPtr->lastBlock = cBlockHeader & 1;
   71|  34.0k|        bpPtr->blockType = (blockType_e)((cBlockHeader >> 1) & 3);
   72|  34.0k|        bpPtr->origSize = cSize;   /* only useful for RLE */
   73|  34.0k|        if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (73:13): [True: 938, False: 33.1k]
  ------------------
   74|  33.1k|        RETURN_ERROR_IF(bpPtr->blockType == bt_reserved, corruption_detected, "");
  ------------------
  |  |  114|  33.1k|    do {                                                                       \
  |  |  115|  33.1k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 24, False: 33.1k]
  |  |  ------------------
  |  |  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|  33.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 33.1k]
  |  |  ------------------
  ------------------
   75|  33.1k|        return cSize;
   76|  33.1k|    }
   77|  33.1k|}
ZSTD_buildFSETable:
  656|  8.18k|{
  657|  8.18k|    if (ZSTD_USE_BMI2(bmi2)) {
  ------------------
  |  |   36|  8.18k|#  define ZSTD_USE_BMI2(bmi2) (bmi2)
  |  |  ------------------
  |  |  |  Branch (36:31): [True: 6.15k, False: 2.03k]
  |  |  ------------------
  ------------------
  658|  6.15k|        ZSTD_buildFSETable_body_bmi2(dt, normalizedCounter, maxSymbolValue,
  659|  6.15k|                baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  660|  6.15k|        return;
  661|  6.15k|    }
  662|  2.03k|    (void)bmi2;
  663|  2.03k|    ZSTD_buildFSETable_body_default(dt, normalizedCounter, maxSymbolValue,
  664|  2.03k|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  665|  2.03k|}
ZSTD_decodeSeqHeaders:
  721|  11.0k|{
  722|  11.0k|    const BYTE* const istart = (const BYTE*)src;
  723|  11.0k|    const BYTE* const iend = istart + srcSize;
  724|  11.0k|    const BYTE* ip = istart;
  725|  11.0k|    int nbSeq;
  726|  11.0k|    DEBUGLOG(5, "ZSTD_decodeSeqHeaders");
  ------------------
  |  |  104|  11.0k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 11.0k]
  |  |  ------------------
  ------------------
  727|       |
  728|       |    /* check */
  729|  11.0k|    RETURN_ERROR_IF(srcSize < MIN_SEQUENCES_SIZE, srcSize_wrong, "");
  ------------------
  |  |  114|  11.0k|    do {                                                                       \
  |  |  115|  11.0k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 27, False: 11.0k]
  |  |  ------------------
  |  |  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|  11.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 11.0k]
  |  |  ------------------
  ------------------
  730|       |
  731|       |    /* SeqHead */
  732|  11.0k|    nbSeq = *ip++;
  733|  11.0k|    if (nbSeq > 0x7F) {
  ------------------
  |  Branch (733:9): [True: 1.59k, False: 9.45k]
  ------------------
  734|  1.59k|        if (nbSeq == 0xFF) {
  ------------------
  |  Branch (734:13): [True: 777, False: 821]
  ------------------
  735|    777|            RETURN_ERROR_IF(ip+2 > iend, srcSize_wrong, "");
  ------------------
  |  |  114|    777|    do {                                                                       \
  |  |  115|    777|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4, False: 773]
  |  |  ------------------
  |  |  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|    777|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 773]
  |  |  ------------------
  ------------------
  736|    773|            nbSeq = MEM_readLE16(ip) + LONGNBSEQ;
  ------------------
  |  |   96|    773|#define LONGNBSEQ 0x7F00
  ------------------
  737|    773|            ip+=2;
  738|    821|        } else {
  739|    821|            RETURN_ERROR_IF(ip >= iend, srcSize_wrong, "");
  ------------------
  |  |  114|    821|    do {                                                                       \
  |  |  115|    821|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 14, False: 807]
  |  |  ------------------
  |  |  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|    821|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 807]
  |  |  ------------------
  ------------------
  740|    807|            nbSeq = ((nbSeq-0x80)<<8) + *ip++;
  741|    807|        }
  742|  1.59k|    }
  743|  11.0k|    *nbSeqPtr = nbSeq;
  744|       |
  745|  11.0k|    if (nbSeq == 0) {
  ------------------
  |  Branch (745:9): [True: 5.36k, False: 5.66k]
  ------------------
  746|       |        /* No sequence : section ends immediately */
  747|  5.36k|        RETURN_ERROR_IF(ip != iend, corruption_detected,
  ------------------
  |  |  114|  5.36k|    do {                                                                       \
  |  |  115|  5.36k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 43, False: 5.32k]
  |  |  ------------------
  |  |  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|  5.36k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.32k]
  |  |  ------------------
  ------------------
  748|  5.36k|            "extraneous data present in the Sequences section");
  749|  5.32k|        return (size_t)(ip - istart);
  750|  5.36k|    }
  751|       |
  752|       |    /* FSE table descriptors */
  753|  5.66k|    RETURN_ERROR_IF(ip+1 > iend, srcSize_wrong, ""); /* minimum possible size: 1 byte for symbol encoding types */
  ------------------
  |  |  114|  5.66k|    do {                                                                       \
  |  |  115|  5.66k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 22, False: 5.64k]
  |  |  ------------------
  |  |  116|     22|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     22|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     22|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     22|    do {                                           \
  |  |  |  |   99|     22|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     22|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     22|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     22|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     22|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     22|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     22|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     22|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     22|        }                                                                      \
  |  |  123|  5.66k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.64k]
  |  |  ------------------
  ------------------
  754|  5.64k|    RETURN_ERROR_IF(*ip & 3, corruption_detected, ""); /* The last field, Reserved, must be all-zeroes. */
  ------------------
  |  |  114|  5.64k|    do {                                                                       \
  |  |  115|  5.64k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 35, False: 5.60k]
  |  |  ------------------
  |  |  116|     35|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     35|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     35|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     35|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     35|    do {                                           \
  |  |  |  |   99|     35|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 35]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     35|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     35|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     35|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     35|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     35|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     35|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     35|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     35|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     35|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     35|        }                                                                      \
  |  |  123|  5.64k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.60k]
  |  |  ------------------
  ------------------
  755|  5.60k|    {   SymbolEncodingType_e const LLtype = (SymbolEncodingType_e)(*ip >> 6);
  756|  5.60k|        SymbolEncodingType_e const OFtype = (SymbolEncodingType_e)((*ip >> 4) & 3);
  757|  5.60k|        SymbolEncodingType_e const MLtype = (SymbolEncodingType_e)((*ip >> 2) & 3);
  758|  5.60k|        ip++;
  759|       |
  760|       |        /* Build DTables */
  761|  5.60k|        assert(ip <= iend);
  ------------------
  |  |   70|  5.60k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  762|  5.60k|        {   size_t const llhSize = ZSTD_buildSeqTable(dctx->entropy.LLTable, &dctx->LLTptr,
  763|  5.60k|                                                      LLtype, MaxLL, LLFSELog,
  ------------------
  |  |  104|  5.60k|#define MaxLL   35
  ------------------
                                                                    LLtype, MaxLL, LLFSELog,
  ------------------
  |  |  109|  5.60k|#define LLFSELog    9
  ------------------
  764|  5.60k|                                                      ip, (size_t)(iend-ip),
  765|  5.60k|                                                      LL_base, LL_bits,
  766|  5.60k|                                                      LL_defaultDTable, dctx->fseEntropy,
  767|  5.60k|                                                      dctx->ddictIsCold, nbSeq,
  768|  5.60k|                                                      dctx->workspace, sizeof(dctx->workspace),
  769|  5.60k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  770|  5.60k|            RETURN_ERROR_IF(ZSTD_isError(llhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  5.60k|    do {                                                                       \
  |  |  115|  5.60k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 39, False: 5.56k]
  |  |  ------------------
  |  |  116|     39|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     39|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 39]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     39|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     39|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     39|    do {                                           \
  |  |  |  |   99|     39|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 39]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     39|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 39]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     39|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     39|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 39]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     39|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     39|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 39]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     39|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     39|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     39|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     39|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     39|        }                                                                      \
  |  |  123|  5.60k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.56k]
  |  |  ------------------
  ------------------
  771|  5.56k|            ip += llhSize;
  772|  5.56k|        }
  773|       |
  774|  5.56k|        assert(ip <= iend);
  ------------------
  |  |   70|  5.56k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  775|  5.56k|        {   size_t const ofhSize = ZSTD_buildSeqTable(dctx->entropy.OFTable, &dctx->OFTptr,
  776|  5.56k|                                                      OFtype, MaxOff, OffFSELog,
  ------------------
  |  |  106|  5.56k|#define MaxOff  31
  ------------------
                                                                    OFtype, MaxOff, OffFSELog,
  ------------------
  |  |  110|  5.56k|#define OffFSELog   8
  ------------------
  777|  5.56k|                                                      ip, (size_t)(iend-ip),
  778|  5.56k|                                                      OF_base, OF_bits,
  779|  5.56k|                                                      OF_defaultDTable, dctx->fseEntropy,
  780|  5.56k|                                                      dctx->ddictIsCold, nbSeq,
  781|  5.56k|                                                      dctx->workspace, sizeof(dctx->workspace),
  782|  5.56k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  783|  5.56k|            RETURN_ERROR_IF(ZSTD_isError(ofhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  5.56k|    do {                                                                       \
  |  |  115|  5.56k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 27, False: 5.54k]
  |  |  ------------------
  |  |  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|  5.56k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.54k]
  |  |  ------------------
  ------------------
  784|  5.54k|            ip += ofhSize;
  785|  5.54k|        }
  786|       |
  787|  5.54k|        assert(ip <= iend);
  ------------------
  |  |   70|  5.54k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  788|  5.54k|        {   size_t const mlhSize = ZSTD_buildSeqTable(dctx->entropy.MLTable, &dctx->MLTptr,
  789|  5.54k|                                                      MLtype, MaxML, MLFSELog,
  ------------------
  |  |  103|  5.54k|#define MaxML   52
  ------------------
                                                                    MLtype, MaxML, MLFSELog,
  ------------------
  |  |  108|  5.54k|#define MLFSELog    9
  ------------------
  790|  5.54k|                                                      ip, (size_t)(iend-ip),
  791|  5.54k|                                                      ML_base, ML_bits,
  792|  5.54k|                                                      ML_defaultDTable, dctx->fseEntropy,
  793|  5.54k|                                                      dctx->ddictIsCold, nbSeq,
  794|  5.54k|                                                      dctx->workspace, sizeof(dctx->workspace),
  795|  5.54k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  796|  5.54k|            RETURN_ERROR_IF(ZSTD_isError(mlhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  5.54k|    do {                                                                       \
  |  |  115|  5.54k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 56, False: 5.48k]
  |  |  ------------------
  |  |  116|     56|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     56|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 56]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     56|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     56|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     56|    do {                                           \
  |  |  |  |   99|     56|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 56]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     56|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 56]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     56|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     56|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 56]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     56|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     56|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 56]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     56|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     56|        }                                                                      \
  |  |  123|  5.54k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.48k]
  |  |  ------------------
  ------------------
  797|  5.48k|            ip += mlhSize;
  798|  5.48k|        }
  799|  5.48k|    }
  800|       |
  801|      0|    return (size_t)(ip-istart);
  802|  5.54k|}
ZSTD_decompressBlock_internal:
 2194|  12.4k|{   /* blockType == blockCompressed */
 2195|  12.4k|    const BYTE* ip = (const BYTE*)src;
 2196|  12.4k|    DEBUGLOG(5, "ZSTD_decompressBlock_internal (cSize : %u)", (unsigned)srcSize);
  ------------------
  |  |  104|  12.4k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 12.4k]
  |  |  ------------------
  ------------------
 2197|       |
 2198|       |    /* Note : the wording of the specification
 2199|       |     * allows compressed block to be sized exactly ZSTD_blockSizeMax(dctx).
 2200|       |     * This generally does not happen, as it makes little sense,
 2201|       |     * since an uncompressed block would feature same size and have no decompression cost.
 2202|       |     * Also, note that decoder from reference libzstd before < v1.5.4
 2203|       |     * would consider this edge case as an error.
 2204|       |     * As a consequence, avoid generating compressed blocks of size ZSTD_blockSizeMax(dctx)
 2205|       |     * for broader compatibility with the deployed ecosystem of zstd decoders */
 2206|  12.4k|    RETURN_ERROR_IF(srcSize > ZSTD_blockSizeMax(dctx), srcSize_wrong, "");
  ------------------
  |  |  114|  12.4k|    do {                                                                       \
  |  |  115|  12.4k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 21, False: 12.4k]
  |  |  ------------------
  |  |  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|  12.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 12.4k]
  |  |  ------------------
  ------------------
 2207|       |
 2208|       |    /* Decode literals section */
 2209|  12.4k|    {   size_t const litCSize = ZSTD_decodeLiteralsBlock(dctx, src, srcSize, dst, dstCapacity, streaming);
 2210|  12.4k|        DEBUGLOG(5, "ZSTD_decodeLiteralsBlock : cSize=%u, nbLiterals=%zu", (U32)litCSize, dctx->litSize);
  ------------------
  |  |  104|  12.4k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 12.4k]
  |  |  ------------------
  ------------------
 2211|  12.4k|        if (ZSTD_isError(litCSize)) return litCSize;
  ------------------
  |  |   44|  12.4k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (2211:13): [True: 1.38k, False: 11.0k]
  ------------------
 2212|  11.0k|        ip += litCSize;
 2213|  11.0k|        srcSize -= litCSize;
 2214|  11.0k|    }
 2215|       |
 2216|       |    /* Build Decoding Tables */
 2217|      0|    {
 2218|       |        /* Compute the maximum block size, which must also work when !frame and fParams are unset.
 2219|       |         * Additionally, take the min with dstCapacity to ensure that the totalHistorySize fits in a size_t.
 2220|       |         */
 2221|  11.0k|        size_t const blockSizeMax = MIN(dstCapacity, ZSTD_blockSizeMax(dctx));
  ------------------
  |  |   54|  11.0k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 7.19k, False: 3.87k]
  |  |  ------------------
  ------------------
 2222|  11.0k|        size_t const totalHistorySize = ZSTD_totalHistorySize(ZSTD_maybeNullPtrAdd(dst, (ptrdiff_t)blockSizeMax), (BYTE const*)dctx->virtualStart);
 2223|       |        /* isLongOffset must be true if there are long offsets.
 2224|       |         * Offsets are long if they are larger than ZSTD_maxShortOffset().
 2225|       |         * We don't expect that to be the case in 64-bit mode.
 2226|       |         *
 2227|       |         * We check here to see if our history is large enough to allow long offsets.
 2228|       |         * If it isn't, then we can't possible have (valid) long offsets. If the offset
 2229|       |         * is invalid, then it is okay to read it incorrectly.
 2230|       |         *
 2231|       |         * If isLongOffsets is true, then we will later check our decoding table to see
 2232|       |         * if it is even possible to generate long offsets.
 2233|       |         */
 2234|  11.0k|        ZSTD_longOffset_e isLongOffset = (ZSTD_longOffset_e)(MEM_32bits() && (totalHistorySize > ZSTD_maxShortOffset()));
  ------------------
  |  Branch (2234:62): [True: 0, False: 11.0k]
  |  Branch (2234:78): [True: 0, False: 0]
  ------------------
 2235|       |        /* These macros control at build-time which decompressor implementation
 2236|       |         * we use. If neither is defined, we do some inspection and dispatch at
 2237|       |         * runtime.
 2238|       |         */
 2239|  11.0k|#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \
 2240|  11.0k|    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)
 2241|  11.0k|        int usePrefetchDecoder = dctx->ddictIsCold;
 2242|       |#else
 2243|       |        /* Set to 1 to avoid computing offset info if we don't need to.
 2244|       |         * Otherwise this value is ignored.
 2245|       |         */
 2246|       |        int usePrefetchDecoder = 1;
 2247|       |#endif
 2248|  11.0k|        int nbSeq;
 2249|  11.0k|        size_t const seqHSize = ZSTD_decodeSeqHeaders(dctx, &nbSeq, ip, srcSize);
 2250|  11.0k|        if (ZSTD_isError(seqHSize)) return seqHSize;
  ------------------
  |  |   44|  11.0k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (2250:13): [True: 267, False: 10.8k]
  ------------------
 2251|  10.8k|        ip += seqHSize;
 2252|  10.8k|        srcSize -= seqHSize;
 2253|       |
 2254|  10.8k|        RETURN_ERROR_IF((dst == NULL || dstCapacity == 0) && nbSeq > 0, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  10.8k|    do {                                                                       \
  |  |  115|  43.4k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 10.8k]
  |  |  |  Branch (115:13): [True: 159, False: 10.6k]
  |  |  |  Branch (115:13): [True: 11, False: 148]
  |  |  ------------------
  |  |  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|  10.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 10.8k]
  |  |  ------------------
  ------------------
 2255|  10.8k|        RETURN_ERROR_IF(MEM_64bits() && sizeof(size_t) == sizeof(void*) && (size_t)(-1) - (size_t)dst < (size_t)(1 << 20), dstSize_tooSmall,
  ------------------
  |  |  114|  10.8k|    do {                                                                       \
  |  |  115|  54.0k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 10.8k, False: 0]
  |  |  |  Branch (115:13): [True: 0, Folded]
  |  |  |  Branch (115:13): [True: 0, False: 10.8k]
  |  |  ------------------
  |  |  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.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 10.8k]
  |  |  ------------------
  ------------------
 2256|  10.8k|                "invalid dst");
 2257|       |
 2258|       |        /* If we could potentially have long offsets, or we might want to use the prefetch decoder,
 2259|       |         * compute information about the share of long offsets, and the maximum nbAdditionalBits.
 2260|       |         * NOTE: could probably use a larger nbSeq limit
 2261|       |         */
 2262|  10.8k|        if (isLongOffset || (!usePrefetchDecoder && (totalHistorySize > (1u << 24)) && (nbSeq > 8))) {
  ------------------
  |  Branch (2262:13): [True: 0, False: 10.8k]
  |  Branch (2262:30): [True: 9.42k, False: 1.37k]
  |  Branch (2262:53): [True: 132, False: 9.29k]
  |  Branch (2262:88): [True: 0, False: 132]
  ------------------
 2263|      0|            ZSTD_OffsetInfo const info = ZSTD_getOffsetInfo(dctx->OFTptr, nbSeq);
 2264|      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 (2264:17): [True: 0, False: 0]
  |  Branch (2264:33): [True: 0, False: 0]
  ------------------
 2265|       |                /* If isLongOffset, but the maximum number of additional bits that we see in our table is small
 2266|       |                 * enough, then we know it is impossible to have too long an offset in this block, so we can
 2267|       |                 * use the regular offset decoder.
 2268|       |                 */
 2269|      0|                isLongOffset = ZSTD_lo_isRegularOffset;
 2270|      0|            }
 2271|      0|            if (!usePrefetchDecoder) {
  ------------------
  |  Branch (2271:17): [True: 0, False: 0]
  ------------------
 2272|      0|                U32 const minShare = MEM_64bits() ? 7 : 20; /* heuristic values, correspond to 2.73% and 7.81% */
  ------------------
  |  Branch (2272:38): [True: 0, False: 0]
  ------------------
 2273|      0|                usePrefetchDecoder = (info.longOffsetShare >= minShare);
 2274|      0|            }
 2275|      0|        }
 2276|       |
 2277|  10.8k|        dctx->ddictIsCold = 0;
 2278|       |
 2279|  10.8k|#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \
 2280|  10.8k|    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)
 2281|  10.8k|        if (usePrefetchDecoder) {
  ------------------
  |  Branch (2281:13): [True: 1.37k, False: 9.42k]
  ------------------
 2282|       |#else
 2283|       |        (void)usePrefetchDecoder;
 2284|       |        {
 2285|       |#endif
 2286|  1.37k|#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT
 2287|  1.37k|            return ZSTD_decompressSequencesLong(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2288|  1.37k|#endif
 2289|  1.37k|        }
 2290|       |
 2291|  9.42k|#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG
 2292|       |        /* else */
 2293|  9.42k|        if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (2293:13): [True: 654, False: 8.76k]
  ------------------
 2294|    654|            return ZSTD_decompressSequencesSplitLitBuffer(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2295|  8.76k|        else
 2296|  8.76k|            return ZSTD_decompressSequences(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2297|  9.42k|#endif
 2298|  9.42k|    }
 2299|  9.42k|}
ZSTD_checkContinuity:
 2304|  8.46k|{
 2305|  8.46k|    if (dst != dctx->previousDstEnd && dstSize > 0) {   /* not contiguous */
  ------------------
  |  Branch (2305:9): [True: 8.46k, False: 0]
  |  Branch (2305:40): [True: 8.08k, False: 383]
  ------------------
 2306|  8.08k|        dctx->dictEnd = dctx->previousDstEnd;
 2307|  8.08k|        dctx->virtualStart = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->prefixStart));
 2308|  8.08k|        dctx->prefixStart = dst;
 2309|  8.08k|        dctx->previousDstEnd = dst;
 2310|  8.08k|    }
 2311|       |    /* The external dictionary and current prefix share the frame window.
 2312|       |     * As the prefix grows after a wrap, retaining a full external window
 2313|       |     * could let corrupt offsets alias the destination and expose stale literals.
 2314|       |     * decodedSize > 0 ensures the frame header has initialized windowSize.
 2315|       |     * Only kicks in after decoding windowSize bytes because the entire dictionary is
 2316|       |     * valid as long as a single byte of the dictionary is in the window.
 2317|       |     */
 2318|  8.46k|    if (dstSize > 0 && dctx->isFrameDecompression && dctx->decodedSize > 0 && dctx->decodedSize >= dctx->fParams.windowSize) {
  ------------------
  |  Branch (2318:9): [True: 8.08k, False: 383]
  |  Branch (2318:24): [True: 8.08k, False: 0]
  |  Branch (2318:54): [True: 0, False: 8.08k]
  |  Branch (2318:79): [True: 0, False: 0]
  ------------------
 2319|      0|        size_t const prefixSize = (size_t)((const char*)dctx->previousDstEnd - (const char*)dctx->prefixStart);
 2320|      0|        size_t const extDictSize = (size_t)((const char*)dctx->prefixStart - (const char*)dctx->virtualStart);
 2321|      0|        U64 const maxExtDictSize = prefixSize < dctx->fParams.windowSize ? dctx->fParams.windowSize - prefixSize : 0;
  ------------------
  |  Branch (2321:36): [True: 0, False: 0]
  ------------------
 2322|      0|        dctx->virtualStart = (const char*)dctx->prefixStart - (size_t)MIN((U64)extDictSize, maxExtDictSize);
  ------------------
  |  |   54|      0|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2323|      0|    }
 2324|  8.46k|}
zstd_decompress_block.c:ZSTD_decodeLiteralsBlock:
  156|  12.4k|{
  157|  12.4k|    DEBUGLOG(5, "ZSTD_decodeLiteralsBlock");
  ------------------
  |  |  104|  12.4k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 12.4k]
  |  |  ------------------
  ------------------
  158|  12.4k|    RETURN_ERROR_IF(srcSize < MIN_CBLOCK_SIZE, corruption_detected, "");
  ------------------
  |  |  114|  12.4k|    do {                                                                       \
  |  |  115|  12.4k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 17, False: 12.4k]
  |  |  ------------------
  |  |  116|     17|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     17|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     17|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     17|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     17|    do {                                           \
  |  |  |  |   99|     17|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 17]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     17|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     17|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     17|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     17|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     17|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     17|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     17|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     17|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     17|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     17|        }                                                                      \
  |  |  123|  12.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 12.4k]
  |  |  ------------------
  ------------------
  159|       |
  160|  12.4k|    {   const BYTE* const istart = (const BYTE*) src;
  161|  12.4k|        SymbolEncodingType_e const litEncType = (SymbolEncodingType_e)(istart[0] & 3);
  162|  12.4k|        size_t const blockSizeMax = ZSTD_blockSizeMax(dctx);
  163|       |
  164|  12.4k|        switch(litEncType)
  165|  12.4k|        {
  166|    623|        case set_repeat:
  ------------------
  |  Branch (166:9): [True: 623, False: 11.8k]
  ------------------
  167|    623|            DEBUGLOG(5, "set_repeat flag : re-using stats from previous compressed literals block");
  ------------------
  |  |  104|    623|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 623]
  |  |  ------------------
  ------------------
  168|    623|            RETURN_ERROR_IF(dctx->litEntropy==0, dictionary_corrupted, "");
  ------------------
  |  |  114|    623|    do {                                                                       \
  |  |  115|    623|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 622]
  |  |  ------------------
  |  |  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|    623|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 622]
  |  |  ------------------
  ------------------
  169|    622|            ZSTD_FALLTHROUGH;
  ------------------
  |  |  288|    622|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  170|       |
  171|  7.28k|        case set_compressed:
  ------------------
  |  Branch (171:9): [True: 6.66k, False: 5.77k]
  ------------------
  172|  7.28k|            RETURN_ERROR_IF(srcSize < 5, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need up to 5 for case 3");
  ------------------
  |  |  114|  7.28k|    do {                                                                       \
  |  |  115|  7.28k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 7.28k]
  |  |  ------------------
  |  |  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.28k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 7.28k]
  |  |  ------------------
  ------------------
  173|  7.28k|            {   size_t lhSize, litSize, litCSize;
  174|  7.28k|                U32 singleStream=0;
  175|  7.28k|                U32 const lhlCode = (istart[0] >> 2) & 3;
  176|  7.28k|                U32 const lhc = MEM_readLE32(istart);
  177|  7.28k|                size_t hufSuccess;
  178|  7.28k|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|  7.28k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 3.04k, False: 4.24k]
  |  |  ------------------
  ------------------
  179|  7.28k|                int const flags = 0
  180|  7.28k|                    | (ZSTD_DCtx_get_bmi2(dctx) ? HUF_flags_bmi2 : 0)
  ------------------
  |  Branch (180:24): [True: 7.28k, False: 0]
  ------------------
  181|  7.28k|                    | (dctx->disableHufAsm ? HUF_flags_disableAsm : 0);
  ------------------
  |  Branch (181:24): [True: 0, False: 7.28k]
  ------------------
  182|  7.28k|                switch(lhlCode)
  183|  7.28k|                {
  184|  7.06k|                case 0: case 1: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (184:17): [True: 2.44k, False: 4.84k]
  |  Branch (184:25): [True: 4.61k, False: 2.66k]
  |  Branch (184:33): [True: 0, False: 7.28k]
  ------------------
  185|       |                    /* 2 - 2 - 10 - 10 */
  186|  7.06k|                    singleStream = !lhlCode;
  187|  7.06k|                    lhSize = 3;
  188|  7.06k|                    litSize  = (lhc >> 4) & 0x3FF;
  189|  7.06k|                    litCSize = (lhc >> 14) & 0x3FF;
  190|  7.06k|                    break;
  191|     58|                case 2:
  ------------------
  |  Branch (191:17): [True: 58, False: 7.22k]
  ------------------
  192|       |                    /* 2 - 2 - 14 - 14 */
  193|     58|                    lhSize = 4;
  194|     58|                    litSize  = (lhc >> 4) & 0x3FFF;
  195|     58|                    litCSize = lhc >> 18;
  196|     58|                    break;
  197|    164|                case 3:
  ------------------
  |  Branch (197:17): [True: 164, False: 7.12k]
  ------------------
  198|       |                    /* 2 - 2 - 18 - 18 */
  199|    164|                    lhSize = 5;
  200|    164|                    litSize  = (lhc >> 4) & 0x3FFFF;
  201|    164|                    litCSize = (lhc >> 22) + ((size_t)istart[4] << 10);
  202|    164|                    break;
  203|  7.28k|                }
  204|  7.28k|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  7.28k|    do {                                                                       \
  |  |  115|  21.0k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 6.44k, False: 843]
  |  |  |  Branch (115:13): [True: 0, False: 6.44k]
  |  |  ------------------
  |  |  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|  7.28k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 7.28k]
  |  |  ------------------
  ------------------
  205|  7.28k|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|  7.28k|    do {                                                                       \
  |  |  115|  7.28k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 7.28k]
  |  |  ------------------
  |  |  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|  7.28k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 7.28k]
  |  |  ------------------
  ------------------
  206|  7.28k|                if (!singleStream)
  ------------------
  |  Branch (206:21): [True: 4.83k, False: 2.44k]
  ------------------
  207|  4.83k|                    RETURN_ERROR_IF(litSize < MIN_LITERALS_FOR_4_STREAMS, literals_headerWrong,
  ------------------
  |  |  114|  4.83k|    do {                                                                       \
  |  |  115|  4.83k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 4.83k]
  |  |  ------------------
  |  |  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|  4.83k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.83k]
  |  |  ------------------
  ------------------
  208|  7.28k|                        "Not enough literals (%zu) for the 4-streams mode (min %u)",
  209|  7.28k|                        litSize, MIN_LITERALS_FOR_4_STREAMS);
  210|  7.28k|                RETURN_ERROR_IF(litCSize + lhSize > srcSize, corruption_detected, "");
  ------------------
  |  |  114|  7.28k|    do {                                                                       \
  |  |  115|  7.28k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 22, False: 7.26k]
  |  |  ------------------
  |  |  116|     22|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     22|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     22|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     22|    do {                                           \
  |  |  |  |   99|     22|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     22|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     22|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     22|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     22|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     22|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     22|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     22|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     22|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     22|        }                                                                      \
  |  |  123|  7.28k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 7.26k]
  |  |  ------------------
  ------------------
  211|  7.26k|                RETURN_ERROR_IF(expectedWriteSize < litSize , dstSize_tooSmall, "");
  ------------------
  |  |  114|  7.26k|    do {                                                                       \
  |  |  115|  7.26k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 19, False: 7.24k]
  |  |  ------------------
  |  |  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|  7.26k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 7.24k]
  |  |  ------------------
  ------------------
  212|  7.24k|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 0);
  213|       |
  214|       |                /* prefetch huffman table if cold */
  215|  7.24k|                if (dctx->ddictIsCold && (litSize > 768 /* heuristic */)) {
  ------------------
  |  Branch (215:21): [True: 583, False: 6.65k]
  |  Branch (215:42): [True: 86, False: 497]
  ------------------
  216|     86|                    PREFETCH_AREA(dctx->HUFptr, sizeof(dctx->entropy.hufTable));
  ------------------
  |  |  167|     86|    do {                                                 \
  |  |  168|     86|        const char* const _ptr = (const char*)(p);       \
  |  |  169|     86|        size_t const _size = (size_t)(s);                \
  |  |  170|     86|        size_t _pos;                                     \
  |  |  171|  22.1k|        for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \
  |  |  ------------------
  |  |  |  |  164|  22.1k|#define CACHELINE_SIZE 64
  |  |  ------------------
  |  |  |  Branch (171:22): [True: 22.1k, False: 86]
  |  |  ------------------
  |  |  172|  22.1k|            PREFETCH_L2(_ptr + _pos);                    \
  |  |  ------------------
  |  |  |  |  150|  22.1k|#    define PREFETCH_L2(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */)
  |  |  ------------------
  |  |  173|  22.1k|        }                                                \
  |  |  174|     86|    } while (0)
  |  |  ------------------
  |  |  |  Branch (174:14): [Folded, False: 86]
  |  |  ------------------
  ------------------
  217|     86|                }
  218|       |
  219|  7.24k|                if (litEncType==set_repeat) {
  ------------------
  |  Branch (219:21): [True: 619, False: 6.62k]
  ------------------
  220|    619|                    if (singleStream) {
  ------------------
  |  Branch (220:25): [True: 252, False: 367]
  ------------------
  221|    252|                        hufSuccess = HUF_decompress1X_usingDTable(
  222|    252|                            dctx->litBuffer, litSize, istart+lhSize, litCSize,
  223|    252|                            dctx->HUFptr, flags);
  224|    367|                    } else {
  225|    367|                        assert(litSize >= MIN_LITERALS_FOR_4_STREAMS);
  ------------------
  |  |   70|    367|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  226|    367|                        hufSuccess = HUF_decompress4X_usingDTable(
  227|    367|                            dctx->litBuffer, litSize, istart+lhSize, litCSize,
  228|    367|                            dctx->HUFptr, flags);
  229|    367|                    }
  230|  6.62k|                } else {
  231|  6.62k|                    if (singleStream) {
  ------------------
  |  Branch (231:25): [True: 2.18k, False: 4.43k]
  ------------------
  232|       |                        /* Compressed literals must use the table-reading variant;
  233|       |                         * the generic decoder also accepts raw/RLE data. */
  234|       |#if defined(HUF_FORCE_DECOMPRESS_X2)
  235|       |                        hufSuccess = HUF_decompress1X2_DCtx_wksp(
  236|       |                            dctx->entropy.hufTable, dctx->litBuffer, litSize,
  237|       |                            istart+lhSize, litCSize, dctx->workspace,
  238|       |                            sizeof(dctx->workspace), flags);
  239|       |#else
  240|  2.18k|                        hufSuccess = HUF_decompress1X1_DCtx_wksp(
  241|  2.18k|                            dctx->entropy.hufTable, dctx->litBuffer, litSize,
  242|  2.18k|                            istart+lhSize, litCSize, dctx->workspace,
  243|  2.18k|                            sizeof(dctx->workspace), flags);
  244|  2.18k|#endif
  245|  4.43k|                    } else {
  246|  4.43k|                        hufSuccess = HUF_decompress4X_hufOnly_wksp(
  247|  4.43k|                            dctx->entropy.hufTable, dctx->litBuffer, litSize,
  248|  4.43k|                            istart+lhSize, litCSize, dctx->workspace,
  249|  4.43k|                            sizeof(dctx->workspace), flags);
  250|  4.43k|                    }
  251|  6.62k|                }
  252|  7.24k|                if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (252:21): [True: 62, False: 7.17k]
  ------------------
  253|     62|                {
  254|     62|                    assert(litSize > ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   70|     62|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  255|     62|                    ZSTD_memcpy(dctx->litExtraBuffer, dctx->litBufferEnd - ZSTD_LITBUFFEREXTRASIZE, ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   44|    372|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  |  |  ------------------
  |  |  |  Branch (44:51): [True: 0, Folded]
  |  |  |  Branch (44:51): [True: 62, Folded]
  |  |  |  Branch (44:51): [Folded, False: 62]
  |  |  |  Branch (44:55): [True: 0, Folded]
  |  |  |  Branch (44:55): [True: 62, Folded]
  |  |  |  Branch (44:55): [Folded, False: 62]
  |  |  ------------------
  ------------------
  256|     62|                    ZSTD_memmove(dctx->litBuffer + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH, dctx->litBuffer, litSize - ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   45|    372|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  |  |  ------------------
  |  |  |  Branch (45:49): [True: 0, Folded]
  |  |  |  Branch (45:49): [True: 62, Folded]
  |  |  |  Branch (45:49): [Folded, False: 62]
  |  |  |  Branch (45:57): [True: 0, Folded]
  |  |  |  Branch (45:57): [True: 62, Folded]
  |  |  |  Branch (45:57): [Folded, False: 62]
  |  |  ------------------
  ------------------
  257|     62|                    dctx->litBuffer += ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  118|     62|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|     62|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|    124|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 62]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 62, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  dctx->litBuffer += ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  201|     62|#define WILDCOPY_OVERLENGTH 32
  ------------------
  258|     62|                    dctx->litBufferEnd -= WILDCOPY_OVERLENGTH;
  ------------------
  |  |  201|     62|#define WILDCOPY_OVERLENGTH 32
  ------------------
  259|     62|                    assert(dctx->litBufferEnd <= (BYTE*)dst + blockSizeMax);
  ------------------
  |  |   70|     62|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  260|     62|                }
  261|       |
  262|  7.24k|                RETURN_ERROR_IF(HUF_isError(hufSuccess), corruption_detected, "");
  ------------------
  |  |  114|  7.24k|    do {                                                                       \
  |  |  115|  7.24k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1.18k, False: 6.05k]
  |  |  ------------------
  |  |  116|  1.18k|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|  1.18k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|  1.18k|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|  1.18k|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|  1.18k|    do {                                           \
  |  |  |  |   99|  1.18k|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1.18k]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|  1.18k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|  1.18k|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|  1.18k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  1.18k|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|  1.18k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|  1.18k|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|  1.18k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|  1.18k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  1.18k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|  1.18k|        }                                                                      \
  |  |  123|  7.24k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 6.05k]
  |  |  ------------------
  ------------------
  263|       |
  264|  6.05k|                ZSTD_zeroLiteralsBufferPadding(dctx, litSize);
  265|  6.05k|                dctx->litPtr = dctx->litBuffer;
  266|  6.05k|                dctx->litSize = litSize;
  267|  6.05k|                dctx->litEntropy = 1;
  268|  6.05k|                if (litEncType==set_compressed) dctx->HUFptr = dctx->entropy.hufTable;
  ------------------
  |  Branch (268:21): [True: 5.72k, False: 330]
  ------------------
  269|  6.05k|                return litCSize + lhSize;
  270|  7.24k|            }
  271|       |
  272|  2.43k|        case set_basic:
  ------------------
  |  Branch (272:9): [True: 2.43k, False: 10.0k]
  ------------------
  273|  2.43k|            {   size_t litSize, lhSize;
  274|  2.43k|                U32 const lhlCode = ((istart[0]) >> 2) & 3;
  275|  2.43k|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|  2.43k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 363, False: 2.07k]
  |  |  ------------------
  ------------------
  276|  2.43k|                switch(lhlCode)
  277|  2.43k|                {
  278|  1.95k|                case 0: case 2: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (278:17): [True: 1.55k, False: 876]
  |  Branch (278:25): [True: 401, False: 2.03k]
  |  Branch (278:33): [True: 0, False: 2.43k]
  ------------------
  279|  1.95k|                    lhSize = 1;
  280|  1.95k|                    litSize = istart[0] >> 3;
  281|  1.95k|                    break;
  282|    394|                case 1:
  ------------------
  |  Branch (282:17): [True: 394, False: 2.04k]
  ------------------
  283|    394|                    lhSize = 2;
  284|    394|                    litSize = MEM_readLE16(istart) >> 4;
  285|    394|                    break;
  286|     81|                case 3:
  ------------------
  |  Branch (286:17): [True: 81, False: 2.35k]
  ------------------
  287|     81|                    lhSize = 3;
  288|     81|                    RETURN_ERROR_IF(srcSize<3, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize = 3");
  ------------------
  |  |  114|     81|    do {                                                                       \
  |  |  115|     81|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 80]
  |  |  ------------------
  |  |  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|     81|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 80]
  |  |  ------------------
  ------------------
  289|     80|                    litSize = MEM_readLE24(istart) >> 4;
  290|     80|                    break;
  291|  2.43k|                }
  292|       |
  293|  2.43k|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  2.43k|    do {                                                                       \
  |  |  115|  5.57k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 708, False: 1.72k]
  |  |  |  Branch (115:13): [True: 0, False: 708]
  |  |  ------------------
  |  |  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.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.43k]
  |  |  ------------------
  ------------------
  294|  2.43k|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|  2.43k|    do {                                                                       \
  |  |  115|  2.43k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 28, False: 2.40k]
  |  |  ------------------
  |  |  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.43k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.40k]
  |  |  ------------------
  ------------------
  295|  2.40k|                RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, "");
  ------------------
  |  |  114|  2.40k|    do {                                                                       \
  |  |  115|  2.40k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 13, False: 2.39k]
  |  |  ------------------
  |  |  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.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.39k]
  |  |  ------------------
  ------------------
  296|  2.39k|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1);
  297|  2.39k|                if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */
  ------------------
  |  |  201|  2.39k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  |  Branch (297:21): [True: 2.23k, False: 153]
  ------------------
  298|  2.23k|                    RETURN_ERROR_IF(litSize+lhSize > srcSize, corruption_detected, "");
  ------------------
  |  |  114|  2.23k|    do {                                                                       \
  |  |  115|  2.23k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 31, False: 2.20k]
  |  |  ------------------
  |  |  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.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.20k]
  |  |  ------------------
  ------------------
  299|  2.20k|                    if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (299:25): [True: 0, False: 2.20k]
  ------------------
  300|      0|                    {
  301|      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]
  |  |  ------------------
  ------------------
  302|      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]
  |  |  ------------------
  ------------------
  303|      0|                    }
  304|  2.20k|                    else
  305|  2.20k|                    {
  306|  2.20k|                        ZSTD_memcpy(dctx->litBuffer, istart + lhSize, litSize);
  ------------------
  |  |   44|  2.20k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  307|  2.20k|                    }
  308|  2.20k|                    ZSTD_zeroLiteralsBufferPadding(dctx, litSize);
  309|  2.20k|                    dctx->litPtr = dctx->litBuffer;
  310|  2.20k|                    dctx->litSize = litSize;
  311|  2.20k|                    return lhSize+litSize;
  312|  2.23k|                }
  313|       |                /* direct reference into compressed stream */
  314|    153|                dctx->litPtr = istart+lhSize;
  315|    153|                dctx->litSize = litSize;
  316|    153|                dctx->litBufferEnd = dctx->litPtr + litSize;
  317|    153|                dctx->litBufferLocation = ZSTD_not_in_dst;
  318|    153|                return lhSize+litSize;
  319|  2.39k|            }
  320|       |
  321|  2.71k|        case set_rle:
  ------------------
  |  Branch (321:9): [True: 2.71k, False: 9.72k]
  ------------------
  322|  2.71k|            {   U32 const lhlCode = ((istart[0]) >> 2) & 3;
  323|  2.71k|                size_t litSize, lhSize;
  324|  2.71k|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|  2.71k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 596, False: 2.12k]
  |  |  ------------------
  ------------------
  325|  2.71k|                switch(lhlCode)
  326|  2.71k|                {
  327|  1.21k|                case 0: case 2: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (327:17): [True: 767, False: 1.95k]
  |  Branch (327:25): [True: 447, False: 2.27k]
  |  Branch (327:33): [True: 0, False: 2.71k]
  ------------------
  328|  1.21k|                    lhSize = 1;
  329|  1.21k|                    litSize = istart[0] >> 3;
  330|  1.21k|                    break;
  331|    132|                case 1:
  ------------------
  |  Branch (331:17): [True: 132, False: 2.58k]
  ------------------
  332|    132|                    lhSize = 2;
  333|    132|                    RETURN_ERROR_IF(srcSize<3, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize+1 = 3");
  ------------------
  |  |  114|    132|    do {                                                                       \
  |  |  115|    132|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 5, False: 127]
  |  |  ------------------
  |  |  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|    132|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 127]
  |  |  ------------------
  ------------------
  334|    127|                    litSize = MEM_readLE16(istart) >> 4;
  335|    127|                    break;
  336|  1.37k|                case 3:
  ------------------
  |  Branch (336:17): [True: 1.37k, False: 1.34k]
  ------------------
  337|  1.37k|                    lhSize = 3;
  338|  1.37k|                    RETURN_ERROR_IF(srcSize<4, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize+1 = 4");
  ------------------
  |  |  114|  1.37k|    do {                                                                       \
  |  |  115|  1.37k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4, False: 1.36k]
  |  |  ------------------
  |  |  116|      4|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      4|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      4|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      4|    do {                                           \
  |  |  |  |   99|      4|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      4|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      4|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      4|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      4|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      4|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      4|        }                                                                      \
  |  |  123|  1.37k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.36k]
  |  |  ------------------
  ------------------
  339|  1.36k|                    litSize = MEM_readLE24(istart) >> 4;
  340|  1.36k|                    break;
  341|  2.71k|                }
  342|  2.71k|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  2.71k|    do {                                                                       \
  |  |  115|  7.91k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2.49k, False: 212]
  |  |  |  Branch (115:13): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  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.71k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.71k]
  |  |  ------------------
  ------------------
  343|  2.71k|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|  2.71k|    do {                                                                       \
  |  |  115|  2.71k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 27, False: 2.68k]
  |  |  ------------------
  |  |  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|  2.71k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.68k]
  |  |  ------------------
  ------------------
  344|  2.68k|                RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, "");
  ------------------
  |  |  114|  2.68k|    do {                                                                       \
  |  |  115|  2.68k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 19, False: 2.66k]
  |  |  ------------------
  |  |  116|     19|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     19|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 19]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     19|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     19|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     19|    do {                                           \
  |  |  |  |   99|     19|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 19]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     19|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 19]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     19|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     19|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 19]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     19|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     19|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 19]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     19|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     19|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     19|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     19|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     19|        }                                                                      \
  |  |  123|  2.68k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.66k]
  |  |  ------------------
  ------------------
  345|  2.66k|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1);
  346|  2.66k|                if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (346:21): [True: 974, False: 1.69k]
  ------------------
  347|    974|                {
  348|    974|                    ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize - ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   46|  5.84k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  |  |  ------------------
  |  |  |  Branch (46:55): [True: 0, Folded]
  |  |  |  Branch (46:55): [True: 974, Folded]
  |  |  |  Branch (46:55): [Folded, False: 974]
  |  |  ------------------
  ------------------
  349|    974|                    ZSTD_memset(dctx->litExtraBuffer, istart[lhSize], ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   46|  5.84k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  |  |  ------------------
  |  |  |  Branch (46:55): [True: 0, Folded]
  |  |  |  Branch (46:55): [True: 974, Folded]
  |  |  |  Branch (46:55): [Folded, False: 974]
  |  |  ------------------
  ------------------
  350|    974|                }
  351|  1.69k|                else
  352|  1.69k|                {
  353|  1.69k|                    ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize);
  ------------------
  |  |   46|  1.69k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  354|  1.69k|                }
  355|  2.66k|                ZSTD_zeroLiteralsBufferPadding(dctx, litSize);
  356|  2.66k|                dctx->litPtr = dctx->litBuffer;
  357|  2.66k|                dctx->litSize = litSize;
  358|  2.66k|                return lhSize+1;
  359|  2.68k|            }
  360|      0|        default:
  ------------------
  |  Branch (360:9): [True: 0, False: 12.4k]
  ------------------
  361|      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]
  |  |  ------------------
  ------------------
  362|  12.4k|        }
  363|  12.4k|    }
  364|  12.4k|}
zstd_decompress_block.c:ZSTD_allocateLiteralsBuffer:
   82|  12.2k|{
   83|  12.2k|    size_t const blockSizeMax = ZSTD_blockSizeMax(dctx);
   84|  12.2k|    assert(litSize <= blockSizeMax);
  ------------------
  |  |   70|  12.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   85|  12.2k|    assert(dctx->isFrameDecompression || streaming == not_streaming);
  ------------------
  |  |   70|  12.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   86|  12.2k|    assert(expectedWriteSize <= blockSizeMax);
  ------------------
  |  |   70|  12.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   87|  12.2k|    if (streaming == not_streaming && dstCapacity > blockSizeMax + WILDCOPY_OVERLENGTH + litSize + WILDCOPY_OVERLENGTH) {
  ------------------
  |  |  201|  12.2k|#define WILDCOPY_OVERLENGTH 32
  ------------------
                  if (streaming == not_streaming && dstCapacity > blockSizeMax + WILDCOPY_OVERLENGTH + litSize + WILDCOPY_OVERLENGTH) {
  ------------------
  |  |  201|  12.2k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  |  Branch (87:9): [True: 12.2k, False: 0]
  |  Branch (87:39): [True: 3.39k, False: 8.90k]
  ------------------
   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|  3.39k|        dctx->litBuffer = (BYTE*)dst + blockSizeMax + WILDCOPY_OVERLENGTH;
  ------------------
  |  |  201|  3.39k|#define WILDCOPY_OVERLENGTH 32
  ------------------
   94|  3.39k|        dctx->litBufferEnd = dctx->litBuffer + litSize;
   95|  3.39k|        dctx->litBufferLocation = ZSTD_in_dst;
   96|  8.90k|    } else if (litSize <= ZSTD_LITBUFFEREXTRASIZE) {
  ------------------
  |  |  118|  8.90k|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|  8.90k|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  17.8k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 8.90k]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 8.90k, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (96:16): [True: 7.86k, False: 1.04k]
  ------------------
   97|       |        /* Literals fit entirely within the extra buffer, put them there to avoid
   98|       |         * having to split the literals.
   99|       |         */
  100|  7.86k|        dctx->litBuffer = dctx->litExtraBuffer;
  101|  7.86k|        dctx->litBufferEnd = dctx->litBuffer + litSize;
  102|  7.86k|        dctx->litBufferLocation = ZSTD_not_in_dst;
  103|  7.86k|    } else {
  104|  1.04k|        assert(blockSizeMax > ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   70|  1.04k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  105|       |        /* Literals must be split between the output block and the extra lit
  106|       |         * buffer. We fill the extra lit buffer with the tail of the literals,
  107|       |         * and put the rest of the literals at the end of the block, with
  108|       |         * WILDCOPY_OVERLENGTH of buffer room to allow for overreads.
  109|       |         * This MUST not write more than our maxBlockSize beyond dst, because in
  110|       |         * streaming mode, that could overwrite part of our extDict window.
  111|       |         */
  112|  1.04k|        if (splitImmediately) {
  ------------------
  |  Branch (112:13): [True: 980, False: 62]
  ------------------
  113|       |            /* won't fit in litExtraBuffer, so it will be split between end of dst and extra buffer */
  114|    980|            dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  118|    980|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    980|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.96k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 980]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 980, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  201|    980|#define WILDCOPY_OVERLENGTH 32
  ------------------
  115|    980|            dctx->litBufferEnd = dctx->litBuffer + litSize - ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    980|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    980|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.96k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 980]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 980, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|    980|        } else {
  117|       |            /* initially this will be stored entirely in dst during huffman decoding, it will partially be shifted to litExtraBuffer after */
  118|     62|            dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize;
  119|     62|            dctx->litBufferEnd = (BYTE*)dst + expectedWriteSize;
  120|     62|        }
  121|  1.04k|        dctx->litBufferLocation = ZSTD_split;
  122|  1.04k|        assert(dctx->litBufferEnd <= (BYTE*)dst + expectedWriteSize);
  ------------------
  |  |   70|  1.04k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  123|  1.04k|    }
  124|  12.2k|}
zstd_decompress_block.c:ZSTD_zeroLiteralsBufferPadding:
  132|  10.9k|{
  133|  10.9k|    if (dctx->litBufferLocation == ZSTD_split) {
  ------------------
  |  Branch (133:9): [True: 1.00k, False: 9.92k]
  ------------------
  134|  1.00k|        BYTE* const litBufferEnd = dctx->litBuffer + litSize - ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|  1.00k|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|  1.00k|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  2.00k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 1.00k]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 1.00k, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  135|  1.00k|        assert(litBufferEnd == dctx->litBufferEnd);
  ------------------
  |  |   70|  1.00k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  136|  1.00k|        ZSTD_memset(litBufferEnd, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |   46|  1.00k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  137|  1.00k|        ZSTD_memset(dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |   46|  6.00k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  |  |  ------------------
  |  |  |  Branch (46:47): [True: 0, Folded]
  |  |  |  Branch (46:47): [True: 1.00k, Folded]
  |  |  |  Branch (46:47): [Folded, False: 1.00k]
  |  |  ------------------
  ------------------
  138|  9.92k|    } else {
  139|  9.92k|        BYTE* const litBufferEnd = dctx->litBuffer + litSize;
  140|  9.92k|        assert(litBufferEnd == dctx->litBufferEnd);
  ------------------
  |  |   70|  9.92k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  141|  9.92k|        ZSTD_memset(litBufferEnd, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |   46|  9.92k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  142|  9.92k|    }
  143|  10.9k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body_bmi2:
  644|  6.15k|{
  645|  6.15k|    ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,
  646|  6.15k|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  647|  6.15k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body:
  513|  8.18k|{
  514|  8.18k|    ZSTD_seqSymbol* const tableDecode = dt+1;
  515|  8.18k|    U32 const maxSV1 = maxSymbolValue + 1;
  516|  8.18k|    U32 const tableSize = 1 << tableLog;
  517|       |
  518|  8.18k|    U16* symbolNext = (U16*)wksp;
  519|  8.18k|    BYTE* spread = (BYTE*)(symbolNext + MaxSeq + 1);
  ------------------
  |  |  107|  8.18k|#define MaxSeq MAX(MaxLL, MaxML)   /* Assumption : MaxOff < MaxLL,MaxML */
  |  |  ------------------
  |  |  |  |   55|  8.18k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (55:19): [Folded, False: 8.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  520|  8.18k|    U32 highThreshold = tableSize - 1;
  521|       |
  522|       |
  523|       |    /* Sanity Checks */
  524|  8.18k|    assert(maxSymbolValue <= MaxSeq);
  ------------------
  |  |   70|  8.18k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  525|  8.18k|    assert(tableLog <= MaxFSELog);
  ------------------
  |  |   70|  8.18k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  526|  8.18k|    assert(wkspSize >= ZSTD_BUILD_FSE_TABLE_WKSP_SIZE);
  ------------------
  |  |   70|  8.18k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  527|  8.18k|    (void)wkspSize;
  528|       |    /* Init, lay down lowprob symbols */
  529|  8.18k|    {   ZSTD_seqSymbol_header DTableH;
  530|  8.18k|        DTableH.tableLog = tableLog;
  531|  8.18k|        DTableH.fastMode = 1;
  532|  8.18k|        {   S16 const largeLimit= (S16)(1 << (tableLog-1));
  533|  8.18k|            U32 s;
  534|   111k|            for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (534:23): [True: 103k, False: 8.18k]
  ------------------
  535|   103k|                if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (535:21): [True: 37.4k, False: 66.1k]
  ------------------
  536|  37.4k|                    tableDecode[highThreshold--].baseValue = s;
  537|  37.4k|                    symbolNext[s] = 1;
  538|  66.1k|                } else {
  539|  66.1k|                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
  ------------------
  |  Branch (539:25): [True: 4.63k, False: 61.4k]
  ------------------
  540|  66.1k|                    assert(normalizedCounter[s]>=0);
  ------------------
  |  |   70|  66.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  541|  66.1k|                    symbolNext[s] = (U16)normalizedCounter[s];
  542|  66.1k|        }   }   }
  543|  8.18k|        ZSTD_memcpy(dt, &DTableH, sizeof(DTableH));
  ------------------
  |  |   44|  8.18k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  544|  8.18k|    }
  545|       |
  546|       |    /* Spread symbols */
  547|  8.18k|    assert(tableSize <= 512);
  ------------------
  |  |   70|  8.18k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  548|       |    /* Specialized symbol spreading for the case when there are
  549|       |     * no low probability (-1 count) symbols. When compressing
  550|       |     * small blocks we avoid low probability symbols to hit this
  551|       |     * case, since header decoding speed matters more.
  552|       |     */
  553|  8.18k|    if (highThreshold == tableSize - 1) {
  ------------------
  |  Branch (553:9): [True: 2.64k, False: 5.54k]
  ------------------
  554|  2.64k|        size_t const tableMask = tableSize-1;
  555|  2.64k|        size_t const step = FSE_TABLESTEP(tableSize);
  ------------------
  |  |  623|  2.64k|#define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3)
  ------------------
  556|       |        /* First lay down the symbols in order.
  557|       |         * We use a uint64_t to lay down 8 bytes at a time. This reduces branch
  558|       |         * misses since small blocks generally have small table logs, so nearly
  559|       |         * all symbols have counts <= 8. We ensure we have 8 bytes at the end of
  560|       |         * our buffer to handle the over-write.
  561|       |         */
  562|  2.64k|        {
  563|  2.64k|            U64 const add = 0x0101010101010101ull;
  564|  2.64k|            size_t pos = 0;
  565|  2.64k|            U64 sv = 0;
  566|  2.64k|            U32 s;
  567|  14.7k|            for (s=0; s<maxSV1; ++s, sv += add) {
  ------------------
  |  Branch (567:23): [True: 12.1k, False: 2.64k]
  ------------------
  568|  12.1k|                int i;
  569|  12.1k|                int const n = normalizedCounter[s];
  570|  12.1k|                MEM_write64(spread + pos, sv);
  571|  52.2k|                for (i = 8; i < n; i += 8) {
  ------------------
  |  Branch (571:29): [True: 40.0k, False: 12.1k]
  ------------------
  572|  40.0k|                    MEM_write64(spread + pos + i, sv);
  573|  40.0k|                }
  574|  12.1k|                assert(n>=0);
  ------------------
  |  |   70|  12.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  575|  12.1k|                pos += (size_t)n;
  576|  12.1k|            }
  577|  2.64k|        }
  578|       |        /* Now we spread those positions across the table.
  579|       |         * The benefit of doing it in two stages is that we avoid the
  580|       |         * variable size inner loop, which caused lots of branch misses.
  581|       |         * Now we can run through all the positions without any branch misses.
  582|       |         * We unroll the loop twice, since that is what empirically worked best.
  583|       |         */
  584|  2.64k|        {
  585|  2.64k|            size_t position = 0;
  586|  2.64k|            size_t s;
  587|  2.64k|            size_t const unroll = 2;
  588|  2.64k|            assert(tableSize % unroll == 0); /* FSE_MIN_TABLELOG is 5 */
  ------------------
  |  |   70|  2.64k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  589|   182k|            for (s = 0; s < (size_t)tableSize; s += unroll) {
  ------------------
  |  Branch (589:25): [True: 180k, False: 2.64k]
  ------------------
  590|   180k|                size_t u;
  591|   540k|                for (u = 0; u < unroll; ++u) {
  ------------------
  |  Branch (591:29): [True: 360k, False: 180k]
  ------------------
  592|   360k|                    size_t const uPosition = (position + (u * step)) & tableMask;
  593|   360k|                    tableDecode[uPosition].baseValue = spread[s + u];
  594|   360k|                }
  595|   180k|                position = (position + (unroll * step)) & tableMask;
  596|   180k|            }
  597|  2.64k|            assert(position == 0);
  ------------------
  |  |   70|  2.64k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  598|  2.64k|        }
  599|  5.54k|    } else {
  600|  5.54k|        U32 const tableMask = tableSize-1;
  601|  5.54k|        U32 const step = FSE_TABLESTEP(tableSize);
  ------------------
  |  |  623|  5.54k|#define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3)
  ------------------
  602|  5.54k|        U32 s, position = 0;
  603|  96.9k|        for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (603:19): [True: 91.4k, False: 5.54k]
  ------------------
  604|  91.4k|            int i;
  605|  91.4k|            int const n = normalizedCounter[s];
  606|   708k|            for (i=0; i<n; i++) {
  ------------------
  |  Branch (606:23): [True: 617k, False: 91.4k]
  ------------------
  607|   617k|                tableDecode[position].baseValue = s;
  608|   617k|                position = (position + step) & tableMask;
  609|   654k|                while (UNLIKELY(position > highThreshold)) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  |  196|   654k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (196:21): [True: 36.7k, False: 617k]
  |  |  ------------------
  ------------------
  610|   617k|        }   }
  611|  5.54k|        assert(position == 0); /* position must reach all cells once, otherwise normalizedCounter is incorrect */
  ------------------
  |  |   70|  5.54k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  612|  5.54k|    }
  613|       |
  614|       |    /* Build Decoding table */
  615|  8.18k|    {
  616|  8.18k|        U32 u;
  617|  1.02M|        for (u=0; u<tableSize; u++) {
  ------------------
  |  Branch (617:19): [True: 1.01M, False: 8.18k]
  ------------------
  618|  1.01M|            U32 const symbol = tableDecode[u].baseValue;
  619|  1.01M|            U32 const nextState = symbolNext[symbol]++;
  620|  1.01M|            tableDecode[u].nbBits = (BYTE) (tableLog - ZSTD_highbit32(nextState) );
  621|  1.01M|            tableDecode[u].nextState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
  622|  1.01M|            assert(nbAdditionalBits[symbol] < 255);
  ------------------
  |  |   70|  1.01M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  623|  1.01M|            tableDecode[u].nbAdditionalBits = nbAdditionalBits[symbol];
  624|  1.01M|            tableDecode[u].baseValue = baseValue[symbol];
  625|  1.01M|        }
  626|  8.18k|    }
  627|  8.18k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body_default:
  634|  2.03k|{
  635|  2.03k|    ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,
  636|  2.03k|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  637|  2.03k|}
zstd_decompress_block.c:ZSTD_buildSeqTable:
  678|  16.7k|{
  679|  16.7k|    switch(type)
  680|  16.7k|    {
  681|  3.48k|    case set_rle :
  ------------------
  |  Branch (681:5): [True: 3.48k, False: 13.2k]
  ------------------
  682|  3.48k|        RETURN_ERROR_IF(!srcSize, srcSize_wrong, "");
  ------------------
  |  |  114|  3.48k|    do {                                                                       \
  |  |  115|  3.48k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 10, False: 3.47k]
  |  |  ------------------
  |  |  116|     10|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     10|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     10|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     10|    do {                                           \
  |  |  |  |   99|     10|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     10|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     10|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     10|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     10|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     10|        }                                                                      \
  |  |  123|  3.48k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.47k]
  |  |  ------------------
  ------------------
  683|  3.47k|        RETURN_ERROR_IF((*(const BYTE*)src) > max, corruption_detected, "");
  ------------------
  |  |  114|  3.47k|    do {                                                                       \
  |  |  115|  3.47k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 11, False: 3.46k]
  |  |  ------------------
  |  |  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|  3.47k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.46k]
  |  |  ------------------
  ------------------
  684|  3.46k|        {   U32 const symbol = *(const BYTE*)src;
  685|  3.46k|            U32 const baseline = baseValue[symbol];
  686|  3.46k|            U8 const nbBits = nbAdditionalBits[symbol];
  687|  3.46k|            ZSTD_buildSeqTable_rle(DTableSpace, baseline, nbBits);
  688|  3.46k|        }
  689|  3.46k|        *DTablePtr = DTableSpace;
  690|  3.46k|        return 1;
  691|  6.54k|    case set_basic :
  ------------------
  |  Branch (691:5): [True: 6.54k, False: 10.1k]
  ------------------
  692|  6.54k|        *DTablePtr = defaultTable;
  693|  6.54k|        return 0;
  694|    444|    case set_repeat:
  ------------------
  |  Branch (694:5): [True: 444, False: 16.2k]
  ------------------
  695|    444|        RETURN_ERROR_IF(!flagRepeatTable, corruption_detected, "");
  ------------------
  |  |  114|    444|    do {                                                                       \
  |  |  115|    444|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 7, False: 437]
  |  |  ------------------
  |  |  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|    444|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 437]
  |  |  ------------------
  ------------------
  696|       |        /* prefetch FSE table if used */
  697|    437|        if (ddictIsCold && (nbSeq > 24 /* heuristic */)) {
  ------------------
  |  Branch (697:13): [True: 140, False: 297]
  |  Branch (697:28): [True: 49, False: 91]
  ------------------
  698|     49|            const void* const pStart = *DTablePtr;
  699|     49|            size_t const pSize = sizeof(ZSTD_seqSymbol) * (SEQSYMBOL_TABLE_SIZE(maxLog));
  ------------------
  |  |   74|     49| #define SEQSYMBOL_TABLE_SIZE(log)   (1 + (1 << (log)))
  ------------------
  700|     49|            PREFETCH_AREA(pStart, pSize);
  ------------------
  |  |  167|     49|    do {                                                 \
  |  |  168|     49|        const char* const _ptr = (const char*)(p);       \
  |  |  169|     49|        size_t const _size = (size_t)(s);                \
  |  |  170|     49|        size_t _pos;                                     \
  |  |  171|  2.69k|        for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \
  |  |  ------------------
  |  |  |  |  164|  2.64k|#define CACHELINE_SIZE 64
  |  |  ------------------
  |  |  |  Branch (171:22): [True: 2.64k, False: 49]
  |  |  ------------------
  |  |  172|  2.64k|            PREFETCH_L2(_ptr + _pos);                    \
  |  |  ------------------
  |  |  |  |  150|  2.64k|#    define PREFETCH_L2(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */)
  |  |  ------------------
  |  |  173|  2.64k|        }                                                \
  |  |  174|     49|    } while (0)
  |  |  ------------------
  |  |  |  Branch (174:14): [Folded, False: 49]
  |  |  ------------------
  ------------------
  701|     49|        }
  702|    437|        return 0;
  703|  6.24k|    case set_compressed :
  ------------------
  |  Branch (703:5): [True: 6.24k, False: 10.4k]
  ------------------
  704|  6.24k|        {   unsigned tableLog;
  705|  6.24k|            S16 norm[MaxSeq+1];
  706|  6.24k|            size_t const headerSize = FSE_readNCount(norm, &max, &tableLog, src, srcSize);
  707|  6.24k|            RETURN_ERROR_IF(FSE_isError(headerSize), corruption_detected, "");
  ------------------
  |  |  114|  6.24k|    do {                                                                       \
  |  |  115|  6.24k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 74, False: 6.17k]
  |  |  ------------------
  |  |  116|     74|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     74|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 74]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     74|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     74|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     74|    do {                                           \
  |  |  |  |   99|     74|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 74]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     74|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 74]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     74|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     74|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 74]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     74|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     74|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 74]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     74|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     74|        }                                                                      \
  |  |  123|  6.24k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 6.17k]
  |  |  ------------------
  ------------------
  708|  6.17k|            RETURN_ERROR_IF(tableLog > maxLog, corruption_detected, "");
  ------------------
  |  |  114|  6.17k|    do {                                                                       \
  |  |  115|  6.17k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 20, False: 6.15k]
  |  |  ------------------
  |  |  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|  6.17k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 6.15k]
  |  |  ------------------
  ------------------
  709|  6.15k|            ZSTD_buildFSETable(DTableSpace, norm, max, baseValue, nbAdditionalBits, tableLog, wksp, wkspSize, bmi2);
  710|  6.15k|            *DTablePtr = DTableSpace;
  711|  6.15k|            return headerSize;
  712|  6.17k|        }
  713|      0|    default :
  ------------------
  |  Branch (713:5): [True: 0, False: 16.7k]
  ------------------
  714|      0|        assert(0);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  715|      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]
  |  |  ------------------
  ------------------
  716|  16.7k|    }
  717|  16.7k|}
zstd_decompress_block.c:ZSTD_buildSeqTable_rle:
  488|  3.46k|{
  489|  3.46k|    void* ptr = dt;
  490|  3.46k|    ZSTD_seqSymbol_header* const DTableH = (ZSTD_seqSymbol_header*)ptr;
  491|  3.46k|    ZSTD_seqSymbol* const cell = dt + 1;
  492|       |
  493|  3.46k|    DTableH->tableLog = 0;
  494|  3.46k|    DTableH->fastMode = 0;
  495|       |
  496|  3.46k|    cell->nbBits = 0;
  497|  3.46k|    cell->nextState = 0;
  498|  3.46k|    assert(nbAddBits < 255);
  ------------------
  |  |   70|  3.46k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  499|  3.46k|    cell->nbAdditionalBits = nbAddBits;
  500|  3.46k|    cell->baseValue = baseValue;
  501|  3.46k|}
zstd_decompress_block.c:ZSTD_blockSizeMax:
   55|  52.1k|{
   56|  52.1k|    size_t const blockSizeMax = dctx->isFrameDecompression ? dctx->fParams.blockSizeMax : ZSTD_BLOCKSIZE_MAX;
  ------------------
  |  |  148|  52.1k|#define ZSTD_BLOCKSIZE_MAX     (1<<ZSTD_BLOCKSIZELOG_MAX)
  |  |  ------------------
  |  |  |  |  147|      0|#define ZSTD_BLOCKSIZELOG_MAX  17
  |  |  ------------------
  ------------------
  |  Branch (56:33): [True: 52.1k, False: 0]
  ------------------
   57|  52.1k|    assert(blockSizeMax <= ZSTD_BLOCKSIZE_MAX);
  ------------------
  |  |   70|  52.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   58|  52.1k|    return blockSizeMax;
   59|  52.1k|}
zstd_decompress_block.c:ZSTD_totalHistorySize:
 2122|  11.0k|{
 2123|  11.0k|    return (size_t)ZSTD_wrappedPtrDiff((const BYTE*)curPtr, (const BYTE*)virtualStart);
 2124|  11.0k|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong:
 2106|  1.37k|{
 2107|  1.37k|    DEBUGLOG(5, "ZSTD_decompressSequencesLong");
  ------------------
  |  |  104|  1.37k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 1.37k]
  |  |  ------------------
  ------------------
 2108|  1.37k|    if (ZSTD_USE_BMI2(ZSTD_DCtx_get_bmi2(dctx))) {
  ------------------
  |  |   36|  1.37k|#  define ZSTD_USE_BMI2(bmi2) (bmi2)
  |  |  ------------------
  |  |  |  Branch (36:31): [True: 1.37k, False: 0]
  |  |  ------------------
  ------------------
 2109|  1.37k|        return ZSTD_decompressSequencesLong_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 2110|  1.37k|    }
 2111|      0|  return ZSTD_decompressSequencesLong_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 2112|  1.37k|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong_bmi2:
 2052|  1.37k|{
 2053|  1.37k|    return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 2054|  1.37k|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong_body:
 1857|  1.37k|{
 1858|  1.37k|    BYTE* const ostart = (BYTE*)dst;
 1859|  1.37k|    BYTE* const oend = (dctx->litBufferLocation == ZSTD_in_dst) ?
  ------------------
  |  Branch (1859:24): [True: 29, False: 1.34k]
  ------------------
 1860|     29|                        dctx->litBuffer :
 1861|  1.37k|                        (BYTE*)ZSTD_maybeNullPtrAdd(ostart, (ptrdiff_t)maxDstSize);
 1862|  1.37k|    BYTE* op = ostart;
 1863|  1.37k|    const BYTE* litPtr = dctx->litPtr;
 1864|  1.37k|    const BYTE* litBufferEnd = dctx->litBufferEnd;
 1865|  1.37k|    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);
 1866|  1.37k|    const BYTE* const dictStart = (const BYTE*) (dctx->virtualStart);
 1867|  1.37k|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 1868|       |
 1869|       |    /* Regen sequences */
 1870|  1.37k|    if (nbSeq) {
  ------------------
  |  Branch (1870:9): [True: 1.21k, False: 165]
  ------------------
 1871|  1.21k|#define STORED_SEQS 8
 1872|  1.21k|#define STORED_SEQS_MASK (STORED_SEQS-1)
 1873|  1.21k|#define ADVANCED_SEQS STORED_SEQS
 1874|  1.21k|        seq_t sequences[STORED_SEQS];
 1875|  1.21k|        int const seqAdvance = MIN(nbSeq, ADVANCED_SEQS);
  ------------------
  |  |   54|  1.21k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 244, False: 969]
  |  |  ------------------
  ------------------
 1876|  1.21k|        seqState_t seqState;
 1877|  1.21k|        int seqNb;
 1878|  1.21k|        size_t prefetchPos = (size_t)(op-prefixStart); /* track position relative to prefixStart */
 1879|       |
 1880|  1.21k|        dctx->fseEntropy = 1;
 1881|  4.85k|        { int i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  4.85k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1881:28): [True: 3.63k, False: 1.21k]
  ------------------
 1882|  1.21k|        assert(dst != NULL);
  ------------------
  |  |   70|  1.21k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1883|  1.21k|        RETURN_ERROR_IF(
  ------------------
  |  |  114|  1.21k|    do {                                                                       \
  |  |  115|  1.21k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 61, False: 1.15k]
  |  |  ------------------
  |  |  116|     61|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     61|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 61]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     61|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     61|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     61|    do {                                           \
  |  |  |  |   99|     61|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 61]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     61|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 61]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     61|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     61|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 61]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     61|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     61|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 61]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     61|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     61|        }                                                                      \
  |  |  123|  1.21k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.15k]
  |  |  ------------------
  ------------------
 1884|  1.21k|            ERR_isError(BIT_initDStream(&seqState.DStream, seqStart, seqSize)),
 1885|  1.21k|            corruption_detected, "");
 1886|  1.15k|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1887|  1.15k|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1888|  1.15k|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1889|       |
 1890|       |        /* prepare in advance */
 1891|  9.34k|        for (seqNb=0; seqNb<seqAdvance; seqNb++) {
  ------------------
  |  Branch (1891:23): [True: 8.19k, False: 1.15k]
  ------------------
 1892|  8.19k|            seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1);
 1893|  8.19k|            prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1894|  8.19k|            sequences[seqNb] = sequence;
 1895|  8.19k|        }
 1896|       |
 1897|       |        /* decompress without stomping litBuffer */
 1898|  2.23M|        for (; seqNb < nbSeq; seqNb++) {
  ------------------
  |  Branch (1898:16): [True: 2.23M, False: 268]
  ------------------
 1899|  2.23M|            seq_t sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1);
 1900|       |
 1901|  2.23M|            if (dctx->litBufferLocation == ZSTD_split && litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength > dctx->litBufferEnd) {
  ------------------
  |  | 1873|  2.04M|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1871|  2.04M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                          if (dctx->litBufferLocation == ZSTD_split && litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength > dctx->litBufferEnd) {
  ------------------
  |  | 1872|  2.04M|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1871|  2.04M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
  |  Branch (1901:17): [True: 2.04M, False: 187k]
  |  Branch (1901:58): [True: 249, False: 2.04M]
  ------------------
 1902|       |                /* lit buffer is reaching split point, empty out the first buffer and transition to litExtraBuffer */
 1903|    249|                const size_t leftoverLit = (size_t)(dctx->litBufferEnd - litPtr);
 1904|    249|                assert(dctx->litBufferEnd >= litPtr);
  ------------------
  |  |   70|    249|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1905|    249|                if (leftoverLit) {
  ------------------
  |  Branch (1905:21): [True: 243, False: 6]
  ------------------
 1906|    243|                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer");
  ------------------
  |  |  114|    243|    do {                                                                       \
  |  |  115|    243|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 243]
  |  |  ------------------
  |  |  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|    243|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 243]
  |  |  ------------------
  ------------------
 1907|    243|                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);
 1908|    243|                    sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength -= leftoverLit;
  ------------------
  |  | 1873|    243|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1871|    243|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength -= leftoverLit;
  ------------------
  |  | 1872|    243|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1871|    243|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1909|    243|                    op += leftoverLit;
 1910|    243|                }
 1911|    249|                litPtr = dctx->litExtraBuffer;
 1912|    249|                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    249|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    249|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|    498|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 249]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 249, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1913|    249|                dctx->litBufferLocation = ZSTD_not_in_dst;
 1914|    249|                {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1873|    249|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1871|    249|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                              {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1872|    249|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1871|    249|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1915|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1916|       |                    assert(!ZSTD_isError(oneSeqSize));
 1917|       |                    ZSTD_assertValidSequence(dctx, op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], prefixStart, dictStart);
 1918|       |#endif
 1919|    249|                    if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|    249|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1919:25): [True: 63, False: 186]
  ------------------
 1920|       |
 1921|    186|                    prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1922|    186|                    sequences[seqNb & STORED_SEQS_MASK] = sequence;
  ------------------
  |  | 1872|    186|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1871|    186|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1923|    186|                    op += oneSeqSize;
 1924|    186|            }   }
 1925|  2.23M|            else
 1926|  2.23M|            {
 1927|       |                /* lit buffer is either wholly contained in first or second split, or not split at all*/
 1928|  2.23M|                size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ?
  ------------------
  |  Branch (1928:43): [True: 2.04M, False: 187k]
  ------------------
 1929|  2.04M|                    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) :
  ------------------
  |  | 1873|  2.04M|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1871|  2.04M|#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) :
  ------------------
  |  | 1872|  2.04M|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1871|  2.04M|#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) :
  ------------------
  |  |  201|  2.04M|#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) :
  ------------------
  |  | 1873|  2.04M|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1871|  2.04M|#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) :
  ------------------
  |  | 1872|  2.04M|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1871|  2.04M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1930|  2.23M|                    ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1873|   187k|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1871|   187k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1872|   187k|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1871|   187k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1931|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1932|       |                assert(!ZSTD_isError(oneSeqSize));
 1933|       |                ZSTD_assertValidSequence(dctx, op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], prefixStart, dictStart);
 1934|       |#endif
 1935|  2.23M|                if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|  2.23M|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1935:21): [True: 821, False: 2.23M]
  ------------------
 1936|       |
 1937|  2.23M|                prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1938|  2.23M|                sequences[seqNb & STORED_SEQS_MASK] = sequence;
  ------------------
  |  | 1872|  2.23M|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1871|  2.23M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1939|  2.23M|                op += oneSeqSize;
 1940|  2.23M|            }
 1941|  2.23M|        }
 1942|    268|        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, "");
  ------------------
  |  |  114|    268|    do {                                                                       \
  |  |  115|    268|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 37, False: 231]
  |  |  ------------------
  |  |  116|     37|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     37|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 37]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     37|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     37|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     37|    do {                                           \
  |  |  |  |   99|     37|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 37]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     37|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 37]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     37|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     37|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 37]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     37|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     37|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 37]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     37|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     37|        }                                                                      \
  |  |  123|    268|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 231]
  |  |  ------------------
  ------------------
 1943|       |
 1944|       |        /* finish queue */
 1945|    231|        seqNb -= seqAdvance;
 1946|    874|        for ( ; seqNb<nbSeq ; seqNb++) {
  ------------------
  |  Branch (1946:17): [True: 743, False: 131]
  ------------------
 1947|    743|            seq_t *sequence = &(sequences[seqNb&STORED_SEQS_MASK]);
  ------------------
  |  | 1872|    743|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1871|    743|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1948|    743|            if (dctx->litBufferLocation == ZSTD_split && litPtr + sequence->litLength > dctx->litBufferEnd) {
  ------------------
  |  Branch (1948:17): [True: 0, False: 743]
  |  Branch (1948:58): [True: 0, False: 0]
  ------------------
 1949|      0|                const size_t leftoverLit = (size_t)(dctx->litBufferEnd - litPtr);
 1950|      0|                assert(dctx->litBufferEnd >= litPtr);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1951|      0|                if (leftoverLit) {
  ------------------
  |  Branch (1951:21): [True: 0, False: 0]
  ------------------
 1952|      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]
  |  |  ------------------
  ------------------
 1953|      0|                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);
 1954|      0|                    sequence->litLength -= leftoverLit;
 1955|      0|                    op += leftoverLit;
 1956|      0|                }
 1957|      0|                litPtr = dctx->litExtraBuffer;
 1958|      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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1959|      0|                dctx->litBufferLocation = ZSTD_not_in_dst;
 1960|      0|                {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
 1961|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1962|       |                    assert(!ZSTD_isError(oneSeqSize));
 1963|       |                    ZSTD_assertValidSequence(dctx, op, oend, sequences[seqNb&STORED_SEQS_MASK], prefixStart, dictStart);
 1964|       |#endif
 1965|      0|                    if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|      0|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1965:25): [True: 0, False: 0]
  ------------------
 1966|      0|                    op += oneSeqSize;
 1967|      0|                }
 1968|      0|            }
 1969|    743|            else
 1970|    743|            {
 1971|    743|                size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ?
  ------------------
  |  Branch (1971:43): [True: 0, False: 743]
  ------------------
 1972|      0|                    ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence->litLength - WILDCOPY_OVERLENGTH, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  |  201|      0|#define WILDCOPY_OVERLENGTH 32
  ------------------
 1973|    743|                    ZSTD_execSequence(op, oend, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
 1974|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1975|       |                assert(!ZSTD_isError(oneSeqSize));
 1976|       |                ZSTD_assertValidSequence(dctx, op, oend, sequences[seqNb&STORED_SEQS_MASK], prefixStart, dictStart);
 1977|       |#endif
 1978|    743|                if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|    743|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1978:21): [True: 100, False: 643]
  ------------------
 1979|    643|                op += oneSeqSize;
 1980|    643|            }
 1981|    743|        }
 1982|       |
 1983|       |        /* save reps for next block */
 1984|    524|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  |   64|    524|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1984:28): [True: 393, False: 131]
  ------------------
 1985|    131|    }
 1986|       |
 1987|       |    /* last literal segment */
 1988|    296|    if (dctx->litBufferLocation == ZSTD_split) { /* first deplete literal buffer in dst, then copy litExtraBuffer */
  ------------------
  |  Branch (1988:9): [True: 0, False: 296]
  ------------------
 1989|      0|        size_t const lastLLSize = (size_t)(litBufferEnd - litPtr);
 1990|      0|        assert(litBufferEnd >= litPtr);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1991|      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]
  |  |  ------------------
  ------------------
 1992|      0|        if (op != NULL) {
  ------------------
  |  Branch (1992:13): [True: 0, False: 0]
  ------------------
 1993|      0|            ZSTD_memmove(op, litPtr, lastLLSize);
  ------------------
  |  |   45|      0|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1994|      0|            op += lastLLSize;
 1995|      0|        }
 1996|      0|        litPtr = dctx->litExtraBuffer;
 1997|      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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1998|      0|    }
 1999|    296|    {   size_t const lastLLSize = (size_t)(litBufferEnd - litPtr);
 2000|    296|        assert(litBufferEnd >= litPtr);
  ------------------
  |  |   70|    296|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 2001|    296|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, "");
  ------------------
  |  |  114|    296|    do {                                                                       \
  |  |  115|    296|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 11, False: 285]
  |  |  ------------------
  |  |  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|    296|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 285]
  |  |  ------------------
  ------------------
 2002|    285|        if (op != NULL) {
  ------------------
  |  Branch (2002:13): [True: 285, False: 0]
  ------------------
 2003|    285|            ZSTD_memmove(op, litPtr, lastLLSize);
  ------------------
  |  |   45|    285|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 2004|    285|            op += lastLLSize;
 2005|    285|        }
 2006|    285|    }
 2007|       |
 2008|      0|    return (size_t)(op - ostart);
 2009|    296|}
zstd_decompress_block.c:ZSTD_initFseState:
 1231|  15.7k|{
 1232|  15.7k|    const void* ptr = dt;
 1233|  15.7k|    const ZSTD_seqSymbol_header* const DTableH = (const ZSTD_seqSymbol_header*)ptr;
 1234|  15.7k|    DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);
 1235|  15.7k|    DEBUGLOG(6, "ZSTD_initFseState : val=%u using %u bits",
  ------------------
  |  |  104|  15.7k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 15.7k]
  |  |  ------------------
  ------------------
 1236|  15.7k|                (U32)DStatePtr->state, DTableH->tableLog);
 1237|  15.7k|    BIT_reloadDStream(bitD);
 1238|  15.7k|    DStatePtr->table = dt + 1;
 1239|  15.7k|}
zstd_decompress_block.c:ZSTD_decodeSequence:
 1268|  5.26M|{
 1269|  5.26M|    seq_t seq;
 1270|       |#if defined(__aarch64__)
 1271|       |    size_t prevOffset0 = seqState->prevOffset[0];
 1272|       |    size_t prevOffset1 = seqState->prevOffset[1];
 1273|       |    size_t prevOffset2 = seqState->prevOffset[2];
 1274|       |    /*
 1275|       |     * ZSTD_seqSymbol is a 64 bits wide structure.
 1276|       |     * It can be loaded in one operation
 1277|       |     * and its fields extracted by simply shifting or bit-extracting on aarch64.
 1278|       |     * GCC doesn't recognize this and generates more unnecessary ldr/ldrb/ldrh
 1279|       |     * operations that cause performance drop. This can be avoided by using this
 1280|       |     * ZSTD_memcpy hack.
 1281|       |     */
 1282|       |#  if defined(__GNUC__) && !defined(__clang__)
 1283|       |    ZSTD_seqSymbol llDInfoS, mlDInfoS, ofDInfoS;
 1284|       |    ZSTD_seqSymbol* const llDInfo = &llDInfoS;
 1285|       |    ZSTD_seqSymbol* const mlDInfo = &mlDInfoS;
 1286|       |    ZSTD_seqSymbol* const ofDInfo = &ofDInfoS;
 1287|       |    ZSTD_memcpy(llDInfo, seqState->stateLL.table + seqState->stateLL.state, sizeof(ZSTD_seqSymbol));
 1288|       |    ZSTD_memcpy(mlDInfo, seqState->stateML.table + seqState->stateML.state, sizeof(ZSTD_seqSymbol));
 1289|       |    ZSTD_memcpy(ofDInfo, seqState->stateOffb.table + seqState->stateOffb.state, sizeof(ZSTD_seqSymbol));
 1290|       |#  else
 1291|       |    const ZSTD_seqSymbol* const llDInfo = seqState->stateLL.table + seqState->stateLL.state;
 1292|       |    const ZSTD_seqSymbol* const mlDInfo = seqState->stateML.table + seqState->stateML.state;
 1293|       |    const ZSTD_seqSymbol* const ofDInfo = seqState->stateOffb.table + seqState->stateOffb.state;
 1294|       |#  endif
 1295|       |    (void)longOffsets;
 1296|       |    seq.matchLength = mlDInfo->baseValue;
 1297|       |    seq.litLength = llDInfo->baseValue;
 1298|       |    {   U32 const ofBase = ofDInfo->baseValue;
 1299|       |        BYTE const llBits = llDInfo->nbAdditionalBits;
 1300|       |        BYTE const mlBits = mlDInfo->nbAdditionalBits;
 1301|       |        BYTE const ofBits = ofDInfo->nbAdditionalBits;
 1302|       |        BYTE const totalBits = llBits+mlBits+ofBits;
 1303|       |
 1304|       |        U16 const llNext = llDInfo->nextState;
 1305|       |        U16 const mlNext = mlDInfo->nextState;
 1306|       |        U16 const ofNext = ofDInfo->nextState;
 1307|       |        U32 const llnbBits = llDInfo->nbBits;
 1308|       |        U32 const mlnbBits = mlDInfo->nbBits;
 1309|       |        U32 const ofnbBits = ofDInfo->nbBits;
 1310|       |
 1311|       |        assert(llBits <= MaxLLBits);
 1312|       |        assert(mlBits <= MaxMLBits);
 1313|       |        assert(ofBits <= MaxOff);
 1314|       |        /* sequence */
 1315|       |        {   size_t offset;
 1316|       |            if (ofBits > 1) {
 1317|       |                ZSTD_STATIC_ASSERT(ZSTD_lo_isLongOffset == 1);
 1318|       |                ZSTD_STATIC_ASSERT(LONG_OFFSETS_MAX_EXTRA_BITS_32 == 5);
 1319|       |                ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 > LONG_OFFSETS_MAX_EXTRA_BITS_32);
 1320|       |                ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 - LONG_OFFSETS_MAX_EXTRA_BITS_32 >= MaxMLBits);
 1321|       |                offset = ofBase + BIT_readBitsFast(&seqState->DStream, ofBits/*>0*/);   /* <=  (ZSTD_WINDOWLOG_MAX-1) bits */
 1322|       |                prevOffset2 = prevOffset1;
 1323|       |                prevOffset1 = prevOffset0;
 1324|       |                prevOffset0 = offset;
 1325|       |            } else {
 1326|       |                U32 const ll0 = (llDInfo->baseValue == 0);
 1327|       |                if (LIKELY((ofBits == 0))) {
 1328|       |                    if (ll0) {
 1329|       |                        offset = prevOffset1;
 1330|       |                        prevOffset1 = prevOffset0;
 1331|       |                        prevOffset0 = offset;
 1332|       |                    } else {
 1333|       |                        offset = prevOffset0;
 1334|       |                    }
 1335|       |                } else {
 1336|       |                    offset = ofBase + ll0 + BIT_readBitsFast(&seqState->DStream, 1);
 1337|       |                    {   size_t temp = (offset == 1)   ? prevOffset1
 1338|       |                                      : (offset == 3) ? prevOffset0 - 1
 1339|       |                                      : (offset >= 2) ? prevOffset2
 1340|       |                                      : prevOffset0;
 1341|       |                        /* 0 is not valid: input corrupted => force offset to -1 =>
 1342|       |                         * corruption detected at execSequence.
 1343|       |                         */
 1344|       |                        temp -= !temp;
 1345|       |                        prevOffset2 = (offset == 1) ? prevOffset2 : prevOffset1;
 1346|       |                        prevOffset1 = prevOffset0;
 1347|       |                        prevOffset0 = offset = temp;
 1348|       |            }   }   }
 1349|       |            seq.offset = offset;
 1350|       |        }
 1351|       |
 1352|       |        if (mlBits > 0)
 1353|       |            seq.matchLength += BIT_readBitsFast(&seqState->DStream, mlBits/*>0*/);
 1354|       |
 1355|       |        if (UNLIKELY(totalBits >= STREAM_ACCUMULATOR_MIN_64-(LLFSELog+MLFSELog+OffFSELog)))
 1356|       |            BIT_reloadDStream(&seqState->DStream);
 1357|       |
 1358|       |        /* Ensure there are enough bits to read the rest of data in 64-bit mode. */
 1359|       |        ZSTD_STATIC_ASSERT(16+LLFSELog+MLFSELog+OffFSELog < STREAM_ACCUMULATOR_MIN_64);
 1360|       |
 1361|       |        if (llBits > 0)
 1362|       |            seq.litLength += BIT_readBitsFast(&seqState->DStream, llBits/*>0*/);
 1363|       |
 1364|       |        DEBUGLOG(6, "seq: litL=%u, matchL=%u, offset=%u",
 1365|       |                    (U32)seq.litLength, (U32)seq.matchLength, (U32)seq.offset);
 1366|       |
 1367|       |        if (!isLastSeq) {
 1368|       |            /* Don't update FSE state for last sequence. */
 1369|       |            ZSTD_updateFseStateWithDInfo(&seqState->stateLL, &seqState->DStream, llNext, llnbBits);    /* <=  9 bits */
 1370|       |            ZSTD_updateFseStateWithDInfo(&seqState->stateML, &seqState->DStream, mlNext, mlnbBits);    /* <=  9 bits */
 1371|       |            ZSTD_updateFseStateWithDInfo(&seqState->stateOffb, &seqState->DStream, ofNext, ofnbBits);  /* <=  8 bits */
 1372|       |            BIT_reloadDStream(&seqState->DStream);
 1373|       |        }
 1374|       |    }
 1375|       |    seqState->prevOffset[0] = prevOffset0;
 1376|       |    seqState->prevOffset[1] = prevOffset1;
 1377|       |    seqState->prevOffset[2] = prevOffset2;
 1378|       |#else   /* !defined(__aarch64__) */
 1379|  5.26M|    const ZSTD_seqSymbol* const llDInfo = seqState->stateLL.table + seqState->stateLL.state;
 1380|  5.26M|    const ZSTD_seqSymbol* const mlDInfo = seqState->stateML.table + seqState->stateML.state;
 1381|  5.26M|    const ZSTD_seqSymbol* const ofDInfo = seqState->stateOffb.table + seqState->stateOffb.state;
 1382|  5.26M|    seq.matchLength = mlDInfo->baseValue;
 1383|  5.26M|    seq.litLength = llDInfo->baseValue;
 1384|  5.26M|    {   U32 const ofBase = ofDInfo->baseValue;
 1385|  5.26M|        BYTE const llBits = llDInfo->nbAdditionalBits;
 1386|  5.26M|        BYTE const mlBits = mlDInfo->nbAdditionalBits;
 1387|  5.26M|        BYTE const ofBits = ofDInfo->nbAdditionalBits;
 1388|  5.26M|        BYTE const totalBits = llBits+mlBits+ofBits;
 1389|       |
 1390|  5.26M|        assert(llBits <= MaxLLBits);
  ------------------
  |  |   70|  5.26M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1391|  5.26M|        assert(mlBits <= MaxMLBits);
  ------------------
  |  |   70|  5.26M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1392|  5.26M|        assert(ofBits <= MaxOff);
  ------------------
  |  |   70|  5.26M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1393|       |        /* sequence */
 1394|  5.26M|        {   size_t offset;
 1395|  5.26M|            if (ofBits > 1) {
  ------------------
  |  Branch (1395:17): [True: 4.60M, False: 667k]
  ------------------
 1396|  4.60M|                ZSTD_STATIC_ASSERT(ZSTD_lo_isLongOffset == 1);
  ------------------
  |  |   43|  4.60M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  4.60M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1397|  4.60M|                ZSTD_STATIC_ASSERT(LONG_OFFSETS_MAX_EXTRA_BITS_32 == 5);
  ------------------
  |  |   43|  4.60M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  4.60M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1398|  4.60M|                ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 > LONG_OFFSETS_MAX_EXTRA_BITS_32);
  ------------------
  |  |   43|  4.60M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  4.60M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1399|  4.60M|                ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 - LONG_OFFSETS_MAX_EXTRA_BITS_32 >= MaxMLBits);
  ------------------
  |  |   43|  4.60M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  4.60M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1400|  4.60M|                if (MEM_32bits() && longOffsets && (ofBits >= STREAM_ACCUMULATOR_MIN_32)) {
  ------------------
  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  ------------------
  |  Branch (1400:21): [True: 0, False: 4.60M]
  |  Branch (1400:37): [True: 0, False: 0]
  |  Branch (1400:52): [True: 0, False: 0]
  ------------------
 1401|       |                    /* Always read extra bits, this keeps the logic simple,
 1402|       |                     * avoids branches, and avoids accidentally reading 0 bits.
 1403|       |                     */
 1404|      0|                    U32 const extraBits = LONG_OFFSETS_MAX_EXTRA_BITS_32;
  ------------------
  |  | 1254|      0|    (ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32       \
  |  |  ------------------
  |  |  |  | 1363|      0|#define ZSTD_WINDOWLOG_MAX_32    30
  |  |  ------------------
  |  |                   (ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32       \
  |  |  ------------------
  |  |  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  |  |  ------------------
  |  |  |  Branch (1254:6): [True: 0, Folded]
  |  |  ------------------
  |  | 1255|      0|        ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32  \
  |  |  ------------------
  |  |  |  | 1363|      0|#define ZSTD_WINDOWLOG_MAX_32    30
  |  |  ------------------
  |  |                       ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32  \
  |  |  ------------------
  |  |  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  |  |  ------------------
  |  | 1256|      0|        : 0)
  ------------------
 1405|      0|                    offset = ofBase + (BIT_readBitsFast(&seqState->DStream, ofBits - extraBits) << extraBits);
 1406|      0|                    BIT_reloadDStream(&seqState->DStream);
 1407|      0|                    offset += BIT_readBitsFast(&seqState->DStream, extraBits);
 1408|  4.60M|                } else {
 1409|  4.60M|                    offset = ofBase + BIT_readBitsFast(&seqState->DStream, ofBits/*>0*/);   /* <=  (ZSTD_WINDOWLOG_MAX-1) bits */
 1410|  4.60M|                    if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);
  ------------------
  |  Branch (1410:25): [True: 0, False: 4.60M]
  ------------------
 1411|  4.60M|                }
 1412|  4.60M|                seqState->prevOffset[2] = seqState->prevOffset[1];
 1413|  4.60M|                seqState->prevOffset[1] = seqState->prevOffset[0];
 1414|  4.60M|                seqState->prevOffset[0] = offset;
 1415|  4.60M|            } else {
 1416|   667k|                U32 const ll0 = (llDInfo->baseValue == 0);
 1417|   667k|                if (LIKELY((ofBits == 0))) {
  ------------------
  |  |  195|   667k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (195:19): [True: 574k, False: 93.5k]
  |  |  ------------------
  ------------------
 1418|   574k|                    offset = seqState->prevOffset[ll0];
 1419|   574k|                    seqState->prevOffset[1] = seqState->prevOffset[!ll0];
 1420|   574k|                    seqState->prevOffset[0] = offset;
 1421|   574k|                } else {
 1422|  93.5k|                    offset = ofBase + ll0 + BIT_readBitsFast(&seqState->DStream, 1);
 1423|  93.5k|                    {   size_t temp = (offset==3) ? seqState->prevOffset[0] - 1 : seqState->prevOffset[offset];
  ------------------
  |  Branch (1423:39): [True: 16.9k, False: 76.5k]
  ------------------
 1424|  93.5k|                        temp -= !temp; /* 0 is not valid: input corrupted => force offset to -1 => corruption detected at execSequence */
 1425|  93.5k|                        if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1];
  ------------------
  |  Branch (1425:29): [True: 67.6k, False: 25.9k]
  ------------------
 1426|  93.5k|                        seqState->prevOffset[1] = seqState->prevOffset[0];
 1427|  93.5k|                        seqState->prevOffset[0] = offset = temp;
 1428|  93.5k|            }   }   }
 1429|  5.26M|            seq.offset = offset;
 1430|  5.26M|        }
 1431|       |
 1432|  5.26M|        if (mlBits > 0)
  ------------------
  |  Branch (1432:13): [True: 30.5k, False: 5.23M]
  ------------------
 1433|  30.5k|            seq.matchLength += BIT_readBitsFast(&seqState->DStream, mlBits/*>0*/);
 1434|       |
 1435|  5.26M|        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))
  ------------------
  |  | 1254|      0|    (ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32       \
  |  |  ------------------
  |  |  |  | 1363|      0|#define ZSTD_WINDOWLOG_MAX_32    30
  |  |  ------------------
  |  |                   (ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32       \
  |  |  ------------------
  |  |  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  |  |  ------------------
  |  |  |  Branch (1254:6): [True: 0, Folded]
  |  |  ------------------
  |  | 1255|      0|        ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32  \
  |  |  ------------------
  |  |  |  | 1363|      0|#define ZSTD_WINDOWLOG_MAX_32    30
  |  |  ------------------
  |  |                       ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32  \
  |  |  ------------------
  |  |  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  |  |  ------------------
  |  | 1256|      0|        : 0)
  ------------------
  |  Branch (1435:13): [True: 0, False: 5.26M]
  |  Branch (1435:29): [True: 0, False: 0]
  ------------------
 1436|      0|            BIT_reloadDStream(&seqState->DStream);
 1437|  5.26M|        if (MEM_64bits() && UNLIKELY(totalBits >= STREAM_ACCUMULATOR_MIN_64-(LLFSELog+MLFSELog+OffFSELog)))
  ------------------
  |  |  196|  5.26M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (196:21): [True: 867, False: 5.26M]
  |  |  ------------------
  ------------------
  |  Branch (1437:13): [True: 5.26M, False: 0]
  ------------------
 1438|    867|            BIT_reloadDStream(&seqState->DStream);
 1439|       |        /* Ensure there are enough bits to read the rest of data in 64-bit mode. */
 1440|  5.26M|        ZSTD_STATIC_ASSERT(16+LLFSELog+MLFSELog+OffFSELog < STREAM_ACCUMULATOR_MIN_64);
  ------------------
  |  |   43|  5.26M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  5.26M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1441|       |
 1442|  5.26M|        if (llBits > 0)
  ------------------
  |  Branch (1442:13): [True: 62.5k, False: 5.20M]
  ------------------
 1443|  62.5k|            seq.litLength += BIT_readBitsFast(&seqState->DStream, llBits/*>0*/);
 1444|       |
 1445|  5.26M|        if (MEM_32bits())
  ------------------
  |  Branch (1445:13): [True: 0, False: 5.26M]
  ------------------
 1446|      0|            BIT_reloadDStream(&seqState->DStream);
 1447|       |
 1448|  5.26M|        DEBUGLOG(6, "seq: litL=%u, matchL=%u, offset=%u",
  ------------------
  |  |  104|  5.26M|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 5.26M]
  |  |  ------------------
  ------------------
 1449|  5.26M|                    (U32)seq.litLength, (U32)seq.matchLength, (U32)seq.offset);
 1450|       |
 1451|  5.26M|        if (!isLastSeq) {
  ------------------
  |  Branch (1451:13): [True: 5.26M, False: 3.24k]
  ------------------
 1452|       |            /* Don't update FSE state for last sequence. */
 1453|  5.26M|            ZSTD_updateFseStateWithDInfo(&seqState->stateLL, &seqState->DStream,
 1454|  5.26M|                                         llDInfo->nextState, llDInfo->nbBits);    /* <=  9 bits */
 1455|  5.26M|            ZSTD_updateFseStateWithDInfo(&seqState->stateML, &seqState->DStream,
 1456|  5.26M|                                         mlDInfo->nextState, mlDInfo->nbBits);    /* <=  9 bits */
 1457|  5.26M|            if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);    /* <= 18 bits */
  ------------------
  |  Branch (1457:17): [True: 0, False: 5.26M]
  ------------------
 1458|  5.26M|            ZSTD_updateFseStateWithDInfo(&seqState->stateOffb, &seqState->DStream,
 1459|  5.26M|                                         ofDInfo->nextState, ofDInfo->nbBits);    /* <=  8 bits */
 1460|  5.26M|            BIT_reloadDStream(&seqState->DStream);
 1461|  5.26M|        }
 1462|  5.26M|    }
 1463|  5.26M|#endif  /* defined(__aarch64__) */
 1464|       |
 1465|  5.26M|    return seq;
 1466|  5.26M|}
zstd_decompress_block.c:ZSTD_updateFseStateWithDInfo:
 1243|  15.7M|{
 1244|  15.7M|    size_t const lowBits = BIT_readBits(bitD, nbBits);
 1245|  15.7M|    DStatePtr->state = nextState + lowBits;
 1246|  15.7M|}
zstd_decompress_block.c:ZSTD_prefetchMatch:
 1836|  2.24M|{
 1837|  2.24M|    prefetchPos += sequence.litLength;
 1838|  2.24M|    {   const BYTE* const matchBase = (sequence.offset > prefetchPos) ? dictEnd : prefixStart;
  ------------------
  |  Branch (1838:39): [True: 10.8k, False: 2.23M]
  ------------------
 1839|       |        /* note : this operation can overflow when seq.offset is really too large, which can only happen when input is corrupted.
 1840|       |         * No consequence though : memory address is only used for prefetching, not for dereferencing */
 1841|  2.24M|        const BYTE* const match = (const BYTE*)ZSTD_wrappedPtrSub(ZSTD_wrappedPtrAdd(matchBase, (ptrdiff_t)prefetchPos), (ptrdiff_t)sequence.offset);
 1842|  2.24M|        PREFETCH_L1(match); PREFETCH_L1(ZSTD_wrappedPtrAdd(match, CACHELINE_SIZE));   /* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */
  ------------------
  |  |  149|  2.24M|#    define PREFETCH_L1(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */)
  ------------------
                      PREFETCH_L1(match); PREFETCH_L1(ZSTD_wrappedPtrAdd(match, CACHELINE_SIZE));   /* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */
  ------------------
  |  |  149|  2.24M|#    define PREFETCH_L1(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */)
  ------------------
 1843|  2.24M|    }
 1844|  2.24M|    return prefetchPos + sequence.matchLength;
 1845|  2.24M|}
zstd_decompress_block.c:ZSTD_safecopyDstBeforeSrc:
  909|  1.67k|{
  910|  1.67k|    ptrdiff_t const diff = op - ip;
  911|  1.67k|    BYTE* const oend = op + length;
  912|       |
  913|  1.67k|    if (length < 8 || diff > -8) {
  ------------------
  |  Branch (913:9): [True: 980, False: 699]
  |  Branch (913:23): [True: 74, False: 625]
  ------------------
  914|       |        /* Handle short lengths, close overlaps, and dst not before src. */
  915|  76.7k|        while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (915:16): [True: 75.7k, False: 1.05k]
  ------------------
  916|  1.05k|        return;
  917|  1.05k|    }
  918|       |
  919|       |    /* ZSTD_wildcopy() may write up to WILDCOPY_OVERLENGTH-1 bytes past its length.
  920|       |     * Those bytes must not land on source bytes the leftover loop has yet to read,
  921|       |     * so src must be at least WILDCOPY_OVERLENGTH bytes ahead of dst. */
  922|    625|    if (op <= oend - WILDCOPY_OVERLENGTH && diff <= -WILDCOPY_OVERLENGTH) {
  ------------------
  |  |  201|  1.25k|#define WILDCOPY_OVERLENGTH 32
  ------------------
                  if (op <= oend - WILDCOPY_OVERLENGTH && diff <= -WILDCOPY_OVERLENGTH) {
  ------------------
  |  |  201|    486|#define WILDCOPY_OVERLENGTH 32
  ------------------
  |  Branch (922:9): [True: 486, False: 139]
  |  Branch (922:45): [True: 390, False: 96]
  ------------------
  923|    390|        ZSTD_wildcopy(op, ip, (size_t)(oend - WILDCOPY_OVERLENGTH - op), ZSTD_no_overlap);
  ------------------
  |  |  201|    390|#define WILDCOPY_OVERLENGTH 32
  ------------------
  924|    390|        ip += oend - WILDCOPY_OVERLENGTH - op;
  ------------------
  |  |  201|    390|#define WILDCOPY_OVERLENGTH 32
  ------------------
  925|    390|        op += oend - WILDCOPY_OVERLENGTH - op;
  ------------------
  |  |  201|    390|#define WILDCOPY_OVERLENGTH 32
  ------------------
  926|    390|    }
  927|       |
  928|       |    /* Handle the leftovers. */
  929|  78.2k|    while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (929:12): [True: 77.6k, False: 625]
  ------------------
  930|    625|}
zstd_decompress_block.c:ZSTD_execSequence:
 1043|   562k|{
 1044|   562k|    BYTE* const oLitEnd = op + sequence.litLength;
 1045|   562k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 1046|   562k|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 1047|   562k|    BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;   /* risk : address space underflow on oend=NULL */
  ------------------
  |  |  201|   562k|#define WILDCOPY_OVERLENGTH 32
  ------------------
 1048|   562k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 1049|   562k|    const BYTE* match = oLitEnd - sequence.offset;
 1050|       |
 1051|   562k|    assert(op != NULL /* Precondition */);
  ------------------
  |  |   70|   562k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1052|   562k|    assert(oend_w < oend /* No underflow */);
  ------------------
  |  |   70|   562k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1053|       |
 1054|       |#if defined(__aarch64__)
 1055|       |    /* prefetch sequence starting from match that will be used for copy later */
 1056|       |    PREFETCH_L1(match);
 1057|       |#endif
 1058|       |    /* Handle edge cases in a slow path:
 1059|       |     *   - Read beyond end of literals
 1060|       |     *   - Match end is within WILDCOPY_OVERLIMIT of oend
 1061|       |     *   - 32-bit mode and the match length overflows
 1062|       |     */
 1063|   562k|    if (UNLIKELY(
  ------------------
  |  |  196|  2.79M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (196:21): [True: 6.37k, False: 556k]
  |  |  |  Branch (196:40): [True: 456, False: 562k]
  |  |  |  Branch (196:40): [True: 5.91k, False: 556k]
  |  |  |  Branch (196:40): [True: 0, False: 556k]
  |  |  |  Branch (196:40): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1064|   562k|        iLitEnd > litLimit ||
 1065|   562k|        oMatchEnd > oend_w ||
 1066|   562k|        (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH)))
 1067|  6.37k|        return ZSTD_execSequenceEnd(op, oend, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd);
 1068|       |
 1069|       |    /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */
 1070|   556k|    assert(op <= oLitEnd /* No overflow */);
  ------------------
  |  |   70|   556k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1071|   556k|    assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */);
  ------------------
  |  |   70|   556k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1072|   556k|    assert(oMatchEnd <= oend /* No underflow */);
  ------------------
  |  |   70|   556k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1073|   556k|    assert(iLitEnd <= litLimit /* Literal length is in bounds */);
  ------------------
  |  |   70|   556k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1074|   556k|    assert(oLitEnd <= oend_w /* Can wildcopy literals */);
  ------------------
  |  |   70|   556k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1075|   556k|    assert(oMatchEnd <= oend_w /* Can wildcopy matches */);
  ------------------
  |  |   70|   556k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1076|       |
 1077|       |    /* Copy Literals:
 1078|       |     * Split out litLength <= 16 since it is nearly always true. +1.6% on gcc-9.
 1079|       |     * We likely don't need the full 32-byte wildcopy.
 1080|       |     */
 1081|   556k|    assert(WILDCOPY_OVERLENGTH >= 16);
  ------------------
  |  |   70|   556k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1082|   556k|    ZSTD_copy16(op, (*litPtr));
 1083|   556k|    if (UNLIKELY(sequence.litLength > 16)) {
  ------------------
  |  |  196|   556k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (196:21): [True: 12.2k, False: 543k]
  |  |  ------------------
  ------------------
 1084|  12.2k|        ZSTD_wildcopy(op + 16, (*litPtr) + 16, sequence.litLength - 16, ZSTD_no_overlap);
 1085|  12.2k|    }
 1086|   556k|    op = oLitEnd;
 1087|   556k|    *litPtr = iLitEnd;   /* update for next sequence */
 1088|       |
 1089|       |    /* Copy Match */
 1090|   556k|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (1090:9): [True: 3.76k, False: 552k]
  ------------------
 1091|       |        /* offset beyond prefix -> go into extDict */
 1092|  3.76k|        RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected, "");
  ------------------
  |  |  114|  3.76k|    do {                                                                       \
  |  |  115|  3.76k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 503, False: 3.26k]
  |  |  ------------------
  |  |  116|    503|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    503|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 503]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    503|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    503|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    503|    do {                                           \
  |  |  |  |   99|    503|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 503]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    503|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 503]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    503|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    503|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 503]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    503|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    503|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 503]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    503|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    503|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    503|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    503|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    503|        }                                                                      \
  |  |  123|  3.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.26k]
  |  |  ------------------
  ------------------
 1093|  3.26k|        match = dictEnd + (match - prefixStart);
 1094|  3.26k|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (1094:13): [True: 2.94k, False: 316]
  ------------------
 1095|  2.94k|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|  2.94k|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1096|  2.94k|            return sequenceLength;
 1097|  2.94k|        }
 1098|       |        /* span extDict & currentPrefixSegment */
 1099|    316|        {   size_t const length1 = (size_t)(dictEnd - match);
 1100|    316|            ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|    316|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1101|    316|            op = oLitEnd + length1;
 1102|    316|            sequence.matchLength -= length1;
 1103|    316|            match = prefixStart;
 1104|    316|        }
 1105|    316|    }
 1106|       |    /* Match within prefix of 1 or more bytes */
 1107|   552k|    assert(op <= oMatchEnd);
  ------------------
  |  |   70|   552k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1108|   552k|    assert(oMatchEnd <= oend_w);
  ------------------
  |  |   70|   552k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1109|   552k|    assert(match >= prefixStart);
  ------------------
  |  |   70|   552k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1110|   552k|    assert(sequence.matchLength >= 1);
  ------------------
  |  |   70|   552k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1111|       |
 1112|       |    /* Nearly all offsets are >= WILDCOPY_VECLEN bytes, which means we can use wildcopy
 1113|       |     * without overlap checking.
 1114|       |     */
 1115|   552k|    if (LIKELY(sequence.offset >= WILDCOPY_VECLEN)) {
  ------------------
  |  |  195|   552k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (195:19): [True: 366k, False: 185k]
  |  |  ------------------
  ------------------
 1116|       |        /* We bet on a full wildcopy for matches, since we expect matches to be
 1117|       |         * longer than literals (in general). In silesia, ~10% of matches are longer
 1118|       |         * than 16 bytes.
 1119|       |         */
 1120|   366k|        ZSTD_wildcopy(op, match, sequence.matchLength, ZSTD_no_overlap);
 1121|   366k|        return sequenceLength;
 1122|   366k|    }
 1123|   185k|    assert(sequence.offset < WILDCOPY_VECLEN);
  ------------------
  |  |   70|   185k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1124|       |
 1125|       |    /* Copy 8 bytes and spread the offset to be >= 8. */
 1126|   185k|    ZSTD_overlapCopy8(&op, &match, sequence.offset);
 1127|       |
 1128|       |    /* If the match length is > 8 bytes, then continue with the wildcopy. */
 1129|   185k|    if (sequence.matchLength > 8) {
  ------------------
  |  Branch (1129:9): [True: 17.1k, False: 168k]
  ------------------
 1130|  17.1k|        assert(op < oMatchEnd);
  ------------------
  |  |   70|  17.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1131|  17.1k|        ZSTD_wildcopy(op, match, sequence.matchLength - 8, ZSTD_overlap_src_before_dst);
 1132|  17.1k|    }
 1133|   185k|    return sequenceLength;
 1134|   552k|}
zstd_decompress_block.c:ZSTD_execSequenceEnd:
  946|  6.37k|{
  947|  6.37k|    BYTE* const oLitEnd = op + sequence.litLength;
  948|  6.37k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
  949|  6.37k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
  950|  6.37k|    const BYTE* match = oLitEnd - sequence.offset;
  951|  6.37k|    BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  201|  6.37k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  952|       |
  953|       |    /* bounds checks : careful of address space overflow in 32-bit mode */
  954|  6.37k|    RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, "last match must fit within dstBuffer");
  ------------------
  |  |  114|  6.37k|    do {                                                                       \
  |  |  115|  6.37k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1.06k, False: 5.31k]
  |  |  ------------------
  |  |  116|  1.06k|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|  1.06k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|  1.06k|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|  1.06k|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|  1.06k|    do {                                           \
  |  |  |  |   99|  1.06k|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1.06k]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|  1.06k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|  1.06k|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|  1.06k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  1.06k|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|  1.06k|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|  1.06k|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|  1.06k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|  1.06k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|  1.06k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|  1.06k|        }                                                                      \
  |  |  123|  6.37k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.31k]
  |  |  ------------------
  ------------------
  955|  5.31k|    RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, "try to read beyond literal buffer");
  ------------------
  |  |  114|  5.31k|    do {                                                                       \
  |  |  115|  5.31k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 146, False: 5.16k]
  |  |  ------------------
  |  |  116|    146|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    146|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 146]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    146|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    146|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    146|    do {                                           \
  |  |  |  |   99|    146|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 146]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    146|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 146]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    146|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    146|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 146]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    146|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    146|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 146]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    146|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    146|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    146|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    146|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    146|        }                                                                      \
  |  |  123|  5.31k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.16k]
  |  |  ------------------
  ------------------
  956|  5.16k|    assert(op < op + sequenceLength);
  ------------------
  |  |   70|  5.16k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  957|  5.16k|    assert(oLitEnd < op + sequenceLength);
  ------------------
  |  |   70|  5.16k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  958|       |
  959|       |    /* copy literals */
  960|  5.16k|    ZSTD_safecopy(op, oend_w, *litPtr, sequence.litLength, ZSTD_no_overlap);
  961|  5.16k|    op = oLitEnd;
  962|  5.16k|    *litPtr = iLitEnd;
  963|       |
  964|       |    /* copy Match */
  965|  5.16k|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (965:9): [True: 588, False: 4.57k]
  ------------------
  966|       |        /* offset beyond prefix */
  967|    588|        RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, "");
  ------------------
  |  |  114|    588|    do {                                                                       \
  |  |  115|    588|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 178, False: 410]
  |  |  ------------------
  |  |  116|    178|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    178|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 178]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    178|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    178|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    178|    do {                                           \
  |  |  |  |   99|    178|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 178]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    178|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 178]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    178|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    178|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 178]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    178|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    178|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 178]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    178|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    178|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    178|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    178|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    178|        }                                                                      \
  |  |  123|    588|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 410]
  |  |  ------------------
  ------------------
  968|    410|        match = dictEnd - (prefixStart - match);
  969|    410|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (969:13): [True: 299, False: 111]
  ------------------
  970|    299|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|    299|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  971|    299|            return sequenceLength;
  972|    299|        }
  973|       |        /* span extDict & currentPrefixSegment */
  974|    111|        {   size_t const length1 = (size_t)(dictEnd - match);
  975|    111|            ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|    111|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  976|    111|            op = oLitEnd + length1;
  977|    111|            sequence.matchLength -= length1;
  978|    111|            match = prefixStart;
  979|    111|        }
  980|    111|    }
  981|  4.68k|    ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst);
  982|  4.68k|    return sequenceLength;
  983|  5.16k|}
zstd_decompress_block.c:ZSTD_safecopy:
  867|  10.9k|{
  868|  10.9k|    ptrdiff_t const diff = op - ip;
  869|  10.9k|    BYTE* const oend = op + length;
  870|       |
  871|  10.9k|    assert((ovtype == ZSTD_no_overlap && (diff <= -8 || diff >= 8 || op >= oend_w)) ||
  ------------------
  |  |   70|  10.9k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  872|  10.9k|           (ovtype == ZSTD_overlap_src_before_dst && diff >= 0));
  873|       |
  874|  10.9k|    if (length < 8) {
  ------------------
  |  Branch (874:9): [True: 8.95k, False: 1.96k]
  ------------------
  875|       |        /* Handle short lengths. */
  876|  32.0k|        while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (876:16): [True: 23.0k, False: 8.95k]
  ------------------
  877|  8.95k|        return;
  878|  8.95k|    }
  879|  1.96k|    if (ovtype == ZSTD_overlap_src_before_dst) {
  ------------------
  |  Branch (879:9): [True: 663, False: 1.30k]
  ------------------
  880|       |        /* Copy 8 bytes and ensure the offset >= 8 when there can be overlap. */
  881|    663|        assert(length >= 8);
  ------------------
  |  |   70|    663|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  882|    663|        assert(diff > 0);
  ------------------
  |  |   70|    663|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  883|    663|        ZSTD_overlapCopy8(&op, &ip, (size_t)diff);
  884|    663|        length -= 8;
  885|    663|        assert(op - ip >= 8);
  ------------------
  |  |   70|    663|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  886|    663|        assert(op <= oend);
  ------------------
  |  |   70|    663|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  887|    663|    }
  888|       |
  889|  1.96k|    if (oend <= oend_w) {
  ------------------
  |  Branch (889:9): [True: 54, False: 1.91k]
  ------------------
  890|       |        /* No risk of overwrite. */
  891|     54|        ZSTD_wildcopy(op, ip, length, ovtype);
  892|     54|        return;
  893|     54|    }
  894|  1.91k|    if (op <= oend_w) {
  ------------------
  |  Branch (894:9): [True: 351, False: 1.56k]
  ------------------
  895|       |        /* Wildcopy until we get close to the end. */
  896|    351|        assert(oend > oend_w);
  ------------------
  |  |   70|    351|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  897|    351|        ZSTD_wildcopy(op, ip, (size_t)(oend_w - op), ovtype);
  898|    351|        ip += oend_w - op;
  899|    351|        op += oend_w - op;
  900|    351|    }
  901|       |    /* Handle the leftovers. */
  902|  20.7k|    while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (902:12): [True: 18.8k, False: 1.91k]
  ------------------
  903|  1.91k|}
zstd_decompress_block.c:ZSTD_overlapCopy8:
  832|  1.79M|{
  833|  1.79M|    assert(*ip <= *op);
  ------------------
  |  |   70|  1.79M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  834|  1.79M|    if (offset < 8) {
  ------------------
  |  Branch (834:9): [True: 852k, False: 946k]
  ------------------
  835|       |        /* close range match, overlap */
  836|   852k|        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
  837|   852k|        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
  838|   852k|        int const sub2 = dec64table[offset];
  839|   852k|        (*op)[0] = (*ip)[0];
  840|   852k|        (*op)[1] = (*ip)[1];
  841|   852k|        (*op)[2] = (*ip)[2];
  842|   852k|        (*op)[3] = (*ip)[3];
  843|   852k|        *ip += dec32table[offset];
  844|   852k|        ZSTD_copy4(*op+4, *ip);
  845|   852k|        *ip -= sub2;
  846|   946k|    } else {
  847|   946k|        ZSTD_copy8(*op, *ip);
  848|   946k|    }
  849|  1.79M|    *ip += 8;
  850|  1.79M|    *op += 8;
  851|  1.79M|    assert(*op - *ip >= 8);
  ------------------
  |  |   70|  1.79M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  852|  1.79M|}
zstd_decompress_block.c:ZSTD_copy4:
   47|   852k|static void ZSTD_copy4(void* dst, const void* src) { ZSTD_memcpy(dst, src, 4); }
  ------------------
  |  |   44|   852k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
zstd_decompress_block.c:ZSTD_execSequenceSplitLitBuffer:
 1142|  4.69M|{
 1143|  4.69M|    BYTE* const oLitEnd = op + sequence.litLength;
 1144|  4.69M|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 1145|  4.69M|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 1146|  4.69M|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 1147|  4.69M|    const BYTE* match = oLitEnd - sequence.offset;
 1148|       |
 1149|  4.69M|    assert(op != NULL /* Precondition */);
  ------------------
  |  |   70|  4.69M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1150|  4.69M|    assert(oend_w < oend /* No underflow */);
  ------------------
  |  |   70|  4.69M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1151|       |    /* Handle edge cases in a slow path:
 1152|       |     *   - Read beyond end of literals
 1153|       |     *   - Match end is within WILDCOPY_OVERLIMIT of oend
 1154|       |     *   - 32-bit mode and the match length overflows
 1155|       |     */
 1156|  4.69M|    if (UNLIKELY(
  ------------------
  |  |  196|  23.4M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (196:21): [True: 1.23k, False: 4.69M]
  |  |  |  Branch (196:40): [True: 0, False: 4.69M]
  |  |  |  Branch (196:40): [True: 1.23k, False: 4.69M]
  |  |  |  Branch (196:40): [True: 0, False: 4.69M]
  |  |  |  Branch (196:40): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1157|  4.69M|            iLitEnd > litLimit ||
 1158|  4.69M|            oMatchEnd > oend_w ||
 1159|  4.69M|            (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH)))
 1160|  1.23k|        return ZSTD_execSequenceEndSplitLitBuffer(op, oend, oend_w, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd);
 1161|       |
 1162|       |    /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */
 1163|  4.69M|    assert(op <= oLitEnd /* No overflow */);
  ------------------
  |  |   70|  4.69M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1164|  4.69M|    assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */);
  ------------------
  |  |   70|  4.69M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1165|  4.69M|    assert(oMatchEnd <= oend /* No underflow */);
  ------------------
  |  |   70|  4.69M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1166|  4.69M|    assert(iLitEnd <= litLimit /* Literal length is in bounds */);
  ------------------
  |  |   70|  4.69M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1167|  4.69M|    assert(oLitEnd <= oend_w /* Can wildcopy literals */);
  ------------------
  |  |   70|  4.69M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1168|  4.69M|    assert(oMatchEnd <= oend_w /* Can wildcopy matches */);
  ------------------
  |  |   70|  4.69M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1169|       |
 1170|       |    /* Copy Literals:
 1171|       |     * Split out litLength <= 16 since it is nearly always true. +1.6% on gcc-9.
 1172|       |     * We likely don't need the full 32-byte wildcopy.
 1173|       |     */
 1174|  4.69M|    assert(WILDCOPY_OVERLENGTH >= 16);
  ------------------
  |  |   70|  4.69M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1175|  4.69M|    ZSTD_copy16(op, (*litPtr));
 1176|  4.69M|    if (UNLIKELY(sequence.litLength > 16)) {
  ------------------
  |  |  196|  4.69M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (196:21): [True: 43.2k, False: 4.65M]
  |  |  ------------------
  ------------------
 1177|  43.2k|        ZSTD_wildcopy(op+16, (*litPtr)+16, sequence.litLength-16, ZSTD_no_overlap);
 1178|  43.2k|    }
 1179|  4.69M|    op = oLitEnd;
 1180|  4.69M|    *litPtr = iLitEnd;   /* update for next sequence */
 1181|       |
 1182|       |    /* Copy Match */
 1183|  4.69M|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (1183:9): [True: 7.42k, False: 4.69M]
  ------------------
 1184|       |        /* offset beyond prefix -> go into extDict */
 1185|  7.42k|        RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected, "");
  ------------------
  |  |  114|  7.42k|    do {                                                                       \
  |  |  115|  7.42k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 129, False: 7.29k]
  |  |  ------------------
  |  |  116|    129|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    129|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 129]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    129|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    129|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    129|    do {                                           \
  |  |  |  |   99|    129|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 129]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    129|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 129]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    129|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    129|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 129]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    129|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    129|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 129]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    129|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    129|        }                                                                      \
  |  |  123|  7.42k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 7.29k]
  |  |  ------------------
  ------------------
 1186|  7.29k|        match = dictEnd + (match - prefixStart);
 1187|  7.29k|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (1187:13): [True: 7.16k, False: 129]
  ------------------
 1188|  7.16k|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|  7.16k|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1189|  7.16k|            return sequenceLength;
 1190|  7.16k|        }
 1191|       |        /* span extDict & currentPrefixSegment */
 1192|    129|        {   size_t const length1 = (size_t)(dictEnd - match);
 1193|    129|            ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|    129|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1194|    129|            op = oLitEnd + length1;
 1195|    129|            sequence.matchLength -= length1;
 1196|    129|            match = prefixStart;
 1197|    129|    }   }
 1198|       |    /* Match within prefix of 1 or more bytes */
 1199|  4.69M|    assert(op <= oMatchEnd);
  ------------------
  |  |   70|  4.69M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1200|  4.69M|    assert(oMatchEnd <= oend_w);
  ------------------
  |  |   70|  4.69M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1201|  4.69M|    assert(match >= prefixStart);
  ------------------
  |  |   70|  4.69M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1202|  4.69M|    assert(sequence.matchLength >= 1);
  ------------------
  |  |   70|  4.69M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1203|       |
 1204|       |    /* Nearly all offsets are >= WILDCOPY_VECLEN bytes, which means we can use wildcopy
 1205|       |     * without overlap checking.
 1206|       |     */
 1207|  4.69M|    if (LIKELY(sequence.offset >= WILDCOPY_VECLEN)) {
  ------------------
  |  |  195|  4.69M|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (195:19): [True: 3.07M, False: 1.61M]
  |  |  ------------------
  ------------------
 1208|       |        /* We bet on a full wildcopy for matches, since we expect matches to be
 1209|       |         * longer than literals (in general). In silesia, ~10% of matches are longer
 1210|       |         * than 16 bytes.
 1211|       |         */
 1212|  3.07M|        ZSTD_wildcopy(op, match, sequence.matchLength, ZSTD_no_overlap);
 1213|  3.07M|        return sequenceLength;
 1214|  3.07M|    }
 1215|  1.61M|    assert(sequence.offset < WILDCOPY_VECLEN);
  ------------------
  |  |   70|  1.61M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1216|       |
 1217|       |    /* Copy 8 bytes and spread the offset to be >= 8. */
 1218|  1.61M|    ZSTD_overlapCopy8(&op, &match, sequence.offset);
 1219|       |
 1220|       |    /* If the match length is > 8 bytes, then continue with the wildcopy. */
 1221|  1.61M|    if (sequence.matchLength > 8) {
  ------------------
  |  Branch (1221:9): [True: 164k, False: 1.44M]
  ------------------
 1222|   164k|        assert(op < oMatchEnd);
  ------------------
  |  |   70|   164k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1223|   164k|        ZSTD_wildcopy(op, match, sequence.matchLength-8, ZSTD_overlap_src_before_dst);
 1224|   164k|    }
 1225|  1.61M|    return sequenceLength;
 1226|  4.69M|}
zstd_decompress_block.c:ZSTD_execSequenceEndSplitLitBuffer:
  994|  1.23k|{
  995|  1.23k|    BYTE* const oLitEnd = op + sequence.litLength;
  996|  1.23k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
  997|  1.23k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
  998|  1.23k|    const BYTE* match = oLitEnd - sequence.offset;
  999|       |
 1000|       |
 1001|       |    /* bounds checks : careful of address space overflow in 32-bit mode */
 1002|  1.23k|    RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, "last match must fit within dstBuffer");
  ------------------
  |  |  114|  1.23k|    do {                                                                       \
  |  |  115|  1.23k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 20, False: 1.21k]
  |  |  ------------------
  |  |  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|  1.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.21k]
  |  |  ------------------
  ------------------
 1003|  1.21k|    RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, "try to read beyond literal buffer");
  ------------------
  |  |  114|  1.21k|    do {                                                                       \
  |  |  115|  1.21k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 1.21k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  1.21k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.21k]
  |  |  ------------------
  ------------------
 1004|  1.21k|    assert(op < op + sequenceLength);
  ------------------
  |  |   70|  1.21k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1005|  1.21k|    assert(oLitEnd < op + sequenceLength);
  ------------------
  |  |   70|  1.21k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1006|       |
 1007|       |    /* The literals still to be read live in dst at [*litPtr, litLimit).
 1008|       |     * The output of this sequence must not run past the literals it consumes. */
 1009|  1.21k|    RETURN_ERROR_IF(op + sequenceLength > iLitEnd, dstSize_tooSmall, "output should not catch up to and overwrite literal buffer");
  ------------------
  |  |  114|  1.21k|    do {                                                                       \
  |  |  115|  1.21k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 127, False: 1.08k]
  |  |  ------------------
  |  |  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|  1.21k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.08k]
  |  |  ------------------
  ------------------
 1010|       |
 1011|       |    /* copy literals */
 1012|  1.08k|    ZSTD_safecopyDstBeforeSrc(op, *litPtr, sequence.litLength);
 1013|  1.08k|    op = oLitEnd;
 1014|  1.08k|    *litPtr = iLitEnd;
 1015|       |
 1016|       |    /* copy Match */
 1017|  1.08k|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (1017:9): [True: 22, False: 1.06k]
  ------------------
 1018|       |        /* offset beyond prefix */
 1019|     22|        RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, "");
  ------------------
  |  |  114|     22|    do {                                                                       \
  |  |  115|     22|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 20, False: 2]
  |  |  ------------------
  |  |  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|     22|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
 1020|      2|        match = dictEnd - (prefixStart - match);
 1021|      2|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (1021:13): [True: 0, False: 2]
  ------------------
 1022|      0|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|      0|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1023|      0|            return sequenceLength;
 1024|      0|        }
 1025|       |        /* span extDict & currentPrefixSegment */
 1026|      2|        {   size_t const length1 = (size_t)(dictEnd - match);
 1027|      2|            ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|      2|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1028|      2|            op = oLitEnd + length1;
 1029|      2|            sequence.matchLength -= length1;
 1030|      2|            match = prefixStart;
 1031|      2|        }
 1032|      2|    }
 1033|  1.06k|    ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst);
 1034|  1.06k|    return sequenceLength;
 1035|  1.08k|}
zstd_decompress_block.c:ZSTD_decompressSequencesSplitLitBuffer:
 2085|    654|{
 2086|    654|    DEBUGLOG(5, "ZSTD_decompressSequencesSplitLitBuffer");
  ------------------
  |  |  104|    654|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 654]
  |  |  ------------------
  ------------------
 2087|    654|    if (ZSTD_USE_BMI2(ZSTD_DCtx_get_bmi2(dctx))) {
  ------------------
  |  |   36|    654|#  define ZSTD_USE_BMI2(bmi2) (bmi2)
  |  |  ------------------
  |  |  |  Branch (36:31): [True: 654, False: 0]
  |  |  ------------------
  ------------------
 2088|    654|        return ZSTD_decompressSequencesSplitLitBuffer_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 2089|    654|    }
 2090|      0|    return ZSTD_decompressSequencesSplitLitBuffer_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 2091|    654|}
zstd_decompress_block.c:ZSTD_decompressSequencesSplitLitBuffer_bmi2:
 2041|    654|{
 2042|    654|    return ZSTD_decompressSequences_bodySplitLitBuffer(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 2043|    654|}
zstd_decompress_block.c:ZSTD_decompressSequences_bodySplitLitBuffer:
 1527|    654|{
 1528|    654|    BYTE* const ostart = (BYTE*)dst;
 1529|    654|    BYTE* const oend = (BYTE*)ZSTD_maybeNullPtrAdd(ostart, (ptrdiff_t)maxDstSize);
 1530|    654|    BYTE* op = ostart;
 1531|    654|    const BYTE* litPtr = dctx->litPtr;
 1532|    654|    const BYTE* litBufferEnd = dctx->litBufferEnd;
 1533|    654|    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);
 1534|    654|    const BYTE* const vBase = (const BYTE*) (dctx->virtualStart);
 1535|    654|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 1536|    654|    DEBUGLOG(5, "ZSTD_decompressSequences_bodySplitLitBuffer (%i seqs)", nbSeq);
  ------------------
  |  |  104|    654|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 654]
  |  |  ------------------
  ------------------
 1537|       |
 1538|       |    /* Literals are split between internal buffer & output buffer */
 1539|    654|    if (nbSeq) {
  ------------------
  |  Branch (1539:9): [True: 654, False: 0]
  ------------------
 1540|    654|        seqState_t seqState;
 1541|    654|        dctx->fseEntropy = 1;
 1542|  2.61k|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  2.61k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1542:28): [True: 1.96k, False: 654]
  ------------------
 1543|    654|        RETURN_ERROR_IF(
  ------------------
  |  |  114|    654|    do {                                                                       \
  |  |  115|    654|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 48, False: 606]
  |  |  ------------------
  |  |  116|     48|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     48|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 48]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     48|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     48|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     48|    do {                                           \
  |  |  |  |   99|     48|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 48]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     48|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 48]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     48|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     48|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 48]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     48|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     48|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 48]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     48|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     48|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     48|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     48|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     48|        }                                                                      \
  |  |  123|    654|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 606]
  |  |  ------------------
  ------------------
 1544|    654|            ERR_isError(BIT_initDStream(&seqState.DStream, seqStart, seqSize)),
 1545|    654|            corruption_detected, "");
 1546|    606|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1547|    606|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1548|    606|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1549|    606|        assert(dst != NULL);
  ------------------
  |  |   70|    606|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1550|       |
 1551|    606|        ZSTD_STATIC_ASSERT(
  ------------------
  |  |   43|    606|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|    606|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1552|    606|                BIT_DStream_unfinished < BIT_DStream_completed &&
 1553|    606|                BIT_DStream_endOfBuffer < BIT_DStream_completed &&
 1554|    606|                BIT_DStream_completed < BIT_DStream_overflow);
 1555|       |
 1556|       |        /* decompress without overrunning litPtr begins */
 1557|    606|        {   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) */
 1558|       |            /* Align the decompression loop to 32 + 16 bytes.
 1559|       |                *
 1560|       |                * zstd compiled with gcc-9 on an Intel i9-9900k shows 10% decompression
 1561|       |                * speed swings based on the alignment of the decompression loop. This
 1562|       |                * performance swing is caused by parts of the decompression loop falling
 1563|       |                * out of the DSB. The entire decompression loop should fit in the DSB,
 1564|       |                * when it can't we get much worse performance. You can measure if you've
 1565|       |                * hit the good case or the bad case with this perf command for some
 1566|       |                * compressed file test.zst:
 1567|       |                *
 1568|       |                *   perf stat -e cycles -e instructions -e idq.all_dsb_cycles_any_uops \
 1569|       |                *             -e idq.all_mite_cycles_any_uops -- ./zstd -tq test.zst
 1570|       |                *
 1571|       |                * If you see most cycles served out of the MITE you've hit the bad case.
 1572|       |                * If you see most cycles served out of the DSB you've hit the good case.
 1573|       |                * If it is pretty even then you may be in an okay case.
 1574|       |                *
 1575|       |                * This issue has been reproduced on the following CPUs:
 1576|       |                *   - Kabylake: Macbook Pro (15-inch, 2019) 2.4 GHz Intel Core i9
 1577|       |                *               Use Instruments->Counters to get DSB/MITE cycles.
 1578|       |                *               I never got performance swings, but I was able to
 1579|       |                *               go from the good case of mostly DSB to half of the
 1580|       |                *               cycles served from MITE.
 1581|       |                *   - Coffeelake: Intel i9-9900k
 1582|       |                *   - Coffeelake: Intel i7-9700k
 1583|       |                *
 1584|       |                * I haven't been able to reproduce the instability or DSB misses on any
 1585|       |                * of the following CPUS:
 1586|       |                *   - Haswell
 1587|       |                *   - Broadwell: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GH
 1588|       |                *   - Skylake
 1589|       |                *
 1590|       |                * Alignment is done for each of the three major decompression loops:
 1591|       |                *   - ZSTD_decompressSequences_bodySplitLitBuffer - presplit section of the literal buffer
 1592|       |                *   - ZSTD_decompressSequences_bodySplitLitBuffer - postsplit section of the literal buffer
 1593|       |                *   - ZSTD_decompressSequences_body
 1594|       |                * Alignment choices are made to minimize large swings on bad cases and influence on performance
 1595|       |                * from changes external to this code, rather than to overoptimize on the current commit.
 1596|       |                *
 1597|       |                * If you are seeing performance stability this script can help test.
 1598|       |                * It tests on 4 commits in zstd where I saw performance change.
 1599|       |                *
 1600|       |                *   https://gist.github.com/terrelln/9889fc06a423fd5ca6e99351564473f4
 1601|       |                */
 1602|    606|#if defined(__GNUC__) && defined(__x86_64__)
 1603|    606|            __asm__(".p2align 6");
 1604|       |#  if __GNUC__ >= 7
 1605|       |	    /* good for gcc-7, gcc-9, and gcc-11 */
 1606|       |            __asm__("nop");
 1607|       |            __asm__(".p2align 5");
 1608|       |            __asm__("nop");
 1609|       |            __asm__(".p2align 4");
 1610|       |#    if __GNUC__ == 8 || __GNUC__ == 10
 1611|       |	    /* good for gcc-8 and gcc-10 */
 1612|       |            __asm__("nop");
 1613|       |            __asm__(".p2align 3");
 1614|       |#    endif
 1615|       |#  endif
 1616|    606|#endif
 1617|       |
 1618|       |            /* Handle the initial state where litBuffer is currently split between dst and litExtraBuffer */
 1619|  2.65M|            for ( ; nbSeq; nbSeq--) {
  ------------------
  |  Branch (1619:21): [True: 2.65M, False: 3]
  ------------------
 1620|  2.65M|                sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1621|  2.65M|                if (litPtr + sequence.litLength > dctx->litBufferEnd) break;
  ------------------
  |  Branch (1621:21): [True: 400, False: 2.65M]
  ------------------
 1622|  2.65M|                {   size_t const oneSeqSize = ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence.litLength - WILDCOPY_OVERLENGTH, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd);
  ------------------
  |  |  201|  2.65M|#define WILDCOPY_OVERLENGTH 32
  ------------------
 1623|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1624|       |                    assert(!ZSTD_isError(oneSeqSize));
 1625|       |                    ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase);
 1626|       |#endif
 1627|  2.65M|                    if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  196|  2.65M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (196:21): [True: 203, False: 2.65M]
  |  |  ------------------
  ------------------
 1628|    203|                        return oneSeqSize;
 1629|  2.65M|                    DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|  2.65M|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.65M]
  |  |  ------------------
  ------------------
 1630|  2.65M|                    op += oneSeqSize;
 1631|  2.65M|            }   }
 1632|    403|            DEBUGLOG(6, "reached: (litPtr + sequence.litLength > dctx->litBufferEnd)");
  ------------------
  |  |  104|    403|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 403]
  |  |  ------------------
  ------------------
 1633|       |
 1634|       |            /* If there are more sequences, they will need to read literals from litExtraBuffer; copy over the remainder from dst and update litPtr and litEnd */
 1635|    403|            if (nbSeq > 0) {
  ------------------
  |  Branch (1635:17): [True: 400, False: 3]
  ------------------
 1636|    400|                const size_t leftoverLit = (size_t)(dctx->litBufferEnd - litPtr);
 1637|    400|                assert(dctx->litBufferEnd >= litPtr);
  ------------------
  |  |   70|    400|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1638|    400|                DEBUGLOG(6, "There are %i sequences left, and %zu/%zu literals left in buffer", nbSeq, leftoverLit, sequence.litLength);
  ------------------
  |  |  104|    400|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 400]
  |  |  ------------------
  ------------------
 1639|    400|                if (leftoverLit) {
  ------------------
  |  Branch (1639:21): [True: 353, False: 47]
  ------------------
 1640|    353|                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer");
  ------------------
  |  |  114|    353|    do {                                                                       \
  |  |  115|    353|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 353]
  |  |  ------------------
  |  |  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|    353|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 353]
  |  |  ------------------
  ------------------
 1641|    353|                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);
 1642|    353|                    sequence.litLength -= leftoverLit;
 1643|    353|                    op += leftoverLit;
 1644|    353|                }
 1645|    400|                litPtr = dctx->litExtraBuffer;
 1646|    400|                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    400|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    400|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|    800|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 400]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 400, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1647|    400|                dctx->litBufferLocation = ZSTD_not_in_dst;
 1648|    400|                {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd);
 1649|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1650|       |                    assert(!ZSTD_isError(oneSeqSize));
 1651|       |                    ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase);
 1652|       |#endif
 1653|    400|                    if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  196|    400|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (196:21): [True: 67, False: 333]
  |  |  ------------------
  ------------------
 1654|     67|                        return oneSeqSize;
 1655|    333|                    DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|    333|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 333]
  |  |  ------------------
  ------------------
 1656|    333|                    op += oneSeqSize;
 1657|    333|                }
 1658|      0|                nbSeq--;
 1659|    333|            }
 1660|    403|        }
 1661|       |
 1662|    336|        if (nbSeq > 0) {
  ------------------
  |  Branch (1662:13): [True: 332, False: 4]
  ------------------
 1663|       |            /* there is remaining lit from extra buffer */
 1664|       |
 1665|    332|#if defined(__GNUC__) && defined(__x86_64__)
 1666|    332|            __asm__(".p2align 6");
 1667|    332|            __asm__("nop");
 1668|    332|#  if __GNUC__ != 7
 1669|       |            /* worse for gcc-7 better for gcc-8, gcc-9, and gcc-10 and clang */
 1670|    332|            __asm__(".p2align 4");
 1671|    332|            __asm__("nop");
 1672|    332|            __asm__(".p2align 3");
 1673|       |#  elif __GNUC__ >= 11
 1674|       |            __asm__(".p2align 3");
 1675|       |#  else
 1676|       |            __asm__(".p2align 5");
 1677|       |            __asm__("nop");
 1678|       |            __asm__(".p2align 3");
 1679|       |#  endif
 1680|    332|#endif
 1681|       |
 1682|   260k|            for ( ; nbSeq ; nbSeq--) {
  ------------------
  |  Branch (1682:21): [True: 260k, False: 1]
  ------------------
 1683|   260k|                seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1684|   260k|                size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd);
 1685|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1686|       |                assert(!ZSTD_isError(oneSeqSize));
 1687|       |                ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase);
 1688|       |#endif
 1689|   260k|                if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  196|   260k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (196:21): [True: 331, False: 260k]
  |  |  ------------------
  ------------------
 1690|    331|                    return oneSeqSize;
 1691|   260k|                DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|   260k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 260k]
  |  |  ------------------
  ------------------
 1692|   260k|                op += oneSeqSize;
 1693|   260k|            }
 1694|    332|        }
 1695|       |
 1696|       |        /* check if reached exact end */
 1697|      5|        DEBUGLOG(5, "ZSTD_decompressSequences_bodySplitLitBuffer: after decode loop, remaining nbSeq : %i", nbSeq);
  ------------------
  |  |  104|      5|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 5]
  |  |  ------------------
  ------------------
 1698|      5|        RETURN_ERROR_IF(nbSeq, corruption_detected, "");
  ------------------
  |  |  114|      5|    do {                                                                       \
  |  |  115|      5|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 5]
  |  |  ------------------
  |  |  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|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5]
  |  |  ------------------
  ------------------
 1699|      5|        DEBUGLOG(5, "bitStream : start=%p, ptr=%p, bitsConsumed=%u", seqState.DStream.start, seqState.DStream.ptr, seqState.DStream.bitsConsumed);
  ------------------
  |  |  104|      5|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 5]
  |  |  ------------------
  ------------------
 1700|      5|        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, "");
  ------------------
  |  |  114|      5|    do {                                                                       \
  |  |  115|      5|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 5, False: 0]
  |  |  ------------------
  |  |  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|      5|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1701|       |        /* save reps for next block */
 1702|      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 (1702:28): [True: 0, False: 0]
  ------------------
 1703|      0|    }
 1704|       |
 1705|       |    /* last literal segment */
 1706|      0|    if (dctx->litBufferLocation == ZSTD_split) {
  ------------------
  |  Branch (1706:9): [True: 0, False: 0]
  ------------------
 1707|       |        /* split hasn't been reached yet, first get dst then copy litExtraBuffer */
 1708|      0|        size_t const lastLLSize = (size_t)(litBufferEnd - litPtr);
 1709|      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]
  |  |  ------------------
  ------------------
 1710|      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]
  |  |  ------------------
  ------------------
 1711|      0|        if (op != NULL) {
  ------------------
  |  Branch (1711:13): [True: 0, False: 0]
  ------------------
 1712|      0|            ZSTD_memmove(op, litPtr, lastLLSize);
  ------------------
  |  |   45|      0|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1713|      0|            op += lastLLSize;
 1714|      0|        }
 1715|      0|        litPtr = dctx->litExtraBuffer;
 1716|      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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1717|      0|        dctx->litBufferLocation = ZSTD_not_in_dst;
 1718|      0|    }
 1719|       |    /* copy last literals from internal buffer */
 1720|      0|    {   size_t const lastLLSize = (size_t)(litBufferEnd - litPtr);
 1721|      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]
  |  |  ------------------
  ------------------
 1722|      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]
  |  |  ------------------
  ------------------
 1723|      0|        if (op != NULL) {
  ------------------
  |  Branch (1723:13): [True: 0, False: 0]
  ------------------
 1724|      0|            ZSTD_memcpy(op, litPtr, lastLLSize);
  ------------------
  |  |   44|      0|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1725|      0|            op += lastLLSize;
 1726|      0|    }   }
 1727|       |
 1728|      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]
  |  |  ------------------
  ------------------
 1729|      0|    return (size_t)(op - ostart);
 1730|      0|}
zstd_decompress_block.c:ZSTD_decompressSequences:
 2074|  8.76k|{
 2075|  8.76k|    DEBUGLOG(5, "ZSTD_decompressSequences");
  ------------------
  |  |  104|  8.76k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 8.76k]
  |  |  ------------------
  ------------------
 2076|  8.76k|    if (ZSTD_USE_BMI2(ZSTD_DCtx_get_bmi2(dctx))) {
  ------------------
  |  |   36|  8.76k|#  define ZSTD_USE_BMI2(bmi2) (bmi2)
  |  |  ------------------
  |  |  |  Branch (36:31): [True: 8.76k, False: 0]
  |  |  ------------------
  ------------------
 2077|  8.76k|        return ZSTD_decompressSequences_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 2078|  8.76k|    }
 2079|      0|    return ZSTD_decompressSequences_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 2080|  8.76k|}
zstd_decompress_block.c:ZSTD_decompressSequences_bmi2:
 2032|  8.76k|{
 2033|  8.76k|    return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 2034|  8.76k|}
zstd_decompress_block.c:ZSTD_decompressSequences_body:
 1738|  8.76k|{
 1739|  8.76k|    BYTE* const ostart = (BYTE*)dst;
 1740|  8.76k|    BYTE* const oend = (dctx->litBufferLocation == ZSTD_not_in_dst) ?
  ------------------
  |  Branch (1740:24): [True: 5.45k, False: 3.31k]
  ------------------
 1741|  5.45k|                        (BYTE*)ZSTD_maybeNullPtrAdd(ostart, (ptrdiff_t)maxDstSize) :
 1742|  8.76k|                        dctx->litBuffer;
 1743|  8.76k|    BYTE* op = ostart;
 1744|  8.76k|    const BYTE* litPtr = dctx->litPtr;
 1745|  8.76k|    const BYTE* const litEnd = litPtr + dctx->litSize;
 1746|  8.76k|    const BYTE* const prefixStart = (const BYTE*)(dctx->prefixStart);
 1747|  8.76k|    const BYTE* const vBase = (const BYTE*)(dctx->virtualStart);
 1748|  8.76k|    const BYTE* const dictEnd = (const BYTE*)(dctx->dictEnd);
 1749|  8.76k|    DEBUGLOG(5, "ZSTD_decompressSequences_body: nbSeq = %d", nbSeq);
  ------------------
  |  |  104|  8.76k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 8.76k]
  |  |  ------------------
  ------------------
 1750|       |
 1751|       |    /* Regen sequences */
 1752|  8.76k|    if (nbSeq) {
  ------------------
  |  Branch (1752:9): [True: 3.60k, False: 5.16k]
  ------------------
 1753|  3.60k|        seqState_t seqState;
 1754|  3.60k|        dctx->fseEntropy = 1;
 1755|  14.4k|        { U32 i; for (i = 0; i < ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  14.4k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1755:30): [True: 10.8k, False: 3.60k]
  ------------------
 1756|  3.60k|        RETURN_ERROR_IF(
  ------------------
  |  |  114|  3.60k|    do {                                                                       \
  |  |  115|  3.60k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 107, False: 3.50k]
  |  |  ------------------
  |  |  116|    107|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    107|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 107]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    107|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    107|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    107|    do {                                           \
  |  |  |  |   99|    107|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 107]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    107|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 107]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    107|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    107|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 107]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    107|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    107|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 107]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    107|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    107|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    107|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    107|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    107|        }                                                                      \
  |  |  123|  3.60k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.50k]
  |  |  ------------------
  ------------------
 1757|  3.60k|            ERR_isError(BIT_initDStream(&seqState.DStream, seqStart, seqSize)),
 1758|  3.60k|            corruption_detected, "");
 1759|  3.50k|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1760|  3.50k|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1761|  3.50k|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1762|  3.50k|        assert(dst != NULL);
  ------------------
  |  |   70|  3.50k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1763|       |
 1764|  3.50k|#if defined(__GNUC__) && defined(__x86_64__)
 1765|  3.50k|            __asm__(".p2align 6");
 1766|  3.50k|            __asm__("nop");
 1767|       |#  if __GNUC__ >= 7
 1768|       |            __asm__(".p2align 5");
 1769|       |            __asm__("nop");
 1770|       |            __asm__(".p2align 3");
 1771|       |#  else
 1772|  3.50k|            __asm__(".p2align 4");
 1773|  3.50k|            __asm__("nop");
 1774|  3.50k|            __asm__(".p2align 3");
 1775|  3.50k|#  endif
 1776|  3.50k|#endif
 1777|       |
 1778|   115k|        for ( ; nbSeq ; nbSeq--) {
  ------------------
  |  Branch (1778:17): [True: 112k, False: 2.90k]
  ------------------
 1779|   112k|            seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1780|   112k|            size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litEnd, prefixStart, vBase, dictEnd);
 1781|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1782|       |            assert(!ZSTD_isError(oneSeqSize));
 1783|       |            ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase);
 1784|       |#endif
 1785|   112k|            if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  196|   112k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (196:21): [True: 599, False: 112k]
  |  |  ------------------
  ------------------
 1786|    599|                return oneSeqSize;
 1787|   112k|            DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|   112k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 112k]
  |  |  ------------------
  ------------------
 1788|   112k|            op += oneSeqSize;
 1789|   112k|        }
 1790|       |
 1791|       |        /* check if reached exact end */
 1792|  2.90k|        assert(nbSeq == 0);
  ------------------
  |  |   70|  2.90k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1793|  2.90k|        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, "");
  ------------------
  |  |  114|  2.90k|    do {                                                                       \
  |  |  115|  2.90k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 26, False: 2.87k]
  |  |  ------------------
  |  |  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|  2.90k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.87k]
  |  |  ------------------
  ------------------
 1794|       |        /* save reps for next block */
 1795|  11.5k|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  |   64|  11.5k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1795:28): [True: 8.62k, False: 2.87k]
  ------------------
 1796|  2.87k|    }
 1797|       |
 1798|       |    /* last literal segment */
 1799|  8.03k|    {   size_t const lastLLSize = (size_t)(litEnd - litPtr);
 1800|  8.03k|        DEBUGLOG(6, "copy last literals : %u", (U32)lastLLSize);
  ------------------
  |  |  104|  8.03k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 8.03k]
  |  |  ------------------
  ------------------
 1801|  8.03k|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, "");
  ------------------
  |  |  114|  8.03k|    do {                                                                       \
  |  |  115|  8.03k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 35, False: 8.00k]
  |  |  ------------------
  |  |  116|     35|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     35|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     35|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     35|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     35|    do {                                           \
  |  |  |  |   99|     35|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 35]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     35|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     35|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     35|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     35|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     35|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     35|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     35|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     35|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     35|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     35|        }                                                                      \
  |  |  123|  8.03k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 8.00k]
  |  |  ------------------
  ------------------
 1802|  8.00k|        if (op != NULL) {
  ------------------
  |  Branch (1802:13): [True: 8.00k, False: 0]
  ------------------
 1803|  8.00k|            ZSTD_memcpy(op, litPtr, lastLLSize);
  ------------------
  |  |   44|  8.00k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1804|  8.00k|            op += lastLLSize;
 1805|  8.00k|    }   }
 1806|       |
 1807|  8.00k|    DEBUGLOG(6, "decoded block of size %u bytes", (U32)(op - ostart));
  ------------------
  |  |  104|  8.00k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 8.00k]
  |  |  ------------------
  ------------------
 1808|  8.00k|    return (size_t)(op - ostart);
 1809|  8.03k|}

zstd_decompress_block.c:ZSTD_DCtx_get_bmi2:
  228|  34.8k|MEM_STATIC int ZSTD_DCtx_get_bmi2(const struct ZSTD_DCtx_s *dctx) {
  229|  34.8k|#if DYNAMIC_BMI2
  230|  34.8k|    return dctx->bmi2;
  231|       |#else
  232|       |    (void)dctx;
  233|       |    return 0;
  234|       |#endif
  235|  34.8k|}

bshuf_trans_byte_bitrow_AVX:
  131|    487|                                    const size_t elem_size) {
  132|       |
  133|    487|  size_t hh, ii, jj, kk, mm;
  134|    487|  const char* in_b = (const char*) in;
  135|    487|  char* out_b = (char*) out;
  136|       |
  137|    487|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|    487|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 487]
  |  |  ------------------
  ------------------
  138|       |
  139|    487|  size_t nrows = 8 * elem_size;
  140|    487|  size_t nbyte_row = size / 8;
  141|       |
  142|    487|  if (elem_size % 4) return bshuf_trans_byte_bitrow_SSE(in, out, size,
  ------------------
  |  Branch (142:7): [True: 340, False: 147]
  ------------------
  143|    340|                                                        elem_size);
  144|       |
  145|    147|  __m256i ymm_0[8];
  146|    147|  __m256i ymm_1[8];
  147|    147|  __m256i ymm_storeage[8][4];
  148|       |
  149|    327|  for (jj = 0; jj + 31 < nbyte_row; jj += 32) {
  ------------------
  |  Branch (149:16): [True: 180, False: 147]
  ------------------
  150|  1.54k|    for (ii = 0; ii + 3 < elem_size; ii += 4) {
  ------------------
  |  Branch (150:18): [True: 1.36k, False: 180]
  ------------------
  151|  6.83k|      for (hh = 0; hh < 4; hh ++) {
  ------------------
  |  Branch (151:20): [True: 5.46k, False: 1.36k]
  ------------------
  152|       |
  153|  49.1k|        for (kk = 0; kk < 8; kk ++){
  ------------------
  |  Branch (153:22): [True: 43.7k, False: 5.46k]
  ------------------
  154|  43.7k|          ymm_0[kk] = _mm256_loadu_si256((__m256i *) &in_b[
  155|  43.7k|              (ii * 8 + hh * 8 + kk) * nbyte_row + jj]);
  156|  43.7k|        }
  157|       |
  158|  27.3k|        for (kk = 0; kk < 4; kk ++){
  ------------------
  |  Branch (158:22): [True: 21.8k, False: 5.46k]
  ------------------
  159|  21.8k|          ymm_1[kk] = _mm256_unpacklo_epi8(ymm_0[kk * 2],
  160|  21.8k|                                           ymm_0[kk * 2 + 1]);
  161|  21.8k|          ymm_1[kk + 4] = _mm256_unpackhi_epi8(ymm_0[kk * 2],
  162|  21.8k|                                               ymm_0[kk * 2 + 1]);
  163|  21.8k|        }
  164|       |
  165|  16.3k|        for (kk = 0; kk < 2; kk ++){
  ------------------
  |  Branch (165:22): [True: 10.9k, False: 5.46k]
  ------------------
  166|  32.7k|          for (mm = 0; mm < 2; mm ++){
  ------------------
  |  Branch (166:24): [True: 21.8k, False: 10.9k]
  ------------------
  167|  21.8k|            ymm_0[kk * 4 + mm] = _mm256_unpacklo_epi16(
  168|  21.8k|                ymm_1[kk * 4 + mm * 2],
  169|  21.8k|                ymm_1[kk * 4 + mm * 2 + 1]);
  170|  21.8k|            ymm_0[kk * 4 + mm + 2] = _mm256_unpackhi_epi16(
  171|  21.8k|                ymm_1[kk * 4 + mm * 2],
  172|  21.8k|                ymm_1[kk * 4 + mm * 2 + 1]);
  173|  21.8k|          }
  174|  10.9k|        }
  175|       |
  176|  27.3k|        for (kk = 0; kk < 4; kk ++){
  ------------------
  |  Branch (176:22): [True: 21.8k, False: 5.46k]
  ------------------
  177|  21.8k|          ymm_1[kk * 2] = _mm256_unpacklo_epi32(ymm_0[kk * 2],
  178|  21.8k|                                                ymm_0[kk * 2 + 1]);
  179|  21.8k|          ymm_1[kk * 2 + 1] = _mm256_unpackhi_epi32(ymm_0[kk * 2],
  180|  21.8k|                                                    ymm_0[kk * 2 + 1]);
  181|  21.8k|        }
  182|       |
  183|  49.1k|        for (kk = 0; kk < 8; kk ++){
  ------------------
  |  Branch (183:22): [True: 43.7k, False: 5.46k]
  ------------------
  184|  43.7k|          ymm_storeage[kk][hh] = ymm_1[kk];
  185|  43.7k|        }
  186|  5.46k|      }
  187|       |
  188|  12.2k|      for (mm = 0; mm < 8; mm ++) {
  ------------------
  |  Branch (188:20): [True: 10.9k, False: 1.36k]
  ------------------
  189|       |
  190|  54.6k|        for (kk = 0; kk < 4; kk ++){
  ------------------
  |  Branch (190:22): [True: 43.7k, False: 10.9k]
  ------------------
  191|  43.7k|          ymm_0[kk] = ymm_storeage[mm][kk];
  192|  43.7k|        }
  193|       |
  194|  10.9k|        ymm_1[0] = _mm256_unpacklo_epi64(ymm_0[0], ymm_0[1]);
  195|  10.9k|        ymm_1[1] = _mm256_unpacklo_epi64(ymm_0[2], ymm_0[3]);
  196|  10.9k|        ymm_1[2] = _mm256_unpackhi_epi64(ymm_0[0], ymm_0[1]);
  197|  10.9k|        ymm_1[3] = _mm256_unpackhi_epi64(ymm_0[2], ymm_0[3]);
  198|       |
  199|  10.9k|        ymm_0[0] = _mm256_permute2x128_si256(ymm_1[0], ymm_1[1], 32);
  200|  10.9k|        ymm_0[1] = _mm256_permute2x128_si256(ymm_1[2], ymm_1[3], 32);
  201|  10.9k|        ymm_0[2] = _mm256_permute2x128_si256(ymm_1[0], ymm_1[1], 49);
  202|  10.9k|        ymm_0[3] = _mm256_permute2x128_si256(ymm_1[2], ymm_1[3], 49);
  203|       |
  204|  10.9k|        _mm256_storeu_si256((__m256i *) &out_b[
  205|  10.9k|            (jj + mm * 2 + 0 * 16) * nrows + ii * 8], ymm_0[0]);
  206|  10.9k|        _mm256_storeu_si256((__m256i *) &out_b[
  207|  10.9k|            (jj + mm * 2 + 0 * 16 + 1) * nrows + ii * 8], ymm_0[1]);
  208|  10.9k|        _mm256_storeu_si256((__m256i *) &out_b[
  209|  10.9k|            (jj + mm * 2 + 1 * 16) * nrows + ii * 8], ymm_0[2]);
  210|  10.9k|        _mm256_storeu_si256((__m256i *) &out_b[
  211|  10.9k|            (jj + mm * 2 + 1 * 16 + 1) * nrows + ii * 8], ymm_0[3]);
  212|  10.9k|      }
  213|  1.36k|    }
  214|    180|  }
  215|  33.6k|  for (ii = 0; ii < nrows; ii ++ ) {
  ------------------
  |  Branch (215:16): [True: 33.5k, False: 147]
  ------------------
  216|   169k|    for (jj = nbyte_row - nbyte_row % 32; jj < nbyte_row; jj ++) {
  ------------------
  |  Branch (216:43): [True: 136k, False: 33.5k]
  ------------------
  217|   136k|      out_b[jj * nrows + ii] = in_b[ii * nbyte_row + jj];
  218|   136k|    }
  219|  33.5k|  }
  220|    147|  return size * elem_size;
  221|    487|}
bshuf_shuffle_bit_eightelem_AVX:
  242|    487|                                        const size_t elem_size) {
  243|       |
  244|    487|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|    487|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 487]
  |  |  ------------------
  ------------------
  245|       |
  246|       |  // With a bit of care, this could be written such that such that it is
  247|       |  // in_buf = out_buf safe.
  248|    487|  const char* in_b = (const char*) in;
  249|    487|  char* out_b = (char*) out;
  250|       |
  251|    487|  size_t ii, jj, kk;
  252|    487|  size_t nbyte = elem_size * size;
  253|       |
  254|    487|  __m256i ymm;
  255|    487|  int32_t bt;
  256|       |
  257|    487|  if (elem_size <= 2) {
  ------------------
  |  Branch (257:7): [True: 0, False: 487]
  ------------------
  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|    487|  } else if (elem_size % 4) {
  ------------------
  |  Branch (275:14): [True: 340, False: 147]
  ------------------
  276|    340|    return bshuf_shuffle_bit_eightelem_SSE(in, out, size, elem_size);
  277|    340|  } else {
  278|  1.19k|    for (jj = 0; jj + 31 < 8 * elem_size; jj += 32) {
  ------------------
  |  Branch (278:18): [True: 1.04k, False: 147]
  ------------------
  279|  49.0k|      for (ii = 0; ii + 8 * elem_size - 1 < nbyte;
  ------------------
  |  Branch (279:20): [True: 47.9k, False: 1.04k]
  ------------------
  280|  47.9k|           ii += 8 * elem_size) {
  281|  47.9k|        ymm = _mm256_loadu_si256((__m256i *) &in_b[ii + jj]);
  282|   431k|        for (kk = 0; kk < 8; kk++) {
  ------------------
  |  Branch (282:22): [True: 383k, False: 47.9k]
  ------------------
  283|   383k|          bt = _mm256_movemask_epi8(ymm);
  284|   383k|          ymm = _mm256_slli_epi16(ymm, 1);
  285|   383k|          size_t ind = (ii + jj / 8 + (7 - kk) * elem_size);
  286|   383k|          * (int32_t *) &out_b[ind] = bt;
  287|   383k|        }
  288|  47.9k|      }
  289|  1.04k|    }
  290|    147|  }
  291|    147|  return size * elem_size;
  292|    487|}
bshuf_untrans_bit_elem_AVX:
  297|  2.07k|                                   const size_t elem_size, void* tmp_buf) {
  298|       |
  299|  2.07k|  int64_t count;
  300|       |
  301|  2.07k|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|  2.07k|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 2.07k]
  |  |  ------------------
  ------------------
  302|       |
  303|  2.07k|  if (elem_size == 1) return bshuf_untrans_bit_byte_SSE(in, out, size);
  ------------------
  |  Branch (303:7): [True: 722, False: 1.35k]
  ------------------
  304|  1.35k|  if ((elem_size == 2 || elem_size == 4 || elem_size == 8 || elem_size == 16)
  ------------------
  |  Branch (304:8): [True: 442, False: 915]
  |  Branch (304:26): [True: 150, False: 765]
  |  Branch (304:44): [True: 181, False: 584]
  |  Branch (304:62): [True: 97, False: 487]
  ------------------
  305|    870|      && size <= INT32_MAX / elem_size) {
  ------------------
  |  Branch (305:10): [True: 870, False: 0]
  ------------------
  306|  5.35k|    for (size_t j = 0; j < elem_size; ++j) {
  ------------------
  |  Branch (306:24): [True: 4.48k, False: 870]
  ------------------
  307|  4.48k|      bshuf_untrans_bit_byte_SSE((const uint8_t*)in + j * size, (uint8_t*)tmp_buf + j * size, size);
  308|  4.48k|    }
  309|    870|    unshuffle_avx2((int32_t)elem_size, (int32_t)(size * elem_size), tmp_buf, out);
  310|    870|    return size * elem_size;
  311|    870|  }
  312|    487|  count = bshuf_trans_byte_bitrow_AVX(in, tmp_buf, size, elem_size);
  313|    487|  CHECK_ERR(count);
  ------------------
  |  |   40|    487|        do {                              \
  |  |   41|    487|          if ((count) < 0)                \
  |  |  ------------------
  |  |  |  Branch (41:15): [True: 0, False: 487]
  |  |  ------------------
  |  |   42|    487|            return count;                 \
  |  |   43|    487|         } while (0)
  |  |  ------------------
  |  |  |  Branch (43:19): [Folded, False: 487]
  |  |  ------------------
  ------------------
  314|    487|  count =  bshuf_shuffle_bit_eightelem_AVX(tmp_buf, out, size, elem_size);
  315|       |
  316|    487|  return count;
  317|    487|}

bshuf_shuffle_bit_eightelem_scal:
  194|    193|        const size_t size, const size_t elem_size) {
  195|       |
  196|    193|  const char *in_b;
  197|    193|  char *out_b;
  198|    193|  uint64_t x, t;
  199|    193|  size_t ii, jj, kk;
  200|    193|  size_t nbyte, out_index;
  201|       |
  202|    193|  uint64_t e=1;
  203|    193|  const int little_endian = *(uint8_t *) &e == 1;
  204|    193|  const size_t elem_skip = little_endian ? elem_size : -elem_size;
  ------------------
  |  Branch (204:28): [True: 193, False: 0]
  ------------------
  205|    193|  const uint64_t elem_offset = little_endian ? 0 : 7 * elem_size;
  ------------------
  |  Branch (205:32): [True: 193, False: 0]
  ------------------
  206|       |
  207|    193|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|    193|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 193]
  |  |  ------------------
  ------------------
  208|       |
  209|    193|  in_b = (const char*) in;
  210|    193|  out_b = (char*) out;
  211|       |
  212|    193|  nbyte = elem_size * size;
  213|       |
  214|  3.89k|  for (jj = 0; jj < 8 * elem_size; jj += 8) {
  ------------------
  |  Branch (214:16): [True: 3.69k, False: 193]
  ------------------
  215|   789k|    for (ii = 0; ii + 8 * elem_size - 1 < nbyte; ii += 8 * elem_size) {
  ------------------
  |  Branch (215:18): [True: 786k, False: 3.69k]
  ------------------
  216|   786k|      x = *((uint64_t*) &in_b[ii + jj]);
  217|   786k|      if (little_endian) {
  ------------------
  |  Branch (217:11): [True: 786k, False: 0]
  ------------------
  218|   786k|        TRANS_BIT_8X8(x, t);
  ------------------
  |  |   54|   786k|#define TRANS_BIT_8X8(x, t) {                                               \
  |  |   55|   786k|        t = (x ^ (x >> 7)) & 0x00AA00AA00AA00AALL;                          \
  |  |   56|   786k|        x = x ^ t ^ (t << 7);                                               \
  |  |   57|   786k|        t = (x ^ (x >> 14)) & 0x0000CCCC0000CCCCLL;                         \
  |  |   58|   786k|        x = x ^ t ^ (t << 14);                                              \
  |  |   59|   786k|        t = (x ^ (x >> 28)) & 0x00000000F0F0F0F0LL;                         \
  |  |   60|   786k|        x = x ^ t ^ (t << 28);                                              \
  |  |   61|   786k|    }
  ------------------
  219|   786k|      } 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|  7.07M|      for (kk = 0; kk < 8; kk++) {
  ------------------
  |  Branch (222:20): [True: 6.28M, False: 786k]
  ------------------
  223|  6.28M|        out_index = ii + jj / 8 + elem_offset + kk * elem_skip;
  224|  6.28M|        *((uint8_t*) &out_b[out_index]) = x;
  225|  6.28M|        x = x >> 8;
  226|  6.28M|      }
  227|   786k|    }
  228|  3.69k|  }
  229|    193|  return size * elem_size;
  230|    193|}

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

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

blosc2.c:is_little_endian:
   42|   248k|static bool is_little_endian(void) {
   43|   248k|  static const int i = 1;
   44|   248k|  char* p = (char*)&i;
   45|       |
   46|   248k|  if (p[0] == 1) {
  ------------------
  |  Branch (46:7): [True: 248k, False: 0]
  ------------------
   47|   248k|    return true;
   48|   248k|  }
   49|      0|  else {
   50|       |    return false;
   51|      0|  }
   52|   248k|}
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|  52.1k|static inline int32_t sw32_(const void* pa) {
  217|  52.1k|  int32_t idest;
  218|       |
  219|  52.1k|  bool little_endian = is_little_endian();
  220|  52.1k|  if (little_endian) {
  ------------------
  |  Branch (220:7): [True: 52.1k, False: 0]
  ------------------
  221|  52.1k|    memcpy(&idest, pa, sizeof(idest));
  222|  52.1k|  }
  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|  52.1k|  return idest;
  238|  52.1k|}

do_nothing:
  815|   305k|int do_nothing(const blosc2_context* context, int i, char cmode) {
  816|   305k|  uint8_t filter = context->filters[i];
  817|   305k|  if (filter == BLOSC_SHUFFLE) {
  ------------------
  |  Branch (817:7): [True: 62.3k, False: 243k]
  ------------------
  818|       |    // Shuffling single bytes is the identity, so skip it instead of copying the block
  819|  62.3k|    return shuffle_size(context, i) == 1;
  820|  62.3k|  }
  821|   243k|  if (cmode == 'c') {
  ------------------
  |  Branch (821:7): [True: 0, False: 243k]
  ------------------
  822|      0|    return (filter == BLOSC_NOFILTER);
  823|   243k|  } else {
  824|       |    // TRUNC_PREC do not have to be applied during decompression
  825|   243k|    return ((filter == BLOSC_NOFILTER) || (filter == BLOSC_TRUNC_PREC));
  ------------------
  |  Branch (825:13): [True: 122k, False: 121k]
  |  Branch (825:43): [True: 16.3k, False: 104k]
  ------------------
  826|   243k|  }
  827|   243k|}
next_filter:
  830|  50.2k|int next_filter(const blosc2_context* context, int current_filter, char cmode) {
  831|  97.8k|  for (int i = current_filter - 1; i >= 0; i--) {
  ------------------
  |  Branch (831:36): [True: 97.8k, False: 0]
  ------------------
  832|  97.8k|    if (!do_nothing(context, i, cmode)) {
  ------------------
  |  Branch (832:9): [True: 50.2k, False: 47.5k]
  ------------------
  833|  50.2k|      return context->filters[i];
  834|  50.2k|    }
  835|  97.8k|  }
  836|      0|  return BLOSC_NOFILTER;
  837|  50.2k|}
last_filter:
  840|  23.5k|int last_filter(const blosc2_context* context, char cmode) {
  841|  23.5k|  int last_index = -1;
  842|   164k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (842:40): [True: 141k, False: 23.5k]
  ------------------
  843|   141k|    if (!do_nothing(context, i, cmode))  {
  ------------------
  |  Branch (843:9): [True: 64.2k, False: 77.1k]
  ------------------
  844|  64.2k|      last_index = i;
  845|  64.2k|    }
  846|   141k|  }
  847|  23.5k|  return last_index;
  848|  23.5k|}
read_chunk_header:
  927|   196k|{
  928|   196k|  memset(header, 0, sizeof(blosc_header));
  929|       |
  930|   196k|  if (srcsize < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (930:7): [True: 0, False: 196k]
  ------------------
  931|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  932|      0|    return BLOSC2_ERROR_READ_BUFFER;
  933|      0|  }
  934|       |
  935|   196k|  memcpy(header, src, BLOSC_MIN_HEADER_LENGTH);
  936|       |
  937|   196k|  bool little_endian = is_little_endian();
  938|       |
  939|   196k|  if (!little_endian) {
  ------------------
  |  Branch (939:7): [True: 0, False: 196k]
  ------------------
  940|      0|    header->nbytes = bswap32_(header->nbytes);
  941|      0|    header->blocksize = bswap32_(header->blocksize);
  942|      0|    header->cbytes = bswap32_(header->cbytes);
  943|      0|  }
  944|       |
  945|   196k|  if (header->cbytes < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (945:7): [True: 36, False: 196k]
  ------------------
  946|     36|    BLOSC_TRACE_ERROR("`cbytes` is too small to read min header.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  947|     36|    return BLOSC2_ERROR_INVALID_HEADER;
  948|     36|  }
  949|   196k|  if (header->blocksize <= 0) {
  ------------------
  |  Branch (949:7): [True: 34, False: 196k]
  ------------------
  950|     34|    BLOSC_TRACE_ERROR("`blocksize` is zero");
  ------------------
  |  |   93|     34|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     34|    do {                                            \
  |  |  |  |   98|     34|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     34|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 34, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     34|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  951|     34|    return BLOSC2_ERROR_INVALID_HEADER;
  952|     34|  }
  953|   196k|  if (header->blocksize > BLOSC2_MAXBLOCKSIZE) {
  ------------------
  |  Branch (953:7): [True: 7, False: 196k]
  ------------------
  954|      7|    BLOSC_TRACE_ERROR("`blocksize` greater than maximum allowed");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  955|      7|    return BLOSC2_ERROR_INVALID_HEADER;
  956|      7|  }
  957|   196k|  if (header->typesize == 0) {
  ------------------
  |  Branch (957:7): [True: 7, False: 196k]
  ------------------
  958|      7|    BLOSC_TRACE_ERROR("`typesize` is zero.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  959|      7|    return BLOSC2_ERROR_INVALID_HEADER;
  960|      7|  }
  961|       |
  962|       |  /* Read extended header if it is wanted */
  963|   196k|  if ((extended_header) && (header->flags & BLOSC_DOSHUFFLE) && (header->flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (963:7): [True: 12.5k, False: 184k]
  |  Branch (963:28): [True: 8.95k, False: 3.62k]
  |  Branch (963:65): [True: 7.03k, False: 1.92k]
  ------------------
  964|  7.03k|    if (header->cbytes < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (964:9): [True: 23, False: 7.01k]
  ------------------
  965|     23|      BLOSC_TRACE_ERROR("`cbytes` is too small to read extended header.");
  ------------------
  |  |   93|     23|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     23|    do {                                            \
  |  |  |  |   98|     23|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     23|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 23, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     23|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  966|     23|      return BLOSC2_ERROR_INVALID_HEADER;
  967|     23|    }
  968|  7.01k|    if (srcsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (968:9): [True: 0, False: 7.01k]
  ------------------
  969|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  970|      0|      return BLOSC2_ERROR_READ_BUFFER;
  971|      0|    }
  972|       |
  973|  7.01k|    memcpy((uint8_t *)header + BLOSC_MIN_HEADER_LENGTH, src + BLOSC_MIN_HEADER_LENGTH,
  974|  7.01k|      BLOSC_EXTENDED_HEADER_LENGTH - BLOSC_MIN_HEADER_LENGTH);
  975|       |
  976|  7.01k|    if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) && (header->blosc2_flags != 0)) {
  ------------------
  |  Branch (976:9): [True: 394, False: 6.61k]
  |  Branch (976:55): [True: 233, False: 161]
  ------------------
  977|    233|      int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  978|    233|      if (special_type != 0) {
  ------------------
  |  Branch (978:11): [True: 6, False: 227]
  ------------------
  979|      6|        BLOSC_TRACE_ERROR("VL-block chunks cannot use special chunk encodings.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  980|      6|        return BLOSC2_ERROR_INVALID_HEADER;
  981|      6|      }
  982|    233|    }
  983|       |
  984|  7.00k|    int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  985|  7.00k|    if (special_type != 0) {
  ------------------
  |  Branch (985:9): [True: 327, False: 6.67k]
  ------------------
  986|    327|      if (special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (986:11): [True: 148, False: 179]
  ------------------
  987|       |        // In this case, the actual type size must be derived from the cbytes
  988|    148|        int32_t typesize = header->cbytes - BLOSC_EXTENDED_HEADER_LENGTH;
  989|    148|        if (typesize <= 0) {
  ------------------
  |  Branch (989:13): [True: 1, False: 147]
  ------------------
  990|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  991|      1|          return BLOSC2_ERROR_INVALID_HEADER;
  992|      1|        }
  993|    147|        if (typesize > BLOSC2_MAXTYPESIZE) {
  ------------------
  |  Branch (993:13): [True: 0, False: 147]
  ------------------
  994|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  995|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  996|      0|        }
  997|    147|        if (typesize > header->nbytes) {
  ------------------
  |  Branch (997:13): [True: 25, False: 122]
  ------------------
  998|     25|          BLOSC_TRACE_ERROR("`typesize` is greater than `nbytes`");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  999|     25|          return BLOSC2_ERROR_INVALID_HEADER;
 1000|     25|        }
 1001|    122|        if (header->nbytes % typesize != 0) {
  ------------------
  |  Branch (1001:13): [True: 18, False: 104]
  ------------------
 1002|     18|          BLOSC_TRACE_ERROR("`nbytes` is not a multiple of typesize");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1003|     18|          return BLOSC2_ERROR_INVALID_HEADER;
 1004|     18|        }
 1005|    122|      }
 1006|    179|      else {
 1007|       |        // All-zero chunks fill with memset, which works regardless of element alignment.
 1008|    179|        if (special_type != BLOSC2_SPECIAL_ZERO
  ------------------
  |  Branch (1008:13): [True: 115, False: 64]
  ------------------
 1009|    115|            && header->nbytes % header->typesize != 0) {
  ------------------
  |  Branch (1009:16): [True: 4, False: 111]
  ------------------
 1010|      4|          BLOSC_TRACE_ERROR("`nbytes` is not a multiple of typesize");
  ------------------
  |  |   93|      4|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      4|    do {                                            \
  |  |  |  |   98|      4|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      4|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      4|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1011|      4|          return BLOSC2_ERROR_INVALID_HEADER;
 1012|      4|        }
 1013|    179|      }
 1014|    327|    }
 1015|       |    // The number of filters depends on the version of the header. Blosc2 alpha series
 1016|       |    // did not initialize filters to zero beyond the max supported.
 1017|  6.95k|    if (header->version == BLOSC2_VERSION_FORMAT_ALPHA) {
  ------------------
  |  Branch (1017:9): [True: 785, False: 6.17k]
  ------------------
 1018|    785|      header->filters[5] = 0;
 1019|    785|      header->filters_meta[5] = 0;
 1020|    785|    }
 1021|  6.95k|  }
 1022|   189k|  else {
 1023|   189k|    flags_to_filters(header->flags, header->filters);
 1024|   189k|  }
 1025|   196k|  if (header->version > BLOSC2_VERSION_FORMAT &&
  ------------------
  |  Branch (1025:7): [True: 19.0k, False: 177k]
  ------------------
 1026|  19.0k|      (header->blosc2_flags2 & (uint8_t)~BLOSC2_VL_BLOCKS) != 0) {
  ------------------
  |  Branch (1026:7): [True: 11, False: 19.0k]
  ------------------
 1027|       |    /* Version from future with unsupported chunk features. */
 1028|     11|    return BLOSC2_ERROR_VERSION_SUPPORT;
 1029|     11|  }
 1030|   196k|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0 &&
  ------------------
  |  Branch (1030:7): [True: 385, False: 196k]
  ------------------
 1031|    385|      (header->flags & (uint8_t)BLOSC_MEMCPYED) != 0) {
  ------------------
  |  Branch (1031:7): [True: 2, False: 383]
  ------------------
 1032|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1033|      2|    return BLOSC2_ERROR_INVALID_HEADER;
 1034|      2|  }
 1035|   196k|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) == 0 &&
  ------------------
  |  Branch (1035:7): [True: 196k, False: 383]
  ------------------
 1036|   196k|      header->nbytes > 0 && header->blocksize > header->nbytes) {
  ------------------
  |  Branch (1036:7): [True: 196k, False: 131]
  |  Branch (1036:29): [True: 29.3k, False: 166k]
  ------------------
 1037|  29.3k|    header->blocksize = header->nbytes;
 1038|  29.3k|  }
 1039|   196k|  return 0;
 1040|   196k|}
fill_codec:
 1196|      4|int fill_codec(blosc2_codec *codec) {
 1197|      4|  int rc = BLOSC2_ERROR_SUCCESS;
 1198|      4|  static_lock(&g_plugin_lock);
  ------------------
  |  |  132|      4|#define static_lock(l) pthread_mutex_lock(l)
  ------------------
 1199|       |  /* Unless another thread loaded it meanwhile */
 1200|      4|  if (codec->encoder == NULL || codec->decoder == NULL) {
  ------------------
  |  Branch (1200:7): [True: 4, False: 0]
  |  Branch (1200:33): [True: 0, False: 0]
  ------------------
 1201|      4|    rc = load_codec_locked(codec);
 1202|      4|  }
 1203|      4|  static_unlock(&g_plugin_lock);
  ------------------
  |  |  133|      4|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 1204|      4|  return rc;
 1205|      4|}
pipeline_backward:
 1884|  12.9k|                      uint8_t* tmp2, int last_filter_index, int32_t nblock) {
 1885|  12.9k|  (void)tmp2;
 1886|  12.9k|  blosc2_context* context = thread_context->parent_context;
 1887|  12.9k|  int32_t typesize = context->typesize;
 1888|  12.9k|  uint8_t* filters = context->filters;
 1889|  12.9k|  uint8_t* filters_meta = context->filters_meta;
 1890|  12.9k|  uint8_t* _src = (next_filter(context, BLOSC2_MAX_FILTERS, 'd') == BLOSC_DELTA &&
  ------------------
  |  Branch (1890:20): [True: 3.32k, False: 9.60k]
  ------------------
 1891|  9.60k|                   context->postfilter == NULL) ? (dest + offset) : src;
  ------------------
  |  Branch (1891:20): [True: 3.32k, False: 0]
  ------------------
 1892|  12.9k|  uint8_t* _dest = tmp;
 1893|  12.9k|  int errcode = 0;
 1894|       |
 1895|  66.7k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (1895:40): [True: 66.7k, False: 0]
  ------------------
 1896|  66.7k|    if (do_nothing(context, i, 'd')) {
  ------------------
  |  Branch (1896:9): [True: 26.4k, False: 40.2k]
  ------------------
 1897|  26.4k|      continue;
 1898|  26.4k|    }
 1899|  40.2k|    int first_index = i;
 1900|  40.2k|#ifdef BLOSC_USE_FUSED_SHUFFLE_BYTEDELTA
 1901|  40.2k|    int fused_size = fused_shuffle_bytedelta_size(context, i - 1);
 1902|  40.2k|    if (fused_size) {
  ------------------
  |  Branch (1902:9): [True: 1.46k, False: 38.8k]
  ------------------
 1903|  1.46k|      first_index = i - 1;
 1904|  1.46k|    }
 1905|  40.2k|#endif
 1906|       |    // Delta filter requires the whole chunk ready. A fused inverse ends at
 1907|       |    // SHUFFLE's position, so select its sink using the pair's first index.
 1908|  40.2k|    int last_copy_filter = (last_filter_index == first_index) || (filters[i] == BLOSC_DELTA) ||
  ------------------
  |  Branch (1908:28): [True: 12.8k, False: 27.4k]
  |  Branch (1908:66): [True: 9.33k, False: 18.1k]
  ------------------
 1909|  18.1k|                           (next_filter(context, first_index, 'd') == BLOSC_DELTA);
  ------------------
  |  Branch (1909:28): [True: 4.78k, False: 13.3k]
  ------------------
 1910|  40.2k|    if (last_copy_filter && context->postfilter == NULL &&
  ------------------
  |  Branch (1910:9): [True: 26.9k, False: 13.3k]
  |  Branch (1910:29): [True: 26.9k, False: 0]
  ------------------
 1911|  26.9k|        (filters[i] == BLOSC_DELTA || _src != dest + offset)) {
  ------------------
  |  Branch (1911:10): [True: 13.4k, False: 13.5k]
  |  Branch (1911:39): [True: 10.5k, False: 2.94k]
  ------------------
 1912|  23.9k|      _dest = dest + offset;
 1913|  23.9k|    } else {
 1914|  16.2k|      _dest = (_src == src) ? tmp : src;
  ------------------
  |  Branch (1914:15): [True: 7.85k, False: 8.41k]
  ------------------
 1915|  16.2k|    }
 1916|  40.2k|    int rc = BLOSC2_ERROR_SUCCESS;
 1917|  40.2k|#ifdef BLOSC_USE_FUSED_SHUFFLE_BYTEDELTA
 1918|  40.2k|    if (fused_size && shuffle_bytedelta_backward(_src, _dest, bsize, fused_size)) {
  ------------------
  |  Branch (1918:9): [True: 1.46k, False: 38.8k]
  |  Branch (1918:23): [True: 1.46k, False: 0]
  ------------------
 1919|  1.46k|      i--;
 1920|  1.46k|      _src = _dest;
 1921|  1.46k|      if (last_filter_index == i) {
  ------------------
  |  Branch (1921:11): [True: 543, False: 923]
  ------------------
 1922|    543|        break;
 1923|    543|      }
 1924|    923|      continue;
 1925|  1.46k|    }
 1926|  38.8k|#endif
 1927|  38.8k|    if (filters[i] <= BLOSC2_DEFINED_FILTERS_STOP) {
  ------------------
  |  Branch (1927:9): [True: 32.9k, False: 5.80k]
  ------------------
 1928|  32.9k|      switch (filters[i]) {
 1929|  13.3k|        case BLOSC_SHUFFLE:
  ------------------
  |  Branch (1929:9): [True: 13.3k, False: 19.6k]
  ------------------
 1930|  13.3k|          blosc2_unshuffle(shuffle_size(context, i), bsize, _src, _dest);
 1931|  13.3k|          break;
 1932|  6.05k|        case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (1932:9): [True: 6.05k, False: 26.9k]
  ------------------
 1933|  6.05k|          if (bitunshuffle(typesize, bsize, _src, _dest, bitshuffle_scratch(thread_context, bsize),
  ------------------
  |  Branch (1933:15): [True: 0, False: 6.05k]
  ------------------
 1934|  6.05k|                           context->src[BLOSC2_CHUNK_VERSION]) < 0) {
 1935|      0|            return BLOSC2_ERROR_FILTER_PIPELINE;
 1936|      0|          }
 1937|  6.05k|          break;
 1938|  13.4k|        case BLOSC_DELTA:
  ------------------
  |  Branch (1938:9): [True: 13.4k, False: 19.5k]
  ------------------
 1939|  13.4k|          if (_src != _dest) {
  ------------------
  |  Branch (1939:15): [True: 1.34k, False: 12.0k]
  ------------------
 1940|  1.34k|            memcpy(_dest, _src, (size_t)bsize);
 1941|  1.34k|          }
 1942|  13.4k|          if (offset != 0 && !thread_context->serial) {
  ------------------
  |  Branch (1942:15): [True: 11.0k, False: 2.32k]
  |  Branch (1942:30): [True: 0, False: 11.0k]
  ------------------
 1943|      0|            delta_wait_dref(context);
 1944|      0|          }
 1945|  13.4k|          delta_decoder(offset == 0 ? _dest : dest, offset, bsize, typesize, _dest);
  ------------------
  |  Branch (1945:25): [True: 2.32k, False: 11.0k]
  ------------------
 1946|  13.4k|          break;
 1947|    189|        default:
  ------------------
  |  Branch (1947:9): [True: 189, False: 32.8k]
  ------------------
 1948|    189|          BLOSC_TRACE_ERROR("Filter %d not handled during decompression.", filters[i]);
  ------------------
  |  |   93|    189|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    189|    do {                                            \
  |  |  |  |   98|    189|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    189|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 189, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    189|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1949|    189|          errcode = -1;
 1950|  32.9k|      }
 1951|  32.9k|    } else {
 1952|       |        // Look for the filters_meta in user filters and run it
 1953|  23.9k|        for (uint64_t j = 0; j < g_nfilters; ++j) {
  ------------------
  |  Branch (1953:30): [True: 23.8k, False: 174]
  ------------------
 1954|  23.8k|          if (g_filters[j].id == filters[i]) {
  ------------------
  |  Branch (1954:15): [True: 5.63k, False: 18.1k]
  ------------------
 1955|  5.63k|            if (load_acquire_ptr(&g_filters[j].backward) == NULL) {
  ------------------
  |  |  144|  5.63k|#define load_acquire_ptr(p) __atomic_load_n((p), __ATOMIC_ACQUIRE)
  ------------------
  |  Branch (1955:17): [True: 0, False: 5.63k]
  ------------------
 1956|       |              // Dynamically load filter
 1957|      0|              if (fill_filter(&g_filters[j]) < 0) {
  ------------------
  |  Branch (1957:19): [True: 0, False: 0]
  ------------------
 1958|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1959|      0|                return BLOSC2_ERROR_FILTER_PIPELINE;
 1960|      0|              }
 1961|      0|            }
 1962|  5.63k|            if (g_filters[j].backward != NULL) {
  ------------------
  |  Branch (1962:17): [True: 5.63k, False: 0]
  ------------------
 1963|  5.63k|              blosc2_dparams dparams;
 1964|  5.63k|              blosc2_ctx_get_dparams(context, &dparams);
 1965|  5.63k|              rc = g_filters[j].backward(_src, _dest, bsize, filters_meta[i], &dparams, g_filters[j].id);
 1966|  5.63k|            } else {
 1967|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1968|      0|              return BLOSC2_ERROR_FILTER_PIPELINE;
 1969|      0|            }
 1970|  5.63k|            if (rc != BLOSC2_ERROR_SUCCESS) {
  ------------------
  |  Branch (1970:17): [True: 30, False: 5.60k]
  ------------------
 1971|     30|              BLOSC_TRACE_ERROR("User-defined filter %d failed during decompression.", filters[i]);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1972|     30|              return rc;
 1973|     30|            }
 1974|  5.60k|            goto urfiltersuccess;
 1975|  5.63k|          }
 1976|  23.8k|        }
 1977|    174|      BLOSC_TRACE_ERROR("User-defined filter %d not found during decompression.", filters[i]);
  ------------------
  |  |   93|    174|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    174|    do {                                            \
  |  |  |  |   98|    174|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    174|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 174, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    174|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1978|    174|      return BLOSC2_ERROR_FILTER_PIPELINE;
 1979|  5.60k|      urfiltersuccess:;
 1980|  5.60k|    }
 1981|       |
 1982|       |    // do_nothing() skipped the filters that leave the block as it is (TRUNC_PREC is not undone);
 1983|       |    // the output of this filter is the input of the next one
 1984|  38.6k|    _src = _dest;
 1985|  38.6k|    if (last_filter_index == i) {
  ------------------
  |  Branch (1985:9): [True: 12.1k, False: 26.4k]
  ------------------
 1986|  12.1k|      break;
 1987|  12.1k|    }
 1988|  38.6k|  }
 1989|       |
 1990|  12.7k|  if (context->postfilter == NULL && _src != dest + offset) {
  ------------------
  |  Branch (1990:7): [True: 12.7k, False: 0]
  |  Branch (1990:38): [True: 1.56k, False: 11.1k]
  ------------------
 1991|  1.56k|    memcpy(dest + offset, _src, (unsigned int)bsize);
 1992|  1.56k|  }
 1993|       |
 1994|       |  /* Postfilter function */
 1995|  12.7k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (1995:7): [True: 0, False: 12.7k]
  ------------------
 1996|       |    // Create new postfilter parameters for this block (must be private for each thread)
 1997|      0|    blosc2_postfilter_params postparams;
 1998|      0|    memcpy(&postparams, context->postparams, sizeof(postparams));
 1999|      0|    postparams.input = _src;
 2000|      0|    postparams.output = dest + offset;
 2001|      0|    postparams.size = bsize;
 2002|      0|    postparams.typesize = typesize;
 2003|      0|    postparams.offset = nblock * context->blocksize;
 2004|      0|    postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (2004:25): [True: 0, False: 0]
  ------------------
 2005|      0|    postparams.nblock = nblock;
 2006|      0|    postparams.tid = thread_context->tid;
 2007|      0|    postparams.ttmp = thread_context->tmp;
 2008|      0|    postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 2009|      0|    postparams.ctx = context;
 2010|       |
 2011|      0|    if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (2011:9): [True: 0, False: 0]
  ------------------
 2012|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2013|      0|      return BLOSC2_ERROR_POSTFILTER;
 2014|      0|    }
 2015|      0|  }
 2016|       |
 2017|  12.7k|  return errcode;
 2018|  12.7k|}
free_thread_context:
 2708|  11.3k|void free_thread_context(struct thread_context* thread_context) {
 2709|  11.3k|  destroy_thread_context(thread_context);
 2710|  11.3k|  my_free(thread_context);
 2711|  11.3k|}
blosc2_decompress:
 4871|  12.5k|int blosc2_decompress(const void* src, int32_t srcsize, void* dest, int32_t destsize) {
 4872|  12.5k|  int result;
 4873|  12.5k|  char* envvar;
 4874|  12.5k|  long nthreads;
 4875|  12.5k|  blosc2_context *dctx;
 4876|  12.5k|  blosc2_dparams dparams = BLOSC2_DPARAMS_DEFAULTS;
 4877|       |
 4878|       |  /* Check whether the library should be initialized */
 4879|  12.5k|  blosc2_init();
 4880|       |
 4881|       |  /* Check for a BLOSC_NTHREADS environment variable */
 4882|  12.5k|  envvar = getenv("BLOSC_NTHREADS");
 4883|  12.5k|  if (envvar != NULL) {
  ------------------
  |  Branch (4883:7): [True: 0, False: 12.5k]
  ------------------
 4884|      0|    errno = 0; /* To distinguish success/failure after call */
 4885|      0|    nthreads = strtol(envvar, NULL, 10);
 4886|      0|    if ((errno != EINVAL)) {
  ------------------
  |  Branch (4886:9): [True: 0, False: 0]
  ------------------
 4887|      0|      if ((nthreads <= 0) || (nthreads > INT16_MAX)) {
  ------------------
  |  Branch (4887:11): [True: 0, False: 0]
  |  Branch (4887:30): [True: 0, False: 0]
  ------------------
 4888|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 4888|      0|        BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4889|      0|        return BLOSC2_ERROR_INVALID_PARAM;
 4890|      0|      }
 4891|      0|      result = blosc2_set_nthreads((int16_t) nthreads);
 4892|      0|      if (result < 0) {
  ------------------
  |  Branch (4892:11): [True: 0, False: 0]
  ------------------
 4893|      0|        return result;
 4894|      0|      }
 4895|      0|    }
 4896|      0|  }
 4897|       |
 4898|       |  /* Check for a BLOSC_NOLOCK environment variable.  It is important
 4899|       |     that this should be the last env var so that it can take the
 4900|       |     previous ones into account */
 4901|  12.5k|  envvar = getenv("BLOSC_NOLOCK");
 4902|  12.5k|  if (envvar != NULL) {
  ------------------
  |  Branch (4902:7): [True: 0, False: 12.5k]
  ------------------
 4903|      0|    dparams.nthreads = g_nthreads;
 4904|      0|    dctx = blosc2_create_dctx(dparams);
 4905|      0|    if (dctx == NULL) {
  ------------------
  |  Branch (4905:9): [True: 0, False: 0]
  ------------------
 4906|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4907|      0|      return BLOSC2_ERROR_NULL_POINTER;
 4908|      0|    }
 4909|      0|    result = blosc2_decompress_ctx(dctx, src, srcsize, dest, destsize);
 4910|      0|    blosc2_free_ctx(dctx);
 4911|      0|    return result;
 4912|      0|  }
 4913|       |
 4914|  12.5k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  12.5k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 4915|       |
 4916|  12.5k|  result = blosc_run_decompression_with_context(
 4917|  12.5k|          g_global_context, src, srcsize, dest, destsize);
 4918|       |
 4919|  12.5k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  12.5k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 4920|       |
 4921|  12.5k|  return result;
 4922|  12.5k|}
blosc2_set_nthreads:
 6409|  12.8k|int16_t blosc2_set_nthreads(int16_t nthreads) {
 6410|  12.8k|  int16_t ret;          /* the previous number of threads */
 6411|       |
 6412|       |  /* Check whether the library should be initialized */
 6413|  12.8k|  blosc2_init();
 6414|       |
 6415|  12.8k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  12.8k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 6416|  12.8k|  ret = g_nthreads;
 6417|  12.8k|  if (nthreads != ret) {
  ------------------
  |  Branch (6417:7): [True: 0, False: 12.8k]
  ------------------
 6418|      0|    int16_t old_new_nthreads = g_global_context->new_nthreads;
 6419|      0|    int16_t old_nthreads = g_global_context->nthreads;
 6420|      0|    g_nthreads = nthreads;
 6421|      0|    g_global_context->new_nthreads = nthreads;
 6422|      0|    int16_t ret2 = check_nthreads(g_global_context, true);
 6423|      0|    if (ret2 < 0) {
  ------------------
  |  Branch (6423:9): [True: 0, False: 0]
  ------------------
 6424|      0|      g_nthreads = ret;
 6425|      0|      g_global_context->new_nthreads = old_new_nthreads;
 6426|      0|      g_global_context->nthreads = old_nthreads;
 6427|      0|      check_nthreads(g_global_context, true);
 6428|      0|      blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 6429|      0|      return ret2;
 6430|      0|    }
 6431|      0|  }
 6432|  12.8k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  12.8k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 6433|       |
 6434|  12.8k|  return ret;
 6435|  12.8k|}
blosc1_cbuffer_sizes:
 6544|  12.8k|void blosc1_cbuffer_sizes(const void* cbuffer, size_t* nbytes, size_t* cbytes, size_t* blocksize) {
 6545|  12.8k|  int32_t nbytes32, cbytes32, blocksize32;
 6546|  12.8k|  blosc2_cbuffer_sizes(cbuffer, &nbytes32, &cbytes32, &blocksize32);
 6547|  12.8k|  *nbytes = nbytes32;
 6548|  12.8k|  *cbytes = cbytes32;
 6549|  12.8k|  *blocksize = blocksize32;
 6550|  12.8k|}
blosc2_cbuffer_sizes:
 6552|   184k|int blosc2_cbuffer_sizes(const void* cbuffer, int32_t* nbytes, int32_t* cbytes, int32_t* blocksize) {
 6553|   184k|  blosc_header header;
 6554|   184k|  int rc = read_chunk_header((uint8_t *) cbuffer, BLOSC_MIN_HEADER_LENGTH, false, &header);
 6555|   184k|  if (rc < 0) {
  ------------------
  |  Branch (6555:7): [True: 84, False: 184k]
  ------------------
 6556|       |    /* Return zeros if error reading header */
 6557|     84|    memset(&header, 0, sizeof(header));
 6558|     84|  }
 6559|       |
 6560|       |  /* Read the interesting values */
 6561|   184k|  if (nbytes != NULL)
  ------------------
  |  Branch (6561:7): [True: 184k, False: 39]
  ------------------
 6562|   184k|    *nbytes = header.nbytes;
 6563|   184k|  if (cbytes != NULL)
  ------------------
  |  Branch (6563:7): [True: 184k, False: 0]
  ------------------
 6564|   184k|    *cbytes = header.cbytes;
 6565|   184k|  if (blocksize != NULL)
  ------------------
  |  Branch (6565:7): [True: 12.8k, False: 171k]
  ------------------
 6566|  12.8k|    *blocksize = header.blocksize;
 6567|   184k|  return rc;
 6568|   184k|}
blosc1_cbuffer_validate:
 6570|  12.6k|int blosc1_cbuffer_validate(const void* cbuffer, size_t cbytes, size_t* nbytes) {
 6571|  12.6k|  int32_t header_cbytes;
 6572|  12.6k|  int32_t header_nbytes;
 6573|  12.6k|  if (cbytes < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (6573:7): [True: 0, False: 12.6k]
  ------------------
 6574|       |    /* Compressed data should contain enough space for header */
 6575|      0|    *nbytes = 0;
 6576|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 6577|      0|  }
 6578|  12.6k|  int rc = blosc2_cbuffer_sizes(cbuffer, &header_nbytes, &header_cbytes, NULL);
 6579|  12.6k|  if (rc < 0) {
  ------------------
  |  Branch (6579:7): [True: 0, False: 12.6k]
  ------------------
 6580|      0|    *nbytes = 0;
 6581|      0|    return rc;
 6582|      0|  }
 6583|  12.6k|  *nbytes = header_nbytes;
 6584|  12.6k|  if (header_cbytes != (int32_t)cbytes) {
  ------------------
  |  Branch (6584:7): [True: 0, False: 12.6k]
  ------------------
 6585|       |    /* Compressed size from header does not match `cbytes` */
 6586|      0|    *nbytes = 0;
 6587|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 6588|      0|  }
 6589|  12.6k|  if (*nbytes > BLOSC2_MAX_BUFFERSIZE) {
  ------------------
  |  Branch (6589:7): [True: 48, False: 12.5k]
  ------------------
 6590|       |    /* Uncompressed size is larger than allowed */
 6591|     48|    *nbytes = 0;
 6592|     48|    return BLOSC2_ERROR_MEMORY_ALLOC;
 6593|     48|  }
 6594|  12.5k|  return 0;
 6595|  12.6k|}
blosc2_init:
 6758|  38.2k|void blosc2_init(void) {
 6759|       |  /* Return if Blosc is already initialized */
 6760|  38.2k|  if (load_acquire_int(&g_initlib) == BLOSC_STATE_INITIALIZED) return;
  ------------------
  |  |  142|  38.2k|#define load_acquire_int(p) __atomic_load_n((p), __ATOMIC_ACQUIRE)
  ------------------
                if (load_acquire_int(&g_initlib) == BLOSC_STATE_INITIALIZED) return;
  ------------------
  |  |  104|  38.2k|#define BLOSC_STATE_INITIALIZED   1
  ------------------
  |  Branch (6760:7): [True: 25.4k, False: 12.8k]
  ------------------
 6761|       |
 6762|  12.8k|#if !defined(_WIN32)
 6763|       |  /* Before g_init_lock is taken: from now on a fork() waits for it */
 6764|  12.8k|  pthread_once(&atfork_once, register_atfork);
 6765|  12.8k|#endif
 6766|  12.8k|  static_lock(&g_init_lock);
  ------------------
  |  |  132|  12.8k|#define static_lock(l) pthread_mutex_lock(l)
  ------------------
 6767|       |  /* Teardown drops this lock while joining prefetch workers.  Wait without
 6768|       |     holding it so the destroyer can finish; never reinitialize live globals. */
 6769|  12.8k|  while (g_initlib == BLOSC_STATE_TEARDOWN) {
  ------------------
  |  |  105|  12.8k|#define BLOSC_STATE_TEARDOWN      2
  ------------------
  |  Branch (6769:10): [True: 0, False: 12.8k]
  ------------------
 6770|       |#if defined(_WIN32)
 6771|       |    SleepConditionVariableSRW(&g_init_cv, &g_init_lock, INFINITE, 0);
 6772|       |#else
 6773|      0|    pthread_cond_wait(&g_init_cv, &g_init_lock);
 6774|      0|#endif
 6775|      0|  }
 6776|       |  /* Unless another thread initialized it meanwhile */
 6777|  12.8k|  if (g_initlib != BLOSC_STATE_INITIALIZED) {
  ------------------
  |  |  104|  12.8k|#define BLOSC_STATE_INITIALIZED   1
  ------------------
  |  Branch (6777:7): [True: 12.8k, False: 0]
  ------------------
 6778|  12.8k|    blosc2_init_locked();
 6779|  12.8k|  }
 6780|  12.8k|  static_unlock(&g_init_lock);
  ------------------
  |  |  133|  12.8k|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 6781|  12.8k|}
blosc2_tmp_cache_clear:
 7014|  25.6k|void blosc2_tmp_cache_clear(void) {
 7015|  25.6k|#if !defined(_WIN32)
 7016|  25.6k|  tmp_cache_t *cache = tmp_cache_get(false);
 7017|  25.6k|  if (cache != NULL) {
  ------------------
  |  Branch (7017:7): [True: 25.0k, False: 638]
  ------------------
 7018|   125k|    for (int i = 0; i < BLOSC2_TMP_CACHE_SLOTS; ++i) {
  ------------------
  |  | 6811|   125k|#define BLOSC2_TMP_CACHE_SLOTS 4
  ------------------
  |  Branch (7018:21): [True: 100k, False: 25.0k]
  ------------------
 7019|   100k|      free(cache->ptr[i]);
 7020|   100k|      cache->ptr[i] = NULL;
 7021|   100k|      cache->size[i] = 0;
 7022|   100k|    }
 7023|  25.0k|    if (cache->serial != NULL && !cache->serial_busy) {
  ------------------
  |  Branch (7023:9): [True: 11.3k, False: 13.7k]
  |  Branch (7023:34): [True: 11.3k, False: 0]
  ------------------
 7024|  11.3k|      free_thread_context(cache->serial);
 7025|       |      cache->serial = NULL;
 7026|  11.3k|    }
 7027|  25.0k|  }
 7028|  25.6k|#endif
 7029|  25.6k|}
blosc2_destroy:
 7067|  12.8k|void blosc2_destroy(void) {
 7068|       |  /* Return if Blosc is not initialized */
 7069|  12.8k|  if (load_acquire_int(&g_initlib) != BLOSC_STATE_INITIALIZED) return;
  ------------------
  |  |  142|  12.8k|#define load_acquire_int(p) __atomic_load_n((p), __ATOMIC_ACQUIRE)
  ------------------
                if (load_acquire_int(&g_initlib) != BLOSC_STATE_INITIALIZED) return;
  ------------------
  |  |  104|  12.8k|#define BLOSC_STATE_INITIALIZED   1
  ------------------
  |  Branch (7069:7): [True: 0, False: 12.8k]
  ------------------
 7070|       |
 7071|  12.8k|  static_lock(&g_init_lock);
  ------------------
  |  |  132|  12.8k|#define static_lock(l) pthread_mutex_lock(l)
  ------------------
 7072|  12.8k|  if (g_initlib != BLOSC_STATE_INITIALIZED) {
  ------------------
  |  |  104|  12.8k|#define BLOSC_STATE_INITIALIZED   1
  ------------------
  |  Branch (7072:7): [True: 0, False: 12.8k]
  ------------------
 7073|      0|    static_unlock(&g_init_lock);
  ------------------
  |  |  133|      0|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 7074|      0|    return;
 7075|      0|  }
 7076|  12.8k|  store_release_int(&g_initlib, BLOSC_STATE_TEARDOWN);
  ------------------
  |  |  143|  12.8k|#define store_release_int(p, v) __atomic_store_n((p), (v), __ATOMIC_RELEASE)
  ------------------
 7077|  12.8k|  static_unlock(&g_init_lock);
  ------------------
  |  |  133|  12.8k|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 7078|       |
 7079|       |  /* Not under g_init_lock: a fork() holds the read-ahead pool's lock while it
 7080|       |     waits for g_init_lock (prefetch.c registers its fork handlers later).
 7081|       |     New prefetch operations and threads are blocked by blosc2_is_initialized(). */
 7082|  12.8k|  prefetch_destroy();
 7083|       |
 7084|  12.8k|  static_lock(&g_init_lock);
  ------------------
  |  |  132|  12.8k|#define static_lock(l) pthread_mutex_lock(l)
  ------------------
 7085|  12.8k|  blosc2_destroy_locked();
 7086|  12.8k|  store_release_int(&g_initlib, BLOSC_STATE_UNINITIALIZED);
  ------------------
  |  |  143|  12.8k|#define store_release_int(p, v) __atomic_store_n((p), (v), __ATOMIC_RELEASE)
  ------------------
 7087|       |#if defined(_WIN32)
 7088|       |  WakeAllConditionVariable(&g_init_cv);
 7089|       |#else
 7090|  12.8k|  pthread_cond_broadcast(&g_init_cv);
 7091|  12.8k|#endif
 7092|  12.8k|  static_unlock(&g_init_lock);
  ------------------
  |  |  133|  12.8k|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 7093|  12.8k|}
blosc2_free_ctx:
 7360|  12.8k|void blosc2_free_ctx(blosc2_context* context) {
 7361|  12.8k|  if (load_acquire_int(&g_initlib) == BLOSC_STATE_INITIALIZED ||
  ------------------
  |  |  142|  12.8k|#define load_acquire_int(p) __atomic_load_n((p), __ATOMIC_ACQUIRE)
  ------------------
                if (load_acquire_int(&g_initlib) == BLOSC_STATE_INITIALIZED ||
  ------------------
  |  |  104|  25.6k|#define BLOSC_STATE_INITIALIZED   1
  ------------------
  |  Branch (7361:7): [True: 0, False: 12.8k]
  ------------------
 7362|  12.8k|      context->thread_backend == BLOSC_BACKEND_PER_CONTEXT ||
  ------------------
  |  |   36|  25.6k|#define BLOSC_BACKEND_PER_CONTEXT 3   /* per-context threads; used on Windows */
  ------------------
  |  Branch (7362:7): [True: 0, False: 12.8k]
  ------------------
 7363|  12.8k|      context->thread_backend == BLOSC_BACKEND_CALLBACK) {
  ------------------
  |  |   35|  12.8k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (7363:7): [True: 0, False: 12.8k]
  ------------------
 7364|      0|    release_thread_backend(context);
 7365|      0|  }
 7366|  12.8k|  if (context->serial_context != NULL) {
  ------------------
  |  Branch (7366:7): [True: 0, False: 12.8k]
  ------------------
 7367|      0|    free_thread_context(context->serial_context);
 7368|      0|  }
 7369|  12.8k|  blosc2_pthread_mutex_destroy(&context->nchunk_mutex);
  ------------------
  |  |   91|  12.8k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 7370|  12.8k|  release_context_dict_buffer(context);
 7371|  12.8k|  if (context->dict_cdict != NULL) {
  ------------------
  |  Branch (7371:7): [True: 0, False: 12.8k]
  ------------------
 7372|      0|    if (context->compcode == BLOSC_LZ4) {
  ------------------
  |  Branch (7372:9): [True: 0, False: 0]
  ------------------
 7373|      0|      LZ4_freeStream((LZ4_stream_t*)context->dict_cdict);
 7374|      0|    } else if (context->compcode == BLOSC_LZ4HC) {
  ------------------
  |  Branch (7374:16): [True: 0, False: 0]
  ------------------
 7375|      0|      LZ4_freeStreamHC((LZ4_streamHC_t*)context->dict_cdict);
 7376|      0|    }
 7377|      0|#ifdef HAVE_ZSTD
 7378|      0|    else if (context->compcode == BLOSC_ZSTD) {
  ------------------
  |  Branch (7378:14): [True: 0, False: 0]
  ------------------
 7379|      0|      ZSTD_freeCDict(context->dict_cdict);
 7380|      0|    }
 7381|      0|#endif
 7382|      0|  }
 7383|  12.8k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (7383:7): [True: 1.91k, False: 10.9k]
  ------------------
 7384|  1.91k|#ifdef HAVE_ZSTD
 7385|  1.91k|    ZSTD_freeDDict(context->dict_ddict);
 7386|  1.91k|#endif
 7387|  1.91k|  }
 7388|  12.8k|  if (context->tuner_params != NULL) {
  ------------------
  |  Branch (7388:7): [True: 0, False: 12.8k]
  ------------------
 7389|      0|    int rc;
 7390|      0|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|      0|#define BLOSC_STUNE 0
  ------------------
  |  Branch (7390:9): [True: 0, False: 0]
  |  Branch (7390:49): [True: 0, False: 0]
  ------------------
 7391|      0|      rc = blosc_stune_free(context);
 7392|      0|    } else {
 7393|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (7393:23): [True: 0, False: 0]
  ------------------
 7394|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (7394:13): [True: 0, False: 0]
  ------------------
 7395|      0|          if (load_acquire_ptr(&g_tuners[i].init) == NULL) {
  ------------------
  |  |  144|      0|#define load_acquire_ptr(p) __atomic_load_n((p), __ATOMIC_ACQUIRE)
  ------------------
  |  Branch (7395:15): [True: 0, False: 0]
  ------------------
 7396|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (7396:17): [True: 0, False: 0]
  ------------------
 7397|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7398|      0|              return;
 7399|      0|            }
 7400|      0|          }
 7401|      0|          rc = g_tuners[i].free(context);
 7402|      0|          goto urtunersuccess;
 7403|      0|        }
 7404|      0|      }
 7405|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7406|      0|      return;
 7407|      0|      urtunersuccess:;
 7408|      0|    }
 7409|      0|    if (rc < 0) {
  ------------------
  |  Branch (7409:9): [True: 0, False: 0]
  ------------------
 7410|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7411|      0|      return;
 7412|      0|    }
 7413|      0|  }
 7414|       |  /* May be needed if codec_params ever contains nested objects
 7415|       |  if (context->codec_params != NULL) {
 7416|       |    int rc;
 7417|       |    for (int i = 0; i < g_ncodecs; ++i) {
 7418|       |      if (g_codecs[i].compcode == context->compcode) {
 7419|       |        if (g_codecs[i].free == NULL) {
 7420|       |          // Dynamically load codec plugin
 7421|       |          if (fill_codec(&g_codecs[i]) < 0) {
 7422|       |            BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
 7423|       |            return BLOSC2_ERROR_CODEC_SUPPORT;
 7424|       |          }
 7425|       |        }
 7426|       |        if (g_codecs[i].free == NULL){
 7427|       |          // no free func, codec_params is simple
 7428|       |          my_free(context->codec_params);
 7429|       |        }
 7430|       |        else{ // has free function for codec_params (e.g. openzl)
 7431|       |        rc = g_codecs[i].free(context->codec_params);
 7432|       |          goto urcodecsuccess;
 7433|       |        }
 7434|       |      }
 7435|       |    }
 7436|       |      BLOSC_TRACE_ERROR("User-defined compressor codec %d not found", context->compcode);
 7437|       |      return BLOSC2_ERROR_CODEC_SUPPORT;
 7438|       |    urcodecsuccess:;
 7439|       |    if (rc < 0) {
 7440|       |      BLOSC_TRACE_ERROR("Error in user-defined codec free function\n");
 7441|       |      return;
 7442|       |    }
 7443|       |  }
 7444|       |  */
 7445|  12.8k|  if (context->prefilter != NULL) {
  ------------------
  |  Branch (7445:7): [True: 0, False: 12.8k]
  ------------------
 7446|      0|    my_free(context->preparams);
 7447|      0|  }
 7448|  12.8k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (7448:7): [True: 0, False: 12.8k]
  ------------------
 7449|      0|    my_free(context->postparams);
 7450|      0|  }
 7451|       |
 7452|  12.8k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (7452:7): [True: 0, False: 12.8k]
  ------------------
 7453|      0|    free(context->block_maskout);
 7454|      0|  }
 7455|  12.8k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (7455:7): [True: 314, False: 12.5k]
  ------------------
 7456|    314|    free(context->blocknbytes);
 7457|    314|  }
 7458|  12.8k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (7458:7): [True: 314, False: 12.5k]
  ------------------
 7459|    314|    free(context->blockoffsets);
 7460|    314|  }
 7461|  12.8k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (7461:7): [True: 314, False: 12.5k]
  ------------------
 7462|    314|    free(context->blockcbytes);
 7463|    314|  }
 7464|  12.8k|  my_free(context);
 7465|  12.8k|}
blosc2_ctx_get_dparams:
 7492|  7.52k|int blosc2_ctx_get_dparams(blosc2_context *ctx, blosc2_dparams *dparams) {
 7493|  7.52k|  dparams->nthreads = ctx->nthreads;
 7494|  7.52k|  dparams->schunk = ctx->schunk;
 7495|  7.52k|  dparams->postfilter = ctx->postfilter;
 7496|  7.52k|  dparams->postparams = ctx->postparams;
 7497|  7.52k|  dparams->typesize = ctx->typesize;
 7498|       |
 7499|  7.52k|  return BLOSC2_ERROR_SUCCESS;
 7500|  7.52k|}
register_filter_private:
 7718|  64.1k|int register_filter_private(blosc2_filter *filter) {
 7719|  64.1k|    BLOSC_ERROR_NULL(filter, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  64.1k|    do {                                            \
  |  |  105|  64.1k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 64.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|  64.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 64.1k]
  |  |  ------------------
  ------------------
 7720|  64.1k|    if (g_nfilters == UINT8_MAX) {
  ------------------
  |  Branch (7720:9): [True: 0, False: 64.1k]
  ------------------
 7721|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7722|      0|        return BLOSC2_ERROR_CODEC_SUPPORT;
 7723|      0|    }
 7724|  64.1k|    if (filter->id < BLOSC2_GLOBAL_REGISTERED_FILTERS_START) {
  ------------------
  |  Branch (7724:9): [True: 0, False: 64.1k]
  ------------------
 7725|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7726|      0|        return BLOSC2_ERROR_FAILURE;
 7727|      0|    }
 7728|       |    /* This condition can never be fulfilled
 7729|       |    if (filter->id > BLOSC2_USER_REGISTERED_FILTERS_STOP) {
 7730|       |        BLOSC_TRACE_ERROR("The id must be less than or equal to %d", BLOSC2_USER_REGISTERED_FILTERS_STOP);
 7731|       |        return BLOSC2_ERROR_FAILURE;
 7732|       |    }
 7733|       |    */
 7734|       |
 7735|   192k|    for (uint64_t i = 0; i < g_nfilters; ++i) {
  ------------------
  |  Branch (7735:26): [True: 128k, False: 64.1k]
  ------------------
 7736|   128k|      if (g_filters[i].id == filter->id) {
  ------------------
  |  Branch (7736:11): [True: 0, False: 128k]
  ------------------
 7737|      0|        if (strcmp(g_filters[i].name, filter->name) != 0) {
  ------------------
  |  Branch (7737:13): [True: 0, False: 0]
  ------------------
 7738|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7739|      0|                            "  Choose another one !", filter->id, g_filters[i].name);
 7740|      0|          return BLOSC2_ERROR_FAILURE;
 7741|      0|        }
 7742|      0|        else {
 7743|       |          // Already registered, so no more actions needed
 7744|      0|          return BLOSC2_ERROR_SUCCESS;
 7745|      0|        }
 7746|      0|      }
 7747|   128k|    }
 7748|       |
 7749|  64.1k|    blosc2_filter *filter_new = &g_filters[g_nfilters++];
 7750|  64.1k|    memcpy(filter_new, filter, sizeof(blosc2_filter));
 7751|       |
 7752|  64.1k|    return BLOSC2_ERROR_SUCCESS;
 7753|  64.1k|}
register_codec_private:
 7768|   115k|int register_codec_private(blosc2_codec *codec) {
 7769|   115k|    BLOSC_ERROR_NULL(codec, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|   115k|    do {                                            \
  |  |  105|   115k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 115k]
  |  |  ------------------
  |  |  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|   115k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 115k]
  |  |  ------------------
  ------------------
 7770|   115k|    if (g_ncodecs == UINT8_MAX) {
  ------------------
  |  Branch (7770:9): [True: 0, False: 115k]
  ------------------
 7771|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7772|      0|      return BLOSC2_ERROR_CODEC_SUPPORT;
 7773|      0|    }
 7774|   115k|    if (codec->compcode < BLOSC2_GLOBAL_REGISTERED_CODECS_START) {
  ------------------
  |  Branch (7774:9): [True: 0, False: 115k]
  ------------------
 7775|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7776|      0|      return BLOSC2_ERROR_FAILURE;
 7777|      0|    }
 7778|       |    /* This condition can never be fulfilled
 7779|       |    if (codec->compcode > BLOSC2_USER_REGISTERED_CODECS_STOP) {
 7780|       |      BLOSC_TRACE_ERROR("The id must be less or equal to %d", BLOSC2_USER_REGISTERED_CODECS_STOP);
 7781|       |      return BLOSC2_ERROR_FAILURE;
 7782|       |    }
 7783|       |     */
 7784|       |
 7785|   577k|    for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (7785:21): [True: 461k, False: 115k]
  ------------------
 7786|   461k|      if (g_codecs[i].compcode == codec->compcode) {
  ------------------
  |  Branch (7786:11): [True: 0, False: 461k]
  ------------------
 7787|      0|        if (strcmp(g_codecs[i].compname, codec->compname) != 0) {
  ------------------
  |  Branch (7787:13): [True: 0, False: 0]
  ------------------
 7788|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7789|      0|                            "  Choose another one !", codec->compcode, codec->compname);
 7790|      0|          return BLOSC2_ERROR_CODEC_PARAM;
 7791|      0|        }
 7792|      0|        else {
 7793|       |          // Already registered, so no more actions needed
 7794|      0|          return BLOSC2_ERROR_SUCCESS;
 7795|      0|        }
 7796|      0|      }
 7797|   461k|    }
 7798|       |
 7799|   115k|    blosc2_codec *codec_new = &g_codecs[g_ncodecs++];
 7800|   115k|    memcpy(codec_new, codec, sizeof(blosc2_codec));
 7801|       |
 7802|   115k|    return BLOSC2_ERROR_SUCCESS;
 7803|   115k|}
register_tuner_private:
 7818|  12.8k|int register_tuner_private(blosc2_tuner *tuner) {
 7819|  12.8k|  BLOSC_ERROR_NULL(tuner, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  12.8k|    do {                                            \
  |  |  105|  12.8k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 12.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|  12.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 12.8k]
  |  |  ------------------
  ------------------
 7820|  12.8k|  if (g_ntuners == UINT8_MAX) {
  ------------------
  |  Branch (7820:7): [True: 0, False: 12.8k]
  ------------------
 7821|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7822|      0|    return BLOSC2_ERROR_CODEC_SUPPORT;
 7823|      0|  }
 7824|  12.8k|  if (tuner->id < BLOSC2_GLOBAL_REGISTERED_TUNER_START) {
  ------------------
  |  Branch (7824:7): [True: 0, False: 12.8k]
  ------------------
 7825|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7826|      0|    return BLOSC2_ERROR_FAILURE;
 7827|      0|  }
 7828|       |
 7829|  12.8k|  for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (7829:19): [True: 0, False: 12.8k]
  ------------------
 7830|      0|    if (g_tuners[i].id == tuner->id) {
  ------------------
  |  Branch (7830:9): [True: 0, False: 0]
  ------------------
 7831|      0|      if (strcmp(g_tuners[i].name, tuner->name) != 0) {
  ------------------
  |  Branch (7831:11): [True: 0, False: 0]
  ------------------
 7832|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7833|      0|                          "  Choose another one !", tuner->id, g_tuners[i].name);
 7834|      0|        return BLOSC2_ERROR_FAILURE;
 7835|      0|      }
 7836|      0|      else {
 7837|       |        // Already registered, so no more actions needed
 7838|      0|        return BLOSC2_ERROR_SUCCESS;
 7839|      0|      }
 7840|      0|    }
 7841|      0|  }
 7842|       |
 7843|  12.8k|  blosc2_tuner *tuner_new = &g_tuners[g_ntuners++];
 7844|  12.8k|  memcpy(tuner_new, tuner, sizeof(blosc2_tuner));
 7845|       |
 7846|  12.8k|  return BLOSC2_ERROR_SUCCESS;
 7847|  12.8k|}
_blosc2_register_io_cb:
 7860|  25.6k|int _blosc2_register_io_cb(const blosc2_io_cb *io) {
 7861|       |
 7862|  38.4k|  for (uint64_t i = 0; i < g_nio; ++i) {
  ------------------
  |  Branch (7862:24): [True: 38.4k, False: 2]
  ------------------
 7863|  38.4k|    if (g_ios[i].id == io->id) {
  ------------------
  |  Branch (7863:9): [True: 25.6k, False: 12.8k]
  ------------------
 7864|  25.6k|      if (strcmp(g_ios[i].name, io->name) != 0) {
  ------------------
  |  Branch (7864:11): [True: 0, False: 25.6k]
  ------------------
 7865|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7866|      0|                          "  Choose another one !", io->id, g_ios[i].name);
 7867|      0|        return BLOSC2_ERROR_PLUGIN_IO;
 7868|      0|      }
 7869|  25.6k|      else {
 7870|       |        // Already registered, so no more actions needed
 7871|  25.6k|        return BLOSC2_ERROR_SUCCESS;
 7872|  25.6k|      }
 7873|  25.6k|    }
 7874|  38.4k|  }
 7875|       |
 7876|      2|  blosc2_io_cb *io_new = &g_ios[g_nio++];
 7877|      2|  memcpy(io_new, io, sizeof(blosc2_io_cb));
 7878|       |
 7879|      2|  return BLOSC2_ERROR_SUCCESS;
 7880|  25.6k|}
blosc2_error_string:
 7995|     44|const char *blosc2_error_string(int error_code) {
 7996|     44|  switch (error_code) {
 7997|     26|    case BLOSC2_ERROR_FAILURE:
  ------------------
  |  Branch (7997:5): [True: 26, False: 18]
  ------------------
 7998|     26|      return "Generic failure";
 7999|      0|    case BLOSC2_ERROR_STREAM:
  ------------------
  |  Branch (7999:5): [True: 0, False: 44]
  ------------------
 8000|      0|      return "Bad stream";
 8001|     15|    case BLOSC2_ERROR_DATA:
  ------------------
  |  Branch (8001:5): [True: 15, False: 29]
  ------------------
 8002|     15|      return "Invalid data";
 8003|      0|    case BLOSC2_ERROR_MEMORY_ALLOC:
  ------------------
  |  Branch (8003:5): [True: 0, False: 44]
  ------------------
 8004|      0|      return "Memory alloc/realloc failure";
 8005|      0|    case BLOSC2_ERROR_READ_BUFFER:
  ------------------
  |  Branch (8005:5): [True: 0, False: 44]
  ------------------
 8006|      0|      return "Not enough space to read";
 8007|      3|    case BLOSC2_ERROR_WRITE_BUFFER:
  ------------------
  |  Branch (8007:5): [True: 3, False: 41]
  ------------------
 8008|      3|      return "Not enough space to write";
 8009|      0|    case BLOSC2_ERROR_CODEC_SUPPORT:
  ------------------
  |  Branch (8009:5): [True: 0, False: 44]
  ------------------
 8010|      0|      return "Codec not supported";
 8011|      0|    case BLOSC2_ERROR_CODEC_PARAM:
  ------------------
  |  Branch (8011:5): [True: 0, False: 44]
  ------------------
 8012|      0|      return "Invalid parameter supplied to codec";
 8013|      0|    case BLOSC2_ERROR_CODEC_DICT:
  ------------------
  |  Branch (8013:5): [True: 0, False: 44]
  ------------------
 8014|      0|      return "Codec dictionary error";
 8015|      0|    case BLOSC2_ERROR_VERSION_SUPPORT:
  ------------------
  |  Branch (8015:5): [True: 0, False: 44]
  ------------------
 8016|      0|      return "Version not supported";
 8017|      0|    case BLOSC2_ERROR_INVALID_HEADER:
  ------------------
  |  Branch (8017:5): [True: 0, False: 44]
  ------------------
 8018|      0|      return "Invalid value in header";
 8019|      0|    case BLOSC2_ERROR_INVALID_PARAM:
  ------------------
  |  Branch (8019:5): [True: 0, False: 44]
  ------------------
 8020|      0|      return "Invalid parameter supplied to function";
 8021|      0|    case BLOSC2_ERROR_FILE_READ:
  ------------------
  |  Branch (8021:5): [True: 0, False: 44]
  ------------------
 8022|      0|      return "File read failure";
 8023|      0|    case BLOSC2_ERROR_FILE_WRITE:
  ------------------
  |  Branch (8023:5): [True: 0, False: 44]
  ------------------
 8024|      0|      return "File write failure";
 8025|      0|    case BLOSC2_ERROR_FILE_OPEN:
  ------------------
  |  Branch (8025:5): [True: 0, False: 44]
  ------------------
 8026|      0|      return "File open failure";
 8027|      0|    case BLOSC2_ERROR_NOT_FOUND:
  ------------------
  |  Branch (8027:5): [True: 0, False: 44]
  ------------------
 8028|      0|      return "Not found";
 8029|      0|    case BLOSC2_ERROR_RUN_LENGTH:
  ------------------
  |  Branch (8029:5): [True: 0, False: 44]
  ------------------
 8030|      0|      return "Bad run length encoding";
 8031|      0|    case BLOSC2_ERROR_FILTER_PIPELINE:
  ------------------
  |  Branch (8031:5): [True: 0, False: 44]
  ------------------
 8032|      0|      return "Filter pipeline error";
 8033|      0|    case BLOSC2_ERROR_CHUNK_INSERT:
  ------------------
  |  Branch (8033:5): [True: 0, False: 44]
  ------------------
 8034|      0|      return "Chunk insert failure";
 8035|      0|    case BLOSC2_ERROR_CHUNK_APPEND:
  ------------------
  |  Branch (8035:5): [True: 0, False: 44]
  ------------------
 8036|      0|      return "Chunk append failure";
 8037|      0|    case BLOSC2_ERROR_CHUNK_UPDATE:
  ------------------
  |  Branch (8037:5): [True: 0, False: 44]
  ------------------
 8038|      0|      return "Chunk update failure";
 8039|      0|    case BLOSC2_ERROR_2GB_LIMIT:
  ------------------
  |  Branch (8039:5): [True: 0, False: 44]
  ------------------
 8040|      0|      return "Sizes larger than 2gb not supported";
 8041|      0|    case BLOSC2_ERROR_SCHUNK_COPY:
  ------------------
  |  Branch (8041:5): [True: 0, False: 44]
  ------------------
 8042|      0|      return "Super-chunk copy failure";
 8043|      0|    case BLOSC2_ERROR_FRAME_TYPE:
  ------------------
  |  Branch (8043:5): [True: 0, False: 44]
  ------------------
 8044|      0|      return "Wrong type for frame";
 8045|      0|    case BLOSC2_ERROR_FILE_TRUNCATE:
  ------------------
  |  Branch (8045:5): [True: 0, False: 44]
  ------------------
 8046|      0|      return "File truncate failure";
 8047|      0|    case BLOSC2_ERROR_LOCK:
  ------------------
  |  Branch (8047:5): [True: 0, False: 44]
  ------------------
 8048|      0|      return "Frame lock failure";
 8049|      0|    case BLOSC2_ERROR_THREAD_CREATE:
  ------------------
  |  Branch (8049:5): [True: 0, False: 44]
  ------------------
 8050|      0|      return "Thread or thread context creation failure";
 8051|      0|    case BLOSC2_ERROR_POSTFILTER:
  ------------------
  |  Branch (8051:5): [True: 0, False: 44]
  ------------------
 8052|      0|      return "Postfilter failure";
 8053|      0|    case BLOSC2_ERROR_FRAME_SPECIAL:
  ------------------
  |  Branch (8053:5): [True: 0, False: 44]
  ------------------
 8054|      0|      return "Special frame failure";
 8055|      0|    case BLOSC2_ERROR_SCHUNK_SPECIAL:
  ------------------
  |  Branch (8055:5): [True: 0, False: 44]
  ------------------
 8056|      0|      return "Special super-chunk failure";
 8057|      0|    case BLOSC2_ERROR_PLUGIN_IO:
  ------------------
  |  Branch (8057:5): [True: 0, False: 44]
  ------------------
 8058|      0|      return "IO plugin error";
 8059|      0|    case BLOSC2_ERROR_FILE_REMOVE:
  ------------------
  |  Branch (8059:5): [True: 0, False: 44]
  ------------------
 8060|      0|      return "Remove file failure";
 8061|      0|    case BLOSC2_ERROR_NULL_POINTER:
  ------------------
  |  Branch (8061:5): [True: 0, False: 44]
  ------------------
 8062|      0|      return "Pointer is null";
 8063|      0|    case BLOSC2_ERROR_INVALID_INDEX:
  ------------------
  |  Branch (8063:5): [True: 0, False: 44]
  ------------------
 8064|      0|      return "Invalid index";
 8065|      0|    case BLOSC2_ERROR_METALAYER_NOT_FOUND:
  ------------------
  |  Branch (8065:5): [True: 0, False: 44]
  ------------------
 8066|      0|      return "Metalayer has not been found";
 8067|      0|    case BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED:
  ------------------
  |  Branch (8067:5): [True: 0, False: 44]
  ------------------
 8068|      0|      return "Maximum buffersize exceeded";
 8069|      0|    case BLOSC2_ERROR_TUNER:
  ------------------
  |  Branch (8069:5): [True: 0, False: 44]
  ------------------
 8070|      0|      return "Tuner failure";
 8071|      0|    default:
  ------------------
  |  Branch (8071:5): [True: 0, False: 44]
  ------------------
 8072|      0|      return "Unknown error";
 8073|     44|  }
 8074|     44|}
blosc2.c:shuffle_size:
  791|  78.4k|static int32_t shuffle_size(const blosc2_context* context, int i) {
  792|  78.4k|  return context->filters_meta[i] == 0 ? context->typesize : context->filters_meta[i];
  ------------------
  |  Branch (792:10): [True: 41.5k, False: 36.9k]
  ------------------
  793|  78.4k|}
blosc2.c:flags_to_filters:
  875|   195k|static void flags_to_filters(const uint8_t flags, uint8_t* filters) {
  876|       |  /* Initialize the filter pipeline */
  877|   195k|  memset(filters, 0, BLOSC2_MAX_FILTERS);
  878|       |  /* Fill the filter pipeline */
  879|   195k|  if (flags & BLOSC_DOSHUFFLE)
  ------------------
  |  Branch (879:7): [True: 176k, False: 18.9k]
  ------------------
  880|   176k|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_SHUFFLE;
  881|   195k|  if (flags & BLOSC_DOBITSHUFFLE)
  ------------------
  |  Branch (881:7): [True: 172k, False: 22.4k]
  ------------------
  882|   172k|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_BITSHUFFLE;
  883|   195k|  if (flags & BLOSC_DODELTA)
  ------------------
  |  Branch (883:7): [True: 32.0k, False: 163k]
  ------------------
  884|  32.0k|    filters[BLOSC2_MAX_FILTERS - 2] = BLOSC_DELTA;
  885|   195k|}
blosc2.c:load_codec_locked:
 1155|      4|static int load_codec_locked(blosc2_codec *codec) {
 1156|      4|  char libpath[PATH_MAX];
 1157|      4|  void *lib = load_lib(codec->compname, libpath);
 1158|      4|  if(lib == NULL) {
  ------------------
  |  Branch (1158:6): [True: 4, False: 0]
  ------------------
 1159|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1160|      4|    return BLOSC2_ERROR_FAILURE;
 1161|      4|  }
 1162|       |
 1163|      0|  codec_info *info = dlsym(lib, "info");
 1164|      0|  if (info == NULL) {
  ------------------
  |  Branch (1164:7): [True: 0, False: 0]
  ------------------
 1165|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1166|      0|    dlclose(lib);
 1167|      0|    return BLOSC2_ERROR_FAILURE;
 1168|      0|  }
 1169|      0|  void *encoder = plugin_dlsym(lib, info->encoder);
 1170|      0|  void *decoder = plugin_dlsym(lib, info->decoder);
 1171|       |
 1172|      0|  if (encoder == NULL || decoder == NULL) {
  ------------------
  |  Branch (1172:7): [True: 0, False: 0]
  |  Branch (1172:26): [True: 0, False: 0]
  ------------------
 1173|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1174|      0|    dlclose(lib);
 1175|      0|    return BLOSC2_ERROR_FAILURE;
 1176|      0|  }
 1177|      0|  codec->encoder = encoder;
 1178|      0|  store_release_ptr(&codec->decoder, decoder);
  ------------------
  |  |  145|      0|#define store_release_ptr(p, v) __atomic_store_n((p), (v), __ATOMIC_RELEASE)
  ------------------
 1179|       |
 1180|       |  /* If ever add .free function in future for codec params
 1181|       |  codecparams_info *info2 = dlsym(lib, "info2");
 1182|       |  if (info2 != NULL) {
 1183|       |    // New plugin (e.g. openzl) with free function for codec_params defined
 1184|       |    // will be used when destroying context in blosc2_free_ctx
 1185|       |      codec->free = dlsym(lib, info2->free);
 1186|       |  }
 1187|       |  else{
 1188|       |    codec->free = NULL;
 1189|       |  }
 1190|       |  */
 1191|       |
 1192|      0|  return BLOSC2_ERROR_SUCCESS;
 1193|      0|}
blosc2.c:fused_shuffle_bytedelta_size:
  799|  40.2k|static int fused_shuffle_bytedelta_size(const blosc2_context *context, int i) {
  800|  40.2k|  if (i < 0 || i + 1 >= BLOSC2_MAX_FILTERS || context->filters[i] != BLOSC_SHUFFLE ||
  ------------------
  |  Branch (800:7): [True: 8.23k, False: 32.0k]
  |  Branch (800:16): [True: 0, False: 32.0k]
  |  Branch (800:47): [True: 23.8k, False: 8.21k]
  ------------------
  801|  37.5k|      context->filters[i + 1] != BLOSC_FILTER_BYTEDELTA) {
  ------------------
  |  Branch (801:7): [True: 5.47k, False: 2.74k]
  ------------------
  802|  37.5k|    return 0;
  803|  37.5k|  }
  804|  2.74k|  int delta_size = context->filters_meta[i + 1];
  805|  2.74k|  if (delta_size == 0 && context->schunk != NULL) {
  ------------------
  |  Branch (805:7): [True: 7, False: 2.73k]
  |  Branch (805:26): [True: 0, False: 7]
  ------------------
  806|      0|    delta_size = context->schunk->typesize;
  807|      0|  }
  808|  2.74k|  int size = shuffle_size(context, i);
  809|  2.74k|  return (size == 2 || size == 4 || size == 8) && size == delta_size &&
  ------------------
  |  Branch (809:11): [True: 768, False: 1.97k]
  |  Branch (809:24): [True: 762, False: 1.21k]
  |  Branch (809:37): [True: 571, False: 645]
  |  Branch (809:51): [True: 1.46k, False: 635]
  ------------------
  810|  1.46k|         shuffle_bytedelta_available() ? size : 0;
  ------------------
  |  Branch (810:10): [True: 1.46k, False: 0]
  ------------------
  811|  40.2k|}
blosc2.c:bitshuffle_scratch:
 1322|  6.05k|static uint8_t* bitshuffle_scratch(struct thread_context* thread_context, int32_t bsize) {
 1323|  6.05k|  size_t offset = (size_t)(thread_context->tmp4 - thread_context->tmp);
 1324|  6.05k|  size_t shift = (16 - ((uintptr_t)thread_context->tmp4 & 15)) & 15;
 1325|  6.05k|  if (offset + shift + (size_t)bsize <= thread_context->tmp_nbytes) {
  ------------------
  |  Branch (1325:7): [True: 4.63k, False: 1.41k]
  ------------------
 1326|  4.63k|    return thread_context->tmp4 + shift;
 1327|  4.63k|  }
 1328|  1.41k|  if (offset + (size_t)bsize <= thread_context->tmp_nbytes) {
  ------------------
  |  Branch (1328:7): [True: 1.41k, False: 0]
  ------------------
 1329|  1.41k|    return thread_context->tmp4;
 1330|  1.41k|  }
 1331|      0|  return NULL;
 1332|  1.41k|}
blosc2.c:destroy_thread_context:
 2689|  11.3k|static void destroy_thread_context(struct thread_context* thread_context) {
 2690|  11.3k|  my_free(thread_context->tmp);
 2691|  11.3k|  free(thread_context->blosclz_state);
 2692|  11.3k|#if defined(HAVE_ZSTD)
 2693|  11.3k|  if (thread_context->zstd_cctx != NULL) {
  ------------------
  |  Branch (2693:7): [True: 0, False: 11.3k]
  ------------------
 2694|      0|    ZSTD_freeCCtx(thread_context->zstd_cctx);
 2695|      0|  }
 2696|  11.3k|  if (thread_context->zstd_dctx != NULL) {
  ------------------
  |  Branch (2696:7): [True: 5.19k, False: 6.12k]
  ------------------
 2697|  5.19k|    ZSTD_freeDCtx(thread_context->zstd_dctx);
 2698|  5.19k|  }
 2699|  11.3k|#endif
 2700|  11.3k|  if (thread_context->lz4_cstream != NULL) {
  ------------------
  |  Branch (2700:7): [True: 0, False: 11.3k]
  ------------------
 2701|      0|    LZ4_freeStream((LZ4_stream_t*)thread_context->lz4_cstream);
 2702|      0|  }
 2703|  11.3k|  if (thread_context->lz4hc_cstream != NULL) {
  ------------------
  |  Branch (2703:7): [True: 0, False: 11.3k]
  ------------------
 2704|      0|    LZ4_freeStreamHC((LZ4_streamHC_t*)thread_context->lz4hc_cstream);
 2705|      0|  }
 2706|  11.3k|}
blosc2.c:my_free:
  412|  35.4k|static void my_free(void* block) {
  413|       |#if defined(_WIN32)
  414|       |  _aligned_free(block);
  415|       |#else
  416|  35.4k|  free(block);
  417|  35.4k|#endif  /* _WIN32 */
  418|  35.4k|}
blosc2.c:filters_to_flags:
  852|  6.92k|static uint8_t filters_to_flags(const uint8_t* filters) {
  853|  6.92k|  uint8_t flags = 0;
  854|       |
  855|  48.4k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (855:19): [True: 41.5k, False: 6.92k]
  ------------------
  856|  41.5k|    switch (filters[i]) {
  857|  4.00k|      case BLOSC_SHUFFLE:
  ------------------
  |  Branch (857:7): [True: 4.00k, False: 37.5k]
  ------------------
  858|  4.00k|        flags |= BLOSC_DOSHUFFLE;
  859|  4.00k|        break;
  860|  1.77k|      case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (860:7): [True: 1.77k, False: 39.7k]
  ------------------
  861|  1.77k|        flags |= BLOSC_DOBITSHUFFLE;
  862|  1.77k|        break;
  863|  2.80k|      case BLOSC_DELTA:
  ------------------
  |  Branch (863:7): [True: 2.80k, False: 38.7k]
  ------------------
  864|  2.80k|        flags |= BLOSC_DODELTA;
  865|  2.80k|        break;
  866|  32.9k|      default :
  ------------------
  |  Branch (866:7): [True: 32.9k, False: 8.58k]
  ------------------
  867|  32.9k|        break;
  868|  41.5k|    }
  869|  41.5k|  }
  870|  6.92k|  return flags;
  871|  6.92k|}
blosc2.c:blosc2_calculate_blocks:
 1042|  12.0k|static inline void blosc2_calculate_blocks(blosc2_context* context) {
 1043|       |  /* Compute number of blocks in buffer */
 1044|  12.0k|  context->nblocks = context->sourcesize / context->blocksize;
 1045|  12.0k|  context->leftover = context->sourcesize % context->blocksize;
 1046|  12.0k|  context->nblocks = (context->leftover > 0) ?
  ------------------
  |  Branch (1046:22): [True: 2.95k, False: 9.07k]
  ------------------
 1047|  9.07k|                     (context->nblocks + 1) : context->nblocks;
 1048|  12.0k|}
blosc2.c:clibcode_to_clibname:
  445|      8|static const char* clibcode_to_clibname(int clibcode) {
  446|      8|  if (clibcode == BLOSC_BLOSCLZ_LIB) return BLOSC_BLOSCLZ_LIBNAME;
  ------------------
  |  |  367|      0|#define BLOSC_BLOSCLZ_LIBNAME   "BloscLZ"
  ------------------
  |  Branch (446:7): [True: 0, False: 8]
  ------------------
  447|      8|  if (clibcode == BLOSC_LZ4_LIB) return BLOSC_LZ4_LIBNAME;
  ------------------
  |  |  368|      0|#define BLOSC_LZ4_LIBNAME       "LZ4"
  ------------------
  |  Branch (447:7): [True: 0, False: 8]
  ------------------
  448|      8|  if (clibcode == BLOSC_ZLIB_LIB) return BLOSC_ZLIB_LIBNAME;
  ------------------
  |  |  369|      0|#define BLOSC_ZLIB_LIBNAME      "Zlib"
  ------------------
  |  Branch (448:7): [True: 0, False: 8]
  ------------------
  449|      8|  if (clibcode == BLOSC_ZSTD_LIB) return BLOSC_ZSTD_LIBNAME;
  ------------------
  |  |  370|      0|#define BLOSC_ZSTD_LIBNAME      "Zstd"
  ------------------
  |  Branch (449:7): [True: 0, False: 8]
  ------------------
  450|     80|  for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (450:19): [True: 72, False: 8]
  ------------------
  451|     72|    if (clibcode == g_codecs[i].complib)
  ------------------
  |  Branch (451:9): [True: 0, False: 72]
  ------------------
  452|      0|      return g_codecs[i].compname;
  453|     72|  }
  454|      8|  return NULL;                  /* should never happen */
  455|      8|}
blosc2.c:blosc_run_decompression_with_context:
 4515|  12.5k|                                                void* dest, int32_t destsize) {
 4516|  12.5k|  blosc_header header;
 4517|  12.5k|  int32_t ntbytes;
 4518|  12.5k|  int rc;
 4519|       |
 4520|  12.5k|  rc = read_chunk_header(src, srcsize, true, &header);
 4521|  12.5k|  if (rc < 0) {
  ------------------
  |  Branch (4521:7): [True: 90, False: 12.4k]
  ------------------
 4522|     90|    return rc;
 4523|     90|  }
 4524|       |
 4525|  12.4k|  if (header.nbytes > destsize) {
  ------------------
  |  Branch (4525:7): [True: 84, False: 12.4k]
  ------------------
 4526|       |    // Not enough space for writing into the destination
 4527|     84|    return BLOSC2_ERROR_WRITE_BUFFER;
 4528|     84|  }
 4529|       |
 4530|  12.4k|  rc = initialize_context_decompression(context, &header, src, srcsize, dest, destsize);
 4531|  12.4k|  if (rc < 0) {
  ------------------
  |  Branch (4531:7): [True: 1.09k, False: 11.3k]
  ------------------
 4532|  1.09k|    return rc;
 4533|  1.09k|  }
 4534|       |
 4535|       |  /* Do the actual decompression */
 4536|  11.3k|  ntbytes = do_job(context);
 4537|  11.3k|  if (ntbytes < 0) {
  ------------------
  |  Branch (4537:7): [True: 9.99k, False: 1.32k]
  ------------------
 4538|  9.99k|    return ntbytes;
 4539|  9.99k|  }
 4540|       |
 4541|  11.3k|  assert(ntbytes <= (int32_t)destsize);
 4542|  1.32k|  return ntbytes;
 4543|  11.3k|}
blosc2.c:initialize_context_decompression:
 3206|  12.4k|                                            int32_t srcsize, void* dest, int32_t destsize) {
 3207|  12.4k|  int32_t bstarts_end;
 3208|  12.4k|  bool vlblocks;
 3209|       |
 3210|  12.4k|  context->do_compress = 0;
 3211|  12.4k|  context->src = (const uint8_t*)src;
 3212|  12.4k|  context->srcsize = srcsize;
 3213|  12.4k|  context->dest = (uint8_t*)dest;
 3214|  12.4k|  context->destsize = destsize;
 3215|  12.4k|  context->output_bytes = 0;
 3216|  12.4k|  context->vlblock_sources = NULL;
 3217|  12.4k|  context->vlblock_dests = NULL;
 3218|  12.4k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (3218:7): [True: 0, False: 12.4k]
  ------------------
 3219|      0|    free(context->blocknbytes);
 3220|      0|    context->blocknbytes = NULL;
 3221|      0|  }
 3222|  12.4k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (3222:7): [True: 0, False: 12.4k]
  ------------------
 3223|      0|    free(context->blockoffsets);
 3224|      0|    context->blockoffsets = NULL;
 3225|      0|  }
 3226|  12.4k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (3226:7): [True: 0, False: 12.4k]
  ------------------
 3227|      0|    free(context->blockcbytes);
 3228|      0|    context->blockcbytes = NULL;
 3229|      0|  }
 3230|       |
 3231|  12.4k|  int rc = blosc2_initialize_context_from_header(context, header);
 3232|  12.4k|  if (rc < 0) {
  ------------------
  |  Branch (3232:7): [True: 0, False: 12.4k]
  ------------------
 3233|      0|    return rc;
 3234|      0|  }
 3235|  12.4k|  clear_context_decompression_dict(context);
 3236|  12.4k|  vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 3237|  12.4k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (3237:19): [True: 6.92k, False: 5.49k]
  ------------------
 3238|  6.92k|                  (context->blosc2_flags & 0x08u));
  ------------------
  |  Branch (3238:19): [True: 255, False: 6.66k]
  ------------------
 3239|       |
 3240|       |  /* Check that we have enough space to decompress */
 3241|  12.4k|  if (context->sourcesize > (int32_t)context->destsize) {
  ------------------
  |  Branch (3241:7): [True: 0, False: 12.4k]
  ------------------
 3242|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 3243|      0|  }
 3244|       |
 3245|  12.4k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (3245:7): [True: 0, False: 12.4k]
  ------------------
 3246|      0|    if (context->block_maskout_nitems != context->nblocks) {
  ------------------
  |  Branch (3246:9): [True: 0, False: 0]
  ------------------
 3247|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3248|      0|                        " of blocks in chunk (%d).",
 3249|      0|                        context->block_maskout_nitems, context->nblocks);
 3250|      0|      return BLOSC2_ERROR_DATA;
 3251|      0|    }
 3252|      0|    if (filters_contain(context->filters, BLOSC_DELTA)) {
  ------------------
  |  Branch (3252:9): [True: 0, False: 0]
  ------------------
 3253|      0|      bool any_needed = false;
 3254|      0|      for (int i = 0; i < context->block_maskout_nitems; ++i) {
  ------------------
  |  Branch (3254:23): [True: 0, False: 0]
  ------------------
 3255|      0|        if (!context->block_maskout[i]) {
  ------------------
  |  Branch (3255:13): [True: 0, False: 0]
  ------------------
 3256|      0|          any_needed = true;
 3257|      0|          break;
 3258|      0|        }
 3259|      0|      }
 3260|      0|      if (any_needed) {
  ------------------
  |  Branch (3260:11): [True: 0, False: 0]
  ------------------
 3261|       |        // Delta filter encodes subsequent blocks relative to block 0; block 0 must be unmasked.
 3262|      0|        context->block_maskout[0] = false;
 3263|      0|      }
 3264|      0|    }
 3265|      0|  }
 3266|       |
 3267|  12.4k|  context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
 3268|  12.4k|  if (context->special_type > BLOSC2_SPECIAL_LASTID) {
  ------------------
  |  Branch (3268:7): [True: 2, False: 12.4k]
  ------------------
 3269|      2|    BLOSC_TRACE_ERROR("Unknown special values ID (%d) ",
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3270|      2|                      context->special_type);
 3271|      2|    return BLOSC2_ERROR_DATA;
 3272|      2|  }
 3273|       |
 3274|  12.4k|  int memcpyed = (context->header_flags & (uint8_t) BLOSC_MEMCPYED);
 3275|  12.4k|  if (memcpyed && (header->cbytes != header->nbytes + context->header_overhead)) {
  ------------------
  |  Branch (3275:7): [True: 65, False: 12.3k]
  |  Branch (3275:19): [True: 30, False: 35]
  ------------------
 3276|     30|    BLOSC_TRACE_ERROR("Wrong header info for this memcpyed chunk");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3277|     30|    return BLOSC2_ERROR_DATA;
 3278|     30|  }
 3279|       |
 3280|  12.3k|  if ((header->nbytes == 0) && (header->cbytes == context->header_overhead) &&
  ------------------
  |  Branch (3280:7): [True: 0, False: 12.3k]
  |  Branch (3280:32): [True: 0, False: 0]
  ------------------
 3281|      0|      !context->special_type) {
  ------------------
  |  Branch (3281:7): [True: 0, False: 0]
  ------------------
 3282|       |    // A compressed buffer with only a header can only contain a zero-length buffer
 3283|      0|    return 0;
 3284|      0|  }
 3285|       |
 3286|  12.3k|  context->bstarts = (int32_t *) (context->src + context->header_overhead);
 3287|  12.3k|  bstarts_end = context->header_overhead;
 3288|  12.3k|  if (!context->special_type && !memcpyed) {
  ------------------
  |  Branch (3288:7): [True: 12.1k, False: 251]
  |  Branch (3288:33): [True: 12.0k, False: 34]
  ------------------
 3289|  12.0k|    size_t bstarts_end_tmp;
 3290|  12.0k|    size_t bstarts_nbytes;
 3291|  12.0k|    if (context->nblocks < 0 ||
  ------------------
  |  Branch (3291:9): [True: 0, False: 12.0k]
  ------------------
 3292|  12.0k|        !blosc2_checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (3292:9): [True: 0, False: 12.0k]
  ------------------
 3293|  12.0k|        !blosc2_checked_add_size((size_t)context->header_overhead, bstarts_nbytes, &bstarts_end_tmp) ||
  ------------------
  |  Branch (3293:9): [True: 0, False: 12.0k]
  ------------------
 3294|  12.0k|        bstarts_end_tmp > (size_t)INT32_MAX) {
  ------------------
  |  Branch (3294:9): [True: 0, False: 12.0k]
  ------------------
 3295|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3296|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 3297|      0|    }
 3298|       |    /* If chunk is not special or a memcpyed, we do have a bstarts section */
 3299|  12.0k|    bstarts_end = (int32_t)bstarts_end_tmp;
 3300|  12.0k|  }
 3301|       |
 3302|  12.3k|  if (srcsize < bstarts_end) {
  ------------------
  |  Branch (3302:7): [True: 66, False: 12.3k]
  ------------------
 3303|     66|    BLOSC_TRACE_ERROR("`bstarts` exceeds length of source buffer.");
  ------------------
  |  |   93|     66|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     66|    do {                                            \
  |  |  |  |   98|     66|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     66|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 66, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     66|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3304|     66|    return BLOSC2_ERROR_READ_BUFFER;
 3305|     66|  }
 3306|       |
 3307|  12.3k|  if (vlblocks && is_lazy && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (3307:7): [True: 331, False: 11.9k]
  |  Branch (3307:19): [True: 137, False: 194]
  |  Branch (3307:30): [True: 137, False: 0]
  |  Branch (3307:56): [True: 137, False: 0]
  ------------------
 3308|    137|    size_t block_csizes_nbytes;
 3309|    137|    size_t trailer_meta_nbytes;
 3310|    137|    size_t lazy_trailer_end;
 3311|    137|    if (context->srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (3311:9): [True: 0, False: 137]
  |  Branch (3311:33): [True: 0, False: 137]
  ------------------
 3312|    137|        !blosc2_checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (3312:9): [True: 0, False: 137]
  ------------------
 3313|    137|        !blosc2_checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (3313:9): [True: 0, False: 137]
  ------------------
 3314|    137|        !blosc2_checked_add_size((size_t)bstarts_end, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (3314:9): [True: 0, False: 137]
  ------------------
 3315|    137|        (size_t)context->srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (3315:9): [True: 16, False: 121]
  ------------------
 3316|     16|      BLOSC_TRACE_ERROR("Lazy trailer exceeds source buffer.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3317|     16|      return BLOSC2_ERROR_READ_BUFFER;
 3318|     16|    }
 3319|    137|  }
 3320|  12.2k|  srcsize -= bstarts_end;
 3321|       |
 3322|       |  /* Read optional dictionary if flag set.  A memcpyed chunk has none, even if the flag says so
 3323|       |     (older versions left it on chunks with a dictionary that did not compress) */
 3324|  12.2k|  if ((context->blosc2_flags & BLOSC2_USEDICT) && !memcpyed && !is_lazy) {
  ------------------
  |  Branch (3324:7): [True: 3.39k, False: 8.90k]
  |  Branch (3324:51): [True: 3.39k, False: 2]
  |  Branch (3324:64): [True: 3.35k, False: 40]
  ------------------
 3325|  3.35k|    context->use_dict = 1;
 3326|       |    // The dictionary section is after the bstarts block: [int32 size | raw bytes]
 3327|  3.35k|    if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (3327:9): [True: 2, False: 3.35k]
  ------------------
 3328|      2|      BLOSC_TRACE_ERROR("Not enough space to read size of dictionary.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3329|      2|      return BLOSC2_ERROR_READ_BUFFER;
 3330|      2|    }
 3331|  3.35k|    srcsize -= sizeof(int32_t);
 3332|       |    // Read dictionary size
 3333|  3.35k|    context->dict_size = sw32_(context->src + bstarts_end);
 3334|  3.35k|    if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (3334:9): [True: 34, False: 3.31k]
  |  Branch (3334:36): [True: 24, False: 3.29k]
  ------------------
 3335|     58|      BLOSC_TRACE_ERROR("Dictionary size is smaller than minimum or larger than maximum allowed.");
  ------------------
  |  |   93|     58|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     58|    do {                                            \
  |  |  |  |   98|     58|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     58|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 58, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     58|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3336|     58|      return BLOSC2_ERROR_CODEC_DICT;
 3337|     58|    }
 3338|  3.29k|    if (srcsize < (int32_t)context->dict_size) {
  ------------------
  |  Branch (3338:9): [True: 16, False: 3.27k]
  ------------------
 3339|     16|      BLOSC_TRACE_ERROR("Not enough space to read entire dictionary.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3340|     16|      return BLOSC2_ERROR_READ_BUFFER;
 3341|     16|    }
 3342|  3.27k|    srcsize -= context->dict_size;
 3343|       |    // dict_buffer points directly into the source chunk — no copy needed
 3344|  3.27k|    context->dict_buffer = (void*)(context->src + bstarts_end + sizeof(int32_t));
 3345|  3.27k|    context->dict_buffer_owned = false;
 3346|  3.27k|#if defined(HAVE_ZSTD)
 3347|       |    // context->compcode during decompression holds the format code (flags >> 5),
 3348|       |    // so compare against BLOSC_ZSTD_FORMAT (not BLOSC_ZSTD).
 3349|  3.27k|    if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (3349:9): [True: 2.48k, False: 789]
  ------------------
 3350|  2.48k|      context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 3351|  2.48k|      if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (3351:11): [True: 578, False: 1.91k]
  ------------------
 3352|    578|        BLOSC_TRACE_ERROR("Cannot create ZSTD dictionary for chunk.");
  ------------------
  |  |   93|    578|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    578|    do {                                            \
  |  |  |  |   98|    578|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    578|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 578, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    578|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3353|    578|        return BLOSC2_ERROR_CODEC_DICT;
 3354|    578|      }
 3355|  2.48k|    }
 3356|  3.27k|#endif   // HAVE_ZSTD
 3357|       |    // For LZ4/LZ4HC: dict_buffer and dict_size are sufficient; no digested object needed.
 3358|  3.27k|  }
 3359|  8.94k|  else if ((context->blosc2_flags & BLOSC2_USEDICT) && !memcpyed && is_lazy) {
  ------------------
  |  Branch (3359:12): [True: 42, False: 8.90k]
  |  Branch (3359:56): [True: 40, False: 2]
  |  Branch (3359:69): [True: 40, False: 0]
  ------------------
 3360|     40|    rc = load_lazy_chunk_dict(context, header, bstarts_end);
 3361|     40|    if (rc < 0) {
  ------------------
  |  Branch (3361:9): [True: 40, False: 0]
  ------------------
 3362|     40|      return rc;
 3363|     40|    }
 3364|     40|  }
 3365|       |
 3366|  11.6k|  if (vlblocks && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (3366:7): [True: 314, False: 11.2k]
  |  Branch (3366:19): [True: 314, False: 0]
  |  Branch (3366:45): [True: 314, False: 0]
  ------------------
 3367|    314|    context->blocknbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 3368|    314|    BLOSC_ERROR_NULL(context->blocknbytes, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    314|    do {                                            \
  |  |  105|    314|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 314]
  |  |  ------------------
  |  |  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|    314|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 314]
  |  |  ------------------
  ------------------
 3369|    314|    context->blockoffsets = malloc((size_t)context->nblocks * sizeof(int32_t));
 3370|    314|    BLOSC_ERROR_NULL(context->blockoffsets, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    314|    do {                                            \
  |  |  105|    314|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 314]
  |  |  ------------------
  |  |  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|    314|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 314]
  |  |  ------------------
  ------------------
 3371|    314|    context->blockcbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 3372|    314|    BLOSC_ERROR_NULL(context->blockcbytes, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    314|    do {                                            \
  |  |  105|    314|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 314]
  |  |  ------------------
  |  |  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|    314|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 314]
  |  |  ------------------
  ------------------
 3373|       |
 3374|    314|    if (is_lazy) {
  ------------------
  |  Branch (3374:9): [True: 120, False: 194]
  ------------------
 3375|       |      // Lazy VL: block data is on disk, so blocknbytes is unknown at this point.
 3376|       |      // Populate blockcbytes from bstarts differences; blocksize gets max(blockcbytes)
 3377|       |      // as a safe upper bound so tmp buffers are large enough for the lazy block read.
 3378|    120|      int32_t max_csize = 0;
 3379|    166|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (3379:27): [True: 146, False: 20]
  ------------------
 3380|    146|        int32_t bstart = sw32_(context->bstarts + i);
 3381|    146|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (3381:31): [True: 82, False: 64]
  ------------------
 3382|     82|            sw32_(context->bstarts + i + 1) : header->cbytes;
 3383|    146|        if (bstart < bstarts_end || next_bstart <= bstart ||
  ------------------
  |  Branch (3383:13): [True: 7, False: 139]
  |  Branch (3383:37): [True: 41, False: 98]
  ------------------
 3384|    100|            next_bstart > header->cbytes) {
  ------------------
  |  Branch (3384:13): [True: 52, False: 46]
  ------------------
 3385|    100|          BLOSC_TRACE_ERROR("Invalid VL-block offsets in lazy chunk.");
  ------------------
  |  |   93|    100|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    100|    do {                                            \
  |  |  |  |   98|    100|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    100|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 100, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    100|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3386|    100|          return BLOSC2_ERROR_INVALID_HEADER;
 3387|    100|        }
 3388|     46|        context->blocknbytes[i] = 0;   // unknown until block is read from disk
 3389|     46|        context->blockoffsets[i] = 0;  // unknown
 3390|     46|        context->blockcbytes[i] = next_bstart - bstart;
 3391|     46|        if (context->blockcbytes[i] > max_csize) {
  ------------------
  |  Branch (3391:13): [True: 33, False: 13]
  ------------------
 3392|     33|          max_csize = context->blockcbytes[i];
 3393|     33|        }
 3394|     46|      }
 3395|     20|      context->blocksize = max_csize;
 3396|     20|      context->leftover = 0;
 3397|     20|    }
 3398|    194|    else {
 3399|    194|      int32_t max_blocksize = 0;
 3400|    194|      int64_t total_nbytes = 0;
 3401|    194|      int32_t prev_bstart = 0;
 3402|    234|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (3402:27): [True: 219, False: 15]
  ------------------
 3403|    219|        int32_t bstart = sw32_(context->bstarts + i);
 3404|    219|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (3404:31): [True: 85, False: 134]
  ------------------
 3405|    134|            sw32_(context->bstarts + i + 1) : header->cbytes;
 3406|    219|        if (bstart < bstarts_end || bstart <= prev_bstart || next_bstart <= bstart ||
  ------------------
  |  Branch (3406:13): [True: 4, False: 215]
  |  Branch (3406:37): [True: 0, False: 215]
  |  Branch (3406:62): [True: 44, False: 171]
  ------------------
 3407|    171|            next_bstart > header->cbytes || bstart > context->srcsize - (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (3407:13): [True: 50, False: 121]
  |  Branch (3407:45): [True: 2, False: 119]
  ------------------
 3408|    100|          BLOSC_TRACE_ERROR("Invalid VL-block offsets in chunk.");
  ------------------
  |  |   93|    100|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    100|    do {                                            \
  |  |  |  |   98|    100|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    100|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 100, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    100|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3409|    100|          return BLOSC2_ERROR_INVALID_HEADER;
 3410|    100|        }
 3411|    119|        context->blocknbytes[i] = sw32_(context->src + bstart);
 3412|    119|        context->blockcbytes[i] = next_bstart - bstart;
 3413|    119|        if (context->blocknbytes[i] <= 0) {
  ------------------
  |  Branch (3413:13): [True: 31, False: 88]
  ------------------
 3414|     31|          BLOSC_TRACE_ERROR("Invalid VL-block uncompressed size in chunk.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3415|     31|          return BLOSC2_ERROR_INVALID_HEADER;
 3416|     31|        }
 3417|     88|        if (total_nbytes > INT32_MAX) {
  ------------------
  |  Branch (3417:13): [True: 0, False: 88]
  ------------------
 3418|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3419|      0|          return BLOSC2_ERROR_INVALID_HEADER;
 3420|      0|        }
 3421|     88|        context->blockoffsets[i] = (int32_t)total_nbytes;
 3422|     88|        total_nbytes += context->blocknbytes[i];
 3423|     88|        if (total_nbytes > context->sourcesize) {
  ------------------
  |  Branch (3423:13): [True: 48, False: 40]
  ------------------
 3424|     48|          BLOSC_TRACE_ERROR("VL-block sizes exceed chunk nbytes.");
  ------------------
  |  |   93|     48|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     48|    do {                                            \
  |  |  |  |   98|     48|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     48|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 48, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     48|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3425|     48|          return BLOSC2_ERROR_INVALID_HEADER;
 3426|     48|        }
 3427|     40|        if (context->blocknbytes[i] > max_blocksize) {
  ------------------
  |  Branch (3427:13): [True: 32, False: 8]
  ------------------
 3428|     32|          max_blocksize = context->blocknbytes[i];
 3429|     32|        }
 3430|     40|        prev_bstart = bstart;
 3431|     40|      }
 3432|     15|      if (total_nbytes != context->sourcesize) {
  ------------------
  |  Branch (3432:11): [True: 6, False: 9]
  ------------------
 3433|      6|        BLOSC_TRACE_ERROR("VL-block sizes do not add up to chunk nbytes.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3434|      6|        return BLOSC2_ERROR_INVALID_HEADER;
 3435|      6|      }
 3436|      9|      context->blocksize = max_blocksize;
 3437|      9|      context->leftover = 0;
 3438|      9|    }
 3439|    314|  }
 3440|       |
 3441|  11.3k|  return 0;
 3442|  11.6k|}
blosc2.c:load_lazy_chunk_dict:
 3152|     40|static int load_lazy_chunk_dict(blosc2_context* context, blosc_header* header, int32_t bstarts_end) {
 3153|     40|  int32_t dict_offset = bstarts_end;
 3154|     40|  if (header->cbytes < dict_offset + (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (3154:7): [True: 1, False: 39]
  ------------------
 3155|      1|    BLOSC_TRACE_ERROR("Lazy chunk dictionary header exceeds chunk length.");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3156|      1|    return BLOSC2_ERROR_INVALID_HEADER;
 3157|      1|  }
 3158|       |
 3159|     39|  uint8_t dict_size_buf[sizeof(int32_t)];
 3160|     39|  int rc = read_lazy_chunk_bytes(context, dict_offset, dict_size_buf, (int32_t)sizeof(dict_size_buf),
 3161|     39|                                 "Cannot open frame file for lazy chunk dictionary read.",
 3162|     39|                                 "Cannot read lazy chunk dictionary size from disk.");
 3163|     39|  if (rc < 0) {
  ------------------
  |  Branch (3163:7): [True: 39, False: 0]
  ------------------
 3164|     39|    return rc;
 3165|     39|  }
 3166|       |
 3167|      0|  context->dict_size = sw32_(dict_size_buf);
 3168|      0|  if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (3168:7): [True: 0, False: 0]
  |  Branch (3168:34): [True: 0, False: 0]
  ------------------
 3169|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3170|      0|    return BLOSC2_ERROR_CODEC_DICT;
 3171|      0|  }
 3172|      0|  if (header->cbytes < dict_offset + (int32_t)sizeof(int32_t) + context->dict_size) {
  ------------------
  |  Branch (3172:7): [True: 0, False: 0]
  ------------------
 3173|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3174|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 3175|      0|  }
 3176|       |
 3177|      0|  context->dict_buffer = malloc((size_t)context->dict_size);
 3178|      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]
  |  |  ------------------
  ------------------
 3179|      0|  context->dict_buffer_owned = true;
 3180|      0|  rc = read_lazy_chunk_bytes(context, dict_offset + (int32_t)sizeof(int32_t),
 3181|      0|                             context->dict_buffer, context->dict_size,
 3182|      0|                             "Cannot open frame file for lazy chunk dictionary read.",
 3183|      0|                             "Cannot read lazy chunk dictionary from disk.");
 3184|      0|  if (rc < 0) {
  ------------------
  |  Branch (3184:7): [True: 0, False: 0]
  ------------------
 3185|      0|    release_context_dict_buffer(context);
 3186|      0|    return rc;
 3187|      0|  }
 3188|       |
 3189|      0|  context->use_dict = 1;
 3190|      0|#if defined(HAVE_ZSTD)
 3191|      0|  if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (3191:7): [True: 0, False: 0]
  ------------------
 3192|      0|    context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 3193|      0|    if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (3193:9): [True: 0, False: 0]
  ------------------
 3194|      0|      release_context_dict_buffer(context);
 3195|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3196|      0|      return BLOSC2_ERROR_CODEC_DICT;
 3197|      0|    }
 3198|      0|  }
 3199|      0|#endif
 3200|       |
 3201|      0|  return 0;
 3202|      0|}
blosc2.c:do_job:
 2836|  11.3k|static int do_job(blosc2_context* context) {
 2837|  11.3k|  int32_t ntbytes;
 2838|       |
 2839|       |  /* Set sentinels */
 2840|  11.3k|  context->dref_not_init = 1;
 2841|       |
 2842|       |  /* Apply thread-count changes before deciding whether this operation actually
 2843|       |     needs a parallel backend.  POSIX defers backend startup for serial jobs.
 2844|       |     Windows keeps its existing per-context thread lifecycle and starts/rebinds
 2845|       |     the backend eagerly. */
 2846|       |#if defined(_WIN32)
 2847|       |  int rc = check_nthreads(context, true);
 2848|       |#else
 2849|  11.3k|  int rc = check_nthreads(context, false);
 2850|  11.3k|#endif
 2851|       |
 2852|       |  /* Run serially with one thread, with fewer than two full blocks of source
 2853|       |     data, or if thread configuration/backend setup fails. */
 2854|  11.3k|  if (context->nthreads == 1 || (context->sourcesize / context->blocksize) <= 1 || rc < 0) {
  ------------------
  |  Branch (2854:7): [True: 11.3k, False: 0]
  |  Branch (2854:33): [True: 0, False: 0]
  |  Branch (2854:84): [True: 0, False: 0]
  ------------------
 2855|  11.3k|    ntbytes = run_serial_job(context);
 2856|  11.3k|  }
 2857|      0|  else {
 2858|      0|    rc = check_nthreads(context, true);
 2859|      0|    if (rc < 0) {
  ------------------
  |  Branch (2859:9): [True: 0, False: 0]
  ------------------
 2860|       |      /* Backend startup failed; run serially and retry on the next parallel job. */
 2861|      0|      ntbytes = run_serial_job(context);
 2862|      0|    }
 2863|      0|    else {
 2864|      0|      ntbytes = parallel_blosc(context);
 2865|      0|    }
 2866|      0|  }
 2867|       |
 2868|  11.3k|  return ntbytes;
 2869|  11.3k|}
blosc2.c:run_serial_job:
 2824|  11.3k|static int run_serial_job(blosc2_context* context) {
 2825|  11.3k|  struct thread_context* thread_context = serial_context_get(context);
 2826|  11.3k|  if (thread_context == NULL) {
  ------------------
  |  Branch (2826:7): [True: 0, False: 11.3k]
  ------------------
 2827|      0|    return BLOSC2_ERROR_THREAD_CREATE;
 2828|      0|  }
 2829|  11.3k|  int ntbytes = serial_blosc(thread_context);
 2830|  11.3k|  serial_context_put(thread_context);
 2831|  11.3k|  return ntbytes;
 2832|  11.3k|}
blosc2.c:serial_blosc:
 2571|  11.3k|static int serial_blosc(struct thread_context* thread_context) {
 2572|  11.3k|  blosc2_context* context = thread_context->parent_context;
 2573|  11.3k|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2574|  11.3k|  int32_t j, bsize, leftoverblock;
 2575|  11.3k|  int32_t cbytes;
 2576|  11.3k|  int32_t ntbytes = context->output_bytes;
 2577|  11.3k|  int32_t* bstarts = context->bstarts;
 2578|  11.3k|  uint8_t* tmp = thread_context->tmp;
 2579|  11.3k|  uint8_t* tmp2 = thread_context->tmp2;
 2580|  11.3k|  int dict_training = context->use_dict && (context->dict_cdict == NULL);
  ------------------
  |  Branch (2580:23): [True: 2.70k, False: 8.61k]
  |  Branch (2580:44): [True: 2.70k, False: 0]
  ------------------
 2581|  11.3k|  bool memcpyed = context->header_flags & (uint8_t)BLOSC_MEMCPYED;
 2582|  11.3k|  if (!context->do_compress && context->special_type) {
  ------------------
  |  Branch (2582:7): [True: 11.3k, False: 0]
  |  Branch (2582:32): [True: 174, False: 11.1k]
  ------------------
 2583|       |    // Fake a runlen as if it was a memcpyed chunk
 2584|    174|    memcpyed = true;
 2585|    174|  }
 2586|       |
 2587|   159k|  for (j = 0; j < context->nblocks; j++) {
  ------------------
  |  Branch (2587:15): [True: 158k, False: 1.32k]
  ------------------
 2588|   158k|    if (context->do_compress && !memcpyed && !dict_training) {
  ------------------
  |  Branch (2588:9): [True: 0, False: 158k]
  |  Branch (2588:33): [True: 0, False: 0]
  |  Branch (2588:46): [True: 0, False: 0]
  ------------------
 2589|      0|      _sw32(bstarts + j, ntbytes);
 2590|      0|    }
 2591|   158k|    bsize = vlblocks ? context->blocknbytes[j] : context->blocksize;
  ------------------
  |  Branch (2591:13): [True: 30, False: 158k]
  ------------------
 2592|   158k|    leftoverblock = 0;
 2593|   158k|    if (!vlblocks && (j == context->nblocks - 1) && (context->leftover > 0)) {
  ------------------
  |  Branch (2593:9): [True: 158k, False: 30]
  |  Branch (2593:22): [True: 8.98k, False: 149k]
  |  Branch (2593:53): [True: 636, False: 8.35k]
  ------------------
 2594|    636|      bsize = context->leftover;
 2595|    636|      leftoverblock = 1;
 2596|    636|    }
 2597|   158k|    if (context->do_compress) {
  ------------------
  |  Branch (2597:9): [True: 0, False: 158k]
  ------------------
 2598|      0|      if (memcpyed && !context->prefilter) {
  ------------------
  |  Branch (2598:11): [True: 0, False: 0]
  |  Branch (2598:23): [True: 0, False: 0]
  ------------------
 2599|       |        /* We want to memcpy only */
 2600|      0|        memcpy(context->dest + context->header_overhead + j * context->blocksize,
 2601|      0|               context->src + j * context->blocksize, (unsigned int)bsize);
 2602|      0|        cbytes = (int32_t)bsize;
 2603|      0|      }
 2604|      0|      else {
 2605|       |        /* Regular compression */
 2606|      0|        cbytes = blosc_c(thread_context, bsize, leftoverblock, ntbytes,
 2607|      0|                         context->destsize,
 2608|      0|                         vlblocks ? context->vlblock_sources[j] : context->src,
  ------------------
  |  Branch (2608:26): [True: 0, False: 0]
  ------------------
 2609|      0|                         vlblocks ? 0 : j * context->blocksize,
  ------------------
  |  Branch (2609:26): [True: 0, False: 0]
  ------------------
 2610|      0|                         context->dest + ntbytes, tmp, tmp2);
 2611|      0|        if (cbytes == 0) {
  ------------------
  |  Branch (2611:13): [True: 0, False: 0]
  ------------------
 2612|      0|          ntbytes = 0;              /* incompressible data */
 2613|      0|          break;
 2614|      0|        }
 2615|      0|      }
 2616|      0|    }
 2617|   158k|    else {
 2618|       |      /* Regular decompression */
 2619|       |      // If memcpyed we don't have a bstarts section (because it is not needed)
 2620|   158k|      int32_t src_offset = memcpyed ?
  ------------------
  |  Branch (2620:28): [True: 134k, False: 24.1k]
  ------------------
 2621|   134k|          context->header_overhead + j * context->blocksize : sw32_(bstarts + j);
 2622|   158k|      uint8_t *dest_block = (vlblocks && context->vlblock_dests != NULL) ? context->vlblock_dests[j] : context->dest;
  ------------------
  |  Branch (2622:30): [True: 30, False: 158k]
  |  Branch (2622:42): [True: 0, False: 30]
  ------------------
 2623|   158k|      int32_t dest_offset = (vlblocks && context->vlblock_dests != NULL) ? 0 :
  ------------------
  |  Branch (2623:30): [True: 30, False: 158k]
  |  Branch (2623:42): [True: 0, False: 30]
  ------------------
 2624|   158k|                            (vlblocks ? context->blockoffsets[j] : j * context->blocksize);
  ------------------
  |  Branch (2624:30): [True: 30, False: 158k]
  ------------------
 2625|   158k|      cbytes = blosc_d(thread_context, bsize, leftoverblock, memcpyed,
 2626|   158k|                       context->src, context->srcsize, src_offset, j,
 2627|   158k|                       dest_block, dest_offset, tmp, tmp2);
 2628|   158k|    }
 2629|       |
 2630|   158k|    if (cbytes < 0) {
  ------------------
  |  Branch (2630:9): [True: 9.99k, False: 148k]
  ------------------
 2631|  9.99k|      ntbytes = cbytes;         /* error in blosc_c or blosc_d */
 2632|  9.99k|      break;
 2633|  9.99k|    }
 2634|   148k|    ntbytes += cbytes;
 2635|   148k|  }
 2636|       |
 2637|  11.3k|  return ntbytes;
 2638|  11.3k|}
blosc2.c:read_lazy_chunk_bytes:
 3064|     39|                                 const char* open_error, const char* read_error) {
 3065|     39|  int32_t chunk_cbytes;
 3066|     39|  if (context->src == NULL || context->srcsize < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (3066:7): [True: 0, False: 39]
  |  Branch (3066:31): [True: 0, False: 39]
  ------------------
 3067|     39|      offset < 0 || nbytes < 0 || context->nblocks <= 0 ||
  ------------------
  |  Branch (3067:7): [True: 0, False: 39]
  |  Branch (3067:21): [True: 0, False: 39]
  |  Branch (3067:35): [True: 0, False: 39]
  ------------------
 3068|     39|      blosc2_cbuffer_sizes(context->src, NULL, &chunk_cbytes, NULL) < 0 ||
  ------------------
  |  Branch (3068:7): [True: 0, False: 39]
  ------------------
 3069|     39|      offset > chunk_cbytes || nbytes > chunk_cbytes - offset) {
  ------------------
  |  Branch (3069:7): [True: 0, False: 39]
  |  Branch (3069:32): [True: 0, False: 39]
  ------------------
 3070|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 3071|      0|  }
 3072|     39|  int64_t trailer_end = BLOSC_EXTENDED_HEADER_LENGTH +
 3073|     39|      (int64_t)context->nblocks * sizeof(int32_t) + sizeof(int32_t) + sizeof(int64_t);
 3074|     39|  if (trailer_end > context->srcsize) return BLOSC2_ERROR_READ_BUFFER;
  ------------------
  |  Branch (3074:7): [True: 16, False: 23]
  ------------------
 3075|     23|  if (context->schunk == NULL || context->schunk->frame == NULL) {
  ------------------
  |  Branch (3075:7): [True: 23, False: 0]
  |  Branch (3075:34): [True: 0, False: 0]
  ------------------
 3076|     23|    BLOSC_TRACE_ERROR("Lazy chunk needs an associated super-chunk with a frame.");
  ------------------
  |  |   93|     23|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     23|    do {                                            \
  |  |  |  |   98|     23|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     23|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 23, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     23|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3077|     23|    return BLOSC2_ERROR_INVALID_PARAM;
 3078|     23|  }
 3079|       |
 3080|      0|  blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 3081|      0|  blosc2_io_cb* io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 3082|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (3082:7): [True: 0, False: 0]
  ------------------
 3083|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3084|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 3085|      0|  }
 3086|       |
 3087|      0|  int32_t trailer_offset = BLOSC_EXTENDED_HEADER_LENGTH +
 3088|      0|                           context->nblocks * (int32_t)sizeof(int32_t);
 3089|      0|  int32_t nchunk_lazy;
 3090|      0|  int64_t chunk_offset;
 3091|      0|  memcpy(&nchunk_lazy, context->src + trailer_offset, sizeof(nchunk_lazy));
 3092|      0|  memcpy(&chunk_offset, context->src + trailer_offset + (int32_t)sizeof(int32_t), sizeof(chunk_offset));
 3093|      0|  if (nchunk_lazy < 0 || chunk_offset < 0 || frame->file_offset < 0 ||
  ------------------
  |  Branch (3093:7): [True: 0, False: 0]
  |  Branch (3093:26): [True: 0, False: 0]
  |  Branch (3093:46): [True: 0, False: 0]
  ------------------
 3094|      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 (3094:8): [True: 0, False: 0]
  |  Branch (3094:27): [True: 0, False: 0]
  ------------------
 3095|      0|       chunk_offset > frame->len || chunk_cbytes > frame->len - chunk_offset))) {
  ------------------
  |  Branch (3095:8): [True: 0, False: 0]
  |  Branch (3095:37): [True: 0, False: 0]
  ------------------
 3096|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 3097|      0|  }
 3098|       |
 3099|      0|  void* fp = NULL;
 3100|      0|  int64_t io_pos;
 3101|      0|  if (frame->sframe) {
  ------------------
  |  Branch (3101:7): [True: 0, False: 0]
  ------------------
 3102|      0|    fp = sframe_open_chunk(frame->urlpath, nchunk_lazy, "rb", context->schunk->storage->io);
 3103|      0|    io_pos = offset;
 3104|      0|  }
 3105|      0|  else {
 3106|      0|    if (chunk_offset < 0 || offset < 0) {
  ------------------
  |  Branch (3106:9): [True: 0, False: 0]
  |  Branch (3106:29): [True: 0, False: 0]
  ------------------
 3107|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3108|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 3109|      0|    }
 3110|      0|    fp = frame_reader_acquire(frame, context->schunk->storage->io);
 3111|      0|    if (!blosc2_checked_add_i64(frame->file_offset, chunk_offset, &io_pos)) {
  ------------------
  |  Branch (3111:9): [True: 0, False: 0]
  ------------------
 3112|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3113|      0|      if (fp != NULL) {
  ------------------
  |  Branch (3113:11): [True: 0, False: 0]
  ------------------
 3114|      0|        frame_reader_release(frame, io_cb, fp);
 3115|      0|      }
 3116|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 3117|      0|    }
 3118|      0|    if (!blosc2_checked_add_i64(io_pos, offset, &io_pos)) {
  ------------------
  |  Branch (3118:9): [True: 0, False: 0]
  ------------------
 3119|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3120|      0|      if (fp != NULL) {
  ------------------
  |  Branch (3120:11): [True: 0, False: 0]
  ------------------
 3121|      0|        frame_reader_release(frame, io_cb, fp);
 3122|      0|      }
 3123|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 3124|      0|    }
 3125|      0|  }
 3126|      0|  if (fp == NULL) {
  ------------------
  |  Branch (3126:7): [True: 0, False: 0]
  ------------------
 3127|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3128|      0|    return BLOSC2_ERROR_FILE_OPEN;
 3129|      0|  }
 3130|      0|  if (!blosc2_checked_add_i64(io_pos, nbytes, NULL)) {
  ------------------
  |  Branch (3130:7): [True: 0, False: 0]
  ------------------
 3131|      0|    frame_reader_release(frame, io_cb, fp);
 3132|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 3133|      0|  }
 3134|       |
 3135|      0|  uint8_t* read_buffer = buffer;
 3136|      0|  int64_t rbytes = io_cb->read((void**)&read_buffer, 1, nbytes, io_pos, fp);
 3137|      0|  bool complete = rbytes == nbytes && read_buffer != NULL;
  ------------------
  |  Branch (3137:19): [True: 0, False: 0]
  |  Branch (3137:39): [True: 0, False: 0]
  ------------------
 3138|      0|  if (complete && read_buffer != buffer) {
  ------------------
  |  Branch (3138:7): [True: 0, False: 0]
  |  Branch (3138:19): [True: 0, False: 0]
  ------------------
 3139|       |    // An io that hands out its own memory (mmap) keeps owning it
 3140|      0|    memcpy(buffer, read_buffer, (size_t)nbytes);
 3141|      0|  }
 3142|      0|  frame_reader_release(frame, io_cb, fp);
 3143|      0|  if (!complete) {
  ------------------
  |  Branch (3143:7): [True: 0, False: 0]
  ------------------
 3144|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3145|      0|    return BLOSC2_ERROR_FILE_READ;
 3146|      0|  }
 3147|       |
 3148|      0|  return 0;
 3149|      0|}
blosc2.c:serial_context_get:
 2796|  11.3k|static struct thread_context* serial_context_get(blosc2_context* context) {
 2797|  11.3k|  struct thread_context* thread_context = NULL;
 2798|  11.3k|  if (context->serial_context == NULL) {
  ------------------
  |  Branch (2798:7): [True: 11.3k, False: 0]
  ------------------
 2799|  11.3k|    thread_context = serial_context_take_tls(context);
 2800|  11.3k|  }
 2801|  11.3k|  if (thread_context == NULL) {
  ------------------
  |  Branch (2801:7): [True: 0, False: 11.3k]
  ------------------
 2802|      0|    if (context->serial_context != NULL &&
  ------------------
  |  Branch (2802:9): [True: 0, False: 0]
  ------------------
 2803|      0|        context->serial_context->tmp_blocksize != context->blocksize) {
  ------------------
  |  Branch (2803:9): [True: 0, False: 0]
  ------------------
 2804|      0|      free_thread_context(context->serial_context);
 2805|      0|      context->serial_context = NULL;
 2806|      0|    }
 2807|      0|    if (context->serial_context == NULL) {
  ------------------
  |  Branch (2807:9): [True: 0, False: 0]
  ------------------
 2808|      0|      context->serial_context = create_thread_context(context, 0);
 2809|      0|      if (context->serial_context == NULL) {
  ------------------
  |  Branch (2809:11): [True: 0, False: 0]
  ------------------
 2810|      0|        return NULL;
 2811|      0|      }
 2812|      0|    }
 2813|      0|    else if (fit_thread_context(context->serial_context, context) < 0) {
  ------------------
  |  Branch (2813:14): [True: 0, False: 0]
  ------------------
 2814|      0|      return NULL;
 2815|      0|    }
 2816|      0|    thread_context = context->serial_context;
 2817|      0|  }
 2818|  11.3k|  thread_context->parent_context = context;
 2819|  11.3k|  thread_context->tid = 0;
 2820|       |  thread_context->serial = true;
 2821|  11.3k|  return thread_context;
 2822|  11.3k|}
blosc2.c:serial_context_take_tls:
 6894|  11.3k|static struct thread_context* serial_context_take_tls(blosc2_context* context) {
 6895|  11.3k|#if !defined(_WIN32)
 6896|  11.3k|  int32_t ebsize = context->blocksize + context->typesize * (int32_t)sizeof(int32_t);
 6897|  11.3k|  if ((size_t)4 * ebsize > BLOSC2_SERIAL_TLS_MAX) {
  ------------------
  |  | 6817|  11.3k|#define BLOSC2_SERIAL_TLS_MAX (16 * 1024 * 1024)
  ------------------
  |  Branch (6897:7): [True: 0, False: 11.3k]
  ------------------
 6898|      0|    return NULL;
 6899|      0|  }
 6900|  11.3k|  tmp_cache_t *cache = tmp_cache_get(true);
 6901|  11.3k|  if (cache == NULL || cache->serial_busy) {
  ------------------
  |  Branch (6901:7): [True: 0, False: 11.3k]
  |  Branch (6901:24): [True: 0, False: 11.3k]
  ------------------
 6902|      0|    return NULL;
 6903|      0|  }
 6904|  11.3k|  if (cache->serial == NULL) {
  ------------------
  |  Branch (6904:7): [True: 11.3k, False: 0]
  ------------------
 6905|  11.3k|    cache->serial = create_thread_context(context, 0);
 6906|  11.3k|    if (cache->serial == NULL) {
  ------------------
  |  Branch (6906:9): [True: 0, False: 11.3k]
  ------------------
 6907|      0|      return NULL;
 6908|      0|    }
 6909|  11.3k|  }
 6910|      0|  else if (fit_thread_context(cache->serial, context) < 0) {
  ------------------
  |  Branch (6910:12): [True: 0, False: 0]
  ------------------
 6911|      0|    return NULL;
 6912|      0|  }
 6913|  11.3k|  cache->serial_busy = true;
 6914|  11.3k|  return cache->serial;
 6915|       |#else
 6916|       |  BLOSC_UNUSED_PARAM(context);
 6917|       |  return NULL;
 6918|       |#endif
 6919|  11.3k|}
blosc2.c:create_thread_context:
 2676|  11.3k|create_thread_context(blosc2_context* context, int32_t tid) {
 2677|  11.3k|  struct thread_context* thread_context;
 2678|  11.3k|  thread_context = (struct thread_context*)my_malloc(sizeof(struct thread_context));
 2679|  11.3k|  BLOSC_ERROR_NULL(thread_context, NULL);
  ------------------
  |  |  104|  11.3k|    do {                                            \
  |  |  105|  11.3k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 11.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|  11.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 11.3k]
  |  |  ------------------
  ------------------
 2680|  11.3k|  int rc = init_thread_context(thread_context, context, tid);
 2681|  11.3k|  if (rc < 0) {
  ------------------
  |  Branch (2681:7): [True: 0, False: 11.3k]
  ------------------
 2682|      0|    my_free(thread_context);
 2683|      0|    return NULL;
 2684|      0|  }
 2685|  11.3k|  return thread_context;
 2686|  11.3k|}
blosc2.c:init_thread_context:
 2644|  11.3k|{
 2645|  11.3k|  int32_t ebsize;
 2646|       |
 2647|  11.3k|  thread_context->parent_context = context;
 2648|  11.3k|  thread_context->owner_pool = NULL;
 2649|  11.3k|  thread_context->tid = tid;
 2650|  11.3k|  thread_context->serial = false;
 2651|  11.3k|  thread_context->blosclz_state = NULL;
 2652|       |
 2653|  11.3k|  int32_t blocksize = context != NULL ? context->blocksize : 0;
  ------------------
  |  Branch (2653:23): [True: 11.3k, False: 0]
  ------------------
 2654|  11.3k|  int32_t typesize = context != NULL ? context->typesize : 0;
  ------------------
  |  Branch (2654:22): [True: 11.3k, False: 0]
  ------------------
 2655|  11.3k|  ebsize = blocksize + typesize * (signed)sizeof(int32_t);
 2656|  11.3k|  thread_context->tmp_nbytes = (size_t)4 * ebsize;
 2657|  11.3k|  thread_context->tmp = my_malloc(thread_context->tmp_nbytes);
 2658|  11.3k|  BLOSC_ERROR_NULL(thread_context->tmp, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|  11.3k|    do {                                            \
  |  |  105|  11.3k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 11.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|  11.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 11.3k]
  |  |  ------------------
  ------------------
 2659|  11.3k|  thread_context->tmp2 = thread_context->tmp + ebsize;
 2660|  11.3k|  thread_context->tmp3 = thread_context->tmp2 + ebsize;
 2661|  11.3k|  thread_context->tmp4 = thread_context->tmp3 + ebsize;
 2662|  11.3k|  thread_context->tmp_blocksize = blocksize;
 2663|  11.3k|  thread_context->zfp_cell_nitems = 0;
 2664|  11.3k|  thread_context->zfp_cell_start = 0;
 2665|  11.3k|  #if defined(HAVE_ZSTD)
 2666|  11.3k|  thread_context->zstd_cctx = NULL;
 2667|  11.3k|  thread_context->zstd_dctx = NULL;
 2668|  11.3k|  #endif
 2669|  11.3k|  thread_context->lz4_cstream = NULL;
 2670|  11.3k|  thread_context->lz4hc_cstream = NULL;
 2671|       |
 2672|  11.3k|  return 0;
 2673|  11.3k|}
blosc2.c:blosc_d:
 2122|   158k|    int32_t nblock, uint8_t* dest, int32_t dest_offset, uint8_t* tmp, uint8_t* tmp2) {
 2123|   158k|  blosc2_context* context = thread_context->parent_context;
 2124|   158k|  uint8_t *tmp3 = thread_context->tmp4;
 2125|   158k|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2126|   158k|  int32_t compformat = (context->header_flags & (uint8_t)0xe0) >> 5u;
 2127|   158k|  int dont_split = (context->header_flags & 0x10) >> 4;
 2128|   158k|  int32_t chunk_nbytes;
 2129|   158k|  int32_t chunk_cbytes;
 2130|   158k|  int nstreams;
 2131|   158k|  int32_t neblock;
 2132|   158k|  int32_t nbytes;                /* number of decompressed bytes in split */
 2133|   158k|  int32_t cbytes;                /* number of compressed bytes in split */
 2134|       |  // int32_t ctbytes = 0;           /* number of compressed bytes in block */
 2135|   158k|  int32_t ntbytes = 0;           /* number of uncompressed bytes in block */
 2136|   158k|  uint8_t* _dest;
 2137|   158k|  int32_t typesize = context->typesize;
 2138|   158k|  bool instr_codec = context->blosc2_flags & BLOSC2_INSTR_CODEC;
 2139|   158k|  const char* compname;
 2140|   158k|  int rc;
 2141|       |
 2142|   158k|  if (context->block_maskout != NULL && context->block_maskout[nblock]) {
  ------------------
  |  Branch (2142:7): [True: 0, False: 158k]
  |  Branch (2142:41): [True: 0, False: 0]
  ------------------
 2143|       |    // Do not decompress, but act as if we successfully decompressed everything
 2144|      0|    return bsize;
 2145|      0|  }
 2146|       |
 2147|   158k|  rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 2148|   158k|  if (rc < 0) {
  ------------------
  |  Branch (2148:7): [True: 0, False: 158k]
  ------------------
 2149|      0|    return rc;
 2150|      0|  }
 2151|   158k|  if (context->special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (2151:7): [True: 245, False: 158k]
  ------------------
 2152|       |    // We need the actual typesize in this case, but it cannot be encoded in the header, so derive it from cbytes
 2153|    245|    typesize = chunk_cbytes - context->header_overhead;
 2154|    245|  }
 2155|       |
 2156|       |  // In some situations (lazychunks) the context can arrive uninitialized
 2157|       |  // (but BITSHUFFLE needs it for accessing the format of the chunk)
 2158|   158k|  if (context->src == NULL) {
  ------------------
  |  Branch (2158:7): [True: 0, False: 158k]
  ------------------
 2159|      0|    context->src = src;
 2160|      0|  }
 2161|       |
 2162|       |  // Chunks with special values cannot be lazy
 2163|   158k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (2163:19): [True: 151k, False: 6.70k]
  ------------------
 2164|   151k|          (context->blosc2_flags & 0x08u) && !context->special_type);
  ------------------
  |  Branch (2164:11): [True: 132k, False: 19.7k]
  |  Branch (2164:46): [True: 22, False: 132k]
  ------------------
 2165|   158k|  if (is_lazy) {
  ------------------
  |  Branch (2165:7): [True: 22, False: 158k]
  ------------------
 2166|       |    // The chunk is on disk, so just lazily load the block
 2167|     22|    if (context->schunk == NULL) {
  ------------------
  |  Branch (2167:9): [True: 22, False: 0]
  ------------------
 2168|     22|      BLOSC_TRACE_ERROR("Lazy chunk needs an associated super-chunk.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2169|     22|      return BLOSC2_ERROR_INVALID_PARAM;
 2170|     22|    }
 2171|      0|    if (context->schunk->frame == NULL) {
  ------------------
  |  Branch (2171:9): [True: 0, False: 0]
  ------------------
 2172|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2173|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 2174|      0|    }
 2175|      0|    blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 2176|      0|    size_t bstarts_nbytes;
 2177|      0|    size_t trailer_offset;
 2178|      0|    size_t block_csizes_nbytes;
 2179|      0|    size_t trailer_meta_nbytes;
 2180|      0|    size_t lazy_trailer_end;
 2181|      0|    if (srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (2181:9): [True: 0, False: 0]
  |  Branch (2181:24): [True: 0, False: 0]
  ------------------
 2182|      0|        !blosc2_checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (2182:9): [True: 0, False: 0]
  ------------------
 2183|      0|        !blosc2_checked_add_size((size_t)BLOSC_EXTENDED_HEADER_LENGTH, bstarts_nbytes, &trailer_offset) ||
  ------------------
  |  Branch (2183:9): [True: 0, False: 0]
  ------------------
 2184|      0|        !blosc2_checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (2184:9): [True: 0, False: 0]
  ------------------
 2185|      0|        !blosc2_checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (2185:9): [True: 0, False: 0]
  ------------------
 2186|      0|        !blosc2_checked_add_size(trailer_offset, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (2186:9): [True: 0, False: 0]
  ------------------
 2187|      0|        (size_t)srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (2187:9): [True: 0, False: 0]
  ------------------
 2188|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2189|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2190|      0|    }
 2191|      0|    int32_t nchunk;
 2192|      0|    int64_t chunk_offset;
 2193|       |    // The nchunk and the offset of the current chunk are in the trailer
 2194|      0|    memcpy(&nchunk, src + trailer_offset, sizeof(nchunk));
 2195|      0|    memcpy(&chunk_offset, src + trailer_offset + sizeof(int32_t), sizeof(chunk_offset));
 2196|       |    // Get the csize of the nblock
 2197|      0|    if (nblock < 0 || nblock >= context->nblocks) {
  ------------------
  |  Branch (2197:9): [True: 0, False: 0]
  |  Branch (2197:23): [True: 0, False: 0]
  ------------------
 2198|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2199|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2200|      0|    }
 2201|      0|    int32_t *block_csizes = (int32_t *)(src + trailer_offset + sizeof(int32_t) + sizeof(int64_t));
 2202|      0|    int32_t block_csize = block_csizes[nblock];
 2203|      0|    int32_t max_lazy_block_csize = context->blocksize + context->typesize * (signed)sizeof(int32_t);
 2204|      0|    if (block_csize <= 0 || block_csize > max_lazy_block_csize) {
  ------------------
  |  Branch (2204:9): [True: 0, False: 0]
  |  Branch (2204:29): [True: 0, False: 0]
  ------------------
 2205|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2206|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2207|      0|    }
 2208|      0|    if (vlblocks && block_csize <= (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (2208:9): [True: 0, False: 0]
  |  Branch (2208:21): [True: 0, False: 0]
  ------------------
 2209|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2210|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2211|      0|    }
 2212|       |    // Read the lazy block on disk
 2213|      0|    void* fp = NULL;
 2214|      0|    blosc2_io_cb *io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 2215|      0|    if (io_cb == NULL) {
  ------------------
  |  Branch (2215:9): [True: 0, False: 0]
  ------------------
 2216|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2217|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 2218|      0|    }
 2219|       |
 2220|      0|    int64_t io_pos = 0;
 2221|      0|    if (frame->sframe) {
  ------------------
  |  Branch (2221:9): [True: 0, False: 0]
  ------------------
 2222|       |      // The chunk is not in the frame
 2223|      0|      fp = sframe_open_chunk(frame->urlpath, nchunk, "rb", context->schunk->storage->io);
 2224|      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]
  |  |  ------------------
  ------------------
 2225|       |      // The offset of the block is src_offset
 2226|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (2226:11): [True: 0, False: 0]
  ------------------
 2227|      0|        frame_reader_release(frame, io_cb, fp);
 2228|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2229|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 2230|      0|      }
 2231|      0|      io_pos = src_offset;
 2232|      0|    }
 2233|      0|    else {
 2234|      0|      fp = frame_reader_acquire(frame, context->schunk->storage->io);
 2235|      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]
  |  |  ------------------
  ------------------
 2236|       |      // The offset of the block is src_offset
 2237|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (2237:11): [True: 0, False: 0]
  ------------------
 2238|      0|        frame_reader_release(frame, io_cb, fp);
 2239|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2240|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 2241|      0|      }
 2242|      0|      if (chunk_offset < 0) {
  ------------------
  |  Branch (2242:11): [True: 0, False: 0]
  ------------------
 2243|      0|        frame_reader_release(frame, io_cb, fp);
 2244|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2245|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 2246|      0|      }
 2247|      0|      if (!blosc2_checked_add_i64(frame->file_offset, chunk_offset, &io_pos)) {
  ------------------
  |  Branch (2247:11): [True: 0, False: 0]
  ------------------
 2248|      0|        frame_reader_release(frame, io_cb, fp);
 2249|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2250|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 2251|      0|      }
 2252|      0|      if (!blosc2_checked_add_i64(io_pos, src_offset, &io_pos)) {
  ------------------
  |  Branch (2252:11): [True: 0, False: 0]
  ------------------
 2253|      0|        frame_reader_release(frame, io_cb, fp);
 2254|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2255|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 2256|      0|      }
 2257|      0|    }
 2258|       |    // We can make use of tmp3 because it will be used after src is not needed anymore
 2259|      0|    int64_t rbytes = io_cb->read((void**)&tmp3, 1, block_csize, io_pos, fp);
 2260|      0|    frame_reader_release(frame, io_cb, fp);
 2261|      0|    if ((int32_t)rbytes != block_csize) {
  ------------------
  |  Branch (2261:9): [True: 0, False: 0]
  ------------------
 2262|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2263|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2264|      0|    }
 2265|      0|    src = tmp3;
 2266|      0|    src_offset = 0;
 2267|      0|    srcsize = block_csize;
 2268|      0|  }
 2269|       |
 2270|       |  // If the chunk is memcpyed, we just have to copy the block to dest and return
 2271|   158k|  if (memcpyed) {
  ------------------
  |  Branch (2271:7): [True: 134k, False: 24.1k]
  ------------------
 2272|   134k|    int bsize_ = leftoverblock ? chunk_nbytes % context->blocksize : bsize;
  ------------------
  |  Branch (2272:18): [True: 45, False: 134k]
  ------------------
 2273|   134k|    if (!context->special_type) {
  ------------------
  |  Branch (2273:9): [True: 716, False: 133k]
  ------------------
 2274|    716|      if (chunk_nbytes + context->header_overhead != chunk_cbytes) {
  ------------------
  |  Branch (2274:11): [True: 0, False: 716]
  ------------------
 2275|      0|        return BLOSC2_ERROR_WRITE_BUFFER;
 2276|      0|      }
 2277|    716|      if (chunk_cbytes < context->header_overhead + (nblock * context->blocksize) + bsize_) {
  ------------------
  |  Branch (2277:11): [True: 0, False: 716]
  ------------------
 2278|       |        /* Not enough input to copy block */
 2279|      0|        return BLOSC2_ERROR_READ_BUFFER;
 2280|      0|      }
 2281|    716|    }
 2282|   134k|    if (!is_lazy) {
  ------------------
  |  Branch (2282:9): [True: 134k, False: 0]
  ------------------
 2283|   134k|      src += context->header_overhead + nblock * context->blocksize;
 2284|   134k|    }
 2285|   134k|    _dest = dest + dest_offset;
 2286|   134k|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (2286:9): [True: 0, False: 134k]
  ------------------
 2287|       |      // We are making use of a postfilter, so use a temp for destination
 2288|      0|      _dest = tmp;
 2289|      0|    }
 2290|   134k|    rc = 0;
 2291|   134k|    switch (context->special_type) {
 2292|    245|      case BLOSC2_SPECIAL_VALUE:
  ------------------
  |  Branch (2292:7): [True: 245, False: 134k]
  ------------------
 2293|       |        // All repeated values
 2294|    245|        rc = set_values(typesize, context->src, _dest, bsize_);
 2295|    245|        if (rc < 0) {
  ------------------
  |  Branch (2295:13): [True: 1, False: 244]
  ------------------
 2296|      1|          BLOSC_TRACE_ERROR("set_values failed");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2297|      1|          return BLOSC2_ERROR_DATA;
 2298|      1|        }
 2299|    244|        break;
 2300|    997|      case BLOSC2_SPECIAL_NAN:
  ------------------
  |  Branch (2300:7): [True: 997, False: 133k]
  ------------------
 2301|    997|        rc = set_nans(context->typesize, _dest, bsize_);
 2302|    997|        if (rc < 0) {
  ------------------
  |  Branch (2302:13): [True: 17, False: 980]
  ------------------
 2303|     17|          BLOSC_TRACE_ERROR("set_nans failed");
  ------------------
  |  |   93|     17|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     17|    do {                                            \
  |  |  |  |   98|     17|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     17|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 17, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     17|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2304|     17|          return BLOSC2_ERROR_DATA;
 2305|     17|        }
 2306|    980|        break;
 2307|    980|      case BLOSC2_SPECIAL_ZERO:
  ------------------
  |  Branch (2307:7): [True: 924, False: 133k]
  ------------------
 2308|    924|        memset(_dest, 0, bsize_);
 2309|    924|        break;
 2310|   131k|      case BLOSC2_SPECIAL_UNINIT:
  ------------------
  |  Branch (2310:7): [True: 131k, False: 2.88k]
  ------------------
 2311|       |        // We do nothing here
 2312|   131k|        break;
 2313|    716|      default:
  ------------------
  |  Branch (2313:7): [True: 716, False: 133k]
  ------------------
 2314|    716|        memcpy(_dest, src, bsize_);
 2315|   134k|    }
 2316|   134k|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (2316:9): [True: 0, False: 134k]
  ------------------
 2317|       |      // Create new postfilter parameters for this block (must be private for each thread)
 2318|      0|      blosc2_postfilter_params postparams;
 2319|      0|      memcpy(&postparams, context->postparams, sizeof(postparams));
 2320|      0|      postparams.input = tmp;
 2321|      0|      postparams.output = dest + dest_offset;
 2322|      0|      postparams.size = bsize;
 2323|      0|      postparams.typesize = typesize;
 2324|      0|      postparams.offset = nblock * context->blocksize;
 2325|      0|      postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (2325:27): [True: 0, False: 0]
  ------------------
 2326|      0|      postparams.nblock = nblock;
 2327|      0|      postparams.tid = thread_context->tid;
 2328|      0|      postparams.ttmp = thread_context->tmp;
 2329|      0|      postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 2330|      0|      postparams.ctx = context;
 2331|       |
 2332|       |      // Execute the postfilter (the processed block will be copied to dest)
 2333|      0|      if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (2333:11): [True: 0, False: 0]
  ------------------
 2334|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2335|      0|        return BLOSC2_ERROR_POSTFILTER;
 2336|      0|      }
 2337|      0|    }
 2338|   134k|    thread_context->zfp_cell_nitems = 0;
 2339|       |
 2340|   134k|    return bsize_;
 2341|   134k|  }
 2342|       |
 2343|  24.1k|  if (!is_lazy && (src_offset <= 0 || src_offset >= srcsize)) {
  ------------------
  |  Branch (2343:7): [True: 24.1k, False: 0]
  |  Branch (2343:20): [True: 212, False: 23.9k]
  |  Branch (2343:39): [True: 353, False: 23.5k]
  ------------------
 2344|       |    /* Invalid block src offset encountered */
 2345|    565|    return BLOSC2_ERROR_DATA;
 2346|    565|  }
 2347|       |
 2348|  23.5k|  src += src_offset;
 2349|  23.5k|  if (vlblocks) {
  ------------------
  |  Branch (2349:7): [True: 10, False: 23.5k]
  ------------------
 2350|     10|    if (context->blockcbytes == NULL || nblock >= context->nblocks ||
  ------------------
  |  Branch (2350:9): [True: 0, False: 10]
  |  Branch (2350:41): [True: 0, False: 10]
  ------------------
 2351|     10|        context->blockcbytes[nblock] <= (int32_t)sizeof(int32_t) ||
  ------------------
  |  Branch (2351:9): [True: 4, False: 6]
  ------------------
 2352|      6|        src_offset > srcsize - context->blockcbytes[nblock]) {
  ------------------
  |  Branch (2352:9): [True: 0, False: 6]
  ------------------
 2353|      4|      return BLOSC2_ERROR_DATA;
 2354|      4|    }
 2355|      6|    srcsize = context->blockcbytes[nblock];
 2356|      6|  }
 2357|  23.5k|  else {
 2358|  23.5k|    srcsize -= src_offset;
 2359|  23.5k|  }
 2360|       |
 2361|  23.5k|  int last_filter_index = last_filter(context, 'd');
 2362|  23.5k|  if (instr_codec) {
  ------------------
  |  Branch (2362:7): [True: 2.09k, False: 21.4k]
  ------------------
 2363|       |    // If instrumented, we don't want to run the filters
 2364|  2.09k|    _dest = dest + dest_offset;
 2365|  2.09k|  }
 2366|  21.4k|  else if (((last_filter_index >= 0) &&
  ------------------
  |  Branch (2366:13): [True: 19.2k, False: 2.22k]
  ------------------
 2367|  19.2k|       (next_filter(context, BLOSC2_MAX_FILTERS, 'd') != BLOSC_DELTA)) ||
  ------------------
  |  Branch (2367:8): [True: 14.6k, False: 4.61k]
  ------------------
 2368|  14.6k|    context->postfilter != NULL) {
  ------------------
  |  Branch (2368:5): [True: 0, False: 6.84k]
  ------------------
 2369|       |    // We are making use of some filter, so use a temp for destination
 2370|  14.6k|    _dest = tmp;
 2371|  14.6k|  }
 2372|  6.84k|  else {
 2373|       |    // If no filters, or only DELTA in pipeline
 2374|  6.84k|    _dest = dest + dest_offset;
 2375|  6.84k|  }
 2376|       |
 2377|       |  /* The number of compressed data streams for this block */
 2378|  23.5k|  if (vlblocks) {
  ------------------
  |  Branch (2378:7): [True: 6, False: 23.5k]
  ------------------
 2379|      6|    nstreams = 1;
 2380|      6|  }
 2381|  23.5k|  else if (!dont_split && !leftoverblock) {
  ------------------
  |  Branch (2381:12): [True: 3.36k, False: 20.1k]
  |  Branch (2381:27): [True: 3.33k, False: 33]
  ------------------
 2382|  3.33k|    nstreams = context->typesize;
 2383|  3.33k|  }
 2384|  20.2k|  else {
 2385|  20.2k|    nstreams = 1;
 2386|  20.2k|  }
 2387|       |
 2388|  23.5k|  neblock = bsize / nstreams;
 2389|  23.5k|  if (neblock == 0) {
  ------------------
  |  Branch (2389:7): [True: 3, False: 23.5k]
  ------------------
 2390|       |    /* Not enough space to output bytes */
 2391|      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]
  |  |  ------------------
  ------------------
 2392|      3|  }
 2393|       |  /* The splits must cover the whole block, or part of tmp is left unwritten */
 2394|  23.5k|  if (neblock * nstreams != bsize) {
  ------------------
  |  Branch (2394:7): [True: 15, False: 23.5k]
  ------------------
 2395|     15|    BLOSC_ERROR(BLOSC2_ERROR_DATA);
  ------------------
  |  |  111|     15|    do {                                            \
  |  |  112|     15|        int rc_ = (rc);                             \
  |  |  113|     15|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 15, False: 0]
  |  |  ------------------
  |  |  114|     15|            char *error_msg = print_error(rc_);     \
  |  |  115|     15|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|     15|            return rc_;                             \
  |  |  117|     15|        }                                           \
  |  |  118|     15|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2396|     15|  }
 2397|  38.5k|  for (int j = 0; j < nstreams; j++) {
  ------------------
  |  Branch (2397:19): [True: 24.0k, False: 14.4k]
  ------------------
 2398|  24.0k|    if (vlblocks) {
  ------------------
  |  Branch (2398:9): [True: 6, False: 24.0k]
  ------------------
 2399|      6|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2399:11): [True: 0, False: 6]
  ------------------
 2400|       |        /* Not enough input to read compressed bytes */
 2401|      0|        return BLOSC2_ERROR_READ_BUFFER;
 2402|      0|      }
 2403|      6|      neblock = sw32_(src);
 2404|      6|      if (neblock != bsize) {
  ------------------
  |  Branch (2404:11): [True: 0, False: 6]
  ------------------
 2405|      0|        return BLOSC2_ERROR_DATA;
 2406|      0|      }
 2407|      6|      src += sizeof(int32_t);
 2408|      6|      cbytes = srcsize - (int32_t)sizeof(int32_t);
 2409|      6|      srcsize = 0;
 2410|      6|    }
 2411|  24.0k|    else {
 2412|  24.0k|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2412:11): [True: 13, False: 24.0k]
  ------------------
 2413|       |        /* Not enough input to read compressed size */
 2414|     13|        return BLOSC2_ERROR_READ_BUFFER;
 2415|     13|      }
 2416|  24.0k|      srcsize -= sizeof(int32_t);
 2417|  24.0k|      cbytes = sw32_(src);      /* amount of compressed bytes */
 2418|  24.0k|      if (cbytes > 0) {
  ------------------
  |  Branch (2418:11): [True: 20.4k, False: 3.54k]
  ------------------
 2419|  20.4k|        if (srcsize < cbytes) {
  ------------------
  |  Branch (2419:13): [True: 103, False: 20.3k]
  ------------------
 2420|       |          /* Not enough input to read compressed bytes */
 2421|    103|          return BLOSC2_ERROR_READ_BUFFER;
 2422|    103|        }
 2423|  20.3k|        srcsize -= cbytes;
 2424|  20.3k|      }
 2425|  23.9k|      src += sizeof(int32_t);
 2426|  23.9k|    }
 2427|       |    // ctbytes += (signed)sizeof(int32_t);
 2428|       |
 2429|       |    /* Uncompress */
 2430|  23.9k|    if (!vlblocks && cbytes == 0) {
  ------------------
  |  Branch (2430:9): [True: 23.9k, False: 6]
  |  Branch (2430:22): [True: 2.73k, False: 21.2k]
  ------------------
 2431|       |      // A run of 0's
 2432|  2.73k|      memset(_dest, 0, (unsigned int)neblock);
 2433|  2.73k|      nbytes = neblock;
 2434|  2.73k|    }
 2435|  21.2k|    else if (!vlblocks && cbytes < 0) {
  ------------------
  |  Branch (2435:14): [True: 21.2k, False: 6]
  |  Branch (2435:27): [True: 807, False: 20.3k]
  ------------------
 2436|       |      // A negative number means some encoding depending on the token that comes next
 2437|    807|      uint8_t token;
 2438|       |
 2439|    807|      if (srcsize < (signed)sizeof(uint8_t)) {
  ------------------
  |  Branch (2439:11): [True: 12, False: 795]
  ------------------
 2440|       |        // Not enough input to read token */
 2441|     12|        return BLOSC2_ERROR_READ_BUFFER;
 2442|     12|      }
 2443|    795|      srcsize -= sizeof(uint8_t);
 2444|       |
 2445|    795|      token = src[0];
 2446|    795|      src += 1;
 2447|       |      // ctbytes += 1;
 2448|       |
 2449|    795|      if (token & 0x1) {
  ------------------
  |  Branch (2449:11): [True: 777, False: 18]
  ------------------
 2450|       |        // A run of bytes that are different than 0
 2451|    777|        if (cbytes < -255) {
  ------------------
  |  Branch (2451:13): [True: 63, False: 714]
  ------------------
 2452|       |          // Runs can only encode a byte
 2453|     63|          return BLOSC2_ERROR_RUN_LENGTH;
 2454|     63|        }
 2455|    714|        uint8_t value = -cbytes;
 2456|    714|        memset(_dest, value, (unsigned int)neblock);
 2457|    714|      } else {
 2458|     18|        BLOSC_TRACE_ERROR("Invalid or unsupported compressed stream token value - %d", token);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2459|     18|        return BLOSC2_ERROR_RUN_LENGTH;
 2460|     18|      }
 2461|    714|      nbytes = neblock;
 2462|    714|      cbytes = 0;  // everything is encoded in the cbytes token
 2463|    714|    }
 2464|  20.4k|    else if (cbytes == neblock) {
  ------------------
  |  Branch (2464:14): [True: 7.48k, False: 12.9k]
  ------------------
 2465|  7.48k|      memcpy(_dest, src, (unsigned int)neblock);
 2466|  7.48k|      nbytes = (int32_t)neblock;
 2467|  7.48k|    }
 2468|  12.9k|    else {
 2469|  12.9k|      if (compformat == BLOSC_BLOSCLZ_FORMAT) {
  ------------------
  |  Branch (2469:11): [True: 1.28k, False: 11.6k]
  ------------------
 2470|  1.28k|        nbytes = blosclz_decompress(src, cbytes, _dest, (int)neblock);
 2471|  1.28k|      }
 2472|  11.6k|      else if (compformat == BLOSC_LZ4_FORMAT) {
  ------------------
  |  Branch (2472:16): [True: 1.38k, False: 10.2k]
  ------------------
 2473|  1.38k|        nbytes = lz4_wrap_decompress((char*)src, (size_t)cbytes,
 2474|  1.38k|                                     (char*)_dest, (size_t)neblock,
 2475|  1.38k|                                     thread_context);
 2476|  1.38k|      }
 2477|  10.2k|  #if defined(HAVE_ZLIB)
 2478|  10.2k|      else if (compformat == BLOSC_ZLIB_FORMAT) {
  ------------------
  |  Branch (2478:16): [True: 1.34k, False: 8.90k]
  ------------------
 2479|  1.34k|        nbytes = zlib_wrap_decompress((char*)src, (size_t)cbytes,
 2480|  1.34k|                                      (char*)_dest, (size_t)neblock);
 2481|  1.34k|      }
 2482|  8.90k|  #endif /*  HAVE_ZLIB */
 2483|  8.90k|  #if defined(HAVE_ZSTD)
 2484|  8.90k|      else if (compformat == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2484:16): [True: 6.98k, False: 1.92k]
  ------------------
 2485|  6.98k|        nbytes = zstd_wrap_decompress(thread_context,
 2486|  6.98k|                                      (char*)src, (size_t)cbytes,
 2487|  6.98k|                                      (char*)_dest, (size_t)neblock);
 2488|  6.98k|      }
 2489|  1.92k|  #endif /*  HAVE_ZSTD */
 2490|  1.92k|      else if (compformat == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (2490:16): [True: 1.91k, False: 8]
  ------------------
 2491|  1.91k|        bool getcell = false;
 2492|       |
 2493|  1.91k|#if defined(HAVE_ZFP)
 2494|  1.91k|        if ((context->compcode == BLOSC_CODEC_ZFP_FIXED_RATE) &&
  ------------------
  |  Branch (2494:13): [True: 1, False: 1.91k]
  ------------------
 2495|      1|            (thread_context->zfp_cell_nitems > 0)) {
  ------------------
  |  Branch (2495:13): [True: 0, False: 1]
  ------------------
 2496|      0|          nbytes = zfp_getcell(thread_context, src, cbytes, _dest, neblock);
 2497|      0|          if (nbytes < 0) {
  ------------------
  |  Branch (2497:15): [True: 0, False: 0]
  ------------------
 2498|      0|            return BLOSC2_ERROR_DATA;
 2499|      0|          }
 2500|      0|          if (nbytes == thread_context->zfp_cell_nitems * typesize) {
  ------------------
  |  Branch (2500:15): [True: 0, False: 0]
  ------------------
 2501|      0|            getcell = true;
 2502|      0|          }
 2503|      0|        }
 2504|  1.91k|#endif /* HAVE_ZFP */
 2505|  1.91k|        if (!getcell) {
  ------------------
  |  Branch (2505:13): [True: 1.91k, False: 0]
  ------------------
 2506|  1.91k|          thread_context->zfp_cell_nitems = 0;
 2507|  2.08k|          for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (2507:27): [True: 2.06k, False: 16]
  ------------------
 2508|  2.06k|            if (g_codecs[i].compcode == context->compcode) {
  ------------------
  |  Branch (2508:17): [True: 1.89k, False: 173]
  ------------------
 2509|  1.89k|              if (load_acquire_ptr(&g_codecs[i].decoder) == NULL) {
  ------------------
  |  |  144|  1.89k|#define load_acquire_ptr(p) __atomic_load_n((p), __ATOMIC_ACQUIRE)
  ------------------
  |  Branch (2509:19): [True: 4, False: 1.89k]
  ------------------
 2510|       |                // Dynamically load codec plugin
 2511|      4|                if (fill_codec(&g_codecs[i]) < 0) {
  ------------------
  |  Branch (2511:21): [True: 4, False: 0]
  ------------------
 2512|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2513|      4|                  return BLOSC2_ERROR_CODEC_SUPPORT;
 2514|      4|                }
 2515|      4|              }
 2516|  1.89k|              blosc2_dparams dparams;
 2517|  1.89k|              blosc2_ctx_get_dparams(context, &dparams);
 2518|  1.89k|              nbytes = g_codecs[i].decoder(src,
 2519|  1.89k|                                           cbytes,
 2520|  1.89k|                                           _dest,
 2521|  1.89k|                                           neblock,
 2522|  1.89k|                                           context->compcode_meta,
 2523|  1.89k|                                           &dparams,
 2524|  1.89k|                                           context->src);
 2525|  1.89k|              goto urcodecsuccess;
 2526|  1.89k|            }
 2527|  2.06k|          }
 2528|     16|          BLOSC_TRACE_ERROR("User-defined compressor codec %d not found during decompression", context->compcode);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2529|     16|          return BLOSC2_ERROR_CODEC_SUPPORT;
 2530|  1.91k|        }
 2531|  1.89k|      urcodecsuccess:
 2532|  1.89k|        ;
 2533|  1.89k|      }
 2534|      8|      else {
 2535|      8|        compname = clibcode_to_clibname(compformat);
 2536|      8|        BLOSC_TRACE_ERROR(
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2537|      8|                "Blosc has not been compiled with decompression "
 2538|      8|                "support for '%s' format.  "
 2539|      8|                "Please recompile for adding this support.", compname);
 2540|      8|        return BLOSC2_ERROR_CODEC_SUPPORT;
 2541|      8|      }
 2542|       |
 2543|       |      /* Check that decompressed bytes number is correct */
 2544|  12.8k|      if ((nbytes != neblock) && (thread_context->zfp_cell_nitems == 0)) {
  ------------------
  |  Branch (2544:11): [True: 8.81k, False: 4.07k]
  |  Branch (2544:34): [True: 8.81k, False: 0]
  ------------------
 2545|  8.81k|        return BLOSC2_ERROR_DATA;
 2546|  8.81k|      }
 2547|       |
 2548|  12.8k|    }
 2549|  15.0k|    src += cbytes;
 2550|       |    // ctbytes += cbytes;
 2551|  15.0k|    _dest += nbytes;
 2552|  15.0k|    ntbytes += nbytes;
 2553|  15.0k|  } /* Closes j < nstreams */
 2554|       |
 2555|  14.4k|  if (!instr_codec) {
  ------------------
  |  Branch (2555:7): [True: 13.3k, False: 1.15k]
  ------------------
 2556|  13.3k|    if (last_filter_index >= 0 || context->postfilter != NULL) {
  ------------------
  |  Branch (2556:9): [True: 12.9k, False: 407]
  |  Branch (2556:35): [True: 0, False: 407]
  ------------------
 2557|       |      /* Apply regular filter pipeline */
 2558|  12.9k|      int errcode = pipeline_backward(thread_context, bsize, dest, dest_offset, tmp, tmp2, tmp3,
 2559|  12.9k|                                      last_filter_index, nblock);
 2560|  12.9k|      if (errcode < 0)
  ------------------
  |  Branch (2560:11): [True: 312, False: 12.6k]
  ------------------
 2561|    312|        return errcode;
 2562|  12.9k|    }
 2563|  13.3k|  }
 2564|       |
 2565|       |  /* Return the number of uncompressed bytes */
 2566|  14.1k|  return (int)ntbytes;
 2567|  14.4k|}
blosc2.c:lz4_wrap_decompress:
  659|  1.38k|                               struct thread_context* thread_context) {
  660|  1.38k|  int nbytes;
  661|  1.38k|  blosc2_context* context = thread_context->parent_context;
  662|  1.38k|  if (context->use_dict && context->dict_buffer != NULL && context->dict_size > 0) {
  ------------------
  |  Branch (662:7): [True: 646, False: 735]
  |  Branch (662:28): [True: 646, False: 0]
  |  Branch (662:60): [True: 646, False: 0]
  ------------------
  663|    646|    nbytes = LZ4_decompress_safe_usingDict(input, output,
  664|    646|                                           (int)compressed_length, (int)maxout,
  665|    646|                                           (const char*)context->dict_buffer,
  666|    646|                                           (int)context->dict_size);
  667|    735|  } else {
  668|    735|    nbytes = LZ4_decompress_safe(input, output, (int)compressed_length, (int)maxout);
  669|    735|  }
  670|  1.38k|  if (nbytes != (int)maxout) {
  ------------------
  |  Branch (670:7): [True: 1.08k, False: 297]
  ------------------
  671|  1.08k|    return 0;
  672|  1.08k|  }
  673|    297|  return (int)maxout;
  674|  1.38k|}
blosc2.c:zlib_wrap_decompress:
  698|  1.34k|                                char* output, size_t maxout) {
  699|  1.34k|  int status;
  700|  1.34k|#if defined(HAVE_ZLIB_NG) && ! defined(ZLIB_COMPAT)
  701|  1.34k|  size_t ul = maxout;
  702|  1.34k|  status = zng_uncompress(
  703|  1.34k|      (uint8_t*)output, &ul, (uint8_t*)input, compressed_length);
  704|       |#else
  705|       |  uLongf ul = (uLongf)maxout;
  706|       |  status = uncompress(
  707|       |      (Bytef*)output, &ul, (Bytef*)input, (uLong)compressed_length);
  708|       |#endif
  709|  1.34k|  if (status != Z_OK) {
  ------------------
  |  |  180|  1.34k|#define Z_OK            0
  ------------------
  |  Branch (709:7): [True: 1.33k, False: 2]
  ------------------
  710|  1.33k|    return 0;
  711|  1.33k|  }
  712|      2|  return (int)ul;
  713|  1.34k|}
blosc2.c:zstd_wrap_decompress:
  750|  6.98k|                                char* output, size_t maxout) {
  751|  6.98k|  size_t code;
  752|  6.98k|  blosc2_context* context = thread_context->parent_context;
  753|       |
  754|  6.98k|  if (thread_context->zstd_dctx == NULL) {
  ------------------
  |  Branch (754:7): [True: 5.19k, False: 1.79k]
  ------------------
  755|  5.19k|    thread_context->zstd_dctx = ZSTD_createDCtx();
  756|  5.19k|  }
  757|       |
  758|  6.98k|  if (context->use_dict) {
  ------------------
  |  Branch (758:7): [True: 2.22k, False: 4.76k]
  ------------------
  759|  2.22k|    assert(context->dict_ddict != NULL);
  760|  2.22k|    code = ZSTD_decompress_usingDDict(
  761|  2.22k|            thread_context->zstd_dctx, (void*)output, maxout, (void*)input,
  762|  2.22k|            compressed_length, context->dict_ddict);
  763|  4.76k|  } else {
  764|  4.76k|    code = ZSTD_decompressDCtx(thread_context->zstd_dctx,
  765|  4.76k|        (void*)output, maxout, (void*)input, compressed_length);
  766|  4.76k|  }
  767|  6.98k|  if (ZSTD_isError(code) != ZSTD_error_no_error) {
  ------------------
  |  Branch (767:7): [True: 4.96k, False: 2.02k]
  ------------------
  768|  4.96k|    BLOSC_TRACE_ERROR("Error in ZSTD decompression: '%s'.  Giving up.",
  ------------------
  |  |   93|  4.96k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  4.96k|    do {                                            \
  |  |  |  |   98|  4.96k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  4.96k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 4.96k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  4.96k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  769|  4.96k|                      ZDICT_getErrorName(code));
  770|  4.96k|    return 0;
  771|  4.96k|  }
  772|  2.02k|  return (int)code;
  773|  6.98k|}
blosc2.c:set_values:
 2053|    245|static int32_t set_values(int32_t typesize, const uint8_t* src, uint8_t* dest, int32_t destsize) {
 2054|       |#if defined(BLOSC_STRICT_ALIGN)
 2055|       |  if (destsize % typesize != 0) {
 2056|       |    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
 2057|       |  }
 2058|       |  int32_t nitems = destsize / typesize;
 2059|       |  if (nitems == 0) {
 2060|       |    return 0;
 2061|       |  }
 2062|       |  for (int i = 0; i < nitems; i++) {
 2063|       |    memcpy(dest + i * typesize, src + BLOSC_EXTENDED_HEADER_LENGTH, typesize);
 2064|       |  }
 2065|       |#else
 2066|    245|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (2066:7): [True: 1, False: 244]
  ------------------
 2067|      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]
  |  |  ------------------
  ------------------
 2068|      1|  }
 2069|    244|  int32_t nitems = destsize / typesize;
 2070|    244|  if (nitems == 0) {
  ------------------
  |  Branch (2070:7): [True: 0, False: 244]
  ------------------
 2071|      0|    return 0;
 2072|      0|  }
 2073|       |
 2074|    244|  switch (typesize) {
 2075|     14|    case 8: {
  ------------------
  |  Branch (2075:5): [True: 14, False: 230]
  ------------------
 2076|     14|      int64_t val8 = ((int64_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 2077|     14|      int64_t* dest8 = (int64_t*)dest;
 2078|     41|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (2078:23): [True: 27, False: 14]
  ------------------
 2079|     27|        dest8[i] = val8;
 2080|     27|      }
 2081|     14|      break;
 2082|      0|    }
 2083|     23|    case 4: {
  ------------------
  |  Branch (2083:5): [True: 23, False: 221]
  ------------------
 2084|     23|      int32_t val4 = ((int32_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 2085|     23|      int32_t* dest4 = (int32_t*)dest;
 2086|     78|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (2086:23): [True: 55, False: 23]
  ------------------
 2087|     55|        dest4[i] = val4;
 2088|     55|      }
 2089|     23|      break;
 2090|      0|    }
 2091|     69|    case 2: {
  ------------------
  |  Branch (2091:5): [True: 69, False: 175]
  ------------------
 2092|     69|      int16_t val2 = ((int16_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 2093|     69|      int16_t* dest2 = (int16_t*)dest;
 2094|    311|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (2094:23): [True: 242, False: 69]
  ------------------
 2095|    242|        dest2[i] = val2;
 2096|    242|      }
 2097|     69|      break;
 2098|      0|    }
 2099|    115|    case 1: {
  ------------------
  |  Branch (2099:5): [True: 115, False: 129]
  ------------------
 2100|    115|      int8_t val1 = ((int8_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 2101|    115|      int8_t* dest1 = (int8_t*)dest;
 2102|    439|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (2102:23): [True: 324, False: 115]
  ------------------
 2103|    324|        dest1[i] = val1;
 2104|    324|      }
 2105|    115|      break;
 2106|      0|    }
 2107|     23|    default:
  ------------------
  |  Branch (2107:5): [True: 23, False: 221]
  ------------------
 2108|     86|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (2108:23): [True: 63, False: 23]
  ------------------
 2109|     63|        memcpy(dest + i * typesize, src + BLOSC_EXTENDED_HEADER_LENGTH, typesize);
 2110|     63|      }
 2111|    244|  }
 2112|    244|#endif
 2113|       |
 2114|    244|  return nitems;
 2115|    244|}
blosc2.c:set_nans:
 2021|    997|static int32_t set_nans(int32_t typesize, uint8_t* dest, int32_t destsize) {
 2022|    997|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (2022:7): [True: 8, False: 989]
  ------------------
 2023|      8|    BLOSC_TRACE_ERROR("destsize can only be a multiple of typesize");
  ------------------
  |  |   93|      8|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      8|    do {                                            \
  |  |  |  |   98|      8|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      8|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      8|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2024|      8|    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  111|      8|    do {                                            \
  |  |  112|      8|        int rc_ = (rc);                             \
  |  |  113|      8|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 8, False: 0]
  |  |  ------------------
  |  |  114|      8|            char *error_msg = print_error(rc_);     \
  |  |  115|      8|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|      8|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      8|    do {                                            \
  |  |  |  |  |  |   98|      8|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      8|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 8, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      8|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      8|            return rc_;                             \
  |  |  117|      8|        }                                           \
  |  |  118|      8|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2025|      8|  }
 2026|    989|  int32_t nitems = destsize / typesize;
 2027|    989|  if (nitems == 0) {
  ------------------
  |  Branch (2027:7): [True: 0, False: 989]
  ------------------
 2028|      0|    return 0;
 2029|      0|  }
 2030|       |
 2031|    989|  if (typesize == 4) {
  ------------------
  |  Branch (2031:7): [True: 423, False: 566]
  ------------------
 2032|    423|    float* dest_ = (float*)dest;
 2033|    423|    float val = nanf("");
 2034|  3.84k|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (2034:21): [True: 3.42k, False: 423]
  ------------------
 2035|  3.42k|      dest_[i] = val;
 2036|  3.42k|    }
 2037|    423|    return nitems;
 2038|    423|  }
 2039|    566|  else if (typesize == 8) {
  ------------------
  |  Branch (2039:12): [True: 557, False: 9]
  ------------------
 2040|    557|    double* dest_ = (double*)dest;
 2041|    557|    double val = nan("");
 2042|  2.99k|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (2042:21): [True: 2.43k, False: 557]
  ------------------
 2043|  2.43k|      dest_[i] = val;
 2044|  2.43k|    }
 2045|    557|    return nitems;
 2046|    557|  }
 2047|       |
 2048|      9|  BLOSC_TRACE_ERROR("Unsupported typesize for NaN");
  ------------------
  |  |   93|      9|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      9|    do {                                            \
  |  |  |  |   98|      9|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      9|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 9, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      9|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2049|      9|  return BLOSC2_ERROR_DATA;
 2050|    989|}
blosc2.c:blosc2_initialize_context_from_header:
 1050|  12.4k|static int blosc2_initialize_context_from_header(blosc2_context* context, blosc_header* header) {
 1051|  12.4k|  context->header_flags = header->flags;
 1052|  12.4k|  context->typesize = header->typesize;
 1053|  12.4k|  context->sourcesize = header->nbytes;
 1054|  12.4k|  context->header_blocksize = header->blocksize;
 1055|  12.4k|  context->blocksize = header->blocksize;
 1056|  12.4k|  context->blosc2_flags2 = header->blosc2_flags2;
 1057|  12.4k|  context->blosc2_flags = header->blosc2_flags;
 1058|  12.4k|  context->compcode = header->flags >> 5;
 1059|  12.4k|  if (context->compcode == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (1059:7): [True: 1.24k, False: 11.1k]
  ------------------
 1060|  1.24k|    context->compcode = header->udcompcode;
 1061|  1.24k|  }
 1062|  12.4k|  if (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) {
  ------------------
  |  Branch (1062:7): [True: 383, False: 12.0k]
  ------------------
 1063|    383|    context->nblocks = header->blocksize;
 1064|    383|    context->leftover = 0;
 1065|    383|    context->blocksize = 0;
 1066|    383|  }
 1067|  12.0k|  else {
 1068|  12.0k|    blosc2_calculate_blocks(context);
 1069|  12.0k|  }
 1070|       |
 1071|  12.4k|  bool is_lazy = false;
 1072|  12.4k|  if ((context->header_flags & BLOSC_DOSHUFFLE) &&
  ------------------
  |  Branch (1072:7): [True: 8.82k, False: 3.58k]
  ------------------
 1073|  8.82k|      (context->header_flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (1073:7): [True: 6.92k, False: 1.90k]
  ------------------
 1074|       |    /* Extended header */
 1075|  6.92k|    context->header_overhead = BLOSC_EXTENDED_HEADER_LENGTH;
 1076|       |
 1077|  6.92k|    memcpy(context->filters, header->filters, BLOSC2_MAX_FILTERS);
 1078|  6.92k|    memcpy(context->filters_meta, header->filters_meta, BLOSC2_MAX_FILTERS);
 1079|  6.92k|    context->compcode_meta = header->compcode_meta;
 1080|       |
 1081|  6.92k|    context->filter_flags = filters_to_flags(header->filters);
 1082|  6.92k|    context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
 1083|       |
 1084|       |    // Chunks with special values cannot be lazy (as in blosc_d()), and their
 1085|       |    // value is read from the buffer, so the cbytes check below must apply
 1086|  6.92k|    is_lazy = (context->blosc2_flags & 0x08u) && !context->special_type;
  ------------------
  |  Branch (1086:15): [True: 255, False: 6.66k]
  |  Branch (1086:50): [True: 160, False: 95]
  ------------------
 1087|  6.92k|  }
 1088|  5.49k|  else {
 1089|  5.49k|    context->header_overhead = BLOSC_MIN_HEADER_LENGTH;
 1090|  5.49k|    context->filter_flags = get_filter_flags(context->header_flags, context->typesize);
 1091|  5.49k|    flags_to_filters(context->header_flags, context->filters);
 1092|  5.49k|  }
 1093|       |
 1094|       |  // Some checks for malformed headers
 1095|  12.4k|  if (!is_lazy && header->cbytes > context->srcsize) {
  ------------------
  |  Branch (1095:7): [True: 12.2k, False: 160]
  |  Branch (1095:19): [True: 0, False: 12.2k]
  ------------------
 1096|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 1097|      0|  }
 1098|       |
 1099|  12.4k|  return 0;
 1100|  12.4k|}
blosc2.c:get_filter_flags:
  890|  5.49k|                                const int32_t typesize) {
  891|  5.49k|  uint8_t flags = 0;
  892|       |
  893|  5.49k|  if ((header_flags & BLOSC_DOSHUFFLE) && (typesize > 1)) {
  ------------------
  |  Branch (893:7): [True: 1.90k, False: 3.58k]
  |  Branch (893:43): [True: 1.20k, False: 703]
  ------------------
  894|  1.20k|    flags |= BLOSC_DOSHUFFLE;
  895|  1.20k|  }
  896|  5.49k|  if (header_flags & BLOSC_DOBITSHUFFLE) {
  ------------------
  |  Branch (896:7): [True: 1.24k, False: 4.24k]
  ------------------
  897|  1.24k|    flags |= BLOSC_DOBITSHUFFLE;
  898|  1.24k|  }
  899|  5.49k|  if (header_flags & BLOSC_DODELTA) {
  ------------------
  |  Branch (899:7): [True: 2.32k, False: 3.16k]
  ------------------
  900|  2.32k|    flags |= BLOSC_DODELTA;
  901|  2.32k|  }
  902|  5.49k|  if (header_flags & BLOSC_MEMCPYED) {
  ------------------
  |  Branch (902:7): [True: 54, False: 5.43k]
  ------------------
  903|     54|    flags |= BLOSC_MEMCPYED;
  904|     54|  }
  905|  5.49k|  return flags;
  906|  5.49k|}
blosc2.c:clear_context_decompression_dict:
 3049|  12.4k|static void clear_context_decompression_dict(blosc2_context* context) {
 3050|  12.4k|  context->use_dict = 0;
 3051|  12.4k|  release_context_dict_buffer(context);
 3052|  12.4k|#if defined(HAVE_ZSTD)
 3053|  12.4k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (3053:7): [True: 0, False: 12.4k]
  ------------------
 3054|      0|    ZSTD_freeDDict(context->dict_ddict);
 3055|      0|    context->dict_ddict = NULL;
 3056|      0|  }
 3057|       |#else
 3058|       |  context->dict_ddict = NULL;
 3059|       |#endif
 3060|  12.4k|}
blosc2.c:check_nthreads:
 2714|  11.3k|static int check_nthreads(blosc2_context* context, bool start_backend) {
 2715|  11.3k|  if (context->new_nthreads != context->nthreads && context->new_nthreads <= 0) {
  ------------------
  |  Branch (2715:7): [True: 0, False: 11.3k]
  |  Branch (2715:53): [True: 0, False: 0]
  ------------------
 2716|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2716|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2717|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2718|      0|  }
 2719|  11.3k|  if (context->nthreads <= 0) {
  ------------------
  |  Branch (2719:7): [True: 0, False: 11.3k]
  ------------------
 2720|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2720|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2721|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2722|      0|  }
 2723|       |
 2724|       |  /* Detect a pool that was torn down by blosc2_destroy() while this context
 2725|       |   * was still alive, or that belongs to the parent of a forked process.  The
 2726|       |   * epoch mismatch tells us the pool pointer is dangling or has no threads;
 2727|       |   * clear it so the re-attach logic below creates a fresh one. */
 2728|  11.3k|  if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL &&
  ------------------
  |  |   34|  22.6k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (2728:7): [True: 0, False: 11.3k]
  ------------------
 2729|      0|      context->pool_epoch != load_acquire_int(&g_destroy_count)) {
  ------------------
  |  |  142|      0|#define load_acquire_int(p) __atomic_load_n((p), __ATOMIC_ACQUIRE)
  ------------------
  |  Branch (2729:7): [True: 0, False: 0]
  ------------------
 2730|      0|    context->thread_pool = NULL;
 2731|      0|    context->threads_started = 0;
 2732|      0|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   33|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2733|      0|  }
 2734|       |
 2735|  11.3k|  if (context->new_nthreads != context->nthreads) {
  ------------------
  |  Branch (2735:7): [True: 0, False: 11.3k]
  ------------------
 2736|      0|    release_thread_backend(context);
 2737|      0|    context->nthreads = context->new_nthreads;
 2738|      0|  }
 2739|  11.3k|  if (start_backend && context->nthreads > 1 && context->threads_started == 0) {
  ------------------
  |  Branch (2739:7): [True: 0, False: 11.3k]
  |  Branch (2739:24): [True: 0, False: 0]
  |  Branch (2739:49): [True: 0, False: 0]
  ------------------
 2740|      0|    int rc;
 2741|      0|    if (threads_callback) {
  ------------------
  |  Branch (2741:9): [True: 0, False: 0]
  ------------------
 2742|      0|      rc = init_callback_threads(context);
 2743|      0|    }
 2744|      0|    else {
 2745|       |#if defined(_WIN32)
 2746|       |      rc = init_threadpool(context);
 2747|       |#else
 2748|      0|      rc = attach_shared_pool(context);
 2749|      0|#endif
 2750|      0|    }
 2751|      0|    if (rc < 0) {
  ------------------
  |  Branch (2751:9): [True: 0, False: 0]
  ------------------
 2752|      0|      return rc;
 2753|      0|    }
 2754|      0|  }
 2755|  11.3k|  if (context->nthreads <= 1) {
  ------------------
  |  Branch (2755:7): [True: 11.3k, False: 0]
  ------------------
 2756|  11.3k|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   33|  11.3k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2757|  11.3k|  }
 2758|       |
 2759|  11.3k|  return context->nthreads;
 2760|  11.3k|}
blosc2.c:register_atfork:
  311|      1|static void register_atfork(void) {
  312|      1|  if (pthread_atfork(atfork_prepare, atfork_parent, atfork_child) != 0) {
  ------------------
  |  Branch (312:7): [True: 0, False: 1]
  ------------------
  313|       |    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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  314|      0|  }
  315|      1|}
blosc2.c:blosc2_init_locked:
 6696|  12.8k|static void blosc2_init_locked(void) {
 6697|  12.8k|  BLOSC2_IO_CB_DEFAULTS.id = BLOSC2_IO_FILESYSTEM;
 6698|  12.8k|  BLOSC2_IO_CB_DEFAULTS.name = "filesystem";
 6699|  12.8k|  BLOSC2_IO_CB_DEFAULTS.is_allocation_necessary = true;
 6700|  12.8k|  BLOSC2_IO_CB_DEFAULTS.open = (blosc2_open_cb) blosc2_stdio_open;
 6701|  12.8k|  BLOSC2_IO_CB_DEFAULTS.close = (blosc2_close_cb) blosc2_stdio_close;
 6702|  12.8k|  BLOSC2_IO_CB_DEFAULTS.size = (blosc2_size_cb) blosc2_stdio_size;
 6703|  12.8k|  BLOSC2_IO_CB_DEFAULTS.write = (blosc2_write_cb) blosc2_stdio_write;
 6704|  12.8k|  BLOSC2_IO_CB_DEFAULTS.read = (blosc2_read_cb) blosc2_stdio_read;
 6705|  12.8k|  BLOSC2_IO_CB_DEFAULTS.truncate = (blosc2_truncate_cb) blosc2_stdio_truncate;
 6706|  12.8k|  BLOSC2_IO_CB_DEFAULTS.destroy = (blosc2_destroy_cb) blosc2_stdio_destroy;
 6707|       |
 6708|  12.8k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_DEFAULTS);
 6709|       |
 6710|  12.8k|  BLOSC2_IO_CB_MMAP.id = BLOSC2_IO_FILESYSTEM_MMAP;
 6711|  12.8k|  BLOSC2_IO_CB_MMAP.name = "filesystem_mmap";
 6712|  12.8k|  BLOSC2_IO_CB_MMAP.is_allocation_necessary = false;
 6713|  12.8k|  BLOSC2_IO_CB_MMAP.open = (blosc2_open_cb) blosc2_stdio_mmap_open;
 6714|  12.8k|  BLOSC2_IO_CB_MMAP.close = (blosc2_close_cb) blosc2_stdio_mmap_close;
 6715|  12.8k|  BLOSC2_IO_CB_MMAP.read = (blosc2_read_cb) blosc2_stdio_mmap_read;
 6716|  12.8k|  BLOSC2_IO_CB_MMAP.size = (blosc2_size_cb) blosc2_stdio_mmap_size;
 6717|  12.8k|  BLOSC2_IO_CB_MMAP.write = (blosc2_write_cb) blosc2_stdio_mmap_write;
 6718|  12.8k|  BLOSC2_IO_CB_MMAP.truncate = (blosc2_truncate_cb) blosc2_stdio_mmap_truncate;
 6719|  12.8k|  BLOSC2_IO_CB_MMAP.destroy = (blosc2_destroy_cb) blosc2_stdio_mmap_destroy;
 6720|       |
 6721|  12.8k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_MMAP);
 6722|       |
 6723|       |  // BLOSC_PREFETCH=<nthreads> turns read-ahead on without touching the sources (see blosc2_set_prefetch())
 6724|  12.8k|  const char *prefetch_env = getenv("BLOSC_PREFETCH");
 6725|  12.8k|  if (prefetch_env != NULL && prefetch_env[0] != '\0') {
  ------------------
  |  Branch (6725:7): [True: 0, False: 12.8k]
  |  Branch (6725:31): [True: 0, False: 0]
  ------------------
 6726|      0|    long nthreads = strtol(prefetch_env, NULL, 10);
 6727|      0|    if (nthreads > 0 && nthreads <= BLOSC2_PREFETCH_MAX_NTHREADS) {
  ------------------
  |  |  786|      0|#define BLOSC2_PREFETCH_MAX_NTHREADS 256
  ------------------
  |  Branch (6727:9): [True: 0, False: 0]
  |  Branch (6727:25): [True: 0, False: 0]
  ------------------
 6728|      0|      blosc2_set_prefetch((int) nthreads, 0, 0);
 6729|      0|    }
 6730|      0|  }
 6731|       |  // BLOSC_PREFETCH_POPULATE: of which memory-mapped frames read-ahead populates the mapping: of all (1), of none (0),
 6732|       |  // or, if unset or empty, of those on GPFS
 6733|  12.8k|  const char *populate_env = getenv("BLOSC_PREFETCH_POPULATE");
 6734|  12.8k|  prefetch_set_populate(populate_env != NULL && populate_env[0] != '\0' ? strtol(populate_env, NULL, 10) != 0 : -1);
  ------------------
  |  Branch (6734:25): [True: 0, False: 12.8k]
  |  Branch (6734:49): [True: 0, False: 0]
  ------------------
 6735|       |
 6736|  12.8k|  g_ncodecs = 0;
 6737|  12.8k|  g_nfilters = 0;
 6738|  12.8k|  g_ntuners = 0;
 6739|       |
 6740|  12.8k|#if defined(HAVE_PLUGINS)
 6741|  12.8k|  #include "blosc2/blosc2-common.h"
 6742|  12.8k|  #include "blosc2/blosc2-stdio.h"
 6743|  12.8k|  register_codecs();
 6744|  12.8k|  register_filters();
 6745|  12.8k|  register_tuners();
 6746|  12.8k|#endif
 6747|  12.8k|  blosc2_pthread_mutex_init(&global_comp_mutex, NULL);
  ------------------
  |  |   90|  12.8k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 6748|       |  /* Create a global context */
 6749|  12.8k|  g_global_context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 6750|  12.8k|  memset(g_global_context, 0, sizeof(blosc2_context));
 6751|  12.8k|  g_global_context->nthreads = g_nthreads;
 6752|  12.8k|  g_global_context->new_nthreads = g_nthreads;
 6753|  12.8k|  blosc2_pthread_mutex_init(&g_global_context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  12.8k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 6754|  12.8k|  store_release_int(&g_initlib, BLOSC_STATE_INITIALIZED);
  ------------------
  |  |  143|  12.8k|#define store_release_int(p, v) __atomic_store_n((p), (v), __ATOMIC_RELEASE)
  ------------------
 6755|  12.8k|}
blosc2.c:blosc2_free_resources_locked:
 6784|  12.8k|static int blosc2_free_resources_locked(void) {
 6785|       |  /* The calling thread's temporaries (other threads free theirs at exit) */
 6786|  12.8k|  blosc2_tmp_cache_clear();
 6787|  12.8k|  int rc = release_thread_backend(g_global_context);
 6788|       |  /* The thread pools that no context uses (kept for reuse) */
 6789|  12.8k|  static_lock(&pool_registry_mutex);
  ------------------
  |  |  132|  12.8k|#define static_lock(l) pthread_mutex_lock(l)
  ------------------
 6790|  12.8k|  struct blosc_shared_pool *unused = unlink_unused_pools_locked(0);
 6791|  12.8k|  static_unlock(&pool_registry_mutex);
  ------------------
  |  |  133|  12.8k|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 6792|  12.8k|  destroy_shared_pools(unused);
 6793|  12.8k|  return rc;
 6794|  12.8k|}
blosc2.c:unlink_unused_pools_locked:
 6013|  12.8k|static struct blosc_shared_pool *unlink_unused_pools_locked(int keep) {
 6014|  12.8k|  struct blosc_shared_pool *unused = NULL;
 6015|  12.8k|  struct blosc_shared_pool **prev = &shared_pools;
 6016|  12.8k|  while (*prev != NULL) {
  ------------------
  |  Branch (6016:10): [True: 0, False: 12.8k]
  ------------------
 6017|      0|    struct blosc_shared_pool *pool = *prev;
 6018|      0|    if (pool->context_refs == 0) {
  ------------------
  |  Branch (6018:9): [True: 0, False: 0]
  ------------------
 6019|      0|      if (keep == 0) {
  ------------------
  |  Branch (6019:11): [True: 0, False: 0]
  ------------------
 6020|      0|        *prev = pool->next;
 6021|      0|        pool->next = unused;
 6022|      0|        unused = pool;
 6023|      0|        continue;
 6024|      0|      }
 6025|      0|      keep--;
 6026|      0|    }
 6027|      0|    prev = &pool->next;
 6028|      0|  }
 6029|  12.8k|  return unused;
 6030|  12.8k|}
blosc2.c:destroy_shared_pools:
 6000|  25.6k|static void destroy_shared_pools(struct blosc_shared_pool *pool) {
 6001|  25.6k|  while (pool != NULL) {
  ------------------
  |  Branch (6001:10): [True: 0, False: 25.6k]
  ------------------
 6002|      0|    struct blosc_shared_pool *next = pool->next;
 6003|      0|    destroy_shared_pool(pool);
 6004|      0|    pool = next;
 6005|      0|  }
 6006|  25.6k|}
blosc2.c:serial_context_put:
 6921|  11.3k|static void serial_context_put(struct thread_context* thread_context) {
 6922|  11.3k|#if !defined(_WIN32)
 6923|  11.3k|  tmp_cache_t *cache = tmp_cache_get(false);
 6924|  11.3k|  if (cache != NULL && cache->serial == thread_context) {
  ------------------
  |  Branch (6924:7): [True: 11.3k, False: 0]
  |  Branch (6924:24): [True: 11.3k, False: 0]
  ------------------
 6925|  11.3k|    blosc2_context* context = thread_context->parent_context;
 6926|  11.3k|    if (context->serial_context == NULL &&
  ------------------
  |  Branch (6926:9): [True: 11.3k, False: 0]
  ------------------
 6927|  11.3k|        thread_context_nbytes(thread_context) > BLOSC2_SERIAL_TLS_MAX) {
  ------------------
  |  | 6817|  11.3k|#define BLOSC2_SERIAL_TLS_MAX (16 * 1024 * 1024)
  ------------------
  |  Branch (6927:9): [True: 0, False: 11.3k]
  ------------------
 6928|       |      /* Grown too large to keep per thread (e.g. ZSTD compression state for
 6929|       |         large blocks at high levels): the context that needed it keeps it, as
 6930|       |         if it had always been its own, and the thread starts a new one */
 6931|      0|      thread_context->tmp_blocksize = context->blocksize;
 6932|      0|      context->serial_context = thread_context;
 6933|      0|      cache->serial = NULL;
 6934|      0|    }
 6935|  11.3k|    else {
 6936|  11.3k|      thread_context->parent_context = NULL;
 6937|  11.3k|    }
 6938|  11.3k|    cache->serial_busy = false;
 6939|  11.3k|  }
 6940|       |#else
 6941|       |  BLOSC_UNUSED_PARAM(thread_context);
 6942|       |#endif
 6943|  11.3k|}
blosc2.c:thread_context_nbytes:
 6867|  11.3k|static size_t thread_context_nbytes(const struct thread_context* thread_context) {
 6868|  11.3k|  size_t nbytes = thread_context->tmp_nbytes +
 6869|  11.3k|                  (thread_context->blosclz_state != NULL ? sizeof(blosclz_state) : 0);
  ------------------
  |  Branch (6869:20): [True: 0, False: 11.3k]
  ------------------
 6870|  11.3k|#if defined(HAVE_ZSTD)
 6871|  11.3k|  if (thread_context->zstd_cctx != NULL) {
  ------------------
  |  Branch (6871:7): [True: 0, False: 11.3k]
  ------------------
 6872|      0|    nbytes += ZSTD_sizeof_CCtx(thread_context->zstd_cctx);
 6873|      0|  }
 6874|  11.3k|  if (thread_context->zstd_dctx != NULL) {
  ------------------
  |  Branch (6874:7): [True: 5.19k, False: 6.12k]
  ------------------
 6875|  5.19k|    nbytes += ZSTD_sizeof_DCtx(thread_context->zstd_dctx);
 6876|  5.19k|  }
 6877|  11.3k|#endif
 6878|  11.3k|  if (thread_context->lz4_cstream != NULL) {
  ------------------
  |  Branch (6878:7): [True: 0, False: 11.3k]
  ------------------
 6879|      0|    nbytes += sizeof(LZ4_stream_t);
 6880|      0|  }
 6881|  11.3k|  if (thread_context->lz4hc_cstream != NULL) {
  ------------------
  |  Branch (6881:7): [True: 0, False: 11.3k]
  ------------------
 6882|      0|    nbytes += sizeof(LZ4_streamHC_t);
 6883|      0|  }
 6884|  11.3k|  return nbytes;
 6885|  11.3k|}
blosc2.c:tmp_cache_get:
 6848|  48.2k|static tmp_cache_t *tmp_cache_get(bool create) {
 6849|  48.2k|  pthread_once(&tmp_cache_once, tmp_cache_init);
 6850|  48.2k|  if (!tmp_cache_ready) {
  ------------------
  |  Branch (6850:7): [True: 0, False: 48.2k]
  ------------------
 6851|      0|    return NULL;
 6852|      0|  }
 6853|  48.2k|  tmp_cache_t *cache = pthread_getspecific(tmp_cache_key);
 6854|  48.2k|  if (cache == NULL && create) {
  ------------------
  |  Branch (6854:7): [True: 639, False: 47.6k]
  |  Branch (6854:24): [True: 1, False: 638]
  ------------------
 6855|      1|    cache = calloc(1, sizeof(tmp_cache_t));
 6856|      1|    if (cache != NULL && pthread_setspecific(tmp_cache_key, cache) != 0) {
  ------------------
  |  Branch (6856:9): [True: 1, False: 0]
  |  Branch (6856:26): [True: 0, False: 1]
  ------------------
 6857|      0|      free(cache);
 6858|       |      cache = NULL;
 6859|      0|    }
 6860|      1|  }
 6861|  48.2k|  return cache;
 6862|  48.2k|}
blosc2.c:tmp_cache_init:
 6844|      1|static void tmp_cache_init(void) {
 6845|      1|  tmp_cache_ready = pthread_key_create(&tmp_cache_key, tmp_cache_release) == 0;
 6846|      1|}
blosc2.c:blosc2_destroy_locked:
 7045|  12.8k|static void blosc2_destroy_locked(void) {
 7046|  12.8k|  blosc2_free_resources_locked();
 7047|  12.8k|  blosc2_free_ctx(g_global_context);
 7048|  12.8k|  blosc2_tmp_cache_clear();
 7049|       |
 7050|       |  /* Atomically invalidate outstanding context pointers and detach the registry.
 7051|       |   * A release either finishes its refcount update before this, or observes the
 7052|       |   * new epoch without dereferencing its stale pool.  Join outside the lock. */
 7053|  12.8k|  static_lock(&pool_registry_mutex);
  ------------------
  |  |  132|  12.8k|#define static_lock(l) pthread_mutex_lock(l)
  ------------------
 7054|  12.8k|  store_release_int(&g_destroy_count, load_acquire_int(&g_destroy_count) + 1);
  ------------------
  |  |  143|  12.8k|#define store_release_int(p, v) __atomic_store_n((p), (v), __ATOMIC_RELEASE)
  ------------------
 7055|  12.8k|  struct blosc_shared_pool *pools = shared_pools;
 7056|  12.8k|  shared_pools = NULL;
 7057|  12.8k|  static_unlock(&pool_registry_mutex);
  ------------------
  |  |  133|  12.8k|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 7058|  12.8k|  destroy_shared_pools(pools);
 7059|       |
 7060|  12.8k|  blosc2_pthread_mutex_destroy(&global_comp_mutex);
  ------------------
  |  |   91|  12.8k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 7061|  12.8k|}
blosc2.c:my_malloc:
  383|  35.4k|static uint8_t* my_malloc(size_t size) {
  384|  35.4k|  void* block = NULL;
  385|  35.4k|  int res = 0;
  386|       |  /* Keep aligned allocations valid under Valgrind and POSIX wrappers. */
  387|  35.4k|  if (size == 0) {
  ------------------
  |  Branch (387:7): [True: 0, False: 35.4k]
  ------------------
  388|      0|    size = 1;
  389|      0|  }
  390|       |
  391|       |/* Do an alignment to 32 bytes because AVX2 is supported */
  392|       |#if defined(_WIN32)
  393|       |  /* A (void *) cast needed for avoiding a warning with MINGW :-/ */
  394|       |  block = (void *)_aligned_malloc(size, 32);
  395|       |#elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600
  396|       |  /* Platform does have an implementation of posix_memalign */
  397|  35.4k|  res = posix_memalign(&block, 32, size);
  398|       |#else
  399|       |  block = malloc(size);
  400|       |#endif  /* _WIN32 */
  401|       |
  402|  35.4k|  if (block == NULL || res != 0) {
  ------------------
  |  Branch (402:7): [True: 0, False: 35.4k]
  |  Branch (402:24): [True: 0, False: 35.4k]
  ------------------
  403|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  404|      0|    return NULL;
  405|      0|  }
  406|       |
  407|  35.4k|  return (uint8_t*)block;
  408|  35.4k|}
blosc2.c:release_thread_backend:
 6178|  12.8k|static int release_thread_backend(blosc2_context *context) {
 6179|  12.8k|  if (context->thread_backend == BLOSC_BACKEND_CALLBACK && context->threads_started > 0) {
  ------------------
  |  |   35|  25.6k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (6179:7): [True: 0, False: 12.8k]
  |  Branch (6179:60): [True: 0, False: 0]
  ------------------
 6180|      0|    for (int32_t t = 0; t < context->threads_started; t++) {
  ------------------
  |  Branch (6180:25): [True: 0, False: 0]
  ------------------
 6181|      0|      destroy_thread_context(context->thread_contexts + t);
 6182|      0|    }
 6183|      0|    my_free(context->thread_contexts);
 6184|      0|    context->thread_contexts = NULL;
 6185|      0|    blosc2_pthread_mutex_destroy(&context->count_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6186|      0|    blosc2_pthread_mutex_destroy(&context->delta_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6187|      0|    blosc2_pthread_cond_destroy(&context->delta_cv);
  ------------------
  |  |   97|      0|#define blosc2_pthread_cond_destroy(a) pthread_cond_destroy((a))
  ------------------
 6188|      0|  }
 6189|       |#if defined(_WIN32)
 6190|       |  else if (context->thread_backend == BLOSC_BACKEND_PER_CONTEXT && context->threads_started > 0) {
 6191|       |    /* Signal all workers to exit. */
 6192|       |    blosc2_pthread_mutex_lock(&context->jobs_mutex);
 6193|       |    context->end_threads = 1;
 6194|       |    blosc2_pthread_cond_broadcast(&context->jobs_ready);
 6195|       |    blosc2_pthread_mutex_unlock(&context->jobs_mutex);
 6196|       |
 6197|       |    for (int32_t t = 0; t < context->threads_started; t++) {
 6198|       |      blosc2_pthread_join(context->threads[t], NULL);
 6199|       |    }
 6200|       |    my_free(context->threads);
 6201|       |    context->threads = NULL;
 6202|       |    blosc2_pthread_cond_destroy(&context->jobs_done);
 6203|       |    blosc2_pthread_cond_destroy(&context->jobs_ready);
 6204|       |    blosc2_pthread_mutex_destroy(&context->jobs_mutex);
 6205|       |    blosc2_pthread_cond_destroy(&context->delta_cv);
 6206|       |    blosc2_pthread_mutex_destroy(&context->delta_mutex);
 6207|       |    blosc2_pthread_mutex_destroy(&context->count_mutex);
 6208|       |  }
 6209|       |#endif  /* _WIN32 */
 6210|  12.8k|  else if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL && context->thread_pool != NULL) {
  ------------------
  |  |   34|  25.6k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (6210:12): [True: 0, False: 12.8k]
  |  Branch (6210:68): [True: 0, False: 0]
  ------------------
 6211|      0|    struct blosc_shared_pool *pool = context->thread_pool;
 6212|       |
 6213|      0|    static_lock(&pool_registry_mutex);
  ------------------
  |  |  132|      0|#define static_lock(l) pthread_mutex_lock(l)
  ------------------
 6214|      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 (6214:9): [True: 0, False: 0]
  ------------------
 6215|       |      /* Check under the process-lifetime registry lock: destruction cannot
 6216|       |       * invalidate the pool between this check and the refcount update. */
 6217|      0|      static_unlock(&pool_registry_mutex);
  ------------------
  |  |  133|      0|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 6218|      0|      context->thread_pool = NULL;
 6219|      0|      context->threads_started = 0;
 6220|      0|      context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   33|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 6221|      0|      return 0;
 6222|      0|    }
 6223|       |
 6224|       |    /* A pool that no context uses any more stays registered for the next
 6225|       |     * contexts with the same nthreads: contexts that live for one call
 6226|       |     * (python-blosc2's compress2()/decompress2(), BLOSC_NOLOCK) would otherwise
 6227|       |     * start and join all of its threads every time.  The most recently
 6228|       |     * released unused pools are kept, the others destroyed (the pool moves to
 6229|       |     * the front of the registry); blosc2_free_resources() destroys all. */
 6230|      0|    struct blosc_shared_pool *unused = NULL;
 6231|      0|    pool->context_refs--;
 6232|      0|    if (pool->context_refs == 0) {
  ------------------
  |  Branch (6232:9): [True: 0, False: 0]
  ------------------
 6233|      0|      struct blosc_shared_pool **prev = &shared_pools;
 6234|      0|      while (*prev != NULL && *prev != pool) {
  ------------------
  |  Branch (6234:14): [True: 0, False: 0]
  |  Branch (6234:31): [True: 0, False: 0]
  ------------------
 6235|      0|        prev = &(*prev)->next;
 6236|      0|      }
 6237|      0|      if (*prev == pool) {
  ------------------
  |  Branch (6237:11): [True: 0, False: 0]
  ------------------
 6238|      0|        *prev = pool->next;
 6239|      0|        pool->next = shared_pools;
 6240|      0|        shared_pools = pool;
 6241|      0|      }
 6242|      0|      unused = unlink_unused_pools_locked(BLOSC2_UNUSED_POOLS_MAX);
  ------------------
  |  |  197|      0|#define BLOSC2_UNUSED_POOLS_MAX 2
  ------------------
 6243|      0|    }
 6244|      0|    static_unlock(&pool_registry_mutex);
  ------------------
  |  |  133|      0|#define static_unlock(l) pthread_mutex_unlock(l)
  ------------------
 6245|      0|    destroy_shared_pools(unused);
 6246|      0|    context->thread_pool = NULL;
 6247|      0|  }
 6248|       |
 6249|  12.8k|  context->threads_started = 0;
 6250|  12.8k|  context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   33|  12.8k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 6251|  12.8k|  return 0;
 6252|  12.8k|}
blosc2.c:release_context_dict_buffer:
 3039|  25.2k|static void release_context_dict_buffer(blosc2_context* context) {
 3040|  25.2k|  if (context->dict_buffer_owned && context->dict_buffer != NULL) {
  ------------------
  |  Branch (3040:7): [True: 0, False: 25.2k]
  |  Branch (3040:37): [True: 0, False: 0]
  ------------------
 3041|      0|    free(context->dict_buffer);
 3042|      0|  }
 3043|  25.2k|  context->dict_buffer = NULL;
 3044|       |  context->dict_buffer_owned = false;
 3045|  25.2k|  context->dict_size = 0;
 3046|  25.2k|}

blosclz_decompress:
 2120|  1.28k|int blosclz_decompress(const void* input, int length, void* output, int maxout) {
 2121|  1.28k|#if defined(BLOSCLZ_AVX2_ENABLED) && !defined(__AVX2__)
 2122|  1.28k|  if (blosc_cpu_has_avx2()) {
  ------------------
  |  Branch (2122:7): [True: 1.28k, False: 0]
  ------------------
 2123|  1.28k|    return blosclz_decompress_avx2(input, length, output, maxout);
 2124|  1.28k|  }
 2125|      0|#endif
 2126|      0|  return blosclz_decompress_impl(input, length, output, maxout);
 2127|  1.28k|}
blosclz_decompress_avx2:
 2089|  1.28k|int blosclz_decompress_avx2(const void* input, int length, void* output, int maxout) {
 2090|  1.28k|  return blosclz_decompress_impl(input, length, output, maxout);
 2091|  1.28k|}
blosclz-avx2.c:blosclz_decompress_impl:
 1949|  1.28k|static inline int blosclz_decompress_impl(const void* input, int length, void* output, int maxout) {
 1950|  1.28k|  const uint8_t* ip = (const uint8_t*)input;
 1951|  1.28k|  const uint8_t* ip_limit = ip + length;
 1952|  1.28k|  uint8_t* op = (uint8_t*)output;
 1953|  1.28k|  uint32_t ctrl;
 1954|  1.28k|  uint8_t* op_limit = op + maxout;
 1955|  1.28k|  if (BLOSCLZ_UNLIKELY(length == 0)) {
  ------------------
  |  |   52|  1.28k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (52:30): [True: 0, False: 1.28k]
  |  |  ------------------
  ------------------
 1956|      0|    return 0;
 1957|      0|  }
 1958|  1.28k|  ctrl = (*ip++) & 31U;
 1959|       |
 1960|  2.39M|  while (1) {
  ------------------
  |  Branch (1960:10): [True: 2.39M, Folded]
  ------------------
 1961|  2.39M|    if (ctrl >= 32) {
  ------------------
  |  Branch (1961:9): [True: 389k, False: 2.00M]
  ------------------
 1962|       |      // match
 1963|   389k|      int32_t len = (int32_t)(ctrl >> 5U) - 1 ;
 1964|   389k|      int32_t ofs = (int32_t)(ctrl & 31U) << 8U;
 1965|   389k|      uint8_t code;
 1966|   389k|      const uint8_t* ref;
 1967|       |
 1968|   389k|      if (len == 7 - 1) {
  ------------------
  |  Branch (1968:11): [True: 113k, False: 276k]
  ------------------
 1969|   113k|#ifdef BLOSCLZ_WIDE_DECODE
 1970|       |        /* Long runs encode their lengths as consecutive 255-byte extensions.
 1971|       |         * Consume eight together, keeping an offset byte in reserve. */
 1972|   114k|        while (ip_limit - ip >= 9) {
  ------------------
  |  Branch (1972:16): [True: 113k, False: 222]
  ------------------
 1973|   113k|          uint64_t extensions;
 1974|   113k|          memcpy(&extensions, ip, sizeof(extensions));
 1975|   113k|          if (extensions != UINT64_MAX) {
  ------------------
  |  Branch (1975:15): [True: 112k, False: 1.01k]
  ------------------
 1976|   112k|            break;
 1977|   112k|          }
 1978|  1.01k|          if (BLOSCLZ_UNLIKELY(len > maxout - 8 * 255)) {
  ------------------
  |  |   52|  1.01k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (52:30): [True: 14, False: 1.00k]
  |  |  ------------------
  ------------------
 1979|     14|            return 0;
 1980|     14|          }
 1981|  1.00k|          len += 8 * 255;
 1982|  1.00k|          ip += 8;
 1983|  1.00k|        }
 1984|   113k|#endif
 1985|   131k|        do {
 1986|   131k|          if (BLOSCLZ_UNLIKELY(ip + 1 >= ip_limit)) {
  ------------------
  |  |   52|   131k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (52:30): [True: 16, False: 131k]
  |  |  ------------------
  ------------------
 1987|     16|            return 0;
 1988|     16|          }
 1989|   131k|          code = *ip++;
 1990|       |          /* Guard before the addition so that `len` can never wrap past
 1991|       |             INT32_MAX.  The subsequent `len += 3` adds at most 3 more,
 1992|       |             so capping at maxout here is safe and sufficient. */
 1993|   131k|          if (BLOSCLZ_UNLIKELY(len > maxout - code)) {
  ------------------
  |  |   52|   131k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (52:30): [True: 94, False: 131k]
  |  |  ------------------
  ------------------
 1994|     94|            return 0;
 1995|     94|          }
 1996|   131k|          len += code;
 1997|   131k|        } while (code == 255);
  ------------------
  |  Branch (1997:18): [True: 18.0k, False: 113k]
  ------------------
 1998|   113k|      }
 1999|   276k|      else {
 2000|   276k|        if (BLOSCLZ_UNLIKELY(ip + 1 >= ip_limit)) {
  ------------------
  |  |   52|   276k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (52:30): [True: 49, False: 276k]
  |  |  ------------------
  ------------------
 2001|     49|          return 0;
 2002|     49|        }
 2003|   276k|      }
 2004|   389k|      code = *ip++;
 2005|   389k|      len += 3;
 2006|   389k|      ofs += code;
 2007|       |
 2008|       |      /* match from 16-bit distance: ofs == (31 << 8) && code == 255 iff ofs + code == MAX_DISTANCE */
 2009|   389k|      if (BLOSCLZ_UNLIKELY(ofs == MAX_DISTANCE)) {
  ------------------
  |  |   52|   389k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (52:30): [True: 2.38k, False: 387k]
  |  |  ------------------
  ------------------
 2010|  2.38k|        if (ip + 1 >= ip_limit) {
  ------------------
  |  Branch (2010:13): [True: 2, False: 2.38k]
  ------------------
 2011|      2|          return 0;
 2012|      2|        }
 2013|  2.38k|        ofs = (*ip++) << 8U;
 2014|  2.38k|        ofs += *ip++;
 2015|  2.38k|        ofs += MAX_DISTANCE;
  ------------------
  |  |   63|  2.38k|#define MAX_DISTANCE 8191
  ------------------
 2016|  2.38k|      }
 2017|   389k|      ref = op - ofs;
 2018|       |
 2019|   389k|      if (BLOSCLZ_UNLIKELY(len > op_limit - op)) {
  ------------------
  |  |   52|   389k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (52:30): [True: 189, False: 389k]
  |  |  ------------------
  ------------------
 2020|    189|        return 0;
 2021|    189|      }
 2022|       |
 2023|   389k|      if (BLOSCLZ_UNLIKELY(ref <= (uint8_t*)output)) {
  ------------------
  |  |   52|   389k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (52:30): [True: 103, False: 389k]
  |  |  ------------------
  ------------------
 2024|    103|        return 0;
 2025|    103|      }
 2026|       |
 2027|   389k|      if (BLOSCLZ_UNLIKELY(ip >= ip_limit)) break;
  ------------------
  |  |   52|   389k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (52:30): [True: 2, False: 389k]
  |  |  ------------------
  ------------------
 2028|   389k|      ctrl = *ip++;
 2029|       |
 2030|   389k|      ref--;
 2031|   389k|#if defined(__aarch64__) || defined(_M_ARM64) || defined(__AVX2__) || defined(__SSSE3__)
 2032|   389k|      if (len <= 32 && op_limit - op >= 32) {
  ------------------
  |  Branch (2032:11): [True: 336k, False: 53.2k]
  |  Branch (2032:24): [True: 334k, False: 1.14k]
  ------------------
 2033|   334k|        blosclz_copy_short_match(op, ref, len);
 2034|   334k|        op += len;
 2035|   334k|        continue;
 2036|   334k|      }
 2037|  54.3k|#endif
 2038|  54.3k|#if defined(__AVX2__)
 2039|  54.3k|      op = blosclz_copy_match_avx2(op, ref, len, op_limit);
 2040|       |#elif defined(__SSE2__) || defined(__x86_64__) || defined(_M_X64)
 2041|       |      op = blosclz_copy_match_sse2(op, ref, len, op_limit);
 2042|       |#elif defined(__aarch64__) || defined(_M_ARM64)
 2043|       |      op = blosclz_copy_match_neon(op, ref, len, op_limit);
 2044|       |#else
 2045|       |      if (ref == op - 1) {
 2046|       |        /* optimized copy for a run */
 2047|       |        memset(op, *ref, len);
 2048|       |        op += len;
 2049|       |      }
 2050|       |      else if ((op - ref >= 8) && (op_limit - op - len >= 8)) {
 2051|       |        // copy with an overlap not larger than 8
 2052|       |        wild_copy(op, ref, op + len);
 2053|       |        op += len;
 2054|       |      }
 2055|       |      else {
 2056|       |        op = copy_match(op, ref, (unsigned) len);
 2057|       |      }
 2058|       |#endif
 2059|  54.3k|    }
 2060|  2.00M|    else {
 2061|       |      // literal
 2062|  2.00M|      ctrl++;
 2063|  2.00M|#ifdef BLOSCLZ_WIDE_DECODE
 2064|       |      /* All literal lengths fit in one fixed-size copy when both buffers have room. */
 2065|  2.00M|      if (op_limit - op >= 32 && ip_limit - ip >= 32) {
  ------------------
  |  Branch (2065:11): [True: 1.99M, False: 3.84k]
  |  Branch (2065:34): [True: 1.99M, False: 1.67k]
  ------------------
 2066|  1.99M|        memcpy(op, ip, 32);
 2067|  1.99M|      }
 2068|  5.51k|      else
 2069|  5.51k|#endif
 2070|  5.51k|      {
 2071|  5.51k|        if (BLOSCLZ_UNLIKELY(ctrl > op_limit - op || ctrl > ip_limit - ip)) {
  ------------------
  |  |   52|  10.8k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (52:31): [True: 151, False: 5.36k]
  |  |  |  Branch (52:31): [True: 29, False: 5.33k]
  |  |  ------------------
  ------------------
 2072|    180|          return 0;
 2073|    180|        }
 2074|  5.33k|        memcpy(op, ip, ctrl);
 2075|  5.33k|      }
 2076|  2.00M|      op += ctrl; ip += ctrl;
 2077|       |
 2078|  2.00M|      if (BLOSCLZ_UNLIKELY(ip >= ip_limit)) break;
  ------------------
  |  |   52|  2.00M|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (52:30): [True: 640, False: 2.00M]
  |  |  ------------------
  ------------------
 2079|  2.00M|      ctrl = *ip++;
 2080|  2.00M|    }
 2081|  2.39M|  }
 2082|       |
 2083|    642|  return (int)(op - (uint8_t*)output);
 2084|  1.28k|}
blosclz-avx2.c:blosclz_copy_short_match:
 1308|   334k|BLOSCLZ_ALWAYS_INLINE void blosclz_copy_short_match(uint8_t *op, const uint8_t *ref, int32_t len) {
 1309|   334k|  ptrdiff_t dist = op - ref;
 1310|       |  /* Row d repeats the first d bytes. Row zero is the identity for distances
 1311|       |   * of at least 16, where each vector load already contains the next 16 bytes. */
 1312|   334k|  static const uint8_t repeat[16][16] = {
 1313|   334k|    {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
 1314|   334k|    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
 1315|   334k|    {0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1},
 1316|   334k|    {0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0},
 1317|   334k|    {0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3},
 1318|   334k|    {0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0},
 1319|   334k|    {0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3},
 1320|   334k|    {0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 0, 1},
 1321|   334k|    {0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7},
 1322|   334k|    {0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 6},
 1323|   334k|    {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5},
 1324|   334k|    {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 1, 2, 3, 4},
 1325|   334k|    {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3},
 1326|   334k|    {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 1, 2},
 1327|   334k|    {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 1},
 1328|   334k|    {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0},
 1329|   334k|  };
 1330|       |
 1331|       |  /* Compute the repeat-table row branchlessly (row 0 is identity for dist >= 16)
 1332|       |   * so GCC does not emit a mispredicting branch on dist < 16. */
 1333|   334k|  size_t row = (size_t)dist & ((size_t)0 - (size_t)(dist < 16));
 1334|       |#if defined(__aarch64__) || defined(_M_ARM64)
 1335|       |  uint8x16_t index = vld1q_u8(repeat[row]);
 1336|       |  vst1q_u8(op, vqtbl1q_u8(vld1q_u8(ref), index));
 1337|       |  if (len > 16) {
 1338|       |    vst1q_u8(op + 16, vqtbl1q_u8(vld1q_u8(ref + 16), index));
 1339|       |  }
 1340|       |#else
 1341|   334k|  __m128i index = _mm_loadu_si128((const __m128i *)repeat[row]);
 1342|   334k|  _mm_storeu_si128((__m128i *)op, _mm_shuffle_epi8(_mm_loadu_si128((const __m128i *)ref), index));
 1343|   334k|  if (len > 16) {
  ------------------
  |  Branch (1343:7): [True: 19.6k, False: 315k]
  ------------------
 1344|  19.6k|    _mm_storeu_si128((__m128i *)(op + 16), _mm_shuffle_epi8(_mm_loadu_si128((const __m128i *)(ref + 16)), index));
 1345|  19.6k|  }
 1346|   334k|#endif
 1347|   334k|}
blosclz-avx2.c:blosclz_copy_match_avx2:
 1356|  54.3k|    uint8_t *op, const uint8_t *ref, int32_t len, uint8_t *op_limit) {
 1357|  54.3k|  ptrdiff_t dist = op - ref;
 1358|  54.3k|  uint8_t *end = op + len;
 1359|       |
 1360|  54.3k|  if (dist >= 32) {
  ------------------
  |  Branch (1360:7): [True: 23.9k, False: 30.3k]
  ------------------
 1361|       |    /* Short match overcopies when output slack permits (subsequent tokens overwrite excess). */
 1362|  23.9k|    if (len <= 16 && op_limit - op >= 16) {
  ------------------
  |  Branch (1362:9): [True: 121, False: 23.8k]
  |  Branch (1362:22): [True: 48, False: 73]
  ------------------
 1363|     48|      _mm_storeu_si128((__m128i *)op, _mm_loadu_si128((const __m128i *)ref));
 1364|     48|      return end;
 1365|     48|    }
 1366|  23.9k|    if (len <= 32 && op_limit - op >= 32) {
  ------------------
  |  Branch (1366:9): [True: 75, False: 23.8k]
  |  Branch (1366:22): [True: 0, False: 75]
  ------------------
 1367|      0|      _mm256_storeu_si256((__m256i *)op, _mm256_loadu_si256((const __m256i *)ref));
 1368|      0|      return end;
 1369|      0|    }
 1370|  23.9k|    if (len <= 64 && op_limit - op >= 64) {
  ------------------
  |  Branch (1370:9): [True: 4.71k, False: 19.1k]
  |  Branch (1370:22): [True: 4.62k, False: 88]
  ------------------
 1371|  4.62k|      _mm256_storeu_si256((__m256i *)op, _mm256_loadu_si256((const __m256i *)ref));
 1372|  4.62k|      _mm256_storeu_si256((__m256i *)(op + 32), _mm256_loadu_si256((const __m256i *)(ref + 32)));
 1373|  4.62k|      return end;
 1374|  4.62k|    }
 1375|  19.2k|    if (len >= 32) {
  ------------------
  |  Branch (1375:9): [True: 19.2k, False: 75]
  ------------------
 1376|  19.2k|      uint8_t *cur = op;
 1377|  19.2k|      const uint8_t *src = ref;
 1378|  19.2k|      if (dist >= 128) {
  ------------------
  |  Branch (1378:11): [True: 18.6k, False: 539]
  ------------------
 1379|       |        /* Non-overlapping 128B blocks: batch 4x32B loads before stores in 256B/128B steps. */
 1380|  44.4k|        while (cur + 256 <= end) {
  ------------------
  |  Branch (1380:16): [True: 25.8k, False: 18.6k]
  ------------------
 1381|  25.8k|          __m256i v0 = _mm256_loadu_si256((const __m256i *)src);
 1382|  25.8k|          __m256i v1 = _mm256_loadu_si256((const __m256i *)(src + 32));
 1383|  25.8k|          __m256i v2 = _mm256_loadu_si256((const __m256i *)(src + 64));
 1384|  25.8k|          __m256i v3 = _mm256_loadu_si256((const __m256i *)(src + 96));
 1385|  25.8k|          _mm256_storeu_si256((__m256i *)cur, v0);
 1386|  25.8k|          _mm256_storeu_si256((__m256i *)(cur + 32), v1);
 1387|  25.8k|          _mm256_storeu_si256((__m256i *)(cur + 64), v2);
 1388|  25.8k|          _mm256_storeu_si256((__m256i *)(cur + 96), v3);
 1389|  25.8k|          __m256i v4 = _mm256_loadu_si256((const __m256i *)(src + 128));
 1390|  25.8k|          __m256i v5 = _mm256_loadu_si256((const __m256i *)(src + 160));
 1391|  25.8k|          __m256i v6 = _mm256_loadu_si256((const __m256i *)(src + 192));
 1392|  25.8k|          __m256i v7 = _mm256_loadu_si256((const __m256i *)(src + 224));
 1393|  25.8k|          _mm256_storeu_si256((__m256i *)(cur + 128), v4);
 1394|  25.8k|          _mm256_storeu_si256((__m256i *)(cur + 160), v5);
 1395|  25.8k|          _mm256_storeu_si256((__m256i *)(cur + 192), v6);
 1396|  25.8k|          _mm256_storeu_si256((__m256i *)(cur + 224), v7);
 1397|  25.8k|          cur += 256;
 1398|  25.8k|          src += 256;
 1399|  25.8k|        }
 1400|  18.6k|        if (cur + 128 <= end) {
  ------------------
  |  Branch (1400:13): [True: 9.42k, False: 9.24k]
  ------------------
 1401|  9.42k|          __m256i v0 = _mm256_loadu_si256((const __m256i *)src);
 1402|  9.42k|          __m256i v1 = _mm256_loadu_si256((const __m256i *)(src + 32));
 1403|  9.42k|          __m256i v2 = _mm256_loadu_si256((const __m256i *)(src + 64));
 1404|  9.42k|          __m256i v3 = _mm256_loadu_si256((const __m256i *)(src + 96));
 1405|  9.42k|          _mm256_storeu_si256((__m256i *)cur, v0);
 1406|  9.42k|          _mm256_storeu_si256((__m256i *)(cur + 32), v1);
 1407|  9.42k|          _mm256_storeu_si256((__m256i *)(cur + 64), v2);
 1408|  9.42k|          _mm256_storeu_si256((__m256i *)(cur + 96), v3);
 1409|  9.42k|          cur += 128;
 1410|  9.42k|          src += 128;
 1411|  9.42k|        }
 1412|  18.6k|      }
 1413|    539|      else {
 1414|       |        /* Keep each 32B load/store ordered so distances in [32, 128) propagate safely. */
 1415|  1.24k|        while (cur + 128 <= end) {
  ------------------
  |  Branch (1415:16): [True: 708, False: 539]
  ------------------
 1416|    708|          _mm256_storeu_si256((__m256i *)cur, _mm256_loadu_si256((const __m256i *)src));
 1417|    708|          _mm256_storeu_si256((__m256i *)(cur + 32), _mm256_loadu_si256((const __m256i *)(src + 32)));
 1418|    708|          _mm256_storeu_si256((__m256i *)(cur + 64), _mm256_loadu_si256((const __m256i *)(src + 64)));
 1419|    708|          _mm256_storeu_si256((__m256i *)(cur + 96), _mm256_loadu_si256((const __m256i *)(src + 96)));
 1420|    708|          cur += 128;
 1421|    708|          src += 128;
 1422|    708|        }
 1423|    539|      }
 1424|       |      /* Finish remaining <128B using 64B/32B steps and an exact overlapping 32B tail. */
 1425|  19.2k|      if (cur + 64 <= end) {
  ------------------
  |  Branch (1425:11): [True: 8.39k, False: 10.8k]
  ------------------
 1426|  8.39k|        _mm256_storeu_si256((__m256i *)cur, _mm256_loadu_si256((const __m256i *)src));
 1427|  8.39k|        _mm256_storeu_si256((__m256i *)(cur + 32), _mm256_loadu_si256((const __m256i *)(src + 32)));
 1428|  8.39k|        cur += 64;
 1429|  8.39k|        src += 64;
 1430|  8.39k|      }
 1431|  19.2k|      if (cur + 32 <= end) {
  ------------------
  |  Branch (1431:11): [True: 7.06k, False: 12.1k]
  ------------------
 1432|  7.06k|        _mm256_storeu_si256((__m256i *)cur, _mm256_loadu_si256((const __m256i *)src));
 1433|  7.06k|        cur += 32;
 1434|  7.06k|      }
 1435|  19.2k|      if (cur < end) {
  ------------------
  |  Branch (1435:11): [True: 18.0k, False: 1.13k]
  ------------------
 1436|  18.0k|        _mm256_storeu_si256((__m256i *)(end - 32), _mm256_loadu_si256((const __m256i *)(ref + len - 32)));
 1437|  18.0k|      }
 1438|  19.2k|      return end;
 1439|  19.2k|    }
 1440|       |    /* Exact 16..31-byte copy near end of buffer using two overlapping 16B stores. */
 1441|     75|    if (len >= 16) {
  ------------------
  |  Branch (1441:9): [True: 2, False: 73]
  ------------------
 1442|      2|      _mm_storeu_si128((__m128i *)op, _mm_loadu_si128((const __m128i *)ref));
 1443|      2|      _mm_storeu_si128((__m128i *)(end - 16), _mm_loadu_si128((const __m128i *)(ref + len - 16)));
 1444|      2|      return end;
 1445|      2|    }
 1446|     73|    return copy_match(op, ref, (unsigned)len);
 1447|     75|  }
 1448|       |
 1449|  30.3k|  if (dist >= 16) {
  ------------------
  |  Branch (1449:7): [True: 970, False: 29.4k]
  ------------------
 1450|       |    /* 16..31-byte overlap distance: single 16B overcopy for short matches. */
 1451|    970|    if (len <= 16 && op_limit - op >= 16) {
  ------------------
  |  Branch (1451:9): [True: 166, False: 804]
  |  Branch (1451:22): [True: 45, False: 121]
  ------------------
 1452|     45|      _mm_storeu_si128((__m128i *)op, _mm_loadu_si128((const __m128i *)ref));
 1453|     45|      return end;
 1454|     45|    }
 1455|    925|    if (len >= 32) {
  ------------------
  |  Branch (1455:9): [True: 793, False: 132]
  ------------------
 1456|       |      /* Seed first dist bytes so wide_dist = 2 * dist >= 32, enabling 32B AVX2 copies. */
 1457|    793|      _mm_storeu_si128((__m128i *)op, _mm_loadu_si128((const __m128i *)ref));
 1458|    793|      _mm_storeu_si128((__m128i *)(op + dist - 16), _mm_loadu_si128((const __m128i *)(ref + dist - 16)));
 1459|    793|      uint8_t *cur = op + dist;
 1460|    793|      const uint8_t *src = ref;
 1461|    793|      ptrdiff_t wide_dist = dist * 2;
 1462|  1.79k|      while (cur + 64 <= end) {
  ------------------
  |  Branch (1462:14): [True: 1.00k, False: 793]
  ------------------
 1463|  1.00k|        _mm256_storeu_si256((__m256i *)cur, _mm256_loadu_si256((const __m256i *)src));
 1464|  1.00k|        _mm256_storeu_si256((__m256i *)(cur + 32), _mm256_loadu_si256((const __m256i *)(src + 32)));
 1465|  1.00k|        cur += 64;
 1466|  1.00k|        src += 64;
 1467|  1.00k|      }
 1468|    793|      if (cur + 32 <= end) {
  ------------------
  |  Branch (1468:11): [True: 371, False: 422]
  ------------------
 1469|    371|        _mm256_storeu_si256((__m256i *)cur, _mm256_loadu_si256((const __m256i *)src));
 1470|    371|        cur += 32;
 1471|    371|        src += 32;
 1472|    371|      }
 1473|       |      /* Overlapping 32B tail if the wide loop ran; otherwise finish safely with 16B ops. */
 1474|    793|      if (cur < end) {
  ------------------
  |  Branch (1474:11): [True: 567, False: 226]
  ------------------
 1475|    567|        if (cur > op + dist) {
  ------------------
  |  Branch (1475:13): [True: 213, False: 354]
  ------------------
 1476|    213|          _mm256_storeu_si256((__m256i *)(end - 32), _mm256_loadu_si256((const __m256i *)(end - 32 - wide_dist)));
 1477|    213|        }
 1478|    354|        else {
 1479|    354|          if (cur + 16 <= end) {
  ------------------
  |  Branch (1479:15): [True: 250, False: 104]
  ------------------
 1480|    250|            _mm_storeu_si128((__m128i *)cur, _mm_loadu_si128((const __m128i *)src));
 1481|    250|            cur += 16;
 1482|    250|          }
 1483|    354|          if (cur < end) {
  ------------------
  |  Branch (1483:15): [True: 274, False: 80]
  ------------------
 1484|    274|            _mm_storeu_si128((__m128i *)(end - 16), _mm_loadu_si128((const __m128i *)(end - 16 - dist)));
 1485|    274|          }
 1486|    354|        }
 1487|    567|      }
 1488|    793|      return end;
 1489|    793|    }
 1490|       |    /* Exact 16..31-byte copy with two overlapping 16B stores. */
 1491|    132|    if (len >= 16) {
  ------------------
  |  Branch (1491:9): [True: 11, False: 121]
  ------------------
 1492|     11|      _mm_storeu_si128((__m128i *)op, _mm_loadu_si128((const __m128i *)ref));
 1493|     11|      if (len > 16) {
  ------------------
  |  Branch (1493:11): [True: 11, False: 0]
  ------------------
 1494|     11|        _mm_storeu_si128((__m128i *)(end - 16), _mm_loadu_si128((const __m128i *)(ref + len - 16)));
 1495|     11|      }
 1496|     11|      return end;
 1497|     11|    }
 1498|    121|    return copy_match(op, ref, (unsigned)len);
 1499|    132|  }
 1500|       |
 1501|  29.4k|  if (dist == 1) {
  ------------------
  |  Branch (1501:7): [True: 4.10k, False: 25.3k]
  ------------------
 1502|       |    /* Inline AVX2 RLE fills up to 256B to avoid memset call overhead; longer runs use memset. */
 1503|  4.10k|    if (len <= 32 && op_limit - op >= 32) {
  ------------------
  |  Branch (1503:9): [True: 202, False: 3.90k]
  |  Branch (1503:22): [True: 0, False: 202]
  ------------------
 1504|      0|      _mm256_storeu_si256((__m256i *)op, _mm256_set1_epi8((char)*ref));
 1505|      0|      return end;
 1506|      0|    }
 1507|  4.10k|    if (len <= 64 && op_limit - op >= 64) {
  ------------------
  |  Branch (1507:9): [True: 1.51k, False: 2.59k]
  |  Branch (1507:22): [True: 1.29k, False: 218]
  ------------------
 1508|  1.29k|      __m256i v = _mm256_set1_epi8((char)*ref);
 1509|  1.29k|      _mm256_storeu_si256((__m256i *)op, v);
 1510|  1.29k|      _mm256_storeu_si256((__m256i *)(op + 32), v);
 1511|  1.29k|      return end;
 1512|  1.29k|    }
 1513|  2.81k|    if (len >= 32 && len <= 256) {
  ------------------
  |  Branch (1513:9): [True: 2.60k, False: 202]
  |  Branch (1513:22): [True: 2.39k, False: 213]
  ------------------
 1514|  2.39k|      __m256i v = _mm256_set1_epi8((char)*ref);
 1515|  2.39k|      uint8_t *cur = op;
 1516|  5.88k|      while (cur + 64 <= end) {
  ------------------
  |  Branch (1516:14): [True: 3.48k, False: 2.39k]
  ------------------
 1517|  3.48k|        _mm256_storeu_si256((__m256i *)cur, v);
 1518|  3.48k|        _mm256_storeu_si256((__m256i *)(cur + 32), v);
 1519|  3.48k|        cur += 64;
 1520|  3.48k|      }
 1521|  2.39k|      if (cur + 32 <= end) {
  ------------------
  |  Branch (1521:11): [True: 190, False: 2.20k]
  ------------------
 1522|    190|        _mm256_storeu_si256((__m256i *)cur, v);
 1523|    190|        cur += 32;
 1524|    190|      }
 1525|  2.39k|      if (cur < end) {
  ------------------
  |  Branch (1525:11): [True: 2.21k, False: 178]
  ------------------
 1526|  2.21k|        _mm256_storeu_si256((__m256i *)(end - 32), v);
 1527|  2.21k|      }
 1528|  2.39k|      return end;
 1529|  2.39k|    }
 1530|    415|    memset(op, *ref, (size_t)len);
 1531|    415|    return end;
 1532|  2.81k|  }
 1533|       |
 1534|  25.3k|  if (dist >= 8) {
  ------------------
  |  Branch (1534:7): [True: 2.53k, False: 22.7k]
  ------------------
 1535|       |    /* 8..15-byte overlap distance: fast short copies, or double distance to >=16B for loops. */
 1536|  2.53k|    if (len <= dist && op_limit - op >= 16) {
  ------------------
  |  Branch (1536:9): [True: 120, False: 2.41k]
  |  Branch (1536:24): [True: 33, False: 87]
  ------------------
 1537|     33|      _mm_storeu_si128((__m128i *)op, _mm_loadu_si128((const __m128i *)ref));
 1538|     33|      return end;
 1539|     33|    }
 1540|  2.50k|    if (len <= 16 && op_limit - op >= 16) {
  ------------------
  |  Branch (1540:9): [True: 112, False: 2.39k]
  |  Branch (1540:22): [True: 20, False: 92]
  ------------------
 1541|     20|      memcpy(op, ref, 8);
 1542|     20|      memcpy(op + 8, ref + 8, 8);
 1543|     20|      return end;
 1544|     20|    }
 1545|  2.48k|    if (len > 16) {
  ------------------
  |  Branch (1545:9): [True: 2.39k, False: 92]
  ------------------
 1546|       |      /* Seed first dist bytes so wide_dist = 2 * dist >= 16. */
 1547|  2.39k|      _mm_storeu_si128((__m128i *)op, _mm_loadu_si128((const __m128i *)ref));
 1548|  2.39k|      uint8_t *cur = op + dist;
 1549|  2.39k|      const uint8_t *src = ref;
 1550|  2.39k|      ptrdiff_t wide_dist = dist * 2;
 1551|  9.26k|      while (cur + 16 <= end) {
  ------------------
  |  Branch (1551:14): [True: 6.87k, False: 2.39k]
  ------------------
 1552|  6.87k|        _mm_storeu_si128((__m128i *)cur, _mm_loadu_si128((const __m128i *)src));
 1553|  6.87k|        cur += 16;
 1554|  6.87k|        src += 16;
 1555|  6.87k|      }
 1556|       |      /* Finish tail via overlapping 16B copy if wide loop ran, else bytewise fallback. */
 1557|  2.39k|      if (cur < end) {
  ------------------
  |  Branch (1557:11): [True: 1.86k, False: 526]
  ------------------
 1558|  1.86k|        if (cur > op + dist) {
  ------------------
  |  Branch (1558:13): [True: 1.83k, False: 27]
  ------------------
 1559|  1.83k|          _mm_storeu_si128((__m128i *)(end - 16), _mm_loadu_si128((const __m128i *)(end - 16 - wide_dist)));
 1560|  1.83k|        }
 1561|     27|        else {
 1562|    225|          while (cur < end) {
  ------------------
  |  Branch (1562:18): [True: 198, False: 27]
  ------------------
 1563|    198|            *cur++ = *src++;
 1564|    198|          }
 1565|     27|        }
 1566|  1.86k|      }
 1567|  2.39k|      return end;
 1568|  2.39k|    }
 1569|     92|    return copy_match(op, ref, (unsigned)len);
 1570|  2.48k|  }
 1571|       |
 1572|  22.7k|  if ((dist == 2 || dist == 4) && len >= 16) {
  ------------------
  |  Branch (1572:8): [True: 10.0k, False: 12.7k]
  |  Branch (1572:21): [True: 8.00k, False: 4.71k]
  |  Branch (1572:35): [True: 17.7k, False: 306]
  ------------------
 1573|  17.7k|    __m256i v256;
 1574|  17.7k|    if (dist == 2) {
  ------------------
  |  Branch (1574:9): [True: 9.92k, False: 7.83k]
  ------------------
 1575|  9.92k|      int16_t pat2;
 1576|  9.92k|      memcpy(&pat2, ref, sizeof(pat2));
 1577|  9.92k|      v256 = _mm256_set1_epi16(pat2);
 1578|  9.92k|    }
 1579|  7.83k|    else {
 1580|  7.83k|      int32_t pat4;
 1581|  7.83k|      memcpy(&pat4, ref, sizeof(pat4));
 1582|  7.83k|      v256 = _mm256_set1_epi32(pat4);
 1583|  7.83k|    }
 1584|  17.7k|    __m128i v128 = _mm256_castsi256_si128(v256);
 1585|  17.7k|    uint8_t *cur = op;
 1586|  46.8k|    while (cur + 64 <= end) {
  ------------------
  |  Branch (1586:12): [True: 29.0k, False: 17.7k]
  ------------------
 1587|  29.0k|      _mm256_storeu_si256((__m256i *)cur, v256);
 1588|  29.0k|      _mm256_storeu_si256((__m256i *)(cur + 32), v256);
 1589|  29.0k|      cur += 64;
 1590|  29.0k|    }
 1591|  17.7k|    if (cur + 32 <= end) {
  ------------------
  |  Branch (1591:9): [True: 9.59k, False: 8.16k]
  ------------------
 1592|  9.59k|      _mm256_storeu_si256((__m256i *)cur, v256);
 1593|  9.59k|      cur += 32;
 1594|  9.59k|    }
 1595|  17.7k|    if (cur + 16 <= end) {
  ------------------
  |  Branch (1595:9): [True: 4.71k, False: 13.0k]
  ------------------
 1596|  4.71k|      _mm_storeu_si128((__m128i *)cur, v128);
 1597|  4.71k|      cur += 16;
 1598|  4.71k|    }
 1599|  17.7k|    if (cur < end) {
  ------------------
  |  Branch (1599:9): [True: 16.5k, False: 1.19k]
  ------------------
 1600|  16.5k|      if (op_limit - cur >= 16) {
  ------------------
  |  Branch (1600:11): [True: 16.5k, False: 41]
  ------------------
 1601|  16.5k|        _mm_storeu_si128((__m128i *)cur, v128);
 1602|  16.5k|      }
 1603|     41|      else {
 1604|     41|        const uint8_t *tail_src = ref;
 1605|    220|        while (cur < end) {
  ------------------
  |  Branch (1605:16): [True: 179, False: 41]
  ------------------
 1606|    179|          *cur++ = *tail_src++;
 1607|    179|        }
 1608|     41|      }
 1609|  16.5k|    }
 1610|  17.7k|    return end;
 1611|  17.7k|  }
 1612|       |
 1613|  5.02k|  return copy_match(op, ref, (unsigned)len);
 1614|  22.7k|}

delta_decoder:
   97|  18.3k|                   int32_t typesize, uint8_t* dest) {
   98|  18.3k|  int32_t i;
   99|       |
  100|  18.3k|  if (offset == 0) {
  ------------------
  |  Branch (100:7): [True: 3.29k, False: 15.0k]
  ------------------
  101|       |    /* Decode delta for the reference block */
  102|  3.29k|    switch (typesize) {
  103|  1.01k|      case 1:
  ------------------
  |  Branch (103:7): [True: 1.01k, False: 2.28k]
  ------------------
  104|  19.9M|        for (i = 1; i < nbytes; i++) {
  ------------------
  |  Branch (104:21): [True: 19.9M, False: 1.01k]
  ------------------
  105|  19.9M|          dest[i] ^= dref[i-1];
  106|  19.9M|        }
  107|  1.01k|        break;
  108|    388|      case 2:
  ------------------
  |  Branch (108:7): [True: 388, False: 2.91k]
  ------------------
  109|  1.38M|        for (i = 1; i < nbytes / 2; i++) {
  ------------------
  |  Branch (109:21): [True: 1.38M, False: 388]
  ------------------
  110|  1.38M|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i-1];
  111|  1.38M|        }
  112|    388|        break;
  113|    302|      case 4:
  ------------------
  |  Branch (113:7): [True: 302, False: 2.99k]
  ------------------
  114|  1.15M|        for (i = 1; i < nbytes / 4; i++) {
  ------------------
  |  Branch (114:21): [True: 1.15M, False: 302]
  ------------------
  115|  1.15M|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i-1];
  116|  1.15M|        }
  117|    302|        break;
  118|    621|      case 8:
  ------------------
  |  Branch (118:7): [True: 621, False: 2.67k]
  ------------------
  119|   449k|        for (i = 1; i < nbytes / 8; i++) {
  ------------------
  |  Branch (119:21): [True: 448k, False: 621]
  ------------------
  120|   448k|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i-1];
  121|   448k|        }
  122|    621|        break;
  123|    972|      default:
  ------------------
  |  Branch (123:7): [True: 972, False: 2.32k]
  ------------------
  124|    972|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (124:13): [True: 330, False: 642]
  ------------------
  125|    330|          delta_decoder(dref, offset, nbytes, 8, dest);
  126|    642|        } else {
  127|    642|          delta_decoder(dref, offset, nbytes, 1, dest);
  128|    642|        }
  129|  3.29k|    }
  130|  15.0k|  } else {
  131|       |    /* Decode delta for the non-reference blocks */
  132|  15.0k|    switch (typesize) {
  133|  4.72k|      case 1:
  ------------------
  |  Branch (133:7): [True: 4.72k, False: 10.3k]
  ------------------
  134|  6.05M|        for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (134:21): [True: 6.05M, False: 4.72k]
  ------------------
  135|  6.05M|          dest[i] ^= dref[i];
  136|  6.05M|        }
  137|  4.72k|        break;
  138|  1.87k|      case 2:
  ------------------
  |  Branch (138:7): [True: 1.87k, False: 13.1k]
  ------------------
  139|  19.5k|        for (i = 0; i < nbytes / 2; i++) {
  ------------------
  |  Branch (139:21): [True: 17.7k, False: 1.87k]
  ------------------
  140|  17.7k|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i];
  141|  17.7k|        }
  142|  1.87k|        break;
  143|  1.98k|      case 4:
  ------------------
  |  Branch (143:7): [True: 1.98k, False: 13.0k]
  ------------------
  144|   239k|        for (i = 0; i < nbytes / 4; i++) {
  ------------------
  |  Branch (144:21): [True: 237k, False: 1.98k]
  ------------------
  145|   237k|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i];
  146|   237k|        }
  147|  1.98k|        break;
  148|  2.49k|      case 8:
  ------------------
  |  Branch (148:7): [True: 2.49k, False: 12.5k]
  ------------------
  149|   143k|        for (i = 0; i < nbytes / 8; i++) {
  ------------------
  |  Branch (149:21): [True: 141k, False: 2.49k]
  ------------------
  150|   141k|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i];
  151|   141k|        }
  152|  2.49k|        break;
  153|  3.94k|      default:
  ------------------
  |  Branch (153:7): [True: 3.94k, False: 11.0k]
  ------------------
  154|  3.94k|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (154:13): [True: 1.27k, False: 2.67k]
  ------------------
  155|  1.27k|          delta_decoder(dref, offset, nbytes, 8, dest);
  156|  2.67k|        } else {
  157|  2.67k|          delta_decoder(dref, offset, nbytes, 1, dest);
  158|  2.67k|        }
  159|  15.0k|    }
  160|  15.0k|  }
  161|  18.3k|}

fastcopy:
  516|    131|unsigned char *fastcopy(unsigned char *out, const unsigned char *from, unsigned len) {
  517|    131|  switch (len) {
  518|      0|    case 32:
  ------------------
  |  Branch (518:5): [True: 0, False: 131]
  ------------------
  519|      0|      return copy_32_bytes(out, from);
  520|      0|    case 16:
  ------------------
  |  Branch (520:5): [True: 0, False: 131]
  ------------------
  521|      0|      return copy_16_bytes(out, from);
  522|     14|    case 8:
  ------------------
  |  Branch (522:5): [True: 14, False: 117]
  ------------------
  523|     14|      return copy_8_bytes(out, from);
  524|    117|    default: {
  ------------------
  |  Branch (524:5): [True: 117, False: 14]
  ------------------
  525|    117|    }
  526|    131|  }
  527|    117|  if (len < 8) {
  ------------------
  |  Branch (527:7): [True: 101, False: 16]
  ------------------
  528|    101|    return copy_bytes(out, from, len);
  529|    101|  }
  530|     16|#if defined(__SSE2__)
  531|     16|  if (len < 16) {
  ------------------
  |  Branch (531:7): [True: 16, False: 0]
  ------------------
  532|     16|    return chunk_memcpy(out, from, len);
  533|     16|  }
  534|      0|#if !defined(__AVX2__)
  535|      0|  return chunk_memcpy_unaligned(out, from, len);
  536|       |#else
  537|       |  if (len < 32) {
  538|       |    return chunk_memcpy_16(out, from, len);
  539|       |  }
  540|       |  return chunk_memcpy_unaligned(out, from, len);
  541|       |#endif  // !__AVX2__
  542|       |#else
  543|       |  return chunk_memcpy(out, from, len);
  544|       |#endif  // __SSE2__
  545|     16|}
copy_match:
  549|  5.31k|unsigned char* copy_match(unsigned char *out, const unsigned char *from, unsigned len) {
  550|       |#if defined(__AVX2__)
  551|       |  unsigned sz = sizeof(__m256i);
  552|       |#elif defined(__SSE2__)
  553|       |  unsigned sz = sizeof(__m128i);
  554|       |#else
  555|       |  unsigned sz = sizeof(uint64_t);
  556|       |#endif
  557|       |
  558|       |#if ((defined(__GNUC__) && BLOSC_GCC_VERSION < 800) && !defined(__clang__) && !defined(__ICC) && !defined(__ICL))
  559|       |  // GCC < 8 in fully optimization mode seems to have problems with the code further below so stop here
  560|       |  for (; len > 0; len--) {
  561|       |    *out++ = *from++;
  562|       |  }
  563|       |  return out;
  564|       |#endif
  565|       |
  566|       |  // If out and from are away more than the size of the copy, then a fastcopy is safe
  567|  5.31k|  unsigned overlap_dist = (unsigned) (out - from);
  568|  5.31k|  if (overlap_dist > sz) {
  ------------------
  |  Branch (568:7): [True: 131, False: 5.17k]
  ------------------
  569|    131|    return fastcopy(out, from, len);
  570|    131|  }
  571|       |
  572|       |  // Otherwise we need to be more careful so as not to overwrite destination
  573|  5.17k|  switch (overlap_dist) {
  574|      0|    case 32:
  ------------------
  |  Branch (574:5): [True: 0, False: 5.17k]
  ------------------
  575|      0|      for (; len >= 32; len -= 32) {
  ------------------
  |  Branch (575:14): [True: 0, False: 0]
  ------------------
  576|      0|        out = copy_32_bytes(out, from);
  577|      0|      }
  578|      0|      break;
  579|      0|    case 30:
  ------------------
  |  Branch (579:5): [True: 0, False: 5.17k]
  ------------------
  580|      0|      for (; len >= 30; len -= 30) {
  ------------------
  |  Branch (580:14): [True: 0, False: 0]
  ------------------
  581|      0|        out = copy_16_bytes(out, from);
  582|      0|        out = copy_8_bytes(out, from + 16);
  583|      0|        out = copy_4_bytes(out, from + 24);
  584|      0|        out = copy_2_bytes(out, from + 28);
  585|      0|      }
  586|      0|      break;
  587|      0|    case 28:
  ------------------
  |  Branch (587:5): [True: 0, False: 5.17k]
  ------------------
  588|      0|      for (; len >= 28; len -= 28) {
  ------------------
  |  Branch (588:14): [True: 0, False: 0]
  ------------------
  589|      0|        out = copy_16_bytes(out, from);
  590|      0|        out = copy_8_bytes(out, from + 16);
  591|      0|        out = copy_4_bytes(out, from + 24);
  592|      0|      }
  593|      0|      break;
  594|      0|    case 26:
  ------------------
  |  Branch (594:5): [True: 0, False: 5.17k]
  ------------------
  595|      0|      for (; len >= 26; len -= 26) {
  ------------------
  |  Branch (595:14): [True: 0, False: 0]
  ------------------
  596|      0|        out = copy_16_bytes(out, from);
  597|      0|        out = copy_8_bytes(out, from + 16);
  598|      0|        out = copy_2_bytes(out, from + 24);
  599|      0|      }
  600|      0|      break;
  601|      0|    case 24:
  ------------------
  |  Branch (601:5): [True: 0, False: 5.17k]
  ------------------
  602|      0|      for (; len >= 24; len -= 24) {
  ------------------
  |  Branch (602:14): [True: 0, False: 0]
  ------------------
  603|      0|        out = copy_16_bytes(out, from);
  604|      0|        out = copy_8_bytes(out, from + 16);
  605|      0|      }
  606|      0|      break;
  607|      0|    case 22:
  ------------------
  |  Branch (607:5): [True: 0, False: 5.17k]
  ------------------
  608|      0|      for (; len >= 22; len -= 22) {
  ------------------
  |  Branch (608:14): [True: 0, False: 0]
  ------------------
  609|      0|        out = copy_16_bytes(out, from);
  610|      0|        out = copy_4_bytes(out, from + 16);
  611|      0|        out = copy_2_bytes(out, from + 20);
  612|      0|      }
  613|      0|      break;
  614|      0|    case 20:
  ------------------
  |  Branch (614:5): [True: 0, False: 5.17k]
  ------------------
  615|      0|      for (; len >= 20; len -= 20) {
  ------------------
  |  Branch (615:14): [True: 0, False: 0]
  ------------------
  616|      0|        out = copy_16_bytes(out, from);
  617|      0|        out = copy_4_bytes(out, from + 16);
  618|      0|      }
  619|      0|      break;
  620|      0|    case 18:
  ------------------
  |  Branch (620:5): [True: 0, False: 5.17k]
  ------------------
  621|      0|      for (; len >= 18; len -= 18) {
  ------------------
  |  Branch (621:14): [True: 0, False: 0]
  ------------------
  622|      0|        out = copy_16_bytes(out, from);
  623|      0|        out = copy_2_bytes(out, from + 16);
  624|      0|      }
  625|      0|      break;
  626|     63|    case 16:
  ------------------
  |  Branch (626:5): [True: 63, False: 5.11k]
  ------------------
  627|     63|      for (; len >= 16; len -= 16) {
  ------------------
  |  Branch (627:14): [True: 0, False: 63]
  ------------------
  628|      0|        out = copy_16_bytes(out, from);
  629|      0|      }
  630|     63|      break;
  631|     60|    case 8:
  ------------------
  |  Branch (631:5): [True: 60, False: 5.11k]
  ------------------
  632|     72|      for (; len >= 8; len -= 8) {
  ------------------
  |  Branch (632:14): [True: 12, False: 60]
  ------------------
  633|     12|        out = copy_8_bytes(out, from);
  634|     12|      }
  635|     60|      break;
  636|    170|    case 4:
  ------------------
  |  Branch (636:5): [True: 170, False: 5.00k]
  ------------------
  637|    390|      for (; len >= 4; len -= 4) {
  ------------------
  |  Branch (637:14): [True: 220, False: 170]
  ------------------
  638|    220|        out = copy_4_bytes(out, from);
  639|    220|      }
  640|    170|      break;
  641|    136|    case 2:
  ------------------
  |  Branch (641:5): [True: 136, False: 5.04k]
  ------------------
  642|    451|      for (; len >= 2; len -= 2) {
  ------------------
  |  Branch (642:14): [True: 315, False: 136]
  ------------------
  643|    315|        out = copy_2_bytes(out, from);
  644|    315|      }
  645|    136|      break;
  646|  4.75k|    default:
  ------------------
  |  Branch (646:5): [True: 4.75k, False: 429]
  ------------------
  647|   272k|      for (; len > 0; len--) {
  ------------------
  |  Branch (647:14): [True: 267k, False: 4.75k]
  ------------------
  648|   267k|        *out++ = *from++;
  649|   267k|      }
  650|  5.17k|  }
  651|       |
  652|       |  // Copy the leftovers
  653|  6.04k|  for (; len > 0; len--) {
  ------------------
  |  Branch (653:10): [True: 865, False: 5.17k]
  ------------------
  654|    865|    *out++ = *from++;
  655|    865|  }
  656|       |
  657|  5.17k|  return out;
  658|  5.17k|}
fastcopy.c:copy_8_bytes:
   89|     58|static inline unsigned char *copy_8_bytes(unsigned char *out, const unsigned char *from) {
   90|       |#if defined(BLOSC_STRICT_ALIGN)
   91|       |  uint64_t chunk;
   92|       |  memcpy(&chunk, from, 8);
   93|       |  memcpy(out, &chunk, 8);
   94|       |#else
   95|     58|  *(uint64_t *) out = *(uint64_t *) from;
   96|     58|#endif
   97|     58|  return out + 8;
   98|     58|}
fastcopy.c:copy_bytes:
  173|    101|static inline unsigned char *copy_bytes(unsigned char *out, const unsigned char *from, unsigned len) {
  174|    101|  assert(len < 8);
  175|       |
  176|       |#ifdef BLOSC_STRICT_ALIGN
  177|       |  while (len--) {
  178|       |    *out++ = *from++;
  179|       |  }
  180|       |#else
  181|    101|  switch (len) {
  182|     12|    case 7:
  ------------------
  |  Branch (182:5): [True: 12, False: 89]
  ------------------
  183|     12|      return copy_7_bytes(out, from);
  184|     14|    case 6:
  ------------------
  |  Branch (184:5): [True: 14, False: 87]
  ------------------
  185|     14|      return copy_6_bytes(out, from);
  186|     16|    case 5:
  ------------------
  |  Branch (186:5): [True: 16, False: 85]
  ------------------
  187|     16|      return copy_5_bytes(out, from);
  188|     17|    case 4:
  ------------------
  |  Branch (188:5): [True: 17, False: 84]
  ------------------
  189|     17|      return copy_4_bytes(out, from);
  190|     42|    case 3:
  ------------------
  |  Branch (190:5): [True: 42, False: 59]
  ------------------
  191|     42|      return copy_3_bytes(out, from);
  192|      0|    case 2:
  ------------------
  |  Branch (192:5): [True: 0, False: 101]
  ------------------
  193|      0|      return copy_2_bytes(out, from);
  194|      0|    case 1:
  ------------------
  |  Branch (194:5): [True: 0, False: 101]
  ------------------
  195|      0|      return copy_1_bytes(out, from);
  196|      0|    case 0:
  ------------------
  |  Branch (196:5): [True: 0, False: 101]
  ------------------
  197|      0|      return out;
  198|      0|    default:
  ------------------
  |  Branch (198:5): [True: 0, False: 101]
  ------------------
  199|      0|      assert(0);
  200|    101|  }
  201|      0|#endif /* BLOSC_STRICT_ALIGN */
  202|      0|  return out;
  203|    101|}
fastcopy.c:copy_7_bytes:
   83|     12|static inline unsigned char *copy_7_bytes(unsigned char *out, const unsigned char *from) {
   84|     12|  out = copy_3_bytes(out, from);
   85|     12|  return copy_4_bytes(out, from + 3);
   86|     12|}
fastcopy.c:copy_6_bytes:
   78|     14|static inline unsigned char *copy_6_bytes(unsigned char *out, const unsigned char *from) {
   79|     14|  out = copy_2_bytes(out, from);
   80|     14|  return copy_4_bytes(out, from + 2);
   81|     14|}
fastcopy.c:copy_5_bytes:
   73|     16|static inline unsigned char *copy_5_bytes(unsigned char *out, const unsigned char *from) {
   74|     16|  out = copy_1_bytes(out, from);
   75|     16|  return copy_4_bytes(out, from + 1);
   76|     16|}
fastcopy.c:copy_3_bytes:
   68|     54|static inline unsigned char *copy_3_bytes(unsigned char *out, const unsigned char *from) {
   69|     54|  out = copy_1_bytes(out, from);
   70|     54|  return copy_2_bytes(out, from + 1);
   71|     54|}
fastcopy.c:copy_1_bytes:
   63|     70|static inline unsigned char *copy_1_bytes(unsigned char *out, const unsigned char *from) {
   64|     70|  *out++ = *from;
   65|     70|  return out;
   66|     70|}
fastcopy.c:chunk_memcpy:
  212|     16|static inline unsigned char *chunk_memcpy(unsigned char *out, const unsigned char *from, unsigned len) {
  213|     16|  unsigned sz = sizeof(uint64_t);
  214|     16|  unsigned rem = len % sz;
  215|     16|  unsigned by8;
  216|       |
  217|     16|  assert(len >= sz);
  218|       |
  219|       |  /* Copy a few bytes to make sure the loop below has a multiple of SZ bytes to be copied. */
  220|     16|  copy_8_bytes(out, from);
  221|       |
  222|     16|  len /= sz;
  223|     16|  out += rem;
  224|     16|  from += rem;
  225|       |
  226|     16|  by8 = len % 8;
  227|     16|  len -= by8;
  228|     16|  switch (by8) {
  229|      0|    case 7:
  ------------------
  |  Branch (229:5): [True: 0, False: 16]
  ------------------
  230|      0|      out = copy_8_bytes(out, from);
  231|      0|      from += sz;
  232|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  233|       |      __attribute__ ((fallthrough));  // Shut-up -Wimplicit-fallthrough warning in GCC
  234|       |      #endif
  235|      0|    case 6:
  ------------------
  |  Branch (235:5): [True: 0, False: 16]
  ------------------
  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 5:
  ------------------
  |  Branch (241:5): [True: 0, False: 16]
  ------------------
  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 4:
  ------------------
  |  Branch (247:5): [True: 0, False: 16]
  ------------------
  248|      0|      out = copy_8_bytes(out, from);
  249|      0|      from += sz;
  250|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  251|       |      __attribute__ ((fallthrough));
  252|       |      #endif
  253|      0|    case 3:
  ------------------
  |  Branch (253:5): [True: 0, False: 16]
  ------------------
  254|      0|      out = copy_8_bytes(out, from);
  255|      0|      from += sz;
  256|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  257|       |      __attribute__ ((fallthrough));
  258|       |      #endif
  259|      0|    case 2:
  ------------------
  |  Branch (259:5): [True: 0, False: 16]
  ------------------
  260|      0|      out = copy_8_bytes(out, from);
  261|      0|      from += sz;
  262|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  263|       |      __attribute__ ((fallthrough));
  264|       |      #endif
  265|     16|    case 1:
  ------------------
  |  Branch (265:5): [True: 16, False: 0]
  ------------------
  266|     16|      out = copy_8_bytes(out, from);
  267|     16|      from += sz;
  268|       |      #ifdef AVOID_FALLTHROUGH_WARNING
  269|       |      __attribute__ ((fallthrough));
  270|       |      #endif
  271|     16|    default:
  ------------------
  |  Branch (271:5): [True: 0, False: 16]
  ------------------
  272|     16|      break;
  273|     16|  }
  274|       |
  275|     16|  while (len) {
  ------------------
  |  Branch (275:10): [True: 0, False: 16]
  ------------------
  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|      0|    out = copy_8_bytes(out, from);
  281|      0|    from += sz;
  282|      0|    out = copy_8_bytes(out, from);
  283|      0|    from += sz;
  284|      0|    out = copy_8_bytes(out, from);
  285|      0|    from += sz;
  286|      0|    out = copy_8_bytes(out, from);
  287|      0|    from += sz;
  288|      0|    out = copy_8_bytes(out, from);
  289|      0|    from += sz;
  290|      0|    out = copy_8_bytes(out, from);
  291|      0|    from += sz;
  292|       |
  293|      0|    len -= 8;
  294|      0|  }
  295|       |
  296|     16|  return out;
  297|     16|}
fastcopy.c:copy_4_bytes:
   51|    279|static inline unsigned char *copy_4_bytes(unsigned char *out, const unsigned char *from) {
   52|       |#if defined(BLOSC_STRICT_ALIGN)
   53|       |  uint32_t chunk;
   54|       |  memcpy(&chunk, from, 4);
   55|       |  memcpy(out, &chunk, 4);
   56|       |#else
   57|    279|  *(uint32_t *) out = *(uint32_t *) from;
   58|    279|#endif
   59|    279|  return out + 4;
   60|    279|}
fastcopy.c:copy_2_bytes:
   40|    383|static inline unsigned char *copy_2_bytes(unsigned char *out, const unsigned char *from) {
   41|       |#if defined(BLOSC_STRICT_ALIGN)
   42|       |  uint16_t chunk;
   43|       |  memcpy(&chunk, from, 2);
   44|       |  memcpy(out, &chunk, 2);
   45|       |#else
   46|    383|  *(uint16_t *) out = *(uint16_t *) from;
   47|    383|#endif
   48|    383|  return out + 2;
   49|    383|}

prefetch_set_populate:
   85|  12.8k|void prefetch_set_populate(int mode) {
   86|  12.8k|  g_populate = mode < 0 ? -1 : (mode > 0);
  ------------------
  |  Branch (86:16): [True: 12.8k, False: 0]
  ------------------
   87|  12.8k|}
prefetch_destroy:
  356|  12.8k|void prefetch_destroy(void) {
  357|  12.8k|  pthread_mutex_lock(&destroy_mutex);
  358|  12.8k|  pthread_mutex_lock(&pool.mutex);
  359|  12.8k|  if (pool.threads == NULL) {
  ------------------
  |  Branch (359:7): [True: 12.8k, False: 0]
  ------------------
  360|  12.8k|    pthread_mutex_unlock(&pool.mutex);
  361|  12.8k|    pthread_mutex_unlock(&destroy_mutex);
  362|  12.8k|    return;
  363|  12.8k|  }
  364|      0|  pool.stop = true;
  365|      0|  pthread_cond_broadcast(&pool.work);
  366|      0|  int nthreads = pool.nthreads;
  367|      0|  pthread_t *threads = pool.threads;
  368|      0|  pool.threads = NULL;
  369|      0|  pool.nthreads = 0;
  370|      0|  pthread_mutex_unlock(&pool.mutex);
  371|       |
  372|      0|  for (int i = 0; i < nthreads; ++i) {
  ------------------
  |  Branch (372:19): [True: 0, False: 0]
  ------------------
  373|      0|    pthread_join(threads[i], NULL);
  374|      0|  }
  375|      0|  free(threads);
  376|       |
  377|      0|  pthread_mutex_lock(&pool.mutex);
  378|       |  pool.stop = false;
  379|      0|  pthread_mutex_unlock(&pool.mutex);
  380|      0|  pthread_mutex_unlock(&destroy_mutex);
  381|      0|}

unshuffle_avx2:
  777|  14.2k|               const uint8_t *_src, uint8_t *_dest) {
  778|  14.2k|  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|  14.2k|  if (blocksize < vectorized_chunk_size) {
  ------------------
  |  Branch (782:7): [True: 12.9k, False: 1.28k]
  ------------------
  783|  12.9k|    unshuffle_generic(bytesoftype, blocksize, _src, _dest);
  784|  12.9k|    return;
  785|  12.9k|  }
  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|  1.28k|  const int32_t vectorizable_bytes = blocksize - (blocksize % vectorized_chunk_size);
  793|       |
  794|  1.28k|  const int32_t vectorizable_elements = vectorizable_bytes / bytesoftype;
  795|  1.28k|  const int32_t total_elements = blocksize / bytesoftype;
  796|       |
  797|       |  /* Optimized unshuffle implementations */
  798|  1.28k|  switch (bytesoftype) {
  799|    548|    case 2:
  ------------------
  |  Branch (799:5): [True: 548, False: 739]
  ------------------
  800|    548|      unshuffle2_avx2(_dest, _src, vectorizable_elements, total_elements);
  801|    548|      break;
  802|    193|    case 4:
  ------------------
  |  Branch (802:5): [True: 193, False: 1.09k]
  ------------------
  803|    193|      unshuffle4_avx2(_dest, _src, vectorizable_elements, total_elements);
  804|    193|      break;
  805|    204|    case 8:
  ------------------
  |  Branch (805:5): [True: 204, False: 1.08k]
  ------------------
  806|    204|      unshuffle8_avx2(_dest, _src, vectorizable_elements, total_elements);
  807|    204|      break;
  808|     71|    case 12:
  ------------------
  |  Branch (808:5): [True: 71, False: 1.21k]
  ------------------
  809|     71|      unshuffle12_avx2(_dest, _src, vectorizable_elements, total_elements);
  810|     71|      break;
  811|     74|    case 16:
  ------------------
  |  Branch (811:5): [True: 74, False: 1.21k]
  ------------------
  812|     74|      unshuffle16_avx2(_dest, _src, vectorizable_elements, total_elements);
  813|     74|      break;
  814|    197|    default:
  ------------------
  |  Branch (814:5): [True: 197, False: 1.09k]
  ------------------
  815|       |      /* For types larger than 16 bytes, use the AVX2 tiled unshuffle. */
  816|    197|      if (bytesoftype > (int32_t)sizeof(__m128i)) {
  ------------------
  |  Branch (816:11): [True: 79, False: 118]
  ------------------
  817|     79|        unshuffle16_tiled_avx2(_dest, _src, vectorizable_elements, total_elements, bytesoftype);
  818|     79|      }
  819|    118|      else {
  820|       |        /* Non-optimized unshuffle */
  821|    118|        unshuffle_generic(bytesoftype, blocksize, _src, _dest);
  822|       |        /* The non-optimized function covers the whole buffer,
  823|       |           so we're done processing here. */
  824|    118|        return;
  825|    118|      }
  826|  1.28k|  }
  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|  1.16k|  if (vectorizable_bytes < blocksize) {
  ------------------
  |  Branch (831:7): [True: 792, False: 377]
  ------------------
  832|    792|    unshuffle_generic_inline(bytesoftype, vectorizable_bytes, blocksize, _src, _dest);
  833|    792|  }
  834|  1.16k|}
shuffle-avx2.c:unshuffle2_avx2:
  331|    548|                const int32_t vectorizable_elements, const int32_t total_elements) {
  332|    548|  static const int32_t bytesoftype = 2;
  333|    548|  int32_t i;
  334|    548|  int j;
  335|    548|  __m256i ymm0[2], ymm1[2];
  336|       |
  337|  48.9k|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (337:15): [True: 48.4k, False: 548]
  ------------------
  338|       |    /* Load 32 elements (64 bytes) into 2 YMM registers. */
  339|  48.4k|    const uint8_t* const src_for_ith_element = src + i;
  340|   145k|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (340:17): [True: 96.8k, False: 48.4k]
  ------------------
  341|  96.8k|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  342|  96.8k|    }
  343|       |    /* Shuffle bytes */
  344|   145k|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (344:17): [True: 96.8k, False: 48.4k]
  ------------------
  345|  96.8k|      ymm0[j] = _mm256_permute4x64_epi64(ymm0[j], 0xd8);
  346|  96.8k|    }
  347|       |    /* Compute the low 64 bytes */
  348|  48.4k|    ymm1[0] = _mm256_unpacklo_epi8(ymm0[0], ymm0[1]);
  349|       |    /* Compute the hi 64 bytes */
  350|  48.4k|    ymm1[1] = _mm256_unpackhi_epi8(ymm0[0], ymm0[1]);
  351|       |    /* Store the result vectors in proper order */
  352|  48.4k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * sizeof(__m256i))), ymm1[0]);
  353|  48.4k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * sizeof(__m256i))), ymm1[1]);
  354|  48.4k|  }
  355|    548|}
shuffle-avx2.c:unshuffle4_avx2:
  360|    193|                const int32_t vectorizable_elements, const int32_t total_elements) {
  361|    193|  static const int32_t bytesoftype = 4;
  362|    193|  int32_t i;
  363|    193|  int j;
  364|    193|  __m256i ymm0[4], ymm1[4];
  365|       |
  366|  44.3k|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (366:15): [True: 44.1k, False: 193]
  ------------------
  367|       |    /* Load 32 elements (128 bytes) into 4 YMM registers. */
  368|  44.1k|    const uint8_t* const src_for_ith_element = src + i;
  369|   220k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (369:17): [True: 176k, False: 44.1k]
  ------------------
  370|   176k|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  371|   176k|    }
  372|       |    /* Shuffle bytes */
  373|   132k|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (373:17): [True: 88.2k, False: 44.1k]
  ------------------
  374|       |      /* Compute the low 64 bytes */
  375|  88.2k|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  376|       |      /* Compute the hi 64 bytes */
  377|  88.2k|      ymm1[2 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  378|  88.2k|    }
  379|       |    /* Shuffle 2-byte words */
  380|   132k|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (380:17): [True: 88.2k, False: 44.1k]
  ------------------
  381|       |      /* Compute the low 64 bytes */
  382|  88.2k|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  383|       |      /* Compute the hi 64 bytes */
  384|  88.2k|      ymm0[2 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  385|  88.2k|    }
  386|  44.1k|    ymm1[0] = _mm256_permute2x128_si256(ymm0[0], ymm0[2], 0x20);
  387|  44.1k|    ymm1[1] = _mm256_permute2x128_si256(ymm0[1], ymm0[3], 0x20);
  388|  44.1k|    ymm1[2] = _mm256_permute2x128_si256(ymm0[0], ymm0[2], 0x31);
  389|  44.1k|    ymm1[3] = _mm256_permute2x128_si256(ymm0[1], ymm0[3], 0x31);
  390|       |
  391|       |    /* Store the result vectors in proper order */
  392|   220k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (392:17): [True: 176k, False: 44.1k]
  ------------------
  393|   176k|      _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (j * sizeof(__m256i))), ymm1[j]);
  394|   176k|    }
  395|  44.1k|  }
  396|    193|}
shuffle-avx2.c:unshuffle8_avx2:
  401|    204|                const int32_t vectorizable_elements, const int32_t total_elements) {
  402|    204|  static const int32_t bytesoftype = 8;
  403|    204|  int32_t i;
  404|    204|  int j;
  405|    204|  __m256i ymm0[8], ymm1[8];
  406|       |
  407|  6.52k|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (407:15): [True: 6.31k, False: 204]
  ------------------
  408|       |    /* Fetch 32 elements (256 bytes) into 8 YMM registers. */
  409|  6.31k|    const uint8_t* const src_for_ith_element = src + i;
  410|  56.8k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (410:17): [True: 50.5k, False: 6.31k]
  ------------------
  411|  50.5k|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  412|  50.5k|    }
  413|       |    /* Shuffle bytes */
  414|  31.5k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (414:17): [True: 25.2k, False: 6.31k]
  ------------------
  415|       |      /* Compute the low 32 bytes */
  416|  25.2k|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  417|       |      /* Compute the hi 32 bytes */
  418|  25.2k|      ymm1[4 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  419|  25.2k|    }
  420|       |    /* Shuffle words */
  421|  31.5k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (421:17): [True: 25.2k, False: 6.31k]
  ------------------
  422|       |      /* Compute the low 32 bytes */
  423|  25.2k|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  424|       |      /* Compute the hi 32 bytes */
  425|  25.2k|      ymm0[4 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  426|  25.2k|    }
  427|  56.8k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (427:17): [True: 50.5k, False: 6.31k]
  ------------------
  428|  50.5k|      ymm0[j] = _mm256_permute4x64_epi64(ymm0[j], 0xd8);
  429|  50.5k|    }
  430|       |
  431|       |    /* Shuffle 4-byte dwords */
  432|  31.5k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (432:17): [True: 25.2k, False: 6.31k]
  ------------------
  433|       |      /* Compute the low 32 bytes */
  434|  25.2k|      ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  435|       |      /* Compute the hi 32 bytes */
  436|  25.2k|      ymm1[4 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  437|  25.2k|    }
  438|       |
  439|       |    /* Store the result vectors in proper order */
  440|  6.31k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * sizeof(__m256i))), ymm1[0]);
  441|  6.31k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * sizeof(__m256i))), ymm1[2]);
  442|  6.31k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (2 * sizeof(__m256i))), ymm1[1]);
  443|  6.31k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (3 * sizeof(__m256i))), ymm1[3]);
  444|  6.31k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (4 * sizeof(__m256i))), ymm1[4]);
  445|  6.31k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (5 * sizeof(__m256i))), ymm1[6]);
  446|  6.31k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (6 * sizeof(__m256i))), ymm1[5]);
  447|  6.31k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (7 * sizeof(__m256i))), ymm1[7]);
  448|  6.31k|  }
  449|    204|}
shuffle-avx2.c:unshuffle12_avx2:
  526|     71|    const int32_t vectorizable_elements, const int32_t total_elements) {
  527|     71|  static const int32_t bytesoftype = 12;
  528|     71|  int32_t i;
  529|     71|  int j;
  530|     71|  __m256i ymm0[16], ymm1[16];
  531|       |
  532|     71|  __m256i permute = _mm256_set_epi32(0,0,6,5,4,2,1,0);
  533|     71|  __m256i store_mask = _mm256_set_epi32(0x0, 0x0, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
  534|     71|  int32_t jump = 2*bytesoftype;
  535|    443|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (535:15): [True: 372, False: 71]
  ------------------
  536|       |    /* Fetch 24 elements (384 bytes) into 12 YMM registers. */
  537|    372|    const uint8_t* const src_for_ith_element = src + i;
  538|  4.83k|    for (j = 0; j < bytesoftype; j++) {
  ------------------
  |  Branch (538:17): [True: 4.46k, False: 372]
  ------------------
  539|  4.46k|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  540|  4.46k|    }
  541|       |    /* Initialize the last 4 registers (128 bytes) to null */
  542|  1.86k|    for (j = bytesoftype; j < 16; j++) {
  ------------------
  |  Branch (542:27): [True: 1.48k, False: 372]
  ------------------
  543|  1.48k|      ymm0[j] = _mm256_setzero_si256();
  544|  1.48k|    }
  545|       |
  546|       |    /* Shuffle bytes */
  547|  3.34k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (547:17): [True: 2.97k, False: 372]
  ------------------
  548|       |      /* Compute the low 32 bytes */
  549|  2.97k|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  550|       |      /* Compute the hi 32 bytes */
  551|  2.97k|      ymm1[8 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  552|  2.97k|    }
  553|       |    /* Shuffle 2-byte words */
  554|  3.34k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (554:17): [True: 2.97k, False: 372]
  ------------------
  555|       |      /* Compute the low 32 bytes */
  556|  2.97k|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  557|       |      /* Compute the hi 32 bytes */
  558|  2.97k|      ymm0[8 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  559|  2.97k|    }
  560|       |    /* Shuffle 4-byte dwords */
  561|  3.34k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (561:17): [True: 2.97k, False: 372]
  ------------------
  562|       |      /* Compute the low 32 bytes */
  563|  2.97k|      ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  564|       |      /* Compute the hi 32 bytes */
  565|  2.97k|      ymm1[8 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  566|  2.97k|    }
  567|       |
  568|       |    /* Shuffle 8-byte qwords */
  569|  3.34k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (569:17): [True: 2.97k, False: 372]
  ------------------
  570|       |      /* Compute the low 32 bytes */
  571|  2.97k|      ymm0[j] = _mm256_unpacklo_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  572|       |      /* Compute the hi 32 bytes */
  573|  2.97k|      ymm0[8 + j] = _mm256_unpackhi_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  574|  2.97k|    }
  575|       |
  576|       |
  577|  3.34k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (577:17): [True: 2.97k, False: 372]
  ------------------
  578|  2.97k|      ymm1[j] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x20);
  579|  2.97k|      ymm1[j + 8] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x31);
  580|  2.97k|      ymm1[j] = _mm256_permutevar8x32_epi32(ymm1[j], permute);
  581|  2.97k|      ymm1[j+8] = _mm256_permutevar8x32_epi32(ymm1[j+8], permute);
  582|       |
  583|       |
  584|  2.97k|    }
  585|    372|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * jump)), ymm1[0]);
  586|    372|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * jump)), ymm1[4]);
  587|    372|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (2 * jump)), ymm1[2]);
  588|    372|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (3 * jump)), ymm1[6]);
  589|    372|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (4 * jump)), ymm1[1]);
  590|    372|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (5 * jump)), ymm1[5]);
  591|    372|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (6 * jump)), ymm1[3]);
  592|    372|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (7 * jump)), ymm1[7]);
  593|    372|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (8 * jump)), ymm1[8]);
  594|    372|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (9 * jump)), ymm1[12]);
  595|    372|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (10 * jump)), ymm1[10]);
  596|    372|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (11 * jump)), ymm1[14]);
  597|    372|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (12 * jump)), ymm1[9]);
  598|    372|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (13 * jump)), ymm1[13]);
  599|    372|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (14 * jump)), ymm1[11]);
  600|    372|    _mm256_maskstore_epi32((int *)(dest + (i * bytesoftype) + (15 * jump)), store_mask, ymm1[15]);
  601|    372|  }
  602|     71|}
shuffle-avx2.c:unshuffle16_avx2:
  454|     74|                 const int32_t vectorizable_elements, const int32_t total_elements) {
  455|     74|  static const int32_t bytesoftype = 16;
  456|     74|  int32_t i;
  457|     74|  int j;
  458|     74|  __m256i ymm0[16], ymm1[16];
  459|       |
  460|  5.56k|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (460:15): [True: 5.49k, False: 74]
  ------------------
  461|       |    /* Fetch 32 elements (512 bytes) into 16 YMM registers. */
  462|  5.49k|    const uint8_t* const src_for_ith_element = src + i;
  463|  93.4k|    for (j = 0; j < 16; j++) {
  ------------------
  |  Branch (463:17): [True: 87.9k, False: 5.49k]
  ------------------
  464|  87.9k|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  465|  87.9k|    }
  466|       |
  467|       |    /* Shuffle bytes */
  468|  49.4k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (468:17): [True: 43.9k, False: 5.49k]
  ------------------
  469|       |      /* Compute the low 32 bytes */
  470|  43.9k|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  471|       |      /* Compute the hi 32 bytes */
  472|  43.9k|      ymm1[8 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  473|  43.9k|    }
  474|       |    /* Shuffle 2-byte words */
  475|  49.4k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (475:17): [True: 43.9k, False: 5.49k]
  ------------------
  476|       |      /* Compute the low 32 bytes */
  477|  43.9k|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  478|       |      /* Compute the hi 32 bytes */
  479|  43.9k|      ymm0[8 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  480|  43.9k|    }
  481|       |    /* Shuffle 4-byte dwords */
  482|  49.4k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (482:17): [True: 43.9k, False: 5.49k]
  ------------------
  483|       |      /* Compute the low 32 bytes */
  484|  43.9k|      ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  485|       |      /* Compute the hi 32 bytes */
  486|  43.9k|      ymm1[8 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  487|  43.9k|    }
  488|       |
  489|       |    /* Shuffle 8-byte qwords */
  490|  49.4k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (490:17): [True: 43.9k, False: 5.49k]
  ------------------
  491|       |      /* Compute the low 32 bytes */
  492|  43.9k|      ymm0[j] = _mm256_unpacklo_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  493|       |      /* Compute the hi 32 bytes */
  494|  43.9k|      ymm0[8 + j] = _mm256_unpackhi_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  495|  43.9k|    }
  496|       |
  497|  49.4k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (497:17): [True: 43.9k, False: 5.49k]
  ------------------
  498|  43.9k|      ymm1[j] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x20);
  499|  43.9k|      ymm1[j + 8] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x31);
  500|  43.9k|    }
  501|       |
  502|       |    /* Store the result vectors in proper order */
  503|  5.49k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * sizeof(__m256i))), ymm1[0]);
  504|  5.49k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * sizeof(__m256i))), ymm1[4]);
  505|  5.49k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (2 * sizeof(__m256i))), ymm1[2]);
  506|  5.49k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (3 * sizeof(__m256i))), ymm1[6]);
  507|  5.49k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (4 * sizeof(__m256i))), ymm1[1]);
  508|  5.49k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (5 * sizeof(__m256i))), ymm1[5]);
  509|  5.49k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (6 * sizeof(__m256i))), ymm1[3]);
  510|  5.49k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (7 * sizeof(__m256i))), ymm1[7]);
  511|  5.49k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (8 * sizeof(__m256i))), ymm1[8]);
  512|  5.49k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (9 * sizeof(__m256i))), ymm1[12]);
  513|  5.49k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (10 * sizeof(__m256i))), ymm1[10]);
  514|  5.49k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (11 * sizeof(__m256i))), ymm1[14]);
  515|  5.49k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (12 * sizeof(__m256i))), ymm1[9]);
  516|  5.49k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (13 * sizeof(__m256i))), ymm1[13]);
  517|  5.49k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (14 * sizeof(__m256i))), ymm1[11]);
  518|  5.49k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (15 * sizeof(__m256i))), ymm1[15]);
  519|  5.49k|  }
  520|     74|}
shuffle-avx2.c:unshuffle16_tiled_avx2:
  606|     79|                       const int32_t vectorizable_elements, const int32_t total_elements, const int32_t bytesoftype) {
  607|     79|  int32_t i;
  608|     79|  int j;
  609|     79|  __m256i ymm0[16], ymm1[16];
  610|       |
  611|     79|  const lldiv_t vecs_per_el = lldiv(bytesoftype, sizeof(__m128i));
  612|     79|  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|     79|  int32_t offset_into_type;
  617|    364|  for (offset_into_type = 0; offset_into_type < bytesoftype;
  ------------------
  |  Branch (617:30): [True: 285, False: 79]
  ------------------
  618|    285|       offset_into_type += (offset_into_type == 0 && vecs_rem > 0 ? vecs_rem : (int32_t)sizeof(__m128i))) {
  ------------------
  |  Branch (618:29): [True: 79, False: 206]
  |  Branch (618:54): [True: 67, False: 12]
  ------------------
  619|  2.66k|    for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (619:17): [True: 2.37k, False: 285]
  ------------------
  620|       |      /* Load the first 16 bytes of 32 adjacent elements (512 bytes) into 16 YMM registers */
  621|  2.37k|      const uint8_t* const src_for_ith_element = src + i;
  622|  40.4k|      for (j = 0; j < 16; j++) {
  ------------------
  |  Branch (622:19): [True: 38.0k, False: 2.37k]
  ------------------
  623|  38.0k|        ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (total_elements * (offset_into_type + j))));
  624|  38.0k|      }
  625|       |
  626|       |      /* Shuffle bytes */
  627|  21.4k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (627:19): [True: 19.0k, False: 2.37k]
  ------------------
  628|       |        /* Compute the low 32 bytes */
  629|  19.0k|        ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  630|       |        /* Compute the hi 32 bytes */
  631|  19.0k|        ymm1[8 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  632|  19.0k|      }
  633|       |      /* Shuffle 2-byte words */
  634|  21.4k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (634:19): [True: 19.0k, False: 2.37k]
  ------------------
  635|       |        /* Compute the low 32 bytes */
  636|  19.0k|        ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  637|       |        /* Compute the hi 32 bytes */
  638|  19.0k|        ymm0[8 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  639|  19.0k|      }
  640|       |      /* Shuffle 4-byte dwords */
  641|  21.4k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (641:19): [True: 19.0k, False: 2.37k]
  ------------------
  642|       |        /* Compute the low 32 bytes */
  643|  19.0k|        ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  644|       |        /* Compute the hi 32 bytes */
  645|  19.0k|        ymm1[8 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  646|  19.0k|      }
  647|       |
  648|       |      /* Shuffle 8-byte qwords */
  649|  21.4k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (649:19): [True: 19.0k, False: 2.37k]
  ------------------
  650|       |        /* Compute the low 32 bytes */
  651|  19.0k|        ymm0[j] = _mm256_unpacklo_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  652|       |        /* Compute the hi 32 bytes */
  653|  19.0k|        ymm0[8 + j] = _mm256_unpackhi_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  654|  19.0k|      }
  655|       |
  656|  21.4k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (656:19): [True: 19.0k, False: 2.37k]
  ------------------
  657|  19.0k|        ymm1[j] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x20);
  658|  19.0k|        ymm1[j + 8] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x31);
  659|  19.0k|      }
  660|       |
  661|       |      /* Store the result vectors in proper order */
  662|  2.37k|      const uint8_t* const dest_with_offset = dest + offset_into_type;
  663|  2.37k|      _mm256_storeu2_m128i(
  664|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x01) * bytesoftype),
  665|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x00) * bytesoftype), ymm1[0]);
  666|  2.37k|      _mm256_storeu2_m128i(
  667|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x03) * bytesoftype),
  668|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x02) * bytesoftype), ymm1[4]);
  669|  2.37k|      _mm256_storeu2_m128i(
  670|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x05) * bytesoftype),
  671|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x04) * bytesoftype), ymm1[2]);
  672|  2.37k|      _mm256_storeu2_m128i(
  673|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x07) * bytesoftype),
  674|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x06) * bytesoftype), ymm1[6]);
  675|  2.37k|      _mm256_storeu2_m128i(
  676|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x09) * bytesoftype),
  677|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x08) * bytesoftype), ymm1[1]);
  678|  2.37k|      _mm256_storeu2_m128i(
  679|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x0b) * bytesoftype),
  680|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x0a) * bytesoftype), ymm1[5]);
  681|  2.37k|      _mm256_storeu2_m128i(
  682|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x0d) * bytesoftype),
  683|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x0c) * bytesoftype), ymm1[3]);
  684|  2.37k|      _mm256_storeu2_m128i(
  685|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x0f) * bytesoftype),
  686|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x0e) * bytesoftype), ymm1[7]);
  687|  2.37k|      _mm256_storeu2_m128i(
  688|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x11) * bytesoftype),
  689|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x10) * bytesoftype), ymm1[8]);
  690|  2.37k|      _mm256_storeu2_m128i(
  691|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x13) * bytesoftype),
  692|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x12) * bytesoftype), ymm1[12]);
  693|  2.37k|      _mm256_storeu2_m128i(
  694|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x15) * bytesoftype),
  695|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x14) * bytesoftype), ymm1[10]);
  696|  2.37k|      _mm256_storeu2_m128i(
  697|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x17) * bytesoftype),
  698|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x16) * bytesoftype), ymm1[14]);
  699|  2.37k|      _mm256_storeu2_m128i(
  700|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x19) * bytesoftype),
  701|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x18) * bytesoftype), ymm1[9]);
  702|  2.37k|      _mm256_storeu2_m128i(
  703|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x1b) * bytesoftype),
  704|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x1a) * bytesoftype), ymm1[13]);
  705|  2.37k|      _mm256_storeu2_m128i(
  706|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x1d) * bytesoftype),
  707|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x1c) * bytesoftype), ymm1[11]);
  708|  2.37k|      _mm256_storeu2_m128i(
  709|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x1f) * bytesoftype),
  710|  2.37k|          (__m128i*)(dest_with_offset + (i + 0x1e) * bytesoftype), ymm1[15]);
  711|  2.37k|    }
  712|    285|  }
  713|     79|}

shuffle_bytedelta_avx2_backward:
  537|  1.46k|int shuffle_bytedelta_avx2_backward(const uint8_t *input, uint8_t *output, int32_t length, int typesize) {
  538|  1.46k|  switch (typesize) {
  539|    494|    case 2: return backward2_avx2(input, output, length);
  ------------------
  |  Branch (539:5): [True: 494, False: 972]
  ------------------
  540|    485|    case 4: return backward4_avx2(input, output, length);
  ------------------
  |  Branch (540:5): [True: 485, False: 981]
  ------------------
  541|    487|    case 8: return backward8_avx2(input, output, length);
  ------------------
  |  Branch (541:5): [True: 487, False: 979]
  ------------------
  542|      0|    default: return 0;
  ------------------
  |  Branch (542:5): [True: 0, False: 1.46k]
  ------------------
  543|  1.46k|  }
  544|  1.46k|}
shuffle-bytedelta-avx2.c:backward2_avx2:
  204|    494|static int backward2_avx2(const uint8_t *input, uint8_t *output, int32_t length) {
  205|    494|  int count = length / 2, vector_count = count / 32 * 32;
  206|       |  /* Shuffle mask broadcasting the 8th 16-bit record (bytes 14..15) in each 128-bit lane. */
  207|    494|  const __m256i mask_hi16 = _mm256_setr_epi8(
  208|    494|      14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15,
  209|    494|      14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15, 14, 15);
  210|    494|  const __m128i mask_hi16_128 = _mm256_castsi256_si128(mask_hi16);
  211|    494|  __m128i carry128 = _mm_setzero_si128();
  212|    685|  for (int i = 0; i < vector_count; i += 32) {
  ------------------
  |  Branch (212:19): [True: 191, False: 494]
  ------------------
  213|       |    /* Load 32 delta bytes from each of the 2 byte planes. */
  214|    191|    __m256i p0 = _mm256_loadu_si256((const __m256i *)(input + i));
  215|    191|    __m256i p1 = _mm256_loadu_si256((const __m256i *)(input + count + i));
  216|       |
  217|       |    /* Interleave into 2-byte records: lo lanes hold 0..7 and 8..15, hi lanes 16..23 and 24..31. */
  218|    191|    __m256i r0 = _mm256_unpacklo_epi8(p0, p1);
  219|    191|    __m256i r1 = _mm256_unpackhi_epi8(p0, p1);
  220|       |
  221|       |    /* Kogge-Stone prefix sum across the 8 interleaved 2-byte records in each 128-bit lane. */
  222|    191|    r0 = _mm256_add_epi8(r0, _mm256_slli_si256(r0, 2));
  223|    191|    r1 = _mm256_add_epi8(r1, _mm256_slli_si256(r1, 2));
  224|    191|    r0 = _mm256_add_epi8(r0, _mm256_slli_si256(r0, 4));
  225|    191|    r1 = _mm256_add_epi8(r1, _mm256_slli_si256(r1, 4));
  226|    191|    r0 = _mm256_add_epi8(r0, _mm256_slli_si256(r0, 8));
  227|    191|    r1 = _mm256_add_epi8(r1, _mm256_slli_si256(r1, 8));
  228|       |
  229|       |    /* Propagate each 8-record half-lane total from r0 into r1. */
  230|    191|    r1 = _mm256_add_epi8(r1, _mm256_shuffle_epi8(r0, mask_hi16));
  231|       |
  232|       |    /* Build per-lane tile carry [carry, carry + sum_lo] and advance running carry128. */
  233|    191|    __m128i sum_lo = _mm_shuffle_epi8(_mm256_castsi256_si128(r1), mask_hi16_128);
  234|    191|    __m128i sum_hi = _mm_shuffle_epi8(_mm256_extracti128_si256(r1, 1), mask_hi16_128);
  235|    191|    __m128i carry_hi = _mm_add_epi8(carry128, sum_lo);
  236|    191|    __m256i tile_carry = _mm256_inserti128_si256(_mm256_castsi128_si256(carry128), carry_hi, 1);
  237|    191|    carry128 = _mm_add_epi8(carry128, _mm_add_epi8(sum_lo, sum_hi));
  238|       |
  239|       |    /* Apply incoming cross-tile and cross-lane carry to all 32 records. */
  240|    191|    r0 = _mm256_add_epi8(r0, tile_carry);
  241|    191|    r1 = _mm256_add_epi8(r1, tile_carry);
  242|       |
  243|       |    /* Reorder lanes into two contiguous 32-byte stores (records 0..15, then 16..31). */
  244|    191|    uint8_t *dst = output + i * 2;
  245|    191|    _mm256_storeu_si256((__m256i *)dst, _mm256_permute2x128_si256(r0, r1, 0x20));
  246|    191|    _mm256_storeu_si256((__m256i *)(dst + 32), _mm256_permute2x128_si256(r0, r1, 0x31));
  247|    191|  }
  248|       |  /* Scalar tail for remaining <32 records and any incomplete trailing bytes. */
  249|    494|  uint8_t tail_carry[16];
  250|    494|  _mm_storeu_si128((__m128i *)tail_carry, carry128);
  251|  1.48k|  for (int p = 0; p < 2; p++) {
  ------------------
  |  Branch (251:19): [True: 988, False: 494]
  ------------------
  252|    988|    uint8_t carry = tail_carry[p];
  253|  5.38k|    for (int i = vector_count; i < count; i++) {
  ------------------
  |  Branch (253:32): [True: 4.40k, False: 988]
  ------------------
  254|  4.40k|      carry = (uint8_t)(carry + input[p * count + i]);
  255|  4.40k|      output[i * 2 + p] = carry;
  256|  4.40k|    }
  257|    988|  }
  258|    494|  memcpy(output + count * 2, input + count * 2, (size_t)(length % 2));
  259|    494|  return 1;
  260|    494|}
shuffle-bytedelta-avx2.c:backward4_avx2:
  262|    485|static int backward4_avx2(const uint8_t *input, uint8_t *output, int32_t length) {
  263|    485|  int count = length / 4, vector_count = count / 32 * 32;
  264|    485|  __m128i carry128 = _mm_setzero_si128();
  265|    568|  for (int i = 0; i < vector_count; i += 32) {
  ------------------
  |  Branch (265:19): [True: 83, False: 485]
  ------------------
  266|       |    /* Load 32 delta bytes from each of the 4 byte planes. */
  267|     83|    __m256i p0 = _mm256_loadu_si256((const __m256i *)(input + 0 * count + i));
  268|     83|    __m256i p1 = _mm256_loadu_si256((const __m256i *)(input + 1 * count + i));
  269|     83|    __m256i p2 = _mm256_loadu_si256((const __m256i *)(input + 2 * count + i));
  270|     83|    __m256i p3 = _mm256_loadu_si256((const __m256i *)(input + 3 * count + i));
  271|       |
  272|       |    /* Stage 1 & 2 in-lane transpose: interleave 4 planes into 4-byte records in r0..r3. */
  273|     83|    __m256i a0 = _mm256_unpacklo_epi8(p0, p1);
  274|     83|    __m256i a1 = _mm256_unpackhi_epi8(p0, p1);
  275|     83|    __m256i a2 = _mm256_unpacklo_epi8(p2, p3);
  276|     83|    __m256i a3 = _mm256_unpackhi_epi8(p2, p3);
  277|       |
  278|     83|    __m256i r0 = _mm256_unpacklo_epi16(a0, a2);
  279|     83|    __m256i r1 = _mm256_unpackhi_epi16(a0, a2);
  280|     83|    __m256i r2 = _mm256_unpacklo_epi16(a1, a3);
  281|     83|    __m256i r3 = _mm256_unpackhi_epi16(a1, a3);
  282|       |
  283|       |    /* Prefix sum across the 4 interleaved 4-byte records within each 128-bit lane. */
  284|     83|    r0 = _mm256_add_epi8(r0, _mm256_slli_si256(r0, 4));
  285|     83|    r1 = _mm256_add_epi8(r1, _mm256_slli_si256(r1, 4));
  286|     83|    r2 = _mm256_add_epi8(r2, _mm256_slli_si256(r2, 4));
  287|     83|    r3 = _mm256_add_epi8(r3, _mm256_slli_si256(r3, 4));
  288|       |
  289|     83|    r0 = _mm256_add_epi8(r0, _mm256_slli_si256(r0, 8));
  290|     83|    r1 = _mm256_add_epi8(r1, _mm256_slli_si256(r1, 8));
  291|     83|    r2 = _mm256_add_epi8(r2, _mm256_slli_si256(r2, 8));
  292|     83|    r3 = _mm256_add_epi8(r3, _mm256_slli_si256(r3, 8));
  293|       |
  294|       |    /* Tree-reduce quad totals across r0..r3 to get full 16-record local sums per lane. */
  295|     83|    r1 = _mm256_add_epi8(r1, dup_hi32_256(r0));
  296|     83|    r3 = _mm256_add_epi8(r3, dup_hi32_256(r2));
  297|     83|    __m256i d1 = dup_hi32_256(r1);
  298|     83|    __m256i r3_local = _mm256_add_epi8(r3, d1);
  299|       |
  300|       |    /* Build per-lane tile carry [carry, carry + sum_lo] and advance running carry128. */
  301|     83|    __m128i sum_lo = _mm_shuffle_epi32(_mm256_castsi256_si128(r3_local), 0xff);
  302|     83|    __m128i sum_hi = _mm_shuffle_epi32(_mm256_extracti128_si256(r3_local, 1), 0xff);
  303|     83|    __m128i carry_hi = _mm_add_epi8(carry128, sum_lo);
  304|     83|    __m256i tile_carry = _mm256_inserti128_si256(_mm256_castsi128_si256(carry128), carry_hi, 1);
  305|     83|    carry128 = _mm_add_epi8(carry128, _mm_add_epi8(sum_lo, sum_hi));
  306|       |
  307|       |    /* Fold tile_carry with d1 for r2 and apply carries to all 4 vectors. */
  308|     83|    __m256i d1c = _mm256_add_epi8(d1, tile_carry);
  309|     83|    r0 = _mm256_add_epi8(r0, tile_carry);
  310|     83|    r1 = _mm256_add_epi8(r1, tile_carry);
  311|     83|    r2 = _mm256_add_epi8(r2, d1c);
  312|     83|    r3 = _mm256_add_epi8(r3_local, tile_carry);
  313|       |
  314|       |    /* Reorder lanes into four contiguous 32-byte stores (records 0..31). */
  315|     83|    uint8_t *dst = output + i * 4;
  316|     83|    _mm256_storeu_si256((__m256i *)(dst + 0), _mm256_permute2x128_si256(r0, r1, 0x20));
  317|     83|    _mm256_storeu_si256((__m256i *)(dst + 32), _mm256_permute2x128_si256(r2, r3, 0x20));
  318|     83|    _mm256_storeu_si256((__m256i *)(dst + 64), _mm256_permute2x128_si256(r0, r1, 0x31));
  319|     83|    _mm256_storeu_si256((__m256i *)(dst + 96), _mm256_permute2x128_si256(r2, r3, 0x31));
  320|     83|  }
  321|       |  /* Scalar tail for remaining <32 records and any incomplete trailing bytes. */
  322|    485|  uint8_t tail_carry[16];
  323|    485|  _mm_storeu_si128((__m128i *)tail_carry, carry128);
  324|  2.42k|  for (int p = 0; p < 4; p++) {
  ------------------
  |  Branch (324:19): [True: 1.94k, False: 485]
  ------------------
  325|  1.94k|    uint8_t carry = tail_carry[p];
  326|  9.49k|    for (int i = vector_count; i < count; i++) {
  ------------------
  |  Branch (326:32): [True: 7.55k, False: 1.94k]
  ------------------
  327|  7.55k|      carry = (uint8_t)(carry + input[p * count + i]);
  328|  7.55k|      output[i * 4 + p] = carry;
  329|  7.55k|    }
  330|  1.94k|  }
  331|    485|  memcpy(output + count * 4, input + count * 4, (size_t)(length % 4));
  332|    485|  return 1;
  333|    485|}
shuffle-bytedelta-avx2.c:dup_hi32_256:
   95|    354|static inline __m256i dup_hi32_256(__m256i v) {
   96|       |  /* Broadcast the top 32-bit record of each 128-bit lane across that lane. */
   97|       |  return _mm256_shuffle_epi32(v, 0xff);
   98|    354|}
shuffle-bytedelta-avx2.c:backward8_avx2:
  335|    487|static int backward8_avx2(const uint8_t *input, uint8_t *output, int32_t length) {
  336|    487|  int count = length / 8, vector_count = count / 32 * 32;
  337|    487|  __m128i carry128 = _mm_setzero_si128();
  338|    548|  for (int i = 0; i < vector_count; i += 32) {
  ------------------
  |  Branch (338:19): [True: 61, False: 487]
  ------------------
  339|       |    /* Load 32 delta bytes from each of the 8 byte planes. */
  340|     61|    __m256i p0 = _mm256_loadu_si256((const __m256i *)(input + 0 * count + i));
  341|     61|    __m256i p1 = _mm256_loadu_si256((const __m256i *)(input + 1 * count + i));
  342|     61|    __m256i p2 = _mm256_loadu_si256((const __m256i *)(input + 2 * count + i));
  343|     61|    __m256i p3 = _mm256_loadu_si256((const __m256i *)(input + 3 * count + i));
  344|     61|    __m256i p4 = _mm256_loadu_si256((const __m256i *)(input + 4 * count + i));
  345|     61|    __m256i p5 = _mm256_loadu_si256((const __m256i *)(input + 5 * count + i));
  346|     61|    __m256i p6 = _mm256_loadu_si256((const __m256i *)(input + 6 * count + i));
  347|     61|    __m256i p7 = _mm256_loadu_si256((const __m256i *)(input + 7 * count + i));
  348|       |
  349|       |    /* Stage 1 (8-bit) transpose of low 4 planes; skip upper 4 planes when all zero. */
  350|     61|    __m256i a0 = _mm256_unpacklo_epi8(p0, p1);
  351|     61|    __m256i a1 = _mm256_unpackhi_epi8(p0, p1);
  352|     61|    __m256i a2 = _mm256_unpacklo_epi8(p2, p3);
  353|     61|    __m256i a3 = _mm256_unpackhi_epi8(p2, p3);
  354|       |
  355|     61|    __m256i hi = _mm256_or_si256(_mm256_or_si256(p4, p5), _mm256_or_si256(p6, p7));
  356|     61|    if (_mm256_testz_si256(hi, hi)) {
  ------------------
  |  Branch (356:9): [True: 35, False: 26]
  ------------------
  357|     35|      __m256i b0 = _mm256_unpacklo_epi16(a0, a2);
  358|     35|      __m256i b1 = _mm256_unpackhi_epi16(a0, a2);
  359|     35|      __m256i b2 = _mm256_unpacklo_epi16(a1, a3);
  360|     35|      __m256i b3 = _mm256_unpackhi_epi16(a1, a3);
  361|       |
  362|     35|      b0 = _mm256_add_epi8(b0, _mm256_slli_si256(b0, 4));
  363|     35|      b1 = _mm256_add_epi8(b1, _mm256_slli_si256(b1, 4));
  364|     35|      b2 = _mm256_add_epi8(b2, _mm256_slli_si256(b2, 4));
  365|     35|      b3 = _mm256_add_epi8(b3, _mm256_slli_si256(b3, 4));
  366|       |
  367|     35|      b0 = _mm256_add_epi8(b0, _mm256_slli_si256(b0, 8));
  368|     35|      b1 = _mm256_add_epi8(b1, _mm256_slli_si256(b1, 8));
  369|     35|      b2 = _mm256_add_epi8(b2, _mm256_slli_si256(b2, 8));
  370|     35|      b3 = _mm256_add_epi8(b3, _mm256_slli_si256(b3, 8));
  371|       |
  372|     35|      b1 = _mm256_add_epi8(b1, dup_hi32_256(b0));
  373|     35|      b3 = _mm256_add_epi8(b3, dup_hi32_256(b2));
  374|     35|      __m256i d1 = dup_hi32_256(b1);
  375|     35|      __m256i b3_local = _mm256_add_epi8(b3, d1);
  376|       |
  377|     35|      __m128i carry_lo128 = _mm_shuffle_epi32(carry128, 0x00);
  378|     35|      __m128i carry_hi128 = _mm_shuffle_epi32(carry128, 0x55);
  379|     35|      __m128i sum_lo = _mm_shuffle_epi32(_mm256_castsi256_si128(b3_local), 0xff);
  380|     35|      __m128i sum_hi = _mm_shuffle_epi32(_mm256_extracti128_si256(b3_local, 1), 0xff);
  381|     35|      __m128i carry_mid = _mm_add_epi8(carry_lo128, sum_lo);
  382|     35|      __m256i tile_carry_lo = _mm256_inserti128_si256(
  383|     35|          _mm256_castsi128_si256(carry_lo128), carry_mid, 1);
  384|     35|      carry_lo128 = _mm_add_epi8(carry_mid, sum_hi);
  385|     35|      carry128 = _mm_unpacklo_epi32(carry_lo128, carry_hi128);
  386|       |
  387|     35|      __m256i d1c = _mm256_add_epi8(d1, tile_carry_lo);
  388|     35|      b0 = _mm256_add_epi8(b0, tile_carry_lo);
  389|     35|      b1 = _mm256_add_epi8(b1, tile_carry_lo);
  390|     35|      b2 = _mm256_add_epi8(b2, d1c);
  391|     35|      b3 = _mm256_add_epi8(b3_local, tile_carry_lo);
  392|       |
  393|     35|      __m256i carry_hi256 = _mm256_inserti128_si256(
  394|     35|          _mm256_castsi128_si256(carry_hi128), carry_hi128, 1);
  395|     35|      __m256i r0 = _mm256_unpacklo_epi32(b0, carry_hi256);
  396|     35|      __m256i r1 = _mm256_unpackhi_epi32(b0, carry_hi256);
  397|     35|      __m256i r2 = _mm256_unpacklo_epi32(b1, carry_hi256);
  398|     35|      __m256i r3 = _mm256_unpackhi_epi32(b1, carry_hi256);
  399|     35|      __m256i r4 = _mm256_unpacklo_epi32(b2, carry_hi256);
  400|     35|      __m256i r5 = _mm256_unpackhi_epi32(b2, carry_hi256);
  401|     35|      __m256i r6 = _mm256_unpacklo_epi32(b3, carry_hi256);
  402|     35|      __m256i r7 = _mm256_unpackhi_epi32(b3, carry_hi256);
  403|       |
  404|     35|      uint8_t *dst = output + i * 8;
  405|     35|      _mm_storeu_si128((__m128i *)(dst + 0), _mm256_castsi256_si128(r0));
  406|     35|      _mm_storeu_si128((__m128i *)(dst + 16), _mm256_castsi256_si128(r1));
  407|     35|      _mm_storeu_si128((__m128i *)(dst + 32), _mm256_castsi256_si128(r2));
  408|     35|      _mm_storeu_si128((__m128i *)(dst + 48), _mm256_castsi256_si128(r3));
  409|     35|      _mm_storeu_si128((__m128i *)(dst + 64), _mm256_castsi256_si128(r4));
  410|     35|      _mm_storeu_si128((__m128i *)(dst + 80), _mm256_castsi256_si128(r5));
  411|     35|      _mm_storeu_si128((__m128i *)(dst + 96), _mm256_castsi256_si128(r6));
  412|     35|      _mm_storeu_si128((__m128i *)(dst + 112), _mm256_castsi256_si128(r7));
  413|     35|      _mm_storeu_si128((__m128i *)(dst + 128), _mm256_extracti128_si256(r0, 1));
  414|     35|      _mm_storeu_si128((__m128i *)(dst + 144), _mm256_extracti128_si256(r1, 1));
  415|     35|      _mm_storeu_si128((__m128i *)(dst + 160), _mm256_extracti128_si256(r2, 1));
  416|     35|      _mm_storeu_si128((__m128i *)(dst + 176), _mm256_extracti128_si256(r3, 1));
  417|     35|      _mm_storeu_si128((__m128i *)(dst + 192), _mm256_extracti128_si256(r4, 1));
  418|     35|      _mm_storeu_si128((__m128i *)(dst + 208), _mm256_extracti128_si256(r5, 1));
  419|     35|      _mm_storeu_si128((__m128i *)(dst + 224), _mm256_extracti128_si256(r6, 1));
  420|     35|      _mm_storeu_si128((__m128i *)(dst + 240), _mm256_extracti128_si256(r7, 1));
  421|     35|      continue;
  422|     35|    }
  423|       |
  424|     26|    __m256i a4 = _mm256_unpacklo_epi8(p4, p5);
  425|     26|    __m256i a5 = _mm256_unpackhi_epi8(p4, p5);
  426|     26|    __m256i a6 = _mm256_unpacklo_epi8(p6, p7);
  427|     26|    __m256i a7 = _mm256_unpackhi_epi8(p6, p7);
  428|       |
  429|     26|    __m256i b0 = _mm256_unpacklo_epi16(a0, a2);
  430|     26|    __m256i b1 = _mm256_unpackhi_epi16(a0, a2);
  431|     26|    __m256i b2 = _mm256_unpacklo_epi16(a1, a3);
  432|     26|    __m256i b3 = _mm256_unpackhi_epi16(a1, a3);
  433|     26|    __m256i b4 = _mm256_unpacklo_epi16(a4, a6);
  434|     26|    __m256i b5 = _mm256_unpackhi_epi16(a4, a6);
  435|     26|    __m256i b6 = _mm256_unpacklo_epi16(a5, a7);
  436|     26|    __m256i b7 = _mm256_unpackhi_epi16(a5, a7);
  437|       |
  438|     26|    __m256i r0 = _mm256_unpacklo_epi32(b0, b4);
  439|     26|    __m256i r1 = _mm256_unpackhi_epi32(b0, b4);
  440|     26|    __m256i r2 = _mm256_unpacklo_epi32(b1, b5);
  441|     26|    __m256i r3 = _mm256_unpackhi_epi32(b1, b5);
  442|     26|    __m256i r4 = _mm256_unpacklo_epi32(b2, b6);
  443|     26|    __m256i r5 = _mm256_unpackhi_epi32(b2, b6);
  444|     26|    __m256i r6 = _mm256_unpacklo_epi32(b3, b7);
  445|     26|    __m256i r7 = _mm256_unpackhi_epi32(b3, b7);
  446|       |
  447|       |    /* Prefix sum depth 1: combine adjacent pairs of 8-byte records within each 128-bit lane. */
  448|     26|    r0 = _mm256_add_epi8(r0, _mm256_slli_si256(r0, 8));
  449|     26|    r1 = _mm256_add_epi8(r1, _mm256_slli_si256(r1, 8));
  450|     26|    r2 = _mm256_add_epi8(r2, _mm256_slli_si256(r2, 8));
  451|     26|    r3 = _mm256_add_epi8(r3, _mm256_slli_si256(r3, 8));
  452|     26|    r4 = _mm256_add_epi8(r4, _mm256_slli_si256(r4, 8));
  453|     26|    r5 = _mm256_add_epi8(r5, _mm256_slli_si256(r5, 8));
  454|     26|    r6 = _mm256_add_epi8(r6, _mm256_slli_si256(r6, 8));
  455|     26|    r7 = _mm256_add_epi8(r7, _mm256_slli_si256(r7, 8));
  456|       |
  457|       |    /* Prefix sum depth 2: combine pairs into 4-record groups. */
  458|     26|    r1 = _mm256_add_epi8(r1, dup_hi64_256(r0));
  459|     26|    r3 = _mm256_add_epi8(r3, dup_hi64_256(r2));
  460|     26|    r5 = _mm256_add_epi8(r5, dup_hi64_256(r4));
  461|     26|    r7 = _mm256_add_epi8(r7, dup_hi64_256(r6));
  462|       |
  463|       |    /* Prefix sum depth 3: combine 4-record groups into 8-record halves. */
  464|     26|    __m256i d1 = dup_hi64_256(r1);
  465|     26|    __m256i d5 = dup_hi64_256(r5);
  466|     26|    r2 = _mm256_add_epi8(r2, d1);
  467|     26|    r3 = _mm256_add_epi8(r3, d1);
  468|     26|    r6 = _mm256_add_epi8(r6, d5);
  469|     26|    r7 = _mm256_add_epi8(r7, d5);
  470|       |
  471|       |    /* Prefix sum depth 4: compute 16-record local totals in r7_local before applying carries. */
  472|     26|    __m256i d3 = dup_hi64_256(r3);
  473|     26|    __m256i r7_local = _mm256_add_epi8(r7, d3);
  474|       |
  475|       |    /* Build per-lane tile carry [carry, carry + sum_lo] and advance running carry128. */
  476|     26|    __m128i r7_lo = _mm256_castsi256_si128(r7_local);
  477|     26|    __m128i r7_hi = _mm256_extracti128_si256(r7_local, 1);
  478|     26|    __m128i sum_lo = _mm_unpackhi_epi64(r7_lo, r7_lo);
  479|     26|    __m128i sum_hi = _mm_unpackhi_epi64(r7_hi, r7_hi);
  480|     26|    __m128i carry_hi = _mm_add_epi8(carry128, sum_lo);
  481|     26|    __m256i tile_carry = _mm256_inserti128_si256(_mm256_castsi128_si256(carry128), carry_hi, 1);
  482|     26|    carry128 = _mm_add_epi8(carry128, _mm_add_epi8(sum_lo, sum_hi));
  483|       |
  484|       |    /* Fold tile_carry with d3 for r4..r6 to save vector adds, then finalize r0..r7. */
  485|     26|    __m256i d3c = _mm256_add_epi8(d3, tile_carry);
  486|     26|    r0 = _mm256_add_epi8(r0, tile_carry);
  487|     26|    r1 = _mm256_add_epi8(r1, tile_carry);
  488|     26|    r2 = _mm256_add_epi8(r2, tile_carry);
  489|     26|    r3 = _mm256_add_epi8(r3, tile_carry);
  490|     26|    r4 = _mm256_add_epi8(r4, d3c);
  491|     26|    r5 = _mm256_add_epi8(r5, d3c);
  492|     26|    r6 = _mm256_add_epi8(r6, d3c);
  493|     26|    r7 = _mm256_add_epi8(r7_local, tile_carry);
  494|       |
  495|       |    /* Split-store low 128-bit lanes (records 0..15) and high lanes (16..31) without vperm2i128. */
  496|     26|    uint8_t *dst = output + i * 8;
  497|     26|    _mm_storeu_si128((__m128i *)(dst + 0), _mm256_castsi256_si128(r0));
  498|     26|    _mm_storeu_si128((__m128i *)(dst + 16), _mm256_castsi256_si128(r1));
  499|     26|    _mm_storeu_si128((__m128i *)(dst + 32), _mm256_castsi256_si128(r2));
  500|     26|    _mm_storeu_si128((__m128i *)(dst + 48), _mm256_castsi256_si128(r3));
  501|     26|    _mm_storeu_si128((__m128i *)(dst + 64), _mm256_castsi256_si128(r4));
  502|     26|    _mm_storeu_si128((__m128i *)(dst + 80), _mm256_castsi256_si128(r5));
  503|     26|    _mm_storeu_si128((__m128i *)(dst + 96), _mm256_castsi256_si128(r6));
  504|     26|    _mm_storeu_si128((__m128i *)(dst + 112), _mm256_castsi256_si128(r7));
  505|     26|    _mm_storeu_si128((__m128i *)(dst + 128), _mm256_extracti128_si256(r0, 1));
  506|     26|    _mm_storeu_si128((__m128i *)(dst + 144), _mm256_extracti128_si256(r1, 1));
  507|     26|    _mm_storeu_si128((__m128i *)(dst + 160), _mm256_extracti128_si256(r2, 1));
  508|     26|    _mm_storeu_si128((__m128i *)(dst + 176), _mm256_extracti128_si256(r3, 1));
  509|     26|    _mm_storeu_si128((__m128i *)(dst + 192), _mm256_extracti128_si256(r4, 1));
  510|     26|    _mm_storeu_si128((__m128i *)(dst + 208), _mm256_extracti128_si256(r5, 1));
  511|     26|    _mm_storeu_si128((__m128i *)(dst + 224), _mm256_extracti128_si256(r6, 1));
  512|     26|    _mm_storeu_si128((__m128i *)(dst + 240), _mm256_extracti128_si256(r7, 1));
  513|     26|  }
  514|       |  /* Scalar tail for remaining <32 records and any incomplete trailing bytes. */
  515|    487|  uint8_t tail_carry[16];
  516|    487|  _mm_storeu_si128((__m128i *)tail_carry, carry128);
  517|  4.38k|  for (int p = 0; p < 8; p++) {
  ------------------
  |  Branch (517:19): [True: 3.89k, False: 487]
  ------------------
  518|  3.89k|    uint8_t carry = tail_carry[p];
  519|  14.2k|    for (int i = vector_count; i < count; i++) {
  ------------------
  |  Branch (519:32): [True: 10.3k, False: 3.89k]
  ------------------
  520|  10.3k|      carry = (uint8_t)(carry + input[p * count + i]);
  521|  10.3k|      output[i * 8 + p] = carry;
  522|  10.3k|    }
  523|  3.89k|  }
  524|    487|  memcpy(output + count * 8, input + count * 8, (size_t)(length % 8));
  525|    487|  return 1;
  526|    487|}
shuffle-bytedelta-avx2.c:dup_hi64_256:
   90|    182|static inline __m256i dup_hi64_256(__m256i v) {
   91|       |  /* Broadcast the upper 64-bit record of each 128-bit lane across that lane. */
   92|    182|  return _mm256_unpackhi_epi64(v, v);
   93|    182|}

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

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

shuffle_bytedelta_available:
  443|  1.46k|int shuffle_bytedelta_available(void) {
  444|  1.46k|  init_shuffle_implementation();
  445|       |  return host_shuffle_bytedelta_forward != NULL;
  446|  1.46k|}
blosc_cpu_has_avx2:
  448|  1.28k|int blosc_cpu_has_avx2(void) {
  449|  1.28k|  init_shuffle_implementation();
  450|  1.28k|  return host_has_avx2;
  451|  1.28k|}
shuffle_bytedelta_backward:
  462|  1.46k|int shuffle_bytedelta_backward(const uint8_t *input, uint8_t *output, int32_t length, int typesize) {
  463|  1.46k|  init_shuffle_implementation();
  464|  1.46k|  if ((typesize != 2 && typesize != 4 && typesize != 8) || length < 0 || input == output ||
  ------------------
  |  Branch (464:8): [True: 972, False: 494]
  |  Branch (464:25): [True: 487, False: 485]
  |  Branch (464:42): [True: 0, False: 487]
  |  Branch (464:60): [True: 0, False: 1.46k]
  |  Branch (464:74): [True: 0, False: 1.46k]
  ------------------
  465|  1.46k|      host_shuffle_bytedelta_backward == NULL) {
  ------------------
  |  Branch (465:7): [True: 0, False: 1.46k]
  ------------------
  466|      0|    return 0;
  467|      0|  }
  468|  1.46k|  return host_shuffle_bytedelta_backward(input, output, length, typesize);
  469|  1.46k|}
blosc2_unshuffle:
  502|  13.3k|                 const void* src, void* dest) {
  503|       |  /* Initialize the shuffle implementation if necessary. */
  504|  13.3k|  init_shuffle_implementation();
  505|       |
  506|  13.3k|  if (typesize < 1 || typesize > 256 || blocksize < 0) {
  ------------------
  |  Branch (506:7): [True: 0, False: 13.3k]
  |  Branch (506:23): [True: 0, False: 13.3k]
  |  Branch (506:41): [True: 0, False: 13.3k]
  ------------------
  507|      0|    return BLOSC2_ERROR_INVALID_PARAM;
  508|      0|  }
  509|       |
  510|       |  /* Unshuffling single bytes is the identity (see blosc2_shuffle). */
  511|  13.3k|  if (typesize == 1) {
  ------------------
  |  Branch (511:7): [True: 0, False: 13.3k]
  ------------------
  512|      0|    if (dest != src) {
  ------------------
  |  Branch (512:9): [True: 0, False: 0]
  ------------------
  513|      0|      memcpy(dest, src, (size_t)blocksize);
  514|      0|    }
  515|      0|    return blocksize;
  516|      0|  }
  517|       |
  518|       |  /* The implementation is initialized.
  519|       |     Dispatch to it's unshuffle routine. */
  520|  13.3k|  (host_implementation.unshuffle)(typesize, blocksize, src, dest);
  521|       |
  522|  13.3k|  return blocksize;
  523|  13.3k|}
bitunshuffle:
  582|  6.05k|                     const uint8_t format_version) {
  583|       |  /* Initialize the shuffle implementation if necessary. */
  584|  6.05k|  init_shuffle_implementation();
  585|  6.05k|  size_t size = blocksize / typesize;
  586|       |
  587|  6.05k|  if (format_version == 2) {
  ------------------
  |  Branch (587:7): [True: 1.56k, False: 4.48k]
  ------------------
  588|       |    /* Starting from version 3, bitshuffle() works differently */
  589|  1.56k|    if ((size % 8) == 0) {
  ------------------
  |  Branch (589:9): [True: 869, False: 695]
  ------------------
  590|       |      /* The number of elems is a multiple of 8 which is supported by
  591|       |         bitshuffle. */
  592|    869|      int ret = (int) run_bitshuffle(host_implementation.bitunshuffle,
  593|    869|                                     src, dest, size, typesize, tmp);
  594|    869|      if (ret < 0) {
  ------------------
  |  Branch (594:11): [True: 0, False: 869]
  ------------------
  595|       |        // Some error in bitshuffle (should not happen)
  596|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  597|      0|        return ret;
  598|      0|      }
  599|       |      /* Copy the leftovers (the bytes that do not make up a whole element), as
  600|       |         Blosc1 does when it writes them after the shuffled part. */
  601|    869|      size_t offset = size * typesize;
  602|    869|      memcpy((uint8_t *) dest + offset, (const uint8_t *) src + offset, blocksize - offset);
  603|    869|    }
  604|    695|    else {
  605|    695|      memcpy(dest, src, blocksize);
  606|    695|    }
  607|  1.56k|  }
  608|  4.48k|  else {
  609|       |    /* bitshuffle only supports a number of bytes that is a multiple of 8. */
  610|  4.48k|    size -= size % 8;
  611|  4.48k|    int ret = (int) run_bitshuffle(host_implementation.bitunshuffle, src, dest, size, typesize, tmp);
  612|  4.48k|    if (ret < 0) {
  ------------------
  |  Branch (612:9): [True: 0, False: 4.48k]
  ------------------
  613|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  614|      0|      return ret;
  615|      0|    }
  616|       |
  617|       |    /* Copy the leftovers */
  618|  4.48k|    size_t offset = size * typesize;
  619|  4.48k|    memcpy((uint8_t *) dest + offset, (const uint8_t *) src + offset, blocksize - offset);
  620|  4.48k|  }
  621|       |
  622|  6.05k|  return blocksize;
  623|  6.05k|}
shuffle.c:init_shuffle_implementation:
  436|  23.6k|static void init_shuffle_implementation(void) {
  437|  23.6k|  pthread_once(&implementation_once, set_host_implementation);
  438|  23.6k|}
shuffle.c:set_host_implementation:
  392|      1|static void set_host_implementation(void) {
  393|      1|  host_implementation = get_shuffle_implementation();
  394|      1|#if defined(SHUFFLE_AVX512_ENABLED) || defined(SHUFFLE_AVX2_ENABLED) || defined(SHUFFLE_SSE2_ENABLED)
  395|      1|  blosc_cpu_features cpu_features = blosc_get_cpu_features();
  396|      1|  host_has_avx2 = (cpu_features & BLOSC_HAVE_AVX2) != 0;
  397|      1|#if defined(SHUFFLE_BYTEDELTA_AVX2_ENABLED)
  398|      1|  if (cpu_features & BLOSC_HAVE_AVX2) {
  ------------------
  |  Branch (398:7): [True: 1, False: 0]
  ------------------
  399|      1|    host_shuffle_bytedelta_forward = shuffle_bytedelta_avx2_forward;
  400|      1|    host_shuffle_bytedelta_backward = shuffle_bytedelta_avx2_backward;
  401|      1|  }
  402|      1|#endif
  403|      1|#if defined(SHUFFLE_BYTEDELTA_SSSE3_ENABLED)
  404|       |  /* SSSE3 needs only the legacy XMM state, not AVX/XSAVE or YMM support. */
  405|      1|  if (host_shuffle_bytedelta_forward == NULL && (cpu_features & BLOSC_HAVE_SSSE3)) {
  ------------------
  |  Branch (405:7): [True: 0, False: 1]
  |  Branch (405:49): [True: 0, False: 0]
  ------------------
  406|      0|    host_shuffle_bytedelta_forward = shuffle_bytedelta_ssse3_forward;
  407|      0|    host_shuffle_bytedelta_backward = shuffle_bytedelta_ssse3_backward;
  408|      0|  }
  409|      1|#endif
  410|       |#elif defined(SHUFFLE_BYTEDELTA_NEON_ENABLED) && (defined(__aarch64__) || defined(_M_ARM64))
  411|       |  host_shuffle_bytedelta_forward = shuffle_bytedelta_neon_forward;
  412|       |  host_shuffle_bytedelta_backward = shuffle_bytedelta_neon_backward;
  413|       |#endif
  414|      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:
  528|  5.35k|                              const size_t size, const size_t typesize, void* tmp) {
  529|  5.35k|  if (size == 0) {
  ------------------
  |  Branch (529:7): [True: 3.27k, False: 2.07k]
  ------------------
  530|  3.27k|    return 0;  /* fewer than 8 elements: only leftovers */
  531|  3.27k|  }
  532|  2.07k|  void* scratch = (tmp != NULL) ? tmp : malloc(size * typesize);
  ------------------
  |  Branch (532:19): [True: 2.07k, False: 0]
  ------------------
  533|  2.07k|  if (scratch == NULL) {
  ------------------
  |  Branch (533:7): [True: 0, False: 2.07k]
  ------------------
  534|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
  535|      0|  }
  536|  2.07k|  int64_t ret = routine(src, dest, size, typesize, scratch);
  537|  2.07k|  if (scratch != tmp) {
  ------------------
  |  Branch (537:7): [True: 0, False: 2.07k]
  ------------------
  538|      0|    free(scratch);
  539|      0|  }
  540|  2.07k|  return ret;
  541|  2.07k|}

blosc2.c:print_error:
  525|     27|static inline char *print_error(int rc) {
  526|       |  // TODO: remove this function, use blosc2_error_string only
  527|     27|  return (char *) blosc2_error_string(rc);
  528|     27|}
ndcell.c:blosc2_meta_get:
 2774|      7|                                  int32_t *content_len) {
 2775|      7|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2775:7): [True: 7, False: 0]
  |  Branch (2775:25): [True: 0, False: 0]
  |  Branch (2775:41): [True: 0, False: 0]
  |  Branch (2775:60): [True: 0, False: 0]
  ------------------
 2776|      7|    BLOSC_TRACE_ERROR("Invalid parameters.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2777|      7|    return BLOSC2_ERROR_INVALID_PARAM;
 2778|      7|  }
 2779|       |
 2780|      0|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2781|      0|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2781:7): [True: 0, False: 0]
  ------------------
 2782|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2783|      0|    return nmetalayer;
 2784|      0|  }
 2785|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2786|      0|  if (len < 0) {
  ------------------
  |  Branch (2786:7): [True: 0, False: 0]
  ------------------
 2787|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2788|      0|    return BLOSC2_ERROR_DATA;
 2789|      0|  }
 2790|      0|  *content_len = len;
 2791|      0|  if (len == 0) {
  ------------------
  |  Branch (2791:7): [True: 0, False: 0]
  ------------------
 2792|      0|    *content = NULL;
 2793|      0|    return nmetalayer;
 2794|      0|  }
 2795|      0|  *content = (uint8_t*)malloc((size_t)len);
 2796|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2796:7): [True: 0, False: 0]
  ------------------
 2797|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2798|      0|    *content_len = 0;
 2799|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2800|      0|  }
 2801|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2801:7): [True: 0, False: 0]
  |  Branch (2801:18): [True: 0, False: 0]
  ------------------
 2802|      0|    free(*content);
 2803|      0|    *content = NULL;
 2804|      0|    *content_len = 0;
 2805|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2806|      0|    return BLOSC2_ERROR_DATA;
 2807|      0|  }
 2808|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2809|      0|  return nmetalayer;
 2810|      0|}
ndmean.c:blosc2_meta_get:
 2774|      6|                                  int32_t *content_len) {
 2775|      6|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2775:7): [True: 6, False: 0]
  |  Branch (2775:25): [True: 0, False: 0]
  |  Branch (2775:41): [True: 0, False: 0]
  |  Branch (2775:60): [True: 0, False: 0]
  ------------------
 2776|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2777|      6|    return BLOSC2_ERROR_INVALID_PARAM;
 2778|      6|  }
 2779|       |
 2780|      0|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2781|      0|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2781:7): [True: 0, False: 0]
  ------------------
 2782|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2783|      0|    return nmetalayer;
 2784|      0|  }
 2785|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2786|      0|  if (len < 0) {
  ------------------
  |  Branch (2786:7): [True: 0, False: 0]
  ------------------
 2787|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2788|      0|    return BLOSC2_ERROR_DATA;
 2789|      0|  }
 2790|      0|  *content_len = len;
 2791|      0|  if (len == 0) {
  ------------------
  |  Branch (2791:7): [True: 0, False: 0]
  ------------------
 2792|      0|    *content = NULL;
 2793|      0|    return nmetalayer;
 2794|      0|  }
 2795|      0|  *content = (uint8_t*)malloc((size_t)len);
 2796|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2796:7): [True: 0, False: 0]
  ------------------
 2797|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2798|      0|    *content_len = 0;
 2799|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2800|      0|  }
 2801|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2801:7): [True: 0, False: 0]
  |  Branch (2801:18): [True: 0, False: 0]
  ------------------
 2802|      0|    free(*content);
 2803|      0|    *content = NULL;
 2804|      0|    *content_len = 0;
 2805|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2806|      0|    return BLOSC2_ERROR_DATA;
 2807|      0|  }
 2808|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2809|      0|  return nmetalayer;
 2810|      0|}
bytedelta.c:print_error:
  525|     17|static inline char *print_error(int rc) {
  526|       |  // TODO: remove this function, use blosc2_error_string only
  527|     17|  return (char *) blosc2_error_string(rc);
  528|     17|}

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

ndlz_decompress:
   42|  1.88k|                    uint8_t meta, blosc2_dparams *dparams, const void *chunk) {
   43|  1.88k|  NDLZ_ERROR_NULL(input);
  ------------------
  |  |   19|  1.88k|  do {                           \
  |  |   20|  1.88k|    if ((pointer) == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (20:9): [True: 0, False: 1.88k]
  |  |  ------------------
  |  |   21|      0|      return 0;                  \
  |  |   22|      0|    }                            \
  |  |   23|  1.88k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (23:12): [Folded, False: 1.88k]
  |  |  ------------------
  ------------------
   44|  1.88k|  NDLZ_ERROR_NULL(output);
  ------------------
  |  |   19|  1.88k|  do {                           \
  |  |   20|  1.88k|    if ((pointer) == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (20:9): [True: 0, False: 1.88k]
  |  |  ------------------
  |  |   21|      0|      return 0;                  \
  |  |   22|      0|    }                            \
  |  |   23|  1.88k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (23:12): [Folded, False: 1.88k]
  |  |  ------------------
  ------------------
   45|  1.88k|  NDLZ_ERROR_NULL(dparams);
  ------------------
  |  |   19|  1.88k|  do {                           \
  |  |   20|  1.88k|    if ((pointer) == NULL) {     \
  |  |  ------------------
  |  |  |  Branch (20:9): [True: 0, False: 1.88k]
  |  |  ------------------
  |  |   21|      0|      return 0;                  \
  |  |   22|      0|    }                            \
  |  |   23|  1.88k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (23:12): [Folded, False: 1.88k]
  |  |  ------------------
  ------------------
   46|  1.88k|  BLOSC_UNUSED_PARAM(chunk);
  ------------------
  |  |   28|  1.88k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
   47|       |
   48|  1.88k|  switch (meta) {
   49|  1.21k|    case 4:
  ------------------
  |  Branch (49:5): [True: 1.21k, False: 677]
  ------------------
   50|  1.21k|      return ndlz4_decompress(input, input_len, output, output_len, meta, dparams);
   51|    676|    case 8:
  ------------------
  |  Branch (51:5): [True: 676, False: 1.21k]
  ------------------
   52|    676|      return ndlz8_decompress(input, input_len, output, output_len, meta, dparams);
   53|      1|    default:
  ------------------
  |  Branch (53:5): [True: 1, False: 1.88k]
  ------------------
   54|      1|      BLOSC_TRACE_ERROR("NDLZ is not available for this cellsize: %d", meta);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   55|  1.88k|  }
   56|      1|  return BLOSC2_ERROR_FAILURE;
   57|  1.88k|}

ndlz4_decompress:
  526|  1.21k|                     uint8_t meta, blosc2_dparams *dparams) {
  527|  1.21k|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|  1.21k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  528|  1.21k|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|  1.21k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  529|  1.21k|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|  1.21k|    do {                                            \
  |  |  105|  1.21k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 1.21k]
  |  |  ------------------
  |  |  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.21k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 1.21k]
  |  |  ------------------
  ------------------
  530|  1.21k|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|  1.21k|    do {                                            \
  |  |  105|  1.21k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 1.21k]
  |  |  ------------------
  |  |  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.21k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 1.21k]
  |  |  ------------------
  ------------------
  531|       |
  532|  1.21k|  uint8_t *ip = (uint8_t *) input;
  533|  1.21k|  uint8_t *op = (uint8_t *) output;
  534|  1.21k|  uint8_t ndim;
  535|  1.21k|  int32_t blockshape[2];
  536|  1.21k|  int32_t eshape[2];
  537|  1.21k|  uint8_t *buffercpy;
  538|  1.21k|  uint8_t local_buffer[16];
  539|  1.21k|  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.21k|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < (int32_t) (1 + 2 * sizeof(int32_t)))) {
  ------------------
  |  |   30|  1.21k|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 3, False: 1.20k]
  |  |  ------------------
  ------------------
  546|      3|    return 0;
  547|      3|  }
  548|  1.20k|  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.20k|#define NDLZ4_CHECK_RANGE(pos, len)                                              \
  560|  1.20k|  do {                                                                           \
  561|  1.20k|    int64_t _pos = (int64_t) (pos);                                              \
  562|  1.20k|    int64_t _len = (int64_t) (len);                                              \
  563|  1.20k|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  564|  1.20k|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  565|  1.20k|      return BLOSC2_ERROR_FAILURE;                                               \
  566|  1.20k|    }                                                                            \
  567|  1.20k|  } while (0)
  568|       |
  569|       |  /* we start with literal copy */
  570|  1.20k|  ndim = *ip;
  571|  1.20k|  ip++;
  572|  1.20k|  if (ndim != 2) {
  ------------------
  |  Branch (572:7): [True: 8, False: 1.20k]
  ------------------
  573|      8|    BLOSC_TRACE_ERROR("This codec only works for ndim = 2");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  574|      8|    return BLOSC2_ERROR_FAILURE;
  575|      8|  }
  576|  1.20k|  memcpy(&blockshape[0], ip, 4);
  577|  1.20k|  ip += 4;
  578|  1.20k|  memcpy(&blockshape[1], ip, 4);
  579|  1.20k|  ip += 4;
  580|       |
  581|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3204
  582|  1.20k|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (582:7): [True: 0, False: 1.20k]
  |  Branch (582:25): [True: 3, False: 1.19k]
  |  Branch (582:46): [True: 27, False: 1.17k]
  ------------------
  583|     30|    BLOSC_TRACE_ERROR("Output length or blockshape is negative");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  584|     30|    return BLOSC2_ERROR_FAILURE;
  585|     30|  }
  586|       |
  587|  1.17k|  eshape[0] = ((blockshape[0] + 3) / 4) * 4;
  588|  1.17k|  eshape[1] = ((blockshape[1] + 3) / 4) * 4;
  589|       |
  590|  1.17k|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|  1.17k|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 98, False: 1.07k]
  |  |  ------------------
  ------------------
  591|     98|    BLOSC_TRACE_ERROR("The blockshape is bigger than the output buffer");
  ------------------
  |  |   93|     98|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     98|    do {                                            \
  |  |  |  |   98|     98|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     98|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 98, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     98|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  592|     98|    return 0;
  593|     98|  }
  594|  1.07k|  memset(op, 0, blockshape[0] * blockshape[1]);
  595|       |
  596|  1.07k|  uint32_t i_stop[2];
  597|  3.21k|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (597:19): [True: 2.14k, False: 1.07k]
  ------------------
  598|  2.14k|    i_stop[i] = eshape[i] / 4;
  599|  2.14k|  }
  600|       |
  601|       |  /* main loop */
  602|  1.07k|  uint32_t ii[2];
  603|  1.07k|  uint32_t padding[2] = {0};
  604|  1.07k|  uint32_t ind = 0;
  605|  1.07k|  uint8_t cell_aux[16];
  606|   494M|  for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
  ------------------
  |  Branch (606:19): [True: 494M, False: 822]
  ------------------
  607|   494M|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (607:21): [True: 2.22k, False: 494M]
  ------------------
  608|  2.22k|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|  2.22k|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 2.22k]
  |  |  ------------------
  ------------------
  609|      0|        BLOSC_TRACE_ERROR("Exceeding input length");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  610|      0|        return BLOSC2_ERROR_FAILURE;
  611|      0|      }
  612|  2.22k|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (612:11): [True: 1.24k, False: 982]
  ------------------
  613|  1.24k|        padding[0] = (blockshape[0] % 4 == 0) ? 4 : blockshape[0] % 4;
  ------------------
  |  Branch (613:22): [True: 118, False: 1.12k]
  ------------------
  614|  1.24k|      } else {
  615|    982|        padding[0] = 4;
  616|    982|      }
  617|  2.22k|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (617:11): [True: 1.78k, False: 440]
  ------------------
  618|  1.78k|        padding[1] = (blockshape[1] % 4 == 0) ? 4 : blockshape[1] % 4;
  ------------------
  |  Branch (618:22): [True: 99, False: 1.68k]
  ------------------
  619|  1.78k|      } else {
  620|    440|        padding[1] = 4;
  621|    440|      }
  622|  2.22k|      int64_t cur = ip - (const uint8_t *) input;   // in-range: ip is within [input, ip_limit]
  623|  2.22k|      NDLZ4_CHECK_RANGE(cur, 1);
  ------------------
  |  |  560|  2.22k|  do {                                                                           \
  |  |  561|  2.22k|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|  2.22k|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|  2.22k|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 2.22k]
  |  |  |  Branch (563:21): [True: 0, False: 2.22k]
  |  |  |  Branch (563:33): [True: 20, False: 2.20k]
  |  |  ------------------
  |  |  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|  2.22k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 2.20k]
  |  |  ------------------
  ------------------
  624|  2.20k|      token = *ip++;
  625|  2.20k|      if (token == 0) {    // no match
  ------------------
  |  Branch (625:11): [True: 353, False: 1.85k]
  ------------------
  626|    353|        NDLZ4_CHECK_RANGE(cur + 1, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  560|    353|  do {                                                                           \
  |  |  561|    353|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    353|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    353|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 353]
  |  |  |  Branch (563:21): [True: 0, False: 353]
  |  |  |  Branch (563:33): [True: 19, False: 334]
  |  |  ------------------
  |  |  564|     19|      BLOSC_TRACE_ERROR("ndlz4: 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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     19|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     19|    }                                                                            \
  |  |  567|    353|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 334]
  |  |  ------------------
  ------------------
  627|    334|        buffercpy = ip;
  628|    334|        ip += padding[0] * padding[1];
  629|  1.85k|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (629:18): [True: 117, False: 1.73k]
  ------------------
  630|    117|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    117|  do {                                                                           \
  |  |  561|    117|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    117|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    117|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 117]
  |  |  |  Branch (563:21): [True: 0, False: 117]
  |  |  |  Branch (563:33): [True: 2, False: 115]
  |  |  ------------------
  |  |  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|    117|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 115]
  |  |  ------------------
  ------------------
  631|    115|        uint16_t offset;
  632|    115|        memcpy(&offset, ip, sizeof(offset));
  633|    115|        int64_t bpos = (cur + 1) - (int64_t) offset - 1;   // back-reference start offset
  634|    115|        NDLZ4_CHECK_RANGE(bpos, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  560|    115|  do {                                                                           \
  |  |  561|    115|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    115|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    115|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 20, False: 95]
  |  |  |  Branch (563:21): [True: 0, False: 95]
  |  |  |  Branch (563:33): [True: 4, False: 91]
  |  |  ------------------
  |  |  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|    115|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 91]
  |  |  ------------------
  ------------------
  635|     91|        buffercpy = (uint8_t *) input + bpos;
  636|     91|        ip += 2;
  637|  1.73k|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (637:18): [True: 374, False: 1.36k]
  ------------------
  638|    374|        NDLZ4_CHECK_RANGE(cur + 1, 1);
  ------------------
  |  |  560|    374|  do {                                                                           \
  |  |  561|    374|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    374|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    374|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 374]
  |  |  |  Branch (563:21): [True: 0, False: 374]
  |  |  |  Branch (563:33): [True: 2, False: 372]
  |  |  ------------------
  |  |  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|    374|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 372]
  |  |  ------------------
  ------------------
  639|    372|        buffercpy = cell_aux;
  640|    372|        memset(buffercpy, *ip, 16);
  641|    372|        ip++;
  642|  1.36k|      } else if (token >= 224) { // three rows match
  ------------------
  |  Branch (642:18): [True: 411, False: 949]
  ------------------
  643|    411|        buffercpy = local_buffer;
  644|    411|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    411|  do {                                                                           \
  |  |  561|    411|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    411|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    411|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 411]
  |  |  |  Branch (563:21): [True: 0, False: 411]
  |  |  |  Branch (563:33): [True: 4, False: 407]
  |  |  ------------------
  |  |  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|    411|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 407]
  |  |  ------------------
  ------------------
  645|    407|        uint16_t offset;
  646|    407|        memcpy(&offset, ip, sizeof(offset));
  647|    407|        offset += 3;
  648|    407|        ip += 2;
  649|    407|        int i, j, k;
  650|    407|        if ((token >> 3U) == 28) {
  ------------------
  |  Branch (650:13): [True: 84, False: 323]
  ------------------
  651|     84|          i = 1;
  652|     84|          j = 2;
  653|     84|          k = 3;
  654|    323|        } else {
  655|    323|          i = 0;
  656|    323|          if ((token >> 3U) < 30) {
  ------------------
  |  Branch (656:15): [True: 86, False: 237]
  ------------------
  657|     86|            j = 1;
  658|     86|            k = 2;
  659|    237|          } else {
  660|    237|            k = 3;
  661|    237|            if ((token >> 3U) == 30) {
  ------------------
  |  Branch (661:17): [True: 93, False: 144]
  ------------------
  662|     93|              j = 1;
  663|    144|            } else {
  664|    144|              j = 2;
  665|    144|            }
  666|    237|          }
  667|    323|        }
  668|    407|        int64_t bpos = (cur + 3) - (int64_t) offset;   // == (ip - offset) as an offset
  669|    407|        NDLZ4_CHECK_RANGE(bpos, 12);
  ------------------
  |  |  560|    407|  do {                                                                           \
  |  |  561|    407|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    407|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    407|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 32, False: 375]
  |  |  |  Branch (563:21): [True: 0, False: 375]
  |  |  |  Branch (563:33): [True: 8, False: 367]
  |  |  ------------------
  |  |  564|     40|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     40|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     40|    do {                                            \
  |  |  |  |  |  |   98|     40|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     40|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 40, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     40|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     40|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     40|    }                                                                            \
  |  |  567|    407|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 367]
  |  |  ------------------
  ------------------
  670|    367|        const uint8_t *ref = (const uint8_t *) input + bpos;
  671|    367|        memcpy(&buffercpy[i * 4], ref, 4);
  672|    367|        memcpy(&buffercpy[j * 4], ref + 4, 4);
  673|    367|        memcpy(&buffercpy[k * 4], ref + 8, 4);
  674|    901|        for (int l = 0; l < 4; l++) {
  ------------------
  |  Branch (674:25): [True: 901, False: 0]
  ------------------
  675|    901|          if ((l != i) && (l != j) && (l != k)) {
  ------------------
  |  Branch (675:15): [True: 612, False: 289]
  |  Branch (675:27): [True: 445, False: 167]
  |  Branch (675:39): [True: 367, False: 78]
  ------------------
  676|    367|            NDLZ4_CHECK_RANGE(ip - (const uint8_t *) input, 4);
  ------------------
  |  |  560|    367|  do {                                                                           \
  |  |  561|    367|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    367|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    367|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 367]
  |  |  |  Branch (563:21): [True: 0, False: 367]
  |  |  |  Branch (563:33): [True: 9, False: 358]
  |  |  ------------------
  |  |  564|      9|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      9|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      9|    }                                                                            \
  |  |  567|    367|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 358]
  |  |  ------------------
  ------------------
  677|    358|            memcpy(&buffercpy[l * 4], ip, 4);
  678|    358|            ip += 4;
  679|    358|            break;
  680|    367|          }
  681|    901|        }
  682|       |
  683|    949|      } else if ((token >= 128) && (token <= 191)) { // rows pair match
  ------------------
  |  Branch (683:18): [True: 639, False: 310]
  |  Branch (683:36): [True: 638, False: 1]
  ------------------
  684|    638|        buffercpy = local_buffer;
  685|    638|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    638|  do {                                                                           \
  |  |  561|    638|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    638|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    638|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 638]
  |  |  |  Branch (563:21): [True: 0, False: 638]
  |  |  |  Branch (563:33): [True: 5, False: 633]
  |  |  ------------------
  |  |  564|      5|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      5|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      5|    }                                                                            \
  |  |  567|    638|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 633]
  |  |  ------------------
  ------------------
  686|    633|        uint16_t offset;
  687|    633|        memcpy(&offset, ip, sizeof(offset));
  688|    633|        offset += 3;
  689|    633|        ip += 2;
  690|    633|        int i, j;
  691|    633|        if (token == 128) {
  ------------------
  |  Branch (691:13): [True: 130, False: 503]
  ------------------
  692|    130|          i = 2;
  693|    130|          j = 3;
  694|    503|        } else {
  695|    503|          i = (token - 128) >> 5U;
  696|    503|          j = ((token - 128) >> 3U) - (i << 2U);
  697|    503|        }
  698|    633|        int64_t bpos = (cur + 3) - (int64_t) offset;
  699|    633|        NDLZ4_CHECK_RANGE(bpos, 8);
  ------------------
  |  |  560|    633|  do {                                                                           \
  |  |  561|    633|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    633|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    633|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 25, False: 608]
  |  |  |  Branch (563:21): [True: 0, False: 608]
  |  |  |  Branch (563:33): [True: 4, False: 604]
  |  |  ------------------
  |  |  564|     29|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     29|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     29|    do {                                            \
  |  |  |  |  |  |   98|     29|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     29|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 29, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     29|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     29|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     29|    }                                                                            \
  |  |  567|    633|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 604]
  |  |  ------------------
  ------------------
  700|    604|        const uint8_t *ref = (const uint8_t *) input + bpos;
  701|    604|        memcpy(&buffercpy[i * 4], ref, 4);
  702|    604|        memcpy(&buffercpy[j * 4], ref + 4, 4);
  703|  2.98k|        for (int k = 0; k < 4; k++) {
  ------------------
  |  Branch (703:25): [True: 2.40k, False: 583]
  ------------------
  704|  2.40k|          if ((k != i) && (k != j)) {
  ------------------
  |  Branch (704:15): [True: 1.80k, False: 601]
  |  Branch (704:27): [True: 1.20k, False: 591]
  ------------------
  705|  1.20k|            NDLZ4_CHECK_RANGE(ip - (const uint8_t *) input, 4);
  ------------------
  |  |  560|  1.20k|  do {                                                                           \
  |  |  561|  1.20k|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|  1.20k|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|  1.20k|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 1.20k]
  |  |  |  Branch (563:21): [True: 0, False: 1.20k]
  |  |  |  Branch (563:33): [True: 21, False: 1.18k]
  |  |  ------------------
  |  |  564|     21|      BLOSC_TRACE_ERROR("ndlz4: 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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     21|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     21|    }                                                                            \
  |  |  567|  1.20k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 1.18k]
  |  |  ------------------
  ------------------
  706|  1.18k|            memcpy(&buffercpy[k * 4], ip, 4);
  707|  1.18k|            ip += 4;
  708|  1.18k|          }
  709|  2.40k|        }
  710|    604|      } else if ((token >= 40) && (token <= 63)) {  // 2 rows pair matches
  ------------------
  |  Branch (710:18): [True: 301, False: 10]
  |  Branch (710:35): [True: 296, False: 5]
  ------------------
  711|    296|        buffercpy = local_buffer;
  712|    296|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    296|  do {                                                                           \
  |  |  561|    296|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    296|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    296|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 296]
  |  |  |  Branch (563:21): [True: 0, False: 296]
  |  |  |  Branch (563:33): [True: 3, False: 293]
  |  |  ------------------
  |  |  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|    296|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 293]
  |  |  ------------------
  ------------------
  713|    293|        uint16_t offset_1;
  714|    293|        memcpy(&offset_1, ip, sizeof(offset_1));
  715|    293|        offset_1 += 5;
  716|    293|        ip += 2;
  717|    293|        NDLZ4_CHECK_RANGE(cur + 3, 2);
  ------------------
  |  |  560|    293|  do {                                                                           \
  |  |  561|    293|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    293|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    293|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 293]
  |  |  |  Branch (563:21): [True: 0, False: 293]
  |  |  |  Branch (563:33): [True: 5, False: 288]
  |  |  ------------------
  |  |  564|      5|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      5|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      5|    }                                                                            \
  |  |  567|    293|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 288]
  |  |  ------------------
  ------------------
  718|    288|        uint16_t offset_2;
  719|    288|        memcpy(&offset_2, ip, sizeof(offset_2));
  720|    288|        offset_2 += 5;
  721|    288|        ip += 2;
  722|    288|        int i, j, k, l, m;
  723|    288|        i = 0;
  724|    288|        j = ((token - 32) >> 3U);
  725|    288|        l = -1;
  726|  1.15k|        for (k = 1; k < 4; k++) {
  ------------------
  |  Branch (726:21): [True: 864, False: 288]
  ------------------
  727|    864|          if ((k != i) && (k != j)) {
  ------------------
  |  Branch (727:15): [True: 864, False: 0]
  |  Branch (727:27): [True: 576, False: 288]
  ------------------
  728|    576|            if (l == -1) {
  ------------------
  |  Branch (728:17): [True: 288, False: 288]
  ------------------
  729|    288|              l = k;
  730|    288|            } else {
  731|    288|              m = k;
  732|    288|            }
  733|    576|          }
  734|    864|        }
  735|    288|        int64_t bpos1 = (cur + 5) - (int64_t) offset_1;
  736|    288|        NDLZ4_CHECK_RANGE(bpos1, 8);
  ------------------
  |  |  560|    288|  do {                                                                           \
  |  |  561|    288|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    288|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    288|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 23, False: 265]
  |  |  |  Branch (563:21): [True: 0, False: 265]
  |  |  |  Branch (563:33): [True: 5, False: 260]
  |  |  ------------------
  |  |  564|     28|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     28|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     28|    do {                                            \
  |  |  |  |  |  |   98|     28|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     28|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 28, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     28|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     28|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     28|    }                                                                            \
  |  |  567|    288|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 260]
  |  |  ------------------
  ------------------
  737|    260|        const uint8_t *ref1 = (const uint8_t *) input + bpos1;
  738|    260|        memcpy(&buffercpy[i * 4], ref1, 4);
  739|    260|        memcpy(&buffercpy[j * 4], ref1 + 4, 4);
  740|    260|        int64_t bpos2 = (cur + 5) - (int64_t) offset_2;
  741|    260|        NDLZ4_CHECK_RANGE(bpos2, 8);
  ------------------
  |  |  560|    260|  do {                                                                           \
  |  |  561|    260|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    260|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    260|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 23, False: 237]
  |  |  |  Branch (563:21): [True: 0, False: 237]
  |  |  |  Branch (563:33): [True: 1, False: 236]
  |  |  ------------------
  |  |  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|    260|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 236]
  |  |  ------------------
  ------------------
  742|    236|        const uint8_t *ref2 = (const uint8_t *) input + bpos2;
  743|    236|        memcpy(&buffercpy[l * 4], ref2, 4);
  744|    236|        memcpy(&buffercpy[m * 4], ref2 + 4, 4);
  745|       |
  746|    236|      } else {
  747|     15|        BLOSC_TRACE_ERROR("Invalid token: %u at cell [%d, %d]\n", token, ii[0], ii[1]);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  748|     15|        return BLOSC2_ERROR_FAILURE;
  749|     15|      }
  750|       |      // fill op with buffercpy
  751|  1.97k|      uint32_t orig = ii[0] * 4 * blockshape[1] + ii[1] * 4;
  752|  9.87k|      for (uint32_t i = 0; i < 4; i++) {
  ------------------
  |  Branch (752:28): [True: 7.89k, False: 1.97k]
  ------------------
  753|  7.89k|        if (i < padding[0]) {
  ------------------
  |  Branch (753:13): [True: 5.36k, False: 2.52k]
  ------------------
  754|  5.36k|          ind = orig + i * blockshape[1];
  755|  5.36k|          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|  5.36k|          buffercpy += padding[1];
  762|  5.36k|        }
  763|  7.89k|      }
  764|  1.97k|      if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (764:11): [True: 0, False: 1.97k]
  ------------------
  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.97k|    }
  769|   494M|  }
  770|    822|  ind += padding[1];
  771|       |
  772|    822|  if ((int32_t)ind != (blockshape[0] * blockshape[1])) {
  ------------------
  |  Branch (772:7): [True: 0, False: 822]
  ------------------
  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|    822|  if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (776:7): [True: 0, False: 822]
  ------------------
  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|    822|  return (int) ind;
  782|    822|#undef NDLZ4_CHECK_RANGE
  783|    822|}

ndlz8_decompress:
  444|    676|                     uint8_t meta, blosc2_dparams *dparams) {
  445|    676|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|    676|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  446|    676|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|    676|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  447|    676|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    676|    do {                                            \
  |  |  105|    676|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 676]
  |  |  ------------------
  |  |  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|    676|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 676]
  |  |  ------------------
  ------------------
  448|    676|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    676|    do {                                            \
  |  |  105|    676|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 676]
  |  |  ------------------
  |  |  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|    676|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 676]
  |  |  ------------------
  ------------------
  449|       |
  450|    676|  const int cell_shape = 8;
  451|    676|  const int cell_size = 64;
  452|    676|  uint8_t *ip = (uint8_t *) input;
  453|    676|  uint8_t *op = (uint8_t *) output;
  454|    676|  uint8_t ndim;
  455|    676|  int32_t blockshape[2];
  456|    676|  int32_t eshape[2];
  457|    676|  uint8_t *buffercpy;
  458|    676|  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|    676|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < (int32_t) (1 + 2 * sizeof(int32_t)))) {
  ------------------
  |  |   30|    676|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 3, False: 673]
  |  |  ------------------
  ------------------
  465|      3|    return 0;
  466|      3|  }
  467|    673|  uint8_t *ip_limit = ip + input_len;
  468|       |
  469|       |  /* we start with literal copy */
  470|    673|  ndim = *ip;
  471|    673|  ip++;
  472|    673|  if (ndim != 2) {
  ------------------
  |  Branch (472:7): [True: 4, False: 669]
  ------------------
  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|    669|  memcpy(&blockshape[0], ip, 4);
  477|    669|  ip += 4;
  478|    669|  memcpy(&blockshape[1], ip, 4);
  479|    669|  ip += 4;
  480|       |
  481|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3203
  482|    669|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (482:7): [True: 0, False: 669]
  |  Branch (482:25): [True: 19, False: 650]
  |  Branch (482:46): [True: 22, False: 628]
  ------------------
  483|     41|    BLOSC_TRACE_ERROR("Output length or blockshape is negative");
  ------------------
  |  |   93|     41|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     41|    do {                                            \
  |  |  |  |   98|     41|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     41|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 41, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     41|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  484|     41|    return BLOSC2_ERROR_FAILURE;
  485|     41|  }
  486|       |
  487|    628|  eshape[0] = ((blockshape[0] + 7) / cell_shape) * cell_shape;
  488|    628|  eshape[1] = ((blockshape[1] + 7) / cell_shape) * cell_shape;
  489|       |
  490|    628|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|    628|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 39, False: 589]
  |  |  ------------------
  ------------------
  491|     39|    BLOSC_TRACE_ERROR("The blockshape is bigger than the output buffer");
  ------------------
  |  |   93|     39|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     39|    do {                                            \
  |  |  |  |   98|     39|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     39|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 39, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     39|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  492|     39|    return 0;
  493|     39|  }
  494|    589|  memset(op, 0, blockshape[0] * blockshape[1]);
  495|       |
  496|    589|  int32_t i_stop[2];
  497|  1.76k|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (497:19): [True: 1.17k, False: 589]
  ------------------
  498|  1.17k|    i_stop[i] = eshape[i] / cell_shape;
  499|  1.17k|  }
  500|       |
  501|       |  /* main loop */
  502|    589|  int32_t ii[2];
  503|    589|  int32_t padding[2] = {0};
  504|    589|  int32_t ind = 0;
  505|    589|  uint8_t *local_buffer = malloc(cell_size);
  506|    589|  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|    589|#define NDLZ8_CHECK_RANGE(pos, len)                                              \
  518|    589|  do {                                                                           \
  519|    589|    int64_t _pos = (int64_t) (pos);                                              \
  520|    589|    int64_t _len = (int64_t) (len);                                              \
  521|    589|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  522|    589|      free(local_buffer);                                                        \
  523|    589|      free(cell_aux);                                                            \
  524|    589|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  525|    589|      return BLOSC2_ERROR_FAILURE;                                               \
  526|    589|    }                                                                            \
  527|    589|  } while (0)
  528|       |
  529|  3.85G|  for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
  ------------------
  |  Branch (529:19): [True: 3.85G, False: 395]
  ------------------
  530|  3.85G|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (530:21): [True: 850, False: 3.85G]
  ------------------
  531|    850|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|    850|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 850]
  |  |  ------------------
  ------------------
  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|    850|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (537:11): [True: 584, False: 266]
  ------------------
  538|    584|        padding[0] = (blockshape[0] % cell_shape == 0) ? cell_shape : blockshape[0] % cell_shape;
  ------------------
  |  Branch (538:22): [True: 6, False: 578]
  ------------------
  539|    584|      } else {
  540|    266|        padding[0] = cell_shape;
  541|    266|      }
  542|    850|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (542:11): [True: 656, False: 194]
  ------------------
  543|    656|        padding[1] = (blockshape[1] % cell_shape == 0) ? cell_shape : blockshape[1] % cell_shape;
  ------------------
  |  Branch (543:22): [True: 7, False: 649]
  ------------------
  544|    656|      } else {
  545|    194|        padding[1] = cell_shape;
  546|    194|      }
  547|    850|      int64_t cur = ip - (const uint8_t *) input;   // in-range: ip is within [input, ip_limit]
  548|    850|      NDLZ8_CHECK_RANGE(cur, 1);
  ------------------
  |  |  518|    850|  do {                                                                           \
  |  |  519|    850|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    850|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    850|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 850]
  |  |  |  Branch (521:21): [True: 0, False: 850]
  |  |  |  Branch (521:33): [True: 10, False: 840]
  |  |  ------------------
  |  |  522|     10|      free(local_buffer);                                                        \
  |  |  523|     10|      free(cell_aux);                                                            \
  |  |  524|     10|      BLOSC_TRACE_ERROR("ndlz8: 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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     10|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     10|    }                                                                            \
  |  |  527|    850|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 840]
  |  |  ------------------
  ------------------
  549|    840|      token = *ip++;
  550|    840|      uint8_t match_type = (token >> 3U);
  551|    840|      if (token == 0) {    // no match
  ------------------
  |  Branch (551:11): [True: 287, False: 553]
  ------------------
  552|    287|        NDLZ8_CHECK_RANGE(cur + 1, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  518|    287|  do {                                                                           \
  |  |  519|    287|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    287|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    287|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 287]
  |  |  |  Branch (521:21): [True: 0, False: 287]
  |  |  |  Branch (521:33): [True: 18, False: 269]
  |  |  ------------------
  |  |  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|    287|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 269]
  |  |  ------------------
  ------------------
  553|    269|        buffercpy = ip;
  554|    269|        ip += padding[0] * padding[1];
  555|    553|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (555:18): [True: 116, False: 437]
  ------------------
  556|    116|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|    116|  do {                                                                           \
  |  |  519|    116|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    116|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    116|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 116]
  |  |  |  Branch (521:21): [True: 0, False: 116]
  |  |  |  Branch (521:33): [True: 1, False: 115]
  |  |  ------------------
  |  |  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|    116|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 115]
  |  |  ------------------
  ------------------
  557|    115|        uint16_t offset;
  558|    115|        memcpy(&offset, ip, sizeof(offset));
  559|    115|        int64_t bpos = (cur + 1) - (int64_t) offset - 1;
  560|    115|        NDLZ8_CHECK_RANGE(bpos, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  518|    115|  do {                                                                           \
  |  |  519|    115|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    115|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    115|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 21, False: 94]
  |  |  |  Branch (521:21): [True: 0, False: 94]
  |  |  |  Branch (521:33): [True: 6, False: 88]
  |  |  ------------------
  |  |  522|     27|      free(local_buffer);                                                        \
  |  |  523|     27|      free(cell_aux);                                                            \
  |  |  524|     27|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     27|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     27|    do {                                            \
  |  |  |  |  |  |   98|     27|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     27|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 27, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     27|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     27|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     27|    }                                                                            \
  |  |  527|    115|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 88]
  |  |  ------------------
  ------------------
  561|     88|        buffercpy = (uint8_t *) input + bpos;
  562|     88|        ip += 2;
  563|    437|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (563:18): [True: 251, False: 186]
  ------------------
  564|    251|        NDLZ8_CHECK_RANGE(cur + 1, 1);
  ------------------
  |  |  518|    251|  do {                                                                           \
  |  |  519|    251|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    251|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    251|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 251]
  |  |  |  Branch (521:21): [True: 0, False: 251]
  |  |  |  Branch (521:33): [True: 1, False: 250]
  |  |  ------------------
  |  |  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|    251|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 250]
  |  |  ------------------
  ------------------
  565|    250|        buffercpy = cell_aux;
  566|    250|        memset(buffercpy, *ip, cell_size);
  567|    250|        ip++;
  568|    250|      } else if (match_type == 21) {    // triple match
  ------------------
  |  Branch (568:18): [True: 79, False: 107]
  ------------------
  569|     79|        buffercpy = local_buffer;
  570|     79|        int row = (int) (token & 7);
  571|     79|        if (row + 2 >= cell_shape) {
  ------------------
  |  Branch (571:13): [True: 1, False: 78]
  ------------------
  572|      1|          free(local_buffer);
  573|      1|          free(cell_aux);
  574|      1|          BLOSC_TRACE_ERROR("Triple match row out of bounds");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  575|      1|          return BLOSC2_ERROR_FAILURE;
  576|      1|        }
  577|     78|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     78|  do {                                                                           \
  |  |  519|     78|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     78|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     78|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 78]
  |  |  |  Branch (521:21): [True: 0, False: 78]
  |  |  |  Branch (521:33): [True: 1, False: 77]
  |  |  ------------------
  |  |  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|     78|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 77]
  |  |  ------------------
  ------------------
  578|     77|        uint16_t offset;
  579|     77|        memcpy(&offset, ip, sizeof(offset));
  580|     77|        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|     77|        int64_t bpos = cur - (int64_t) offset;
  584|     77|        NDLZ8_CHECK_RANGE(bpos, 3 * cell_shape);
  ------------------
  |  |  518|     77|  do {                                                                           \
  |  |  519|     77|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     77|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     77|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 20, False: 57]
  |  |  |  Branch (521:21): [True: 0, False: 57]
  |  |  |  Branch (521:33): [True: 6, False: 51]
  |  |  ------------------
  |  |  522|     26|      free(local_buffer);                                                        \
  |  |  523|     26|      free(cell_aux);                                                            \
  |  |  524|     26|      BLOSC_TRACE_ERROR("ndlz8: 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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     26|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     26|    }                                                                            \
  |  |  527|     77|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 51]
  |  |  ------------------
  ------------------
  585|     51|        const uint8_t *ref = (const uint8_t *) input + bpos;
  586|    204|        for (int l = 0; l < 3; l++) {
  ------------------
  |  Branch (586:25): [True: 153, False: 51]
  ------------------
  587|    153|          memcpy(&buffercpy[(row + l) * cell_shape], ref + l * cell_shape, cell_shape);
  588|    153|        }
  589|    378|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (589:25): [True: 349, False: 29]
  ------------------
  590|    349|          if ((l < row) || (l > row + 2)) {
  ------------------
  |  Branch (590:15): [True: 116, False: 233]
  |  Branch (590:28): [True: 104, False: 129]
  ------------------
  591|    220|            NDLZ8_CHECK_RANGE(ip - (const uint8_t *) input, cell_shape);
  ------------------
  |  |  518|    220|  do {                                                                           \
  |  |  519|    220|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    220|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    220|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 220]
  |  |  |  Branch (521:21): [True: 0, False: 220]
  |  |  |  Branch (521:33): [True: 22, False: 198]
  |  |  ------------------
  |  |  522|     22|      free(local_buffer);                                                        \
  |  |  523|     22|      free(cell_aux);                                                            \
  |  |  524|     22|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     22|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     22|    }                                                                            \
  |  |  527|    220|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 198]
  |  |  ------------------
  ------------------
  592|    198|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  593|    198|            ip += cell_shape;
  594|    198|          }
  595|    349|        }
  596|    107|      } else if (match_type == 17) {    // pair match
  ------------------
  |  Branch (596:18): [True: 81, False: 26]
  ------------------
  597|     81|        buffercpy = local_buffer;
  598|     81|        int row = (int) (token & 7);
  599|     81|        if (row + 1 >= cell_shape) {
  ------------------
  |  Branch (599:13): [True: 1, False: 80]
  ------------------
  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|     80|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     80|  do {                                                                           \
  |  |  519|     80|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     80|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     80|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 80]
  |  |  |  Branch (521:21): [True: 0, False: 80]
  |  |  |  Branch (521:33): [True: 1, False: 79]
  |  |  ------------------
  |  |  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|     80|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 79]
  |  |  ------------------
  ------------------
  606|     79|        uint16_t offset;
  607|     79|        memcpy(&offset, ip, sizeof(offset));
  608|     79|        ip += 2;
  609|       |        // back-reference base == cur - offset (see triple-match note above).
  610|     79|        int64_t bpos = cur - (int64_t) offset;
  611|     79|        NDLZ8_CHECK_RANGE(bpos, 2 * cell_shape);
  ------------------
  |  |  518|     79|  do {                                                                           \
  |  |  519|     79|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     79|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     79|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 27, False: 52]
  |  |  |  Branch (521:21): [True: 0, False: 52]
  |  |  |  Branch (521:33): [True: 2, False: 50]
  |  |  ------------------
  |  |  522|     29|      free(local_buffer);                                                        \
  |  |  523|     29|      free(cell_aux);                                                            \
  |  |  524|     29|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     29|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     29|    do {                                            \
  |  |  |  |  |  |   98|     29|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     29|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 29, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     29|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     29|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     29|    }                                                                            \
  |  |  527|     79|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 50]
  |  |  ------------------
  ------------------
  612|     50|        const uint8_t *ref = (const uint8_t *) input + bpos;
  613|    150|        for (int l = 0; l < 2; l++) {
  ------------------
  |  Branch (613:25): [True: 100, False: 50]
  ------------------
  614|    100|          memcpy(&buffercpy[(row + l) * cell_shape], ref + l * cell_shape, cell_shape);
  615|    100|        }
  616|    319|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (616:25): [True: 299, False: 20]
  ------------------
  617|    299|          if ((l < row) || (l > row + 1)) {
  ------------------
  |  Branch (617:15): [True: 109, False: 190]
  |  Branch (617:28): [True: 110, False: 80]
  ------------------
  618|    219|            NDLZ8_CHECK_RANGE(ip - (const uint8_t *) input, cell_shape);
  ------------------
  |  |  518|    219|  do {                                                                           \
  |  |  519|    219|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    219|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    219|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 219]
  |  |  |  Branch (521:21): [True: 0, False: 219]
  |  |  |  Branch (521:33): [True: 30, False: 189]
  |  |  ------------------
  |  |  522|     30|      free(local_buffer);                                                        \
  |  |  523|     30|      free(cell_aux);                                                            \
  |  |  524|     30|      BLOSC_TRACE_ERROR("ndlz8: 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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     30|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     30|    }                                                                            \
  |  |  527|    219|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 189]
  |  |  ------------------
  ------------------
  619|    189|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  620|    189|            ip += cell_shape;
  621|    189|          }
  622|    299|        }
  623|     50|      } else {
  624|     26|        free(local_buffer);
  625|     26|        free(cell_aux);
  626|     26|        BLOSC_TRACE_ERROR("Invalid token: %u at cell [%d, %d]\n", token, ii[0], ii[1]);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  627|     26|        return BLOSC2_ERROR_FAILURE;
  628|     26|      }
  629|       |
  630|    656|      int32_t orig = ii[0] * cell_shape * blockshape[1] + ii[1] * cell_shape;
  631|  5.90k|      for (int32_t i = 0; i < (int32_t) cell_shape; i++) {
  ------------------
  |  Branch (631:27): [True: 5.24k, False: 656]
  ------------------
  632|  5.24k|        if (i < padding[0]) {
  ------------------
  |  Branch (632:13): [True: 3.25k, False: 1.99k]
  ------------------
  633|  3.25k|          ind = orig + i * blockshape[1];
  634|  3.25k|          memcpy(&op[ind], buffercpy, padding[1]);
  635|       |          // Only advance over rows we actually consume.  For a literal cell
  636|       |          // (token == 0) buffercpy points into the input and only holds
  637|       |          // padding[0] * padding[1] bytes; advancing unconditionally for the
  638|       |          // trailing padding rows would form an out-of-bounds pointer (UB)
  639|       |          // for the block's last cell.  The skipped rows are never read.
  640|  3.25k|          buffercpy += padding[1];
  641|  3.25k|        }
  642|  5.24k|      }
  643|    656|      if (ind > output_len) {
  ------------------
  |  Branch (643:11): [True: 0, False: 656]
  ------------------
  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|    656|    }
  650|  3.85G|  }
  651|    395|  ind += padding[1];
  652|       |
  653|    395|  free(cell_aux);
  654|    395|  free(local_buffer);
  655|       |
  656|    395|  if (ind != (blockshape[0] * blockshape[1])) {
  ------------------
  |  Branch (656:7): [True: 0, False: 395]
  ------------------
  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|    395|  if (ind > output_len) {
  ------------------
  |  Branch (660:7): [True: 0, False: 395]
  ------------------
  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|    395|  return (int) ind;
  666|    395|#undef NDLZ8_CHECK_RANGE
  667|    395|}

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

simd_load:
   34|  4.87k|bytes16 simd_load(const void* ptr) { return _mm_loadu_si128((const __m128i*)ptr); }
simd_store:
   35|  4.87k|void simd_store(void* ptr, bytes16 x) { _mm_storeu_si128((__m128i*)ptr, x); }
simd_add:
   38|  4.87k|bytes16 simd_add(bytes16 a, bytes16 b) { return _mm_add_epi8(a, b); }
simd_duplane15:
   40|  4.87k|bytes16 simd_duplane15(bytes16 x) { return _mm_shuffle_epi8(x, _mm_set1_epi8(15)); }
simd_prefix_sum:
   43|  4.87k|{
   44|       |  // Sklansky-style sum from https://gist.github.com/rygorous/4212be0cd009584e4184e641ca210528
   45|  4.87k|  x = _mm_add_epi8(x, _mm_slli_epi64(x, 8));
   46|  4.87k|  x = _mm_add_epi8(x, _mm_slli_epi64(x, 16));
   47|  4.87k|  x = _mm_add_epi8(x, _mm_slli_epi64(x, 32));
   48|  4.87k|  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|  4.87k|  return x;
   50|  4.87k|}
simd_get_last:
   52|  1.76k|uint8_t simd_get_last(bytes16 x) { return (_mm_extract_epi16(x, 7) >> 8) & 0xFF; }
bytedelta_backward:
  515|  2.51k|                       blosc2_dparams *dparams, uint8_t id) {
  516|  2.51k|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|  2.51k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  517|       |
  518|  2.51k|  int typesize = meta;
  519|  2.51k|  if (typesize == 0) {
  ------------------
  |  Branch (519:7): [True: 8, False: 2.50k]
  ------------------
  520|      8|    if (dparams->schunk == NULL) {
  ------------------
  |  Branch (520:9): [True: 8, False: 0]
  ------------------
  521|      8|      BLOSC_TRACE_ERROR("When meta is 0, you need to be on a schunk!");
  ------------------
  |  |   93|      8|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      8|    do {                                            \
  |  |  |  |   98|      8|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      8|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      8|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  522|      8|      BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  111|      8|    do {                                            \
  |  |  112|      8|        int rc_ = (rc);                             \
  |  |  113|      8|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 8, False: 0]
  |  |  ------------------
  |  |  114|      8|            char *error_msg = print_error(rc_);     \
  |  |  115|      8|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|      8|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      8|    do {                                            \
  |  |  |  |  |  |   98|      8|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      8|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 8, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      8|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      8|            return rc_;                             \
  |  |  117|      8|        }                                           \
  |  |  118|      8|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  523|      8|    }
  524|      0|    blosc2_schunk* schunk = (blosc2_schunk*)(dparams->schunk);
  525|      0|    typesize = schunk->typesize;
  526|      0|  }
  527|       |
  528|  2.50k|  const int stream_len = length / typesize;
  529|   186k|  for (int ich = 0; ich < typesize; ++ich) {
  ------------------
  |  Branch (529:21): [True: 183k, False: 2.50k]
  ------------------
  530|   183k|    int ip = 0;
  531|   183k|    uint8_t _v2 = 0;
  532|       |    // SIMD fetch 16 bytes from each channel, prefix-sum un-delta
  533|   183k|#if defined(CPU_HAS_SIMD)
  534|   183k|    bytes16 v2 = {0};
  535|   186k|    for (; ip < stream_len - 15; ip += 16) {
  ------------------
  |  Branch (535:12): [True: 2.52k, False: 183k]
  ------------------
  536|  2.52k|      bytes16 v = simd_load(input);
  537|  2.52k|      input += 16;
  538|       |      // un-delta via prefix sum
  539|  2.52k|      v2 = simd_add(simd_prefix_sum(v), simd_duplane15(v2));
  540|  2.52k|      simd_store(output, v2);
  541|  2.52k|      output += 16;
  542|  2.52k|    }
  543|   183k|    if (stream_len > 15) {
  ------------------
  |  Branch (543:9): [True: 1.76k, False: 182k]
  ------------------
  544|  1.76k|      _v2 = simd_get_last(v2);
  545|  1.76k|    }
  546|   183k|#endif // #if defined(CPU_HAS_SIMD)
  547|       |    // scalar leftover
  548|   209k|    for (; ip < stream_len; ip++) {
  ------------------
  |  Branch (548:12): [True: 25.9k, False: 183k]
  ------------------
  549|  25.9k|      uint8_t v = *input + _v2;
  550|  25.9k|      input++;
  551|  25.9k|      *output = v;
  552|  25.9k|      output++;
  553|  25.9k|      _v2 = v;
  554|  25.9k|    }
  555|   183k|  }
  556|       |
  557|       |  // Mirror of the forward pass: restore the trailing bytes verbatim.
  558|  2.50k|  memcpy(output, input, (size_t)(length - stream_len * typesize));
  559|       |
  560|  2.50k|  return BLOSC2_ERROR_SUCCESS;
  561|  2.51k|}
bytedelta_backward_buggy:
  611|  1.32k|                             uint8_t meta, blosc2_dparams *dparams, uint8_t id) {
  612|  1.32k|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|  1.32k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  613|       |
  614|  1.32k|  int typesize = meta;
  615|  1.32k|  if (typesize == 0) {
  ------------------
  |  Branch (615:7): [True: 9, False: 1.31k]
  ------------------
  616|      9|    if (dparams->schunk == NULL) {
  ------------------
  |  Branch (616:9): [True: 9, False: 0]
  ------------------
  617|      9|      BLOSC_TRACE_ERROR("When meta is 0, you need to be on a schunk!");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  618|      9|      BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  111|      9|    do {                                            \
  |  |  112|      9|        int rc_ = (rc);                             \
  |  |  113|      9|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 9, False: 0]
  |  |  ------------------
  |  |  114|      9|            char *error_msg = print_error(rc_);     \
  |  |  115|      9|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      9|            return rc_;                             \
  |  |  117|      9|        }                                           \
  |  |  118|      9|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  619|      9|    }
  620|      0|    blosc2_schunk* schunk = (blosc2_schunk*)(dparams->schunk);
  621|      0|    typesize = schunk->typesize;
  622|      0|  }
  623|       |
  624|  1.31k|  const int stream_len = length / typesize;
  625|  83.5k|  for (int ich = 0; ich < typesize; ++ich) {
  ------------------
  |  Branch (625:21): [True: 82.2k, False: 1.31k]
  ------------------
  626|  82.2k|    int ip = 0;
  627|       |    // SIMD fetch 16 bytes from each channel, prefix-sum un-delta
  628|  82.2k|#if defined(CPU_HAS_SIMD)
  629|  82.2k|    bytes16 v2 = {0};
  630|  84.5k|    for (; ip < stream_len - 15; ip += 16) {
  ------------------
  |  Branch (630:12): [True: 2.35k, False: 82.2k]
  ------------------
  631|  2.35k|      bytes16 v = simd_load(input);
  632|  2.35k|      input += 16;
  633|       |      // un-delta via prefix sum
  634|  2.35k|      v2 = simd_add(simd_prefix_sum(v), simd_duplane15(v2));
  635|  2.35k|      simd_store(output, v2);
  636|  2.35k|      output += 16;
  637|  2.35k|    }
  638|  82.2k|#endif // #if defined(CPU_HAS_SIMD)
  639|       |    // scalar leftover
  640|  82.2k|    uint8_t _v2 = 0;
  641|   111k|    for (; ip < stream_len; ip++) {
  ------------------
  |  Branch (641:12): [True: 29.0k, False: 82.2k]
  ------------------
  642|  29.0k|      uint8_t v = *input + _v2;
  643|  29.0k|      input++;
  644|  29.0k|      *output = v;
  645|  29.0k|      output++;
  646|  29.0k|      _v2 = v;
  647|  29.0k|    }
  648|  82.2k|  }
  649|       |
  650|  1.31k|  return BLOSC2_ERROR_SUCCESS;
  651|  1.32k|}

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

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

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

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

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

