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

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

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

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

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

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

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

chunkset_avx2.c:loadhalfchunk:
   91|    164|static inline void loadhalfchunk(uint8_t const *s, halfchunk_t *chunk) {
   92|    164|    *chunk = _mm_loadu_si128((__m128i *)s);
   93|    164|}
chunkset_avx2.c:GET_HALFCHUNK_MAG:
  105|  7.41k|static inline halfchunk_t GET_HALFCHUNK_MAG(uint8_t *buf, uint32_t *chunk_rem, uint32_t dist) {
  106|  7.41k|    lut_rem_pair lut_rem = perm_idx_lut[dist - 3];
  107|  7.41k|    __m128i perm_vec, ret_vec;
  108|  7.41k|    __msan_unpoison(buf + dist, 16 - dist);
  ------------------
  |  |  338|  7.41k|#  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  7.41k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |               #  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  7.41k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |  |  Branch (338:79): [Folded, False: 7.41k]
  |  |  ------------------
  ------------------
  109|  7.41k|    ret_vec = _mm_loadu_si128((__m128i*)buf);
  110|  7.41k|    *chunk_rem = half_rem_vals[dist - 3];
  111|       |
  112|  7.41k|    perm_vec = _mm_load_si128((__m128i*)(permute_table + lut_rem.idx));
  113|  7.41k|    ret_vec = _mm_shuffle_epi8(ret_vec, perm_vec);
  114|       |
  115|  7.41k|    return ret_vec;
  116|  7.41k|}
chunkset_avx2.c:storehalfchunk:
   95|    765|static inline void storehalfchunk(uint8_t *out, halfchunk_t *chunk) {
   96|    765|    _mm_storeu_si128((__m128i *)out, *chunk);
   97|    765|}
chunkset_avx2.c:halfchunk2whole:
   99|  7.41k|static inline chunk_t halfchunk2whole(halfchunk_t *chunk) {
  100|       |    /* We zero extend mostly to appease some memory sanitizers. These bytes are ultimately
  101|       |     * unlikely to be actually written or read from */
  102|  7.41k|    return _mm256_zextsi128_si256(*chunk);
  103|  7.41k|}
chunkset_avx2.c:chunkmemset_2:
   22|  8.41k|static inline void chunkmemset_2(uint8_t *from, chunk_t *chunk) {
   23|  8.41k|    *chunk = _mm256_set1_epi16(zng_memread_2(from));
   24|  8.41k|}
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|  2.67k|static inline void chunkmemset_8(uint8_t *from, chunk_t *chunk) {
   31|  2.67k|    *chunk = _mm256_set1_epi64x(zng_memread_8(from));
   32|  2.67k|}
chunkset_avx2.c:chunkmemset_16:
   34|  1.56k|static inline void chunkmemset_16(uint8_t *from, chunk_t *chunk) {
   35|       |    /* See explanation in chunkset_avx512.c */
   36|       |#if defined(_MSC_VER) && _MSC_VER <= 1900
   37|       |    halfchunk_t half = _mm_loadu_si128((__m128i*)from);
   38|       |    *chunk = _mm256_inserti128_si256(_mm256_castsi128_si256(half), half, 1);
   39|       |#else
   40|  1.56k|    *chunk = _mm256_broadcastsi128_si256(_mm_loadu_si128((__m128i*)from));
   41|  1.56k|#endif
   42|  1.56k|}
chunkset_avx2.c:GET_CHUNK_MAG:
   52|  1.74k|static inline chunk_t GET_CHUNK_MAG(uint8_t *buf, uint32_t *chunk_rem, uint32_t dist) {
   53|  1.74k|    lut_rem_pair lut_rem = perm_idx_lut[dist - 3];
   54|  1.74k|    __m256i ret_vec;
   55|       |    /* While technically we only need to read 4 or 8 bytes into this vector register for a lot of cases, GCC is
   56|       |     * compiling this to a shared load for all branches, preferring the simpler code.  Given that the buf value isn't in
   57|       |     * GPRs to begin with the 256 bit load is _probably_ just as inexpensive */
   58|  1.74k|    *chunk_rem = lut_rem.remval;
   59|       |
   60|       |    /* See note in chunkset_ssse3.c for why this is ok */
   61|  1.74k|    __msan_unpoison(buf + dist, 32 - dist);
  ------------------
  |  |  338|  1.74k|#  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  1.74k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |               #  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  1.74k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |  |  Branch (338:79): [Folded, False: 1.74k]
  |  |  ------------------
  ------------------
   62|       |
   63|  1.74k|    if (dist < 16) {
  ------------------
  |  Branch (63:9): [True: 1.22k, False: 517]
  ------------------
   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.22k|        const __m256i permute_xform =
   68|  1.22k|            _mm256_setr_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   69|  1.22k|                             16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16);
   70|  1.22k|        __m256i perm_vec = _mm256_load_si256((__m256i*)(permute_table+lut_rem.idx));
   71|  1.22k|        __m128i ret_vec0 = _mm_loadu_si128((__m128i*)buf);
   72|  1.22k|        perm_vec = _mm256_add_epi8(perm_vec, permute_xform);
   73|  1.22k|        ret_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ret_vec0), ret_vec0, 1);
   74|  1.22k|        ret_vec = _mm256_shuffle_epi8(ret_vec, perm_vec);
   75|  1.22k|    }  else {
   76|    517|        __m128i ret_vec0 = _mm_loadu_si128((__m128i*)buf);
   77|    517|        __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|    517|        __m128i perm_vec1 = _mm_load_si128((__m128i*)(permute_table + lut_rem.idx));
   80|    517|        __m128i xlane_permutes = _mm_cmpgt_epi8(_mm_set1_epi8(16), perm_vec1);
   81|    517|        __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|    517|        __m128i latter_half = _mm_blendv_epi8(ret_vec1, xlane_res, xlane_permutes);
   85|    517|        ret_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ret_vec0), latter_half, 1);
   86|    517|    }
   87|       |
   88|  1.74k|    return ret_vec;
   89|  1.74k|}
chunkset_avx2.c:storechunk:
   48|  91.7k|static inline void storechunk(uint8_t *out, chunk_t *chunk) {
   49|  91.7k|    _mm256_storeu_si256((__m256i *)out, *chunk);
   50|  91.7k|}
chunkset_avx2.c:loadchunk:
   44|  78.2k|static inline void loadchunk(uint8_t const *s, chunk_t *chunk) {
   45|  78.2k|    *chunk = _mm256_loadu_si256((__m256i *)s);
   46|  78.2k|}

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

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

inflate_fast_avx2:
   53|  19.5k|void Z_INTERNAL INFLATE_FAST(PREFIX3(stream) *strm, uint32_t start) {
   54|       |    /* start: inflate()'s starting value for strm->avail_out */
   55|  19.5k|    struct inflate_state *state;
   56|  19.5k|    z_const unsigned char *in;  /* local strm->next_in */
  ------------------
  |  |   23|  19.5k|#define z_const const
  ------------------
   57|  19.5k|    const unsigned char *last;  /* have enough input while in < last */
   58|  19.5k|    unsigned char *out;         /* local strm->next_out */
   59|  19.5k|    unsigned char *beg;         /* inflate()'s initial strm->next_out */
   60|  19.5k|    unsigned char *end;         /* while out < end, enough space available */
   61|  19.5k|    unsigned char *safe;        /* can use chunkcopy provided out < safe */
   62|  19.5k|    unsigned char *window;      /* allocated sliding window, if wsize != 0 */
   63|  19.5k|    unsigned wsize;             /* window size or zero if not using window */
   64|  19.5k|    unsigned whave;             /* valid bytes in the window */
   65|  19.5k|    unsigned wnext;             /* window write index */
   66|       |
   67|       |    /* hold is a local copy of strm->hold. By default, hold satisfies the same
   68|       |       invariants that strm->hold does, namely that (hold >> bits) == 0. This
   69|       |       invariant is kept by loading bits into hold one byte at a time, like:
   70|       |
   71|       |       hold |= next_byte_of_input << bits; in++; bits += 8;
   72|       |
   73|       |       If we need to ensure that bits >= 15 then this code snippet is simply
   74|       |       repeated. Over one iteration of the outermost do/while loop, this
   75|       |       happens up to six times (48 bits of input), as described in the NOTES
   76|       |       above.
   77|       |
   78|       |       However, on some little endian architectures, it can be significantly
   79|       |       faster to load 64 bits once instead of 8 bits six times:
   80|       |
   81|       |       if (bits <= 16) {
   82|       |         hold |= next_8_bytes_of_input << bits; in += 6; bits += 48;
   83|       |       }
   84|       |
   85|       |       Unlike the simpler one byte load, shifting the next_8_bytes_of_input
   86|       |       by bits will overflow and lose those high bits, up to 2 bytes' worth.
   87|       |       The conservative estimate is therefore that we have read only 6 bytes
   88|       |       (48 bits). Again, as per the NOTES above, 48 bits is sufficient for the
   89|       |       rest of the iteration, and we will not need to load another 8 bytes.
   90|       |
   91|       |       Inside this function, we no longer satisfy (hold >> bits) == 0, but
   92|       |       this is not problematic, even if that overflow does not land on an 8 bit
   93|       |       byte boundary. Those excess bits will eventually shift down lower as the
   94|       |       Huffman decoder consumes input, and when new input bits need to be loaded
   95|       |       into the bits variable, the same input bits will be or'ed over those
   96|       |       existing bits. A bitwise or is idempotent: (a | b | b) equals (a | b).
   97|       |       Note that we therefore write that load operation as "hold |= etc" and not
   98|       |       "hold += etc".
   99|       |
  100|       |       Outside that loop, at the end of the function, hold is bitwise and'ed
  101|       |       with (1<<bits)-1 to drop those excess bits so that, on function exit, we
  102|       |       keep the invariant that (state->hold >> state->bits) == 0.
  103|       |    */
  104|  19.5k|    unsigned bits;              /* local strm->bits */
  105|  19.5k|    uint64_t hold;              /* local strm->hold */
  106|  19.5k|    unsigned lmask;             /* mask for first level of length codes */
  107|  19.5k|    unsigned dmask;             /* mask for first level of distance codes */
  108|  19.5k|    code const *lcode;          /* local strm->lencode */
  109|  19.5k|    code const *dcode;          /* local strm->distcode */
  110|  19.5k|    const code *here;           /* retrieved table entry */
  111|  19.5k|    unsigned op;                /* code bits, operation, extra bits, or */
  112|       |                                /*  window position, window bytes to copy */
  113|  19.5k|    unsigned len;               /* match length, unused bytes */
  114|  19.5k|    unsigned char *from;        /* where to copy match from */
  115|  19.5k|    unsigned dist;              /* match distance */
  116|  19.5k|    unsigned extra_safe;        /* copy chunks safely in all cases */
  117|       |
  118|       |    /* copy state to local variables */
  119|  19.5k|    state = (struct inflate_state *)strm->state;
  120|  19.5k|    in = strm->next_in;
  121|  19.5k|    last = in + (strm->avail_in - (INFLATE_FAST_MIN_HAVE - 1));
  ------------------
  |  |  137|  19.5k|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
  122|  19.5k|    out = strm->next_out;
  123|  19.5k|    beg = out - (start - strm->avail_out);
  124|  19.5k|    end = out + (strm->avail_out - (INFLATE_FAST_MIN_LEFT - 1));
  ------------------
  |  |  138|  19.5k|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  125|  19.5k|    safe = out + strm->avail_out;
  126|  19.5k|    wsize = state->wsize;
  127|  19.5k|    whave = state->whave;
  128|  19.5k|    wnext = state->wnext;
  129|  19.5k|    window = state->window;
  130|  19.5k|    hold = state->hold;
  131|  19.5k|    bits = state->bits;
  132|  19.5k|    lcode = state->lencode;
  133|  19.5k|    dcode = state->distcode;
  134|  19.5k|    lmask = (1U << state->lenbits) - 1;
  135|  19.5k|    dmask = (1U << state->distbits) - 1;
  136|       |
  137|       |    /* Detect if out and window point to the same memory allocation. In this instance it is
  138|       |       necessary to use safe chunk copy functions to prevent overwriting the window. If the
  139|       |       window is overwritten then future matches with far distances will fail to copy correctly. */
  140|  19.5k|    extra_safe = (wsize != 0 && out >= window && out + INFLATE_FAST_MIN_LEFT <= window + state->wbufsize);
  ------------------
  |  |  138|      0|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  |  Branch (140:19): [True: 0, False: 19.5k]
  |  Branch (140:33): [True: 0, False: 0]
  |  Branch (140:50): [True: 0, False: 0]
  ------------------
  141|       |
  142|  19.5k|#define REFILL() do { \
  143|  19.5k|        hold |= load_64_bits(in, bits); \
  144|  19.5k|        in += 7; \
  145|  19.5k|        in -= ((bits >> 3) & 7); \
  146|  19.5k|        bits |= 56; \
  147|  19.5k|    } while (0)
  148|       |
  149|       |    /* decode literals and length/distances until end-of-block or not enough
  150|       |       input data or output space */
  151|  2.80M|    do {
  152|  2.80M|        REFILL();
  ------------------
  |  |  142|  2.80M|#define REFILL() do { \
  |  |  143|  2.80M|        hold |= load_64_bits(in, bits); \
  |  |  144|  2.80M|        in += 7; \
  |  |  145|  2.80M|        in -= ((bits >> 3) & 7); \
  |  |  146|  2.80M|        bits |= 56; \
  |  |  147|  2.80M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (147:14): [Folded, False: 2.80M]
  |  |  ------------------
  ------------------
  153|  2.80M|        here = lcode + (hold & lmask);
  154|  2.80M|        if (here->op == 0) {
  ------------------
  |  Branch (154:13): [True: 2.65M, False: 146k]
  ------------------
  155|  2.65M|            *out++ = (unsigned char)(here->val);
  156|  2.65M|            DROPBITS(here->bits);
  ------------------
  |  |  118|  2.65M|    do { \
  |  |  119|  2.65M|        hold >>= (n); \
  |  |  120|  2.65M|        bits -= (unsigned)(n); \
  |  |  121|  2.65M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 2.65M]
  |  |  ------------------
  ------------------
  157|  2.65M|            here = lcode + (hold & lmask);
  158|  2.65M|            if (here->op == 0) {
  ------------------
  |  Branch (158:17): [True: 2.58M, False: 71.8k]
  ------------------
  159|  2.58M|                *out++ = (unsigned char)(here->val);
  160|  2.58M|                DROPBITS(here->bits);
  ------------------
  |  |  118|  2.58M|    do { \
  |  |  119|  2.58M|        hold >>= (n); \
  |  |  120|  2.58M|        bits -= (unsigned)(n); \
  |  |  121|  2.58M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 2.58M]
  |  |  ------------------
  ------------------
  161|  2.58M|                here = lcode + (hold & lmask);
  162|  2.58M|            }
  163|  2.65M|        }
  164|  2.97M|      dolen:
  165|  2.97M|        DROPBITS(here->bits);
  ------------------
  |  |  118|  2.97M|    do { \
  |  |  119|  2.97M|        hold >>= (n); \
  |  |  120|  2.97M|        bits -= (unsigned)(n); \
  |  |  121|  2.97M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 2.97M]
  |  |  ------------------
  ------------------
  166|  2.97M|        op = here->op;
  167|  2.97M|        if (op == 0) {                          /* literal */
  ------------------
  |  Branch (167:13): [True: 2.66M, False: 302k]
  ------------------
  168|  2.66M|            Tracevv((stderr, here->val >= 0x20 && here->val < 0x7f ?
  169|  2.66M|                    "inflate:         literal '%c'\n" :
  170|  2.66M|                    "inflate:         literal 0x%02x\n", here->val));
  171|  2.66M|            *out++ = (unsigned char)(here->val);
  172|  2.66M|        } else if (op & 16) {                     /* length base */
  ------------------
  |  Branch (172:20): [True: 114k, False: 188k]
  ------------------
  173|   114k|            len = here->val;
  174|   114k|            op &= MAX_BITS;                       /* number of extra bits */
  ------------------
  |  |   39|   114k|#define MAX_BITS 15
  ------------------
  175|   114k|            len += BITS(op);
  ------------------
  |  |  114|   114k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  176|   114k|            DROPBITS(op);
  ------------------
  |  |  118|   114k|    do { \
  |  |  119|   114k|        hold >>= (n); \
  |  |  120|   114k|        bits -= (unsigned)(n); \
  |  |  121|   114k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 114k]
  |  |  ------------------
  ------------------
  177|   114k|            Tracevv((stderr, "inflate:         length %u\n", len));
  178|   114k|            here = dcode + (hold & dmask);
  179|   114k|            if (bits < MAX_BITS + MAX_DIST_EXTRA_BITS) {
  ------------------
  |  |   39|   114k|#define MAX_BITS 15
  ------------------
                          if (bits < MAX_BITS + MAX_DIST_EXTRA_BITS) {
  ------------------
  |  |   41|   114k|#define MAX_DIST_EXTRA_BITS 13
  ------------------
  |  Branch (179:17): [True: 1.11k, False: 113k]
  ------------------
  180|  1.11k|                REFILL();
  ------------------
  |  |  142|  1.11k|#define REFILL() do { \
  |  |  143|  1.11k|        hold |= load_64_bits(in, bits); \
  |  |  144|  1.11k|        in += 7; \
  |  |  145|  1.11k|        in -= ((bits >> 3) & 7); \
  |  |  146|  1.11k|        bits |= 56; \
  |  |  147|  1.11k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (147:14): [Folded, False: 1.11k]
  |  |  ------------------
  ------------------
  181|  1.11k|            }
  182|   119k|          dodist:
  183|   119k|            DROPBITS(here->bits);
  ------------------
  |  |  118|   119k|    do { \
  |  |  119|   119k|        hold >>= (n); \
  |  |  120|   119k|        bits -= (unsigned)(n); \
  |  |  121|   119k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 119k]
  |  |  ------------------
  ------------------
  184|   119k|            op = here->op;
  185|   119k|            if (op & 16) {                      /* distance base */
  ------------------
  |  Branch (185:17): [True: 114k, False: 5.30k]
  ------------------
  186|   114k|                dist = here->val;
  187|   114k|                op &= MAX_BITS;                 /* number of extra bits */
  ------------------
  |  |   39|   114k|#define MAX_BITS 15
  ------------------
  188|   114k|                dist += BITS(op);
  ------------------
  |  |  114|   114k|    (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|   114k|                DROPBITS(op);
  ------------------
  |  |  118|   114k|    do { \
  |  |  119|   114k|        hold >>= (n); \
  |  |  120|   114k|        bits -= (unsigned)(n); \
  |  |  121|   114k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 114k]
  |  |  ------------------
  ------------------
  196|   114k|                Tracevv((stderr, "inflate:         distance %u\n", dist));
  197|   114k|                op = (unsigned)(out - beg);     /* max distance in output */
  198|   114k|                if (dist > op) {                /* see if copy from window */
  ------------------
  |  Branch (198:21): [True: 19, False: 114k]
  ------------------
  199|     19|                    op = dist - op;             /* distance back in window */
  200|     19|                    if (op > whave) {
  ------------------
  |  Branch (200:25): [True: 19, 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|     19|                        SET_BAD("invalid distance too far back");
  ------------------
  |  |  132|     19|    do { \
  |  |  133|     19|        state->mode = BAD; \
  |  |  134|     19|        strm->msg = (char *)errmsg; \
  |  |  135|     19|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 19]
  |  |  ------------------
  ------------------
  225|     19|                        break;
  226|     19|#endif
  227|     19|                    }
  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|   114k|                } else if (extra_safe) {
  ------------------
  |  Branch (265:28): [True: 0, False: 114k]
  ------------------
  266|       |                    /* Whole reference is in range of current output. */
  267|      0|                        out = chunkcopy_safe(out, out - dist, len, safe);
  268|      0|#endif
  269|   114k|                } 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|   114k|                    if (dist >= len || dist >= CHUNKSIZE())
  ------------------
  |  |  118|  45.9k|#define CHUNKSIZE        chunksize_avx2
  ------------------
  |  Branch (275:25): [True: 68.4k, False: 45.9k]
  |  Branch (275:40): [True: 632, False: 45.3k]
  ------------------
  276|  69.1k|                        out = CHUNKCOPY(out, out - dist, len);
  ------------------
  |  |  119|  69.1k|#define CHUNKCOPY        chunkcopy_avx2
  ------------------
  277|  45.3k|                    else
  278|  45.3k|                        out = CHUNKMEMSET(out, out - dist, len);
  ------------------
  |  |  121|  45.3k|#define CHUNKMEMSET      chunkmemset_avx2
  ------------------
  279|   114k|                }
  280|   114k|            } else if ((op & 64) == 0) {          /* 2nd level distance code */
  ------------------
  |  Branch (280:24): [True: 5.29k, False: 6]
  ------------------
  281|  5.29k|                here = dcode + here->val + BITS(op);
  ------------------
  |  |  114|  5.29k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  282|  5.29k|                goto dodist;
  283|  5.29k|            } 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|   188k|        } else if ((op & 64) == 0) {              /* 2nd level length code */
  ------------------
  |  Branch (287:20): [True: 169k, False: 19.1k]
  ------------------
  288|   169k|            here = lcode + here->val + BITS(op);
  ------------------
  |  |  114|   169k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  289|   169k|            goto dolen;
  290|   169k|        } else if (op & 32) {                     /* end-of-block */
  ------------------
  |  Branch (290:20): [True: 19.1k, False: 3]
  ------------------
  291|  19.1k|            Tracevv((stderr, "inflate:         end of block\n"));
  292|  19.1k|            state->mode = TYPE;
  293|  19.1k|            break;
  294|  19.1k|        } else {
  295|      3|            SET_BAD("invalid literal/length code");
  ------------------
  |  |  132|      3|    do { \
  |  |  133|      3|        state->mode = BAD; \
  |  |  134|      3|        strm->msg = (char *)errmsg; \
  |  |  135|      3|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 3]
  |  |  ------------------
  ------------------
  296|      3|            break;
  297|      3|        }
  298|  2.97M|    } while (in < last && out < end);
  ------------------
  |  Branch (298:14): [True: 2.78M, False: 189]
  |  Branch (298:27): [True: 2.78M, False: 181]
  ------------------
  299|       |
  300|       |    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
  301|  19.5k|    len = bits >> 3;
  302|  19.5k|    in -= len;
  303|  19.5k|    bits -= len << 3;
  304|  19.5k|    hold &= (UINT64_C(1) << bits) - 1;
  305|       |
  306|       |    /* update state and return */
  307|  19.5k|    strm->next_in = in;
  308|  19.5k|    strm->next_out = out;
  309|  19.5k|    strm->avail_in = (unsigned)(in < last ? (INFLATE_FAST_MIN_HAVE - 1) + (last - in)
  ------------------
  |  |  137|  19.5k|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
  |  Branch (309:33): [True: 19.5k, False: 40]
  ------------------
  310|  19.5k|                                          : (INFLATE_FAST_MIN_HAVE - 1) - (in - last));
  ------------------
  |  |  137|     40|#define INFLATE_FAST_MIN_HAVE 15
  ------------------
  311|  19.5k|    strm->avail_out = (unsigned)(out < end ? (INFLATE_FAST_MIN_LEFT - 1) + (end - out)
  ------------------
  |  |  138|  19.3k|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  |  Branch (311:34): [True: 19.3k, False: 235]
  ------------------
  312|  19.5k|                                           : (INFLATE_FAST_MIN_LEFT - 1) - (out - end));
  ------------------
  |  |  138|    235|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  313|       |
  314|  19.5k|    Assert(bits <= 32, "Remaining bits greater than 32");
  315|  19.5k|    state->hold = (uint32_t)hold;
  316|  19.5k|    state->bits = bits;
  317|  19.5k|    return;
  318|  19.5k|}

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

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

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

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

chunkset_avx2.c:zng_memread_2:
   12|  8.41k|static inline uint16_t zng_memread_2(const void *ptr) {
   13|  8.41k|#if defined(HAVE_MAY_ALIAS)
   14|  8.41k|    typedef struct { uint16_t val; } __attribute__ ((__packed__, __may_alias__)) unaligned_uint16_t;
   15|  8.41k|    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|  8.41k|}
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.80M|static inline uint64_t zng_memread_8(const void *ptr) {
   35|  2.80M|#if defined(HAVE_MAY_ALIAS)
   36|  2.80M|    typedef struct { uint64_t val; } __attribute__ ((__packed__, __may_alias__)) unaligned_uint64_t;
   37|  2.80M|    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.80M|}

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

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

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

zstd_decompress_block.c:ZSTD_highbit32:
  175|   937k|{
  176|   937k|    assert(val != 0);
  ------------------
  |  |   70|   937k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|   937k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|   937k|}
zstd_decompress_block.c:ZSTD_countLeadingZeros32:
   70|   937k|{
   71|   937k|    assert(val != 0);
  ------------------
  |  |   70|   937k|#    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|   937k|}
entropy_common.c:ZSTD_countTrailingZeros32:
   29|  10.5k|{
   30|  10.5k|    assert(val != 0);
  ------------------
  |  |   70|  10.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   31|       |#if defined(_MSC_VER)
   32|       |#  if STATIC_BMI2
   33|       |    return (unsigned)_tzcnt_u32(val);
   34|       |#  else
   35|       |    if (val != 0) {
   36|       |        unsigned long r;
   37|       |        _BitScanForward(&r, val);
   38|       |        return (unsigned)r;
   39|       |    } else {
   40|       |        __assume(0); /* Should not reach this code path */
   41|       |    }
   42|       |#  endif
   43|       |#elif defined(__GNUC__) && (__GNUC__ >= 4)
   44|       |    return (unsigned)__builtin_ctz(val);
   45|       |#elif defined(__ICCARM__)
   46|       |    return (unsigned)__builtin_ctz(val);
   47|       |#else
   48|       |    return ZSTD_countTrailingZeros32_fallback(val);
   49|       |#endif
   50|  10.5k|}
entropy_common.c:ZSTD_highbit32:
  175|  52.4k|{
  176|  52.4k|    assert(val != 0);
  ------------------
  |  |   70|  52.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  52.4k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  52.4k|}
entropy_common.c:ZSTD_countLeadingZeros32:
   70|  52.4k|{
   71|  52.4k|    assert(val != 0);
  ------------------
  |  |   70|  52.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   72|       |#if defined(_MSC_VER)
   73|       |#  if STATIC_BMI2
   74|       |    return (unsigned)_lzcnt_u32(val);
   75|       |#  else
   76|       |    if (val != 0) {
   77|       |        unsigned long r;
   78|       |        _BitScanReverse(&r, val);
   79|       |        return (unsigned)(31 - r);
   80|       |    } else {
   81|       |        __assume(0); /* Should not reach this code path */
   82|       |    }
   83|       |#  endif
   84|       |#elif defined(__GNUC__) && (__GNUC__ >= 4)
   85|       |    return (unsigned)__builtin_clz(val);
   86|       |#elif defined(__ICCARM__)
   87|       |    return (unsigned)__builtin_clz(val);
   88|       |#else
   89|       |    return ZSTD_countLeadingZeros32_fallback(val);
   90|       |#endif
   91|  52.4k|}
fse_decompress.c:ZSTD_highbit32:
  175|   204k|{
  176|   204k|    assert(val != 0);
  ------------------
  |  |   70|   204k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|   204k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|   204k|}
fse_decompress.c:ZSTD_countLeadingZeros32:
   70|   204k|{
   71|   204k|    assert(val != 0);
  ------------------
  |  |   70|   204k|#    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|   204k|}
huf_decompress.c:ZSTD_highbit32:
  175|  8.14k|{
  176|  8.14k|    assert(val != 0);
  ------------------
  |  |   70|  8.14k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  8.14k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  8.14k|}
huf_decompress.c:ZSTD_countLeadingZeros32:
   70|  8.14k|{
   71|  8.14k|    assert(val != 0);
  ------------------
  |  |   70|  8.14k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   72|       |#if defined(_MSC_VER)
   73|       |#  if STATIC_BMI2
   74|       |    return (unsigned)_lzcnt_u32(val);
   75|       |#  else
   76|       |    if (val != 0) {
   77|       |        unsigned long r;
   78|       |        _BitScanReverse(&r, val);
   79|       |        return (unsigned)(31 - r);
   80|       |    } else {
   81|       |        __assume(0); /* Should not reach this code path */
   82|       |    }
   83|       |#  endif
   84|       |#elif defined(__GNUC__) && (__GNUC__ >= 4)
   85|       |    return (unsigned)__builtin_clz(val);
   86|       |#elif defined(__ICCARM__)
   87|       |    return (unsigned)__builtin_clz(val);
   88|       |#else
   89|       |    return ZSTD_countLeadingZeros32_fallback(val);
   90|       |#endif
   91|  8.14k|}
huf_decompress.c:ZSTD_countTrailingZeros64:
   94|  9.66k|{
   95|  9.66k|    assert(val != 0);
  ------------------
  |  |   70|  9.66k|#    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|  9.66k|}

zstd_decompress_block.c:BIT_initDStream:
  255|  4.57k|{
  256|  4.57k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|     35|# 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|     35|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     35|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     35|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (256:9): [True: 35, False: 4.54k]
  ------------------
  257|       |
  258|  4.54k|    bitD->start = (const char*)srcBuffer;
  259|  4.54k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  4.54k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 1.79k, False: 2.75k]
  ------------------
  262|  1.79k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|  1.79k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|  1.79k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|  1.79k|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 1.64k, False: 153]
  ------------------
  266|  1.79k|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|    153|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|    153|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|    153|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:15): [True: 153, False: 1.64k]
  ------------------
  267|  2.75k|    } else {
  268|  2.75k|        bitD->ptr   = bitD->start;
  269|  2.75k|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|  2.75k|        switch(srcSize)
  271|  2.75k|        {
  272|    130|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 130, False: 2.62k]
  ------------------
  273|    130|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    130|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|    329|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 199, False: 2.55k]
  ------------------
  276|    329|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    329|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|    662|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 333, False: 2.41k]
  ------------------
  279|    662|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    662|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|  1.15k|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 496, False: 2.25k]
  ------------------
  282|  1.15k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.15k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|  1.44k|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 289, False: 2.46k]
  ------------------
  285|  1.44k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.44k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|  2.25k|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 812, False: 1.93k]
  ------------------
  288|  2.25k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  2.25k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|  2.75k|        default: break;
  ------------------
  |  Branch (290:9): [True: 491, False: 2.25k]
  ------------------
  291|  2.75k|        }
  292|  2.75k|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|  2.75k|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 2.73k, False: 13]
  ------------------
  294|  2.75k|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|     13|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     13|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     13|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 13, False: 2.73k]
  ------------------
  295|  2.75k|        }
  296|  2.73k|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|  2.73k|    }
  298|       |
  299|  4.37k|    return srcSize;
  300|  4.54k|}
zstd_decompress_block.c:BIT_readBits:
  363|  16.3M|{
  364|  16.3M|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|  16.3M|    BIT_skipBits(bitD, nbBits);
  366|  16.3M|    return value;
  367|  16.3M|}
zstd_decompress_block.c:BIT_lookBits:
  331|  16.3M|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|  16.3M|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|  16.3M|    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|  16.3M|}
zstd_decompress_block.c:BIT_getMiddleBits:
  308|  16.3M|{
  309|  16.3M|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|  16.3M|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|  16.3M|#    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|  16.3M|#if defined(__x86_64__) || defined(_M_X64)
  318|  16.3M|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|  16.3M|}
zstd_decompress_block.c:BIT_skipBits:
  354|  21.3M|{
  355|  21.3M|    bitD->bitsConsumed += nbBits;
  356|  21.3M|}
zstd_decompress_block.c:BIT_reloadDStream:
  413|  5.44M|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|  5.44M|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|  5.44M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 195k, False: 5.24M]
  |  |  ------------------
  ------------------
  416|   195k|        static const BitContainerType zeroFilled = 0;
  417|   195k|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|   195k|        return BIT_DStream_overflow;
  420|   195k|    }
  421|       |
  422|  5.24M|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  5.24M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|  5.24M|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 5.22M, False: 19.8k]
  ------------------
  425|  5.22M|        return BIT_reloadDStream_internal(bitD);
  426|  5.22M|    }
  427|  19.8k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 16.4k, False: 3.44k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  16.4k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 15.6k, False: 786]
  ------------------
  430|    786|        return BIT_DStream_completed;
  431|  16.4k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  3.44k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  3.44k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  3.44k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 165, False: 3.28k]
  ------------------
  436|    165|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    165|            result = BIT_DStream_endOfBuffer;
  438|    165|        }
  439|  3.44k|        bitD->ptr -= nbBytes;
  440|  3.44k|        bitD->bitsConsumed -= nbBytes*8;
  441|  3.44k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  3.44k|        return result;
  443|  19.8k|    }
  444|  19.8k|}
zstd_decompress_block.c:BIT_reloadDStream_internal:
  385|  5.22M|{
  386|  5.22M|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  5.22M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  5.22M|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  5.22M|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  5.22M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  5.22M|    bitD->bitsConsumed &= 7;
  390|  5.22M|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  5.22M|    return BIT_DStream_unfinished;
  392|  5.22M|}
zstd_decompress_block.c:BIT_readBitsFast:
  372|  5.04M|{
  373|  5.04M|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  5.04M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  5.04M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  5.04M|    BIT_skipBits(bitD, nbBits);
  376|  5.04M|    return value;
  377|  5.04M|}
zstd_decompress_block.c:BIT_lookBitsFast:
  347|  5.04M|{
  348|  5.04M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  5.04M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  5.04M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  5.04M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  5.04M|}
zstd_decompress_block.c:BIT_endOfDStream:
  450|  2.59k|{
  451|  2.59k|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 2.55k, False: 37]
  |  Branch (451:49): [True: 2.52k, False: 35]
  ------------------
  452|  2.59k|}
fse_decompress.c:BIT_initDStream:
  255|  4.96k|{
  256|  4.96k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|     33|# 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|     33|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     33|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     33|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (256:9): [True: 33, False: 4.93k]
  ------------------
  257|       |
  258|  4.93k|    bitD->start = (const char*)srcBuffer;
  259|  4.93k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  4.93k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 3.82k, False: 1.11k]
  ------------------
  262|  3.82k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|  3.82k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|  3.82k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|  3.82k|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 3.74k, False: 80]
  ------------------
  266|  3.82k|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|     80|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     80|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     80|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:15): [True: 80, False: 3.74k]
  ------------------
  267|  3.82k|    } else {
  268|  1.11k|        bitD->ptr   = bitD->start;
  269|  1.11k|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|  1.11k|        switch(srcSize)
  271|  1.11k|        {
  272|    259|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 259, False: 851]
  ------------------
  273|    259|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    259|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|    436|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 177, False: 933]
  ------------------
  276|    436|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    436|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|    569|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 133, False: 977]
  ------------------
  279|    569|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    569|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|    692|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 123, False: 987]
  ------------------
  282|    692|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    692|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|    864|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 172, False: 938]
  ------------------
  285|    864|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    864|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|  1.09k|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 226, False: 884]
  ------------------
  288|  1.09k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.09k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|  1.11k|        default: break;
  ------------------
  |  Branch (290:9): [True: 20, False: 1.09k]
  ------------------
  291|  1.11k|        }
  292|  1.11k|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|  1.11k|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 1.10k, False: 10]
  ------------------
  294|  1.11k|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 10, False: 1.10k]
  ------------------
  295|  1.11k|        }
  296|  1.10k|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|  1.10k|    }
  298|       |
  299|  4.84k|    return srcSize;
  300|  4.93k|}
fse_decompress.c:BIT_readBits:
  363|   358k|{
  364|   358k|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|   358k|    BIT_skipBits(bitD, nbBits);
  366|   358k|    return value;
  367|   358k|}
fse_decompress.c:BIT_lookBits:
  331|   358k|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|   358k|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|   358k|    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|   358k|}
fse_decompress.c:BIT_getMiddleBits:
  308|   358k|{
  309|   358k|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|   358k|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|   358k|#    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|   358k|#if defined(__x86_64__) || defined(_M_X64)
  318|   358k|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|   358k|}
fse_decompress.c:BIT_skipBits:
  354|   422k|{
  355|   422k|    bitD->bitsConsumed += nbBits;
  356|   422k|}
fse_decompress.c:BIT_reloadDStream:
  413|   291k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|   291k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|   291k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 4.83k, False: 286k]
  |  |  ------------------
  ------------------
  416|  4.83k|        static const BitContainerType zeroFilled = 0;
  417|  4.83k|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|  4.83k|        return BIT_DStream_overflow;
  420|  4.83k|    }
  421|       |
  422|   286k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   286k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|   286k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 13.9k, False: 272k]
  ------------------
  425|  13.9k|        return BIT_reloadDStream_internal(bitD);
  426|  13.9k|    }
  427|   272k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 230k, False: 42.3k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|   230k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 224k, False: 5.98k]
  ------------------
  430|  5.98k|        return BIT_DStream_completed;
  431|   230k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  42.3k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  42.3k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  42.3k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 351, False: 42.0k]
  ------------------
  436|    351|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    351|            result = BIT_DStream_endOfBuffer;
  438|    351|        }
  439|  42.3k|        bitD->ptr -= nbBytes;
  440|  42.3k|        bitD->bitsConsumed -= nbBytes*8;
  441|  42.3k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  42.3k|        return result;
  443|   272k|    }
  444|   272k|}
fse_decompress.c:BIT_reloadDStream_internal:
  385|  13.9k|{
  386|  13.9k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  13.9k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  13.9k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  13.9k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  13.9k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  13.9k|    bitD->bitsConsumed &= 7;
  390|  13.9k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  13.9k|    return BIT_DStream_unfinished;
  392|  13.9k|}
fse_decompress.c:BIT_readBitsFast:
  372|  64.4k|{
  373|  64.4k|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  64.4k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  64.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  64.4k|    BIT_skipBits(bitD, nbBits);
  376|  64.4k|    return value;
  377|  64.4k|}
fse_decompress.c:BIT_lookBitsFast:
  347|  64.4k|{
  348|  64.4k|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  64.4k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  64.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  64.4k|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  64.4k|}
huf_decompress.c:BIT_initDStream:
  255|  3.04k|{
  256|  3.04k|    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.02k]
  ------------------
  257|       |
  258|  3.02k|    bitD->start = (const char*)srcBuffer;
  259|  3.02k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  3.02k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 944, False: 2.08k]
  ------------------
  262|    944|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|    944|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|    944|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|    944|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 931, False: 13]
  ------------------
  266|    944|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|     13|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     13|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     13|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:15): [True: 13, False: 931]
  ------------------
  267|  2.08k|    } else {
  268|  2.08k|        bitD->ptr   = bitD->start;
  269|  2.08k|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|  2.08k|        switch(srcSize)
  271|  2.08k|        {
  272|     41|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 41, False: 2.04k]
  ------------------
  273|     41|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     41|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|    108|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 67, False: 2.01k]
  ------------------
  276|    108|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    108|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|    151|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 43, False: 2.03k]
  ------------------
  279|    151|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    151|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|    235|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 84, False: 1.99k]
  ------------------
  282|    235|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    235|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|  1.09k|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 856, False: 1.22k]
  ------------------
  285|  1.09k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.09k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|  1.19k|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 103, False: 1.97k]
  ------------------
  288|  1.19k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.19k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|  2.08k|        default: break;
  ------------------
  |  Branch (290:9): [True: 888, False: 1.19k]
  ------------------
  291|  2.08k|        }
  292|  2.08k|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|  2.08k|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 2.05k, False: 23]
  ------------------
  294|  2.08k|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|     23|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     23|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     23|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 23, False: 2.05k]
  ------------------
  295|  2.08k|        }
  296|  2.05k|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|  2.05k|    }
  298|       |
  299|  2.99k|    return srcSize;
  300|  3.02k|}
huf_decompress.c:BIT_reloadDStream:
  413|   427k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|   427k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|   427k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 281, False: 426k]
  |  |  ------------------
  ------------------
  416|    281|        static const BitContainerType zeroFilled = 0;
  417|    281|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|    281|        return BIT_DStream_overflow;
  420|    281|    }
  421|       |
  422|   426k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   426k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|   426k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 411k, False: 15.3k]
  ------------------
  425|   411k|        return BIT_reloadDStream_internal(bitD);
  426|   411k|    }
  427|  15.3k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 3.57k, False: 11.8k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  3.57k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 2.94k, False: 627]
  ------------------
  430|    627|        return BIT_DStream_completed;
  431|  3.57k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  11.8k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  11.8k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  11.8k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 1.37k, False: 10.4k]
  ------------------
  436|  1.37k|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|  1.37k|            result = BIT_DStream_endOfBuffer;
  438|  1.37k|        }
  439|  11.8k|        bitD->ptr -= nbBytes;
  440|  11.8k|        bitD->bitsConsumed -= nbBytes*8;
  441|  11.8k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  11.8k|        return result;
  443|  15.3k|    }
  444|  15.3k|}
huf_decompress.c:BIT_reloadDStream_internal:
  385|   560k|{
  386|   560k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|   560k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|   560k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|   560k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   560k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|   560k|    bitD->bitsConsumed &= 7;
  390|   560k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|   560k|    return BIT_DStream_unfinished;
  392|   560k|}
huf_decompress.c:BIT_lookBitsFast:
  347|  4.99M|{
  348|  4.99M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  4.99M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  4.99M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  4.99M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  4.99M|}
huf_decompress.c:BIT_skipBits:
  354|  4.99M|{
  355|  4.99M|    bitD->bitsConsumed += nbBits;
  356|  4.99M|}
huf_decompress.c:BIT_endOfDStream:
  450|  2.92k|{
  451|  2.92k|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 2.49k, False: 428]
  |  Branch (451:49): [True: 1.70k, False: 790]
  ------------------
  452|  2.92k|}
huf_decompress.c:BIT_reloadDStreamFast:
  401|   149k|{
  402|   149k|    if (UNLIKELY(bitD->ptr < bitD->limitPtr))
  ------------------
  |  |  188|   149k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 571, False: 148k]
  |  |  ------------------
  ------------------
  403|    571|        return BIT_DStream_overflow;
  404|   148k|    return BIT_reloadDStream_internal(bitD);
  405|   149k|}

zstd_decompress_block.c:ZSTD_maybeNullPtrAdd:
  386|  14.2k|{
  387|  14.2k|    return add > 0 ? ptr + add : ptr;
  ------------------
  |  Branch (387:12): [True: 14.0k, False: 221]
  ------------------
  388|  14.2k|}
zstd_decompress_block.c:ZSTD_wrappedPtrSub:
  374|  2.42M|{
  375|  2.42M|    return ptr - sub;
  376|  2.42M|}
zstd_decompress_block.c:ZSTD_wrappedPtrAdd:
  361|  2.42M|{
  362|  2.42M|    return ptr + add;
  363|  2.42M|}
huf_decompress.c:ZSTD_maybeNullPtrAdd:
  386|  7.45k|{
  387|  7.45k|    return add > 0 ? ptr + add : ptr;
  ------------------
  |  Branch (387:12): [True: 6.85k, False: 601]
  ------------------
  388|  7.45k|}

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

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

zstd_common.c:ERR_isError:
   52|  29.3k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  29.3k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  29.3k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  29.3k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_common.c:ERR_getErrorCode:
   54|  16.6k|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: 12.0k, False: 4.62k]
  ------------------
zstd_ddict.c:ERR_isError:
   52|  8.99k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  8.99k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  8.99k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  8.99k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress.c:ERR_isError:
   52|   248k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|   248k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|   248k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   248k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress_block.c:ERR_isError:
   52|  5.47M|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  5.47M|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  5.47M|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  5.47M|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v05.c:ERR_isError:
   52|  82.9k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  82.9k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  82.9k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  82.9k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v06.c:ERR_isError:
   52|   121k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|   121k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|   121k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   121k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v07.c:ERR_isError:
   52|  45.7k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  45.7k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  45.7k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  45.7k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
entropy_common.c:ERR_isError:
   52|  6.92k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  6.92k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  6.92k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  6.92k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
fse_decompress.c:ERR_isError:
   52|  14.9k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  14.9k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  14.9k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  14.9k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
huf_decompress.c:ERR_isError:
   52|  25.5k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  25.5k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  25.5k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  25.5k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------

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

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

zstd_ddict.c:MEM_readLE32:
  322|  4.67k|{
  323|  4.67k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 4.67k, False: 0]
  ------------------
  324|  4.67k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  4.67k|}
zstd_ddict.c:MEM_isLittleEndian:
  141|  4.67k|{
  142|  4.67k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  4.67k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|  4.67k|}
zstd_ddict.c:MEM_read32:
  183|  4.67k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE32:
  322|   118k|{
  323|   118k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 118k, False: 0]
  ------------------
  324|   118k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|   118k|}
zstd_decompress.c:MEM_isLittleEndian:
  141|   121k|{
  142|   121k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   121k|    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|   121k|}
zstd_decompress.c:MEM_read32:
  183|   118k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE16:
  290|  1.31k|{
  291|  1.31k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 1.31k, False: 0]
  ------------------
  292|  1.31k|        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.31k|}
zstd_decompress.c:MEM_read16:
  182|  1.31k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress.c:MEM_readLE64:
  338|  2.13k|{
  339|  2.13k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 2.13k, False: 0]
  ------------------
  340|  2.13k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  2.13k|}
zstd_decompress.c:MEM_read64:
  184|  2.13k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_decompress_block.c:MEM_readLE24:
  311|  52.0k|{
  312|  52.0k|    return (U32)MEM_readLE16(memPtr) + ((U32)(((const BYTE*)memPtr)[2]) << 16);
  313|  52.0k|}
zstd_decompress_block.c:MEM_readLE32:
  322|  5.00k|{
  323|  5.00k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 5.00k, False: 0]
  ------------------
  324|  5.00k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  5.00k|}
zstd_decompress_block.c:MEM_isLittleEndian:
  141|  5.29M|{
  142|  5.29M|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  5.29M|    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.29M|}
zstd_decompress_block.c:MEM_read32:
  183|  5.00k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress_block.c:MEM_write64:
  189|  47.8k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
zstd_decompress_block.c:MEM_readLE16:
  290|  53.0k|{
  291|  53.0k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 53.0k, False: 0]
  ------------------
  292|  53.0k|        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|  53.0k|}
zstd_decompress_block.c:MEM_read16:
  182|  53.0k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress_block.c:MEM_32bits:
  137|  36.5M|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_decompress_block.c:MEM_64bits:
  138|  5.44M|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_decompress_block.c:MEM_readLEST:
  354|  5.23M|{
  355|  5.23M|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 5.23M]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  5.23M|    else
  358|  5.23M|        return (size_t)MEM_readLE64(memPtr);
  359|  5.23M|}
zstd_decompress_block.c:MEM_readLE64:
  338|  5.23M|{
  339|  5.23M|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 5.23M, False: 0]
  ------------------
  340|  5.23M|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  5.23M|}
zstd_decompress_block.c:MEM_read64:
  184|  5.23M|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_v05.c:MEM_readLE32:
  322|   110k|{
  323|   110k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 110k, False: 0]
  ------------------
  324|   110k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|   110k|}
zstd_v05.c:MEM_isLittleEndian:
  141|   553k|{
  142|   553k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   553k|    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|   553k|}
zstd_v05.c:MEM_read32:
  183|   110k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_v05.c:MEM_readLEST:
  354|  89.7k|{
  355|  89.7k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 89.7k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  89.7k|    else
  358|  89.7k|        return (size_t)MEM_readLE64(memPtr);
  359|  89.7k|}
zstd_v05.c:MEM_32bits:
  137|   130k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_v05.c:MEM_readLE64:
  338|  89.7k|{
  339|  89.7k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 89.7k, False: 0]
  ------------------
  340|  89.7k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  89.7k|}
zstd_v05.c:MEM_read64:
  184|  89.7k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_v05.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_v05.c:MEM_read16:
  182|  1.24k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_v05.c:MEM_64bits:
  138|  74.2k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_v05.c:MEM_writeLE16:
  300|   351k|{
  301|   351k|    if (MEM_isLittleEndian()) {
  ------------------
  |  Branch (301:9): [True: 351k, False: 0]
  ------------------
  302|   351k|        MEM_write16(memPtr, val);
  303|   351k|    } else {
  304|      0|        BYTE* p = (BYTE*)memPtr;
  305|      0|        p[0] = (BYTE)val;
  306|      0|        p[1] = (BYTE)(val>>8);
  307|      0|    }
  308|   351k|}
zstd_v05.c:MEM_write16:
  187|   351k|MEM_STATIC void MEM_write16(void* memPtr, U16 value) { *(unalign16*)memPtr = value; }
entropy_common.c:MEM_readLE32:
  322|   130k|{
  323|   130k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 130k, False: 0]
  ------------------
  324|   130k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|   130k|}
entropy_common.c:MEM_isLittleEndian:
  141|   130k|{
  142|   130k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   130k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|   130k|}
entropy_common.c:MEM_read32:
  183|   130k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
fse_decompress.c:MEM_write64:
  189|  15.5k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
fse_decompress.c:MEM_readLEST:
  354|  60.1k|{
  355|  60.1k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 60.1k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  60.1k|    else
  358|  60.1k|        return (size_t)MEM_readLE64(memPtr);
  359|  60.1k|}
fse_decompress.c:MEM_32bits:
  137|  60.1k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
fse_decompress.c:MEM_isLittleEndian:
  141|  60.1k|{
  142|  60.1k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  60.1k|    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|  60.1k|}
fse_decompress.c:MEM_readLE64:
  338|  60.1k|{
  339|  60.1k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 60.1k, False: 0]
  ------------------
  340|  60.1k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  60.1k|}
fse_decompress.c:MEM_read64:
  184|  60.1k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_isLittleEndian:
  141|  1.06M|{
  142|  1.06M|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  1.06M|    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.06M|}
huf_decompress.c:MEM_write64:
  189|  2.15M|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
huf_decompress.c:MEM_readLEST:
  354|   592k|{
  355|   592k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 592k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|   592k|    else
  358|   592k|        return (size_t)MEM_readLE64(memPtr);
  359|   592k|}
huf_decompress.c:MEM_32bits:
  137|   606k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
huf_decompress.c:MEM_readLE64:
  338|   592k|{
  339|   592k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 592k, False: 0]
  ------------------
  340|   592k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|   592k|}
huf_decompress.c:MEM_read64:
  184|   592k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_64bits:
  138|  1.07M|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
huf_decompress.c:MEM_readLE16:
  290|  9.18k|{
  291|  9.18k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 9.18k, False: 0]
  ------------------
  292|  9.18k|        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|  9.18k|}
huf_decompress.c:MEM_read16:
  182|  9.18k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }

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

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

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

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

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

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

ZSTD_getcBlockSize:
   65|  50.9k|{
   66|  50.9k|    RETURN_ERROR_IF(srcSize < ZSTD_blockHeaderSize, srcSize_wrong, "");
  ------------------
  |  |  114|  50.9k|    do {                                                                       \
  |  |  115|  50.9k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 52, False: 50.8k]
  |  |  ------------------
  |  |  116|     52|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     52|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 52]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     52|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     52|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     52|    do {                                           \
  |  |  |  |   99|     52|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 52]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     52|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 52]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     52|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     52|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 52]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     52|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     52|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 52]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     52|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     52|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     52|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     52|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     52|        }                                                                      \
  |  |  123|  50.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 50.8k]
  |  |  ------------------
  ------------------
   67|       |
   68|  50.8k|    {   U32 const cBlockHeader = MEM_readLE24(src);
   69|  50.8k|        U32 const cSize = cBlockHeader >> 3;
   70|  50.8k|        bpPtr->lastBlock = cBlockHeader & 1;
   71|  50.8k|        bpPtr->blockType = (blockType_e)((cBlockHeader >> 1) & 3);
   72|  50.8k|        bpPtr->origSize = cSize;   /* only useful for RLE */
   73|  50.8k|        if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (73:13): [True: 1.77k, False: 49.1k]
  ------------------
   74|  49.1k|        RETURN_ERROR_IF(bpPtr->blockType == bt_reserved, corruption_detected, "");
  ------------------
  |  |  114|  49.1k|    do {                                                                       \
  |  |  115|  49.1k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 17, False: 49.0k]
  |  |  ------------------
  |  |  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|  49.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 49.0k]
  |  |  ------------------
  ------------------
   75|  49.0k|        return cSize;
   76|  49.1k|    }
   77|  49.1k|}
ZSTD_buildFSETable:
  630|  7.52k|{
  631|  7.52k|#if DYNAMIC_BMI2
  632|  7.52k|    if (bmi2) {
  ------------------
  |  Branch (632:9): [True: 5.36k, False: 2.15k]
  ------------------
  633|  5.36k|        ZSTD_buildFSETable_body_bmi2(dt, normalizedCounter, maxSymbolValue,
  634|  5.36k|                baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  635|  5.36k|        return;
  636|  5.36k|    }
  637|  2.15k|#endif
  638|  2.15k|    (void)bmi2;
  639|  2.15k|    ZSTD_buildFSETable_body_default(dt, normalizedCounter, maxSymbolValue,
  640|  2.15k|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  641|  2.15k|}
ZSTD_decodeSeqHeaders:
  697|  8.42k|{
  698|  8.42k|    const BYTE* const istart = (const BYTE*)src;
  699|  8.42k|    const BYTE* const iend = istart + srcSize;
  700|  8.42k|    const BYTE* ip = istart;
  701|  8.42k|    int nbSeq;
  702|  8.42k|    DEBUGLOG(5, "ZSTD_decodeSeqHeaders");
  ------------------
  |  |  104|  8.42k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 8.42k]
  |  |  ------------------
  ------------------
  703|       |
  704|       |    /* check */
  705|  8.42k|    RETURN_ERROR_IF(srcSize < MIN_SEQUENCES_SIZE, srcSize_wrong, "");
  ------------------
  |  |  114|  8.42k|    do {                                                                       \
  |  |  115|  8.42k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 22, False: 8.40k]
  |  |  ------------------
  |  |  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|  8.42k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 8.40k]
  |  |  ------------------
  ------------------
  706|       |
  707|       |    /* SeqHead */
  708|  8.40k|    nbSeq = *ip++;
  709|  8.40k|    if (nbSeq > 0x7F) {
  ------------------
  |  Branch (709:9): [True: 1.34k, False: 7.05k]
  ------------------
  710|  1.34k|        if (nbSeq == 0xFF) {
  ------------------
  |  Branch (710:13): [True: 642, False: 702]
  ------------------
  711|    642|            RETURN_ERROR_IF(ip+2 > iend, srcSize_wrong, "");
  ------------------
  |  |  114|    642|    do {                                                                       \
  |  |  115|    642|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 639]
  |  |  ------------------
  |  |  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|    642|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 639]
  |  |  ------------------
  ------------------
  712|    639|            nbSeq = MEM_readLE16(ip) + LONGNBSEQ;
  ------------------
  |  |   96|    639|#define LONGNBSEQ 0x7F00
  ------------------
  713|    639|            ip+=2;
  714|    702|        } else {
  715|    702|            RETURN_ERROR_IF(ip >= iend, srcSize_wrong, "");
  ------------------
  |  |  114|    702|    do {                                                                       \
  |  |  115|    702|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 15, False: 687]
  |  |  ------------------
  |  |  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|    702|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 687]
  |  |  ------------------
  ------------------
  716|    687|            nbSeq = ((nbSeq-0x80)<<8) + *ip++;
  717|    687|        }
  718|  1.34k|    }
  719|  8.38k|    *nbSeqPtr = nbSeq;
  720|       |
  721|  8.38k|    if (nbSeq == 0) {
  ------------------
  |  Branch (721:9): [True: 3.64k, False: 4.74k]
  ------------------
  722|       |        /* No sequence : section ends immediately */
  723|  3.64k|        RETURN_ERROR_IF(ip != iend, corruption_detected,
  ------------------
  |  |  114|  3.64k|    do {                                                                       \
  |  |  115|  3.64k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 29, False: 3.61k]
  |  |  ------------------
  |  |  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|  3.64k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.61k]
  |  |  ------------------
  ------------------
  724|  3.64k|            "extraneous data present in the Sequences section");
  725|  3.61k|        return (size_t)(ip - istart);
  726|  3.64k|    }
  727|       |
  728|       |    /* FSE table descriptors */
  729|  4.74k|    RETURN_ERROR_IF(ip+1 > iend, srcSize_wrong, ""); /* minimum possible size: 1 byte for symbol encoding types */
  ------------------
  |  |  114|  4.74k|    do {                                                                       \
  |  |  115|  4.74k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 19, False: 4.72k]
  |  |  ------------------
  |  |  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|  4.74k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.72k]
  |  |  ------------------
  ------------------
  730|  4.72k|    RETURN_ERROR_IF(*ip & 3, corruption_detected, ""); /* The last field, Reserved, must be all-zeroes. */
  ------------------
  |  |  114|  4.72k|    do {                                                                       \
  |  |  115|  4.72k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 27, False: 4.69k]
  |  |  ------------------
  |  |  116|     27|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     27|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 27]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     27|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     27|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     27|    do {                                           \
  |  |  |  |   99|     27|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 27]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     27|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 27]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     27|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     27|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 27]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     27|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     27|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 27]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     27|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     27|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     27|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     27|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     27|        }                                                                      \
  |  |  123|  4.72k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.69k]
  |  |  ------------------
  ------------------
  731|  4.69k|    {   SymbolEncodingType_e const LLtype = (SymbolEncodingType_e)(*ip >> 6);
  732|  4.69k|        SymbolEncodingType_e const OFtype = (SymbolEncodingType_e)((*ip >> 4) & 3);
  733|  4.69k|        SymbolEncodingType_e const MLtype = (SymbolEncodingType_e)((*ip >> 2) & 3);
  734|  4.69k|        ip++;
  735|       |
  736|       |        /* Build DTables */
  737|  4.69k|        {   size_t const llhSize = ZSTD_buildSeqTable(dctx->entropy.LLTable, &dctx->LLTptr,
  738|  4.69k|                                                      LLtype, MaxLL, LLFSELog,
  ------------------
  |  |  104|  4.69k|#define MaxLL   35
  ------------------
                                                                    LLtype, MaxLL, LLFSELog,
  ------------------
  |  |  109|  4.69k|#define LLFSELog    9
  ------------------
  739|  4.69k|                                                      ip, iend-ip,
  740|  4.69k|                                                      LL_base, LL_bits,
  741|  4.69k|                                                      LL_defaultDTable, dctx->fseEntropy,
  742|  4.69k|                                                      dctx->ddictIsCold, nbSeq,
  743|  4.69k|                                                      dctx->workspace, sizeof(dctx->workspace),
  744|  4.69k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  745|  4.69k|            RETURN_ERROR_IF(ZSTD_isError(llhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  4.69k|    do {                                                                       \
  |  |  115|  4.69k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 34, False: 4.66k]
  |  |  ------------------
  |  |  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|  4.69k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.66k]
  |  |  ------------------
  ------------------
  746|  4.66k|            ip += llhSize;
  747|  4.66k|        }
  748|       |
  749|      0|        {   size_t const ofhSize = ZSTD_buildSeqTable(dctx->entropy.OFTable, &dctx->OFTptr,
  750|  4.66k|                                                      OFtype, MaxOff, OffFSELog,
  ------------------
  |  |  106|  4.66k|#define MaxOff  31
  ------------------
                                                                    OFtype, MaxOff, OffFSELog,
  ------------------
  |  |  110|  4.66k|#define OffFSELog   8
  ------------------
  751|  4.66k|                                                      ip, iend-ip,
  752|  4.66k|                                                      OF_base, OF_bits,
  753|  4.66k|                                                      OF_defaultDTable, dctx->fseEntropy,
  754|  4.66k|                                                      dctx->ddictIsCold, nbSeq,
  755|  4.66k|                                                      dctx->workspace, sizeof(dctx->workspace),
  756|  4.66k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  757|  4.66k|            RETURN_ERROR_IF(ZSTD_isError(ofhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  4.66k|    do {                                                                       \
  |  |  115|  4.66k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 35, False: 4.62k]
  |  |  ------------------
  |  |  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|  4.66k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.62k]
  |  |  ------------------
  ------------------
  758|  4.62k|            ip += ofhSize;
  759|  4.62k|        }
  760|       |
  761|      0|        {   size_t const mlhSize = ZSTD_buildSeqTable(dctx->entropy.MLTable, &dctx->MLTptr,
  762|  4.62k|                                                      MLtype, MaxML, MLFSELog,
  ------------------
  |  |  103|  4.62k|#define MaxML   52
  ------------------
                                                                    MLtype, MaxML, MLFSELog,
  ------------------
  |  |  108|  4.62k|#define MLFSELog    9
  ------------------
  763|  4.62k|                                                      ip, iend-ip,
  764|  4.62k|                                                      ML_base, ML_bits,
  765|  4.62k|                                                      ML_defaultDTable, dctx->fseEntropy,
  766|  4.62k|                                                      dctx->ddictIsCold, nbSeq,
  767|  4.62k|                                                      dctx->workspace, sizeof(dctx->workspace),
  768|  4.62k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  769|  4.62k|            RETURN_ERROR_IF(ZSTD_isError(mlhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  4.62k|    do {                                                                       \
  |  |  115|  4.62k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 45, False: 4.58k]
  |  |  ------------------
  |  |  116|     45|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     45|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 45]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     45|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     45|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     45|    do {                                           \
  |  |  |  |   99|     45|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 45]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     45|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 45]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     45|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     45|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 45]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     45|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     45|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 45]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     45|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     45|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     45|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     45|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     45|        }                                                                      \
  |  |  123|  4.62k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.58k]
  |  |  ------------------
  ------------------
  770|  4.58k|            ip += mlhSize;
  771|  4.58k|        }
  772|  4.58k|    }
  773|       |
  774|      0|    return ip-istart;
  775|  4.62k|}
ZSTD_decompressBlock_internal:
 2069|  9.48k|{   /* blockType == blockCompressed */
 2070|  9.48k|    const BYTE* ip = (const BYTE*)src;
 2071|  9.48k|    DEBUGLOG(5, "ZSTD_decompressBlock_internal (cSize : %u)", (unsigned)srcSize);
  ------------------
  |  |  104|  9.48k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 9.48k]
  |  |  ------------------
  ------------------
 2072|       |
 2073|       |    /* Note : the wording of the specification
 2074|       |     * allows compressed block to be sized exactly ZSTD_blockSizeMax(dctx).
 2075|       |     * This generally does not happen, as it makes little sense,
 2076|       |     * since an uncompressed block would feature same size and have no decompression cost.
 2077|       |     * Also, note that decoder from reference libzstd before < v1.5.4
 2078|       |     * would consider this edge case as an error.
 2079|       |     * As a consequence, avoid generating compressed blocks of size ZSTD_blockSizeMax(dctx)
 2080|       |     * for broader compatibility with the deployed ecosystem of zstd decoders */
 2081|  9.48k|    RETURN_ERROR_IF(srcSize > ZSTD_blockSizeMax(dctx), srcSize_wrong, "");
  ------------------
  |  |  114|  9.48k|    do {                                                                       \
  |  |  115|  9.48k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 21, False: 9.46k]
  |  |  ------------------
  |  |  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|  9.48k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 9.46k]
  |  |  ------------------
  ------------------
 2082|       |
 2083|       |    /* Decode literals section */
 2084|  9.46k|    {   size_t const litCSize = ZSTD_decodeLiteralsBlock(dctx, src, srcSize, dst, dstCapacity, streaming);
 2085|  9.46k|        DEBUGLOG(5, "ZSTD_decodeLiteralsBlock : cSize=%u, nbLiterals=%zu", (U32)litCSize, dctx->litSize);
  ------------------
  |  |  104|  9.46k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 9.46k]
  |  |  ------------------
  ------------------
 2086|  9.46k|        if (ZSTD_isError(litCSize)) return litCSize;
  ------------------
  |  |   44|  9.46k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (2086:13): [True: 1.03k, False: 8.42k]
  ------------------
 2087|  8.42k|        ip += litCSize;
 2088|  8.42k|        srcSize -= litCSize;
 2089|  8.42k|    }
 2090|       |
 2091|       |    /* Build Decoding Tables */
 2092|      0|    {
 2093|       |        /* Compute the maximum block size, which must also work when !frame and fParams are unset.
 2094|       |         * Additionally, take the min with dstCapacity to ensure that the totalHistorySize fits in a size_t.
 2095|       |         */
 2096|  8.42k|        size_t const blockSizeMax = MIN(dstCapacity, ZSTD_blockSizeMax(dctx));
  ------------------
  |  |   54|  8.42k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 5.43k, False: 2.98k]
  |  |  ------------------
  ------------------
 2097|  8.42k|        size_t const totalHistorySize = ZSTD_totalHistorySize(ZSTD_maybeNullPtrAdd((BYTE*)dst, blockSizeMax), (BYTE const*)dctx->virtualStart);
 2098|       |        /* isLongOffset must be true if there are long offsets.
 2099|       |         * Offsets are long if they are larger than ZSTD_maxShortOffset().
 2100|       |         * We don't expect that to be the case in 64-bit mode.
 2101|       |         *
 2102|       |         * We check here to see if our history is large enough to allow long offsets.
 2103|       |         * If it isn't, then we can't possible have (valid) long offsets. If the offset
 2104|       |         * is invalid, then it is okay to read it incorrectly.
 2105|       |         *
 2106|       |         * If isLongOffsets is true, then we will later check our decoding table to see
 2107|       |         * if it is even possible to generate long offsets.
 2108|       |         */
 2109|  8.42k|        ZSTD_longOffset_e isLongOffset = (ZSTD_longOffset_e)(MEM_32bits() && (totalHistorySize > ZSTD_maxShortOffset()));
  ------------------
  |  Branch (2109:62): [True: 0, False: 8.42k]
  |  Branch (2109:78): [True: 0, False: 0]
  ------------------
 2110|       |        /* These macros control at build-time which decompressor implementation
 2111|       |         * we use. If neither is defined, we do some inspection and dispatch at
 2112|       |         * runtime.
 2113|       |         */
 2114|  8.42k|#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \
 2115|  8.42k|    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)
 2116|  8.42k|        int usePrefetchDecoder = dctx->ddictIsCold;
 2117|       |#else
 2118|       |        /* Set to 1 to avoid computing offset info if we don't need to.
 2119|       |         * Otherwise this value is ignored.
 2120|       |         */
 2121|       |        int usePrefetchDecoder = 1;
 2122|       |#endif
 2123|  8.42k|        int nbSeq;
 2124|  8.42k|        size_t const seqHSize = ZSTD_decodeSeqHeaders(dctx, &nbSeq, ip, srcSize);
 2125|  8.42k|        if (ZSTD_isError(seqHSize)) return seqHSize;
  ------------------
  |  |   44|  8.42k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (2125:13): [True: 229, False: 8.19k]
  ------------------
 2126|  8.19k|        ip += seqHSize;
 2127|  8.19k|        srcSize -= seqHSize;
 2128|       |
 2129|  8.19k|        RETURN_ERROR_IF((dst == NULL || dstCapacity == 0) && nbSeq > 0, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  8.19k|    do {                                                                       \
  |  |  115|  32.8k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 8.19k]
  |  |  |  Branch (115:13): [True: 112, False: 8.08k]
  |  |  |  Branch (115:13): [True: 4, False: 108]
  |  |  ------------------
  |  |  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|  8.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 8.19k]
  |  |  ------------------
  ------------------
 2130|  8.19k|        RETURN_ERROR_IF(MEM_64bits() && sizeof(size_t) == sizeof(void*) && (size_t)(-1) - (size_t)dst < (size_t)(1 << 20), dstSize_tooSmall,
  ------------------
  |  |  114|  8.19k|    do {                                                                       \
  |  |  115|  40.9k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 8.19k, False: 0]
  |  |  |  Branch (115:13): [True: 0, Folded]
  |  |  |  Branch (115:13): [True: 0, False: 8.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|  8.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 8.19k]
  |  |  ------------------
  ------------------
 2131|  8.19k|                "invalid dst");
 2132|       |
 2133|       |        /* If we could potentially have long offsets, or we might want to use the prefetch decoder,
 2134|       |         * compute information about the share of long offsets, and the maximum nbAdditionalBits.
 2135|       |         * NOTE: could probably use a larger nbSeq limit
 2136|       |         */
 2137|  8.19k|        if (isLongOffset || (!usePrefetchDecoder && (totalHistorySize > (1u << 24)) && (nbSeq > 8))) {
  ------------------
  |  Branch (2137:13): [True: 0, False: 8.19k]
  |  Branch (2137:30): [True: 7.00k, False: 1.18k]
  |  Branch (2137:53): [True: 86, False: 6.92k]
  |  Branch (2137:88): [True: 0, False: 86]
  ------------------
 2138|      0|            ZSTD_OffsetInfo const info = ZSTD_getOffsetInfo(dctx->OFTptr, nbSeq);
 2139|      0|            if (isLongOffset && info.maxNbAdditionalBits <= STREAM_ACCUMULATOR_MIN) {
  ------------------
  |  |   45|      0|#define STREAM_ACCUMULATOR_MIN    ((U32)(MEM_32bits() ? STREAM_ACCUMULATOR_MIN_32 : STREAM_ACCUMULATOR_MIN_64))
  |  |  ------------------
  |  |  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  |  |  ------------------
  |  |               #define STREAM_ACCUMULATOR_MIN    ((U32)(MEM_32bits() ? STREAM_ACCUMULATOR_MIN_32 : STREAM_ACCUMULATOR_MIN_64))
  |  |  ------------------
  |  |  |  |   44|      0|#define STREAM_ACCUMULATOR_MIN_64  57
  |  |  ------------------
  |  |  |  Branch (45:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2139:17): [True: 0, False: 0]
  |  Branch (2139:33): [True: 0, False: 0]
  ------------------
 2140|       |                /* If isLongOffset, but the maximum number of additional bits that we see in our table is small
 2141|       |                 * enough, then we know it is impossible to have too long an offset in this block, so we can
 2142|       |                 * use the regular offset decoder.
 2143|       |                 */
 2144|      0|                isLongOffset = ZSTD_lo_isRegularOffset;
 2145|      0|            }
 2146|      0|            if (!usePrefetchDecoder) {
  ------------------
  |  Branch (2146:17): [True: 0, False: 0]
  ------------------
 2147|      0|                U32 const minShare = MEM_64bits() ? 7 : 20; /* heuristic values, correspond to 2.73% and 7.81% */
  ------------------
  |  Branch (2147:38): [True: 0, False: 0]
  ------------------
 2148|      0|                usePrefetchDecoder = (info.longOffsetShare >= minShare);
 2149|      0|            }
 2150|      0|        }
 2151|       |
 2152|  8.19k|        dctx->ddictIsCold = 0;
 2153|       |
 2154|  8.19k|#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \
 2155|  8.19k|    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)
 2156|  8.19k|        if (usePrefetchDecoder) {
  ------------------
  |  Branch (2156:13): [True: 1.18k, False: 7.00k]
  ------------------
 2157|       |#else
 2158|       |        (void)usePrefetchDecoder;
 2159|       |        {
 2160|       |#endif
 2161|  1.18k|#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT
 2162|  1.18k|            return ZSTD_decompressSequencesLong(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2163|  1.18k|#endif
 2164|  1.18k|        }
 2165|       |
 2166|  7.00k|#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG
 2167|       |        /* else */
 2168|  7.00k|        if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (2168:13): [True: 537, False: 6.47k]
  ------------------
 2169|    537|            return ZSTD_decompressSequencesSplitLitBuffer(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2170|  6.47k|        else
 2171|  6.47k|            return ZSTD_decompressSequences(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2172|  7.00k|#endif
 2173|  7.00k|    }
 2174|  7.00k|}
ZSTD_checkContinuity:
 2179|  16.6k|{
 2180|  16.6k|    if (dst != dctx->previousDstEnd && dstSize > 0) {   /* not contiguous */
  ------------------
  |  Branch (2180:9): [True: 16.6k, False: 0]
  |  Branch (2180:40): [True: 16.4k, False: 243]
  ------------------
 2181|  16.4k|        dctx->dictEnd = dctx->previousDstEnd;
 2182|  16.4k|        dctx->virtualStart = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->prefixStart));
 2183|  16.4k|        dctx->prefixStart = dst;
 2184|  16.4k|        dctx->previousDstEnd = dst;
 2185|  16.4k|    }
 2186|  16.6k|}
zstd_decompress_block.c:ZSTD_decodeLiteralsBlock:
  137|  9.46k|{
  138|  9.46k|    DEBUGLOG(5, "ZSTD_decodeLiteralsBlock");
  ------------------
  |  |  104|  9.46k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 9.46k]
  |  |  ------------------
  ------------------
  139|  9.46k|    RETURN_ERROR_IF(srcSize < MIN_CBLOCK_SIZE, corruption_detected, "");
  ------------------
  |  |  114|  9.46k|    do {                                                                       \
  |  |  115|  9.46k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 12, False: 9.44k]
  |  |  ------------------
  |  |  116|     12|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     12|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     12|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     12|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     12|    do {                                           \
  |  |  |  |   99|     12|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 12]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     12|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     12|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     12|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     12|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     12|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     12|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     12|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     12|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     12|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     12|        }                                                                      \
  |  |  123|  9.46k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 9.44k]
  |  |  ------------------
  ------------------
  140|       |
  141|  9.44k|    {   const BYTE* const istart = (const BYTE*) src;
  142|  9.44k|        SymbolEncodingType_e const litEncType = (SymbolEncodingType_e)(istart[0] & 3);
  143|  9.44k|        size_t const blockSizeMax = ZSTD_blockSizeMax(dctx);
  144|       |
  145|  9.44k|        switch(litEncType)
  146|  9.44k|        {
  147|    479|        case set_repeat:
  ------------------
  |  Branch (147:9): [True: 479, False: 8.96k]
  ------------------
  148|    479|            DEBUGLOG(5, "set_repeat flag : re-using stats from previous compressed literals block");
  ------------------
  |  |  104|    479|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 479]
  |  |  ------------------
  ------------------
  149|    479|            RETURN_ERROR_IF(dctx->litEntropy==0, dictionary_corrupted, "");
  ------------------
  |  |  114|    479|    do {                                                                       \
  |  |  115|    479|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 478]
  |  |  ------------------
  |  |  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|    479|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 478]
  |  |  ------------------
  ------------------
  150|    478|            ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    478|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  151|       |
  152|  5.00k|        case set_compressed:
  ------------------
  |  Branch (152:9): [True: 4.52k, False: 4.92k]
  ------------------
  153|  5.00k|            RETURN_ERROR_IF(srcSize < 5, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need up to 5 for case 3");
  ------------------
  |  |  114|  5.00k|    do {                                                                       \
  |  |  115|  5.00k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 5.00k]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|  5.00k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.00k]
  |  |  ------------------
  ------------------
  154|  5.00k|            {   size_t lhSize, litSize, litCSize;
  155|  5.00k|                U32 singleStream=0;
  156|  5.00k|                U32 const lhlCode = (istart[0] >> 2) & 3;
  157|  5.00k|                U32 const lhc = MEM_readLE32(istart);
  158|  5.00k|                size_t hufSuccess;
  159|  5.00k|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|  5.00k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 1.84k, False: 3.16k]
  |  |  ------------------
  ------------------
  160|  5.00k|                int const flags = 0
  161|  5.00k|                    | (ZSTD_DCtx_get_bmi2(dctx) ? HUF_flags_bmi2 : 0)
  ------------------
  |  Branch (161:24): [True: 5.00k, False: 0]
  ------------------
  162|  5.00k|                    | (dctx->disableHufAsm ? HUF_flags_disableAsm : 0);
  ------------------
  |  Branch (162:24): [True: 0, False: 5.00k]
  ------------------
  163|  5.00k|                switch(lhlCode)
  164|  5.00k|                {
  165|  4.82k|                case 0: case 1: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (165:17): [True: 2.00k, False: 2.99k]
  |  Branch (165:25): [True: 2.81k, False: 2.18k]
  |  Branch (165:33): [True: 0, False: 5.00k]
  ------------------
  166|       |                    /* 2 - 2 - 10 - 10 */
  167|  4.82k|                    singleStream = !lhlCode;
  168|  4.82k|                    lhSize = 3;
  169|  4.82k|                    litSize  = (lhc >> 4) & 0x3FF;
  170|  4.82k|                    litCSize = (lhc >> 14) & 0x3FF;
  171|  4.82k|                    break;
  172|     71|                case 2:
  ------------------
  |  Branch (172:17): [True: 71, False: 4.93k]
  ------------------
  173|       |                    /* 2 - 2 - 14 - 14 */
  174|     71|                    lhSize = 4;
  175|     71|                    litSize  = (lhc >> 4) & 0x3FFF;
  176|     71|                    litCSize = lhc >> 18;
  177|     71|                    break;
  178|    113|                case 3:
  ------------------
  |  Branch (178:17): [True: 113, False: 4.89k]
  ------------------
  179|       |                    /* 2 - 2 - 18 - 18 */
  180|    113|                    lhSize = 5;
  181|    113|                    litSize  = (lhc >> 4) & 0x3FFFF;
  182|    113|                    litCSize = (lhc >> 22) + ((size_t)istart[4] << 10);
  183|    113|                    break;
  184|  5.00k|                }
  185|  5.00k|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  5.00k|    do {                                                                       \
  |  |  115|  14.3k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4.32k, False: 683]
  |  |  |  Branch (115:13): [True: 0, False: 4.32k]
  |  |  ------------------
  |  |  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.00k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.00k]
  |  |  ------------------
  ------------------
  186|  5.00k|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|  5.00k|    do {                                                                       \
  |  |  115|  5.00k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 8, False: 4.99k]
  |  |  ------------------
  |  |  116|      8|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      8|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      8|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      8|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      8|    do {                                           \
  |  |  |  |   99|      8|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 8]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      8|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      8|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      8|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      8|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      8|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      8|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      8|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      8|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      8|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      8|        }                                                                      \
  |  |  123|  5.00k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.99k]
  |  |  ------------------
  ------------------
  187|  4.99k|                if (!singleStream)
  ------------------
  |  Branch (187:21): [True: 2.99k, False: 2.00k]
  ------------------
  188|  2.99k|                    RETURN_ERROR_IF(litSize < MIN_LITERALS_FOR_4_STREAMS, literals_headerWrong,
  ------------------
  |  |  114|  2.99k|    do {                                                                       \
  |  |  115|  2.99k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 2.99k]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|  2.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.99k]
  |  |  ------------------
  ------------------
  189|  4.99k|                        "Not enough literals (%zu) for the 4-streams mode (min %u)",
  190|  4.99k|                        litSize, MIN_LITERALS_FOR_4_STREAMS);
  191|  4.99k|                RETURN_ERROR_IF(litCSize + lhSize > srcSize, corruption_detected, "");
  ------------------
  |  |  114|  4.99k|    do {                                                                       \
  |  |  115|  4.99k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 25, False: 4.97k]
  |  |  ------------------
  |  |  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|  4.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.97k]
  |  |  ------------------
  ------------------
  192|  4.97k|                RETURN_ERROR_IF(expectedWriteSize < litSize , dstSize_tooSmall, "");
  ------------------
  |  |  114|  4.97k|    do {                                                                       \
  |  |  115|  4.97k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 15, False: 4.95k]
  |  |  ------------------
  |  |  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|  4.97k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.95k]
  |  |  ------------------
  ------------------
  193|  4.95k|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 0);
  194|       |
  195|       |                /* prefetch huffman table if cold */
  196|  4.95k|                if (dctx->ddictIsCold && (litSize > 768 /* heuristic */)) {
  ------------------
  |  Branch (196:21): [True: 384, False: 4.57k]
  |  Branch (196:42): [True: 40, False: 344]
  ------------------
  197|     40|                    PREFETCH_AREA(dctx->HUFptr, sizeof(dctx->entropy.hufTable));
  ------------------
  |  |  159|     40|    do {                                                 \
  |  |  160|     40|        const char* const _ptr = (const char*)(p);       \
  |  |  161|     40|        size_t const _size = (size_t)(s);                \
  |  |  162|     40|        size_t _pos;                                     \
  |  |  163|  10.3k|        for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \
  |  |  ------------------
  |  |  |  |  156|  10.2k|#define CACHELINE_SIZE 64
  |  |  ------------------
  |  |  |  Branch (163:22): [True: 10.2k, False: 40]
  |  |  ------------------
  |  |  164|  10.2k|            PREFETCH_L2(_ptr + _pos);                    \
  |  |  ------------------
  |  |  |  |  146|  10.2k|#    define PREFETCH_L2(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */)
  |  |  ------------------
  |  |  165|  10.2k|        }                                                \
  |  |  166|     40|    } while (0)
  |  |  ------------------
  |  |  |  Branch (166:14): [Folded, False: 40]
  |  |  ------------------
  ------------------
  198|     40|                }
  199|       |
  200|  4.95k|                if (litEncType==set_repeat) {
  ------------------
  |  Branch (200:21): [True: 474, False: 4.48k]
  ------------------
  201|    474|                    if (singleStream) {
  ------------------
  |  Branch (201:25): [True: 220, False: 254]
  ------------------
  202|    220|                        hufSuccess = HUF_decompress1X_usingDTable(
  203|    220|                            dctx->litBuffer, litSize, istart+lhSize, litCSize,
  204|    220|                            dctx->HUFptr, flags);
  205|    254|                    } else {
  206|    254|                        assert(litSize >= MIN_LITERALS_FOR_4_STREAMS);
  ------------------
  |  |   70|    254|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  207|    254|                        hufSuccess = HUF_decompress4X_usingDTable(
  208|    254|                            dctx->litBuffer, litSize, istart+lhSize, litCSize,
  209|    254|                            dctx->HUFptr, flags);
  210|    254|                    }
  211|  4.48k|                } else {
  212|  4.48k|                    if (singleStream) {
  ------------------
  |  Branch (212:25): [True: 1.77k, False: 2.70k]
  ------------------
  213|       |#if defined(HUF_FORCE_DECOMPRESS_X2)
  214|       |                        hufSuccess = HUF_decompress1X_DCtx_wksp(
  215|       |                            dctx->entropy.hufTable, dctx->litBuffer, litSize,
  216|       |                            istart+lhSize, litCSize, dctx->workspace,
  217|       |                            sizeof(dctx->workspace), flags);
  218|       |#else
  219|  1.77k|                        hufSuccess = HUF_decompress1X1_DCtx_wksp(
  220|  1.77k|                            dctx->entropy.hufTable, dctx->litBuffer, litSize,
  221|  1.77k|                            istart+lhSize, litCSize, dctx->workspace,
  222|  1.77k|                            sizeof(dctx->workspace), flags);
  223|  1.77k|#endif
  224|  2.70k|                    } else {
  225|  2.70k|                        hufSuccess = HUF_decompress4X_hufOnly_wksp(
  226|  2.70k|                            dctx->entropy.hufTable, dctx->litBuffer, litSize,
  227|  2.70k|                            istart+lhSize, litCSize, dctx->workspace,
  228|  2.70k|                            sizeof(dctx->workspace), flags);
  229|  2.70k|                    }
  230|  4.48k|                }
  231|  4.95k|                if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (231:21): [True: 48, False: 4.90k]
  ------------------
  232|     48|                {
  233|     48|                    assert(litSize > ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   70|     48|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  234|     48|                    ZSTD_memcpy(dctx->litExtraBuffer, dctx->litBufferEnd - ZSTD_LITBUFFEREXTRASIZE, ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   44|    288|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  |  |  ------------------
  |  |  |  Branch (44:51): [True: 0, Folded]
  |  |  |  Branch (44:51): [True: 48, Folded]
  |  |  |  Branch (44:51): [Folded, False: 48]
  |  |  |  Branch (44:55): [True: 0, Folded]
  |  |  |  Branch (44:55): [True: 48, Folded]
  |  |  |  Branch (44:55): [Folded, False: 48]
  |  |  ------------------
  ------------------
  235|     48|                    ZSTD_memmove(dctx->litBuffer + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH, dctx->litBuffer, litSize - ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   45|    288|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  |  |  ------------------
  |  |  |  Branch (45:49): [True: 0, Folded]
  |  |  |  Branch (45:49): [True: 48, Folded]
  |  |  |  Branch (45:49): [Folded, False: 48]
  |  |  |  Branch (45:57): [True: 0, Folded]
  |  |  |  Branch (45:57): [True: 48, Folded]
  |  |  |  Branch (45:57): [Folded, False: 48]
  |  |  ------------------
  ------------------
  236|     48|                    dctx->litBuffer += ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  118|     48|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|     48|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|     96|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 48]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 48, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  dctx->litBuffer += ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|     48|#define WILDCOPY_OVERLENGTH 32
  ------------------
  237|     48|                    dctx->litBufferEnd -= WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|     48|#define WILDCOPY_OVERLENGTH 32
  ------------------
  238|     48|                    assert(dctx->litBufferEnd <= (BYTE*)dst + blockSizeMax);
  ------------------
  |  |   70|     48|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  239|     48|                }
  240|       |
  241|  4.95k|                RETURN_ERROR_IF(HUF_isError(hufSuccess), corruption_detected, "");
  ------------------
  |  |  114|  4.95k|    do {                                                                       \
  |  |  115|  4.95k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 854, False: 4.10k]
  |  |  ------------------
  |  |  116|    854|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    854|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 854]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    854|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    854|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    854|    do {                                           \
  |  |  |  |   99|    854|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 854]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    854|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 854]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    854|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    854|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 854]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    854|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    854|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 854]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    854|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    854|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    854|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    854|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    854|        }                                                                      \
  |  |  123|  4.95k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.10k]
  |  |  ------------------
  ------------------
  242|       |
  243|  4.10k|                dctx->litPtr = dctx->litBuffer;
  244|  4.10k|                dctx->litSize = litSize;
  245|  4.10k|                dctx->litEntropy = 1;
  246|  4.10k|                if (litEncType==set_compressed) dctx->HUFptr = dctx->entropy.hufTable;
  ------------------
  |  Branch (246:21): [True: 3.82k, False: 279]
  ------------------
  247|  4.10k|                return litCSize + lhSize;
  248|  4.95k|            }
  249|       |
  250|  2.21k|        case set_basic:
  ------------------
  |  Branch (250:9): [True: 2.21k, False: 7.23k]
  ------------------
  251|  2.21k|            {   size_t litSize, lhSize;
  252|  2.21k|                U32 const lhlCode = ((istart[0]) >> 2) & 3;
  253|  2.21k|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|  2.21k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 603, False: 1.61k]
  |  |  ------------------
  ------------------
  254|  2.21k|                switch(lhlCode)
  255|  2.21k|                {
  256|  1.87k|                case 0: case 2: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (256:17): [True: 1.48k, False: 727]
  |  Branch (256:25): [True: 387, False: 1.82k]
  |  Branch (256:33): [True: 0, False: 2.21k]
  ------------------
  257|  1.87k|                    lhSize = 1;
  258|  1.87k|                    litSize = istart[0] >> 3;
  259|  1.87k|                    break;
  260|    271|                case 1:
  ------------------
  |  Branch (260:17): [True: 271, False: 1.94k]
  ------------------
  261|    271|                    lhSize = 2;
  262|    271|                    litSize = MEM_readLE16(istart) >> 4;
  263|    271|                    break;
  264|     69|                case 3:
  ------------------
  |  Branch (264:17): [True: 69, False: 2.14k]
  ------------------
  265|     69|                    lhSize = 3;
  266|     69|                    RETURN_ERROR_IF(srcSize<3, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize = 3");
  ------------------
  |  |  114|     69|    do {                                                                       \
  |  |  115|     69|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 68]
  |  |  ------------------
  |  |  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|     69|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 68]
  |  |  ------------------
  ------------------
  267|     68|                    litSize = MEM_readLE24(istart) >> 4;
  268|     68|                    break;
  269|  2.21k|                }
  270|       |
  271|  2.21k|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  2.21k|    do {                                                                       \
  |  |  115|  5.06k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 643, False: 1.57k]
  |  |  |  Branch (115:13): [True: 0, False: 643]
  |  |  ------------------
  |  |  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.21k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.21k]
  |  |  ------------------
  ------------------
  272|  2.21k|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|  2.21k|    do {                                                                       \
  |  |  115|  2.21k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 27, False: 2.18k]
  |  |  ------------------
  |  |  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.21k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.18k]
  |  |  ------------------
  ------------------
  273|  2.18k|                RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, "");
  ------------------
  |  |  114|  2.18k|    do {                                                                       \
  |  |  115|  2.18k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 11, False: 2.17k]
  |  |  ------------------
  |  |  116|     11|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     11|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     11|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     11|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     11|    do {                                           \
  |  |  |  |   99|     11|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     11|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     11|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     11|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     11|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     11|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     11|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     11|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     11|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     11|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     11|        }                                                                      \
  |  |  123|  2.18k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.17k]
  |  |  ------------------
  ------------------
  274|  2.17k|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1);
  275|  2.17k|                if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */
  ------------------
  |  |  199|  2.17k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  |  Branch (275:21): [True: 2.08k, False: 90]
  ------------------
  276|  2.08k|                    RETURN_ERROR_IF(litSize+lhSize > srcSize, corruption_detected, "");
  ------------------
  |  |  114|  2.08k|    do {                                                                       \
  |  |  115|  2.08k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 31, False: 2.05k]
  |  |  ------------------
  |  |  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.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.05k]
  |  |  ------------------
  ------------------
  277|  2.05k|                    if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (277:25): [True: 0, False: 2.05k]
  ------------------
  278|      0|                    {
  279|      0|                        ZSTD_memcpy(dctx->litBuffer, istart + lhSize, litSize - ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   44|      0|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  |  |  ------------------
  |  |  |  Branch (44:55): [True: 0, Folded]
  |  |  |  Branch (44:55): [True: 0, Folded]
  |  |  |  Branch (44:55): [Folded, False: 0]
  |  |  ------------------
  ------------------
  280|      0|                        ZSTD_memcpy(dctx->litExtraBuffer, istart + lhSize + litSize - ZSTD_LITBUFFEREXTRASIZE, ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   44|      0|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  |  |  ------------------
  |  |  |  Branch (44:51): [True: 0, Folded]
  |  |  |  Branch (44:51): [True: 0, Folded]
  |  |  |  Branch (44:51): [Folded, False: 0]
  |  |  |  Branch (44:55): [True: 0, Folded]
  |  |  |  Branch (44:55): [True: 0, Folded]
  |  |  |  Branch (44:55): [Folded, False: 0]
  |  |  ------------------
  ------------------
  281|      0|                    }
  282|  2.05k|                    else
  283|  2.05k|                    {
  284|  2.05k|                        ZSTD_memcpy(dctx->litBuffer, istart + lhSize, litSize);
  ------------------
  |  |   44|  2.05k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  285|  2.05k|                    }
  286|  2.05k|                    dctx->litPtr = dctx->litBuffer;
  287|  2.05k|                    dctx->litSize = litSize;
  288|  2.05k|                    return lhSize+litSize;
  289|  2.08k|                }
  290|       |                /* direct reference into compressed stream */
  291|     90|                dctx->litPtr = istart+lhSize;
  292|     90|                dctx->litSize = litSize;
  293|     90|                dctx->litBufferEnd = dctx->litPtr + litSize;
  294|     90|                dctx->litBufferLocation = ZSTD_not_in_dst;
  295|     90|                return lhSize+litSize;
  296|  2.17k|            }
  297|       |
  298|  2.22k|        case set_rle:
  ------------------
  |  Branch (298:9): [True: 2.22k, False: 7.22k]
  ------------------
  299|  2.22k|            {   U32 const lhlCode = ((istart[0]) >> 2) & 3;
  300|  2.22k|                size_t litSize, lhSize;
  301|  2.22k|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|  2.22k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 628, False: 1.60k]
  |  |  ------------------
  ------------------
  302|  2.22k|                switch(lhlCode)
  303|  2.22k|                {
  304|    988|                case 0: case 2: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (304:17): [True: 585, False: 1.64k]
  |  Branch (304:25): [True: 403, False: 1.82k]
  |  Branch (304:33): [True: 0, False: 2.22k]
  ------------------
  305|    988|                    lhSize = 1;
  306|    988|                    litSize = istart[0] >> 3;
  307|    988|                    break;
  308|    117|                case 1:
  ------------------
  |  Branch (308:17): [True: 117, False: 2.11k]
  ------------------
  309|    117|                    lhSize = 2;
  310|    117|                    RETURN_ERROR_IF(srcSize<3, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize+1 = 3");
  ------------------
  |  |  114|    117|    do {                                                                       \
  |  |  115|    117|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 115]
  |  |  ------------------
  |  |  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|    117|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 115]
  |  |  ------------------
  ------------------
  311|    115|                    litSize = MEM_readLE16(istart) >> 4;
  312|    115|                    break;
  313|  1.12k|                case 3:
  ------------------
  |  Branch (313:17): [True: 1.12k, False: 1.10k]
  ------------------
  314|  1.12k|                    lhSize = 3;
  315|  1.12k|                    RETURN_ERROR_IF(srcSize<4, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize+1 = 4");
  ------------------
  |  |  114|  1.12k|    do {                                                                       \
  |  |  115|  1.12k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 1.12k]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|  1.12k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.12k]
  |  |  ------------------
  ------------------
  316|  1.12k|                    litSize = MEM_readLE24(istart) >> 4;
  317|  1.12k|                    break;
  318|  2.22k|                }
  319|  2.22k|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  2.22k|    do {                                                                       \
  |  |  115|  6.52k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2.07k, False: 150]
  |  |  |  Branch (115:13): [True: 0, False: 2.07k]
  |  |  ------------------
  |  |  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.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.22k]
  |  |  ------------------
  ------------------
  320|  2.22k|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|  2.22k|    do {                                                                       \
  |  |  115|  2.22k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 29, False: 2.19k]
  |  |  ------------------
  |  |  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|  2.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.19k]
  |  |  ------------------
  ------------------
  321|  2.19k|                RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, "");
  ------------------
  |  |  114|  2.19k|    do {                                                                       \
  |  |  115|  2.19k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 18, False: 2.17k]
  |  |  ------------------
  |  |  116|     18|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     18|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     18|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     18|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     18|    do {                                           \
  |  |  |  |   99|     18|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 18]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     18|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     18|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     18|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     18|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     18|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     18|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     18|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     18|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     18|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     18|        }                                                                      \
  |  |  123|  2.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.17k]
  |  |  ------------------
  ------------------
  322|  2.17k|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1);
  323|  2.17k|                if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (323:21): [True: 851, False: 1.32k]
  ------------------
  324|    851|                {
  325|    851|                    ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize - ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   46|  5.10k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  |  |  ------------------
  |  |  |  Branch (46:55): [True: 0, Folded]
  |  |  |  Branch (46:55): [True: 851, Folded]
  |  |  |  Branch (46:55): [Folded, False: 851]
  |  |  ------------------
  ------------------
  326|    851|                    ZSTD_memset(dctx->litExtraBuffer, istart[lhSize], ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   46|  5.10k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  |  |  ------------------
  |  |  |  Branch (46:55): [True: 0, Folded]
  |  |  |  Branch (46:55): [True: 851, Folded]
  |  |  |  Branch (46:55): [Folded, False: 851]
  |  |  ------------------
  ------------------
  327|    851|                }
  328|  1.32k|                else
  329|  1.32k|                {
  330|  1.32k|                    ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize);
  ------------------
  |  |   46|  1.32k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  331|  1.32k|                }
  332|  2.17k|                dctx->litPtr = dctx->litBuffer;
  333|  2.17k|                dctx->litSize = litSize;
  334|  2.17k|                return lhSize+1;
  335|  2.19k|            }
  336|      0|        default:
  ------------------
  |  Branch (336:9): [True: 0, False: 9.44k]
  ------------------
  337|      0|            RETURN_ERROR(corruption_detected, "impossible");
  ------------------
  |  |  131|      0|    do {                                                                     \
  |  |  132|      0|        RAWLOG(3, "%s:%d: ERROR!: unconditional check failed, returning %s", \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  133|      0|              __FILE__, __LINE__, ERR_QUOTE(ERROR(err)));                    \
  |  |  134|      0|        _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                               \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  135|      0|        RAWLOG(3, ": " __VA_ARGS__);                                         \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  136|      0|        RAWLOG(3, "\n");                                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  137|      0|        return ERROR(err);                                                   \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  138|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (138:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  338|  9.44k|        }
  339|  9.44k|    }
  340|  9.44k|}
zstd_decompress_block.c:ZSTD_allocateLiteralsBuffer:
   82|  9.30k|{
   83|  9.30k|    size_t const blockSizeMax = ZSTD_blockSizeMax(dctx);
   84|  9.30k|    assert(litSize <= blockSizeMax);
  ------------------
  |  |   70|  9.30k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   85|  9.30k|    assert(dctx->isFrameDecompression || streaming == not_streaming);
  ------------------
  |  |   70|  9.30k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   86|  9.30k|    assert(expectedWriteSize <= blockSizeMax);
  ------------------
  |  |   70|  9.30k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   87|  9.30k|    if (streaming == not_streaming && dstCapacity > blockSizeMax + WILDCOPY_OVERLENGTH + litSize + WILDCOPY_OVERLENGTH) {
  ------------------
  |  |  199|  9.30k|#define WILDCOPY_OVERLENGTH 32
  ------------------
                  if (streaming == not_streaming && dstCapacity > blockSizeMax + WILDCOPY_OVERLENGTH + litSize + WILDCOPY_OVERLENGTH) {
  ------------------
  |  |  199|  9.30k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  |  Branch (87:9): [True: 9.30k, False: 0]
  |  Branch (87:39): [True: 2.41k, False: 6.89k]
  ------------------
   88|       |        /* If we aren't streaming, we can just put the literals after the output
   89|       |         * of the current block. We don't need to worry about overwriting the
   90|       |         * extDict of our window, because it doesn't exist.
   91|       |         * So if we have space after the end of the block, just put it there.
   92|       |         */
   93|  2.41k|        dctx->litBuffer = (BYTE*)dst + blockSizeMax + WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|  2.41k|#define WILDCOPY_OVERLENGTH 32
  ------------------
   94|  2.41k|        dctx->litBufferEnd = dctx->litBuffer + litSize;
   95|  2.41k|        dctx->litBufferLocation = ZSTD_in_dst;
   96|  6.89k|    } else if (litSize <= ZSTD_LITBUFFEREXTRASIZE) {
  ------------------
  |  |  118|  6.89k|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|  6.89k|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  13.7k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 6.89k]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 6.89k, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (96:16): [True: 5.99k, False: 902]
  ------------------
   97|       |        /* Literals fit entirely within the extra buffer, put them there to avoid
   98|       |         * having to split the literals.
   99|       |         */
  100|  5.99k|        dctx->litBuffer = dctx->litExtraBuffer;
  101|  5.99k|        dctx->litBufferEnd = dctx->litBuffer + litSize;
  102|  5.99k|        dctx->litBufferLocation = ZSTD_not_in_dst;
  103|  5.99k|    } else {
  104|    902|        assert(blockSizeMax > ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   70|    902|#    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|    902|        if (splitImmediately) {
  ------------------
  |  Branch (112:13): [True: 854, False: 48]
  ------------------
  113|       |            /* won't fit in litExtraBuffer, so it will be split between end of dst and extra buffer */
  114|    854|            dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  118|    854|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    854|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.70k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 854]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 854, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|    854|#define WILDCOPY_OVERLENGTH 32
  ------------------
  115|    854|            dctx->litBufferEnd = dctx->litBuffer + litSize - ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    854|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    854|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.70k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 854]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 854, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|    854|        } else {
  117|       |            /* initially this will be stored entirely in dst during huffman decoding, it will partially be shifted to litExtraBuffer after */
  118|     48|            dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize;
  119|     48|            dctx->litBufferEnd = (BYTE*)dst + expectedWriteSize;
  120|     48|        }
  121|    902|        dctx->litBufferLocation = ZSTD_split;
  122|    902|        assert(dctx->litBufferEnd <= (BYTE*)dst + expectedWriteSize);
  ------------------
  |  |   70|    902|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  123|    902|    }
  124|  9.30k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body_bmi2:
  620|  5.36k|{
  621|  5.36k|    ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,
  622|  5.36k|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  623|  5.36k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body:
  489|  7.52k|{
  490|  7.52k|    ZSTD_seqSymbol* const tableDecode = dt+1;
  491|  7.52k|    U32 const maxSV1 = maxSymbolValue + 1;
  492|  7.52k|    U32 const tableSize = 1 << tableLog;
  493|       |
  494|  7.52k|    U16* symbolNext = (U16*)wksp;
  495|  7.52k|    BYTE* spread = (BYTE*)(symbolNext + MaxSeq + 1);
  ------------------
  |  |  107|  7.52k|#define MaxSeq MAX(MaxLL, MaxML)   /* Assumption : MaxOff < MaxLL,MaxML */
  |  |  ------------------
  |  |  |  |   55|  7.52k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (55:19): [Folded, False: 7.52k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  496|  7.52k|    U32 highThreshold = tableSize - 1;
  497|       |
  498|       |
  499|       |    /* Sanity Checks */
  500|  7.52k|    assert(maxSymbolValue <= MaxSeq);
  ------------------
  |  |   70|  7.52k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  501|  7.52k|    assert(tableLog <= MaxFSELog);
  ------------------
  |  |   70|  7.52k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  502|  7.52k|    assert(wkspSize >= ZSTD_BUILD_FSE_TABLE_WKSP_SIZE);
  ------------------
  |  |   70|  7.52k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  503|  7.52k|    (void)wkspSize;
  504|       |    /* Init, lay down lowprob symbols */
  505|  7.52k|    {   ZSTD_seqSymbol_header DTableH;
  506|  7.52k|        DTableH.tableLog = tableLog;
  507|  7.52k|        DTableH.fastMode = 1;
  508|  7.52k|        {   S16 const largeLimit= (S16)(1 << (tableLog-1));
  509|  7.52k|            U32 s;
  510|   103k|            for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (510:23): [True: 95.5k, False: 7.52k]
  ------------------
  511|  95.5k|                if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (511:21): [True: 33.5k, False: 61.9k]
  ------------------
  512|  33.5k|                    tableDecode[highThreshold--].baseValue = s;
  513|  33.5k|                    symbolNext[s] = 1;
  514|  61.9k|                } else {
  515|  61.9k|                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
  ------------------
  |  Branch (515:25): [True: 4.43k, False: 57.5k]
  ------------------
  516|  61.9k|                    assert(normalizedCounter[s]>=0);
  ------------------
  |  |   70|  61.9k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  517|  61.9k|                    symbolNext[s] = (U16)normalizedCounter[s];
  518|  61.9k|        }   }   }
  519|  7.52k|        ZSTD_memcpy(dt, &DTableH, sizeof(DTableH));
  ------------------
  |  |   44|  7.52k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  520|  7.52k|    }
  521|       |
  522|       |    /* Spread symbols */
  523|  7.52k|    assert(tableSize <= 512);
  ------------------
  |  |   70|  7.52k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  524|       |    /* Specialized symbol spreading for the case when there are
  525|       |     * no low probability (-1 count) symbols. When compressing
  526|       |     * small blocks we avoid low probability symbols to hit this
  527|       |     * case, since header decoding speed matters more.
  528|       |     */
  529|  7.52k|    if (highThreshold == tableSize - 1) {
  ------------------
  |  Branch (529:9): [True: 2.38k, False: 5.13k]
  ------------------
  530|  2.38k|        size_t const tableMask = tableSize-1;
  531|  2.38k|        size_t const step = FSE_TABLESTEP(tableSize);
  ------------------
  |  |  623|  2.38k|#define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3)
  ------------------
  532|       |        /* First lay down the symbols in order.
  533|       |         * We use a uint64_t to lay down 8 bytes at a time. This reduces branch
  534|       |         * misses since small blocks generally have small table logs, so nearly
  535|       |         * all symbols have counts <= 8. We ensure we have 8 bytes at the end of
  536|       |         * our buffer to handle the over-write.
  537|       |         */
  538|  2.38k|        {
  539|  2.38k|            U64 const add = 0x0101010101010101ull;
  540|  2.38k|            size_t pos = 0;
  541|  2.38k|            U64 sv = 0;
  542|  2.38k|            U32 s;
  543|  13.6k|            for (s=0; s<maxSV1; ++s, sv += add) {
  ------------------
  |  Branch (543:23): [True: 11.2k, False: 2.38k]
  ------------------
  544|  11.2k|                int i;
  545|  11.2k|                int const n = normalizedCounter[s];
  546|  11.2k|                MEM_write64(spread + pos, sv);
  547|  47.8k|                for (i = 8; i < n; i += 8) {
  ------------------
  |  Branch (547:29): [True: 36.6k, False: 11.2k]
  ------------------
  548|  36.6k|                    MEM_write64(spread + pos + i, sv);
  549|  36.6k|                }
  550|  11.2k|                assert(n>=0);
  ------------------
  |  |   70|  11.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  551|  11.2k|                pos += (size_t)n;
  552|  11.2k|            }
  553|  2.38k|        }
  554|       |        /* Now we spread those positions across the table.
  555|       |         * The benefit of doing it in two stages is that we avoid the
  556|       |         * variable size inner loop, which caused lots of branch misses.
  557|       |         * Now we can run through all the positions without any branch misses.
  558|       |         * We unroll the loop twice, since that is what empirically worked best.
  559|       |         */
  560|  2.38k|        {
  561|  2.38k|            size_t position = 0;
  562|  2.38k|            size_t s;
  563|  2.38k|            size_t const unroll = 2;
  564|  2.38k|            assert(tableSize % unroll == 0); /* FSE_MIN_TABLELOG is 5 */
  ------------------
  |  |   70|  2.38k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  565|   167k|            for (s = 0; s < (size_t)tableSize; s += unroll) {
  ------------------
  |  Branch (565:25): [True: 164k, False: 2.38k]
  ------------------
  566|   164k|                size_t u;
  567|   493k|                for (u = 0; u < unroll; ++u) {
  ------------------
  |  Branch (567:29): [True: 329k, False: 164k]
  ------------------
  568|   329k|                    size_t const uPosition = (position + (u * step)) & tableMask;
  569|   329k|                    tableDecode[uPosition].baseValue = spread[s + u];
  570|   329k|                }
  571|   164k|                position = (position + (unroll * step)) & tableMask;
  572|   164k|            }
  573|  2.38k|            assert(position == 0);
  ------------------
  |  |   70|  2.38k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  574|  2.38k|        }
  575|  5.13k|    } else {
  576|  5.13k|        U32 const tableMask = tableSize-1;
  577|  5.13k|        U32 const step = FSE_TABLESTEP(tableSize);
  ------------------
  |  |  623|  5.13k|#define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3)
  ------------------
  578|  5.13k|        U32 s, position = 0;
  579|  89.4k|        for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (579:19): [True: 84.3k, False: 5.13k]
  ------------------
  580|  84.3k|            int i;
  581|  84.3k|            int const n = normalizedCounter[s];
  582|   654k|            for (i=0; i<n; i++) {
  ------------------
  |  Branch (582:23): [True: 570k, False: 84.3k]
  ------------------
  583|   570k|                tableDecode[position].baseValue = s;
  584|   570k|                position = (position + step) & tableMask;
  585|   603k|                while (UNLIKELY(position > highThreshold)) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  |  188|   603k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 32.9k, False: 570k]
  |  |  ------------------
  ------------------
  586|   570k|        }   }
  587|  5.13k|        assert(position == 0); /* position must reach all cells once, otherwise normalizedCounter is incorrect */
  ------------------
  |  |   70|  5.13k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  588|  5.13k|    }
  589|       |
  590|       |    /* Build Decoding table */
  591|  7.52k|    {
  592|  7.52k|        U32 u;
  593|   940k|        for (u=0; u<tableSize; u++) {
  ------------------
  |  Branch (593:19): [True: 933k, False: 7.52k]
  ------------------
  594|   933k|            U32 const symbol = tableDecode[u].baseValue;
  595|   933k|            U32 const nextState = symbolNext[symbol]++;
  596|   933k|            tableDecode[u].nbBits = (BYTE) (tableLog - ZSTD_highbit32(nextState) );
  597|   933k|            tableDecode[u].nextState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
  598|   933k|            assert(nbAdditionalBits[symbol] < 255);
  ------------------
  |  |   70|   933k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  599|   933k|            tableDecode[u].nbAdditionalBits = nbAdditionalBits[symbol];
  600|   933k|            tableDecode[u].baseValue = baseValue[symbol];
  601|   933k|        }
  602|  7.52k|    }
  603|  7.52k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body_default:
  610|  2.15k|{
  611|  2.15k|    ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,
  612|  2.15k|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  613|  2.15k|}
zstd_decompress_block.c:ZSTD_buildSeqTable:
  654|  13.9k|{
  655|  13.9k|    switch(type)
  656|  13.9k|    {
  657|  3.07k|    case set_rle :
  ------------------
  |  Branch (657:5): [True: 3.07k, False: 10.9k]
  ------------------
  658|  3.07k|        RETURN_ERROR_IF(!srcSize, srcSize_wrong, "");
  ------------------
  |  |  114|  3.07k|    do {                                                                       \
  |  |  115|  3.07k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 7, False: 3.06k]
  |  |  ------------------
  |  |  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|  3.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.06k]
  |  |  ------------------
  ------------------
  659|  3.06k|        RETURN_ERROR_IF((*(const BYTE*)src) > max, corruption_detected, "");
  ------------------
  |  |  114|  3.06k|    do {                                                                       \
  |  |  115|  3.06k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 7, False: 3.06k]
  |  |  ------------------
  |  |  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|  3.06k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.06k]
  |  |  ------------------
  ------------------
  660|  3.06k|        {   U32 const symbol = *(const BYTE*)src;
  661|  3.06k|            U32 const baseline = baseValue[symbol];
  662|  3.06k|            U8 const nbBits = nbAdditionalBits[symbol];
  663|  3.06k|            ZSTD_buildSeqTable_rle(DTableSpace, baseline, nbBits);
  664|  3.06k|        }
  665|  3.06k|        *DTablePtr = DTableSpace;
  666|  3.06k|        return 1;
  667|  5.05k|    case set_basic :
  ------------------
  |  Branch (667:5): [True: 5.05k, False: 8.93k]
  ------------------
  668|  5.05k|        *DTablePtr = defaultTable;
  669|  5.05k|        return 0;
  670|    399|    case set_repeat:
  ------------------
  |  Branch (670:5): [True: 399, False: 13.5k]
  ------------------
  671|    399|        RETURN_ERROR_IF(!flagRepeatTable, corruption_detected, "");
  ------------------
  |  |  114|    399|    do {                                                                       \
  |  |  115|    399|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 10, False: 389]
  |  |  ------------------
  |  |  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|    399|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 389]
  |  |  ------------------
  ------------------
  672|       |        /* prefetch FSE table if used */
  673|    389|        if (ddictIsCold && (nbSeq > 24 /* heuristic */)) {
  ------------------
  |  Branch (673:13): [True: 113, False: 276]
  |  Branch (673:28): [True: 35, False: 78]
  ------------------
  674|     35|            const void* const pStart = *DTablePtr;
  675|     35|            size_t const pSize = sizeof(ZSTD_seqSymbol) * (SEQSYMBOL_TABLE_SIZE(maxLog));
  ------------------
  |  |   74|     35| #define SEQSYMBOL_TABLE_SIZE(log)   (1 + (1 << (log)))
  ------------------
  676|     35|            PREFETCH_AREA(pStart, pSize);
  ------------------
  |  |  159|     35|    do {                                                 \
  |  |  160|     35|        const char* const _ptr = (const char*)(p);       \
  |  |  161|     35|        size_t const _size = (size_t)(s);                \
  |  |  162|     35|        size_t _pos;                                     \
  |  |  163|  1.95k|        for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \
  |  |  ------------------
  |  |  |  |  156|  1.92k|#define CACHELINE_SIZE 64
  |  |  ------------------
  |  |  |  Branch (163:22): [True: 1.92k, False: 35]
  |  |  ------------------
  |  |  164|  1.92k|            PREFETCH_L2(_ptr + _pos);                    \
  |  |  ------------------
  |  |  |  |  146|  1.92k|#    define PREFETCH_L2(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */)
  |  |  ------------------
  |  |  165|  1.92k|        }                                                \
  |  |  166|     35|    } while (0)
  |  |  ------------------
  |  |  |  Branch (166:14): [Folded, False: 35]
  |  |  ------------------
  ------------------
  677|     35|        }
  678|    389|        return 0;
  679|  5.45k|    case set_compressed :
  ------------------
  |  Branch (679:5): [True: 5.45k, False: 8.53k]
  ------------------
  680|  5.45k|        {   unsigned tableLog;
  681|  5.45k|            S16 norm[MaxSeq+1];
  682|  5.45k|            size_t const headerSize = FSE_readNCount(norm, &max, &tableLog, src, srcSize);
  683|  5.45k|            RETURN_ERROR_IF(FSE_isError(headerSize), corruption_detected, "");
  ------------------
  |  |  114|  5.45k|    do {                                                                       \
  |  |  115|  5.45k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 74, False: 5.38k]
  |  |  ------------------
  |  |  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|  5.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.38k]
  |  |  ------------------
  ------------------
  684|  5.38k|            RETURN_ERROR_IF(tableLog > maxLog, corruption_detected, "");
  ------------------
  |  |  114|  5.38k|    do {                                                                       \
  |  |  115|  5.38k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 16, False: 5.36k]
  |  |  ------------------
  |  |  116|     16|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     16|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     16|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     16|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     16|    do {                                           \
  |  |  |  |   99|     16|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 16]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     16|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     16|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     16|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     16|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     16|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     16|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     16|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     16|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     16|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     16|        }                                                                      \
  |  |  123|  5.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.36k]
  |  |  ------------------
  ------------------
  685|  5.36k|            ZSTD_buildFSETable(DTableSpace, norm, max, baseValue, nbAdditionalBits, tableLog, wksp, wkspSize, bmi2);
  686|  5.36k|            *DTablePtr = DTableSpace;
  687|  5.36k|            return headerSize;
  688|  5.38k|        }
  689|      0|    default :
  ------------------
  |  Branch (689:5): [True: 0, False: 13.9k]
  ------------------
  690|      0|        assert(0);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  691|      0|        RETURN_ERROR(GENERIC, "impossible");
  ------------------
  |  |  131|      0|    do {                                                                     \
  |  |  132|      0|        RAWLOG(3, "%s:%d: ERROR!: unconditional check failed, returning %s", \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  133|      0|              __FILE__, __LINE__, ERR_QUOTE(ERROR(err)));                    \
  |  |  134|      0|        _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                               \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  135|      0|        RAWLOG(3, ": " __VA_ARGS__);                                         \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  136|      0|        RAWLOG(3, "\n");                                                     \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  137|      0|        return ERROR(err);                                                   \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  138|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (138:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  692|  13.9k|    }
  693|  13.9k|}
zstd_decompress_block.c:ZSTD_buildSeqTable_rle:
  464|  3.06k|{
  465|  3.06k|    void* ptr = dt;
  466|  3.06k|    ZSTD_seqSymbol_header* const DTableH = (ZSTD_seqSymbol_header*)ptr;
  467|  3.06k|    ZSTD_seqSymbol* const cell = dt + 1;
  468|       |
  469|  3.06k|    DTableH->tableLog = 0;
  470|  3.06k|    DTableH->fastMode = 0;
  471|       |
  472|  3.06k|    cell->nbBits = 0;
  473|  3.06k|    cell->nextState = 0;
  474|  3.06k|    assert(nbAddBits < 255);
  ------------------
  |  |   70|  3.06k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  475|  3.06k|    cell->nbAdditionalBits = nbAddBits;
  476|  3.06k|    cell->baseValue = baseValue;
  477|  3.06k|}
zstd_decompress_block.c:ZSTD_blockSizeMax:
   55|  39.6k|{
   56|  39.6k|    size_t const blockSizeMax = dctx->isFrameDecompression ? dctx->fParams.blockSizeMax : ZSTD_BLOCKSIZE_MAX;
  ------------------
  |  |  148|  39.6k|#define ZSTD_BLOCKSIZE_MAX     (1<<ZSTD_BLOCKSIZELOG_MAX)
  |  |  ------------------
  |  |  |  |  147|      0|#define ZSTD_BLOCKSIZELOG_MAX  17
  |  |  ------------------
  ------------------
  |  Branch (56:33): [True: 39.6k, False: 0]
  ------------------
   57|  39.6k|    assert(blockSizeMax <= ZSTD_BLOCKSIZE_MAX);
  ------------------
  |  |   70|  39.6k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   58|  39.6k|    return blockSizeMax;
   59|  39.6k|}
zstd_decompress_block.c:ZSTD_totalHistorySize:
 1997|  8.42k|{
 1998|  8.42k|    return (size_t)(op - virtualStart);
 1999|  8.42k|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong:
 1979|  1.18k|{
 1980|  1.18k|    DEBUGLOG(5, "ZSTD_decompressSequencesLong");
  ------------------
  |  |  104|  1.18k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 1.18k]
  |  |  ------------------
  ------------------
 1981|  1.18k|#if DYNAMIC_BMI2
 1982|  1.18k|    if (ZSTD_DCtx_get_bmi2(dctx)) {
  ------------------
  |  Branch (1982:9): [True: 1.18k, False: 0]
  ------------------
 1983|  1.18k|        return ZSTD_decompressSequencesLong_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1984|  1.18k|    }
 1985|      0|#endif
 1986|      0|  return ZSTD_decompressSequencesLong_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1987|  1.18k|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong_bmi2:
 1931|  1.18k|{
 1932|  1.18k|    return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1933|  1.18k|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong_body:
 1738|  1.18k|{
 1739|  1.18k|    const BYTE* ip = (const BYTE*)seqStart;
 1740|  1.18k|    const BYTE* const iend = ip + seqSize;
 1741|  1.18k|    BYTE* const ostart = (BYTE*)dst;
 1742|  1.18k|    BYTE* const oend = dctx->litBufferLocation == ZSTD_in_dst ? dctx->litBuffer : ZSTD_maybeNullPtrAdd(ostart, maxDstSize);
  ------------------
  |  Branch (1742:24): [True: 32, False: 1.15k]
  ------------------
 1743|  1.18k|    BYTE* op = ostart;
 1744|  1.18k|    const BYTE* litPtr = dctx->litPtr;
 1745|  1.18k|    const BYTE* litBufferEnd = dctx->litBufferEnd;
 1746|  1.18k|    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);
 1747|  1.18k|    const BYTE* const dictStart = (const BYTE*) (dctx->virtualStart);
 1748|  1.18k|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 1749|       |
 1750|       |    /* Regen sequences */
 1751|  1.18k|    if (nbSeq) {
  ------------------
  |  Branch (1751:9): [True: 1.08k, False: 103]
  ------------------
 1752|  1.08k|#define STORED_SEQS 8
 1753|  1.08k|#define STORED_SEQS_MASK (STORED_SEQS-1)
 1754|  1.08k|#define ADVANCED_SEQS STORED_SEQS
 1755|  1.08k|        seq_t sequences[STORED_SEQS];
 1756|  1.08k|        int const seqAdvance = MIN(nbSeq, ADVANCED_SEQS);
  ------------------
  |  |   54|  1.08k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 216, False: 864]
  |  |  ------------------
  ------------------
 1757|  1.08k|        seqState_t seqState;
 1758|  1.08k|        int seqNb;
 1759|  1.08k|        size_t prefetchPos = (size_t)(op-prefixStart); /* track position relative to prefixStart */
 1760|       |
 1761|  1.08k|        dctx->fseEntropy = 1;
 1762|  4.32k|        { int i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  4.32k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1762:28): [True: 3.24k, False: 1.08k]
  ------------------
 1763|  1.08k|        assert(dst != NULL);
  ------------------
  |  |   70|  1.08k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1764|  1.08k|        assert(iend >= ip);
  ------------------
  |  |   70|  1.08k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1765|  1.08k|        RETURN_ERROR_IF(
  ------------------
  |  |  114|  1.08k|    do {                                                                       \
  |  |  115|  1.08k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 62, False: 1.01k]
  |  |  ------------------
  |  |  116|     62|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     62|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 62]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     62|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     62|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     62|    do {                                           \
  |  |  |  |   99|     62|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 62]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     62|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 62]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     62|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     62|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 62]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     62|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     62|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 62]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     62|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     62|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     62|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     62|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     62|        }                                                                      \
  |  |  123|  1.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.01k]
  |  |  ------------------
  ------------------
 1766|  1.08k|            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)),
 1767|  1.08k|            corruption_detected, "");
 1768|  1.01k|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1769|  1.01k|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1770|  1.01k|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1771|       |
 1772|       |        /* prepare in advance */
 1773|  8.24k|        for (seqNb=0; seqNb<seqAdvance; seqNb++) {
  ------------------
  |  Branch (1773:23): [True: 7.22k, False: 1.01k]
  ------------------
 1774|  7.22k|            seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1);
 1775|  7.22k|            prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1776|  7.22k|            sequences[seqNb] = sequence;
 1777|  7.22k|        }
 1778|       |
 1779|       |        /* decompress without stomping litBuffer */
 1780|  2.42M|        for (; seqNb < nbSeq; seqNb++) {
  ------------------
  |  Branch (1780:16): [True: 2.42M, False: 228]
  ------------------
 1781|  2.42M|            seq_t sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1);
 1782|       |
 1783|  2.42M|            if (dctx->litBufferLocation == ZSTD_split && litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength > dctx->litBufferEnd) {
  ------------------
  |  | 1754|  2.25M|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|  2.25M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                          if (dctx->litBufferLocation == ZSTD_split && litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength > dctx->litBufferEnd) {
  ------------------
  |  | 1753|  2.25M|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|  2.25M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
  |  Branch (1783:17): [True: 2.25M, False: 162k]
  |  Branch (1783:58): [True: 228, False: 2.25M]
  ------------------
 1784|       |                /* lit buffer is reaching split point, empty out the first buffer and transition to litExtraBuffer */
 1785|    228|                const size_t leftoverLit = dctx->litBufferEnd - litPtr;
 1786|    228|                if (leftoverLit)
  ------------------
  |  Branch (1786:21): [True: 223, False: 5]
  ------------------
 1787|    223|                {
 1788|    223|                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer");
  ------------------
  |  |  114|    223|    do {                                                                       \
  |  |  115|    223|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 220]
  |  |  ------------------
  |  |  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|    223|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 220]
  |  |  ------------------
  ------------------
 1789|    220|                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);
 1790|    220|                    sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength -= leftoverLit;
  ------------------
  |  | 1754|    220|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|    220|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength -= leftoverLit;
  ------------------
  |  | 1753|    220|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    220|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1791|    220|                    op += leftoverLit;
 1792|    220|                }
 1793|    225|                litPtr = dctx->litExtraBuffer;
 1794|    225|                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    225|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    225|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|    450|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 225]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 225, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1795|    225|                dctx->litBufferLocation = ZSTD_not_in_dst;
 1796|    225|                {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1754|    225|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|    225|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                              {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1753|    225|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    225|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1797|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1798|       |                    assert(!ZSTD_isError(oneSeqSize));
 1799|       |                    ZSTD_assertValidSequence(dctx, op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], prefixStart, dictStart);
 1800|       |#endif
 1801|    225|                    if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|    225|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1801:25): [True: 52, False: 173]
  ------------------
 1802|       |
 1803|    173|                    prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1804|    173|                    sequences[seqNb & STORED_SEQS_MASK] = sequence;
  ------------------
  |  | 1753|    173|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    173|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1805|    173|                    op += oneSeqSize;
 1806|    173|            }   }
 1807|  2.42M|            else
 1808|  2.42M|            {
 1809|       |                /* lit buffer is either wholly contained in first or second split, or not split at all*/
 1810|  2.42M|                size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ?
  ------------------
  |  Branch (1810:43): [True: 2.25M, False: 162k]
  ------------------
 1811|  2.25M|                    ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY_OVERLENGTH, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  | 1754|  2.25M|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|  2.25M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY_OVERLENGTH, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  | 1753|  2.25M|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|  2.25M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY_OVERLENGTH, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  |  199|  2.25M|#define WILDCOPY_OVERLENGTH 32
  ------------------
                                  ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY_OVERLENGTH, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  | 1754|  2.25M|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|  2.25M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY_OVERLENGTH, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  | 1753|  2.25M|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|  2.25M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1812|  2.42M|                    ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1754|   162k|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|   162k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1753|   162k|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|   162k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1813|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1814|       |                assert(!ZSTD_isError(oneSeqSize));
 1815|       |                ZSTD_assertValidSequence(dctx, op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], prefixStart, dictStart);
 1816|       |#endif
 1817|  2.42M|                if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|  2.42M|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1817:21): [True: 735, False: 2.41M]
  ------------------
 1818|       |
 1819|  2.41M|                prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1820|  2.41M|                sequences[seqNb & STORED_SEQS_MASK] = sequence;
  ------------------
  |  | 1753|  2.41M|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|  2.41M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1821|  2.41M|                op += oneSeqSize;
 1822|  2.41M|            }
 1823|  2.42M|        }
 1824|    228|        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, "");
  ------------------
  |  |  114|    228|    do {                                                                       \
  |  |  115|    228|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 28, False: 200]
  |  |  ------------------
  |  |  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|    228|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 200]
  |  |  ------------------
  ------------------
 1825|       |
 1826|       |        /* finish queue */
 1827|    200|        seqNb -= seqAdvance;
 1828|    770|        for ( ; seqNb<nbSeq ; seqNb++) {
  ------------------
  |  Branch (1828:17): [True: 651, False: 119]
  ------------------
 1829|    651|            seq_t *sequence = &(sequences[seqNb&STORED_SEQS_MASK]);
  ------------------
  |  | 1753|    651|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    651|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1830|    651|            if (dctx->litBufferLocation == ZSTD_split && litPtr + sequence->litLength > dctx->litBufferEnd) {
  ------------------
  |  Branch (1830:17): [True: 0, False: 651]
  |  Branch (1830:58): [True: 0, False: 0]
  ------------------
 1831|      0|                const size_t leftoverLit = dctx->litBufferEnd - litPtr;
 1832|      0|                if (leftoverLit) {
  ------------------
  |  Branch (1832:21): [True: 0, False: 0]
  ------------------
 1833|      0|                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer");
  ------------------
  |  |  114|      0|    do {                                                                       \
  |  |  115|      0|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1834|      0|                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);
 1835|      0|                    sequence->litLength -= leftoverLit;
 1836|      0|                    op += leftoverLit;
 1837|      0|                }
 1838|      0|                litPtr = dctx->litExtraBuffer;
 1839|      0|                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|      0|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|      0|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      0|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 0, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1840|      0|                dctx->litBufferLocation = ZSTD_not_in_dst;
 1841|      0|                {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
 1842|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1843|       |                    assert(!ZSTD_isError(oneSeqSize));
 1844|       |                    ZSTD_assertValidSequence(dctx, op, oend, sequences[seqNb&STORED_SEQS_MASK], prefixStart, dictStart);
 1845|       |#endif
 1846|      0|                    if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|      0|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1846:25): [True: 0, False: 0]
  ------------------
 1847|      0|                    op += oneSeqSize;
 1848|      0|                }
 1849|      0|            }
 1850|    651|            else
 1851|    651|            {
 1852|    651|                size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ?
  ------------------
  |  Branch (1852:43): [True: 0, False: 651]
  ------------------
 1853|      0|                    ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence->litLength - WILDCOPY_OVERLENGTH, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  |  199|      0|#define WILDCOPY_OVERLENGTH 32
  ------------------
 1854|    651|                    ZSTD_execSequence(op, oend, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
 1855|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1856|       |                assert(!ZSTD_isError(oneSeqSize));
 1857|       |                ZSTD_assertValidSequence(dctx, op, oend, sequences[seqNb&STORED_SEQS_MASK], prefixStart, dictStart);
 1858|       |#endif
 1859|    651|                if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|    651|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1859:21): [True: 81, False: 570]
  ------------------
 1860|    570|                op += oneSeqSize;
 1861|    570|            }
 1862|    651|        }
 1863|       |
 1864|       |        /* save reps for next block */
 1865|    476|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  |   64|    476|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1865:28): [True: 357, False: 119]
  ------------------
 1866|    119|    }
 1867|       |
 1868|       |    /* last literal segment */
 1869|    222|    if (dctx->litBufferLocation == ZSTD_split) { /* first deplete literal buffer in dst, then copy litExtraBuffer */
  ------------------
  |  Branch (1869:9): [True: 0, False: 222]
  ------------------
 1870|      0|        size_t const lastLLSize = litBufferEnd - litPtr;
 1871|      0|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend - op), dstSize_tooSmall, "");
  ------------------
  |  |  114|      0|    do {                                                                       \
  |  |  115|      0|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1872|      0|        if (op != NULL) {
  ------------------
  |  Branch (1872:13): [True: 0, False: 0]
  ------------------
 1873|      0|            ZSTD_memmove(op, litPtr, lastLLSize);
  ------------------
  |  |   45|      0|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1874|      0|            op += lastLLSize;
 1875|      0|        }
 1876|      0|        litPtr = dctx->litExtraBuffer;
 1877|      0|        litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|      0|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|      0|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      0|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 0, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1878|      0|    }
 1879|    222|    {   size_t const lastLLSize = litBufferEnd - litPtr;
 1880|    222|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, "");
  ------------------
  |  |  114|    222|    do {                                                                       \
  |  |  115|    222|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 5, False: 217]
  |  |  ------------------
  |  |  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|    222|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 217]
  |  |  ------------------
  ------------------
 1881|    217|        if (op != NULL) {
  ------------------
  |  Branch (1881:13): [True: 217, False: 0]
  ------------------
 1882|    217|            ZSTD_memmove(op, litPtr, lastLLSize);
  ------------------
  |  |   45|    217|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1883|    217|            op += lastLLSize;
 1884|    217|        }
 1885|    217|    }
 1886|       |
 1887|      0|    return (size_t)(op - ostart);
 1888|    222|}
zstd_decompress_block.c:ZSTD_initFseState:
 1193|  13.1k|{
 1194|  13.1k|    const void* ptr = dt;
 1195|  13.1k|    const ZSTD_seqSymbol_header* const DTableH = (const ZSTD_seqSymbol_header*)ptr;
 1196|  13.1k|    DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);
 1197|  13.1k|    DEBUGLOG(6, "ZSTD_initFseState : val=%u using %u bits",
  ------------------
  |  |  104|  13.1k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 13.1k]
  |  |  ------------------
  ------------------
 1198|  13.1k|                (U32)DStatePtr->state, DTableH->tableLog);
 1199|  13.1k|    BIT_reloadDStream(bitD);
 1200|  13.1k|    DStatePtr->table = dt + 1;
 1201|  13.1k|}
zstd_decompress_block.c:ZSTD_decodeSequence:
 1230|  5.43M|{
 1231|  5.43M|    seq_t seq;
 1232|       |    /*
 1233|       |     * ZSTD_seqSymbol is a 64 bits wide structure.
 1234|       |     * It can be loaded in one operation
 1235|       |     * and its fields extracted by simply shifting or bit-extracting on aarch64.
 1236|       |     * GCC doesn't recognize this and generates more unnecessary ldr/ldrb/ldrh
 1237|       |     * operations that cause performance drop. This can be avoided by using this
 1238|       |     * ZSTD_memcpy hack.
 1239|       |     */
 1240|       |#if defined(__aarch64__) && (defined(__GNUC__) && !defined(__clang__))
 1241|       |    ZSTD_seqSymbol llDInfoS, mlDInfoS, ofDInfoS;
 1242|       |    ZSTD_seqSymbol* const llDInfo = &llDInfoS;
 1243|       |    ZSTD_seqSymbol* const mlDInfo = &mlDInfoS;
 1244|       |    ZSTD_seqSymbol* const ofDInfo = &ofDInfoS;
 1245|       |    ZSTD_memcpy(llDInfo, seqState->stateLL.table + seqState->stateLL.state, sizeof(ZSTD_seqSymbol));
 1246|       |    ZSTD_memcpy(mlDInfo, seqState->stateML.table + seqState->stateML.state, sizeof(ZSTD_seqSymbol));
 1247|       |    ZSTD_memcpy(ofDInfo, seqState->stateOffb.table + seqState->stateOffb.state, sizeof(ZSTD_seqSymbol));
 1248|       |#else
 1249|  5.43M|    const ZSTD_seqSymbol* const llDInfo = seqState->stateLL.table + seqState->stateLL.state;
 1250|  5.43M|    const ZSTD_seqSymbol* const mlDInfo = seqState->stateML.table + seqState->stateML.state;
 1251|  5.43M|    const ZSTD_seqSymbol* const ofDInfo = seqState->stateOffb.table + seqState->stateOffb.state;
 1252|  5.43M|#endif
 1253|  5.43M|    seq.matchLength = mlDInfo->baseValue;
 1254|  5.43M|    seq.litLength = llDInfo->baseValue;
 1255|  5.43M|    {   U32 const ofBase = ofDInfo->baseValue;
 1256|  5.43M|        BYTE const llBits = llDInfo->nbAdditionalBits;
 1257|  5.43M|        BYTE const mlBits = mlDInfo->nbAdditionalBits;
 1258|  5.43M|        BYTE const ofBits = ofDInfo->nbAdditionalBits;
 1259|  5.43M|        BYTE const totalBits = llBits+mlBits+ofBits;
 1260|       |
 1261|  5.43M|        U16 const llNext = llDInfo->nextState;
 1262|  5.43M|        U16 const mlNext = mlDInfo->nextState;
 1263|  5.43M|        U16 const ofNext = ofDInfo->nextState;
 1264|  5.43M|        U32 const llnbBits = llDInfo->nbBits;
 1265|  5.43M|        U32 const mlnbBits = mlDInfo->nbBits;
 1266|  5.43M|        U32 const ofnbBits = ofDInfo->nbBits;
 1267|       |
 1268|  5.43M|        assert(llBits <= MaxLLBits);
  ------------------
  |  |   70|  5.43M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1269|  5.43M|        assert(mlBits <= MaxMLBits);
  ------------------
  |  |   70|  5.43M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1270|  5.43M|        assert(ofBits <= MaxOff);
  ------------------
  |  |   70|  5.43M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1271|       |        /*
 1272|       |         * As gcc has better branch and block analyzers, sometimes it is only
 1273|       |         * valuable to mark likeliness for clang, it gives around 3-4% of
 1274|       |         * performance.
 1275|       |         */
 1276|       |
 1277|       |        /* sequence */
 1278|  5.43M|        {   size_t offset;
 1279|  5.43M|            if (ofBits > 1) {
  ------------------
  |  Branch (1279:17): [True: 4.84M, False: 589k]
  ------------------
 1280|  4.84M|                ZSTD_STATIC_ASSERT(ZSTD_lo_isLongOffset == 1);
  ------------------
  |  |   43|  4.84M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  4.84M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1281|  4.84M|                ZSTD_STATIC_ASSERT(LONG_OFFSETS_MAX_EXTRA_BITS_32 == 5);
  ------------------
  |  |   43|  4.84M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  4.84M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1282|  4.84M|                ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 > LONG_OFFSETS_MAX_EXTRA_BITS_32);
  ------------------
  |  |   43|  4.84M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  4.84M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1283|  4.84M|                ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 - LONG_OFFSETS_MAX_EXTRA_BITS_32 >= MaxMLBits);
  ------------------
  |  |   43|  4.84M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  4.84M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1284|  4.84M|                if (MEM_32bits() && longOffsets && (ofBits >= STREAM_ACCUMULATOR_MIN_32)) {
  ------------------
  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  ------------------
  |  Branch (1284:21): [True: 0, False: 4.84M]
  |  Branch (1284:37): [True: 0, False: 0]
  |  Branch (1284:52): [True: 0, False: 0]
  ------------------
 1285|       |                    /* Always read extra bits, this keeps the logic simple,
 1286|       |                     * avoids branches, and avoids accidentally reading 0 bits.
 1287|       |                     */
 1288|      0|                    U32 const extraBits = LONG_OFFSETS_MAX_EXTRA_BITS_32;
  ------------------
  |  | 1216|      0|    (ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32       \
  |  |  ------------------
  |  |  |  | 1263|      0|#define ZSTD_WINDOWLOG_MAX_32    30
  |  |  ------------------
  |  |                   (ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32       \
  |  |  ------------------
  |  |  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  |  |  ------------------
  |  |  |  Branch (1216:6): [True: 0, Folded]
  |  |  ------------------
  |  | 1217|      0|        ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32  \
  |  |  ------------------
  |  |  |  | 1263|      0|#define ZSTD_WINDOWLOG_MAX_32    30
  |  |  ------------------
  |  |                       ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32  \
  |  |  ------------------
  |  |  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  |  |  ------------------
  |  | 1218|      0|        : 0)
  ------------------
 1289|      0|                    offset = ofBase + (BIT_readBitsFast(&seqState->DStream, ofBits - extraBits) << extraBits);
 1290|      0|                    BIT_reloadDStream(&seqState->DStream);
 1291|      0|                    offset += BIT_readBitsFast(&seqState->DStream, extraBits);
 1292|  4.84M|                } else {
 1293|  4.84M|                    offset = ofBase + BIT_readBitsFast(&seqState->DStream, ofBits/*>0*/);   /* <=  (ZSTD_WINDOWLOG_MAX-1) bits */
 1294|  4.84M|                    if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);
  ------------------
  |  Branch (1294:25): [True: 0, False: 4.84M]
  ------------------
 1295|  4.84M|                }
 1296|  4.84M|                seqState->prevOffset[2] = seqState->prevOffset[1];
 1297|  4.84M|                seqState->prevOffset[1] = seqState->prevOffset[0];
 1298|  4.84M|                seqState->prevOffset[0] = offset;
 1299|  4.84M|            } else {
 1300|   589k|                U32 const ll0 = (llDInfo->baseValue == 0);
 1301|   589k|                if (LIKELY((ofBits == 0))) {
  ------------------
  |  |  187|   589k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 496k, False: 92.7k]
  |  |  ------------------
  ------------------
 1302|   496k|                    offset = seqState->prevOffset[ll0];
 1303|   496k|                    seqState->prevOffset[1] = seqState->prevOffset[!ll0];
 1304|   496k|                    seqState->prevOffset[0] = offset;
 1305|   496k|                } else {
 1306|  92.7k|                    offset = ofBase + ll0 + BIT_readBitsFast(&seqState->DStream, 1);
 1307|  92.7k|                    {   size_t temp = (offset==3) ? seqState->prevOffset[0] - 1 : seqState->prevOffset[offset];
  ------------------
  |  Branch (1307:39): [True: 17.8k, False: 74.9k]
  ------------------
 1308|  92.7k|                        temp -= !temp; /* 0 is not valid: input corrupted => force offset to -1 => corruption detected at execSequence */
 1309|  92.7k|                        if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1];
  ------------------
  |  Branch (1309:29): [True: 67.7k, False: 25.0k]
  ------------------
 1310|  92.7k|                        seqState->prevOffset[1] = seqState->prevOffset[0];
 1311|  92.7k|                        seqState->prevOffset[0] = offset = temp;
 1312|  92.7k|            }   }   }
 1313|  5.43M|            seq.offset = offset;
 1314|  5.43M|        }
 1315|       |
 1316|  5.43M|        if (mlBits > 0)
  ------------------
  |  Branch (1316:13): [True: 43.6k, False: 5.38M]
  ------------------
 1317|  43.6k|            seq.matchLength += BIT_readBitsFast(&seqState->DStream, mlBits/*>0*/);
 1318|       |
 1319|  5.43M|        if (MEM_32bits() && (mlBits+llBits >= STREAM_ACCUMULATOR_MIN_32-LONG_OFFSETS_MAX_EXTRA_BITS_32))
  ------------------
  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  ------------------
                      if (MEM_32bits() && (mlBits+llBits >= STREAM_ACCUMULATOR_MIN_32-LONG_OFFSETS_MAX_EXTRA_BITS_32))
  ------------------
  |  | 1216|      0|    (ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32       \
  |  |  ------------------
  |  |  |  | 1263|      0|#define ZSTD_WINDOWLOG_MAX_32    30
  |  |  ------------------
  |  |                   (ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32       \
  |  |  ------------------
  |  |  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  |  |  ------------------
  |  |  |  Branch (1216:6): [True: 0, Folded]
  |  |  ------------------
  |  | 1217|      0|        ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32  \
  |  |  ------------------
  |  |  |  | 1263|      0|#define ZSTD_WINDOWLOG_MAX_32    30
  |  |  ------------------
  |  |                       ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32  \
  |  |  ------------------
  |  |  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  |  |  ------------------
  |  | 1218|      0|        : 0)
  ------------------
  |  Branch (1319:13): [True: 0, False: 5.43M]
  |  Branch (1319:29): [True: 0, False: 0]
  ------------------
 1320|      0|            BIT_reloadDStream(&seqState->DStream);
 1321|  5.43M|        if (MEM_64bits() && UNLIKELY(totalBits >= STREAM_ACCUMULATOR_MIN_64-(LLFSELog+MLFSELog+OffFSELog)))
  ------------------
  |  |  188|  5.43M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 693, False: 5.43M]
  |  |  ------------------
  ------------------
  |  Branch (1321:13): [True: 5.43M, False: 0]
  ------------------
 1322|    693|            BIT_reloadDStream(&seqState->DStream);
 1323|       |        /* Ensure there are enough bits to read the rest of data in 64-bit mode. */
 1324|  5.43M|        ZSTD_STATIC_ASSERT(16+LLFSELog+MLFSELog+OffFSELog < STREAM_ACCUMULATOR_MIN_64);
  ------------------
  |  |   43|  5.43M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  5.43M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1325|       |
 1326|  5.43M|        if (llBits > 0)
  ------------------
  |  Branch (1326:13): [True: 64.9k, False: 5.36M]
  ------------------
 1327|  64.9k|            seq.litLength += BIT_readBitsFast(&seqState->DStream, llBits/*>0*/);
 1328|       |
 1329|  5.43M|        if (MEM_32bits())
  ------------------
  |  Branch (1329:13): [True: 0, False: 5.43M]
  ------------------
 1330|      0|            BIT_reloadDStream(&seqState->DStream);
 1331|       |
 1332|  5.43M|        DEBUGLOG(6, "seq: litL=%u, matchL=%u, offset=%u",
  ------------------
  |  |  104|  5.43M|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 5.43M]
  |  |  ------------------
  ------------------
 1333|  5.43M|                    (U32)seq.litLength, (U32)seq.matchLength, (U32)seq.offset);
 1334|       |
 1335|  5.43M|        if (!isLastSeq) {
  ------------------
  |  Branch (1335:13): [True: 5.43M, False: 2.65k]
  ------------------
 1336|       |            /* don't update FSE state for last Sequence */
 1337|  5.43M|            ZSTD_updateFseStateWithDInfo(&seqState->stateLL, &seqState->DStream, llNext, llnbBits);    /* <=  9 bits */
 1338|  5.43M|            ZSTD_updateFseStateWithDInfo(&seqState->stateML, &seqState->DStream, mlNext, mlnbBits);    /* <=  9 bits */
 1339|  5.43M|            if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);    /* <= 18 bits */
  ------------------
  |  Branch (1339:17): [True: 0, False: 5.43M]
  ------------------
 1340|  5.43M|            ZSTD_updateFseStateWithDInfo(&seqState->stateOffb, &seqState->DStream, ofNext, ofnbBits);  /* <=  8 bits */
 1341|  5.43M|            BIT_reloadDStream(&seqState->DStream);
 1342|  5.43M|        }
 1343|  5.43M|    }
 1344|       |
 1345|  5.43M|    return seq;
 1346|  5.43M|}
zstd_decompress_block.c:ZSTD_updateFseStateWithDInfo:
 1205|  16.2M|{
 1206|  16.2M|    size_t const lowBits = BIT_readBits(bitD, nbBits);
 1207|  16.2M|    DStatePtr->state = nextState + lowBits;
 1208|  16.2M|}
zstd_decompress_block.c:ZSTD_prefetchMatch:
 1717|  2.42M|{
 1718|  2.42M|    prefetchPos += sequence.litLength;
 1719|  2.42M|    {   const BYTE* const matchBase = (sequence.offset > prefetchPos) ? dictEnd : prefixStart;
  ------------------
  |  Branch (1719:39): [True: 10.1k, False: 2.41M]
  ------------------
 1720|       |        /* note : this operation can overflow when seq.offset is really too large, which can only happen when input is corrupted.
 1721|       |         * No consequence though : memory address is only used for prefetching, not for dereferencing */
 1722|  2.42M|        const BYTE* const match = ZSTD_wrappedPtrSub(ZSTD_wrappedPtrAdd(matchBase, prefetchPos), sequence.offset);
 1723|  2.42M|        PREFETCH_L1(match); PREFETCH_L1(match+CACHELINE_SIZE);   /* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */
  ------------------
  |  |  145|  2.42M|#    define PREFETCH_L1(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */)
  ------------------
                      PREFETCH_L1(match); PREFETCH_L1(match+CACHELINE_SIZE);   /* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */
  ------------------
  |  |  145|  2.42M|#    define PREFETCH_L1(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */)
  ------------------
 1724|  2.42M|    }
 1725|  2.42M|    return prefetchPos + sequence.matchLength;
 1726|  2.42M|}
zstd_decompress_block.c:ZSTD_safecopyDstBeforeSrc:
  877|  64.4k|static void ZSTD_safecopyDstBeforeSrc(BYTE* op, const BYTE* ip, ptrdiff_t length) {
  878|  64.4k|    ptrdiff_t const diff = op - ip;
  879|  64.4k|    BYTE* const oend = op + length;
  880|       |
  881|  64.4k|    if (length < 8 || diff > -8) {
  ------------------
  |  Branch (881:9): [True: 59.8k, False: 4.60k]
  |  Branch (881:23): [True: 4.05k, False: 546]
  ------------------
  882|       |        /* Handle short lengths, close overlaps, and dst not before src. */
  883|   384k|        while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (883:16): [True: 320k, False: 63.8k]
  ------------------
  884|  63.8k|        return;
  885|  63.8k|    }
  886|       |
  887|    546|    if (op <= oend - WILDCOPY_OVERLENGTH && diff < -WILDCOPY_VECLEN) {
  ------------------
  |  |  199|  1.09k|#define WILDCOPY_OVERLENGTH 32
  ------------------
                  if (op <= oend - WILDCOPY_OVERLENGTH && diff < -WILDCOPY_VECLEN) {
  ------------------
  |  |  200|    385|#define WILDCOPY_VECLEN 16
  ------------------
  |  Branch (887:9): [True: 385, False: 161]
  |  Branch (887:45): [True: 340, False: 45]
  ------------------
  888|    340|        ZSTD_wildcopy(op, ip, oend - WILDCOPY_OVERLENGTH - op, ZSTD_no_overlap);
  ------------------
  |  |  199|    340|#define WILDCOPY_OVERLENGTH 32
  ------------------
  889|    340|        ip += oend - WILDCOPY_OVERLENGTH - op;
  ------------------
  |  |  199|    340|#define WILDCOPY_OVERLENGTH 32
  ------------------
  890|    340|        op += oend - WILDCOPY_OVERLENGTH - op;
  ------------------
  |  |  199|    340|#define WILDCOPY_OVERLENGTH 32
  ------------------
  891|    340|    }
  892|       |
  893|       |    /* Handle the leftovers. */
  894|  80.4k|    while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (894:12): [True: 79.8k, False: 546]
  ------------------
  895|    546|}
zstd_decompress_block.c:ZSTD_execSequence:
 1005|   566k|{
 1006|   566k|    BYTE* const oLitEnd = op + sequence.litLength;
 1007|   566k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 1008|   566k|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 1009|   566k|    BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;   /* risk : address space underflow on oend=NULL */
  ------------------
  |  |  199|   566k|#define WILDCOPY_OVERLENGTH 32
  ------------------
 1010|   566k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 1011|   566k|    const BYTE* match = oLitEnd - sequence.offset;
 1012|       |
 1013|   566k|    assert(op != NULL /* Precondition */);
  ------------------
  |  |   70|   566k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1014|   566k|    assert(oend_w < oend /* No underflow */);
  ------------------
  |  |   70|   566k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1015|       |
 1016|       |#if defined(__aarch64__)
 1017|       |    /* prefetch sequence starting from match that will be used for copy later */
 1018|       |    PREFETCH_L1(match);
 1019|       |#endif
 1020|       |    /* Handle edge cases in a slow path:
 1021|       |     *   - Read beyond end of literals
 1022|       |     *   - Match end is within WILDCOPY_OVERLIMIT of oend
 1023|       |     *   - 32-bit mode and the match length overflows
 1024|       |     */
 1025|   566k|    if (UNLIKELY(
  ------------------
  |  |  188|  2.81M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 6.02k, False: 560k]
  |  |  |  Branch (188:40): [True: 344, False: 565k]
  |  |  |  Branch (188:40): [True: 5.68k, False: 560k]
  |  |  |  Branch (188:40): [True: 0, False: 560k]
  |  |  |  Branch (188:40): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1026|   566k|        iLitEnd > litLimit ||
 1027|   566k|        oMatchEnd > oend_w ||
 1028|   566k|        (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH)))
 1029|  6.02k|        return ZSTD_execSequenceEnd(op, oend, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd);
 1030|       |
 1031|       |    /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */
 1032|   560k|    assert(op <= oLitEnd /* No overflow */);
  ------------------
  |  |   70|   560k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1033|   560k|    assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */);
  ------------------
  |  |   70|   560k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1034|   560k|    assert(oMatchEnd <= oend /* No underflow */);
  ------------------
  |  |   70|   560k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1035|   560k|    assert(iLitEnd <= litLimit /* Literal length is in bounds */);
  ------------------
  |  |   70|   560k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1036|   560k|    assert(oLitEnd <= oend_w /* Can wildcopy literals */);
  ------------------
  |  |   70|   560k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1037|   560k|    assert(oMatchEnd <= oend_w /* Can wildcopy matches */);
  ------------------
  |  |   70|   560k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1038|       |
 1039|       |    /* Copy Literals:
 1040|       |     * Split out litLength <= 16 since it is nearly always true. +1.6% on gcc-9.
 1041|       |     * We likely don't need the full 32-byte wildcopy.
 1042|       |     */
 1043|   560k|    assert(WILDCOPY_OVERLENGTH >= 16);
  ------------------
  |  |   70|   560k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1044|   560k|    ZSTD_copy16(op, (*litPtr));
 1045|   560k|    if (UNLIKELY(sequence.litLength > 16)) {
  ------------------
  |  |  188|   560k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 17.0k, False: 543k]
  |  |  ------------------
  ------------------
 1046|  17.0k|        ZSTD_wildcopy(op + 16, (*litPtr) + 16, sequence.litLength - 16, ZSTD_no_overlap);
 1047|  17.0k|    }
 1048|   560k|    op = oLitEnd;
 1049|   560k|    *litPtr = iLitEnd;   /* update for next sequence */
 1050|       |
 1051|       |    /* Copy Match */
 1052|   560k|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (1052:9): [True: 2.39k, False: 557k]
  ------------------
 1053|       |        /* offset beyond prefix -> go into extDict */
 1054|  2.39k|        RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected, "");
  ------------------
  |  |  114|  2.39k|    do {                                                                       \
  |  |  115|  2.39k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 420, False: 1.97k]
  |  |  ------------------
  |  |  116|    420|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    420|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 420]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    420|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    420|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    420|    do {                                           \
  |  |  |  |   99|    420|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 420]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    420|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 420]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    420|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    420|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 420]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    420|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    420|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 420]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    420|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    420|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    420|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    420|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    420|        }                                                                      \
  |  |  123|  2.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.97k]
  |  |  ------------------
  ------------------
 1055|  1.97k|        match = dictEnd + (match - prefixStart);
 1056|  1.97k|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (1056:13): [True: 1.75k, False: 213]
  ------------------
 1057|  1.75k|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|  1.75k|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1058|  1.75k|            return sequenceLength;
 1059|  1.75k|        }
 1060|       |        /* span extDict & currentPrefixSegment */
 1061|    213|        {   size_t const length1 = dictEnd - match;
 1062|    213|        ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|    213|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1063|    213|        op = oLitEnd + length1;
 1064|    213|        sequence.matchLength -= length1;
 1065|    213|        match = prefixStart;
 1066|    213|        }
 1067|    213|    }
 1068|       |    /* Match within prefix of 1 or more bytes */
 1069|   558k|    assert(op <= oMatchEnd);
  ------------------
  |  |   70|   558k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1070|   558k|    assert(oMatchEnd <= oend_w);
  ------------------
  |  |   70|   558k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1071|   558k|    assert(match >= prefixStart);
  ------------------
  |  |   70|   558k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1072|   558k|    assert(sequence.matchLength >= 1);
  ------------------
  |  |   70|   558k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1073|       |
 1074|       |    /* Nearly all offsets are >= WILDCOPY_VECLEN bytes, which means we can use wildcopy
 1075|       |     * without overlap checking.
 1076|       |     */
 1077|   558k|    if (LIKELY(sequence.offset >= WILDCOPY_VECLEN)) {
  ------------------
  |  |  187|   558k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 406k, False: 151k]
  |  |  ------------------
  ------------------
 1078|       |        /* We bet on a full wildcopy for matches, since we expect matches to be
 1079|       |         * longer than literals (in general). In silesia, ~10% of matches are longer
 1080|       |         * than 16 bytes.
 1081|       |         */
 1082|   406k|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength, ZSTD_no_overlap);
 1083|   406k|        return sequenceLength;
 1084|   406k|    }
 1085|   151k|    assert(sequence.offset < WILDCOPY_VECLEN);
  ------------------
  |  |   70|   151k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1086|       |
 1087|       |    /* Copy 8 bytes and spread the offset to be >= 8. */
 1088|   151k|    ZSTD_overlapCopy8(&op, &match, sequence.offset);
 1089|       |
 1090|       |    /* If the match length is > 8 bytes, then continue with the wildcopy. */
 1091|   151k|    if (sequence.matchLength > 8) {
  ------------------
  |  Branch (1091:9): [True: 15.2k, False: 136k]
  ------------------
 1092|  15.2k|        assert(op < oMatchEnd);
  ------------------
  |  |   70|  15.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1093|  15.2k|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength - 8, ZSTD_overlap_src_before_dst);
 1094|  15.2k|    }
 1095|   151k|    return sequenceLength;
 1096|   558k|}
zstd_decompress_block.c:ZSTD_execSequenceEnd:
  911|  6.02k|{
  912|  6.02k|    BYTE* const oLitEnd = op + sequence.litLength;
  913|  6.02k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
  914|  6.02k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
  915|  6.02k|    const BYTE* match = oLitEnd - sequence.offset;
  916|  6.02k|    BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|  6.02k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  917|       |
  918|       |    /* bounds checks : careful of address space overflow in 32-bit mode */
  919|  6.02k|    RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, "last match must fit within dstBuffer");
  ------------------
  |  |  114|  6.02k|    do {                                                                       \
  |  |  115|  6.02k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 898, False: 5.12k]
  |  |  ------------------
  |  |  116|    898|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    898|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 898]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    898|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    898|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    898|    do {                                           \
  |  |  |  |   99|    898|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 898]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    898|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 898]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    898|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    898|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 898]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    898|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    898|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 898]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    898|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    898|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    898|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    898|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    898|        }                                                                      \
  |  |  123|  6.02k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.12k]
  |  |  ------------------
  ------------------
  920|  5.12k|    RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, "try to read beyond literal buffer");
  ------------------
  |  |  114|  5.12k|    do {                                                                       \
  |  |  115|  5.12k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 90, False: 5.03k]
  |  |  ------------------
  |  |  116|     90|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     90|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 90]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     90|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     90|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     90|    do {                                           \
  |  |  |  |   99|     90|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 90]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     90|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 90]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     90|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     90|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 90]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     90|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     90|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 90]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     90|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     90|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     90|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     90|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     90|        }                                                                      \
  |  |  123|  5.12k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.03k]
  |  |  ------------------
  ------------------
  921|  5.03k|    assert(op < op + sequenceLength);
  ------------------
  |  |   70|  5.03k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  922|  5.03k|    assert(oLitEnd < op + sequenceLength);
  ------------------
  |  |   70|  5.03k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  923|       |
  924|       |    /* copy literals */
  925|  5.03k|    ZSTD_safecopy(op, oend_w, *litPtr, sequence.litLength, ZSTD_no_overlap);
  926|  5.03k|    op = oLitEnd;
  927|  5.03k|    *litPtr = iLitEnd;
  928|       |
  929|       |    /* copy Match */
  930|  5.03k|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (930:9): [True: 509, False: 4.52k]
  ------------------
  931|       |        /* offset beyond prefix */
  932|    509|        RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, "");
  ------------------
  |  |  114|    509|    do {                                                                       \
  |  |  115|    509|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 159, False: 350]
  |  |  ------------------
  |  |  116|    159|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    159|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 159]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    159|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    159|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    159|    do {                                           \
  |  |  |  |   99|    159|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 159]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    159|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 159]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    159|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    159|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 159]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    159|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    159|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 159]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    159|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    159|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    159|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    159|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    159|        }                                                                      \
  |  |  123|    509|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 350]
  |  |  ------------------
  ------------------
  933|    350|        match = dictEnd - (prefixStart - match);
  934|    350|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (934:13): [True: 207, False: 143]
  ------------------
  935|    207|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|    207|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  936|    207|            return sequenceLength;
  937|    207|        }
  938|       |        /* span extDict & currentPrefixSegment */
  939|    143|        {   size_t const length1 = dictEnd - match;
  940|    143|        ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|    143|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  941|    143|        op = oLitEnd + length1;
  942|    143|        sequence.matchLength -= length1;
  943|    143|        match = prefixStart;
  944|    143|        }
  945|    143|    }
  946|  4.67k|    ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst);
  947|  4.67k|    return sequenceLength;
  948|  5.03k|}
zstd_decompress_block.c:ZSTD_safecopy:
  837|  73.5k|static void ZSTD_safecopy(BYTE* op, const BYTE* const oend_w, BYTE const* ip, ptrdiff_t length, ZSTD_overlap_e ovtype) {
  838|  73.5k|    ptrdiff_t const diff = op - ip;
  839|  73.5k|    BYTE* const oend = op + length;
  840|       |
  841|  73.5k|    assert((ovtype == ZSTD_no_overlap && (diff <= -8 || diff >= 8 || op >= oend_w)) ||
  ------------------
  |  |   70|  73.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  842|  73.5k|           (ovtype == ZSTD_overlap_src_before_dst && diff >= 0));
  843|       |
  844|  73.5k|    if (length < 8) {
  ------------------
  |  Branch (844:9): [True: 43.8k, False: 29.7k]
  ------------------
  845|       |        /* Handle short lengths. */
  846|   205k|        while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (846:16): [True: 161k, False: 43.8k]
  ------------------
  847|  43.8k|        return;
  848|  43.8k|    }
  849|  29.7k|    if (ovtype == ZSTD_overlap_src_before_dst) {
  ------------------
  |  Branch (849:9): [True: 28.5k, False: 1.15k]
  ------------------
  850|       |        /* Copy 8 bytes and ensure the offset >= 8 when there can be overlap. */
  851|  28.5k|        assert(length >= 8);
  ------------------
  |  |   70|  28.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  852|  28.5k|        ZSTD_overlapCopy8(&op, &ip, diff);
  853|  28.5k|        length -= 8;
  854|  28.5k|        assert(op - ip >= 8);
  ------------------
  |  |   70|  28.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  855|  28.5k|        assert(op <= oend);
  ------------------
  |  |   70|  28.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  856|  28.5k|    }
  857|       |
  858|  29.7k|    if (oend <= oend_w) {
  ------------------
  |  Branch (858:9): [True: 57, False: 29.6k]
  ------------------
  859|       |        /* No risk of overwrite. */
  860|     57|        ZSTD_wildcopy(op, ip, length, ovtype);
  861|     57|        return;
  862|     57|    }
  863|  29.6k|    if (op <= oend_w) {
  ------------------
  |  Branch (863:9): [True: 529, False: 29.1k]
  ------------------
  864|       |        /* Wildcopy until we get close to the end. */
  865|    529|        assert(oend > oend_w);
  ------------------
  |  |   70|    529|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  866|    529|        ZSTD_wildcopy(op, ip, oend_w - op, ovtype);
  867|    529|        ip += oend_w - op;
  868|    529|        op += oend_w - op;
  869|    529|    }
  870|       |    /* Handle the leftovers. */
  871|  1.69M|    while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (871:12): [True: 1.66M, False: 29.6k]
  ------------------
  872|  29.6k|}
zstd_decompress_block.c:ZSTD_overlapCopy8:
  804|  1.91M|HINT_INLINE void ZSTD_overlapCopy8(BYTE** op, BYTE const** ip, size_t offset) {
  805|  1.91M|    assert(*ip <= *op);
  ------------------
  |  |   70|  1.91M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  806|  1.91M|    if (offset < 8) {
  ------------------
  |  Branch (806:9): [True: 872k, False: 1.04M]
  ------------------
  807|       |        /* close range match, overlap */
  808|   872k|        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
  809|   872k|        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
  810|   872k|        int const sub2 = dec64table[offset];
  811|   872k|        (*op)[0] = (*ip)[0];
  812|   872k|        (*op)[1] = (*ip)[1];
  813|   872k|        (*op)[2] = (*ip)[2];
  814|   872k|        (*op)[3] = (*ip)[3];
  815|   872k|        *ip += dec32table[offset];
  816|   872k|        ZSTD_copy4(*op+4, *ip);
  817|   872k|        *ip -= sub2;
  818|  1.04M|    } else {
  819|  1.04M|        ZSTD_copy8(*op, *ip);
  820|  1.04M|    }
  821|  1.91M|    *ip += 8;
  822|  1.91M|    *op += 8;
  823|  1.91M|    assert(*op - *ip >= 8);
  ------------------
  |  |   70|  1.91M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  824|  1.91M|}
zstd_decompress_block.c:ZSTD_copy4:
   47|   872k|static void ZSTD_copy4(void* dst, const void* src) { ZSTD_memcpy(dst, src, 4); }
  ------------------
  |  |   44|   872k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
zstd_decompress_block.c:ZSTD_execSequenceSplitLitBuffer:
 1104|  4.86M|{
 1105|  4.86M|    BYTE* const oLitEnd = op + sequence.litLength;
 1106|  4.86M|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 1107|  4.86M|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 1108|  4.86M|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 1109|  4.86M|    const BYTE* match = oLitEnd - sequence.offset;
 1110|       |
 1111|  4.86M|    assert(op != NULL /* Precondition */);
  ------------------
  |  |   70|  4.86M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1112|  4.86M|    assert(oend_w < oend /* No underflow */);
  ------------------
  |  |   70|  4.86M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1113|       |    /* Handle edge cases in a slow path:
 1114|       |     *   - Read beyond end of literals
 1115|       |     *   - Match end is within WILDCOPY_OVERLIMIT of oend
 1116|       |     *   - 32-bit mode and the match length overflows
 1117|       |     */
 1118|  4.86M|    if (UNLIKELY(
  ------------------
  |  |  188|  24.1M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 64.0k, False: 4.79M]
  |  |  |  Branch (188:40): [True: 0, False: 4.86M]
  |  |  |  Branch (188:40): [True: 64.0k, False: 4.79M]
  |  |  |  Branch (188:40): [True: 0, False: 4.79M]
  |  |  |  Branch (188:40): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1119|  4.86M|            iLitEnd > litLimit ||
 1120|  4.86M|            oMatchEnd > oend_w ||
 1121|  4.86M|            (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH)))
 1122|  64.0k|        return ZSTD_execSequenceEndSplitLitBuffer(op, oend, oend_w, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd);
 1123|       |
 1124|       |    /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */
 1125|  4.79M|    assert(op <= oLitEnd /* No overflow */);
  ------------------
  |  |   70|  4.79M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1126|  4.79M|    assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */);
  ------------------
  |  |   70|  4.79M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1127|  4.79M|    assert(oMatchEnd <= oend /* No underflow */);
  ------------------
  |  |   70|  4.79M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1128|  4.79M|    assert(iLitEnd <= litLimit /* Literal length is in bounds */);
  ------------------
  |  |   70|  4.79M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1129|  4.79M|    assert(oLitEnd <= oend_w /* Can wildcopy literals */);
  ------------------
  |  |   70|  4.79M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1130|  4.79M|    assert(oMatchEnd <= oend_w /* Can wildcopy matches */);
  ------------------
  |  |   70|  4.79M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1131|       |
 1132|       |    /* Copy Literals:
 1133|       |     * Split out litLength <= 16 since it is nearly always true. +1.6% on gcc-9.
 1134|       |     * We likely don't need the full 32-byte wildcopy.
 1135|       |     */
 1136|  4.79M|    assert(WILDCOPY_OVERLENGTH >= 16);
  ------------------
  |  |   70|  4.79M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1137|  4.79M|    ZSTD_copy16(op, (*litPtr));
 1138|  4.79M|    if (UNLIKELY(sequence.litLength > 16)) {
  ------------------
  |  |  188|  4.79M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 40.2k, False: 4.75M]
  |  |  ------------------
  ------------------
 1139|  40.2k|        ZSTD_wildcopy(op+16, (*litPtr)+16, sequence.litLength-16, ZSTD_no_overlap);
 1140|  40.2k|    }
 1141|  4.79M|    op = oLitEnd;
 1142|  4.79M|    *litPtr = iLitEnd;   /* update for next sequence */
 1143|       |
 1144|       |    /* Copy Match */
 1145|  4.79M|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (1145:9): [True: 7.02k, False: 4.78M]
  ------------------
 1146|       |        /* offset beyond prefix -> go into extDict */
 1147|  7.02k|        RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected, "");
  ------------------
  |  |  114|  7.02k|    do {                                                                       \
  |  |  115|  7.02k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 84, False: 6.93k]
  |  |  ------------------
  |  |  116|     84|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     84|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 84]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     84|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     84|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     84|    do {                                           \
  |  |  |  |   99|     84|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 84]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     84|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 84]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     84|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     84|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 84]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     84|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     84|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 84]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     84|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     84|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     84|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     84|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     84|        }                                                                      \
  |  |  123|  7.02k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 6.93k]
  |  |  ------------------
  ------------------
 1148|  6.93k|        match = dictEnd + (match - prefixStart);
 1149|  6.93k|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (1149:13): [True: 6.83k, False: 100]
  ------------------
 1150|  6.83k|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|  6.83k|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1151|  6.83k|            return sequenceLength;
 1152|  6.83k|        }
 1153|       |        /* span extDict & currentPrefixSegment */
 1154|    100|        {   size_t const length1 = dictEnd - match;
 1155|    100|            ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|    100|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1156|    100|            op = oLitEnd + length1;
 1157|    100|            sequence.matchLength -= length1;
 1158|    100|            match = prefixStart;
 1159|    100|    }   }
 1160|       |    /* Match within prefix of 1 or more bytes */
 1161|  4.78M|    assert(op <= oMatchEnd);
  ------------------
  |  |   70|  4.78M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1162|  4.78M|    assert(oMatchEnd <= oend_w);
  ------------------
  |  |   70|  4.78M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1163|  4.78M|    assert(match >= prefixStart);
  ------------------
  |  |   70|  4.78M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1164|  4.78M|    assert(sequence.matchLength >= 1);
  ------------------
  |  |   70|  4.78M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1165|       |
 1166|       |    /* Nearly all offsets are >= WILDCOPY_VECLEN bytes, which means we can use wildcopy
 1167|       |     * without overlap checking.
 1168|       |     */
 1169|  4.78M|    if (LIKELY(sequence.offset >= WILDCOPY_VECLEN)) {
  ------------------
  |  |  187|  4.78M|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 3.05M, False: 1.73M]
  |  |  ------------------
  ------------------
 1170|       |        /* We bet on a full wildcopy for matches, since we expect matches to be
 1171|       |         * longer than literals (in general). In silesia, ~10% of matches are longer
 1172|       |         * than 16 bytes.
 1173|       |         */
 1174|  3.05M|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength, ZSTD_no_overlap);
 1175|  3.05M|        return sequenceLength;
 1176|  3.05M|    }
 1177|  1.73M|    assert(sequence.offset < WILDCOPY_VECLEN);
  ------------------
  |  |   70|  1.73M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1178|       |
 1179|       |    /* Copy 8 bytes and spread the offset to be >= 8. */
 1180|  1.73M|    ZSTD_overlapCopy8(&op, &match, sequence.offset);
 1181|       |
 1182|       |    /* If the match length is > 8 bytes, then continue with the wildcopy. */
 1183|  1.73M|    if (sequence.matchLength > 8) {
  ------------------
  |  Branch (1183:9): [True: 209k, False: 1.52M]
  ------------------
 1184|   209k|        assert(op < oMatchEnd);
  ------------------
  |  |   70|   209k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1185|   209k|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8, ZSTD_overlap_src_before_dst);
 1186|   209k|    }
 1187|  1.73M|    return sequenceLength;
 1188|  4.78M|}
zstd_decompress_block.c:ZSTD_execSequenceEndSplitLitBuffer:
  959|  64.0k|{
  960|  64.0k|    BYTE* const oLitEnd = op + sequence.litLength;
  961|  64.0k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
  962|  64.0k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
  963|  64.0k|    const BYTE* match = oLitEnd - sequence.offset;
  964|       |
  965|       |
  966|       |    /* bounds checks : careful of address space overflow in 32-bit mode */
  967|  64.0k|    RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, "last match must fit within dstBuffer");
  ------------------
  |  |  114|  64.0k|    do {                                                                       \
  |  |  115|  64.0k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 126, False: 63.9k]
  |  |  ------------------
  |  |  116|    126|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    126|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 126]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    126|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    126|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    126|    do {                                           \
  |  |  |  |   99|    126|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 126]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    126|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 126]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    126|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    126|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 126]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    126|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    126|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 126]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    126|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    126|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    126|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    126|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    126|        }                                                                      \
  |  |  123|  64.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 63.9k]
  |  |  ------------------
  ------------------
  968|  63.9k|    RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, "try to read beyond literal buffer");
  ------------------
  |  |  114|  63.9k|    do {                                                                       \
  |  |  115|  63.9k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 63.9k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  63.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 63.9k]
  |  |  ------------------
  ------------------
  969|  63.9k|    assert(op < op + sequenceLength);
  ------------------
  |  |   70|  63.9k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  970|  63.9k|    assert(oLitEnd < op + sequenceLength);
  ------------------
  |  |   70|  63.9k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  971|       |
  972|       |    /* copy literals */
  973|  63.9k|    RETURN_ERROR_IF(op > *litPtr && op < *litPtr + sequence.litLength, dstSize_tooSmall, "output should not catch up to and overwrite literal buffer");
  ------------------
  |  |  114|  63.9k|    do {                                                                       \
  |  |  115|   190k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 62.6k, False: 1.30k]
  |  |  |  Branch (115:13): [True: 20, False: 62.6k]
  |  |  ------------------
  |  |  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|  63.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 63.9k]
  |  |  ------------------
  ------------------
  974|  63.9k|    ZSTD_safecopyDstBeforeSrc(op, *litPtr, sequence.litLength);
  975|  63.9k|    op = oLitEnd;
  976|  63.9k|    *litPtr = iLitEnd;
  977|       |
  978|       |    /* copy Match */
  979|  63.9k|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (979:9): [True: 122, False: 63.8k]
  ------------------
  980|       |        /* offset beyond prefix */
  981|    122|        RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, "");
  ------------------
  |  |  114|    122|    do {                                                                       \
  |  |  115|    122|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 60, False: 62]
  |  |  ------------------
  |  |  116|     60|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     60|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     60|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     60|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     60|    do {                                           \
  |  |  |  |   99|     60|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 60]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     60|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     60|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     60|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     60|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     60|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     60|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     60|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     60|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     60|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     60|        }                                                                      \
  |  |  123|    122|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 62]
  |  |  ------------------
  ------------------
  982|     62|        match = dictEnd - (prefixStart - match);
  983|     62|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (983:13): [True: 58, False: 4]
  ------------------
  984|     58|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|     58|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  985|     58|            return sequenceLength;
  986|     58|        }
  987|       |        /* span extDict & currentPrefixSegment */
  988|      4|        {   size_t const length1 = dictEnd - match;
  989|      4|        ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|      4|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  990|      4|        op = oLitEnd + length1;
  991|      4|        sequence.matchLength -= length1;
  992|      4|        match = prefixStart;
  993|      4|        }
  994|      4|    }
  995|  63.8k|    ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst);
  996|  63.8k|    return sequenceLength;
  997|  63.9k|}
zstd_decompress_block.c:ZSTD_decompressSequencesSplitLitBuffer:
 1956|    537|{
 1957|    537|    DEBUGLOG(5, "ZSTD_decompressSequencesSplitLitBuffer");
  ------------------
  |  |  104|    537|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 537]
  |  |  ------------------
  ------------------
 1958|    537|#if DYNAMIC_BMI2
 1959|    537|    if (ZSTD_DCtx_get_bmi2(dctx)) {
  ------------------
  |  Branch (1959:9): [True: 537, False: 0]
  ------------------
 1960|    537|        return ZSTD_decompressSequencesSplitLitBuffer_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1961|    537|    }
 1962|      0|#endif
 1963|      0|    return ZSTD_decompressSequencesSplitLitBuffer_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1964|    537|}
zstd_decompress_block.c:ZSTD_decompressSequencesSplitLitBuffer_bmi2:
 1920|    537|{
 1921|    537|    return ZSTD_decompressSequences_bodySplitLitBuffer(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1922|    537|}
zstd_decompress_block.c:ZSTD_decompressSequences_bodySplitLitBuffer:
 1407|    537|{
 1408|    537|    const BYTE* ip = (const BYTE*)seqStart;
 1409|    537|    const BYTE* const iend = ip + seqSize;
 1410|    537|    BYTE* const ostart = (BYTE*)dst;
 1411|    537|    BYTE* const oend = ZSTD_maybeNullPtrAdd(ostart, maxDstSize);
 1412|    537|    BYTE* op = ostart;
 1413|    537|    const BYTE* litPtr = dctx->litPtr;
 1414|    537|    const BYTE* litBufferEnd = dctx->litBufferEnd;
 1415|    537|    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);
 1416|    537|    const BYTE* const vBase = (const BYTE*) (dctx->virtualStart);
 1417|    537|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 1418|    537|    DEBUGLOG(5, "ZSTD_decompressSequences_bodySplitLitBuffer (%i seqs)", nbSeq);
  ------------------
  |  |  104|    537|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 537]
  |  |  ------------------
  ------------------
 1419|       |
 1420|       |    /* Literals are split between internal buffer & output buffer */
 1421|    537|    if (nbSeq) {
  ------------------
  |  Branch (1421:9): [True: 537, False: 0]
  ------------------
 1422|    537|        seqState_t seqState;
 1423|    537|        dctx->fseEntropy = 1;
 1424|  2.14k|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  2.14k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1424:28): [True: 1.61k, False: 537]
  ------------------
 1425|    537|        RETURN_ERROR_IF(
  ------------------
  |  |  114|    537|    do {                                                                       \
  |  |  115|    537|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 40, False: 497]
  |  |  ------------------
  |  |  116|     40|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     40|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 40]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     40|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     40|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     40|    do {                                           \
  |  |  |  |   99|     40|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 40]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     40|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 40]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     40|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     40|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 40]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     40|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     40|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 40]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     40|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     40|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     40|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     40|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     40|        }                                                                      \
  |  |  123|    537|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 497]
  |  |  ------------------
  ------------------
 1426|    537|            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)),
 1427|    537|            corruption_detected, "");
 1428|    497|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1429|    497|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1430|    497|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1431|    497|        assert(dst != NULL);
  ------------------
  |  |   70|    497|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1432|       |
 1433|    497|        ZSTD_STATIC_ASSERT(
  ------------------
  |  |   43|    497|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|    497|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1434|    497|                BIT_DStream_unfinished < BIT_DStream_completed &&
 1435|    497|                BIT_DStream_endOfBuffer < BIT_DStream_completed &&
 1436|    497|                BIT_DStream_completed < BIT_DStream_overflow);
 1437|       |
 1438|       |        /* decompress without overrunning litPtr begins */
 1439|    497|        {   seq_t sequence = {0,0,0};  /* some static analyzer believe that @sequence is not initialized (it necessarily is, since for(;;) loop as at least one iteration) */
 1440|       |            /* Align the decompression loop to 32 + 16 bytes.
 1441|       |                *
 1442|       |                * zstd compiled with gcc-9 on an Intel i9-9900k shows 10% decompression
 1443|       |                * speed swings based on the alignment of the decompression loop. This
 1444|       |                * performance swing is caused by parts of the decompression loop falling
 1445|       |                * out of the DSB. The entire decompression loop should fit in the DSB,
 1446|       |                * when it can't we get much worse performance. You can measure if you've
 1447|       |                * hit the good case or the bad case with this perf command for some
 1448|       |                * compressed file test.zst:
 1449|       |                *
 1450|       |                *   perf stat -e cycles -e instructions -e idq.all_dsb_cycles_any_uops \
 1451|       |                *             -e idq.all_mite_cycles_any_uops -- ./zstd -tq test.zst
 1452|       |                *
 1453|       |                * If you see most cycles served out of the MITE you've hit the bad case.
 1454|       |                * If you see most cycles served out of the DSB you've hit the good case.
 1455|       |                * If it is pretty even then you may be in an okay case.
 1456|       |                *
 1457|       |                * This issue has been reproduced on the following CPUs:
 1458|       |                *   - Kabylake: Macbook Pro (15-inch, 2019) 2.4 GHz Intel Core i9
 1459|       |                *               Use Instruments->Counters to get DSB/MITE cycles.
 1460|       |                *               I never got performance swings, but I was able to
 1461|       |                *               go from the good case of mostly DSB to half of the
 1462|       |                *               cycles served from MITE.
 1463|       |                *   - Coffeelake: Intel i9-9900k
 1464|       |                *   - Coffeelake: Intel i7-9700k
 1465|       |                *
 1466|       |                * I haven't been able to reproduce the instability or DSB misses on any
 1467|       |                * of the following CPUS:
 1468|       |                *   - Haswell
 1469|       |                *   - Broadwell: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GH
 1470|       |                *   - Skylake
 1471|       |                *
 1472|       |                * Alignment is done for each of the three major decompression loops:
 1473|       |                *   - ZSTD_decompressSequences_bodySplitLitBuffer - presplit section of the literal buffer
 1474|       |                *   - ZSTD_decompressSequences_bodySplitLitBuffer - postsplit section of the literal buffer
 1475|       |                *   - ZSTD_decompressSequences_body
 1476|       |                * Alignment choices are made to minimize large swings on bad cases and influence on performance
 1477|       |                * from changes external to this code, rather than to overoptimize on the current commit.
 1478|       |                *
 1479|       |                * If you are seeing performance stability this script can help test.
 1480|       |                * It tests on 4 commits in zstd where I saw performance change.
 1481|       |                *
 1482|       |                *   https://gist.github.com/terrelln/9889fc06a423fd5ca6e99351564473f4
 1483|       |                */
 1484|    497|#if defined(__GNUC__) && defined(__x86_64__)
 1485|    497|            __asm__(".p2align 6");
 1486|       |#  if __GNUC__ >= 7
 1487|       |	    /* good for gcc-7, gcc-9, and gcc-11 */
 1488|       |            __asm__("nop");
 1489|       |            __asm__(".p2align 5");
 1490|       |            __asm__("nop");
 1491|       |            __asm__(".p2align 4");
 1492|       |#    if __GNUC__ == 8 || __GNUC__ == 10
 1493|       |	    /* good for gcc-8 and gcc-10 */
 1494|       |            __asm__("nop");
 1495|       |            __asm__(".p2align 3");
 1496|       |#    endif
 1497|       |#  endif
 1498|    497|#endif
 1499|       |
 1500|       |            /* Handle the initial state where litBuffer is currently split between dst and litExtraBuffer */
 1501|  2.60M|            for ( ; nbSeq; nbSeq--) {
  ------------------
  |  Branch (1501:21): [True: 2.60M, False: 1]
  ------------------
 1502|  2.60M|                sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1503|  2.60M|                if (litPtr + sequence.litLength > dctx->litBufferEnd) break;
  ------------------
  |  Branch (1503:21): [True: 312, False: 2.60M]
  ------------------
 1504|  2.60M|                {   size_t const oneSeqSize = ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence.litLength - WILDCOPY_OVERLENGTH, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd);
  ------------------
  |  |  199|  2.60M|#define WILDCOPY_OVERLENGTH 32
  ------------------
 1505|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1506|       |                    assert(!ZSTD_isError(oneSeqSize));
 1507|       |                    ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase);
 1508|       |#endif
 1509|  2.60M|                    if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|  2.60M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 184, False: 2.60M]
  |  |  ------------------
  ------------------
 1510|    184|                        return oneSeqSize;
 1511|  2.60M|                    DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|  2.60M|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.60M]
  |  |  ------------------
  ------------------
 1512|  2.60M|                    op += oneSeqSize;
 1513|  2.60M|            }   }
 1514|    313|            DEBUGLOG(6, "reached: (litPtr + sequence.litLength > dctx->litBufferEnd)");
  ------------------
  |  |  104|    313|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 313]
  |  |  ------------------
  ------------------
 1515|       |
 1516|       |            /* If there are more sequences, they will need to read literals from litExtraBuffer; copy over the remainder from dst and update litPtr and litEnd */
 1517|    313|            if (nbSeq > 0) {
  ------------------
  |  Branch (1517:17): [True: 312, False: 1]
  ------------------
 1518|    312|                const size_t leftoverLit = dctx->litBufferEnd - litPtr;
 1519|    312|                DEBUGLOG(6, "There are %i sequences left, and %zu/%zu literals left in buffer", nbSeq, leftoverLit, sequence.litLength);
  ------------------
  |  |  104|    312|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 312]
  |  |  ------------------
  ------------------
 1520|    312|                if (leftoverLit) {
  ------------------
  |  Branch (1520:21): [True: 290, False: 22]
  ------------------
 1521|    290|                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer");
  ------------------
  |  |  114|    290|    do {                                                                       \
  |  |  115|    290|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 6, False: 284]
  |  |  ------------------
  |  |  116|      6|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      6|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      6|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      6|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      6|    do {                                           \
  |  |  |  |   99|      6|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      6|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      6|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      6|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      6|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      6|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      6|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      6|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      6|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      6|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      6|        }                                                                      \
  |  |  123|    290|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 284]
  |  |  ------------------
  ------------------
 1522|    284|                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);
 1523|    284|                    sequence.litLength -= leftoverLit;
 1524|    284|                    op += leftoverLit;
 1525|    284|                }
 1526|    306|                litPtr = dctx->litExtraBuffer;
 1527|    306|                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    306|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    306|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|    612|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 306]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 306, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1528|    306|                dctx->litBufferLocation = ZSTD_not_in_dst;
 1529|    306|                {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd);
 1530|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1531|       |                    assert(!ZSTD_isError(oneSeqSize));
 1532|       |                    ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase);
 1533|       |#endif
 1534|    306|                    if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|    306|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 57, False: 249]
  |  |  ------------------
  ------------------
 1535|     57|                        return oneSeqSize;
 1536|    249|                    DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|    249|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 249]
  |  |  ------------------
  ------------------
 1537|    249|                    op += oneSeqSize;
 1538|    249|                }
 1539|      0|                nbSeq--;
 1540|    249|            }
 1541|    313|        }
 1542|       |
 1543|    250|        if (nbSeq > 0) {
  ------------------
  |  Branch (1543:13): [True: 247, False: 3]
  ------------------
 1544|       |            /* there is remaining lit from extra buffer */
 1545|       |
 1546|    247|#if defined(__GNUC__) && defined(__x86_64__)
 1547|    247|            __asm__(".p2align 6");
 1548|    247|            __asm__("nop");
 1549|    247|#  if __GNUC__ != 7
 1550|       |            /* worse for gcc-7 better for gcc-8, gcc-9, and gcc-10 and clang */
 1551|    247|            __asm__(".p2align 4");
 1552|    247|            __asm__("nop");
 1553|    247|            __asm__(".p2align 3");
 1554|       |#  elif __GNUC__ >= 11
 1555|       |            __asm__(".p2align 3");
 1556|       |#  else
 1557|       |            __asm__(".p2align 5");
 1558|       |            __asm__("nop");
 1559|       |            __asm__(".p2align 3");
 1560|       |#  endif
 1561|    247|#endif
 1562|       |
 1563|   250k|            for ( ; nbSeq ; nbSeq--) {
  ------------------
  |  Branch (1563:21): [True: 250k, False: 2]
  ------------------
 1564|   250k|                seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1565|   250k|                size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd);
 1566|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1567|       |                assert(!ZSTD_isError(oneSeqSize));
 1568|       |                ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase);
 1569|       |#endif
 1570|   250k|                if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|   250k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 245, False: 250k]
  |  |  ------------------
  ------------------
 1571|    245|                    return oneSeqSize;
 1572|   250k|                DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|   250k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 250k]
  |  |  ------------------
  ------------------
 1573|   250k|                op += oneSeqSize;
 1574|   250k|            }
 1575|    247|        }
 1576|       |
 1577|       |        /* check if reached exact end */
 1578|      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]
  |  |  ------------------
  ------------------
 1579|      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]
  |  |  ------------------
  ------------------
 1580|      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]
  |  |  ------------------
  ------------------
 1581|      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]
  |  |  ------------------
  ------------------
 1582|       |        /* save reps for next block */
 1583|      0|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  |   64|      0|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1583:28): [True: 0, False: 0]
  ------------------
 1584|      0|    }
 1585|       |
 1586|       |    /* last literal segment */
 1587|      0|    if (dctx->litBufferLocation == ZSTD_split) {
  ------------------
  |  Branch (1587:9): [True: 0, False: 0]
  ------------------
 1588|       |        /* split hasn't been reached yet, first get dst then copy litExtraBuffer */
 1589|      0|        size_t const lastLLSize = (size_t)(litBufferEnd - litPtr);
 1590|      0|        DEBUGLOG(6, "copy last literals from segment : %u", (U32)lastLLSize);
  ------------------
  |  |  104|      0|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1591|      0|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend - op), dstSize_tooSmall, "");
  ------------------
  |  |  114|      0|    do {                                                                       \
  |  |  115|      0|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1592|      0|        if (op != NULL) {
  ------------------
  |  Branch (1592:13): [True: 0, False: 0]
  ------------------
 1593|      0|            ZSTD_memmove(op, litPtr, lastLLSize);
  ------------------
  |  |   45|      0|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1594|      0|            op += lastLLSize;
 1595|      0|        }
 1596|      0|        litPtr = dctx->litExtraBuffer;
 1597|      0|        litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|      0|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|      0|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|      0|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 0, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1598|      0|        dctx->litBufferLocation = ZSTD_not_in_dst;
 1599|      0|    }
 1600|       |    /* copy last literals from internal buffer */
 1601|      0|    {   size_t const lastLLSize = (size_t)(litBufferEnd - litPtr);
 1602|      0|        DEBUGLOG(6, "copy last literals from internal buffer : %u", (U32)lastLLSize);
  ------------------
  |  |  104|      0|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1603|      0|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, "");
  ------------------
  |  |  114|      0|    do {                                                                       \
  |  |  115|      0|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1604|      0|        if (op != NULL) {
  ------------------
  |  Branch (1604:13): [True: 0, False: 0]
  ------------------
 1605|      0|            ZSTD_memcpy(op, litPtr, lastLLSize);
  ------------------
  |  |   44|      0|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1606|      0|            op += lastLLSize;
 1607|      0|    }   }
 1608|       |
 1609|      0|    DEBUGLOG(6, "decoded block of size %u bytes", (U32)(op - ostart));
  ------------------
  |  |  104|      0|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1610|      0|    return (size_t)(op - ostart);
 1611|      0|}
zstd_decompress_block.c:ZSTD_decompressSequences:
 1943|  6.47k|{
 1944|  6.47k|    DEBUGLOG(5, "ZSTD_decompressSequences");
  ------------------
  |  |  104|  6.47k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 6.47k]
  |  |  ------------------
  ------------------
 1945|  6.47k|#if DYNAMIC_BMI2
 1946|  6.47k|    if (ZSTD_DCtx_get_bmi2(dctx)) {
  ------------------
  |  Branch (1946:9): [True: 6.47k, False: 0]
  ------------------
 1947|  6.47k|        return ZSTD_decompressSequences_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1948|  6.47k|    }
 1949|      0|#endif
 1950|      0|    return ZSTD_decompressSequences_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1951|  6.47k|}
zstd_decompress_block.c:ZSTD_decompressSequences_bmi2:
 1911|  6.47k|{
 1912|  6.47k|    return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1913|  6.47k|}
zstd_decompress_block.c:ZSTD_decompressSequences_body:
 1619|  6.47k|{
 1620|  6.47k|    const BYTE* ip = (const BYTE*)seqStart;
 1621|  6.47k|    const BYTE* const iend = ip + seqSize;
 1622|  6.47k|    BYTE* const ostart = (BYTE*)dst;
 1623|  6.47k|    BYTE* const oend = dctx->litBufferLocation == ZSTD_not_in_dst ? ZSTD_maybeNullPtrAdd(ostart, maxDstSize) : dctx->litBuffer;
  ------------------
  |  Branch (1623:24): [True: 4.13k, False: 2.33k]
  ------------------
 1624|  6.47k|    BYTE* op = ostart;
 1625|  6.47k|    const BYTE* litPtr = dctx->litPtr;
 1626|  6.47k|    const BYTE* const litEnd = litPtr + dctx->litSize;
 1627|  6.47k|    const BYTE* const prefixStart = (const BYTE*)(dctx->prefixStart);
 1628|  6.47k|    const BYTE* const vBase = (const BYTE*)(dctx->virtualStart);
 1629|  6.47k|    const BYTE* const dictEnd = (const BYTE*)(dctx->dictEnd);
 1630|  6.47k|    DEBUGLOG(5, "ZSTD_decompressSequences_body: nbSeq = %d", nbSeq);
  ------------------
  |  |  104|  6.47k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 6.47k]
  |  |  ------------------
  ------------------
 1631|       |
 1632|       |    /* Regen sequences */
 1633|  6.47k|    if (nbSeq) {
  ------------------
  |  Branch (1633:9): [True: 2.96k, False: 3.50k]
  ------------------
 1634|  2.96k|        seqState_t seqState;
 1635|  2.96k|        dctx->fseEntropy = 1;
 1636|  11.8k|        { U32 i; for (i = 0; i < ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  11.8k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1636:30): [True: 8.88k, False: 2.96k]
  ------------------
 1637|  2.96k|        RETURN_ERROR_IF(
  ------------------
  |  |  114|  2.96k|    do {                                                                       \
  |  |  115|  2.96k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 99, False: 2.86k]
  |  |  ------------------
  |  |  116|     99|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     99|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 99]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     99|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     99|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     99|    do {                                           \
  |  |  |  |   99|     99|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 99]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     99|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 99]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     99|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     99|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 99]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     99|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     99|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 99]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     99|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     99|        }                                                                      \
  |  |  123|  2.96k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.86k]
  |  |  ------------------
  ------------------
 1638|  2.96k|            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend - ip)),
 1639|  2.96k|            corruption_detected, "");
 1640|  2.86k|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1641|  2.86k|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1642|  2.86k|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1643|  2.86k|        assert(dst != NULL);
  ------------------
  |  |   70|  2.86k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1644|       |
 1645|  2.86k|#if defined(__GNUC__) && defined(__x86_64__)
 1646|  2.86k|            __asm__(".p2align 6");
 1647|  2.86k|            __asm__("nop");
 1648|       |#  if __GNUC__ >= 7
 1649|       |            __asm__(".p2align 5");
 1650|       |            __asm__("nop");
 1651|       |            __asm__(".p2align 3");
 1652|       |#  else
 1653|  2.86k|            __asm__(".p2align 4");
 1654|  2.86k|            __asm__("nop");
 1655|  2.86k|            __asm__(".p2align 3");
 1656|  2.86k|#  endif
 1657|  2.86k|#endif
 1658|       |
 1659|   154k|        for ( ; nbSeq ; nbSeq--) {
  ------------------
  |  Branch (1659:17): [True: 152k, False: 2.36k]
  ------------------
 1660|   152k|            seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1661|   152k|            size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequence, &litPtr, litEnd, prefixStart, vBase, dictEnd);
 1662|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1663|       |            assert(!ZSTD_isError(oneSeqSize));
 1664|       |            ZSTD_assertValidSequence(dctx, op, oend, sequence, prefixStart, vBase);
 1665|       |#endif
 1666|   152k|            if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|   152k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 503, False: 151k]
  |  |  ------------------
  ------------------
 1667|    503|                return oneSeqSize;
 1668|   151k|            DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|   151k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 151k]
  |  |  ------------------
  ------------------
 1669|   151k|            op += oneSeqSize;
 1670|   151k|        }
 1671|       |
 1672|       |        /* check if reached exact end */
 1673|  2.36k|        assert(nbSeq == 0);
  ------------------
  |  |   70|  2.36k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1674|  2.36k|        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, "");
  ------------------
  |  |  114|  2.36k|    do {                                                                       \
  |  |  115|  2.36k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 39, False: 2.32k]
  |  |  ------------------
  |  |  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|  2.36k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.32k]
  |  |  ------------------
  ------------------
 1675|       |        /* save reps for next block */
 1676|  9.28k|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  |   64|  9.28k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1676:28): [True: 6.96k, False: 2.32k]
  ------------------
 1677|  2.32k|    }
 1678|       |
 1679|       |    /* last literal segment */
 1680|  5.82k|    {   size_t const lastLLSize = (size_t)(litEnd - litPtr);
 1681|  5.82k|        DEBUGLOG(6, "copy last literals : %u", (U32)lastLLSize);
  ------------------
  |  |  104|  5.82k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 5.82k]
  |  |  ------------------
  ------------------
 1682|  5.82k|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, "");
  ------------------
  |  |  114|  5.82k|    do {                                                                       \
  |  |  115|  5.82k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 24, False: 5.80k]
  |  |  ------------------
  |  |  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|  5.82k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.80k]
  |  |  ------------------
  ------------------
 1683|  5.80k|        if (op != NULL) {
  ------------------
  |  Branch (1683:13): [True: 5.80k, False: 0]
  ------------------
 1684|  5.80k|            ZSTD_memcpy(op, litPtr, lastLLSize);
  ------------------
  |  |   44|  5.80k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1685|  5.80k|            op += lastLLSize;
 1686|  5.80k|    }   }
 1687|       |
 1688|  5.80k|    DEBUGLOG(6, "decoded block of size %u bytes", (U32)(op - ostart));
  ------------------
  |  |  104|  5.80k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 5.80k]
  |  |  ------------------
  ------------------
 1689|  5.80k|    return (size_t)(op - ostart);
 1690|  5.82k|}

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

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

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

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

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

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

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

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

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

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

do_nothing:
  617|   237k|int do_nothing(uint8_t filter, char cmode) {
  618|   237k|  if (cmode == 'c') {
  ------------------
  |  Branch (618:7): [True: 0, False: 237k]
  ------------------
  619|      0|    return (filter == BLOSC_NOFILTER);
  620|   237k|  } else {
  621|       |    // TRUNC_PREC do not have to be applied during decompression
  622|   237k|    return ((filter == BLOSC_NOFILTER) || (filter == BLOSC_TRUNC_PREC));
  ------------------
  |  Branch (622:13): [True: 111k, False: 126k]
  |  Branch (622:43): [True: 20.2k, False: 106k]
  ------------------
  623|   237k|  }
  624|   237k|}
next_filter:
  627|  51.3k|int next_filter(const uint8_t* filters, int current_filter, char cmode) {
  628|  97.3k|  for (int i = current_filter - 1; i >= 0; i--) {
  ------------------
  |  Branch (628:36): [True: 97.3k, False: 0]
  ------------------
  629|  97.3k|    if (!do_nothing(filters[i], cmode)) {
  ------------------
  |  Branch (629:9): [True: 51.3k, False: 46.0k]
  ------------------
  630|  51.3k|      return filters[i];
  631|  51.3k|    }
  632|  97.3k|  }
  633|      0|  return BLOSC_NOFILTER;
  634|  51.3k|}
last_filter:
  637|  23.4k|int last_filter(const uint8_t* filters, char cmode) {
  638|  23.4k|  int last_index = -1;
  639|   163k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (639:40): [True: 140k, False: 23.4k]
  ------------------
  640|   140k|    if (!do_nothing(filters[i], cmode))  {
  ------------------
  |  Branch (640:9): [True: 54.7k, False: 85.7k]
  ------------------
  641|  54.7k|      last_index = i;
  642|  54.7k|    }
  643|   140k|  }
  644|  23.4k|  return last_index;
  645|  23.4k|}
read_chunk_header:
  724|   208k|{
  725|   208k|  memset(header, 0, sizeof(blosc_header));
  726|       |
  727|   208k|  if (srcsize < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (727:7): [True: 0, False: 208k]
  ------------------
  728|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  729|      0|    return BLOSC2_ERROR_READ_BUFFER;
  730|      0|  }
  731|       |
  732|   208k|  memcpy(header, src, BLOSC_MIN_HEADER_LENGTH);
  733|       |
  734|   208k|  bool little_endian = is_little_endian();
  735|       |
  736|   208k|  if (!little_endian) {
  ------------------
  |  Branch (736:7): [True: 0, False: 208k]
  ------------------
  737|      0|    header->nbytes = bswap32_(header->nbytes);
  738|      0|    header->blocksize = bswap32_(header->blocksize);
  739|      0|    header->cbytes = bswap32_(header->cbytes);
  740|      0|  }
  741|       |
  742|   208k|  if (header->cbytes < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (742:7): [True: 34, False: 208k]
  ------------------
  743|     34|    BLOSC_TRACE_ERROR("`cbytes` is too small to read min header.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  744|     34|    return BLOSC2_ERROR_INVALID_HEADER;
  745|     34|  }
  746|   208k|  if (header->blocksize <= 0) {
  ------------------
  |  Branch (746:7): [True: 36, False: 208k]
  ------------------
  747|     36|    BLOSC_TRACE_ERROR("`blocksize` is zero");
  ------------------
  |  |   93|     36|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     36|    do {                                            \
  |  |  |  |   98|     36|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     36|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 36, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     36|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  748|     36|    return BLOSC2_ERROR_INVALID_HEADER;
  749|     36|  }
  750|   208k|  if (header->blocksize > BLOSC2_MAXBLOCKSIZE) {
  ------------------
  |  Branch (750:7): [True: 9, False: 208k]
  ------------------
  751|      9|    BLOSC_TRACE_ERROR("`blocksize` greater than maximum allowed");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  752|      9|    return BLOSC2_ERROR_INVALID_HEADER;
  753|      9|  }
  754|   208k|  if (header->typesize == 0) {
  ------------------
  |  Branch (754:7): [True: 5, False: 208k]
  ------------------
  755|      5|    BLOSC_TRACE_ERROR("`typesize` is zero.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  756|      5|    return BLOSC2_ERROR_INVALID_HEADER;
  757|      5|  }
  758|       |
  759|       |  /* Read extended header if it is wanted */
  760|   208k|  if ((extended_header) && (header->flags & BLOSC_DOSHUFFLE) && (header->flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (760:7): [True: 16.7k, False: 191k]
  |  Branch (760:28): [True: 9.84k, False: 6.89k]
  |  Branch (760:65): [True: 7.46k, False: 2.37k]
  ------------------
  761|  7.46k|    if (header->cbytes < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (761:9): [True: 15, False: 7.45k]
  ------------------
  762|     15|      BLOSC_TRACE_ERROR("`cbytes` is too small to read extended header.");
  ------------------
  |  |   93|     15|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     15|    do {                                            \
  |  |  |  |   98|     15|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     15|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     15|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  763|     15|      return BLOSC2_ERROR_INVALID_HEADER;
  764|     15|    }
  765|  7.45k|    if (srcsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (765:9): [True: 0, False: 7.45k]
  ------------------
  766|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  767|      0|      return BLOSC2_ERROR_READ_BUFFER;
  768|      0|    }
  769|       |
  770|  7.45k|    memcpy((uint8_t *)header + BLOSC_MIN_HEADER_LENGTH, src + BLOSC_MIN_HEADER_LENGTH,
  771|  7.45k|      BLOSC_EXTENDED_HEADER_LENGTH - BLOSC_MIN_HEADER_LENGTH);
  772|       |
  773|  7.45k|    if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) && (header->blosc2_flags != 0)) {
  ------------------
  |  Branch (773:9): [True: 334, False: 7.12k]
  |  Branch (773:55): [True: 149, False: 185]
  ------------------
  774|    149|      int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  775|    149|      if (special_type != 0) {
  ------------------
  |  Branch (775:11): [True: 6, False: 143]
  ------------------
  776|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  777|      6|        return BLOSC2_ERROR_INVALID_HEADER;
  778|      6|      }
  779|    149|    }
  780|       |
  781|  7.44k|    int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  782|  7.44k|    if (special_type != 0) {
  ------------------
  |  Branch (782:9): [True: 287, False: 7.16k]
  ------------------
  783|    287|      if (special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (783:11): [True: 129, False: 158]
  ------------------
  784|       |        // In this case, the actual type size must be derived from the cbytes
  785|    129|        int32_t typesize = header->cbytes - BLOSC_EXTENDED_HEADER_LENGTH;
  786|    129|        if (typesize <= 0) {
  ------------------
  |  Branch (786:13): [True: 1, False: 128]
  ------------------
  787|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  788|      1|          return BLOSC2_ERROR_INVALID_HEADER;
  789|      1|        }
  790|    128|        if (typesize > BLOSC2_MAXTYPESIZE) {
  ------------------
  |  Branch (790:13): [True: 0, False: 128]
  ------------------
  791|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  792|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  793|      0|        }
  794|    128|        if (typesize > header->nbytes) {
  ------------------
  |  Branch (794:13): [True: 22, False: 106]
  ------------------
  795|     22|          BLOSC_TRACE_ERROR("`typesize` is greater than `nbytes`");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  796|     22|          return BLOSC2_ERROR_INVALID_HEADER;
  797|     22|        }
  798|    106|        if (header->nbytes % typesize != 0) {
  ------------------
  |  Branch (798:13): [True: 5, False: 101]
  ------------------
  799|      5|          BLOSC_TRACE_ERROR("`nbytes` is not a multiple of typesize");
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  800|      5|          return BLOSC2_ERROR_INVALID_HEADER;
  801|      5|        }
  802|    106|      }
  803|    158|      else {
  804|       |        // All-zero chunks fill with memset, which works regardless of element alignment.
  805|    158|        if (special_type != BLOSC2_SPECIAL_ZERO
  ------------------
  |  Branch (805:13): [True: 107, False: 51]
  ------------------
  806|    107|            && header->nbytes % header->typesize != 0) {
  ------------------
  |  Branch (806:16): [True: 4, False: 103]
  ------------------
  807|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  808|      4|          return BLOSC2_ERROR_INVALID_HEADER;
  809|      4|        }
  810|    158|      }
  811|    287|    }
  812|       |    // The number of filters depends on the version of the header. Blosc2 alpha series
  813|       |    // did not initialize filters to zero beyond the max supported.
  814|  7.41k|    if (header->version == BLOSC2_VERSION_FORMAT_ALPHA) {
  ------------------
  |  Branch (814:9): [True: 1.08k, False: 6.32k]
  ------------------
  815|  1.08k|      header->filters[5] = 0;
  816|  1.08k|      header->filters_meta[5] = 0;
  817|  1.08k|    }
  818|  7.41k|  }
  819|   200k|  else {
  820|   200k|    flags_to_filters(header->flags, header->filters);
  821|   200k|  }
  822|   208k|  if (header->version > BLOSC2_VERSION_FORMAT &&
  ------------------
  |  Branch (822:7): [True: 23.9k, False: 184k]
  ------------------
  823|  23.9k|      (header->blosc2_flags2 & (uint8_t)~BLOSC2_VL_BLOCKS) != 0) {
  ------------------
  |  Branch (823:7): [True: 10, False: 23.9k]
  ------------------
  824|       |    /* Version from future with unsupported chunk features. */
  825|     10|    return BLOSC2_ERROR_VERSION_SUPPORT;
  826|     10|  }
  827|   208k|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0 &&
  ------------------
  |  Branch (827:7): [True: 323, False: 207k]
  ------------------
  828|    323|      (header->flags & (uint8_t)BLOSC_MEMCPYED) != 0) {
  ------------------
  |  Branch (828:7): [True: 2, False: 321]
  ------------------
  829|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  830|      2|    return BLOSC2_ERROR_INVALID_HEADER;
  831|      2|  }
  832|   208k|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) == 0 &&
  ------------------
  |  Branch (832:7): [True: 207k, False: 321]
  ------------------
  833|   207k|      header->nbytes > 0 && header->blocksize > header->nbytes) {
  ------------------
  |  Branch (833:7): [True: 207k, False: 124]
  |  Branch (833:29): [True: 43.9k, False: 163k]
  ------------------
  834|  43.9k|    header->blocksize = header->nbytes;
  835|  43.9k|  }
  836|   208k|  return 0;
  837|   208k|}
fill_codec:
  920|      5|int fill_codec(blosc2_codec *codec) {
  921|      5|  char libpath[PATH_MAX];
  922|      5|  void *lib = load_lib(codec->compname, libpath);
  923|      5|  if(lib == NULL) {
  ------------------
  |  Branch (923:6): [True: 5, False: 0]
  ------------------
  924|      5|    BLOSC_TRACE_ERROR("Error while loading the library for codec `%s`", codec->compname);
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  925|      5|    return BLOSC2_ERROR_FAILURE;
  926|      5|  }
  927|       |
  928|      0|  codec_info *info = dlsym(lib, "info");
  929|      0|  if (info == NULL) {
  ------------------
  |  Branch (929:7): [True: 0, False: 0]
  ------------------
  930|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  931|      0|    dlclose(lib);
  932|      0|    return BLOSC2_ERROR_FAILURE;
  933|      0|  }
  934|      0|  codec->encoder = dlsym(lib, info->encoder);
  935|      0|  codec->decoder = dlsym(lib, info->decoder);
  936|       |
  937|      0|  if (codec->encoder == NULL || codec->decoder == NULL) {
  ------------------
  |  Branch (937:7): [True: 0, False: 0]
  |  Branch (937:33): [True: 0, False: 0]
  ------------------
  938|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  939|      0|    dlclose(lib);
  940|      0|    return BLOSC2_ERROR_FAILURE;
  941|      0|  }
  942|       |
  943|       |  /* If ever add .free function in future for codec params
  944|       |  codecparams_info *info2 = dlsym(lib, "info2");
  945|       |  if (info2 != NULL) {
  946|       |    // New plugin (e.g. openzl) with free function for codec_params defined
  947|       |    // will be used when destroying context in blosc2_free_ctx
  948|       |      codec->free = dlsym(lib, info2->free);
  949|       |  }
  950|       |  else{
  951|       |    codec->free = NULL;
  952|       |  }
  953|       |  */
  954|       |
  955|      0|  return BLOSC2_ERROR_SUCCESS;
  956|      0|}
pipeline_backward:
 1509|  7.88k|                      uint8_t* tmp2, int last_filter_index, int32_t nblock) {
 1510|  7.88k|  (void)tmp2;
 1511|  7.88k|  blosc2_context* context = thread_context->parent_context;
 1512|  7.88k|  int32_t typesize = context->typesize;
 1513|  7.88k|  uint8_t* filters = context->filters;
 1514|  7.88k|  uint8_t* filters_meta = context->filters_meta;
 1515|  7.88k|  uint8_t* _src = (next_filter(filters, BLOSC2_MAX_FILTERS, 'd') == BLOSC_DELTA &&
  ------------------
  |  Branch (1515:20): [True: 2.51k, False: 5.37k]
  ------------------
 1516|  5.37k|                   context->postfilter == NULL) ? (dest + offset) : src;
  ------------------
  |  Branch (1516:20): [True: 2.51k, False: 0]
  ------------------
 1517|  7.88k|  uint8_t* _dest = tmp;
 1518|  7.88k|  int errcode = 0;
 1519|       |
 1520|  41.4k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (1520:40): [True: 41.4k, False: 0]
  ------------------
 1521|       |    // Delta filter requires the whole chunk ready
 1522|  41.4k|    int last_copy_filter = (last_filter_index == i) || (filters[i] == BLOSC_DELTA) ||
  ------------------
  |  Branch (1522:28): [True: 7.79k, False: 33.6k]
  |  Branch (1522:56): [True: 7.19k, False: 26.4k]
  ------------------
 1523|  26.4k|                           (next_filter(filters, i, 'd') == BLOSC_DELTA);
  ------------------
  |  Branch (1523:28): [True: 8.47k, False: 17.9k]
  ------------------
 1524|  41.4k|    if (last_copy_filter && context->postfilter == NULL &&
  ------------------
  |  Branch (1524:9): [True: 23.4k, False: 17.9k]
  |  Branch (1524:29): [True: 23.4k, False: 0]
  ------------------
 1525|  23.4k|        (filters[i] == BLOSC_DELTA || _src != dest + offset)) {
  ------------------
  |  Branch (1525:10): [True: 10.3k, False: 13.0k]
  |  Branch (1525:39): [True: 6.22k, False: 6.83k]
  ------------------
 1526|  16.6k|      _dest = dest + offset;
 1527|  24.8k|    } else {
 1528|  24.8k|      _dest = (_src == src) ? tmp : src;
  ------------------
  |  Branch (1528:15): [True: 12.4k, False: 12.3k]
  ------------------
 1529|  24.8k|    }
 1530|  41.4k|    int rc = BLOSC2_ERROR_SUCCESS;
 1531|  41.4k|    if (filters[i] <= BLOSC2_DEFINED_FILTERS_STOP) {
  ------------------
  |  Branch (1531:9): [True: 37.4k, False: 3.94k]
  ------------------
 1532|  37.4k|      switch (filters[i]) {
 1533|  7.64k|        case BLOSC_SHUFFLE:
  ------------------
  |  Branch (1533:9): [True: 7.64k, False: 29.8k]
  ------------------
 1534|       |        // if filters_meta is not 0, interpret as number of bytes to be grouped together for shuffle
 1535|  7.64k|          blosc2_unshuffle(filters_meta[i] == 0 ? typesize : filters_meta[i], bsize, _src, _dest);
  ------------------
  |  Branch (1535:28): [True: 4.35k, False: 3.28k]
  ------------------
 1536|  7.64k|          break;
 1537|  3.66k|        case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (1537:9): [True: 3.66k, False: 33.8k]
  ------------------
 1538|  3.66k|          if (bitunshuffle(typesize, bsize, _src, _dest, context->src[BLOSC2_CHUNK_VERSION]) < 0) {
  ------------------
  |  Branch (1538:15): [True: 0, False: 3.66k]
  ------------------
 1539|      0|            return BLOSC2_ERROR_FILTER_PIPELINE;
 1540|      0|          }
 1541|  3.66k|          break;
 1542|  10.3k|        case BLOSC_DELTA:
  ------------------
  |  Branch (1542:9): [True: 10.3k, False: 27.0k]
  ------------------
 1543|  10.3k|          if (_src != _dest) {
  ------------------
  |  Branch (1543:15): [True: 759, False: 9.63k]
  ------------------
 1544|    759|            memcpy(_dest, _src, (size_t)bsize);
 1545|    759|          }
 1546|  10.3k|          if (offset != 0 && thread_context != context->serial_context) {
  ------------------
  |  Branch (1546:15): [True: 8.47k, False: 1.92k]
  |  Branch (1546:30): [True: 0, False: 8.47k]
  ------------------
 1547|      0|            delta_wait_dref(context);
 1548|      0|          }
 1549|  10.3k|          delta_decoder(offset == 0 ? _dest : dest, offset, bsize, typesize, _dest);
  ------------------
  |  Branch (1549:25): [True: 1.92k, False: 8.47k]
  ------------------
 1550|  10.3k|          break;
 1551|  4.20k|        case BLOSC_TRUNC_PREC:
  ------------------
  |  Branch (1551:9): [True: 4.20k, False: 33.2k]
  ------------------
 1552|       |          // TRUNC_PREC filter does not need to be undone
 1553|  4.20k|          break;
 1554|  11.5k|        default:
  ------------------
  |  Branch (1554:9): [True: 11.5k, False: 25.9k]
  ------------------
 1555|  11.5k|          if (filters[i] != BLOSC_NOFILTER) {
  ------------------
  |  Branch (1555:15): [True: 164, False: 11.4k]
  ------------------
 1556|    164|            BLOSC_TRACE_ERROR("Filter %d not handled during decompression.",
  ------------------
  |  |   93|    164|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    164|    do {                                            \
  |  |  |  |   98|    164|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    164|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 164, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    164|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1557|    164|                              filters[i]);
 1558|    164|            errcode = -1;
 1559|    164|          }
 1560|  37.4k|      }
 1561|  37.4k|    } else {
 1562|       |        // Look for the filters_meta in user filters and run it
 1563|  16.1k|        for (uint64_t j = 0; j < g_nfilters; ++j) {
  ------------------
  |  Branch (1563:30): [True: 16.0k, False: 135]
  ------------------
 1564|  16.0k|          if (g_filters[j].id == filters[i]) {
  ------------------
  |  Branch (1564:15): [True: 3.81k, False: 12.2k]
  ------------------
 1565|  3.81k|            if (g_filters[j].backward == NULL) {
  ------------------
  |  Branch (1565:17): [True: 0, False: 3.81k]
  ------------------
 1566|       |              // Dynamically load filter
 1567|      0|              if (fill_filter(&g_filters[j]) < 0) {
  ------------------
  |  Branch (1567:19): [True: 0, False: 0]
  ------------------
 1568|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1569|      0|                return BLOSC2_ERROR_FILTER_PIPELINE;
 1570|      0|              }
 1571|      0|            }
 1572|  3.81k|            if (g_filters[j].backward != NULL) {
  ------------------
  |  Branch (1572:17): [True: 3.81k, False: 0]
  ------------------
 1573|  3.81k|              blosc2_dparams dparams;
 1574|  3.81k|              blosc2_ctx_get_dparams(context, &dparams);
 1575|  3.81k|              rc = g_filters[j].backward(_src, _dest, bsize, filters_meta[i], &dparams, g_filters[j].id);
 1576|  3.81k|            } else {
 1577|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1578|      0|              return BLOSC2_ERROR_FILTER_PIPELINE;
 1579|      0|            }
 1580|  3.81k|            if (rc != BLOSC2_ERROR_SUCCESS) {
  ------------------
  |  Branch (1580:17): [True: 32, False: 3.77k]
  ------------------
 1581|     32|              BLOSC_TRACE_ERROR("User-defined filter %d failed during decompression.", filters[i]);
  ------------------
  |  |   93|     32|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     32|    do {                                            \
  |  |  |  |   98|     32|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     32|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 32, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     32|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1582|     32|              return rc;
 1583|     32|            }
 1584|  3.77k|            goto urfiltersuccess;
 1585|  3.81k|          }
 1586|  16.0k|        }
 1587|    135|      BLOSC_TRACE_ERROR("User-defined filter %d not found during decompression.", filters[i]);
  ------------------
  |  |   93|    135|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    135|    do {                                            \
  |  |  |  |   98|    135|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    135|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 135, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    135|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1588|    135|      return BLOSC2_ERROR_FILTER_PIPELINE;
 1589|  3.77k|      urfiltersuccess:;
 1590|  3.77k|    }
 1591|       |
 1592|       |    // Update input buffer for the next filter in the backward pipeline
 1593|  41.2k|    if ((filters[i] != BLOSC_NOFILTER) && (filters[i] != BLOSC_TRUNC_PREC)) {
  ------------------
  |  Branch (1593:9): [True: 29.8k, False: 11.4k]
  |  Branch (1593:43): [True: 25.6k, False: 4.20k]
  ------------------
 1594|  25.6k|      _src = _dest;
 1595|  25.6k|    }
 1596|  41.2k|    if (last_filter_index == i) {
  ------------------
  |  Branch (1596:9): [True: 7.71k, False: 33.5k]
  ------------------
 1597|  7.71k|      break;
 1598|  7.71k|    }
 1599|  41.2k|  }
 1600|       |
 1601|  7.71k|  if (context->postfilter == NULL && _src != dest + offset) {
  ------------------
  |  Branch (1601:7): [True: 7.71k, False: 0]
  |  Branch (1601:38): [True: 1.00k, False: 6.71k]
  ------------------
 1602|  1.00k|    memcpy(dest + offset, _src, (unsigned int)bsize);
 1603|  1.00k|  }
 1604|       |
 1605|       |  /* Postfilter function */
 1606|  7.71k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (1606:7): [True: 0, False: 7.71k]
  ------------------
 1607|       |    // Create new postfilter parameters for this block (must be private for each thread)
 1608|      0|    blosc2_postfilter_params postparams;
 1609|      0|    memcpy(&postparams, context->postparams, sizeof(postparams));
 1610|      0|    postparams.input = _src;
 1611|      0|    postparams.output = dest + offset;
 1612|      0|    postparams.size = bsize;
 1613|      0|    postparams.typesize = typesize;
 1614|      0|    postparams.offset = nblock * context->blocksize;
 1615|      0|    postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (1615:25): [True: 0, False: 0]
  ------------------
 1616|      0|    postparams.nblock = nblock;
 1617|      0|    postparams.tid = thread_context->tid;
 1618|      0|    postparams.ttmp = thread_context->tmp;
 1619|      0|    postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 1620|      0|    postparams.ctx = context;
 1621|       |
 1622|      0|    if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (1622:9): [True: 0, False: 0]
  ------------------
 1623|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1624|      0|      return BLOSC2_ERROR_POSTFILTER;
 1625|      0|    }
 1626|      0|  }
 1627|       |
 1628|  7.71k|  return errcode;
 1629|  7.71k|}
free_thread_context:
 2316|  15.6k|void free_thread_context(struct thread_context* thread_context) {
 2317|  15.6k|  destroy_thread_context(thread_context);
 2318|  15.6k|  my_free(thread_context);
 2319|  15.6k|}
blosc2_decompress:
 4436|  16.7k|int blosc2_decompress(const void* src, int32_t srcsize, void* dest, int32_t destsize) {
 4437|  16.7k|  int result;
 4438|  16.7k|  char* envvar;
 4439|  16.7k|  long nthreads;
 4440|  16.7k|  blosc2_context *dctx;
 4441|  16.7k|  blosc2_dparams dparams = BLOSC2_DPARAMS_DEFAULTS;
 4442|       |
 4443|       |  /* Check whether the library should be initialized */
 4444|  16.7k|  if (!g_initlib) blosc2_init();
  ------------------
  |  Branch (4444:7): [True: 0, False: 16.7k]
  ------------------
 4445|       |
 4446|       |  /* Check for a BLOSC_NTHREADS environment variable */
 4447|  16.7k|  envvar = getenv("BLOSC_NTHREADS");
 4448|  16.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (4448:7): [True: 0, False: 16.7k]
  ------------------
 4449|      0|    errno = 0; /* To distinguish success/failure after call */
 4450|      0|    nthreads = strtol(envvar, NULL, 10);
 4451|      0|    if ((errno != EINVAL)) {
  ------------------
  |  Branch (4451:9): [True: 0, False: 0]
  ------------------
 4452|      0|      if ((nthreads <= 0) || (nthreads > INT16_MAX)) {
  ------------------
  |  Branch (4452:11): [True: 0, False: 0]
  |  Branch (4452:30): [True: 0, False: 0]
  ------------------
 4453|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 4453|      0|        BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4454|      0|        return BLOSC2_ERROR_INVALID_PARAM;
 4455|      0|      }
 4456|      0|      result = blosc2_set_nthreads((int16_t) nthreads);
 4457|      0|      if (result < 0) {
  ------------------
  |  Branch (4457:11): [True: 0, False: 0]
  ------------------
 4458|      0|        return result;
 4459|      0|      }
 4460|      0|    }
 4461|      0|  }
 4462|       |
 4463|       |  /* Check for a BLOSC_NOLOCK environment variable.  It is important
 4464|       |     that this should be the last env var so that it can take the
 4465|       |     previous ones into account */
 4466|  16.7k|  envvar = getenv("BLOSC_NOLOCK");
 4467|  16.7k|  if (envvar != NULL) {
  ------------------
  |  Branch (4467:7): [True: 0, False: 16.7k]
  ------------------
 4468|      0|    dparams.nthreads = g_nthreads;
 4469|      0|    dctx = blosc2_create_dctx(dparams);
 4470|      0|    if (dctx == NULL) {
  ------------------
  |  Branch (4470:9): [True: 0, False: 0]
  ------------------
 4471|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4472|      0|      return BLOSC2_ERROR_NULL_POINTER;
 4473|      0|    }
 4474|      0|    result = blosc2_decompress_ctx(dctx, src, srcsize, dest, destsize);
 4475|      0|    blosc2_free_ctx(dctx);
 4476|      0|    return result;
 4477|      0|  }
 4478|       |
 4479|  16.7k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  16.7k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 4480|       |
 4481|  16.7k|  result = blosc_run_decompression_with_context(
 4482|  16.7k|          g_global_context, src, srcsize, dest, destsize);
 4483|       |
 4484|  16.7k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  16.7k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 4485|       |
 4486|  16.7k|  return result;
 4487|  16.7k|}
blosc2_set_nthreads:
 5916|  16.9k|int16_t blosc2_set_nthreads(int16_t nthreads) {
 5917|  16.9k|  int16_t ret;          /* the previous number of threads */
 5918|       |
 5919|       |  /* Check whether the library should be initialized */
 5920|  16.9k|  if (!g_initlib) blosc2_init();
  ------------------
  |  Branch (5920:7): [True: 0, False: 16.9k]
  ------------------
 5921|       |
 5922|  16.9k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  16.9k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5923|  16.9k|  ret = g_nthreads;
 5924|  16.9k|  if (nthreads != ret) {
  ------------------
  |  Branch (5924:7): [True: 0, False: 16.9k]
  ------------------
 5925|      0|    int16_t old_new_nthreads = g_global_context->new_nthreads;
 5926|      0|    int16_t old_nthreads = g_global_context->nthreads;
 5927|      0|    g_nthreads = nthreads;
 5928|      0|    g_global_context->new_nthreads = nthreads;
 5929|      0|    int16_t ret2 = check_nthreads(g_global_context, true);
 5930|      0|    if (ret2 < 0) {
  ------------------
  |  Branch (5930:9): [True: 0, False: 0]
  ------------------
 5931|      0|      g_nthreads = ret;
 5932|      0|      g_global_context->new_nthreads = old_new_nthreads;
 5933|      0|      g_global_context->nthreads = old_nthreads;
 5934|      0|      check_nthreads(g_global_context, true);
 5935|      0|      blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5936|      0|      return ret2;
 5937|      0|    }
 5938|      0|  }
 5939|  16.9k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  16.9k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5940|       |
 5941|  16.9k|  return ret;
 5942|  16.9k|}
blosc1_cbuffer_sizes:
 6086|  16.9k|void blosc1_cbuffer_sizes(const void* cbuffer, size_t* nbytes, size_t* cbytes, size_t* blocksize) {
 6087|  16.9k|  int32_t nbytes32, cbytes32, blocksize32;
 6088|  16.9k|  blosc2_cbuffer_sizes(cbuffer, &nbytes32, &cbytes32, &blocksize32);
 6089|  16.9k|  *nbytes = nbytes32;
 6090|  16.9k|  *cbytes = cbytes32;
 6091|  16.9k|  *blocksize = blocksize32;
 6092|  16.9k|}
blosc2_cbuffer_sizes:
 6094|   191k|int blosc2_cbuffer_sizes(const void* cbuffer, int32_t* nbytes, int32_t* cbytes, int32_t* blocksize) {
 6095|   191k|  blosc_header header;
 6096|   191k|  int rc = read_chunk_header((uint8_t *) cbuffer, BLOSC_MIN_HEADER_LENGTH, false, &header);
 6097|   191k|  if (rc < 0) {
  ------------------
  |  Branch (6097:7): [True: 84, False: 191k]
  ------------------
 6098|       |    /* Return zeros if error reading header */
 6099|     84|    memset(&header, 0, sizeof(header));
 6100|     84|  }
 6101|       |
 6102|       |  /* Read the interesting values */
 6103|   191k|  if (nbytes != NULL)
  ------------------
  |  Branch (6103:7): [True: 191k, False: 21]
  ------------------
 6104|   191k|    *nbytes = header.nbytes;
 6105|   191k|  if (cbytes != NULL)
  ------------------
  |  Branch (6105:7): [True: 191k, False: 0]
  ------------------
 6106|   191k|    *cbytes = header.cbytes;
 6107|   191k|  if (blocksize != NULL)
  ------------------
  |  Branch (6107:7): [True: 16.9k, False: 174k]
  ------------------
 6108|  16.9k|    *blocksize = header.blocksize;
 6109|   191k|  return rc;
 6110|   191k|}
blosc1_cbuffer_validate:
 6112|  16.7k|int blosc1_cbuffer_validate(const void* cbuffer, size_t cbytes, size_t* nbytes) {
 6113|  16.7k|  int32_t header_cbytes;
 6114|  16.7k|  int32_t header_nbytes;
 6115|  16.7k|  if (cbytes < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (6115:7): [True: 0, False: 16.7k]
  ------------------
 6116|       |    /* Compressed data should contain enough space for header */
 6117|      0|    *nbytes = 0;
 6118|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 6119|      0|  }
 6120|  16.7k|  int rc = blosc2_cbuffer_sizes(cbuffer, &header_nbytes, &header_cbytes, NULL);
 6121|  16.7k|  if (rc < 0) {
  ------------------
  |  Branch (6121:7): [True: 0, False: 16.7k]
  ------------------
 6122|      0|    *nbytes = 0;
 6123|      0|    return rc;
 6124|      0|  }
 6125|  16.7k|  *nbytes = header_nbytes;
 6126|  16.7k|  if (header_cbytes != (int32_t)cbytes) {
  ------------------
  |  Branch (6126:7): [True: 0, False: 16.7k]
  ------------------
 6127|       |    /* Compressed size from header does not match `cbytes` */
 6128|      0|    *nbytes = 0;
 6129|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 6130|      0|  }
 6131|  16.7k|  if (*nbytes > BLOSC2_MAX_BUFFERSIZE) {
  ------------------
  |  Branch (6131:7): [True: 47, False: 16.7k]
  ------------------
 6132|       |    /* Uncompressed size is larger than allowed */
 6133|     47|    *nbytes = 0;
 6134|     47|    return BLOSC2_ERROR_MEMORY_ALLOC;
 6135|     47|  }
 6136|  16.7k|  return 0;
 6137|  16.7k|}
blosc2_init:
 6245|  16.9k|void blosc2_init(void) {
 6246|       |  /* Return if Blosc is already initialized */
 6247|  16.9k|  if (g_initlib) return;
  ------------------
  |  Branch (6247:7): [True: 0, False: 16.9k]
  ------------------
 6248|       |
 6249|  16.9k|  BLOSC2_IO_CB_DEFAULTS.id = BLOSC2_IO_FILESYSTEM;
 6250|  16.9k|  BLOSC2_IO_CB_DEFAULTS.name = "filesystem";
 6251|  16.9k|  BLOSC2_IO_CB_DEFAULTS.is_allocation_necessary = true;
 6252|  16.9k|  BLOSC2_IO_CB_DEFAULTS.open = (blosc2_open_cb) blosc2_stdio_open;
 6253|  16.9k|  BLOSC2_IO_CB_DEFAULTS.close = (blosc2_close_cb) blosc2_stdio_close;
 6254|  16.9k|  BLOSC2_IO_CB_DEFAULTS.size = (blosc2_size_cb) blosc2_stdio_size;
 6255|  16.9k|  BLOSC2_IO_CB_DEFAULTS.write = (blosc2_write_cb) blosc2_stdio_write;
 6256|  16.9k|  BLOSC2_IO_CB_DEFAULTS.read = (blosc2_read_cb) blosc2_stdio_read;
 6257|  16.9k|  BLOSC2_IO_CB_DEFAULTS.truncate = (blosc2_truncate_cb) blosc2_stdio_truncate;
 6258|  16.9k|  BLOSC2_IO_CB_DEFAULTS.destroy = (blosc2_destroy_cb) blosc2_stdio_destroy;
 6259|       |
 6260|  16.9k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_DEFAULTS);
 6261|       |
 6262|  16.9k|  BLOSC2_IO_CB_MMAP.id = BLOSC2_IO_FILESYSTEM_MMAP;
 6263|  16.9k|  BLOSC2_IO_CB_MMAP.name = "filesystem_mmap";
 6264|  16.9k|  BLOSC2_IO_CB_MMAP.is_allocation_necessary = false;
 6265|  16.9k|  BLOSC2_IO_CB_MMAP.open = (blosc2_open_cb) blosc2_stdio_mmap_open;
 6266|  16.9k|  BLOSC2_IO_CB_MMAP.close = (blosc2_close_cb) blosc2_stdio_mmap_close;
 6267|  16.9k|  BLOSC2_IO_CB_MMAP.read = (blosc2_read_cb) blosc2_stdio_mmap_read;
 6268|  16.9k|  BLOSC2_IO_CB_MMAP.size = (blosc2_size_cb) blosc2_stdio_mmap_size;
 6269|  16.9k|  BLOSC2_IO_CB_MMAP.write = (blosc2_write_cb) blosc2_stdio_mmap_write;
 6270|  16.9k|  BLOSC2_IO_CB_MMAP.truncate = (blosc2_truncate_cb) blosc2_stdio_mmap_truncate;
 6271|  16.9k|  BLOSC2_IO_CB_MMAP.destroy = (blosc2_destroy_cb) blosc2_stdio_mmap_destroy;
 6272|       |
 6273|  16.9k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_MMAP);
 6274|       |
 6275|  16.9k|  g_ncodecs = 0;
 6276|  16.9k|  g_nfilters = 0;
 6277|  16.9k|  g_ntuners = 0;
 6278|       |
 6279|  16.9k|#if defined(HAVE_PLUGINS)
 6280|  16.9k|  #include "blosc2/blosc2-common.h"
 6281|  16.9k|  #include "blosc2/blosc2-stdio.h"
 6282|  16.9k|  register_codecs();
 6283|  16.9k|  register_filters();
 6284|  16.9k|  register_tuners();
 6285|  16.9k|#endif
 6286|  16.9k|  blosc2_pthread_mutex_init(&global_comp_mutex, NULL);
  ------------------
  |  |   90|  16.9k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 6287|  16.9k|  blosc2_pthread_mutex_init(&pool_registry_mutex, NULL);
  ------------------
  |  |   90|  16.9k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 6288|       |  /* Create a global context */
 6289|  16.9k|  g_global_context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 6290|  16.9k|  memset(g_global_context, 0, sizeof(blosc2_context));
 6291|  16.9k|  g_global_context->nthreads = g_nthreads;
 6292|  16.9k|  g_global_context->new_nthreads = g_nthreads;
 6293|  16.9k|  blosc2_pthread_mutex_init(&g_global_context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  16.9k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 6294|  16.9k|  g_initlib = 1;
 6295|  16.9k|}
blosc2_free_resources:
 6298|  16.9k|int blosc2_free_resources(void) {
 6299|       |  /* Return if Blosc is not initialized */
 6300|  16.9k|  if (!g_initlib) return BLOSC2_ERROR_FAILURE;
  ------------------
  |  Branch (6300:7): [True: 0, False: 16.9k]
  ------------------
 6301|       |
 6302|  16.9k|  return release_thread_backend(g_global_context);
 6303|  16.9k|}
blosc2_destroy:
 6306|  16.9k|void blosc2_destroy(void) {
 6307|       |  /* Return if Blosc is not initialized */
 6308|  16.9k|  if (!g_initlib) return;
  ------------------
  |  Branch (6308:7): [True: 0, False: 16.9k]
  ------------------
 6309|       |
 6310|  16.9k|  blosc2_free_resources();
 6311|  16.9k|  g_initlib = 0;
 6312|  16.9k|  blosc2_free_ctx(g_global_context);
 6313|       |
 6314|       |  /* Bump the epoch so any live context can detect its pool is now stale.
 6315|       |   * Do this before freeing the pools so that release_thread_backend callers
 6316|       |   * that race with us will take the "skip" path rather than locking the
 6317|       |   * soon-to-be-destroyed pool_registry_mutex. */
 6318|  16.9k|  g_destroy_count++;
 6319|       |
 6320|       |  /* Tear down any remaining shared pools */
 6321|  16.9k|  struct blosc_shared_pool *pool = shared_pools;
 6322|  16.9k|  while (pool != NULL) {
  ------------------
  |  Branch (6322:10): [True: 0, False: 16.9k]
  ------------------
 6323|      0|    struct blosc_shared_pool *next = pool->next;
 6324|      0|    destroy_shared_pool(pool);
 6325|      0|    pool = next;
 6326|      0|  }
 6327|  16.9k|  shared_pools = NULL;
 6328|  16.9k|  blosc2_pthread_mutex_destroy(&pool_registry_mutex);
  ------------------
  |  |   91|  16.9k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6329|       |
 6330|  16.9k|  blosc2_pthread_mutex_destroy(&global_comp_mutex);
  ------------------
  |  |   91|  16.9k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6331|  16.9k|}
blosc2_free_ctx:
 6587|  16.9k|void blosc2_free_ctx(blosc2_context* context) {
 6588|  16.9k|  if (g_initlib ||
  ------------------
  |  Branch (6588:7): [True: 0, False: 16.9k]
  ------------------
 6589|  16.9k|      context->thread_backend == BLOSC_BACKEND_PER_CONTEXT ||
  ------------------
  |  |   35|  33.9k|#define BLOSC_BACKEND_PER_CONTEXT 3   /* per-context threads; used on Windows */
  ------------------
  |  Branch (6589:7): [True: 0, False: 16.9k]
  ------------------
 6590|  16.9k|      context->thread_backend == BLOSC_BACKEND_CALLBACK) {
  ------------------
  |  |   34|  16.9k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (6590:7): [True: 0, False: 16.9k]
  ------------------
 6591|      0|    release_thread_backend(context);
 6592|      0|  }
 6593|  16.9k|  if (context->serial_context != NULL) {
  ------------------
  |  Branch (6593:7): [True: 15.6k, False: 1.32k]
  ------------------
 6594|  15.6k|    free_thread_context(context->serial_context);
 6595|  15.6k|  }
 6596|  16.9k|  blosc2_pthread_mutex_destroy(&context->nchunk_mutex);
  ------------------
  |  |   91|  16.9k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6597|  16.9k|  release_context_dict_buffer(context);
 6598|  16.9k|  if (context->dict_cdict != NULL) {
  ------------------
  |  Branch (6598:7): [True: 0, False: 16.9k]
  ------------------
 6599|      0|    if (context->compcode == BLOSC_LZ4) {
  ------------------
  |  Branch (6599:9): [True: 0, False: 0]
  ------------------
 6600|      0|      LZ4_freeStream((LZ4_stream_t*)context->dict_cdict);
 6601|      0|    } else if (context->compcode == BLOSC_LZ4HC) {
  ------------------
  |  Branch (6601:16): [True: 0, False: 0]
  ------------------
 6602|      0|      LZ4_freeStreamHC((LZ4_streamHC_t*)context->dict_cdict);
 6603|      0|    }
 6604|      0|#ifdef HAVE_ZSTD
 6605|      0|    else if (context->compcode == BLOSC_ZSTD) {
  ------------------
  |  Branch (6605:14): [True: 0, False: 0]
  ------------------
 6606|      0|      ZSTD_freeCDict(context->dict_cdict);
 6607|      0|    }
 6608|      0|#endif
 6609|      0|  }
 6610|  16.9k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (6610:7): [True: 3.44k, False: 13.5k]
  ------------------
 6611|  3.44k|#ifdef HAVE_ZSTD
 6612|  3.44k|    ZSTD_freeDDict(context->dict_ddict);
 6613|  3.44k|#endif
 6614|  3.44k|  }
 6615|  16.9k|  if (context->tuner_params != NULL) {
  ------------------
  |  Branch (6615:7): [True: 0, False: 16.9k]
  ------------------
 6616|      0|    int rc;
 6617|      0|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|      0|#define BLOSC_STUNE 0
  ------------------
  |  Branch (6617:9): [True: 0, False: 0]
  |  Branch (6617:49): [True: 0, False: 0]
  ------------------
 6618|      0|      rc = blosc_stune_free(context);
 6619|      0|    } else {
 6620|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (6620:23): [True: 0, False: 0]
  ------------------
 6621|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (6621:13): [True: 0, False: 0]
  ------------------
 6622|      0|          if (g_tuners[i].free == NULL) {
  ------------------
  |  Branch (6622:15): [True: 0, False: 0]
  ------------------
 6623|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (6623:17): [True: 0, False: 0]
  ------------------
 6624|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6625|      0|              return;
 6626|      0|            }
 6627|      0|          }
 6628|      0|          rc = g_tuners[i].free(context);
 6629|      0|          goto urtunersuccess;
 6630|      0|        }
 6631|      0|      }
 6632|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6633|      0|      return;
 6634|      0|      urtunersuccess:;
 6635|      0|    }
 6636|      0|    if (rc < 0) {
  ------------------
  |  Branch (6636:9): [True: 0, False: 0]
  ------------------
 6637|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6638|      0|      return;
 6639|      0|    }
 6640|      0|  }
 6641|       |  /* May be needed if codec_params ever contains nested objects
 6642|       |  if (context->codec_params != NULL) {
 6643|       |    int rc;
 6644|       |    for (int i = 0; i < g_ncodecs; ++i) {
 6645|       |      if (g_codecs[i].compcode == context->compcode) {
 6646|       |        if (g_codecs[i].free == NULL) {
 6647|       |          // Dynamically load codec plugin
 6648|       |          if (fill_codec(&g_codecs[i]) < 0) {
 6649|       |            BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
 6650|       |            return BLOSC2_ERROR_CODEC_SUPPORT;
 6651|       |          }
 6652|       |        }
 6653|       |        if (g_codecs[i].free == NULL){
 6654|       |          // no free func, codec_params is simple
 6655|       |          my_free(context->codec_params);
 6656|       |        }
 6657|       |        else{ // has free function for codec_params (e.g. openzl)
 6658|       |        rc = g_codecs[i].free(context->codec_params);
 6659|       |          goto urcodecsuccess;
 6660|       |        }
 6661|       |      }
 6662|       |    }
 6663|       |      BLOSC_TRACE_ERROR("User-defined compressor codec %d not found", context->compcode);
 6664|       |      return BLOSC2_ERROR_CODEC_SUPPORT;
 6665|       |    urcodecsuccess:;
 6666|       |    if (rc < 0) {
 6667|       |      BLOSC_TRACE_ERROR("Error in user-defined codec free function\n");
 6668|       |      return;
 6669|       |    }
 6670|       |  }
 6671|       |  */
 6672|  16.9k|  if (context->prefilter != NULL) {
  ------------------
  |  Branch (6672:7): [True: 0, False: 16.9k]
  ------------------
 6673|      0|    my_free(context->preparams);
 6674|      0|  }
 6675|  16.9k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (6675:7): [True: 0, False: 16.9k]
  ------------------
 6676|      0|    my_free(context->postparams);
 6677|      0|  }
 6678|       |
 6679|  16.9k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (6679:7): [True: 0, False: 16.9k]
  ------------------
 6680|      0|    free(context->block_maskout);
 6681|      0|  }
 6682|  16.9k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (6682:7): [True: 262, False: 16.7k]
  ------------------
 6683|    262|    free(context->blocknbytes);
 6684|    262|  }
 6685|  16.9k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (6685:7): [True: 262, False: 16.7k]
  ------------------
 6686|    262|    free(context->blockoffsets);
 6687|    262|  }
 6688|  16.9k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (6688:7): [True: 262, False: 16.7k]
  ------------------
 6689|    262|    free(context->blockcbytes);
 6690|    262|  }
 6691|  16.9k|  my_free(context);
 6692|  16.9k|}
blosc2_ctx_get_dparams:
 6719|  5.36k|int blosc2_ctx_get_dparams(blosc2_context *ctx, blosc2_dparams *dparams) {
 6720|  5.36k|  dparams->nthreads = ctx->nthreads;
 6721|  5.36k|  dparams->schunk = ctx->schunk;
 6722|  5.36k|  dparams->postfilter = ctx->postfilter;
 6723|  5.36k|  dparams->postparams = ctx->postparams;
 6724|  5.36k|  dparams->typesize = ctx->typesize;
 6725|       |
 6726|  5.36k|  return BLOSC2_ERROR_SUCCESS;
 6727|  5.36k|}
register_filter_private:
 6939|  84.8k|int register_filter_private(blosc2_filter *filter) {
 6940|  84.8k|    BLOSC_ERROR_NULL(filter, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  84.8k|    do {                                            \
  |  |  105|  84.8k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 84.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|  84.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 84.8k]
  |  |  ------------------
  ------------------
 6941|  84.8k|    if (g_nfilters == UINT8_MAX) {
  ------------------
  |  Branch (6941:9): [True: 0, False: 84.8k]
  ------------------
 6942|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6943|      0|        return BLOSC2_ERROR_CODEC_SUPPORT;
 6944|      0|    }
 6945|  84.8k|    if (filter->id < BLOSC2_GLOBAL_REGISTERED_FILTERS_START) {
  ------------------
  |  Branch (6945:9): [True: 0, False: 84.8k]
  ------------------
 6946|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6947|      0|        return BLOSC2_ERROR_FAILURE;
 6948|      0|    }
 6949|       |    /* This condition can never be fulfilled
 6950|       |    if (filter->id > BLOSC2_USER_REGISTERED_FILTERS_STOP) {
 6951|       |        BLOSC_TRACE_ERROR("The id must be less than or equal to %d", BLOSC2_USER_REGISTERED_FILTERS_STOP);
 6952|       |        return BLOSC2_ERROR_FAILURE;
 6953|       |    }
 6954|       |    */
 6955|       |
 6956|   254k|    for (uint64_t i = 0; i < g_nfilters; ++i) {
  ------------------
  |  Branch (6956:26): [True: 169k, False: 84.8k]
  ------------------
 6957|   169k|      if (g_filters[i].id == filter->id) {
  ------------------
  |  Branch (6957:11): [True: 0, False: 169k]
  ------------------
 6958|      0|        if (strcmp(g_filters[i].name, filter->name) != 0) {
  ------------------
  |  Branch (6958:13): [True: 0, False: 0]
  ------------------
 6959|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6960|      0|                            "  Choose another one !", filter->id, g_filters[i].name);
 6961|      0|          return BLOSC2_ERROR_FAILURE;
 6962|      0|        }
 6963|      0|        else {
 6964|       |          // Already registered, so no more actions needed
 6965|      0|          return BLOSC2_ERROR_SUCCESS;
 6966|      0|        }
 6967|      0|      }
 6968|   169k|    }
 6969|       |
 6970|  84.8k|    blosc2_filter *filter_new = &g_filters[g_nfilters++];
 6971|  84.8k|    memcpy(filter_new, filter, sizeof(blosc2_filter));
 6972|       |
 6973|  84.8k|    return BLOSC2_ERROR_SUCCESS;
 6974|  84.8k|}
register_codec_private:
 6989|   152k|int register_codec_private(blosc2_codec *codec) {
 6990|   152k|    BLOSC_ERROR_NULL(codec, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|   152k|    do {                                            \
  |  |  105|   152k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 152k]
  |  |  ------------------
  |  |  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|   152k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 152k]
  |  |  ------------------
  ------------------
 6991|   152k|    if (g_ncodecs == UINT8_MAX) {
  ------------------
  |  Branch (6991:9): [True: 0, False: 152k]
  ------------------
 6992|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6993|      0|      return BLOSC2_ERROR_CODEC_SUPPORT;
 6994|      0|    }
 6995|   152k|    if (codec->compcode < BLOSC2_GLOBAL_REGISTERED_CODECS_START) {
  ------------------
  |  Branch (6995:9): [True: 0, False: 152k]
  ------------------
 6996|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6997|      0|      return BLOSC2_ERROR_FAILURE;
 6998|      0|    }
 6999|       |    /* This condition can never be fulfilled
 7000|       |    if (codec->compcode > BLOSC2_USER_REGISTERED_CODECS_STOP) {
 7001|       |      BLOSC_TRACE_ERROR("The id must be less or equal to %d", BLOSC2_USER_REGISTERED_CODECS_STOP);
 7002|       |      return BLOSC2_ERROR_FAILURE;
 7003|       |    }
 7004|       |     */
 7005|       |
 7006|   763k|    for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (7006:21): [True: 610k, False: 152k]
  ------------------
 7007|   610k|      if (g_codecs[i].compcode == codec->compcode) {
  ------------------
  |  Branch (7007:11): [True: 0, False: 610k]
  ------------------
 7008|      0|        if (strcmp(g_codecs[i].compname, codec->compname) != 0) {
  ------------------
  |  Branch (7008:13): [True: 0, False: 0]
  ------------------
 7009|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7010|      0|                            "  Choose another one !", codec->compcode, codec->compname);
 7011|      0|          return BLOSC2_ERROR_CODEC_PARAM;
 7012|      0|        }
 7013|      0|        else {
 7014|       |          // Already registered, so no more actions needed
 7015|      0|          return BLOSC2_ERROR_SUCCESS;
 7016|      0|        }
 7017|      0|      }
 7018|   610k|    }
 7019|       |
 7020|   152k|    blosc2_codec *codec_new = &g_codecs[g_ncodecs++];
 7021|   152k|    memcpy(codec_new, codec, sizeof(blosc2_codec));
 7022|       |
 7023|   152k|    return BLOSC2_ERROR_SUCCESS;
 7024|   152k|}
register_tuner_private:
 7039|  16.9k|int register_tuner_private(blosc2_tuner *tuner) {
 7040|  16.9k|  BLOSC_ERROR_NULL(tuner, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  16.9k|    do {                                            \
  |  |  105|  16.9k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 16.9k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  16.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
 7041|  16.9k|  if (g_ntuners == UINT8_MAX) {
  ------------------
  |  Branch (7041:7): [True: 0, False: 16.9k]
  ------------------
 7042|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7043|      0|    return BLOSC2_ERROR_CODEC_SUPPORT;
 7044|      0|  }
 7045|  16.9k|  if (tuner->id < BLOSC2_GLOBAL_REGISTERED_TUNER_START) {
  ------------------
  |  Branch (7045:7): [True: 0, False: 16.9k]
  ------------------
 7046|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7047|      0|    return BLOSC2_ERROR_FAILURE;
 7048|      0|  }
 7049|       |
 7050|  16.9k|  for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (7050:19): [True: 0, False: 16.9k]
  ------------------
 7051|      0|    if (g_tuners[i].id == tuner->id) {
  ------------------
  |  Branch (7051:9): [True: 0, False: 0]
  ------------------
 7052|      0|      if (strcmp(g_tuners[i].name, tuner->name) != 0) {
  ------------------
  |  Branch (7052:11): [True: 0, False: 0]
  ------------------
 7053|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7054|      0|                          "  Choose another one !", tuner->id, g_tuners[i].name);
 7055|      0|        return BLOSC2_ERROR_FAILURE;
 7056|      0|      }
 7057|      0|      else {
 7058|       |        // Already registered, so no more actions needed
 7059|      0|        return BLOSC2_ERROR_SUCCESS;
 7060|      0|      }
 7061|      0|    }
 7062|      0|  }
 7063|       |
 7064|  16.9k|  blosc2_tuner *tuner_new = &g_tuners[g_ntuners++];
 7065|  16.9k|  memcpy(tuner_new, tuner, sizeof(blosc2_tuner));
 7066|       |
 7067|  16.9k|  return BLOSC2_ERROR_SUCCESS;
 7068|  16.9k|}
_blosc2_register_io_cb:
 7081|  33.9k|int _blosc2_register_io_cb(const blosc2_io_cb *io) {
 7082|       |
 7083|  50.9k|  for (uint64_t i = 0; i < g_nio; ++i) {
  ------------------
  |  Branch (7083:24): [True: 50.9k, False: 2]
  ------------------
 7084|  50.9k|    if (g_ios[i].id == io->id) {
  ------------------
  |  Branch (7084:9): [True: 33.9k, False: 16.9k]
  ------------------
 7085|  33.9k|      if (strcmp(g_ios[i].name, io->name) != 0) {
  ------------------
  |  Branch (7085:11): [True: 0, False: 33.9k]
  ------------------
 7086|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7087|      0|                          "  Choose another one !", io->id, g_ios[i].name);
 7088|      0|        return BLOSC2_ERROR_PLUGIN_IO;
 7089|      0|      }
 7090|  33.9k|      else {
 7091|       |        // Already registered, so no more actions needed
 7092|  33.9k|        return BLOSC2_ERROR_SUCCESS;
 7093|  33.9k|      }
 7094|  33.9k|    }
 7095|  50.9k|  }
 7096|       |
 7097|      2|  blosc2_io_cb *io_new = &g_ios[g_nio++];
 7098|      2|  memcpy(io_new, io, sizeof(blosc2_io_cb));
 7099|       |
 7100|      2|  return BLOSC2_ERROR_SUCCESS;
 7101|  33.9k|}
blosc2_error_string:
 7213|     36|const char *blosc2_error_string(int error_code) {
 7214|     36|  switch (error_code) {
 7215|     21|    case BLOSC2_ERROR_FAILURE:
  ------------------
  |  Branch (7215:5): [True: 21, False: 15]
  ------------------
 7216|     21|      return "Generic failure";
 7217|      0|    case BLOSC2_ERROR_STREAM:
  ------------------
  |  Branch (7217:5): [True: 0, False: 36]
  ------------------
 7218|      0|      return "Bad stream";
 7219|     12|    case BLOSC2_ERROR_DATA:
  ------------------
  |  Branch (7219:5): [True: 12, False: 24]
  ------------------
 7220|     12|      return "Invalid data";
 7221|      0|    case BLOSC2_ERROR_MEMORY_ALLOC:
  ------------------
  |  Branch (7221:5): [True: 0, False: 36]
  ------------------
 7222|      0|      return "Memory alloc/realloc failure";
 7223|      0|    case BLOSC2_ERROR_READ_BUFFER:
  ------------------
  |  Branch (7223:5): [True: 0, False: 36]
  ------------------
 7224|      0|      return "Not enough space to read";
 7225|      3|    case BLOSC2_ERROR_WRITE_BUFFER:
  ------------------
  |  Branch (7225:5): [True: 3, False: 33]
  ------------------
 7226|      3|      return "Not enough space to write";
 7227|      0|    case BLOSC2_ERROR_CODEC_SUPPORT:
  ------------------
  |  Branch (7227:5): [True: 0, False: 36]
  ------------------
 7228|      0|      return "Codec not supported";
 7229|      0|    case BLOSC2_ERROR_CODEC_PARAM:
  ------------------
  |  Branch (7229:5): [True: 0, False: 36]
  ------------------
 7230|      0|      return "Invalid parameter supplied to codec";
 7231|      0|    case BLOSC2_ERROR_CODEC_DICT:
  ------------------
  |  Branch (7231:5): [True: 0, False: 36]
  ------------------
 7232|      0|      return "Codec dictionary error";
 7233|      0|    case BLOSC2_ERROR_VERSION_SUPPORT:
  ------------------
  |  Branch (7233:5): [True: 0, False: 36]
  ------------------
 7234|      0|      return "Version not supported";
 7235|      0|    case BLOSC2_ERROR_INVALID_HEADER:
  ------------------
  |  Branch (7235:5): [True: 0, False: 36]
  ------------------
 7236|      0|      return "Invalid value in header";
 7237|      0|    case BLOSC2_ERROR_INVALID_PARAM:
  ------------------
  |  Branch (7237:5): [True: 0, False: 36]
  ------------------
 7238|      0|      return "Invalid parameter supplied to function";
 7239|      0|    case BLOSC2_ERROR_FILE_READ:
  ------------------
  |  Branch (7239:5): [True: 0, False: 36]
  ------------------
 7240|      0|      return "File read failure";
 7241|      0|    case BLOSC2_ERROR_FILE_WRITE:
  ------------------
  |  Branch (7241:5): [True: 0, False: 36]
  ------------------
 7242|      0|      return "File write failure";
 7243|      0|    case BLOSC2_ERROR_FILE_OPEN:
  ------------------
  |  Branch (7243:5): [True: 0, False: 36]
  ------------------
 7244|      0|      return "File open failure";
 7245|      0|    case BLOSC2_ERROR_NOT_FOUND:
  ------------------
  |  Branch (7245:5): [True: 0, False: 36]
  ------------------
 7246|      0|      return "Not found";
 7247|      0|    case BLOSC2_ERROR_RUN_LENGTH:
  ------------------
  |  Branch (7247:5): [True: 0, False: 36]
  ------------------
 7248|      0|      return "Bad run length encoding";
 7249|      0|    case BLOSC2_ERROR_FILTER_PIPELINE:
  ------------------
  |  Branch (7249:5): [True: 0, False: 36]
  ------------------
 7250|      0|      return "Filter pipeline error";
 7251|      0|    case BLOSC2_ERROR_CHUNK_INSERT:
  ------------------
  |  Branch (7251:5): [True: 0, False: 36]
  ------------------
 7252|      0|      return "Chunk insert failure";
 7253|      0|    case BLOSC2_ERROR_CHUNK_APPEND:
  ------------------
  |  Branch (7253:5): [True: 0, False: 36]
  ------------------
 7254|      0|      return "Chunk append failure";
 7255|      0|    case BLOSC2_ERROR_CHUNK_UPDATE:
  ------------------
  |  Branch (7255:5): [True: 0, False: 36]
  ------------------
 7256|      0|      return "Chunk update failure";
 7257|      0|    case BLOSC2_ERROR_2GB_LIMIT:
  ------------------
  |  Branch (7257:5): [True: 0, False: 36]
  ------------------
 7258|      0|      return "Sizes larger than 2gb not supported";
 7259|      0|    case BLOSC2_ERROR_SCHUNK_COPY:
  ------------------
  |  Branch (7259:5): [True: 0, False: 36]
  ------------------
 7260|      0|      return "Super-chunk copy failure";
 7261|      0|    case BLOSC2_ERROR_FRAME_TYPE:
  ------------------
  |  Branch (7261:5): [True: 0, False: 36]
  ------------------
 7262|      0|      return "Wrong type for frame";
 7263|      0|    case BLOSC2_ERROR_FILE_TRUNCATE:
  ------------------
  |  Branch (7263:5): [True: 0, False: 36]
  ------------------
 7264|      0|      return "File truncate failure";
 7265|      0|    case BLOSC2_ERROR_LOCK:
  ------------------
  |  Branch (7265:5): [True: 0, False: 36]
  ------------------
 7266|      0|      return "Frame lock failure";
 7267|      0|    case BLOSC2_ERROR_THREAD_CREATE:
  ------------------
  |  Branch (7267:5): [True: 0, False: 36]
  ------------------
 7268|      0|      return "Thread or thread context creation failure";
 7269|      0|    case BLOSC2_ERROR_POSTFILTER:
  ------------------
  |  Branch (7269:5): [True: 0, False: 36]
  ------------------
 7270|      0|      return "Postfilter failure";
 7271|      0|    case BLOSC2_ERROR_FRAME_SPECIAL:
  ------------------
  |  Branch (7271:5): [True: 0, False: 36]
  ------------------
 7272|      0|      return "Special frame failure";
 7273|      0|    case BLOSC2_ERROR_SCHUNK_SPECIAL:
  ------------------
  |  Branch (7273:5): [True: 0, False: 36]
  ------------------
 7274|      0|      return "Special super-chunk failure";
 7275|      0|    case BLOSC2_ERROR_PLUGIN_IO:
  ------------------
  |  Branch (7275:5): [True: 0, False: 36]
  ------------------
 7276|      0|      return "IO plugin error";
 7277|      0|    case BLOSC2_ERROR_FILE_REMOVE:
  ------------------
  |  Branch (7277:5): [True: 0, False: 36]
  ------------------
 7278|      0|      return "Remove file failure";
 7279|      0|    case BLOSC2_ERROR_NULL_POINTER:
  ------------------
  |  Branch (7279:5): [True: 0, False: 36]
  ------------------
 7280|      0|      return "Pointer is null";
 7281|      0|    case BLOSC2_ERROR_INVALID_INDEX:
  ------------------
  |  Branch (7281:5): [True: 0, False: 36]
  ------------------
 7282|      0|      return "Invalid index";
 7283|      0|    case BLOSC2_ERROR_METALAYER_NOT_FOUND:
  ------------------
  |  Branch (7283:5): [True: 0, False: 36]
  ------------------
 7284|      0|      return "Metalayer has not been found";
 7285|      0|    case BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED:
  ------------------
  |  Branch (7285:5): [True: 0, False: 36]
  ------------------
 7286|      0|      return "Maximum buffersize exceeded";
 7287|      0|    case BLOSC2_ERROR_TUNER:
  ------------------
  |  Branch (7287:5): [True: 0, False: 36]
  ------------------
 7288|      0|      return "Tuner failure";
 7289|      0|    default:
  ------------------
  |  Branch (7289:5): [True: 0, False: 36]
  ------------------
 7290|      0|      return "Unknown error";
 7291|     36|  }
 7292|     36|}
blosc2.c:flags_to_filters:
  672|   209k|static void flags_to_filters(const uint8_t flags, uint8_t* filters) {
  673|       |  /* Initialize the filter pipeline */
  674|   209k|  memset(filters, 0, BLOSC2_MAX_FILTERS);
  675|       |  /* Fill the filter pipeline */
  676|   209k|  if (flags & BLOSC_DOSHUFFLE)
  ------------------
  |  Branch (676:7): [True: 174k, False: 35.0k]
  ------------------
  677|   174k|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_SHUFFLE;
  678|   209k|  if (flags & BLOSC_DOBITSHUFFLE)
  ------------------
  |  Branch (678:7): [True: 173k, False: 36.2k]
  ------------------
  679|   173k|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_BITSHUFFLE;
  680|   209k|  if (flags & BLOSC_DODELTA)
  ------------------
  |  Branch (680:7): [True: 35.1k, False: 174k]
  ------------------
  681|  35.1k|    filters[BLOSC2_MAX_FILTERS - 2] = BLOSC_DELTA;
  682|   209k|}
blosc2.c:destroy_thread_context:
 2298|  15.6k|static void destroy_thread_context(struct thread_context* thread_context) {
 2299|  15.6k|  my_free(thread_context->tmp);
 2300|  15.6k|#if defined(HAVE_ZSTD)
 2301|  15.6k|  if (thread_context->zstd_cctx != NULL) {
  ------------------
  |  Branch (2301:7): [True: 0, False: 15.6k]
  ------------------
 2302|      0|    ZSTD_freeCCtx(thread_context->zstd_cctx);
 2303|      0|  }
 2304|  15.6k|  if (thread_context->zstd_dctx != NULL) {
  ------------------
  |  Branch (2304:7): [True: 10.8k, False: 4.77k]
  ------------------
 2305|  10.8k|    ZSTD_freeDCtx(thread_context->zstd_dctx);
 2306|  10.8k|  }
 2307|  15.6k|#endif
 2308|  15.6k|  if (thread_context->lz4_cstream != NULL) {
  ------------------
  |  Branch (2308:7): [True: 0, False: 15.6k]
  ------------------
 2309|      0|    LZ4_freeStream((LZ4_stream_t*)thread_context->lz4_cstream);
 2310|      0|  }
 2311|  15.6k|  if (thread_context->lz4hc_cstream != NULL) {
  ------------------
  |  Branch (2311:7): [True: 0, False: 15.6k]
  ------------------
 2312|      0|    LZ4_freeStreamHC((LZ4_streamHC_t*)thread_context->lz4hc_cstream);
 2313|      0|  }
 2314|  15.6k|}
blosc2.c:my_free:
  257|  48.2k|static void my_free(void* block) {
  258|       |#if defined(_WIN32)
  259|       |  _aligned_free(block);
  260|       |#else
  261|  48.2k|  free(block);
  262|  48.2k|#endif  /* _WIN32 */
  263|  48.2k|}
blosc2.c:filters_to_flags:
  649|  7.38k|static uint8_t filters_to_flags(const uint8_t* filters) {
  650|  7.38k|  uint8_t flags = 0;
  651|       |
  652|  51.6k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (652:19): [True: 44.2k, False: 7.38k]
  ------------------
  653|  44.2k|    switch (filters[i]) {
  654|  3.02k|      case BLOSC_SHUFFLE:
  ------------------
  |  Branch (654:7): [True: 3.02k, False: 41.2k]
  ------------------
  655|  3.02k|        flags |= BLOSC_DOSHUFFLE;
  656|  3.02k|        break;
  657|  1.42k|      case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (657:7): [True: 1.42k, False: 42.8k]
  ------------------
  658|  1.42k|        flags |= BLOSC_DOBITSHUFFLE;
  659|  1.42k|        break;
  660|  2.71k|      case BLOSC_DELTA:
  ------------------
  |  Branch (660:7): [True: 2.71k, False: 41.5k]
  ------------------
  661|  2.71k|        flags |= BLOSC_DODELTA;
  662|  2.71k|        break;
  663|  37.1k|      default :
  ------------------
  |  Branch (663:7): [True: 37.1k, False: 7.16k]
  ------------------
  664|  37.1k|        break;
  665|  44.2k|    }
  666|  44.2k|  }
  667|  7.38k|  return flags;
  668|  7.38k|}
blosc2.c:blosc2_calculate_blocks:
  839|  16.2k|static inline void blosc2_calculate_blocks(blosc2_context* context) {
  840|       |  /* Compute number of blocks in buffer */
  841|  16.2k|  context->nblocks = context->sourcesize / context->blocksize;
  842|  16.2k|  context->leftover = context->sourcesize % context->blocksize;
  843|  16.2k|  context->nblocks = (context->leftover > 0) ?
  ------------------
  |  Branch (843:22): [True: 3.67k, False: 12.5k]
  ------------------
  844|  12.5k|                     (context->nblocks + 1) : context->nblocks;
  845|  16.2k|}
blosc2.c:clibcode_to_clibname:
  290|      6|static const char* clibcode_to_clibname(int clibcode) {
  291|      6|  if (clibcode == BLOSC_BLOSCLZ_LIB) return BLOSC_BLOSCLZ_LIBNAME;
  ------------------
  |  |  367|      0|#define BLOSC_BLOSCLZ_LIBNAME   "BloscLZ"
  ------------------
  |  Branch (291:7): [True: 0, False: 6]
  ------------------
  292|      6|  if (clibcode == BLOSC_LZ4_LIB) return BLOSC_LZ4_LIBNAME;
  ------------------
  |  |  368|      0|#define BLOSC_LZ4_LIBNAME       "LZ4"
  ------------------
  |  Branch (292:7): [True: 0, False: 6]
  ------------------
  293|      6|  if (clibcode == BLOSC_ZLIB_LIB) return BLOSC_ZLIB_LIBNAME;
  ------------------
  |  |  369|      0|#define BLOSC_ZLIB_LIBNAME      "Zlib"
  ------------------
  |  Branch (293:7): [True: 0, False: 6]
  ------------------
  294|      6|  if (clibcode == BLOSC_ZSTD_LIB) return BLOSC_ZSTD_LIBNAME;
  ------------------
  |  |  370|      0|#define BLOSC_ZSTD_LIBNAME      "Zstd"
  ------------------
  |  Branch (294:7): [True: 0, False: 6]
  ------------------
  295|     60|  for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (295:19): [True: 54, False: 6]
  ------------------
  296|     54|    if (clibcode == g_codecs[i].complib)
  ------------------
  |  Branch (296:9): [True: 0, False: 54]
  ------------------
  297|      0|      return g_codecs[i].compname;
  298|     54|  }
  299|      6|  return NULL;                  /* should never happen */
  300|      6|}
blosc2.c:blosc_run_decompression_with_context:
 4066|  16.7k|                                                void* dest, int32_t destsize) {
 4067|  16.7k|  blosc_header header;
 4068|  16.7k|  int32_t ntbytes;
 4069|  16.7k|  int rc;
 4070|       |
 4071|  16.7k|  rc = read_chunk_header(src, srcsize, true, &header);
 4072|  16.7k|  if (rc < 0) {
  ------------------
  |  Branch (4072:7): [True: 65, False: 16.6k]
  ------------------
 4073|     65|    return rc;
 4074|     65|  }
 4075|       |
 4076|  16.6k|  if (header.nbytes > destsize) {
  ------------------
  |  Branch (4076:7): [True: 96, False: 16.5k]
  ------------------
 4077|       |    // Not enough space for writing into the destination
 4078|     96|    return BLOSC2_ERROR_WRITE_BUFFER;
 4079|     96|  }
 4080|       |
 4081|  16.5k|  rc = initialize_context_decompression(context, &header, src, srcsize, dest, destsize);
 4082|  16.5k|  if (rc < 0) {
  ------------------
  |  Branch (4082:7): [True: 936, False: 15.6k]
  ------------------
 4083|    936|    return rc;
 4084|    936|  }
 4085|       |
 4086|       |  /* Do the actual decompression */
 4087|  15.6k|  ntbytes = do_job(context);
 4088|  15.6k|  if (ntbytes < 0) {
  ------------------
  |  Branch (4088:7): [True: 14.6k, False: 980]
  ------------------
 4089|  14.6k|    return ntbytes;
 4090|  14.6k|  }
 4091|       |
 4092|  15.6k|  assert(ntbytes <= (int32_t)destsize);
 4093|    980|  return ntbytes;
 4094|  15.6k|}
blosc2.c:initialize_context_decompression:
 2757|  16.5k|                                            int32_t srcsize, void* dest, int32_t destsize) {
 2758|  16.5k|  int32_t bstarts_end;
 2759|  16.5k|  bool vlblocks;
 2760|       |
 2761|  16.5k|  context->do_compress = 0;
 2762|  16.5k|  context->src = (const uint8_t*)src;
 2763|  16.5k|  context->srcsize = srcsize;
 2764|  16.5k|  context->dest = (uint8_t*)dest;
 2765|  16.5k|  context->destsize = destsize;
 2766|  16.5k|  context->output_bytes = 0;
 2767|  16.5k|  context->vlblock_sources = NULL;
 2768|  16.5k|  context->vlblock_dests = NULL;
 2769|  16.5k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (2769:7): [True: 0, False: 16.5k]
  ------------------
 2770|      0|    free(context->blocknbytes);
 2771|      0|    context->blocknbytes = NULL;
 2772|      0|  }
 2773|  16.5k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (2773:7): [True: 0, False: 16.5k]
  ------------------
 2774|      0|    free(context->blockoffsets);
 2775|      0|    context->blockoffsets = NULL;
 2776|      0|  }
 2777|  16.5k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (2777:7): [True: 0, False: 16.5k]
  ------------------
 2778|      0|    free(context->blockcbytes);
 2779|      0|    context->blockcbytes = NULL;
 2780|      0|  }
 2781|       |
 2782|  16.5k|  int rc = blosc2_initialize_context_from_header(context, header);
 2783|  16.5k|  if (rc < 0) {
  ------------------
  |  Branch (2783:7): [True: 0, False: 16.5k]
  ------------------
 2784|      0|    return rc;
 2785|      0|  }
 2786|  16.5k|  clear_context_decompression_dict(context);
 2787|  16.5k|  vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2788|  16.5k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (2788:19): [True: 7.38k, False: 9.20k]
  ------------------
 2789|  7.38k|                  (context->blosc2_flags & 0x08u));
  ------------------
  |  Branch (2789:19): [True: 173, False: 7.20k]
  ------------------
 2790|       |
 2791|       |  /* Check that we have enough space to decompress */
 2792|  16.5k|  if (context->sourcesize > (int32_t)context->destsize) {
  ------------------
  |  Branch (2792:7): [True: 0, False: 16.5k]
  ------------------
 2793|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 2794|      0|  }
 2795|       |
 2796|  16.5k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (2796:7): [True: 0, False: 16.5k]
  ------------------
 2797|      0|    if (context->block_maskout_nitems != context->nblocks) {
  ------------------
  |  Branch (2797:9): [True: 0, False: 0]
  ------------------
 2798|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2799|      0|                        " of blocks in chunk (%d).",
 2800|      0|                        context->block_maskout_nitems, context->nblocks);
 2801|      0|      return BLOSC2_ERROR_DATA;
 2802|      0|    }
 2803|      0|    bool has_delta = false;
 2804|      0|    for (int i = 0; i < BLOSC2_MAX_FILTERS; ++i) {
  ------------------
  |  Branch (2804:21): [True: 0, False: 0]
  ------------------
 2805|      0|      if (context->filters[i] == BLOSC_DELTA) {
  ------------------
  |  Branch (2805:11): [True: 0, False: 0]
  ------------------
 2806|      0|        has_delta = true;
 2807|      0|        break;
 2808|      0|      }
 2809|      0|    }
 2810|      0|    if (has_delta) {
  ------------------
  |  Branch (2810:9): [True: 0, False: 0]
  ------------------
 2811|      0|      bool any_needed = false;
 2812|      0|      for (int i = 0; i < context->block_maskout_nitems; ++i) {
  ------------------
  |  Branch (2812:23): [True: 0, False: 0]
  ------------------
 2813|      0|        if (!context->block_maskout[i]) {
  ------------------
  |  Branch (2813:13): [True: 0, False: 0]
  ------------------
 2814|      0|          any_needed = true;
 2815|      0|          break;
 2816|      0|        }
 2817|      0|      }
 2818|      0|      if (any_needed) {
  ------------------
  |  Branch (2818:11): [True: 0, False: 0]
  ------------------
 2819|       |        // Delta filter encodes subsequent blocks relative to block 0; block 0 must be unmasked.
 2820|      0|        context->block_maskout[0] = false;
 2821|      0|      }
 2822|      0|    }
 2823|      0|  }
 2824|       |
 2825|  16.5k|  context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
 2826|  16.5k|  if (context->special_type > BLOSC2_SPECIAL_LASTID) {
  ------------------
  |  Branch (2826:7): [True: 2, False: 16.5k]
  ------------------
 2827|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2828|      2|                      context->special_type);
 2829|      2|    return BLOSC2_ERROR_DATA;
 2830|      2|  }
 2831|       |
 2832|  16.5k|  int memcpyed = (context->header_flags & (uint8_t) BLOSC_MEMCPYED);
 2833|  16.5k|  if (memcpyed && (header->cbytes != header->nbytes + context->header_overhead)) {
  ------------------
  |  Branch (2833:7): [True: 38, False: 16.5k]
  |  Branch (2833:19): [True: 12, False: 26]
  ------------------
 2834|     12|    BLOSC_TRACE_ERROR("Wrong header info for this memcpyed chunk");
  ------------------
  |  |   93|     12|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     12|    do {                                            \
  |  |  |  |   98|     12|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     12|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     12|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2835|     12|    return BLOSC2_ERROR_DATA;
 2836|     12|  }
 2837|       |
 2838|  16.5k|  if ((header->nbytes == 0) && (header->cbytes == context->header_overhead) &&
  ------------------
  |  Branch (2838:7): [True: 0, False: 16.5k]
  |  Branch (2838:32): [True: 0, False: 0]
  ------------------
 2839|      0|      !context->special_type) {
  ------------------
  |  Branch (2839:7): [True: 0, False: 0]
  ------------------
 2840|       |    // A compressed buffer with only a header can only contain a zero-length buffer
 2841|      0|    return 0;
 2842|      0|  }
 2843|       |
 2844|  16.5k|  context->bstarts = (int32_t *) (context->src + context->header_overhead);
 2845|  16.5k|  bstarts_end = context->header_overhead;
 2846|  16.5k|  if (!context->special_type && !memcpyed) {
  ------------------
  |  Branch (2846:7): [True: 16.3k, False: 228]
  |  Branch (2846:33): [True: 16.3k, False: 26]
  ------------------
 2847|  16.3k|    size_t bstarts_end_tmp;
 2848|  16.3k|    size_t bstarts_nbytes;
 2849|  16.3k|    if (context->nblocks < 0 ||
  ------------------
  |  Branch (2849:9): [True: 0, False: 16.3k]
  ------------------
 2850|  16.3k|        !blosc2_checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (2850:9): [True: 0, False: 16.3k]
  ------------------
 2851|  16.3k|        !blosc2_checked_add_size((size_t)context->header_overhead, bstarts_nbytes, &bstarts_end_tmp) ||
  ------------------
  |  Branch (2851:9): [True: 0, False: 16.3k]
  ------------------
 2852|  16.3k|        bstarts_end_tmp > (size_t)INT32_MAX) {
  ------------------
  |  Branch (2852:9): [True: 0, False: 16.3k]
  ------------------
 2853|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2854|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2855|      0|    }
 2856|       |    /* If chunk is not special or a memcpyed, we do have a bstarts section */
 2857|  16.3k|    bstarts_end = (int32_t)bstarts_end_tmp;
 2858|  16.3k|  }
 2859|       |
 2860|  16.5k|  if (srcsize < bstarts_end) {
  ------------------
  |  Branch (2860:7): [True: 62, False: 16.5k]
  ------------------
 2861|     62|    BLOSC_TRACE_ERROR("`bstarts` exceeds length of source buffer.");
  ------------------
  |  |   93|     62|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     62|    do {                                            \
  |  |  |  |   98|     62|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     62|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 62, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     62|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2862|     62|    return BLOSC2_ERROR_READ_BUFFER;
 2863|     62|  }
 2864|       |
 2865|  16.5k|  if (vlblocks && is_lazy && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (2865:7): [True: 271, False: 16.2k]
  |  Branch (2865:19): [True: 103, False: 168]
  |  Branch (2865:30): [True: 103, False: 0]
  |  Branch (2865:56): [True: 103, False: 0]
  ------------------
 2866|    103|    size_t block_csizes_nbytes;
 2867|    103|    size_t trailer_meta_nbytes;
 2868|    103|    size_t lazy_trailer_end;
 2869|    103|    if (context->srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (2869:9): [True: 0, False: 103]
  |  Branch (2869:33): [True: 0, False: 103]
  ------------------
 2870|    103|        !blosc2_checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (2870:9): [True: 0, False: 103]
  ------------------
 2871|    103|        !blosc2_checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (2871:9): [True: 0, False: 103]
  ------------------
 2872|    103|        !blosc2_checked_add_size((size_t)bstarts_end, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (2872:9): [True: 0, False: 103]
  ------------------
 2873|    103|        (size_t)context->srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (2873:9): [True: 7, False: 96]
  ------------------
 2874|      7|      BLOSC_TRACE_ERROR("Lazy trailer exceeds source buffer.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2875|      7|      return BLOSC2_ERROR_READ_BUFFER;
 2876|      7|    }
 2877|    103|  }
 2878|  16.4k|  srcsize -= bstarts_end;
 2879|       |
 2880|       |  /* Read optional dictionary if flag set */
 2881|  16.4k|  if ((context->blosc2_flags & BLOSC2_USEDICT) && !is_lazy) {
  ------------------
  |  Branch (2881:7): [True: 4.65k, False: 11.8k]
  |  Branch (2881:51): [True: 4.62k, False: 22]
  ------------------
 2882|  4.62k|    context->use_dict = 1;
 2883|       |    // The dictionary section is after the bstarts block: [int32 size | raw bytes]
 2884|  4.62k|    if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2884:9): [True: 4, False: 4.62k]
  ------------------
 2885|      4|      BLOSC_TRACE_ERROR("Not enough space to read size of dictionary.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2886|      4|      return BLOSC2_ERROR_READ_BUFFER;
 2887|      4|    }
 2888|  4.62k|    srcsize -= sizeof(int32_t);
 2889|       |    // Read dictionary size
 2890|  4.62k|    context->dict_size = sw32_(context->src + bstarts_end);
 2891|  4.62k|    if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (2891:9): [True: 21, False: 4.60k]
  |  Branch (2891:36): [True: 15, False: 4.58k]
  ------------------
 2892|     36|      BLOSC_TRACE_ERROR("Dictionary size is smaller than minimum or larger than maximum allowed.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2893|     36|      return BLOSC2_ERROR_CODEC_DICT;
 2894|     36|    }
 2895|  4.58k|    if (srcsize < (int32_t)context->dict_size) {
  ------------------
  |  Branch (2895:9): [True: 15, False: 4.57k]
  ------------------
 2896|     15|      BLOSC_TRACE_ERROR("Not enough space to read entire dictionary.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2897|     15|      return BLOSC2_ERROR_READ_BUFFER;
 2898|     15|    }
 2899|  4.57k|    srcsize -= context->dict_size;
 2900|       |    // dict_buffer points directly into the source chunk — no copy needed
 2901|  4.57k|    context->dict_buffer = (void*)(context->src + bstarts_end + sizeof(int32_t));
 2902|  4.57k|    context->dict_buffer_owned = false;
 2903|  4.57k|#if defined(HAVE_ZSTD)
 2904|       |    // context->compcode during decompression holds the format code (flags >> 5),
 2905|       |    // so compare against BLOSC_ZSTD_FORMAT (not BLOSC_ZSTD).
 2906|  4.57k|    if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2906:9): [True: 3.96k, False: 607]
  ------------------
 2907|  3.96k|      context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 2908|  3.96k|      if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (2908:11): [True: 523, False: 3.44k]
  ------------------
 2909|    523|        BLOSC_TRACE_ERROR("Cannot create ZSTD dictionary for chunk.");
  ------------------
  |  |   93|    523|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|    523|    do {                                            \
  |  |  |  |   98|    523|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|    523|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 523, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|    523|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2910|    523|        return BLOSC2_ERROR_CODEC_DICT;
 2911|    523|      }
 2912|  3.96k|    }
 2913|  4.57k|#endif   // HAVE_ZSTD
 2914|       |    // For LZ4/LZ4HC: dict_buffer and dict_size are sufficient; no digested object needed.
 2915|  4.57k|  }
 2916|  11.8k|  else if ((context->blosc2_flags & BLOSC2_USEDICT) && is_lazy) {
  ------------------
  |  Branch (2916:12): [True: 22, False: 11.8k]
  |  Branch (2916:56): [True: 22, False: 0]
  ------------------
 2917|     22|    rc = load_lazy_chunk_dict(context, header, bstarts_end);
 2918|     22|    if (rc < 0) {
  ------------------
  |  Branch (2918:9): [True: 22, False: 0]
  ------------------
 2919|     22|      return rc;
 2920|     22|    }
 2921|     22|  }
 2922|       |
 2923|  15.8k|  if (vlblocks && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (2923:7): [True: 262, False: 15.6k]
  |  Branch (2923:19): [True: 262, False: 0]
  |  Branch (2923:45): [True: 262, False: 0]
  ------------------
 2924|    262|    context->blocknbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 2925|    262|    BLOSC_ERROR_NULL(context->blocknbytes, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    262|    do {                                            \
  |  |  105|    262|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 262]
  |  |  ------------------
  |  |  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|    262|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 262]
  |  |  ------------------
  ------------------
 2926|    262|    context->blockoffsets = malloc((size_t)context->nblocks * sizeof(int32_t));
 2927|    262|    BLOSC_ERROR_NULL(context->blockoffsets, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    262|    do {                                            \
  |  |  105|    262|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 262]
  |  |  ------------------
  |  |  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|    262|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 262]
  |  |  ------------------
  ------------------
 2928|    262|    context->blockcbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 2929|    262|    BLOSC_ERROR_NULL(context->blockcbytes, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|    262|    do {                                            \
  |  |  105|    262|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 262]
  |  |  ------------------
  |  |  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|    262|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 262]
  |  |  ------------------
  ------------------
 2930|       |
 2931|    262|    if (is_lazy) {
  ------------------
  |  Branch (2931:9): [True: 95, False: 167]
  ------------------
 2932|       |      // Lazy VL: block data is on disk, so blocknbytes is unknown at this point.
 2933|       |      // Populate blockcbytes from bstarts differences; blocksize gets max(blockcbytes)
 2934|       |      // as a safe upper bound so tmp buffers are large enough for the lazy block read.
 2935|     95|      int32_t max_csize = 0;
 2936|    123|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (2936:27): [True: 117, False: 6]
  ------------------
 2937|    117|        int32_t bstart = sw32_(context->bstarts + i);
 2938|    117|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (2938:31): [True: 70, False: 47]
  ------------------
 2939|     70|            sw32_(context->bstarts + i + 1) : header->cbytes;
 2940|    117|        if (bstart < bstarts_end || next_bstart <= bstart ||
  ------------------
  |  Branch (2940:13): [True: 5, False: 112]
  |  Branch (2940:37): [True: 43, False: 69]
  ------------------
 2941|     89|            next_bstart > header->cbytes) {
  ------------------
  |  Branch (2941:13): [True: 41, False: 28]
  ------------------
 2942|     89|          BLOSC_TRACE_ERROR("Invalid VL-block offsets in lazy chunk.");
  ------------------
  |  |   93|     89|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     89|    do {                                            \
  |  |  |  |   98|     89|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     89|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 89, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     89|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2943|     89|          return BLOSC2_ERROR_INVALID_HEADER;
 2944|     89|        }
 2945|     28|        context->blocknbytes[i] = 0;   // unknown until block is read from disk
 2946|     28|        context->blockoffsets[i] = 0;  // unknown
 2947|     28|        context->blockcbytes[i] = next_bstart - bstart;
 2948|     28|        if (context->blockcbytes[i] > max_csize) {
  ------------------
  |  Branch (2948:13): [True: 16, False: 12]
  ------------------
 2949|     16|          max_csize = context->blockcbytes[i];
 2950|     16|        }
 2951|     28|      }
 2952|      6|      context->blocksize = max_csize;
 2953|      6|      context->leftover = 0;
 2954|      6|    }
 2955|    167|    else {
 2956|    167|      int32_t max_blocksize = 0;
 2957|    167|      int64_t total_nbytes = 0;
 2958|    167|      int32_t prev_bstart = 0;
 2959|    186|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (2959:27): [True: 181, False: 5]
  ------------------
 2960|    181|        int32_t bstart = sw32_(context->bstarts + i);
 2961|    181|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (2961:31): [True: 65, False: 116]
  ------------------
 2962|    116|            sw32_(context->bstarts + i + 1) : header->cbytes;
 2963|    181|        if (bstart < bstarts_end || bstart <= prev_bstart || next_bstart <= bstart ||
  ------------------
  |  Branch (2963:13): [True: 3, False: 178]
  |  Branch (2963:37): [True: 0, False: 178]
  |  Branch (2963:62): [True: 43, False: 135]
  ------------------
 2964|    135|            next_bstart > header->cbytes || bstart > context->srcsize - (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (2964:13): [True: 45, False: 90]
  |  Branch (2964:45): [True: 3, False: 87]
  ------------------
 2965|     94|          BLOSC_TRACE_ERROR("Invalid VL-block offsets in chunk.");
  ------------------
  |  |   93|     94|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     94|    do {                                            \
  |  |  |  |   98|     94|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     94|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 94, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     94|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2966|     94|          return BLOSC2_ERROR_INVALID_HEADER;
 2967|     94|        }
 2968|     87|        context->blocknbytes[i] = sw32_(context->src + bstart);
 2969|     87|        context->blockcbytes[i] = next_bstart - bstart;
 2970|     87|        if (context->blocknbytes[i] <= 0) {
  ------------------
  |  Branch (2970:13): [True: 24, False: 63]
  ------------------
 2971|     24|          BLOSC_TRACE_ERROR("Invalid VL-block uncompressed size in chunk.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2972|     24|          return BLOSC2_ERROR_INVALID_HEADER;
 2973|     24|        }
 2974|     63|        if (total_nbytes > INT32_MAX) {
  ------------------
  |  Branch (2974:13): [True: 0, False: 63]
  ------------------
 2975|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2976|      0|          return BLOSC2_ERROR_INVALID_HEADER;
 2977|      0|        }
 2978|     63|        context->blockoffsets[i] = (int32_t)total_nbytes;
 2979|     63|        total_nbytes += context->blocknbytes[i];
 2980|     63|        if (total_nbytes > context->sourcesize) {
  ------------------
  |  Branch (2980:13): [True: 44, False: 19]
  ------------------
 2981|     44|          BLOSC_TRACE_ERROR("VL-block sizes exceed chunk nbytes.");
  ------------------
  |  |   93|     44|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     44|    do {                                            \
  |  |  |  |   98|     44|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     44|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 44, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     44|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2982|     44|          return BLOSC2_ERROR_INVALID_HEADER;
 2983|     44|        }
 2984|     19|        if (context->blocknbytes[i] > max_blocksize) {
  ------------------
  |  Branch (2984:13): [True: 14, False: 5]
  ------------------
 2985|     14|          max_blocksize = context->blocknbytes[i];
 2986|     14|        }
 2987|     19|        prev_bstart = bstart;
 2988|     19|      }
 2989|      5|      if (total_nbytes != context->sourcesize) {
  ------------------
  |  Branch (2989:11): [True: 2, False: 3]
  ------------------
 2990|      2|        BLOSC_TRACE_ERROR("VL-block sizes do not add up to chunk nbytes.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2991|      2|        return BLOSC2_ERROR_INVALID_HEADER;
 2992|      2|      }
 2993|      3|      context->blocksize = max_blocksize;
 2994|      3|      context->leftover = 0;
 2995|      3|    }
 2996|    262|  }
 2997|       |
 2998|  15.6k|  return 0;
 2999|  15.8k|}
blosc2.c:load_lazy_chunk_dict:
 2703|     22|static int load_lazy_chunk_dict(blosc2_context* context, blosc_header* header, int32_t bstarts_end) {
 2704|     22|  int32_t dict_offset = bstarts_end;
 2705|     22|  if (header->cbytes < dict_offset + (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (2705:7): [True: 1, False: 21]
  ------------------
 2706|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2707|      1|    return BLOSC2_ERROR_INVALID_HEADER;
 2708|      1|  }
 2709|       |
 2710|     21|  uint8_t dict_size_buf[sizeof(int32_t)];
 2711|     21|  int rc = read_lazy_chunk_bytes(context, dict_offset, dict_size_buf, (int32_t)sizeof(dict_size_buf),
 2712|     21|                                 "Cannot open frame file for lazy chunk dictionary read.",
 2713|     21|                                 "Cannot read lazy chunk dictionary size from disk.");
 2714|     21|  if (rc < 0) {
  ------------------
  |  Branch (2714:7): [True: 21, False: 0]
  ------------------
 2715|     21|    return rc;
 2716|     21|  }
 2717|       |
 2718|      0|  context->dict_size = sw32_(dict_size_buf);
 2719|      0|  if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (2719:7): [True: 0, False: 0]
  |  Branch (2719:34): [True: 0, False: 0]
  ------------------
 2720|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2721|      0|    return BLOSC2_ERROR_CODEC_DICT;
 2722|      0|  }
 2723|      0|  if (header->cbytes < dict_offset + (int32_t)sizeof(int32_t) + context->dict_size) {
  ------------------
  |  Branch (2723:7): [True: 0, False: 0]
  ------------------
 2724|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2725|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 2726|      0|  }
 2727|       |
 2728|      0|  context->dict_buffer = malloc((size_t)context->dict_size);
 2729|      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]
  |  |  ------------------
  ------------------
 2730|      0|  context->dict_buffer_owned = true;
 2731|      0|  rc = read_lazy_chunk_bytes(context, dict_offset + (int32_t)sizeof(int32_t),
 2732|      0|                             context->dict_buffer, context->dict_size,
 2733|      0|                             "Cannot open frame file for lazy chunk dictionary read.",
 2734|      0|                             "Cannot read lazy chunk dictionary from disk.");
 2735|      0|  if (rc < 0) {
  ------------------
  |  Branch (2735:7): [True: 0, False: 0]
  ------------------
 2736|      0|    release_context_dict_buffer(context);
 2737|      0|    return rc;
 2738|      0|  }
 2739|       |
 2740|      0|  context->use_dict = 1;
 2741|      0|#if defined(HAVE_ZSTD)
 2742|      0|  if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2742:7): [True: 0, False: 0]
  ------------------
 2743|      0|    context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 2744|      0|    if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (2744:9): [True: 0, False: 0]
  ------------------
 2745|      0|      release_context_dict_buffer(context);
 2746|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2747|      0|      return BLOSC2_ERROR_CODEC_DICT;
 2748|      0|    }
 2749|      0|  }
 2750|      0|#endif
 2751|       |
 2752|      0|  return 0;
 2753|      0|}
blosc2.c:do_job:
 2382|  15.6k|static int do_job(blosc2_context* context) {
 2383|  15.6k|  int32_t ntbytes;
 2384|       |
 2385|       |  /* Set sentinels */
 2386|  15.6k|  context->dref_not_init = 1;
 2387|       |
 2388|       |  /* Apply thread-count changes before deciding whether this operation actually
 2389|       |     needs a parallel backend.  POSIX defers backend startup for serial jobs.
 2390|       |     Windows keeps its existing per-context thread lifecycle and starts/rebinds
 2391|       |     the backend eagerly. */
 2392|       |#if defined(_WIN32)
 2393|       |  int rc = check_nthreads(context, true);
 2394|       |#else
 2395|  15.6k|  int rc = check_nthreads(context, false);
 2396|  15.6k|#endif
 2397|       |
 2398|       |  /* Run serially with one thread, with fewer than two full blocks of source
 2399|       |     data, or if thread configuration/backend setup fails. */
 2400|  15.6k|  if (context->nthreads == 1 || (context->sourcesize / context->blocksize) <= 1 || rc < 0) {
  ------------------
  |  Branch (2400:7): [True: 15.6k, False: 0]
  |  Branch (2400:33): [True: 0, False: 0]
  |  Branch (2400:84): [True: 0, False: 0]
  ------------------
 2401|  15.6k|    if (ensure_serial_context(context) < 0) {
  ------------------
  |  Branch (2401:9): [True: 0, False: 15.6k]
  ------------------
 2402|      0|      return BLOSC2_ERROR_THREAD_CREATE;
 2403|      0|    }
 2404|  15.6k|    ntbytes = serial_blosc(context->serial_context);
 2405|  15.6k|  }
 2406|      0|  else {
 2407|      0|    rc = check_nthreads(context, true);
 2408|      0|    if (rc < 0) {
  ------------------
  |  Branch (2408:9): [True: 0, False: 0]
  ------------------
 2409|       |      /* Backend startup failed; run serially and retry on the next parallel job. */
 2410|      0|      if (ensure_serial_context(context) < 0) {
  ------------------
  |  Branch (2410:11): [True: 0, False: 0]
  ------------------
 2411|      0|        return BLOSC2_ERROR_THREAD_CREATE;
 2412|      0|      }
 2413|      0|      ntbytes = serial_blosc(context->serial_context);
 2414|      0|    }
 2415|      0|    else {
 2416|      0|      ntbytes = parallel_blosc(context);
 2417|      0|    }
 2418|      0|  }
 2419|       |
 2420|  15.6k|  return ntbytes;
 2421|  15.6k|}
blosc2.c:ensure_serial_context:
 2369|  15.6k|static int ensure_serial_context(blosc2_context* context) {
 2370|  15.6k|  if (context->serial_context == NULL) {
  ------------------
  |  Branch (2370:7): [True: 15.6k, False: 0]
  ------------------
 2371|  15.6k|    context->serial_context = create_thread_context(context, 0);
 2372|  15.6k|  }
 2373|      0|  else if (context->blocksize != context->serial_context->tmp_blocksize) {
  ------------------
  |  Branch (2373:12): [True: 0, False: 0]
  ------------------
 2374|      0|    free_thread_context(context->serial_context);
 2375|      0|    context->serial_context = create_thread_context(context, 0);
 2376|      0|  }
 2377|  15.6k|  return context->serial_context != NULL ? 0 : BLOSC2_ERROR_THREAD_CREATE;
  ------------------
  |  Branch (2377:10): [True: 15.6k, False: 0]
  ------------------
 2378|  15.6k|}
blosc2.c:serial_blosc:
 2183|  15.6k|static int serial_blosc(struct thread_context* thread_context) {
 2184|  15.6k|  blosc2_context* context = thread_context->parent_context;
 2185|  15.6k|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2186|  15.6k|  int32_t j, bsize, leftoverblock;
 2187|  15.6k|  int32_t cbytes;
 2188|  15.6k|  int32_t ntbytes = context->output_bytes;
 2189|  15.6k|  int32_t* bstarts = context->bstarts;
 2190|  15.6k|  uint8_t* tmp = thread_context->tmp;
 2191|  15.6k|  uint8_t* tmp2 = thread_context->tmp2;
 2192|  15.6k|  int dict_training = context->use_dict && (context->dict_cdict == NULL);
  ------------------
  |  Branch (2192:23): [True: 4.05k, False: 11.5k]
  |  Branch (2192:44): [True: 4.05k, False: 0]
  ------------------
 2193|  15.6k|  bool memcpyed = context->header_flags & (uint8_t)BLOSC_MEMCPYED;
 2194|  15.6k|  if (!context->do_compress && context->special_type) {
  ------------------
  |  Branch (2194:7): [True: 15.6k, False: 0]
  |  Branch (2194:32): [True: 165, False: 15.4k]
  ------------------
 2195|       |    // Fake a runlen as if it was a memcpyed chunk
 2196|    165|    memcpyed = true;
 2197|    165|  }
 2198|       |
 2199|   158k|  for (j = 0; j < context->nblocks; j++) {
  ------------------
  |  Branch (2199:15): [True: 157k, False: 980]
  ------------------
 2200|   157k|    if (context->do_compress && !memcpyed && !dict_training) {
  ------------------
  |  Branch (2200:9): [True: 0, False: 157k]
  |  Branch (2200:33): [True: 0, False: 0]
  |  Branch (2200:46): [True: 0, False: 0]
  ------------------
 2201|      0|      _sw32(bstarts + j, ntbytes);
 2202|      0|    }
 2203|   157k|    bsize = vlblocks ? context->blocknbytes[j] : context->blocksize;
  ------------------
  |  Branch (2203:13): [True: 10, False: 157k]
  ------------------
 2204|   157k|    leftoverblock = 0;
 2205|   157k|    if (!vlblocks && (j == context->nblocks - 1) && (context->leftover > 0)) {
  ------------------
  |  Branch (2205:9): [True: 157k, False: 10]
  |  Branch (2205:22): [True: 12.5k, False: 145k]
  |  Branch (2205:53): [True: 481, False: 12.0k]
  ------------------
 2206|    481|      bsize = context->leftover;
 2207|    481|      leftoverblock = 1;
 2208|    481|    }
 2209|   157k|    if (context->do_compress) {
  ------------------
  |  Branch (2209:9): [True: 0, False: 157k]
  ------------------
 2210|      0|      if (memcpyed && !context->prefilter) {
  ------------------
  |  Branch (2210:11): [True: 0, False: 0]
  |  Branch (2210:23): [True: 0, False: 0]
  ------------------
 2211|       |        /* We want to memcpy only */
 2212|      0|        memcpy(context->dest + context->header_overhead + j * context->blocksize,
 2213|      0|               context->src + j * context->blocksize, (unsigned int)bsize);
 2214|      0|        cbytes = (int32_t)bsize;
 2215|      0|      }
 2216|      0|      else {
 2217|       |        /* Regular compression */
 2218|      0|        cbytes = blosc_c(thread_context, bsize, leftoverblock, ntbytes,
 2219|      0|                         context->destsize,
 2220|      0|                         vlblocks ? context->vlblock_sources[j] : context->src,
  ------------------
  |  Branch (2220:26): [True: 0, False: 0]
  ------------------
 2221|      0|                         vlblocks ? 0 : j * context->blocksize,
  ------------------
  |  Branch (2221:26): [True: 0, False: 0]
  ------------------
 2222|      0|                         context->dest + ntbytes, tmp, tmp2);
 2223|      0|        if (cbytes == 0) {
  ------------------
  |  Branch (2223:13): [True: 0, False: 0]
  ------------------
 2224|      0|          ntbytes = 0;              /* incompressible data */
 2225|      0|          break;
 2226|      0|        }
 2227|      0|      }
 2228|      0|    }
 2229|   157k|    else {
 2230|       |      /* Regular decompression */
 2231|       |      // If memcpyed we don't have a bstarts section (because it is not needed)
 2232|   157k|      int32_t src_offset = memcpyed ?
  ------------------
  |  Branch (2232:28): [True: 133k, False: 23.9k]
  ------------------
 2233|   133k|          context->header_overhead + j * context->blocksize : sw32_(bstarts + j);
 2234|   157k|      uint8_t *dest_block = (vlblocks && context->vlblock_dests != NULL) ? context->vlblock_dests[j] : context->dest;
  ------------------
  |  Branch (2234:30): [True: 10, False: 157k]
  |  Branch (2234:42): [True: 0, False: 10]
  ------------------
 2235|   157k|      int32_t dest_offset = (vlblocks && context->vlblock_dests != NULL) ? 0 :
  ------------------
  |  Branch (2235:30): [True: 10, False: 157k]
  |  Branch (2235:42): [True: 0, False: 10]
  ------------------
 2236|   157k|                            (vlblocks ? context->blockoffsets[j] : j * context->blocksize);
  ------------------
  |  Branch (2236:30): [True: 10, False: 157k]
  ------------------
 2237|   157k|      cbytes = blosc_d(thread_context, bsize, leftoverblock, memcpyed,
 2238|   157k|                       context->src, context->srcsize, src_offset, j,
 2239|   157k|                       dest_block, dest_offset, tmp, tmp2);
 2240|   157k|    }
 2241|       |
 2242|   157k|    if (cbytes < 0) {
  ------------------
  |  Branch (2242:9): [True: 14.6k, False: 143k]
  ------------------
 2243|  14.6k|      ntbytes = cbytes;         /* error in blosc_c or blosc_d */
 2244|  14.6k|      break;
 2245|  14.6k|    }
 2246|   143k|    ntbytes += cbytes;
 2247|   143k|  }
 2248|       |
 2249|  15.6k|  return ntbytes;
 2250|  15.6k|}
blosc2.c:read_lazy_chunk_bytes:
 2616|     21|                                 const char* open_error, const char* read_error) {
 2617|     21|  int32_t chunk_cbytes;
 2618|     21|  if (context->src == NULL || context->srcsize < BLOSC_EXTENDED_HEADER_LENGTH ||
  ------------------
  |  Branch (2618:7): [True: 0, False: 21]
  |  Branch (2618:31): [True: 0, False: 21]
  ------------------
 2619|     21|      offset < 0 || nbytes < 0 || context->nblocks <= 0 ||
  ------------------
  |  Branch (2619:7): [True: 0, False: 21]
  |  Branch (2619:21): [True: 0, False: 21]
  |  Branch (2619:35): [True: 0, False: 21]
  ------------------
 2620|     21|      blosc2_cbuffer_sizes(context->src, NULL, &chunk_cbytes, NULL) < 0 ||
  ------------------
  |  Branch (2620:7): [True: 0, False: 21]
  ------------------
 2621|     21|      offset > chunk_cbytes || nbytes > chunk_cbytes - offset) {
  ------------------
  |  Branch (2621:7): [True: 0, False: 21]
  |  Branch (2621:32): [True: 0, False: 21]
  ------------------
 2622|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 2623|      0|  }
 2624|     21|  int64_t trailer_end = BLOSC_EXTENDED_HEADER_LENGTH +
 2625|     21|      (int64_t)context->nblocks * sizeof(int32_t) + sizeof(int32_t) + sizeof(int64_t);
 2626|     21|  if (trailer_end > context->srcsize) return BLOSC2_ERROR_READ_BUFFER;
  ------------------
  |  Branch (2626:7): [True: 8, False: 13]
  ------------------
 2627|     13|  if (context->schunk == NULL || context->schunk->frame == NULL) {
  ------------------
  |  Branch (2627:7): [True: 13, False: 0]
  |  Branch (2627:34): [True: 0, False: 0]
  ------------------
 2628|     13|    BLOSC_TRACE_ERROR("Lazy chunk needs an associated super-chunk with a frame.");
  ------------------
  |  |   93|     13|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     13|    do {                                            \
  |  |  |  |   98|     13|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     13|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     13|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2629|     13|    return BLOSC2_ERROR_INVALID_PARAM;
 2630|     13|  }
 2631|       |
 2632|      0|  blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 2633|      0|  blosc2_io_cb* io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 2634|      0|  if (io_cb == NULL) {
  ------------------
  |  Branch (2634:7): [True: 0, False: 0]
  ------------------
 2635|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2636|      0|    return BLOSC2_ERROR_PLUGIN_IO;
 2637|      0|  }
 2638|       |
 2639|      0|  int32_t trailer_offset = BLOSC_EXTENDED_HEADER_LENGTH +
 2640|      0|                           context->nblocks * (int32_t)sizeof(int32_t);
 2641|      0|  int32_t nchunk_lazy;
 2642|      0|  int64_t chunk_offset;
 2643|      0|  memcpy(&nchunk_lazy, context->src + trailer_offset, sizeof(nchunk_lazy));
 2644|      0|  memcpy(&chunk_offset, context->src + trailer_offset + (int32_t)sizeof(int32_t), sizeof(chunk_offset));
 2645|      0|  if (nchunk_lazy < 0 || chunk_offset < 0 || frame->file_offset < 0 ||
  ------------------
  |  Branch (2645:7): [True: 0, False: 0]
  |  Branch (2645:26): [True: 0, False: 0]
  |  Branch (2645:46): [True: 0, False: 0]
  ------------------
 2646|      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 (2646:8): [True: 0, False: 0]
  |  Branch (2646:27): [True: 0, False: 0]
  ------------------
 2647|      0|       chunk_offset > frame->len || chunk_cbytes > frame->len - chunk_offset))) {
  ------------------
  |  Branch (2647:8): [True: 0, False: 0]
  |  Branch (2647:37): [True: 0, False: 0]
  ------------------
 2648|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 2649|      0|  }
 2650|       |
 2651|      0|  void* fp = NULL;
 2652|      0|  int64_t io_pos;
 2653|      0|  if (frame->sframe) {
  ------------------
  |  Branch (2653:7): [True: 0, False: 0]
  ------------------
 2654|      0|    fp = sframe_open_chunk(frame->urlpath, nchunk_lazy, "rb", context->schunk->storage->io);
 2655|      0|    io_pos = offset;
 2656|      0|  }
 2657|      0|  else {
 2658|      0|    if (chunk_offset < 0 || offset < 0) {
  ------------------
  |  Branch (2658:9): [True: 0, False: 0]
  |  Branch (2658:29): [True: 0, False: 0]
  ------------------
 2659|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2660|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2661|      0|    }
 2662|      0|    fp = frame_reader_acquire(frame, context->schunk->storage->io);
 2663|      0|    if (!blosc2_checked_add_i64(frame->file_offset, chunk_offset, &io_pos)) {
  ------------------
  |  Branch (2663:9): [True: 0, False: 0]
  ------------------
 2664|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2665|      0|      if (fp != NULL) {
  ------------------
  |  Branch (2665:11): [True: 0, False: 0]
  ------------------
 2666|      0|        frame_reader_release(frame, io_cb, fp);
 2667|      0|      }
 2668|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2669|      0|    }
 2670|      0|    if (!blosc2_checked_add_i64(io_pos, offset, &io_pos)) {
  ------------------
  |  Branch (2670:9): [True: 0, False: 0]
  ------------------
 2671|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2672|      0|      if (fp != NULL) {
  ------------------
  |  Branch (2672:11): [True: 0, False: 0]
  ------------------
 2673|      0|        frame_reader_release(frame, io_cb, fp);
 2674|      0|      }
 2675|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2676|      0|    }
 2677|      0|  }
 2678|      0|  if (fp == NULL) {
  ------------------
  |  Branch (2678:7): [True: 0, False: 0]
  ------------------
 2679|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2680|      0|    return BLOSC2_ERROR_FILE_OPEN;
 2681|      0|  }
 2682|      0|  if (!blosc2_checked_add_i64(io_pos, nbytes, NULL)) {
  ------------------
  |  Branch (2682:7): [True: 0, False: 0]
  ------------------
 2683|      0|    frame_reader_release(frame, io_cb, fp);
 2684|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 2685|      0|  }
 2686|       |
 2687|      0|  uint8_t* read_buffer = buffer;
 2688|      0|  int64_t rbytes = io_cb->read((void**)&read_buffer, 1, nbytes, io_pos, fp);
 2689|      0|  frame_reader_release(frame, io_cb, fp);
 2690|      0|  if (read_buffer != buffer) {
  ------------------
  |  Branch (2690:7): [True: 0, False: 0]
  ------------------
 2691|      0|    if (rbytes == nbytes && read_buffer != NULL) memcpy(buffer, read_buffer, (size_t)nbytes);
  ------------------
  |  Branch (2691:9): [True: 0, False: 0]
  |  Branch (2691:29): [True: 0, False: 0]
  ------------------
 2692|      0|    free(read_buffer);
 2693|      0|  }
 2694|      0|  if (rbytes != nbytes || read_buffer == NULL) {
  ------------------
  |  Branch (2694:7): [True: 0, False: 0]
  |  Branch (2694:27): [True: 0, False: 0]
  ------------------
 2695|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2696|      0|    return BLOSC2_ERROR_FILE_READ;
 2697|      0|  }
 2698|       |
 2699|      0|  return 0;
 2700|      0|}
blosc2.c:create_thread_context:
 2286|  15.6k|create_thread_context(blosc2_context* context, int32_t tid) {
 2287|  15.6k|  struct thread_context* thread_context;
 2288|  15.6k|  thread_context = (struct thread_context*)my_malloc(sizeof(struct thread_context));
 2289|  15.6k|  BLOSC_ERROR_NULL(thread_context, NULL);
  ------------------
  |  |  104|  15.6k|    do {                                            \
  |  |  105|  15.6k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 15.6k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  15.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 15.6k]
  |  |  ------------------
  ------------------
 2290|  15.6k|  int rc = init_thread_context(thread_context, context, tid);
 2291|  15.6k|  if (rc < 0) {
  ------------------
  |  Branch (2291:7): [True: 0, False: 15.6k]
  ------------------
 2292|      0|    return NULL;
 2293|      0|  }
 2294|  15.6k|  return thread_context;
 2295|  15.6k|}
blosc2.c:init_thread_context:
 2256|  15.6k|{
 2257|  15.6k|  int32_t ebsize;
 2258|       |
 2259|  15.6k|  thread_context->parent_context = context;
 2260|  15.6k|  thread_context->owner_pool = NULL;
 2261|  15.6k|  thread_context->tid = tid;
 2262|       |
 2263|  15.6k|  int32_t blocksize = context != NULL ? context->blocksize : 0;
  ------------------
  |  Branch (2263:23): [True: 15.6k, False: 0]
  ------------------
 2264|  15.6k|  int32_t typesize = context != NULL ? context->typesize : 0;
  ------------------
  |  Branch (2264:22): [True: 15.6k, False: 0]
  ------------------
 2265|  15.6k|  ebsize = blocksize + typesize * (signed)sizeof(int32_t);
 2266|  15.6k|  thread_context->tmp_nbytes = (size_t)4 * ebsize;
 2267|  15.6k|  thread_context->tmp = my_malloc(thread_context->tmp_nbytes);
 2268|  15.6k|  BLOSC_ERROR_NULL(thread_context->tmp, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|  15.6k|    do {                                            \
  |  |  105|  15.6k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 15.6k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  15.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 15.6k]
  |  |  ------------------
  ------------------
 2269|  15.6k|  thread_context->tmp2 = thread_context->tmp + ebsize;
 2270|  15.6k|  thread_context->tmp3 = thread_context->tmp2 + ebsize;
 2271|  15.6k|  thread_context->tmp4 = thread_context->tmp3 + ebsize;
 2272|  15.6k|  thread_context->tmp_blocksize = blocksize;
 2273|  15.6k|  thread_context->zfp_cell_nitems = 0;
 2274|  15.6k|  thread_context->zfp_cell_start = 0;
 2275|  15.6k|  #if defined(HAVE_ZSTD)
 2276|  15.6k|  thread_context->zstd_cctx = NULL;
 2277|  15.6k|  thread_context->zstd_dctx = NULL;
 2278|  15.6k|  #endif
 2279|  15.6k|  thread_context->lz4_cstream = NULL;
 2280|  15.6k|  thread_context->lz4hc_cstream = NULL;
 2281|       |
 2282|  15.6k|  return 0;
 2283|  15.6k|}
blosc2.c:blosc_d:
 1733|   157k|    int32_t nblock, uint8_t* dest, int32_t dest_offset, uint8_t* tmp, uint8_t* tmp2) {
 1734|   157k|  blosc2_context* context = thread_context->parent_context;
 1735|   157k|  uint8_t* filters = context->filters;
 1736|   157k|  uint8_t *tmp3 = thread_context->tmp4;
 1737|   157k|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 1738|   157k|  int32_t compformat = (context->header_flags & (uint8_t)0xe0) >> 5u;
 1739|   157k|  int dont_split = (context->header_flags & 0x10) >> 4;
 1740|   157k|  int32_t chunk_nbytes;
 1741|   157k|  int32_t chunk_cbytes;
 1742|   157k|  int nstreams;
 1743|   157k|  int32_t neblock;
 1744|   157k|  int32_t nbytes;                /* number of decompressed bytes in split */
 1745|   157k|  int32_t cbytes;                /* number of compressed bytes in split */
 1746|       |  // int32_t ctbytes = 0;           /* number of compressed bytes in block */
 1747|   157k|  int32_t ntbytes = 0;           /* number of uncompressed bytes in block */
 1748|   157k|  uint8_t* _dest;
 1749|   157k|  int32_t typesize = context->typesize;
 1750|   157k|  bool instr_codec = context->blosc2_flags & BLOSC2_INSTR_CODEC;
 1751|   157k|  const char* compname;
 1752|   157k|  int rc;
 1753|       |
 1754|   157k|  if (context->block_maskout != NULL && context->block_maskout[nblock]) {
  ------------------
  |  Branch (1754:7): [True: 0, False: 157k]
  |  Branch (1754:41): [True: 0, False: 0]
  ------------------
 1755|       |    // Do not decompress, but act as if we successfully decompressed everything
 1756|      0|    return bsize;
 1757|      0|  }
 1758|       |
 1759|   157k|  rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 1760|   157k|  if (rc < 0) {
  ------------------
  |  Branch (1760:7): [True: 0, False: 157k]
  ------------------
 1761|      0|    return rc;
 1762|      0|  }
 1763|   157k|  if (context->special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (1763:7): [True: 206, False: 157k]
  ------------------
 1764|       |    // We need the actual typesize in this case, but it cannot be encoded in the header, so derive it from cbytes
 1765|    206|    typesize = chunk_cbytes - context->header_overhead;
 1766|    206|  }
 1767|       |
 1768|       |  // In some situations (lazychunks) the context can arrive uninitialized
 1769|       |  // (but BITSHUFFLE needs it for accessing the format of the chunk)
 1770|   157k|  if (context->src == NULL) {
  ------------------
  |  Branch (1770:7): [True: 0, False: 157k]
  ------------------
 1771|      0|    context->src = src;
 1772|      0|  }
 1773|       |
 1774|       |  // Chunks with special values cannot be lazy
 1775|   157k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (1775:19): [True: 147k, False: 10.0k]
  ------------------
 1776|   147k|          (context->blosc2_flags & 0x08u) && !context->special_type);
  ------------------
  |  Branch (1776:11): [True: 435, False: 147k]
  |  Branch (1776:46): [True: 7, False: 428]
  ------------------
 1777|   157k|  if (is_lazy) {
  ------------------
  |  Branch (1777:7): [True: 7, False: 157k]
  ------------------
 1778|       |    // The chunk is on disk, so just lazily load the block
 1779|      7|    if (context->schunk == NULL) {
  ------------------
  |  Branch (1779:9): [True: 7, False: 0]
  ------------------
 1780|      7|      BLOSC_TRACE_ERROR("Lazy chunk needs an associated super-chunk.");
  ------------------
  |  |   93|      7|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      7|    do {                                            \
  |  |  |  |   98|      7|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      7|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      7|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1781|      7|      return BLOSC2_ERROR_INVALID_PARAM;
 1782|      7|    }
 1783|      0|    if (context->schunk->frame == NULL) {
  ------------------
  |  Branch (1783:9): [True: 0, False: 0]
  ------------------
 1784|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1785|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 1786|      0|    }
 1787|      0|    blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 1788|      0|    size_t bstarts_nbytes;
 1789|      0|    size_t trailer_offset;
 1790|      0|    size_t block_csizes_nbytes;
 1791|      0|    size_t trailer_meta_nbytes;
 1792|      0|    size_t lazy_trailer_end;
 1793|      0|    if (srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (1793:9): [True: 0, False: 0]
  |  Branch (1793:24): [True: 0, False: 0]
  ------------------
 1794|      0|        !blosc2_checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (1794:9): [True: 0, False: 0]
  ------------------
 1795|      0|        !blosc2_checked_add_size((size_t)BLOSC_EXTENDED_HEADER_LENGTH, bstarts_nbytes, &trailer_offset) ||
  ------------------
  |  Branch (1795:9): [True: 0, False: 0]
  ------------------
 1796|      0|        !blosc2_checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (1796:9): [True: 0, False: 0]
  ------------------
 1797|      0|        !blosc2_checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (1797:9): [True: 0, False: 0]
  ------------------
 1798|      0|        !blosc2_checked_add_size(trailer_offset, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (1798:9): [True: 0, False: 0]
  ------------------
 1799|      0|        (size_t)srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (1799:9): [True: 0, False: 0]
  ------------------
 1800|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1801|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1802|      0|    }
 1803|      0|    int32_t nchunk;
 1804|      0|    int64_t chunk_offset;
 1805|       |    // The nchunk and the offset of the current chunk are in the trailer
 1806|      0|    memcpy(&nchunk, src + trailer_offset, sizeof(nchunk));
 1807|      0|    memcpy(&chunk_offset, src + trailer_offset + sizeof(int32_t), sizeof(chunk_offset));
 1808|       |    // Get the csize of the nblock
 1809|      0|    if (nblock < 0 || nblock >= context->nblocks) {
  ------------------
  |  Branch (1809:9): [True: 0, False: 0]
  |  Branch (1809:23): [True: 0, False: 0]
  ------------------
 1810|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1811|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1812|      0|    }
 1813|      0|    int32_t *block_csizes = (int32_t *)(src + trailer_offset + sizeof(int32_t) + sizeof(int64_t));
 1814|      0|    int32_t block_csize = block_csizes[nblock];
 1815|      0|    int32_t max_lazy_block_csize = context->blocksize + context->typesize * (signed)sizeof(int32_t);
 1816|      0|    if (block_csize <= 0 || block_csize > max_lazy_block_csize) {
  ------------------
  |  Branch (1816:9): [True: 0, False: 0]
  |  Branch (1816:29): [True: 0, False: 0]
  ------------------
 1817|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1818|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1819|      0|    }
 1820|      0|    if (vlblocks && block_csize <= (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (1820:9): [True: 0, False: 0]
  |  Branch (1820:21): [True: 0, False: 0]
  ------------------
 1821|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1822|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1823|      0|    }
 1824|       |    // Read the lazy block on disk
 1825|      0|    void* fp = NULL;
 1826|      0|    blosc2_io_cb *io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 1827|      0|    if (io_cb == NULL) {
  ------------------
  |  Branch (1827:9): [True: 0, False: 0]
  ------------------
 1828|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1829|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 1830|      0|    }
 1831|       |
 1832|      0|    int64_t io_pos = 0;
 1833|      0|    if (frame->sframe) {
  ------------------
  |  Branch (1833:9): [True: 0, False: 0]
  ------------------
 1834|       |      // The chunk is not in the frame
 1835|      0|      fp = sframe_open_chunk(frame->urlpath, nchunk, "rb", context->schunk->storage->io);
 1836|      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]
  |  |  ------------------
  ------------------
 1837|       |      // The offset of the block is src_offset
 1838|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (1838:11): [True: 0, False: 0]
  ------------------
 1839|      0|        frame_reader_release(frame, io_cb, fp);
 1840|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1841|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1842|      0|      }
 1843|      0|      io_pos = src_offset;
 1844|      0|    }
 1845|      0|    else {
 1846|      0|      fp = frame_reader_acquire(frame, context->schunk->storage->io);
 1847|      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]
  |  |  ------------------
  ------------------
 1848|       |      // The offset of the block is src_offset
 1849|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (1849:11): [True: 0, False: 0]
  ------------------
 1850|      0|        frame_reader_release(frame, io_cb, fp);
 1851|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1852|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1853|      0|      }
 1854|      0|      if (chunk_offset < 0) {
  ------------------
  |  Branch (1854:11): [True: 0, False: 0]
  ------------------
 1855|      0|        frame_reader_release(frame, io_cb, fp);
 1856|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1857|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1858|      0|      }
 1859|      0|      if (!blosc2_checked_add_i64(frame->file_offset, chunk_offset, &io_pos)) {
  ------------------
  |  Branch (1859:11): [True: 0, False: 0]
  ------------------
 1860|      0|        frame_reader_release(frame, io_cb, fp);
 1861|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1862|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1863|      0|      }
 1864|      0|      if (!blosc2_checked_add_i64(io_pos, src_offset, &io_pos)) {
  ------------------
  |  Branch (1864:11): [True: 0, False: 0]
  ------------------
 1865|      0|        frame_reader_release(frame, io_cb, fp);
 1866|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1867|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1868|      0|      }
 1869|      0|    }
 1870|       |    // We can make use of tmp3 because it will be used after src is not needed anymore
 1871|      0|    int64_t rbytes = io_cb->read((void**)&tmp3, 1, block_csize, io_pos, fp);
 1872|      0|    frame_reader_release(frame, io_cb, fp);
 1873|      0|    if ((int32_t)rbytes != block_csize) {
  ------------------
  |  Branch (1873:9): [True: 0, False: 0]
  ------------------
 1874|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1875|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1876|      0|    }
 1877|      0|    src = tmp3;
 1878|      0|    src_offset = 0;
 1879|      0|    srcsize = block_csize;
 1880|      0|  }
 1881|       |
 1882|       |  // If the chunk is memcpyed, we just have to copy the block to dest and return
 1883|   157k|  if (memcpyed) {
  ------------------
  |  Branch (1883:7): [True: 133k, False: 23.9k]
  ------------------
 1884|   133k|    int bsize_ = leftoverblock ? chunk_nbytes % context->blocksize : bsize;
  ------------------
  |  Branch (1884:18): [True: 41, False: 133k]
  ------------------
 1885|   133k|    if (!context->special_type) {
  ------------------
  |  Branch (1885:9): [True: 306, False: 133k]
  ------------------
 1886|    306|      if (chunk_nbytes + context->header_overhead != chunk_cbytes) {
  ------------------
  |  Branch (1886:11): [True: 0, False: 306]
  ------------------
 1887|      0|        return BLOSC2_ERROR_WRITE_BUFFER;
 1888|      0|      }
 1889|    306|      if (chunk_cbytes < context->header_overhead + (nblock * context->blocksize) + bsize_) {
  ------------------
  |  Branch (1889:11): [True: 0, False: 306]
  ------------------
 1890|       |        /* Not enough input to copy block */
 1891|      0|        return BLOSC2_ERROR_READ_BUFFER;
 1892|      0|      }
 1893|    306|    }
 1894|   133k|    if (!is_lazy) {
  ------------------
  |  Branch (1894:9): [True: 133k, False: 0]
  ------------------
 1895|   133k|      src += context->header_overhead + nblock * context->blocksize;
 1896|   133k|    }
 1897|   133k|    _dest = dest + dest_offset;
 1898|   133k|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (1898:9): [True: 0, False: 133k]
  ------------------
 1899|       |      // We are making use of a postfilter, so use a temp for destination
 1900|      0|      _dest = tmp;
 1901|      0|    }
 1902|   133k|    rc = 0;
 1903|   133k|    switch (context->special_type) {
 1904|    206|      case BLOSC2_SPECIAL_VALUE:
  ------------------
  |  Branch (1904:7): [True: 206, False: 133k]
  ------------------
 1905|       |        // All repeated values
 1906|    206|        rc = set_values(typesize, context->src, _dest, bsize_);
 1907|    206|        if (rc < 0) {
  ------------------
  |  Branch (1907:13): [True: 2, False: 204]
  ------------------
 1908|      2|          BLOSC_TRACE_ERROR("set_values failed");
  ------------------
  |  |   93|      2|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      2|    do {                                            \
  |  |  |  |   98|      2|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      2|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      2|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1909|      2|          return BLOSC2_ERROR_DATA;
 1910|      2|        }
 1911|    204|        break;
 1912|    803|      case BLOSC2_SPECIAL_NAN:
  ------------------
  |  Branch (1912:7): [True: 803, False: 133k]
  ------------------
 1913|    803|        rc = set_nans(context->typesize, _dest, bsize_);
 1914|    803|        if (rc < 0) {
  ------------------
  |  Branch (1914:13): [True: 6, False: 797]
  ------------------
 1915|      6|          BLOSC_TRACE_ERROR("set_nans failed");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1916|      6|          return BLOSC2_ERROR_DATA;
 1917|      6|        }
 1918|    797|        break;
 1919|   132k|      case BLOSC2_SPECIAL_ZERO:
  ------------------
  |  Branch (1919:7): [True: 132k, False: 1.54k]
  ------------------
 1920|   132k|        memset(_dest, 0, bsize_);
 1921|   132k|        break;
 1922|    231|      case BLOSC2_SPECIAL_UNINIT:
  ------------------
  |  Branch (1922:7): [True: 231, False: 133k]
  ------------------
 1923|       |        // We do nothing here
 1924|    231|        break;
 1925|    306|      default:
  ------------------
  |  Branch (1925:7): [True: 306, False: 133k]
  ------------------
 1926|    306|        memcpy(_dest, src, bsize_);
 1927|   133k|    }
 1928|   133k|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (1928:9): [True: 0, False: 133k]
  ------------------
 1929|       |      // Create new postfilter parameters for this block (must be private for each thread)
 1930|      0|      blosc2_postfilter_params postparams;
 1931|      0|      memcpy(&postparams, context->postparams, sizeof(postparams));
 1932|      0|      postparams.input = tmp;
 1933|      0|      postparams.output = dest + dest_offset;
 1934|      0|      postparams.size = bsize;
 1935|      0|      postparams.typesize = typesize;
 1936|      0|      postparams.offset = nblock * context->blocksize;
 1937|      0|      postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (1937:27): [True: 0, False: 0]
  ------------------
 1938|      0|      postparams.nblock = nblock;
 1939|      0|      postparams.tid = thread_context->tid;
 1940|      0|      postparams.ttmp = thread_context->tmp;
 1941|      0|      postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 1942|      0|      postparams.ctx = context;
 1943|       |
 1944|       |      // Execute the postfilter (the processed block will be copied to dest)
 1945|      0|      if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (1945:11): [True: 0, False: 0]
  ------------------
 1946|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1947|      0|        return BLOSC2_ERROR_POSTFILTER;
 1948|      0|      }
 1949|      0|    }
 1950|   133k|    thread_context->zfp_cell_nitems = 0;
 1951|       |
 1952|   133k|    return bsize_;
 1953|   133k|  }
 1954|       |
 1955|  23.9k|  if (!is_lazy && (src_offset <= 0 || src_offset >= srcsize)) {
  ------------------
  |  Branch (1955:7): [True: 23.9k, False: 0]
  |  Branch (1955:20): [True: 179, False: 23.7k]
  |  Branch (1955:39): [True: 314, False: 23.4k]
  ------------------
 1956|       |    /* Invalid block src offset encountered */
 1957|    493|    return BLOSC2_ERROR_DATA;
 1958|    493|  }
 1959|       |
 1960|  23.4k|  src += src_offset;
 1961|  23.4k|  if (vlblocks) {
  ------------------
  |  Branch (1961:7): [True: 4, False: 23.4k]
  ------------------
 1962|      4|    if (context->blockcbytes == NULL || nblock >= context->nblocks ||
  ------------------
  |  Branch (1962:9): [True: 0, False: 4]
  |  Branch (1962:41): [True: 0, False: 4]
  ------------------
 1963|      4|        context->blockcbytes[nblock] <= (int32_t)sizeof(int32_t) ||
  ------------------
  |  Branch (1963:9): [True: 1, False: 3]
  ------------------
 1964|      3|        src_offset > srcsize - context->blockcbytes[nblock]) {
  ------------------
  |  Branch (1964:9): [True: 0, False: 3]
  ------------------
 1965|      1|      return BLOSC2_ERROR_DATA;
 1966|      1|    }
 1967|      3|    srcsize = context->blockcbytes[nblock];
 1968|      3|  }
 1969|  23.4k|  else {
 1970|  23.4k|    srcsize -= src_offset;
 1971|  23.4k|  }
 1972|       |
 1973|  23.4k|  int last_filter_index = last_filter(filters, 'd');
 1974|  23.4k|  if (instr_codec) {
  ------------------
  |  Branch (1974:7): [True: 2.90k, False: 20.5k]
  ------------------
 1975|       |    // If instrumented, we don't want to run the filters
 1976|  2.90k|    _dest = dest + dest_offset;
 1977|  2.90k|  }
 1978|  20.5k|  else if (((last_filter_index >= 0) &&
  ------------------
  |  Branch (1978:13): [True: 17.0k, False: 3.50k]
  ------------------
 1979|  17.0k|       (next_filter(filters, BLOSC2_MAX_FILTERS, 'd') != BLOSC_DELTA)) ||
  ------------------
  |  Branch (1979:8): [True: 12.6k, False: 4.37k]
  ------------------
 1980|  12.6k|    context->postfilter != NULL) {
  ------------------
  |  Branch (1980:5): [True: 0, False: 7.88k]
  ------------------
 1981|       |    // We are making use of some filter, so use a temp for destination
 1982|  12.6k|    _dest = tmp;
 1983|  12.6k|  }
 1984|  7.88k|  else {
 1985|       |    // If no filters, or only DELTA in pipeline
 1986|  7.88k|    _dest = dest + dest_offset;
 1987|  7.88k|  }
 1988|       |
 1989|       |  /* The number of compressed data streams for this block */
 1990|  23.4k|  if (vlblocks) {
  ------------------
  |  Branch (1990:7): [True: 3, False: 23.4k]
  ------------------
 1991|      3|    nstreams = 1;
 1992|      3|  }
 1993|  23.4k|  else if (!dont_split && !leftoverblock) {
  ------------------
  |  Branch (1993:12): [True: 3.29k, False: 20.1k]
  |  Branch (1993:27): [True: 3.27k, False: 18]
  ------------------
 1994|  3.27k|    nstreams = context->typesize;
 1995|  3.27k|  }
 1996|  20.1k|  else {
 1997|  20.1k|    nstreams = 1;
 1998|  20.1k|  }
 1999|       |
 2000|  23.4k|  neblock = bsize / nstreams;
 2001|  23.4k|  if (neblock == 0) {
  ------------------
  |  Branch (2001:7): [True: 3, False: 23.4k]
  ------------------
 2002|       |    /* Not enough space to output bytes */
 2003|      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]
  |  |  ------------------
  ------------------
 2004|      3|  }
 2005|       |  /* The splits must cover the whole block, or part of tmp is left unwritten */
 2006|  23.4k|  if (neblock * nstreams != bsize) {
  ------------------
  |  Branch (2006:7): [True: 12, False: 23.3k]
  ------------------
 2007|     12|    BLOSC_ERROR(BLOSC2_ERROR_DATA);
  ------------------
  |  |  111|     12|    do {                                            \
  |  |  112|     12|        int rc_ = (rc);                             \
  |  |  113|     12|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 12, False: 0]
  |  |  ------------------
  |  |  114|     12|            char *error_msg = print_error(rc_);     \
  |  |  115|     12|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|     12|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     12|    do {                                            \
  |  |  |  |  |  |   98|     12|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     12|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 12, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     12|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|     12|            return rc_;                             \
  |  |  117|     12|        }                                           \
  |  |  118|     12|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2008|     12|  }
 2009|  33.0k|  for (int j = 0; j < nstreams; j++) {
  ------------------
  |  Branch (2009:19): [True: 23.5k, False: 9.50k]
  ------------------
 2010|  23.5k|    if (vlblocks) {
  ------------------
  |  Branch (2010:9): [True: 3, False: 23.5k]
  ------------------
 2011|      3|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2011:11): [True: 0, False: 3]
  ------------------
 2012|       |        /* Not enough input to read compressed bytes */
 2013|      0|        return BLOSC2_ERROR_READ_BUFFER;
 2014|      0|      }
 2015|      3|      neblock = sw32_(src);
 2016|      3|      if (neblock != bsize) {
  ------------------
  |  Branch (2016:11): [True: 0, False: 3]
  ------------------
 2017|      0|        return BLOSC2_ERROR_DATA;
 2018|      0|      }
 2019|      3|      src += sizeof(int32_t);
 2020|      3|      cbytes = srcsize - (int32_t)sizeof(int32_t);
 2021|      3|      srcsize = 0;
 2022|      3|    }
 2023|  23.5k|    else {
 2024|  23.5k|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2024:11): [True: 10, False: 23.5k]
  ------------------
 2025|       |        /* Not enough input to read compressed size */
 2026|     10|        return BLOSC2_ERROR_READ_BUFFER;
 2027|     10|      }
 2028|  23.5k|      srcsize -= sizeof(int32_t);
 2029|  23.5k|      cbytes = sw32_(src);      /* amount of compressed bytes */
 2030|  23.5k|      if (cbytes > 0) {
  ------------------
  |  Branch (2030:11): [True: 21.4k, False: 2.10k]
  ------------------
 2031|  21.4k|        if (srcsize < cbytes) {
  ------------------
  |  Branch (2031:13): [True: 96, False: 21.3k]
  ------------------
 2032|       |          /* Not enough input to read compressed bytes */
 2033|     96|          return BLOSC2_ERROR_READ_BUFFER;
 2034|     96|        }
 2035|  21.3k|        srcsize -= cbytes;
 2036|  21.3k|      }
 2037|  23.4k|      src += sizeof(int32_t);
 2038|  23.4k|    }
 2039|       |    // ctbytes += (signed)sizeof(int32_t);
 2040|       |
 2041|       |    /* Uncompress */
 2042|  23.4k|    if (!vlblocks && cbytes == 0) {
  ------------------
  |  Branch (2042:9): [True: 23.4k, False: 3]
  |  Branch (2042:22): [True: 1.56k, False: 21.9k]
  ------------------
 2043|       |      // A run of 0's
 2044|  1.56k|      memset(_dest, 0, (unsigned int)neblock);
 2045|  1.56k|      nbytes = neblock;
 2046|  1.56k|    }
 2047|  21.9k|    else if (!vlblocks && cbytes < 0) {
  ------------------
  |  Branch (2047:14): [True: 21.9k, False: 3]
  |  Branch (2047:27): [True: 541, False: 21.3k]
  ------------------
 2048|       |      // A negative number means some encoding depending on the token that comes next
 2049|    541|      uint8_t token;
 2050|       |
 2051|    541|      if (srcsize < (signed)sizeof(uint8_t)) {
  ------------------
  |  Branch (2051:11): [True: 11, False: 530]
  ------------------
 2052|       |        // Not enough input to read token */
 2053|     11|        return BLOSC2_ERROR_READ_BUFFER;
 2054|     11|      }
 2055|    530|      srcsize -= sizeof(uint8_t);
 2056|       |
 2057|    530|      token = src[0];
 2058|    530|      src += 1;
 2059|       |      // ctbytes += 1;
 2060|       |
 2061|    530|      if (token & 0x1) {
  ------------------
  |  Branch (2061:11): [True: 507, False: 23]
  ------------------
 2062|       |        // A run of bytes that are different than 0
 2063|    507|        if (cbytes < -255) {
  ------------------
  |  Branch (2063:13): [True: 70, False: 437]
  ------------------
 2064|       |          // Runs can only encode a byte
 2065|     70|          return BLOSC2_ERROR_RUN_LENGTH;
 2066|     70|        }
 2067|    437|        uint8_t value = -cbytes;
 2068|    437|        memset(_dest, value, (unsigned int)neblock);
 2069|    437|      } else {
 2070|     23|        BLOSC_TRACE_ERROR("Invalid or unsupported compressed stream token value - %d", token);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2071|     23|        return BLOSC2_ERROR_RUN_LENGTH;
 2072|     23|      }
 2073|    437|      nbytes = neblock;
 2074|    437|      cbytes = 0;  // everything is encoded in the cbytes token
 2075|    437|    }
 2076|  21.3k|    else if (cbytes == neblock) {
  ------------------
  |  Branch (2076:14): [True: 4.19k, False: 17.1k]
  ------------------
 2077|  4.19k|      memcpy(_dest, src, (unsigned int)neblock);
 2078|  4.19k|      nbytes = (int32_t)neblock;
 2079|  4.19k|    }
 2080|  17.1k|    else {
 2081|  17.1k|      if (compformat == BLOSC_BLOSCLZ_FORMAT) {
  ------------------
  |  Branch (2081:11): [True: 656, False: 16.5k]
  ------------------
 2082|    656|        nbytes = blosclz_decompress(src, cbytes, _dest, (int)neblock);
 2083|    656|      }
 2084|  16.5k|      else if (compformat == BLOSC_LZ4_FORMAT) {
  ------------------
  |  Branch (2084:16): [True: 1.08k, False: 15.4k]
  ------------------
 2085|  1.08k|        nbytes = lz4_wrap_decompress((char*)src, (size_t)cbytes,
 2086|  1.08k|                                     (char*)_dest, (size_t)neblock,
 2087|  1.08k|                                     thread_context);
 2088|  1.08k|      }
 2089|  15.4k|  #if defined(HAVE_ZLIB)
 2090|  15.4k|      else if (compformat == BLOSC_ZLIB_FORMAT) {
  ------------------
  |  Branch (2090:16): [True: 1.16k, False: 14.2k]
  ------------------
 2091|  1.16k|        nbytes = zlib_wrap_decompress((char*)src, (size_t)cbytes,
 2092|  1.16k|                                      (char*)_dest, (size_t)neblock);
 2093|  1.16k|      }
 2094|  14.2k|  #endif /*  HAVE_ZLIB */
 2095|  14.2k|  #if defined(HAVE_ZSTD)
 2096|  14.2k|      else if (compformat == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2096:16): [True: 12.6k, False: 1.57k]
  ------------------
 2097|  12.6k|        nbytes = zstd_wrap_decompress(thread_context,
 2098|  12.6k|                                      (char*)src, (size_t)cbytes,
 2099|  12.6k|                                      (char*)_dest, (size_t)neblock);
 2100|  12.6k|      }
 2101|  1.57k|  #endif /*  HAVE_ZSTD */
 2102|  1.57k|      else if (compformat == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (2102:16): [True: 1.57k, False: 6]
  ------------------
 2103|  1.57k|        bool getcell = false;
 2104|       |
 2105|  1.57k|#if defined(HAVE_ZFP)
 2106|  1.57k|        if ((context->compcode == BLOSC_CODEC_ZFP_FIXED_RATE) &&
  ------------------
  |  Branch (2106:13): [True: 1, False: 1.56k]
  ------------------
 2107|      1|            (thread_context->zfp_cell_nitems > 0)) {
  ------------------
  |  Branch (2107:13): [True: 0, False: 1]
  ------------------
 2108|      0|          nbytes = zfp_getcell(thread_context, src, cbytes, _dest, neblock);
 2109|      0|          if (nbytes < 0) {
  ------------------
  |  Branch (2109:15): [True: 0, False: 0]
  ------------------
 2110|      0|            return BLOSC2_ERROR_DATA;
 2111|      0|          }
 2112|      0|          if (nbytes == thread_context->zfp_cell_nitems * typesize) {
  ------------------
  |  Branch (2112:15): [True: 0, False: 0]
  ------------------
 2113|      0|            getcell = true;
 2114|      0|          }
 2115|      0|        }
 2116|  1.57k|#endif /* HAVE_ZFP */
 2117|  1.57k|        if (!getcell) {
  ------------------
  |  Branch (2117:13): [True: 1.57k, False: 0]
  ------------------
 2118|  1.57k|          thread_context->zfp_cell_nitems = 0;
 2119|  1.73k|          for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (2119:27): [True: 1.71k, False: 14]
  ------------------
 2120|  1.71k|            if (g_codecs[i].compcode == context->compcode) {
  ------------------
  |  Branch (2120:17): [True: 1.55k, False: 162]
  ------------------
 2121|  1.55k|              if (g_codecs[i].decoder == NULL) {
  ------------------
  |  Branch (2121:19): [True: 5, False: 1.55k]
  ------------------
 2122|       |                // Dynamically load codec plugin
 2123|      5|                if (fill_codec(&g_codecs[i]) < 0) {
  ------------------
  |  Branch (2123:21): [True: 5, False: 0]
  ------------------
 2124|      5|                  BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2125|      5|                  return BLOSC2_ERROR_CODEC_SUPPORT;
 2126|      5|                }
 2127|      5|              }
 2128|  1.55k|              blosc2_dparams dparams;
 2129|  1.55k|              blosc2_ctx_get_dparams(context, &dparams);
 2130|  1.55k|              nbytes = g_codecs[i].decoder(src,
 2131|  1.55k|                                           cbytes,
 2132|  1.55k|                                           _dest,
 2133|  1.55k|                                           neblock,
 2134|  1.55k|                                           context->compcode_meta,
 2135|  1.55k|                                           &dparams,
 2136|  1.55k|                                           context->src);
 2137|  1.55k|              goto urcodecsuccess;
 2138|  1.55k|            }
 2139|  1.71k|          }
 2140|     14|          BLOSC_TRACE_ERROR("User-defined compressor codec %d not found during decompression", context->compcode);
  ------------------
  |  |   93|     14|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     14|    do {                                            \
  |  |  |  |   98|     14|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     14|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 14, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     14|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2141|     14|          return BLOSC2_ERROR_CODEC_SUPPORT;
 2142|  1.57k|        }
 2143|  1.55k|      urcodecsuccess:
 2144|  1.55k|        ;
 2145|  1.55k|      }
 2146|      6|      else {
 2147|      6|        compname = clibcode_to_clibname(compformat);
 2148|      6|        BLOSC_TRACE_ERROR(
  ------------------
  |  |   93|      6|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      6|    do {                                            \
  |  |  |  |   98|      6|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      6|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      6|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2149|      6|                "Blosc has not been compiled with decompression "
 2150|      6|                "support for '%s' format.  "
 2151|      6|                "Please recompile for adding this support.", compname);
 2152|      6|        return BLOSC2_ERROR_CODEC_SUPPORT;
 2153|      6|      }
 2154|       |
 2155|       |      /* Check that decompressed bytes number is correct */
 2156|  17.1k|      if ((nbytes != neblock) && (thread_context->zfp_cell_nitems == 0)) {
  ------------------
  |  Branch (2156:11): [True: 13.6k, False: 3.50k]
  |  Branch (2156:34): [True: 13.6k, False: 0]
  ------------------
 2157|  13.6k|        return BLOSC2_ERROR_DATA;
 2158|  13.6k|      }
 2159|       |
 2160|  17.1k|    }
 2161|  9.69k|    src += cbytes;
 2162|       |    // ctbytes += cbytes;
 2163|  9.69k|    _dest += nbytes;
 2164|  9.69k|    ntbytes += nbytes;
 2165|  9.69k|  } /* Closes j < nstreams */
 2166|       |
 2167|  9.50k|  if (!instr_codec) {
  ------------------
  |  Branch (2167:7): [True: 8.33k, False: 1.17k]
  ------------------
 2168|  8.33k|    if (last_filter_index >= 0 || context->postfilter != NULL) {
  ------------------
  |  Branch (2168:9): [True: 7.88k, False: 445]
  |  Branch (2168:35): [True: 0, False: 445]
  ------------------
 2169|       |      /* Apply regular filter pipeline */
 2170|  7.88k|      int errcode = pipeline_backward(thread_context, bsize, dest, dest_offset, tmp, tmp2, tmp3,
 2171|  7.88k|                                      last_filter_index, nblock);
 2172|  7.88k|      if (errcode < 0)
  ------------------
  |  Branch (2172:11): [True: 254, False: 7.63k]
  ------------------
 2173|    254|        return errcode;
 2174|  7.88k|    }
 2175|  8.33k|  }
 2176|       |
 2177|       |  /* Return the number of uncompressed bytes */
 2178|  9.25k|  return (int)ntbytes;
 2179|  9.50k|}
blosc2.c:lz4_wrap_decompress:
  486|  1.08k|                               struct thread_context* thread_context) {
  487|  1.08k|  int nbytes;
  488|  1.08k|  blosc2_context* context = thread_context->parent_context;
  489|  1.08k|  if (context->use_dict && context->dict_buffer != NULL && context->dict_size > 0) {
  ------------------
  |  Branch (489:7): [True: 455, False: 634]
  |  Branch (489:28): [True: 455, False: 0]
  |  Branch (489:60): [True: 455, False: 0]
  ------------------
  490|    455|    nbytes = LZ4_decompress_safe_usingDict(input, output,
  491|    455|                                           (int)compressed_length, (int)maxout,
  492|    455|                                           (const char*)context->dict_buffer,
  493|    455|                                           (int)context->dict_size);
  494|    634|  } else {
  495|    634|    nbytes = LZ4_decompress_safe(input, output, (int)compressed_length, (int)maxout);
  496|    634|  }
  497|  1.08k|  if (nbytes != (int)maxout) {
  ------------------
  |  Branch (497:7): [True: 861, False: 228]
  ------------------
  498|    861|    return 0;
  499|    861|  }
  500|    228|  return (int)maxout;
  501|  1.08k|}
blosc2.c:zlib_wrap_decompress:
  525|  1.16k|                                char* output, size_t maxout) {
  526|  1.16k|  int status;
  527|  1.16k|#if defined(HAVE_ZLIB_NG) && ! defined(ZLIB_COMPAT)
  528|  1.16k|  size_t ul = maxout;
  529|  1.16k|  status = zng_uncompress(
  530|  1.16k|      (uint8_t*)output, &ul, (uint8_t*)input, compressed_length);
  531|       |#else
  532|       |  uLongf ul = (uLongf)maxout;
  533|       |  status = uncompress(
  534|       |      (Bytef*)output, &ul, (Bytef*)input, (uLong)compressed_length);
  535|       |#endif
  536|  1.16k|  if (status != Z_OK) {
  ------------------
  |  |  180|  1.16k|#define Z_OK            0
  ------------------
  |  Branch (536:7): [True: 1.16k, False: 2]
  ------------------
  537|  1.16k|    return 0;
  538|  1.16k|  }
  539|      2|  return (int)ul;
  540|  1.16k|}
blosc2.c:zstd_wrap_decompress:
  577|  12.6k|                                char* output, size_t maxout) {
  578|  12.6k|  size_t code;
  579|  12.6k|  blosc2_context* context = thread_context->parent_context;
  580|       |
  581|  12.6k|  if (thread_context->zstd_dctx == NULL) {
  ------------------
  |  Branch (581:7): [True: 10.8k, False: 1.83k]
  ------------------
  582|  10.8k|    thread_context->zstd_dctx = ZSTD_createDCtx();
  583|  10.8k|  }
  584|       |
  585|  12.6k|  if (context->use_dict) {
  ------------------
  |  Branch (585:7): [True: 3.75k, False: 8.93k]
  ------------------
  586|  3.75k|    assert(context->dict_ddict != NULL);
  587|  3.75k|    code = ZSTD_decompress_usingDDict(
  588|  3.75k|            thread_context->zstd_dctx, (void*)output, maxout, (void*)input,
  589|  3.75k|            compressed_length, context->dict_ddict);
  590|  8.93k|  } else {
  591|  8.93k|    code = ZSTD_decompressDCtx(thread_context->zstd_dctx,
  592|  8.93k|        (void*)output, maxout, (void*)input, compressed_length);
  593|  8.93k|  }
  594|  12.6k|  if (ZSTD_isError(code) != ZSTD_error_no_error) {
  ------------------
  |  Branch (594:7): [True: 10.4k, False: 2.19k]
  ------------------
  595|  10.4k|    BLOSC_TRACE_ERROR("Error in ZSTD decompression: '%s'.  Giving up.",
  ------------------
  |  |   93|  10.4k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  10.4k|    do {                                            \
  |  |  |  |   98|  10.4k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  10.4k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 10.4k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  10.4k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  596|  10.4k|                      ZDICT_getErrorName(code));
  597|  10.4k|    return 0;
  598|  10.4k|  }
  599|  2.19k|  return (int)code;
  600|  12.6k|}
blosc2.c:set_values:
 1664|    206|static int32_t set_values(int32_t typesize, const uint8_t* src, uint8_t* dest, int32_t destsize) {
 1665|       |#if defined(BLOSC_STRICT_ALIGN)
 1666|       |  if (destsize % typesize != 0) {
 1667|       |    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
 1668|       |  }
 1669|       |  int32_t nitems = destsize / typesize;
 1670|       |  if (nitems == 0) {
 1671|       |    return 0;
 1672|       |  }
 1673|       |  for (int i = 0; i < nitems; i++) {
 1674|       |    memcpy(dest + i * typesize, src + BLOSC_EXTENDED_HEADER_LENGTH, typesize);
 1675|       |  }
 1676|       |#else
 1677|    206|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (1677:7): [True: 2, False: 204]
  ------------------
 1678|      2|    BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  111|      2|    do {                                            \
  |  |  112|      2|        int rc_ = (rc);                             \
  |  |  113|      2|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 2, False: 0]
  |  |  ------------------
  |  |  114|      2|            char *error_msg = print_error(rc_);     \
  |  |  115|      2|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|      2|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      2|    do {                                            \
  |  |  |  |  |  |   98|      2|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      2|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 2, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      2|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      2|            return rc_;                             \
  |  |  117|      2|        }                                           \
  |  |  118|      2|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1679|      2|  }
 1680|    204|  int32_t nitems = destsize / typesize;
 1681|    204|  if (nitems == 0) {
  ------------------
  |  Branch (1681:7): [True: 0, False: 204]
  ------------------
 1682|      0|    return 0;
 1683|      0|  }
 1684|       |
 1685|    204|  switch (typesize) {
 1686|     14|    case 8: {
  ------------------
  |  Branch (1686:5): [True: 14, False: 190]
  ------------------
 1687|     14|      int64_t val8 = ((int64_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1688|     14|      int64_t* dest8 = (int64_t*)dest;
 1689|     42|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1689:23): [True: 28, False: 14]
  ------------------
 1690|     28|        dest8[i] = val8;
 1691|     28|      }
 1692|     14|      break;
 1693|      0|    }
 1694|     25|    case 4: {
  ------------------
  |  Branch (1694:5): [True: 25, False: 179]
  ------------------
 1695|     25|      int32_t val4 = ((int32_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1696|     25|      int32_t* dest4 = (int32_t*)dest;
 1697|     93|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1697:23): [True: 68, False: 25]
  ------------------
 1698|     68|        dest4[i] = val4;
 1699|     68|      }
 1700|     25|      break;
 1701|      0|    }
 1702|     61|    case 2: {
  ------------------
  |  Branch (1702:5): [True: 61, False: 143]
  ------------------
 1703|     61|      int16_t val2 = ((int16_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1704|     61|      int16_t* dest2 = (int16_t*)dest;
 1705|    294|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1705:23): [True: 233, False: 61]
  ------------------
 1706|    233|        dest2[i] = val2;
 1707|    233|      }
 1708|     61|      break;
 1709|      0|    }
 1710|     81|    case 1: {
  ------------------
  |  Branch (1710:5): [True: 81, False: 123]
  ------------------
 1711|     81|      int8_t val1 = ((int8_t*)(src + BLOSC_EXTENDED_HEADER_LENGTH))[0];
 1712|     81|      int8_t* dest1 = (int8_t*)dest;
 1713|    335|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1713:23): [True: 254, False: 81]
  ------------------
 1714|    254|        dest1[i] = val1;
 1715|    254|      }
 1716|     81|      break;
 1717|      0|    }
 1718|     23|    default:
  ------------------
  |  Branch (1718:5): [True: 23, False: 181]
  ------------------
 1719|     84|      for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1719:23): [True: 61, False: 23]
  ------------------
 1720|     61|        memcpy(dest + i * typesize, src + BLOSC_EXTENDED_HEADER_LENGTH, typesize);
 1721|     61|      }
 1722|    204|  }
 1723|    204|#endif
 1724|       |
 1725|    204|  return nitems;
 1726|    204|}
blosc2.c:set_nans:
 1632|    803|static int32_t set_nans(int32_t typesize, uint8_t* dest, int32_t destsize) {
 1633|    803|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (1633:7): [True: 1, False: 802]
  ------------------
 1634|      1|    BLOSC_TRACE_ERROR("destsize can only be a multiple of typesize");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1635|      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]
  |  |  ------------------
  ------------------
 1636|      1|  }
 1637|    802|  int32_t nitems = destsize / typesize;
 1638|    802|  if (nitems == 0) {
  ------------------
  |  Branch (1638:7): [True: 0, False: 802]
  ------------------
 1639|      0|    return 0;
 1640|      0|  }
 1641|       |
 1642|    802|  if (typesize == 4) {
  ------------------
  |  Branch (1642:7): [True: 421, False: 381]
  ------------------
 1643|    421|    float* dest_ = (float*)dest;
 1644|    421|    float val = nanf("");
 1645|  3.94k|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1645:21): [True: 3.52k, False: 421]
  ------------------
 1646|  3.52k|      dest_[i] = val;
 1647|  3.52k|    }
 1648|    421|    return nitems;
 1649|    421|  }
 1650|    381|  else if (typesize == 8) {
  ------------------
  |  Branch (1650:12): [True: 376, False: 5]
  ------------------
 1651|    376|    double* dest_ = (double*)dest;
 1652|    376|    double val = nan("");
 1653|  1.93k|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1653:21): [True: 1.55k, False: 376]
  ------------------
 1654|  1.55k|      dest_[i] = val;
 1655|  1.55k|    }
 1656|    376|    return nitems;
 1657|    376|  }
 1658|       |
 1659|      5|  BLOSC_TRACE_ERROR("Unsupported typesize for NaN");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1660|      5|  return BLOSC2_ERROR_DATA;
 1661|    802|}
blosc2.c:my_malloc:
  228|  48.2k|static uint8_t* my_malloc(size_t size) {
  229|  48.2k|  void* block = NULL;
  230|  48.2k|  int res = 0;
  231|       |  /* Keep aligned allocations valid under Valgrind and POSIX wrappers. */
  232|  48.2k|  if (size == 0) {
  ------------------
  |  Branch (232:7): [True: 0, False: 48.2k]
  ------------------
  233|      0|    size = 1;
  234|      0|  }
  235|       |
  236|       |/* Do an alignment to 32 bytes because AVX2 is supported */
  237|       |#if defined(_WIN32)
  238|       |  /* A (void *) cast needed for avoiding a warning with MINGW :-/ */
  239|       |  block = (void *)_aligned_malloc(size, 32);
  240|       |#elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600
  241|       |  /* Platform does have an implementation of posix_memalign */
  242|  48.2k|  res = posix_memalign(&block, 32, size);
  243|       |#else
  244|       |  block = malloc(size);
  245|       |#endif  /* _WIN32 */
  246|       |
  247|  48.2k|  if (block == NULL || res != 0) {
  ------------------
  |  Branch (247:7): [True: 0, False: 48.2k]
  |  Branch (247:24): [True: 0, False: 48.2k]
  ------------------
  248|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  249|      0|    return NULL;
  250|      0|  }
  251|       |
  252|  48.2k|  return (uint8_t*)block;
  253|  48.2k|}
blosc2.c:blosc2_initialize_context_from_header:
  847|  16.5k|static int blosc2_initialize_context_from_header(blosc2_context* context, blosc_header* header) {
  848|  16.5k|  context->header_flags = header->flags;
  849|  16.5k|  context->typesize = header->typesize;
  850|  16.5k|  context->sourcesize = header->nbytes;
  851|  16.5k|  context->header_blocksize = header->blocksize;
  852|  16.5k|  context->blocksize = header->blocksize;
  853|  16.5k|  context->blosc2_flags2 = header->blosc2_flags2;
  854|  16.5k|  context->blosc2_flags = header->blosc2_flags;
  855|  16.5k|  context->compcode = header->flags >> 5;
  856|  16.5k|  if (context->compcode == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (856:7): [True: 1.02k, False: 15.5k]
  ------------------
  857|  1.02k|    context->compcode = header->udcompcode;
  858|  1.02k|  }
  859|  16.5k|  if (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) {
  ------------------
  |  Branch (859:7): [True: 321, False: 16.2k]
  ------------------
  860|    321|    context->nblocks = header->blocksize;
  861|    321|    context->leftover = 0;
  862|    321|    context->blocksize = 0;
  863|    321|  }
  864|  16.2k|  else {
  865|  16.2k|    blosc2_calculate_blocks(context);
  866|  16.2k|  }
  867|       |
  868|  16.5k|  bool is_lazy = false;
  869|  16.5k|  if ((context->header_flags & BLOSC_DOSHUFFLE) &&
  ------------------
  |  Branch (869:7): [True: 9.73k, False: 6.84k]
  ------------------
  870|  9.73k|      (context->header_flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (870:7): [True: 7.38k, False: 2.35k]
  ------------------
  871|       |    /* Extended header */
  872|  7.38k|    context->header_overhead = BLOSC_EXTENDED_HEADER_LENGTH;
  873|       |
  874|  7.38k|    memcpy(context->filters, header->filters, BLOSC2_MAX_FILTERS);
  875|  7.38k|    memcpy(context->filters_meta, header->filters_meta, BLOSC2_MAX_FILTERS);
  876|  7.38k|    context->compcode_meta = header->compcode_meta;
  877|       |
  878|  7.38k|    context->filter_flags = filters_to_flags(header->filters);
  879|  7.38k|    context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  880|       |
  881|  7.38k|    is_lazy = (context->blosc2_flags & 0x08u);
  882|  7.38k|  }
  883|  9.20k|  else {
  884|  9.20k|    context->header_overhead = BLOSC_MIN_HEADER_LENGTH;
  885|  9.20k|    context->filter_flags = get_filter_flags(context->header_flags, context->typesize);
  886|  9.20k|    flags_to_filters(context->header_flags, context->filters);
  887|  9.20k|  }
  888|       |
  889|       |  // Some checks for malformed headers
  890|  16.5k|  if (!is_lazy && header->cbytes > context->srcsize) {
  ------------------
  |  Branch (890:7): [True: 16.4k, False: 173]
  |  Branch (890:19): [True: 0, False: 16.4k]
  ------------------
  891|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  892|      0|  }
  893|       |
  894|  16.5k|  return 0;
  895|  16.5k|}
blosc2.c:get_filter_flags:
  687|  9.20k|                                const int32_t typesize) {
  688|  9.20k|  uint8_t flags = 0;
  689|       |
  690|  9.20k|  if ((header_flags & BLOSC_DOSHUFFLE) && (typesize > 1)) {
  ------------------
  |  Branch (690:7): [True: 2.35k, False: 6.84k]
  |  Branch (690:43): [True: 1.77k, False: 589]
  ------------------
  691|  1.77k|    flags |= BLOSC_DOSHUFFLE;
  692|  1.77k|  }
  693|  9.20k|  if (header_flags & BLOSC_DOBITSHUFFLE) {
  ------------------
  |  Branch (693:7): [True: 2.11k, False: 7.09k]
  ------------------
  694|  2.11k|    flags |= BLOSC_DOBITSHUFFLE;
  695|  2.11k|  }
  696|  9.20k|  if (header_flags & BLOSC_DODELTA) {
  ------------------
  |  Branch (696:7): [True: 2.97k, False: 6.22k]
  ------------------
  697|  2.97k|    flags |= BLOSC_DODELTA;
  698|  2.97k|  }
  699|  9.20k|  if (header_flags & BLOSC_MEMCPYED) {
  ------------------
  |  Branch (699:7): [True: 36, False: 9.16k]
  ------------------
  700|     36|    flags |= BLOSC_MEMCPYED;
  701|     36|  }
  702|  9.20k|  return flags;
  703|  9.20k|}
blosc2.c:clear_context_decompression_dict:
 2601|  16.5k|static void clear_context_decompression_dict(blosc2_context* context) {
 2602|  16.5k|  context->use_dict = 0;
 2603|  16.5k|  release_context_dict_buffer(context);
 2604|  16.5k|#if defined(HAVE_ZSTD)
 2605|  16.5k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (2605:7): [True: 0, False: 16.5k]
  ------------------
 2606|      0|    ZSTD_freeDDict(context->dict_ddict);
 2607|      0|    context->dict_ddict = NULL;
 2608|      0|  }
 2609|       |#else
 2610|       |  context->dict_ddict = NULL;
 2611|       |#endif
 2612|  16.5k|}
blosc2.c:check_nthreads:
 2322|  15.6k|static int check_nthreads(blosc2_context* context, bool start_backend) {
 2323|  15.6k|  if (context->new_nthreads != context->nthreads && context->new_nthreads <= 0) {
  ------------------
  |  Branch (2323:7): [True: 0, False: 15.6k]
  |  Branch (2323:53): [True: 0, False: 0]
  ------------------
 2324|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2324|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2325|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2326|      0|  }
 2327|  15.6k|  if (context->nthreads <= 0) {
  ------------------
  |  Branch (2327:7): [True: 0, False: 15.6k]
  ------------------
 2328|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2328|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2329|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2330|      0|  }
 2331|       |
 2332|       |  /* Detect a pool that was torn down by blosc2_destroy() while this context
 2333|       |   * was still alive.  The epoch mismatch tells us the pool pointer is dangling;
 2334|       |   * clear it so the re-attach logic below creates a fresh one. */
 2335|  15.6k|  if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL &&
  ------------------
  |  |   33|  31.2k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (2335:7): [True: 0, False: 15.6k]
  ------------------
 2336|      0|      context->pool_epoch != g_destroy_count) {
  ------------------
  |  Branch (2336:7): [True: 0, False: 0]
  ------------------
 2337|      0|    context->thread_pool = NULL;
 2338|      0|    context->threads_started = 0;
 2339|      0|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2340|      0|  }
 2341|       |
 2342|  15.6k|  if (context->new_nthreads != context->nthreads) {
  ------------------
  |  Branch (2342:7): [True: 0, False: 15.6k]
  ------------------
 2343|      0|    release_thread_backend(context);
 2344|      0|    context->nthreads = context->new_nthreads;
 2345|      0|  }
 2346|  15.6k|  if (start_backend && context->nthreads > 1 && context->threads_started == 0) {
  ------------------
  |  Branch (2346:7): [True: 0, False: 15.6k]
  |  Branch (2346:24): [True: 0, False: 0]
  |  Branch (2346:49): [True: 0, False: 0]
  ------------------
 2347|      0|    int rc;
 2348|      0|    if (threads_callback) {
  ------------------
  |  Branch (2348:9): [True: 0, False: 0]
  ------------------
 2349|      0|      rc = init_callback_threads(context);
 2350|      0|    }
 2351|      0|    else {
 2352|       |#if defined(_WIN32)
 2353|       |      rc = init_threadpool(context);
 2354|       |#else
 2355|      0|      rc = attach_shared_pool(context);
 2356|      0|#endif
 2357|      0|    }
 2358|      0|    if (rc < 0) {
  ------------------
  |  Branch (2358:9): [True: 0, False: 0]
  ------------------
 2359|      0|      return rc;
 2360|      0|    }
 2361|      0|  }
 2362|  15.6k|  if (context->nthreads <= 1) {
  ------------------
  |  Branch (2362:7): [True: 15.6k, False: 0]
  ------------------
 2363|  15.6k|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|  15.6k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2364|  15.6k|  }
 2365|       |
 2366|  15.6k|  return context->nthreads;
 2367|  15.6k|}
blosc2.c:release_thread_backend:
 5703|  16.9k|static int release_thread_backend(blosc2_context *context) {
 5704|  16.9k|  if (context->thread_backend == BLOSC_BACKEND_CALLBACK && context->threads_started > 0) {
  ------------------
  |  |   34|  33.9k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (5704:7): [True: 0, False: 16.9k]
  |  Branch (5704:60): [True: 0, False: 0]
  ------------------
 5705|      0|    for (int32_t t = 0; t < context->threads_started; t++) {
  ------------------
  |  Branch (5705:25): [True: 0, False: 0]
  ------------------
 5706|      0|      destroy_thread_context(context->thread_contexts + t);
 5707|      0|    }
 5708|      0|    my_free(context->thread_contexts);
 5709|      0|    context->thread_contexts = NULL;
 5710|      0|    blosc2_pthread_mutex_destroy(&context->count_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5711|      0|    blosc2_pthread_mutex_destroy(&context->delta_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5712|      0|    blosc2_pthread_cond_destroy(&context->delta_cv);
  ------------------
  |  |   97|      0|#define blosc2_pthread_cond_destroy(a) pthread_cond_destroy((a))
  ------------------
 5713|      0|  }
 5714|       |#if defined(_WIN32)
 5715|       |  else if (context->thread_backend == BLOSC_BACKEND_PER_CONTEXT && context->threads_started > 0) {
 5716|       |    /* Signal all workers to exit. */
 5717|       |    blosc2_pthread_mutex_lock(&context->jobs_mutex);
 5718|       |    context->end_threads = 1;
 5719|       |    blosc2_pthread_cond_broadcast(&context->jobs_ready);
 5720|       |    blosc2_pthread_mutex_unlock(&context->jobs_mutex);
 5721|       |
 5722|       |    for (int32_t t = 0; t < context->threads_started; t++) {
 5723|       |      blosc2_pthread_join(context->threads[t], NULL);
 5724|       |    }
 5725|       |    my_free(context->threads);
 5726|       |    context->threads = NULL;
 5727|       |    blosc2_pthread_cond_destroy(&context->jobs_done);
 5728|       |    blosc2_pthread_cond_destroy(&context->jobs_ready);
 5729|       |    blosc2_pthread_mutex_destroy(&context->jobs_mutex);
 5730|       |    blosc2_pthread_cond_destroy(&context->delta_cv);
 5731|       |    blosc2_pthread_mutex_destroy(&context->delta_mutex);
 5732|       |    blosc2_pthread_mutex_destroy(&context->count_mutex);
 5733|       |  }
 5734|       |#endif  /* _WIN32 */
 5735|  16.9k|  else if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL && context->thread_pool != NULL) {
  ------------------
  |  |   33|  33.9k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (5735:12): [True: 0, False: 16.9k]
  |  Branch (5735:68): [True: 0, False: 0]
  ------------------
 5736|      0|    struct blosc_shared_pool *pool = context->thread_pool;
 5737|      0|    struct blosc_shared_pool **prev;
 5738|      0|    bool destroy_pool = false;
 5739|       |
 5740|      0|    if (context->pool_epoch != g_destroy_count) {
  ------------------
  |  Branch (5740:9): [True: 0, False: 0]
  ------------------
 5741|       |      /* blosc2_destroy() already freed this pool and tore down pool_registry_mutex.
 5742|       |       * Just clear the dangling pointer; nothing else to do. */
 5743|      0|      context->thread_pool = NULL;
 5744|      0|      context->threads_started = 0;
 5745|      0|      context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 5746|      0|      return 0;
 5747|      0|    }
 5748|       |
 5749|      0|    blosc2_pthread_mutex_lock(&pool_registry_mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5750|      0|    pool->context_refs--;
 5751|      0|    if (pool->context_refs == 0) {
  ------------------
  |  Branch (5751:9): [True: 0, False: 0]
  ------------------
 5752|       |      /* Check pool-internal state under the pool's own mutex */
 5753|      0|      blosc2_pthread_mutex_lock(&pool->mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5754|      0|      bool idle = (pool->active_jobs == 0 && pool->job_queue_head == NULL);
  ------------------
  |  Branch (5754:20): [True: 0, False: 0]
  |  Branch (5754:46): [True: 0, False: 0]
  ------------------
 5755|      0|      blosc2_pthread_mutex_unlock(&pool->mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5756|      0|      if (idle) {
  ------------------
  |  Branch (5756:11): [True: 0, False: 0]
  ------------------
 5757|      0|        prev = &shared_pools;
 5758|      0|        while (*prev != NULL && *prev != pool) {
  ------------------
  |  Branch (5758:16): [True: 0, False: 0]
  |  Branch (5758:33): [True: 0, False: 0]
  ------------------
 5759|      0|          prev = &(*prev)->next;
 5760|      0|        }
 5761|      0|        if (*prev == pool) {
  ------------------
  |  Branch (5761:13): [True: 0, False: 0]
  ------------------
 5762|      0|          *prev = pool->next;
 5763|      0|        }
 5764|      0|        destroy_pool = true;
 5765|      0|      }
 5766|      0|    }
 5767|      0|    blosc2_pthread_mutex_unlock(&pool_registry_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5768|      0|    if (destroy_pool) {
  ------------------
  |  Branch (5768:9): [True: 0, False: 0]
  ------------------
 5769|      0|      destroy_shared_pool(pool);
 5770|      0|    }
 5771|      0|    context->thread_pool = NULL;
 5772|      0|  }
 5773|       |
 5774|  16.9k|  context->threads_started = 0;
 5775|  16.9k|  context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|  16.9k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 5776|  16.9k|  return 0;
 5777|  16.9k|}
blosc2.c:release_context_dict_buffer:
 2591|  33.5k|static void release_context_dict_buffer(blosc2_context* context) {
 2592|  33.5k|  if (context->dict_buffer_owned && context->dict_buffer != NULL) {
  ------------------
  |  Branch (2592:7): [True: 0, False: 33.5k]
  |  Branch (2592:37): [True: 0, False: 0]
  ------------------
 2593|      0|    free(context->dict_buffer);
 2594|      0|  }
 2595|  33.5k|  context->dict_buffer = NULL;
 2596|       |  context->dict_buffer_owned = false;
 2597|  33.5k|  context->dict_size = 0;
 2598|  33.5k|}

blosclz_decompress:
  685|    656|int blosclz_decompress(const void* input, int length, void* output, int maxout) {
  686|    656|  const uint8_t* ip = (const uint8_t*)input;
  687|    656|  const uint8_t* ip_limit = ip + length;
  688|    656|  uint8_t* op = (uint8_t*)output;
  689|    656|  uint32_t ctrl;
  690|    656|  uint8_t* op_limit = op + maxout;
  691|    656|  if (BLOSCLZ_UNLIKELY(length == 0)) {
  ------------------
  |  |   35|    656|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 0, False: 656]
  |  |  ------------------
  ------------------
  692|      0|    return 0;
  693|      0|  }
  694|    656|  ctrl = (*ip++) & 31U;
  695|       |
  696|   687k|  while (1) {
  ------------------
  |  Branch (696:10): [True: 687k, Folded]
  ------------------
  697|   687k|    if (ctrl >= 32) {
  ------------------
  |  Branch (697:9): [True: 128k, False: 558k]
  ------------------
  698|       |      // match
  699|   128k|      int32_t len = (int32_t)(ctrl >> 5U) - 1 ;
  700|   128k|      int32_t ofs = (int32_t)(ctrl & 31U) << 8U;
  701|   128k|      uint8_t code;
  702|   128k|      const uint8_t* ref = op - ofs;
  703|       |
  704|   128k|      if (len == 7 - 1) {
  ------------------
  |  Branch (704:11): [True: 35.5k, False: 93.0k]
  ------------------
  705|  43.1k|        do {
  706|  43.1k|          if (BLOSCLZ_UNLIKELY(ip + 1 >= ip_limit)) {
  ------------------
  |  |   35|  43.1k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 14, False: 43.1k]
  |  |  ------------------
  ------------------
  707|     14|            return 0;
  708|     14|          }
  709|  43.1k|          code = *ip++;
  710|       |          /* Guard before the addition so that `len` can never wrap past
  711|       |             INT32_MAX.  The subsequent `len += 3` adds at most 3 more,
  712|       |             so capping at maxout here is safe and sufficient. */
  713|  43.1k|          if (BLOSCLZ_UNLIKELY(len > maxout - code)) {
  ------------------
  |  |   35|  43.1k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 20, False: 43.1k]
  |  |  ------------------
  ------------------
  714|     20|            return 0;
  715|     20|          }
  716|  43.1k|          len += code;
  717|  43.1k|        } while (code == 255);
  ------------------
  |  Branch (717:18): [True: 7.58k, False: 35.5k]
  ------------------
  718|  35.5k|      }
  719|  93.0k|      else {
  720|  93.0k|        if (BLOSCLZ_UNLIKELY(ip + 1 >= ip_limit)) {
  ------------------
  |  |   35|  93.0k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 40, False: 92.9k]
  |  |  ------------------
  ------------------
  721|     40|          return 0;
  722|     40|        }
  723|  93.0k|      }
  724|   128k|      code = *ip++;
  725|   128k|      len += 3;
  726|   128k|      ref -= code;
  727|       |
  728|       |      /* match from 16-bit distance */
  729|   128k|      if (BLOSCLZ_UNLIKELY(code == 255)) {
  ------------------
  |  |   35|   128k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 8.81k, False: 119k]
  |  |  ------------------
  ------------------
  730|  8.81k|        if (ofs == (31U << 8U)) {
  ------------------
  |  Branch (730:13): [True: 764, False: 8.04k]
  ------------------
  731|    764|          if (ip + 1 >= ip_limit) {
  ------------------
  |  Branch (731:15): [True: 1, False: 763]
  ------------------
  732|      1|            return 0;
  733|      1|          }
  734|    763|          ofs = (*ip++) << 8U;
  735|    763|          ofs += *ip++;
  736|    763|          ref = op - ofs - MAX_DISTANCE;
  ------------------
  |  |   46|    763|#define MAX_DISTANCE 8191
  ------------------
  737|    763|        }
  738|  8.81k|      }
  739|       |
  740|   128k|      if (BLOSCLZ_UNLIKELY(len > op_limit - op)) {
  ------------------
  |  |   35|   128k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 99, False: 128k]
  |  |  ------------------
  ------------------
  741|     99|        return 0;
  742|     99|      }
  743|       |
  744|   128k|      if (BLOSCLZ_UNLIKELY(ref <= (uint8_t*)output)) {
  ------------------
  |  |   35|   128k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 57, False: 128k]
  |  |  ------------------
  ------------------
  745|     57|        return 0;
  746|     57|      }
  747|       |
  748|   128k|      if (BLOSCLZ_UNLIKELY(ip >= ip_limit)) break;
  ------------------
  |  |   35|   128k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 1, False: 128k]
  |  |  ------------------
  ------------------
  749|   128k|      ctrl = *ip++;
  750|       |
  751|   128k|      ref--;
  752|   128k|      if (ref == op - 1) {
  ------------------
  |  Branch (752:11): [True: 17.9k, False: 110k]
  ------------------
  753|       |        /* optimized copy for a run */
  754|  17.9k|        memset(op, *ref, len);
  755|  17.9k|        op += len;
  756|  17.9k|      }
  757|   110k|      else if ((op - ref >= 8) && (op_limit - op >= len + 8)) {
  ------------------
  |  Branch (757:16): [True: 75.9k, False: 34.5k]
  |  Branch (757:35): [True: 75.5k, False: 388]
  ------------------
  758|       |        // copy with an overlap not larger than 8
  759|  75.5k|        wild_copy(op, ref, op + len);
  760|  75.5k|        op += len;
  761|  75.5k|      }
  762|  34.9k|      else {
  763|       |        // general copy with any overlap
  764|       |#if 0 && defined(__AVX2__)
  765|       |        if (op - ref <= 16) {
  766|       |          // This is not faster on a combination of compilers (clang, gcc, icc) or machines, but
  767|       |          // it is not too slower either.
  768|       |          op = copy_match_16(op, ref, len);
  769|       |        }
  770|       |        else {
  771|       |#endif
  772|  34.9k|          op = copy_match(op, ref, (unsigned) len);
  773|       |#if 0 && defined(__AVX2__)
  774|       |        }
  775|       |#endif
  776|  34.9k|      }
  777|   128k|    }
  778|   558k|    else {
  779|       |      // literal
  780|   558k|      ctrl++;
  781|   558k|      if (BLOSCLZ_UNLIKELY(ctrl > op_limit - op)) {
  ------------------
  |  |   35|   558k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 56, False: 558k]
  |  |  ------------------
  ------------------
  782|     56|        return 0;
  783|     56|      }
  784|   558k|      if (BLOSCLZ_UNLIKELY(ctrl > ip_limit - ip)) {
  ------------------
  |  |   35|   558k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 20, False: 558k]
  |  |  ------------------
  ------------------
  785|     20|        return 0;
  786|     20|      }
  787|       |
  788|   558k|      memcpy(op, ip, ctrl); op += ctrl; ip += ctrl;
  789|       |      // On GCC-6, fastcopy this is still faster than plain memcpy
  790|       |      // However, using recent CLANG/LLVM 9.0, there is almost no difference
  791|       |      // in performance.
  792|       |      // And starting on CLANG/LLVM 10 and GCC 9, memcpy is generally faster.
  793|       |      // op = fastcopy(op, ip, (unsigned) ctrl); ip += ctrl;
  794|       |
  795|   558k|      if (BLOSCLZ_UNLIKELY(ip >= ip_limit)) break;
  ------------------
  |  |   35|   558k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 348, False: 558k]
  |  |  ------------------
  ------------------
  796|   558k|      ctrl = *ip++;
  797|   558k|    }
  798|   687k|  }
  799|       |
  800|    349|  return (int)(op - (uint8_t*)output);
  801|    656|}
blosclz.c:wild_copy:
  677|  75.5k|static inline void wild_copy(uint8_t *out, const uint8_t* from, uint8_t* end) {
  678|  75.5k|  uint8_t* d = out;
  679|  75.5k|  const uint8_t* s = from;
  680|  75.5k|  uint8_t* const e = end;
  681|       |
  682|   458k|  do { memcpy(d,s,8); d+=8; s+=8; } while (d<e);
  ------------------
  |  Branch (682:44): [True: 383k, False: 75.5k]
  ------------------
  683|  75.5k|}

delta_decoder:
   97|  15.1k|                   int32_t typesize, uint8_t* dest) {
   98|  15.1k|  int32_t i;
   99|       |
  100|  15.1k|  if (offset == 0) {
  ------------------
  |  Branch (100:7): [True: 2.72k, False: 12.4k]
  ------------------
  101|       |    /* Decode delta for the reference block */
  102|  2.72k|    switch (typesize) {
  103|    794|      case 1:
  ------------------
  |  Branch (103:7): [True: 794, False: 1.92k]
  ------------------
  104|  8.90M|        for (i = 1; i < nbytes; i++) {
  ------------------
  |  Branch (104:21): [True: 8.90M, False: 794]
  ------------------
  105|  8.90M|          dest[i] ^= dref[i-1];
  106|  8.90M|        }
  107|    794|        break;
  108|    332|      case 2:
  ------------------
  |  Branch (108:7): [True: 332, False: 2.38k]
  ------------------
  109|   703k|        for (i = 1; i < nbytes / 2; i++) {
  ------------------
  |  Branch (109:21): [True: 703k, False: 332]
  ------------------
  110|   703k|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i-1];
  111|   703k|        }
  112|    332|        break;
  113|    258|      case 4:
  ------------------
  |  Branch (113:7): [True: 258, False: 2.46k]
  ------------------
  114|   582k|        for (i = 1; i < nbytes / 4; i++) {
  ------------------
  |  Branch (114:21): [True: 582k, False: 258]
  ------------------
  115|   582k|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i-1];
  116|   582k|        }
  117|    258|        break;
  118|    542|      case 8:
  ------------------
  |  Branch (118:7): [True: 542, False: 2.17k]
  ------------------
  119|   768k|        for (i = 1; i < nbytes / 8; i++) {
  ------------------
  |  Branch (119:21): [True: 768k, False: 542]
  ------------------
  120|   768k|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i-1];
  121|   768k|        }
  122|    542|        break;
  123|    795|      default:
  ------------------
  |  Branch (123:7): [True: 795, False: 1.92k]
  ------------------
  124|    795|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (124:13): [True: 300, False: 495]
  ------------------
  125|    300|          delta_decoder(dref, offset, nbytes, 8, dest);
  126|    495|        } else {
  127|    495|          delta_decoder(dref, offset, nbytes, 1, dest);
  128|    495|        }
  129|  2.72k|    }
  130|  12.4k|  } else {
  131|       |    /* Decode delta for the non-reference blocks */
  132|  12.4k|    switch (typesize) {
  133|  4.15k|      case 1:
  ------------------
  |  Branch (133:7): [True: 4.15k, False: 8.26k]
  ------------------
  134|  3.16M|        for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (134:21): [True: 3.15M, False: 4.15k]
  ------------------
  135|  3.15M|          dest[i] ^= dref[i];
  136|  3.15M|        }
  137|  4.15k|        break;
  138|  1.09k|      case 2:
  ------------------
  |  Branch (138:7): [True: 1.09k, False: 11.3k]
  ------------------
  139|  47.7k|        for (i = 0; i < nbytes / 2; i++) {
  ------------------
  |  Branch (139:21): [True: 46.6k, False: 1.09k]
  ------------------
  140|  46.6k|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i];
  141|  46.6k|        }
  142|  1.09k|        break;
  143|  1.21k|      case 4:
  ------------------
  |  Branch (143:7): [True: 1.21k, False: 11.2k]
  ------------------
  144|   272k|        for (i = 0; i < nbytes / 4; i++) {
  ------------------
  |  Branch (144:21): [True: 271k, False: 1.21k]
  ------------------
  145|   271k|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i];
  146|   271k|        }
  147|  1.21k|        break;
  148|  2.00k|      case 8:
  ------------------
  |  Branch (148:7): [True: 2.00k, False: 10.4k]
  ------------------
  149|   236k|        for (i = 0; i < nbytes / 8; i++) {
  ------------------
  |  Branch (149:21): [True: 234k, False: 2.00k]
  ------------------
  150|   234k|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i];
  151|   234k|        }
  152|  2.00k|        break;
  153|  3.94k|      default:
  ------------------
  |  Branch (153:7): [True: 3.94k, False: 8.47k]
  ------------------
  154|  3.94k|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (154:13): [True: 957, False: 2.99k]
  ------------------
  155|    957|          delta_decoder(dref, offset, nbytes, 8, dest);
  156|  2.99k|        } else {
  157|  2.99k|          delta_decoder(dref, offset, nbytes, 1, dest);
  158|  2.99k|        }
  159|  12.4k|    }
  160|  12.4k|  }
  161|  15.1k|}

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

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

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

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

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

blosc2.c:print_error:
  525|     18|static char *print_error(int rc) {
  526|       |  // TODO: remove this function, use blosc2_error_string only
  527|     18|  return (char *) blosc2_error_string(rc);
  528|     18|}
ndcell.c:blosc2_meta_get:
 2494|      7|                                  int32_t *content_len) {
 2495|      7|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2495:7): [True: 7, False: 0]
  |  Branch (2495:25): [True: 0, False: 0]
  |  Branch (2495:41): [True: 0, False: 0]
  |  Branch (2495:60): [True: 0, False: 0]
  ------------------
 2496|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2497|      7|    return BLOSC2_ERROR_INVALID_PARAM;
 2498|      7|  }
 2499|       |
 2500|      0|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2501|      0|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2501:7): [True: 0, False: 0]
  ------------------
 2502|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2503|      0|    return nmetalayer;
 2504|      0|  }
 2505|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2506|      0|  if (len < 0) {
  ------------------
  |  Branch (2506:7): [True: 0, False: 0]
  ------------------
 2507|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2508|      0|    return BLOSC2_ERROR_DATA;
 2509|      0|  }
 2510|      0|  *content_len = len;
 2511|      0|  if (len == 0) {
  ------------------
  |  Branch (2511:7): [True: 0, False: 0]
  ------------------
 2512|      0|    *content = NULL;
 2513|      0|    return nmetalayer;
 2514|      0|  }
 2515|      0|  *content = (uint8_t*)malloc((size_t)len);
 2516|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2516:7): [True: 0, False: 0]
  ------------------
 2517|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2518|      0|    *content_len = 0;
 2519|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2520|      0|  }
 2521|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2521:7): [True: 0, False: 0]
  |  Branch (2521:18): [True: 0, False: 0]
  ------------------
 2522|      0|    free(*content);
 2523|      0|    *content = NULL;
 2524|      0|    *content_len = 0;
 2525|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2526|      0|    return BLOSC2_ERROR_DATA;
 2527|      0|  }
 2528|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2529|      0|  return nmetalayer;
 2530|      0|}
ndmean.c:blosc2_meta_get:
 2494|      7|                                  int32_t *content_len) {
 2495|      7|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2495:7): [True: 7, False: 0]
  |  Branch (2495:25): [True: 0, False: 0]
  |  Branch (2495:41): [True: 0, False: 0]
  |  Branch (2495:60): [True: 0, False: 0]
  ------------------
 2496|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2497|      7|    return BLOSC2_ERROR_INVALID_PARAM;
 2498|      7|  }
 2499|       |
 2500|      0|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2501|      0|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2501:7): [True: 0, False: 0]
  ------------------
 2502|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2503|      0|    return nmetalayer;
 2504|      0|  }
 2505|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2506|      0|  if (len < 0) {
  ------------------
  |  Branch (2506:7): [True: 0, False: 0]
  ------------------
 2507|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2508|      0|    return BLOSC2_ERROR_DATA;
 2509|      0|  }
 2510|      0|  *content_len = len;
 2511|      0|  if (len == 0) {
  ------------------
  |  Branch (2511:7): [True: 0, False: 0]
  ------------------
 2512|      0|    *content = NULL;
 2513|      0|    return nmetalayer;
 2514|      0|  }
 2515|      0|  *content = (uint8_t*)malloc((size_t)len);
 2516|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2516:7): [True: 0, False: 0]
  ------------------
 2517|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2518|      0|    *content_len = 0;
 2519|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2520|      0|  }
 2521|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2521:7): [True: 0, False: 0]
  |  Branch (2521:18): [True: 0, False: 0]
  ------------------
 2522|      0|    free(*content);
 2523|      0|    *content = NULL;
 2524|      0|    *content_len = 0;
 2525|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2526|      0|    return BLOSC2_ERROR_DATA;
 2527|      0|  }
 2528|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2529|      0|  return nmetalayer;
 2530|      0|}
bytedelta.c:print_error:
  525|     18|static char *print_error(int rc) {
  526|       |  // TODO: remove this function, use blosc2_error_string only
  527|     18|  return (char *) blosc2_error_string(rc);
  528|     18|}

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

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

ndlz4_decompress:
  526|  1.00k|                     uint8_t meta, blosc2_dparams *dparams) {
  527|  1.00k|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|  1.00k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  528|  1.00k|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|  1.00k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  529|  1.00k|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|  1.00k|    do {                                            \
  |  |  105|  1.00k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 1.00k]
  |  |  ------------------
  |  |  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.00k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 1.00k]
  |  |  ------------------
  ------------------
  530|  1.00k|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|  1.00k|    do {                                            \
  |  |  105|  1.00k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 1.00k]
  |  |  ------------------
  |  |  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.00k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 1.00k]
  |  |  ------------------
  ------------------
  531|       |
  532|  1.00k|  uint8_t *ip = (uint8_t *) input;
  533|  1.00k|  uint8_t *op = (uint8_t *) output;
  534|  1.00k|  uint8_t ndim;
  535|  1.00k|  int32_t blockshape[2];
  536|  1.00k|  int32_t eshape[2];
  537|  1.00k|  uint8_t *buffercpy;
  538|  1.00k|  uint8_t local_buffer[16];
  539|  1.00k|  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.00k|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < (int32_t) (1 + 2 * sizeof(int32_t)))) {
  ------------------
  |  |   30|  1.00k|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 2, False: 1.00k]
  |  |  ------------------
  ------------------
  546|      2|    return 0;
  547|      2|  }
  548|  1.00k|  uint8_t *ip_limit = ip + input_len;
  549|       |
  550|       |  // Validate that a read of `len` bytes starting at byte offset `pos` (measured
  551|       |  // from the start of `input`) lies fully within the compressed buffer.  A
  552|       |  // crafted token `offset` otherwise makes a back-reference point before
  553|       |  // `input`, and the cell-fill memcpy then leaks out-of-bounds heap memory into
  554|       |  // the (attacker-visible) output buffer -- CWE-125.  The per-cell `ip > ip_limit`
  555|       |  // check is not enough because each cell reads a 2-byte offset and literal bytes
  556|       |  // past that point.  All arithmetic is done on integer offsets so we never form
  557|       |  // an out-of-bounds pointer (which is undefined behaviour in C, even when the
  558|       |  // pointer is only compared and not dereferenced).
  559|  1.00k|#define NDLZ4_CHECK_RANGE(pos, len)                                              \
  560|  1.00k|  do {                                                                           \
  561|  1.00k|    int64_t _pos = (int64_t) (pos);                                              \
  562|  1.00k|    int64_t _len = (int64_t) (len);                                              \
  563|  1.00k|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  564|  1.00k|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  565|  1.00k|      return BLOSC2_ERROR_FAILURE;                                               \
  566|  1.00k|    }                                                                            \
  567|  1.00k|  } while (0)
  568|       |
  569|       |  /* we start with literal copy */
  570|  1.00k|  ndim = *ip;
  571|  1.00k|  ip++;
  572|  1.00k|  if (ndim != 2) {
  ------------------
  |  Branch (572:7): [True: 5, False: 998]
  ------------------
  573|      5|    BLOSC_TRACE_ERROR("This codec only works for ndim = 2");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  574|      5|    return BLOSC2_ERROR_FAILURE;
  575|      5|  }
  576|    998|  memcpy(&blockshape[0], ip, 4);
  577|    998|  ip += 4;
  578|    998|  memcpy(&blockshape[1], ip, 4);
  579|    998|  ip += 4;
  580|       |
  581|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3204
  582|    998|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (582:7): [True: 0, False: 998]
  |  Branch (582:25): [True: 8, False: 990]
  |  Branch (582:46): [True: 26, False: 964]
  ------------------
  583|     34|    BLOSC_TRACE_ERROR("Output length or blockshape is negative");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  584|     34|    return BLOSC2_ERROR_FAILURE;
  585|     34|  }
  586|       |
  587|    964|  eshape[0] = ((blockshape[0] + 3) / 4) * 4;
  588|    964|  eshape[1] = ((blockshape[1] + 3) / 4) * 4;
  589|       |
  590|    964|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|    964|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 75, False: 889]
  |  |  ------------------
  ------------------
  591|     75|    BLOSC_TRACE_ERROR("The blockshape is bigger than the output buffer");
  ------------------
  |  |   93|     75|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     75|    do {                                            \
  |  |  |  |   98|     75|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     75|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 75, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     75|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  592|     75|    return 0;
  593|     75|  }
  594|    889|  memset(op, 0, blockshape[0] * blockshape[1]);
  595|       |
  596|    889|  uint32_t i_stop[2];
  597|  2.66k|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (597:19): [True: 1.77k, False: 889]
  ------------------
  598|  1.77k|    i_stop[i] = eshape[i] / 4;
  599|  1.77k|  }
  600|       |
  601|       |  /* main loop */
  602|    889|  uint32_t ii[2];
  603|    889|  uint32_t padding[2] = {0};
  604|    889|  uint32_t ind = 0;
  605|    889|  uint8_t cell_aux[16];
  606|  5.25G|  for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
  ------------------
  |  Branch (606:19): [True: 5.25G, False: 706]
  ------------------
  607|  5.25G|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (607:21): [True: 1.87k, False: 5.25G]
  ------------------
  608|  1.87k|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|  1.87k|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 1.87k]
  |  |  ------------------
  ------------------
  609|      0|        BLOSC_TRACE_ERROR("Exceeding input length");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  610|      0|        return BLOSC2_ERROR_FAILURE;
  611|      0|      }
  612|  1.87k|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (612:11): [True: 1.03k, False: 838]
  ------------------
  613|  1.03k|        padding[0] = (blockshape[0] % 4 == 0) ? 4 : blockshape[0] % 4;
  ------------------
  |  Branch (613:22): [True: 92, False: 945]
  ------------------
  614|  1.03k|      } else {
  615|    838|        padding[0] = 4;
  616|    838|      }
  617|  1.87k|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (617:11): [True: 1.51k, False: 365]
  ------------------
  618|  1.51k|        padding[1] = (blockshape[1] % 4 == 0) ? 4 : blockshape[1] % 4;
  ------------------
  |  Branch (618:22): [True: 80, False: 1.43k]
  ------------------
  619|  1.51k|      } else {
  620|    365|        padding[1] = 4;
  621|    365|      }
  622|  1.87k|      int64_t cur = ip - (const uint8_t *) input;   // in-range: ip is within [input, ip_limit]
  623|  1.87k|      NDLZ4_CHECK_RANGE(cur, 1);
  ------------------
  |  |  560|  1.87k|  do {                                                                           \
  |  |  561|  1.87k|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|  1.87k|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|  1.87k|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 1.87k]
  |  |  |  Branch (563:21): [True: 0, False: 1.87k]
  |  |  |  Branch (563:33): [True: 14, False: 1.86k]
  |  |  ------------------
  |  |  564|     14|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     14|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     14|    do {                                            \
  |  |  |  |  |  |   98|     14|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     14|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 14, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     14|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     14|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     14|    }                                                                            \
  |  |  567|  1.87k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 1.86k]
  |  |  ------------------
  ------------------
  624|  1.86k|      token = *ip++;
  625|  1.86k|      if (token == 0) {    // no match
  ------------------
  |  Branch (625:11): [True: 401, False: 1.46k]
  ------------------
  626|    401|        NDLZ4_CHECK_RANGE(cur + 1, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  560|    401|  do {                                                                           \
  |  |  561|    401|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    401|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    401|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 401]
  |  |  |  Branch (563:21): [True: 0, False: 401]
  |  |  |  Branch (563:33): [True: 11, False: 390]
  |  |  ------------------
  |  |  564|     11|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     11|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     11|    do {                                            \
  |  |  |  |  |  |   98|     11|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     11|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 11, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     11|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     11|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     11|    }                                                                            \
  |  |  567|    401|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 390]
  |  |  ------------------
  ------------------
  627|    390|        buffercpy = ip;
  628|    390|        ip += padding[0] * padding[1];
  629|  1.46k|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (629:18): [True: 92, False: 1.36k]
  ------------------
  630|     92|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|     92|  do {                                                                           \
  |  |  561|     92|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|     92|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|     92|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 92]
  |  |  |  Branch (563:21): [True: 0, False: 92]
  |  |  |  Branch (563:33): [True: 1, False: 91]
  |  |  ------------------
  |  |  564|      1|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      1|    }                                                                            \
  |  |  567|     92|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 91]
  |  |  ------------------
  ------------------
  631|     91|        uint16_t offset;
  632|     91|        memcpy(&offset, ip, sizeof(offset));
  633|     91|        int64_t bpos = (cur + 1) - (int64_t) offset - 1;   // back-reference start offset
  634|     91|        NDLZ4_CHECK_RANGE(bpos, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  560|     91|  do {                                                                           \
  |  |  561|     91|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|     91|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|     91|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 13, False: 78]
  |  |  |  Branch (563:21): [True: 0, False: 78]
  |  |  |  Branch (563:33): [True: 1, False: 77]
  |  |  ------------------
  |  |  564|     14|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     14|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     14|    do {                                            \
  |  |  |  |  |  |   98|     14|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     14|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 14, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     14|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     14|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     14|    }                                                                            \
  |  |  567|     91|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 77]
  |  |  ------------------
  ------------------
  635|     77|        buffercpy = (uint8_t *) input + bpos;
  636|     77|        ip += 2;
  637|  1.36k|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (637:18): [True: 166, False: 1.20k]
  ------------------
  638|    166|        NDLZ4_CHECK_RANGE(cur + 1, 1);
  ------------------
  |  |  560|    166|  do {                                                                           \
  |  |  561|    166|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    166|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    166|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 166]
  |  |  |  Branch (563:21): [True: 0, False: 166]
  |  |  |  Branch (563:33): [True: 1, False: 165]
  |  |  ------------------
  |  |  564|      1|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      1|    }                                                                            \
  |  |  567|    166|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 165]
  |  |  ------------------
  ------------------
  639|    165|        buffercpy = cell_aux;
  640|    165|        memset(buffercpy, *ip, 16);
  641|    165|        ip++;
  642|  1.20k|      } else if (token >= 224) { // three rows match
  ------------------
  |  Branch (642:18): [True: 367, False: 835]
  ------------------
  643|    367|        buffercpy = local_buffer;
  644|    367|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  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: 4, False: 363]
  |  |  ------------------
  |  |  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|    367|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 363]
  |  |  ------------------
  ------------------
  645|    363|        uint16_t offset;
  646|    363|        memcpy(&offset, ip, sizeof(offset));
  647|    363|        offset += 3;
  648|    363|        ip += 2;
  649|    363|        int i, j, k;
  650|    363|        if ((token >> 3U) == 28) {
  ------------------
  |  Branch (650:13): [True: 81, False: 282]
  ------------------
  651|     81|          i = 1;
  652|     81|          j = 2;
  653|     81|          k = 3;
  654|    282|        } else {
  655|    282|          i = 0;
  656|    282|          if ((token >> 3U) < 30) {
  ------------------
  |  Branch (656:15): [True: 84, False: 198]
  ------------------
  657|     84|            j = 1;
  658|     84|            k = 2;
  659|    198|          } else {
  660|    198|            k = 3;
  661|    198|            if ((token >> 3U) == 30) {
  ------------------
  |  Branch (661:17): [True: 85, False: 113]
  ------------------
  662|     85|              j = 1;
  663|    113|            } else {
  664|    113|              j = 2;
  665|    113|            }
  666|    198|          }
  667|    282|        }
  668|    363|        int64_t bpos = (cur + 3) - (int64_t) offset;   // == (ip - offset) as an offset
  669|    363|        NDLZ4_CHECK_RANGE(bpos, 12);
  ------------------
  |  |  560|    363|  do {                                                                           \
  |  |  561|    363|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    363|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    363|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 26, False: 337]
  |  |  |  Branch (563:21): [True: 0, False: 337]
  |  |  |  Branch (563:33): [True: 6, False: 331]
  |  |  ------------------
  |  |  564|     32|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     32|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     32|    do {                                            \
  |  |  |  |  |  |   98|     32|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     32|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 32, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     32|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     32|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     32|    }                                                                            \
  |  |  567|    363|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 331]
  |  |  ------------------
  ------------------
  670|    331|        const uint8_t *ref = (const uint8_t *) input + bpos;
  671|    331|        memcpy(&buffercpy[i * 4], ref, 4);
  672|    331|        memcpy(&buffercpy[j * 4], ref + 4, 4);
  673|    331|        memcpy(&buffercpy[k * 4], ref + 8, 4);
  674|    819|        for (int l = 0; l < 4; l++) {
  ------------------
  |  Branch (674:25): [True: 819, False: 0]
  ------------------
  675|    819|          if ((l != i) && (l != j) && (l != k)) {
  ------------------
  |  Branch (675:15): [True: 564, False: 255]
  |  Branch (675:27): [True: 407, False: 157]
  |  Branch (675:39): [True: 331, False: 76]
  ------------------
  676|    331|            NDLZ4_CHECK_RANGE(ip - (const uint8_t *) input, 4);
  ------------------
  |  |  560|    331|  do {                                                                           \
  |  |  561|    331|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    331|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    331|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 331]
  |  |  |  Branch (563:21): [True: 0, False: 331]
  |  |  |  Branch (563:33): [True: 6, False: 325]
  |  |  ------------------
  |  |  564|      6|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      6|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      6|    do {                                            \
  |  |  |  |  |  |   98|      6|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      6|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 6, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      6|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      6|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      6|    }                                                                            \
  |  |  567|    331|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 325]
  |  |  ------------------
  ------------------
  677|    325|            memcpy(&buffercpy[l * 4], ip, 4);
  678|    325|            ip += 4;
  679|    325|            break;
  680|    331|          }
  681|    819|        }
  682|       |
  683|    835|      } else if ((token >= 128) && (token <= 191)) { // rows pair match
  ------------------
  |  Branch (683:18): [True: 509, False: 326]
  |  Branch (683:36): [True: 508, False: 1]
  ------------------
  684|    508|        buffercpy = local_buffer;
  685|    508|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    508|  do {                                                                           \
  |  |  561|    508|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    508|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    508|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 508]
  |  |  |  Branch (563:21): [True: 0, False: 508]
  |  |  |  Branch (563:33): [True: 2, False: 506]
  |  |  ------------------
  |  |  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|    508|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 506]
  |  |  ------------------
  ------------------
  686|    506|        uint16_t offset;
  687|    506|        memcpy(&offset, ip, sizeof(offset));
  688|    506|        offset += 3;
  689|    506|        ip += 2;
  690|    506|        int i, j;
  691|    506|        if (token == 128) {
  ------------------
  |  Branch (691:13): [True: 165, False: 341]
  ------------------
  692|    165|          i = 2;
  693|    165|          j = 3;
  694|    341|        } else {
  695|    341|          i = (token - 128) >> 5U;
  696|    341|          j = ((token - 128) >> 3U) - (i << 2U);
  697|    341|        }
  698|    506|        int64_t bpos = (cur + 3) - (int64_t) offset;
  699|    506|        NDLZ4_CHECK_RANGE(bpos, 8);
  ------------------
  |  |  560|    506|  do {                                                                           \
  |  |  561|    506|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    506|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    506|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 22, False: 484]
  |  |  |  Branch (563:21): [True: 0, False: 484]
  |  |  |  Branch (563:33): [True: 1, False: 483]
  |  |  ------------------
  |  |  564|     23|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     23|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     23|    do {                                            \
  |  |  |  |  |  |   98|     23|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     23|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 23, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     23|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     23|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     23|    }                                                                            \
  |  |  567|    506|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 483]
  |  |  ------------------
  ------------------
  700|    483|        const uint8_t *ref = (const uint8_t *) input + bpos;
  701|    483|        memcpy(&buffercpy[i * 4], ref, 4);
  702|    483|        memcpy(&buffercpy[j * 4], ref + 4, 4);
  703|  2.38k|        for (int k = 0; k < 4; k++) {
  ------------------
  |  Branch (703:25): [True: 1.91k, False: 470]
  ------------------
  704|  1.91k|          if ((k != i) && (k != j)) {
  ------------------
  |  Branch (704:15): [True: 1.44k, False: 479]
  |  Branch (704:27): [True: 967, False: 473]
  ------------------
  705|    967|            NDLZ4_CHECK_RANGE(ip - (const uint8_t *) input, 4);
  ------------------
  |  |  560|    967|  do {                                                                           \
  |  |  561|    967|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    967|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    967|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 967]
  |  |  |  Branch (563:21): [True: 0, False: 967]
  |  |  |  Branch (563:33): [True: 13, False: 954]
  |  |  ------------------
  |  |  564|     13|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     13|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     13|    do {                                            \
  |  |  |  |  |  |   98|     13|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     13|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 13, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     13|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     13|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     13|    }                                                                            \
  |  |  567|    967|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 954]
  |  |  ------------------
  ------------------
  706|    954|            memcpy(&buffercpy[k * 4], ip, 4);
  707|    954|            ip += 4;
  708|    954|          }
  709|  1.91k|        }
  710|    483|      } else if ((token >= 40) && (token <= 63)) {  // 2 rows pair matches
  ------------------
  |  Branch (710:18): [True: 312, False: 15]
  |  Branch (710:35): [True: 307, False: 5]
  ------------------
  711|    307|        buffercpy = local_buffer;
  712|    307|        NDLZ4_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  560|    307|  do {                                                                           \
  |  |  561|    307|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    307|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    307|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 307]
  |  |  |  Branch (563:21): [True: 0, False: 307]
  |  |  |  Branch (563:33): [True: 4, False: 303]
  |  |  ------------------
  |  |  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|    307|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 303]
  |  |  ------------------
  ------------------
  713|    303|        uint16_t offset_1;
  714|    303|        memcpy(&offset_1, ip, sizeof(offset_1));
  715|    303|        offset_1 += 5;
  716|    303|        ip += 2;
  717|    303|        NDLZ4_CHECK_RANGE(cur + 3, 2);
  ------------------
  |  |  560|    303|  do {                                                                           \
  |  |  561|    303|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    303|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    303|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 0, False: 303]
  |  |  |  Branch (563:21): [True: 0, False: 303]
  |  |  |  Branch (563:33): [True: 1, False: 302]
  |  |  ------------------
  |  |  564|      1|      BLOSC_TRACE_ERROR("ndlz4: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|      1|    }                                                                            \
  |  |  567|    303|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 302]
  |  |  ------------------
  ------------------
  718|    302|        uint16_t offset_2;
  719|    302|        memcpy(&offset_2, ip, sizeof(offset_2));
  720|    302|        offset_2 += 5;
  721|    302|        ip += 2;
  722|    302|        int i, j, k, l, m;
  723|    302|        i = 0;
  724|    302|        j = ((token - 32) >> 3U);
  725|    302|        l = -1;
  726|  1.20k|        for (k = 1; k < 4; k++) {
  ------------------
  |  Branch (726:21): [True: 906, False: 302]
  ------------------
  727|    906|          if ((k != i) && (k != j)) {
  ------------------
  |  Branch (727:15): [True: 906, False: 0]
  |  Branch (727:27): [True: 604, False: 302]
  ------------------
  728|    604|            if (l == -1) {
  ------------------
  |  Branch (728:17): [True: 302, False: 302]
  ------------------
  729|    302|              l = k;
  730|    302|            } else {
  731|    302|              m = k;
  732|    302|            }
  733|    604|          }
  734|    906|        }
  735|    302|        int64_t bpos1 = (cur + 5) - (int64_t) offset_1;
  736|    302|        NDLZ4_CHECK_RANGE(bpos1, 8);
  ------------------
  |  |  560|    302|  do {                                                                           \
  |  |  561|    302|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    302|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    302|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 18, False: 284]
  |  |  |  Branch (563:21): [True: 0, False: 284]
  |  |  |  Branch (563:33): [True: 1, False: 283]
  |  |  ------------------
  |  |  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|    302|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 283]
  |  |  ------------------
  ------------------
  737|    283|        const uint8_t *ref1 = (const uint8_t *) input + bpos1;
  738|    283|        memcpy(&buffercpy[i * 4], ref1, 4);
  739|    283|        memcpy(&buffercpy[j * 4], ref1 + 4, 4);
  740|    283|        int64_t bpos2 = (cur + 5) - (int64_t) offset_2;
  741|    283|        NDLZ4_CHECK_RANGE(bpos2, 8);
  ------------------
  |  |  560|    283|  do {                                                                           \
  |  |  561|    283|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  562|    283|    int64_t _len = (int64_t) (len);                                              \
  |  |  563|    283|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (563:9): [True: 17, False: 266]
  |  |  |  Branch (563:21): [True: 0, False: 266]
  |  |  |  Branch (563:33): [True: 1, False: 265]
  |  |  ------------------
  |  |  564|     18|      BLOSC_TRACE_ERROR("ndlz4: 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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  565|     18|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  566|     18|    }                                                                            \
  |  |  567|    283|  } while (0)
  |  |  ------------------
  |  |  |  Branch (567:12): [Folded, False: 265]
  |  |  ------------------
  ------------------
  742|    265|        const uint8_t *ref2 = (const uint8_t *) input + bpos2;
  743|    265|        memcpy(&buffercpy[l * 4], ref2, 4);
  744|    265|        memcpy(&buffercpy[m * 4], ref2 + 4, 4);
  745|       |
  746|    265|      } else {
  747|     20|        BLOSC_TRACE_ERROR("Invalid token: %u at cell [%d, %d]\n", token, ii[0], ii[1]);
  ------------------
  |  |   93|     20|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     20|    do {                                            \
  |  |  |  |   98|     20|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     20|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 20, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     20|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  748|     20|        return BLOSC2_ERROR_FAILURE;
  749|     20|      }
  750|       |      // fill op with buffercpy
  751|  1.69k|      uint32_t orig = ii[0] * 4 * blockshape[1] + ii[1] * 4;
  752|  8.46k|      for (uint32_t i = 0; i < 4; i++) {
  ------------------
  |  Branch (752:28): [True: 6.76k, False: 1.69k]
  ------------------
  753|  6.76k|        if (i < padding[0]) {
  ------------------
  |  Branch (753:13): [True: 4.79k, False: 1.96k]
  ------------------
  754|  4.79k|          ind = orig + i * blockshape[1];
  755|  4.79k|          memcpy(&op[ind], buffercpy, padding[1]);
  756|       |          // Only advance over rows we actually consume.  For a literal cell
  757|       |          // (token == 0) buffercpy points into the input and only holds
  758|       |          // padding[0] * padding[1] bytes; advancing unconditionally for the
  759|       |          // trailing padding rows would form an out-of-bounds pointer (UB)
  760|       |          // for the block's last cell.  The skipped rows are never read.
  761|  4.79k|          buffercpy += padding[1];
  762|  4.79k|        }
  763|  6.76k|      }
  764|  1.69k|      if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (764:11): [True: 0, False: 1.69k]
  ------------------
  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.69k|    }
  769|  5.25G|  }
  770|    706|  ind += padding[1];
  771|       |
  772|    706|  if ((int32_t)ind != (blockshape[0] * blockshape[1])) {
  ------------------
  |  Branch (772:7): [True: 0, False: 706]
  ------------------
  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|    706|  if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (776:7): [True: 0, False: 706]
  ------------------
  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|    706|  return (int) ind;
  782|    706|#undef NDLZ4_CHECK_RANGE
  783|    706|}

ndlz8_decompress:
  444|    541|                     uint8_t meta, blosc2_dparams *dparams) {
  445|    541|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|    541|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  446|    541|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|    541|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  447|    541|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    541|    do {                                            \
  |  |  105|    541|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 541]
  |  |  ------------------
  |  |  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|    541|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 541]
  |  |  ------------------
  ------------------
  448|    541|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    541|    do {                                            \
  |  |  105|    541|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 541]
  |  |  ------------------
  |  |  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|    541|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 541]
  |  |  ------------------
  ------------------
  449|       |
  450|    541|  const int cell_shape = 8;
  451|    541|  const int cell_size = 64;
  452|    541|  uint8_t *ip = (uint8_t *) input;
  453|    541|  uint8_t *op = (uint8_t *) output;
  454|    541|  uint8_t ndim;
  455|    541|  int32_t blockshape[2];
  456|    541|  int32_t eshape[2];
  457|    541|  uint8_t *buffercpy;
  458|    541|  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|    541|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < (int32_t) (1 + 2 * sizeof(int32_t)))) {
  ------------------
  |  |   30|    541|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 3, False: 538]
  |  |  ------------------
  ------------------
  465|      3|    return 0;
  466|      3|  }
  467|    538|  uint8_t *ip_limit = ip + input_len;
  468|       |
  469|       |  /* we start with literal copy */
  470|    538|  ndim = *ip;
  471|    538|  ip++;
  472|    538|  if (ndim != 2) {
  ------------------
  |  Branch (472:7): [True: 5, False: 533]
  ------------------
  473|      5|    BLOSC_TRACE_ERROR("This codec only works for ndim = 2");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  474|      5|    return BLOSC2_ERROR_FAILURE;
  475|      5|  }
  476|    533|  memcpy(&blockshape[0], ip, 4);
  477|    533|  ip += 4;
  478|    533|  memcpy(&blockshape[1], ip, 4);
  479|    533|  ip += 4;
  480|       |
  481|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3203
  482|    533|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (482:7): [True: 0, False: 533]
  |  Branch (482:25): [True: 24, False: 509]
  |  Branch (482:46): [True: 26, False: 483]
  ------------------
  483|     50|    BLOSC_TRACE_ERROR("Output length or blockshape is negative");
  ------------------
  |  |   93|     50|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     50|    do {                                            \
  |  |  |  |   98|     50|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     50|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 50, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     50|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  484|     50|    return BLOSC2_ERROR_FAILURE;
  485|     50|  }
  486|       |
  487|    483|  eshape[0] = ((blockshape[0] + 7) / cell_shape) * cell_shape;
  488|    483|  eshape[1] = ((blockshape[1] + 7) / cell_shape) * cell_shape;
  489|       |
  490|    483|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|    483|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 86, False: 397]
  |  |  ------------------
  ------------------
  491|     86|    BLOSC_TRACE_ERROR("The blockshape is bigger than the output buffer");
  ------------------
  |  |   93|     86|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     86|    do {                                            \
  |  |  |  |   98|     86|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     86|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 86, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     86|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  492|     86|    return 0;
  493|     86|  }
  494|    397|  memset(op, 0, blockshape[0] * blockshape[1]);
  495|       |
  496|    397|  int32_t i_stop[2];
  497|  1.19k|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (497:19): [True: 794, False: 397]
  ------------------
  498|    794|    i_stop[i] = eshape[i] / cell_shape;
  499|    794|  }
  500|       |
  501|       |  /* main loop */
  502|    397|  int32_t ii[2];
  503|    397|  int32_t padding[2] = {0};
  504|    397|  int32_t ind = 0;
  505|    397|  uint8_t *local_buffer = malloc(cell_size);
  506|    397|  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|    397|#define NDLZ8_CHECK_RANGE(pos, len)                                              \
  518|    397|  do {                                                                           \
  519|    397|    int64_t _pos = (int64_t) (pos);                                              \
  520|    397|    int64_t _len = (int64_t) (len);                                              \
  521|    397|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  522|    397|      free(local_buffer);                                                        \
  523|    397|      free(cell_aux);                                                            \
  524|    397|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  525|    397|      return BLOSC2_ERROR_FAILURE;                                               \
  526|    397|    }                                                                            \
  527|    397|  } while (0)
  528|       |
  529|  3.28G|  for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
  ------------------
  |  Branch (529:19): [True: 3.28G, False: 259]
  ------------------
  530|  3.28G|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (530:21): [True: 587, False: 3.28G]
  ------------------
  531|    587|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|    587|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 587]
  |  |  ------------------
  ------------------
  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|    587|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (537:11): [True: 400, False: 187]
  ------------------
  538|    400|        padding[0] = (blockshape[0] % cell_shape == 0) ? cell_shape : blockshape[0] % cell_shape;
  ------------------
  |  Branch (538:22): [True: 9, False: 391]
  ------------------
  539|    400|      } else {
  540|    187|        padding[0] = cell_shape;
  541|    187|      }
  542|    587|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (542:11): [True: 433, False: 154]
  ------------------
  543|    433|        padding[1] = (blockshape[1] % cell_shape == 0) ? cell_shape : blockshape[1] % cell_shape;
  ------------------
  |  Branch (543:22): [True: 8, False: 425]
  ------------------
  544|    433|      } else {
  545|    154|        padding[1] = cell_shape;
  546|    154|      }
  547|    587|      int64_t cur = ip - (const uint8_t *) input;   // in-range: ip is within [input, ip_limit]
  548|    587|      NDLZ8_CHECK_RANGE(cur, 1);
  ------------------
  |  |  518|    587|  do {                                                                           \
  |  |  519|    587|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    587|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    587|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 587]
  |  |  |  Branch (521:21): [True: 0, False: 587]
  |  |  |  Branch (521:33): [True: 4, False: 583]
  |  |  ------------------
  |  |  522|      4|      free(local_buffer);                                                        \
  |  |  523|      4|      free(cell_aux);                                                            \
  |  |  524|      4|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      4|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      4|    do {                                            \
  |  |  |  |  |  |   98|      4|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      4|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 4, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      4|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      4|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      4|    }                                                                            \
  |  |  527|    587|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 583]
  |  |  ------------------
  ------------------
  549|    583|      token = *ip++;
  550|    583|      uint8_t match_type = (token >> 3U);
  551|    583|      if (token == 0) {    // no match
  ------------------
  |  Branch (551:11): [True: 168, False: 415]
  ------------------
  552|    168|        NDLZ8_CHECK_RANGE(cur + 1, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  518|    168|  do {                                                                           \
  |  |  519|    168|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    168|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    168|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 168]
  |  |  |  Branch (521:21): [True: 0, False: 168]
  |  |  |  Branch (521:33): [True: 17, False: 151]
  |  |  ------------------
  |  |  522|     17|      free(local_buffer);                                                        \
  |  |  523|     17|      free(cell_aux);                                                            \
  |  |  524|     17|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     17|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     17|    }                                                                            \
  |  |  527|    168|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 151]
  |  |  ------------------
  ------------------
  553|    151|        buffercpy = ip;
  554|    151|        ip += padding[0] * padding[1];
  555|    415|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (555:18): [True: 99, False: 316]
  ------------------
  556|     99|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     99|  do {                                                                           \
  |  |  519|     99|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     99|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     99|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 99]
  |  |  |  Branch (521:21): [True: 0, False: 99]
  |  |  |  Branch (521:33): [True: 1, False: 98]
  |  |  ------------------
  |  |  522|      1|      free(local_buffer);                                                        \
  |  |  523|      1|      free(cell_aux);                                                            \
  |  |  524|      1|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      1|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      1|    }                                                                            \
  |  |  527|     99|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 98]
  |  |  ------------------
  ------------------
  557|     98|        uint16_t offset;
  558|     98|        memcpy(&offset, ip, sizeof(offset));
  559|     98|        int64_t bpos = (cur + 1) - (int64_t) offset - 1;
  560|     98|        NDLZ8_CHECK_RANGE(bpos, (int64_t) padding[0] * padding[1]);
  ------------------
  |  |  518|     98|  do {                                                                           \
  |  |  519|     98|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     98|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     98|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 18, False: 80]
  |  |  |  Branch (521:21): [True: 0, False: 80]
  |  |  |  Branch (521:33): [True: 5, False: 75]
  |  |  ------------------
  |  |  522|     23|      free(local_buffer);                                                        \
  |  |  523|     23|      free(cell_aux);                                                            \
  |  |  524|     23|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     23|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     23|    do {                                            \
  |  |  |  |  |  |   98|     23|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     23|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 23, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     23|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     23|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     23|    }                                                                            \
  |  |  527|     98|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 75]
  |  |  ------------------
  ------------------
  561|     75|        buffercpy = (uint8_t *) input + bpos;
  562|     75|        ip += 2;
  563|    316|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (563:18): [True: 179, False: 137]
  ------------------
  564|    179|        NDLZ8_CHECK_RANGE(cur + 1, 1);
  ------------------
  |  |  518|    179|  do {                                                                           \
  |  |  519|    179|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    179|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    179|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 179]
  |  |  |  Branch (521:21): [True: 0, False: 179]
  |  |  |  Branch (521:33): [True: 1, False: 178]
  |  |  ------------------
  |  |  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|    179|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 178]
  |  |  ------------------
  ------------------
  565|    178|        buffercpy = cell_aux;
  566|    178|        memset(buffercpy, *ip, cell_size);
  567|    178|        ip++;
  568|    178|      } else if (match_type == 21) {    // triple match
  ------------------
  |  Branch (568:18): [True: 66, False: 71]
  ------------------
  569|     66|        buffercpy = local_buffer;
  570|     66|        int row = (int) (token & 7);
  571|     66|        if (row + 2 >= cell_shape) {
  ------------------
  |  Branch (571:13): [True: 3, False: 63]
  ------------------
  572|      3|          free(local_buffer);
  573|      3|          free(cell_aux);
  574|      3|          BLOSC_TRACE_ERROR("Triple match row out of bounds");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  575|      3|          return BLOSC2_ERROR_FAILURE;
  576|      3|        }
  577|     63|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     63|  do {                                                                           \
  |  |  519|     63|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     63|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     63|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 63]
  |  |  |  Branch (521:21): [True: 0, False: 63]
  |  |  |  Branch (521:33): [True: 2, False: 61]
  |  |  ------------------
  |  |  522|      2|      free(local_buffer);                                                        \
  |  |  523|      2|      free(cell_aux);                                                            \
  |  |  524|      2|      BLOSC_TRACE_ERROR("ndlz8: 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]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|      2|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|      2|    }                                                                            \
  |  |  527|     63|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 61]
  |  |  ------------------
  ------------------
  578|     61|        uint16_t offset;
  579|     61|        memcpy(&offset, ip, sizeof(offset));
  580|     61|        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|     61|        int64_t bpos = cur - (int64_t) offset;
  584|     61|        NDLZ8_CHECK_RANGE(bpos, 3 * cell_shape);
  ------------------
  |  |  518|     61|  do {                                                                           \
  |  |  519|     61|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     61|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     61|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 15, False: 46]
  |  |  |  Branch (521:21): [True: 0, False: 46]
  |  |  |  Branch (521:33): [True: 4, False: 42]
  |  |  ------------------
  |  |  522|     19|      free(local_buffer);                                                        \
  |  |  523|     19|      free(cell_aux);                                                            \
  |  |  524|     19|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     19|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     19|    do {                                            \
  |  |  |  |  |  |   98|     19|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     19|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 19, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     19|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     19|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     19|    }                                                                            \
  |  |  527|     61|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 42]
  |  |  ------------------
  ------------------
  585|     42|        const uint8_t *ref = (const uint8_t *) input + bpos;
  586|    168|        for (int l = 0; l < 3; l++) {
  ------------------
  |  Branch (586:25): [True: 126, False: 42]
  ------------------
  587|    126|          memcpy(&buffercpy[(row + l) * cell_shape], ref + l * cell_shape, cell_shape);
  588|    126|        }
  589|    320|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (589:25): [True: 293, False: 27]
  ------------------
  590|    293|          if ((l < row) || (l > row + 2)) {
  ------------------
  |  Branch (590:15): [True: 92, False: 201]
  |  Branch (590:28): [True: 90, False: 111]
  ------------------
  591|    182|            NDLZ8_CHECK_RANGE(ip - (const uint8_t *) input, cell_shape);
  ------------------
  |  |  518|    182|  do {                                                                           \
  |  |  519|    182|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    182|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    182|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 182]
  |  |  |  Branch (521:21): [True: 0, False: 182]
  |  |  |  Branch (521:33): [True: 15, False: 167]
  |  |  ------------------
  |  |  522|     15|      free(local_buffer);                                                        \
  |  |  523|     15|      free(cell_aux);                                                            \
  |  |  524|     15|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     15|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     15|    do {                                            \
  |  |  |  |  |  |   98|     15|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     15|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 15, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     15|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     15|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     15|    }                                                                            \
  |  |  527|    182|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 167]
  |  |  ------------------
  ------------------
  592|    167|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  593|    167|            ip += cell_shape;
  594|    167|          }
  595|    293|        }
  596|     71|      } else if (match_type == 17) {    // pair match
  ------------------
  |  Branch (596:18): [True: 51, False: 20]
  ------------------
  597|     51|        buffercpy = local_buffer;
  598|     51|        int row = (int) (token & 7);
  599|     51|        if (row + 1 >= cell_shape) {
  ------------------
  |  Branch (599:13): [True: 1, False: 50]
  ------------------
  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|     50|        NDLZ8_CHECK_RANGE(cur + 1, 2);
  ------------------
  |  |  518|     50|  do {                                                                           \
  |  |  519|     50|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     50|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     50|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 50]
  |  |  |  Branch (521:21): [True: 0, False: 50]
  |  |  |  Branch (521:33): [True: 1, False: 49]
  |  |  ------------------
  |  |  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|     50|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 49]
  |  |  ------------------
  ------------------
  606|     49|        uint16_t offset;
  607|     49|        memcpy(&offset, ip, sizeof(offset));
  608|     49|        ip += 2;
  609|       |        // back-reference base == cur - offset (see triple-match note above).
  610|     49|        int64_t bpos = cur - (int64_t) offset;
  611|     49|        NDLZ8_CHECK_RANGE(bpos, 2 * cell_shape);
  ------------------
  |  |  518|     49|  do {                                                                           \
  |  |  519|     49|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|     49|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|     49|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 13, False: 36]
  |  |  |  Branch (521:21): [True: 0, False: 36]
  |  |  |  Branch (521:33): [True: 3, False: 33]
  |  |  ------------------
  |  |  522|     16|      free(local_buffer);                                                        \
  |  |  523|     16|      free(cell_aux);                                                            \
  |  |  524|     16|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     16|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     16|    do {                                            \
  |  |  |  |  |  |   98|     16|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     16|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 16, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     16|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     16|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     16|    }                                                                            \
  |  |  527|     49|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 33]
  |  |  ------------------
  ------------------
  612|     33|        const uint8_t *ref = (const uint8_t *) input + bpos;
  613|     99|        for (int l = 0; l < 2; l++) {
  ------------------
  |  Branch (613:25): [True: 66, False: 33]
  ------------------
  614|     66|          memcpy(&buffercpy[(row + l) * cell_shape], ref + l * cell_shape, cell_shape);
  615|     66|        }
  616|    239|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (616:25): [True: 221, False: 18]
  ------------------
  617|    221|          if ((l < row) || (l > row + 1)) {
  ------------------
  |  Branch (617:15): [True: 82, False: 139]
  |  Branch (617:28): [True: 81, False: 58]
  ------------------
  618|    163|            NDLZ8_CHECK_RANGE(ip - (const uint8_t *) input, cell_shape);
  ------------------
  |  |  518|    163|  do {                                                                           \
  |  |  519|    163|    int64_t _pos = (int64_t) (pos);                                              \
  |  |  520|    163|    int64_t _len = (int64_t) (len);                                              \
  |  |  521|    163|    if (_pos < 0 || _len < 0 || _pos > (int64_t) input_len - _len) {             \
  |  |  ------------------
  |  |  |  Branch (521:9): [True: 0, False: 163]
  |  |  |  Branch (521:21): [True: 0, False: 163]
  |  |  |  Branch (521:33): [True: 15, False: 148]
  |  |  ------------------
  |  |  522|     15|      free(local_buffer);                                                        \
  |  |  523|     15|      free(cell_aux);                                                            \
  |  |  524|     15|      BLOSC_TRACE_ERROR("ndlz8: out-of-bounds reference in compressed stream");  \
  |  |  ------------------
  |  |  |  |   93|     15|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     15|    do {                                            \
  |  |  |  |  |  |   98|     15|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|     15|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 15, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|     15|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  525|     15|      return BLOSC2_ERROR_FAILURE;                                               \
  |  |  526|     15|    }                                                                            \
  |  |  527|    163|  } while (0)
  |  |  ------------------
  |  |  |  Branch (527:12): [Folded, False: 148]
  |  |  ------------------
  ------------------
  619|    148|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  620|    148|            ip += cell_shape;
  621|    148|          }
  622|    221|        }
  623|     33|      } else {
  624|     20|        free(local_buffer);
  625|     20|        free(cell_aux);
  626|     20|        BLOSC_TRACE_ERROR("Invalid token: %u at cell [%d, %d]\n", token, ii[0], ii[1]);
  ------------------
  |  |   93|     20|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     20|    do {                                            \
  |  |  |  |   98|     20|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     20|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 20, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     20|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  627|     20|        return BLOSC2_ERROR_FAILURE;
  628|     20|      }
  629|       |
  630|    449|      int32_t orig = ii[0] * cell_shape * blockshape[1] + ii[1] * cell_shape;
  631|  4.04k|      for (int32_t i = 0; i < (int32_t) cell_shape; i++) {
  ------------------
  |  Branch (631:27): [True: 3.59k, False: 449]
  ------------------
  632|  3.59k|        if (i < padding[0]) {
  ------------------
  |  Branch (632:13): [True: 2.09k, False: 1.49k]
  ------------------
  633|  2.09k|          ind = orig + i * blockshape[1];
  634|  2.09k|          memcpy(&op[ind], buffercpy, padding[1]);
  635|       |          // Only advance over rows we actually consume.  For a literal cell
  636|       |          // (token == 0) buffercpy points into the input and only holds
  637|       |          // padding[0] * padding[1] bytes; advancing unconditionally for the
  638|       |          // trailing padding rows would form an out-of-bounds pointer (UB)
  639|       |          // for the block's last cell.  The skipped rows are never read.
  640|  2.09k|          buffercpy += padding[1];
  641|  2.09k|        }
  642|  3.59k|      }
  643|    449|      if (ind > output_len) {
  ------------------
  |  Branch (643:11): [True: 0, False: 449]
  ------------------
  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|    449|    }
  650|  3.28G|  }
  651|    259|  ind += padding[1];
  652|       |
  653|    259|  free(cell_aux);
  654|    259|  free(local_buffer);
  655|       |
  656|    259|  if (ind != (blockshape[0] * blockshape[1])) {
  ------------------
  |  Branch (656:7): [True: 0, False: 259]
  ------------------
  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|    259|  if (ind > output_len) {
  ------------------
  |  Branch (660:7): [True: 0, False: 259]
  ------------------
  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|    259|  return (int) ind;
  666|    259|#undef NDLZ8_CHECK_RANGE
  667|    259|}

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

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

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

int_trunc_backward:
  117|  1.28k|                       blosc2_dparams *dparams, uint8_t id) {
  118|  1.28k|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|  1.28k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  119|  1.28k|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|  1.28k|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  120|  1.28k|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|  1.28k|#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.28k|  memcpy(output, input, length);
  124|  1.28k|  return BLOSC2_ERROR_SUCCESS;
  125|  1.28k|}

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

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

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

