LZ4_decompress_safe:
 2452|    291|{
 2453|    291|    return LZ4_decompress_generic(source, dest, compressedSize, maxDecompressedSize,
 2454|    291|                                  decode_full_block, noDict,
 2455|       |                                  (BYTE*)dest, NULL, 0);
 2456|    291|}
LZ4_decompress_safe_forceExtDict:
 2526|    107|{
 2527|    107|    DEBUGLOG(5, "LZ4_decompress_safe_forceExtDict");
  ------------------
  |  |  289|    107|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2528|    107|    return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize,
 2529|    107|                                  decode_full_block, usingExtDict,
 2530|    107|                                  (BYTE*)dest, (const BYTE*)dictStart, dictSize);
 2531|    107|}
LZ4_decompress_safe_usingDict:
 2720|    107|{
 2721|    107|    if (dictSize==0)
  ------------------
  |  Branch (2721:9): [True: 0, False: 107]
  ------------------
 2722|      0|        return LZ4_decompress_safe(source, dest, compressedSize, maxOutputSize);
 2723|    107|    if (dictStart+dictSize == dest) {
  ------------------
  |  Branch (2723:9): [True: 0, False: 107]
  ------------------
 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|    107|    assert(dictSize >= 0);
  ------------------
  |  |  273|    107|#    define assert(condition) ((void)0)
  ------------------
 2731|    107|    return LZ4_decompress_safe_forceExtDict(source, dest, compressedSize, maxOutputSize, dictStart, (size_t)dictSize);
 2732|    107|}
lz4.c:LZ4_wildCopy8:
  466|  56.2k|{
  467|  56.2k|    BYTE* d = (BYTE*)dstPtr;
  468|  56.2k|    const BYTE* s = (const BYTE*)srcPtr;
  469|  56.2k|    BYTE* const e = (BYTE*)dstEnd;
  470|       |
  471|   103k|    do { LZ4_memcpy(d,s,8); d+=8; s+=8; } while (d<e);
  ------------------
  |  |  349|   103k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (471:50): [True: 47.0k, False: 56.2k]
  ------------------
  472|  56.2k|}
lz4.c:LZ4_isLittleEndian:
  364|   120k|{
  365|   120k|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental */
  366|   120k|    return one.c[0];
  367|   120k|}
lz4.c:LZ4_read16:
  393|   120k|static U16 LZ4_read16(const void* ptr) { return ((const LZ4_unalign16*)ptr)->u16; }
lz4.c:LZ4_write32:
  398|  55.3k|static void LZ4_write32(void* memPtr, U32 value) { ((LZ4_unalign32*)memPtr)->u32 = value; }
lz4.c:LZ4_decompress_generic:
 2035|    398|{
 2036|    398|    if ((src == NULL) || (outputSize < 0)) { return -1; }
  ------------------
  |  Branch (2036:9): [True: 0, False: 398]
  |  Branch (2036:26): [True: 0, False: 398]
  ------------------
 2037|       |
 2038|    398|    {   const BYTE* ip = (const BYTE*) src;
 2039|    398|        const BYTE* const iend = ip + srcSize;
 2040|       |
 2041|    398|        BYTE* op = (BYTE*) dst;
 2042|    398|        BYTE* const oend = op + outputSize;
 2043|    398|        BYTE* cpy;
 2044|       |
 2045|    398|        const BYTE* const dictEnd = (dictStart == NULL) ? NULL : dictStart + dictSize;
  ------------------
  |  Branch (2045:37): [True: 291, False: 107]
  ------------------
 2046|       |
 2047|    398|        const int checkOffset = (dictSize < (int)(64 KB));
  ------------------
  |  |  251|    398|#define KB *(1 <<10)
  ------------------
 2048|       |
 2049|       |
 2050|       |        /* Set up the "end" pointers for the shortcut. */
 2051|    398|        const BYTE* const shortiend = iend - 14 /*maxLL*/ - 2 /*offset*/;
 2052|    398|        const BYTE* const shortoend = oend - 14 /*maxLL*/ - 18 /*maxML*/;
 2053|       |
 2054|    398|        const BYTE* match;
 2055|    398|        size_t offset;
 2056|    398|        unsigned token;
 2057|    398|        size_t length;
 2058|       |
 2059|       |
 2060|    398|        DEBUGLOG(5, "LZ4_decompress_generic (srcSize:%i, dstSize:%i)", srcSize, outputSize);
  ------------------
  |  |  289|    398|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2061|       |
 2062|       |        /* Special cases */
 2063|    398|        assert(lowPrefix <= op);
  ------------------
  |  |  273|    398|#    define assert(condition) ((void)0)
  ------------------
 2064|    398|        if (unlikely(outputSize==0)) {
  ------------------
  |  |  180|    398|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    398|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 398]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|    398|        if (unlikely(srcSize==0)) { return -1; }
  ------------------
  |  |  180|    398|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    398|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 398]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|    398|#if LZ4_FAST_DEC_LOOP
 2076|    398|        if ((oend - op) < FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|    398|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2076:13): [True: 12, False: 386]
  ------------------
 2077|     12|            DEBUGLOG(6, "move to safe decode loop");
  ------------------
  |  |  289|     12|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2078|     12|            goto safe_decode;
 2079|     12|        }
 2080|       |
 2081|       |        /* Fast loop : decode sequences as long as output < oend-FASTLOOP_SAFE_DISTANCE */
 2082|    386|        DEBUGLOG(6, "using fast decode loop");
  ------------------
  |  |  289|    386|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2083|   119k|        while (1) {
  ------------------
  |  Branch (2083:16): [True: 119k, Folded]
  ------------------
 2084|       |            /* Main fastloop assertion: We can always wildcopy FASTLOOP_SAFE_DISTANCE */
 2085|   119k|            assert(oend - op >= FASTLOOP_SAFE_DISTANCE);
  ------------------
  |  |  273|   119k|#    define assert(condition) ((void)0)
  ------------------
 2086|   119k|            assert(ip < iend);
  ------------------
  |  |  273|   119k|#    define assert(condition) ((void)0)
  ------------------
 2087|   119k|            token = *ip++;
 2088|   119k|            length = token >> ML_BITS;  /* literal length */
  ------------------
  |  |  260|   119k|#define ML_BITS  4
  ------------------
 2089|   119k|            DEBUGLOG(7, "blockPos%6u: litLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)length);
  ------------------
  |  |  289|   119k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2090|       |
 2091|       |            /* decode literal length */
 2092|   119k|            if (length == RUN_MASK) {
  ------------------
  |  |  263|   119k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|   119k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|   119k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2092:17): [True: 10.9k, False: 108k]
  ------------------
 2093|  10.9k|                size_t const addl = read_variable_length(&ip, iend-RUN_MASK, 1);
  ------------------
  |  |  263|  10.9k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|  10.9k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|  10.9k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2094|  10.9k|                if (addl == rvl_error) {
  ------------------
  |  Branch (2094:21): [True: 1, False: 10.9k]
  ------------------
 2095|      1|                    DEBUGLOG(6, "error reading long literal length");
  ------------------
  |  |  289|      1|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2096|      1|                    goto _output_error;
 2097|      1|                }
 2098|  10.9k|                length += addl;
 2099|  10.9k|                if (unlikely((uptrval)(op)+length<(uptrval)(op))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  10.9k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  10.9k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 10.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2100|  10.9k|                if (unlikely((uptrval)(ip)+length<(uptrval)(ip))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  10.9k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  10.9k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 10.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2101|       |
 2102|       |                /* copy literals */
 2103|  10.9k|                LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH);
  ------------------
  |  |  277|  10.9k|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
 2104|  10.9k|                if ((op+length>oend-32) || (ip+length>iend-32)) { goto safe_literal_copy; }
  ------------------
  |  Branch (2104:21): [True: 35, False: 10.9k]
  |  Branch (2104:44): [True: 32, False: 10.8k]
  ------------------
 2105|  10.8k|                LZ4_wildCopy32(op, ip, op+length);
 2106|  10.8k|                ip += length; op += length;
 2107|   108k|            } else if (ip <= iend-(16 + 1/*max lit + offset + nextToken*/)) {
  ------------------
  |  Branch (2107:24): [True: 108k, False: 6]
  ------------------
 2108|       |                /* We don't need to check oend, since we check it once for each loop below */
 2109|   108k|                DEBUGLOG(7, "copy %u bytes in a 16-bytes stripe", (unsigned)length);
  ------------------
  |  |  289|   108k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2110|       |                /* Literals can only be <= 14, but hope compilers optimize better when copy by a register size */
 2111|   108k|                LZ4_memcpy(op, ip, 16);
  ------------------
  |  |  349|   108k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2112|   108k|                ip += length; op += length;
 2113|   108k|            } else {
 2114|      6|                goto safe_literal_copy;
 2115|      6|            }
 2116|       |
 2117|       |            /* get offset */
 2118|   119k|            offset = LZ4_readLE16(ip); ip+=2;
 2119|   119k|            DEBUGLOG(6, "blockPos%6u: offset = %u", (unsigned)(op-(BYTE*)dst), (unsigned)offset);
  ------------------
  |  |  289|   119k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2120|   119k|            match = op - offset;
 2121|   119k|            assert(match <= op);  /* overflow check */
  ------------------
  |  |  273|   119k|#    define assert(condition) ((void)0)
  ------------------
 2122|       |
 2123|       |            /* get matchlength */
 2124|   119k|            length = token & ML_MASK;
  ------------------
  |  |  261|   119k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|   119k|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2125|   119k|            DEBUGLOG(7, "  match length token = %u (len==%u)", (unsigned)length, (unsigned)length+MINMATCH);
  ------------------
  |  |  289|   119k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2126|       |
 2127|   119k|            if (length == ML_MASK) {
  ------------------
  |  |  261|   119k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|   119k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2127:17): [True: 13.3k, False: 106k]
  ------------------
 2128|  13.3k|                size_t const addl = read_variable_length(&ip, iend - LASTLITERALS + 1, 0);
  ------------------
  |  |  245|  13.3k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2129|  13.3k|                if (addl == rvl_error) {
  ------------------
  |  Branch (2129:21): [True: 0, False: 13.3k]
  ------------------
 2130|      0|                    DEBUGLOG(5, "error reading long match length");
  ------------------
  |  |  289|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2131|      0|                    goto _output_error;
 2132|      0|                }
 2133|  13.3k|                length += addl;
 2134|  13.3k|                length += MINMATCH;
  ------------------
  |  |  242|  13.3k|#define MINMATCH 4
  ------------------
 2135|  13.3k|                DEBUGLOG(7, "  long match length == %u", (unsigned)length);
  ------------------
  |  |  289|  13.3k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2136|  13.3k|                if (unlikely((uptrval)(op)+length<(uptrval)op)) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  13.3k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  13.3k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 13.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2137|  13.3k|                if (op + length >= oend - FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|  13.3k|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2137:21): [True: 77, False: 13.2k]
  ------------------
 2138|     77|                    goto safe_match_copy;
 2139|     77|                }
 2140|   106k|            } else {
 2141|   106k|                length += MINMATCH;
  ------------------
  |  |  242|   106k|#define MINMATCH 4
  ------------------
 2142|   106k|                if (op + length >= oend - FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|   106k|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2142:21): [True: 174, False: 106k]
  ------------------
 2143|    174|                    DEBUGLOG(7, "moving to safe_match_copy (ml==%u)", (unsigned)length);
  ------------------
  |  |  289|    174|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2144|    174|                    goto safe_match_copy;
 2145|    174|                }
 2146|       |
 2147|       |                /* Fastpath check: skip LZ4_wildCopy32 when true */
 2148|   106k|                if ((dict == withPrefix64k) || (match >= lowPrefix)) {
  ------------------
  |  Branch (2148:21): [True: 0, False: 106k]
  |  Branch (2148:48): [True: 105k, False: 179]
  ------------------
 2149|   105k|                    if (offset >= 8) {
  ------------------
  |  Branch (2149:25): [True: 48.8k, False: 57.0k]
  ------------------
 2150|  48.8k|                        assert(match >= lowPrefix);
  ------------------
  |  |  273|  48.8k|#    define assert(condition) ((void)0)
  ------------------
 2151|  48.8k|                        assert(match <= op);
  ------------------
  |  |  273|  48.8k|#    define assert(condition) ((void)0)
  ------------------
 2152|  48.8k|                        assert(op + 18 <= oend);
  ------------------
  |  |  273|  48.8k|#    define assert(condition) ((void)0)
  ------------------
 2153|       |
 2154|  48.8k|                        LZ4_memcpy(op, match, 8);
  ------------------
  |  |  349|  48.8k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2155|  48.8k|                        LZ4_memcpy(op+8, match+8, 8);
  ------------------
  |  |  349|  48.8k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2156|  48.8k|                        LZ4_memcpy(op+16, match+16, 2);
  ------------------
  |  |  349|  48.8k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2157|  48.8k|                        op += length;
 2158|  48.8k|                        continue;
 2159|  48.8k|            }   }   }
 2160|       |
 2161|  70.4k|            if ( checkOffset && (unlikely(match + dictSize < lowPrefix)) ) {
  ------------------
  |  |  180|  70.4k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  70.4k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  ------------------
  ------------------
  |  Branch (2161:18): [True: 70.4k, False: 0]
  |  Branch (2161:33): [True: 61, False: 70.3k]
  ------------------
 2162|     61|                DEBUGLOG(5, "Error : pos=%zi, offset=%zi => outside buffers", op-lowPrefix, op-match);
  ------------------
  |  |  289|     61|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2163|     61|                goto _output_error;
 2164|     61|            }
 2165|       |            /* match starting within external dictionary */
 2166|  70.3k|            if ((dict==usingExtDict) && (match < lowPrefix)) {
  ------------------
  |  Branch (2166:17): [True: 1.53k, False: 68.8k]
  |  Branch (2166:41): [True: 145, False: 1.39k]
  ------------------
 2167|    145|                assert(dictEnd != NULL);
  ------------------
  |  |  273|    145|#    define assert(condition) ((void)0)
  ------------------
 2168|    145|                if (unlikely(op+length > oend-LASTLITERALS)) {
  ------------------
  |  |  180|    145|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    145|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 145]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|    145|                if (length <= (size_t)(lowPrefix-match)) {
  ------------------
  |  Branch (2177:21): [True: 116, False: 29]
  ------------------
 2178|       |                    /* match fits entirely within external dictionary : just copy */
 2179|    116|                    LZ4_memmove(op, dictEnd - (lowPrefix-match), length);
  ------------------
  |  |  357|    116|#    define LZ4_memmove __builtin_memmove
  ------------------
 2180|    116|                    op += length;
 2181|    116|                } else {
 2182|       |                    /* match stretches into both external dictionary and current block */
 2183|     29|                    size_t const copySize = (size_t)(lowPrefix - match);
 2184|     29|                    size_t const restSize = length - copySize;
 2185|     29|                    LZ4_memcpy(op, dictEnd - copySize, copySize);
  ------------------
  |  |  349|     29|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2186|     29|                    op += copySize;
 2187|     29|                    if (restSize > (size_t)(op - lowPrefix)) {  /* overlap copy */
  ------------------
  |  Branch (2187:25): [True: 13, False: 16]
  ------------------
 2188|     13|                        BYTE* const endOfMatch = op + restSize;
 2189|     13|                        const BYTE* copyFrom = lowPrefix;
 2190|  1.87k|                        while (op < endOfMatch) { *op++ = *copyFrom++; }
  ------------------
  |  Branch (2190:32): [True: 1.86k, False: 13]
  ------------------
 2191|     16|                    } else {
 2192|     16|                        LZ4_memcpy(op, lowPrefix, restSize);
  ------------------
  |  |  349|     16|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2193|     16|                        op += restSize;
 2194|     16|                }   }
 2195|    145|                continue;
 2196|    145|            }
 2197|       |
 2198|       |            /* copy match within block */
 2199|  70.2k|            cpy = op + length;
 2200|       |
 2201|  70.2k|            assert((op <= oend) && (oend-op >= 32));
  ------------------
  |  |  273|  70.2k|#    define assert(condition) ((void)0)
  ------------------
 2202|  70.2k|            if (unlikely(offset<16)) {
  ------------------
  |  |  180|  70.2k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  70.2k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 67.1k, False: 3.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2203|  67.1k|                LZ4_memcpy_using_offset(op, match, cpy, offset);
 2204|  67.1k|            } else {
 2205|  3.09k|                LZ4_wildCopy32(op, match, cpy);
 2206|  3.09k|            }
 2207|       |
 2208|  70.2k|            op = cpy;   /* wildcopy correction */
 2209|  70.2k|        }
 2210|     12|    safe_decode:
 2211|     12|#endif
 2212|       |
 2213|       |        /* Main Loop : decode remaining sequences where output < FASTLOOP_SAFE_DISTANCE */
 2214|     12|        DEBUGLOG(6, "using safe decode loop");
  ------------------
  |  |  289|     12|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2215|  1.44k|        while (1) {
  ------------------
  |  Branch (2215:16): [True: 1.44k, Folded]
  ------------------
 2216|  1.44k|            assert(ip < iend);
  ------------------
  |  |  273|  1.44k|#    define assert(condition) ((void)0)
  ------------------
 2217|  1.44k|            token = *ip++;
 2218|  1.44k|            length = token >> ML_BITS;  /* literal length */
  ------------------
  |  |  260|  1.44k|#define ML_BITS  4
  ------------------
 2219|  1.44k|            DEBUGLOG(7, "blockPos%6u: litLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)length);
  ------------------
  |  |  289|  1.44k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2220|       |
 2221|       |            /* A two-stage shortcut for the most common case:
 2222|       |             * 1) If the literal length is 0..14, and there is enough space,
 2223|       |             * enter the shortcut and copy 16 bytes on behalf of the literals
 2224|       |             * (in the fast mode, only 8 bytes can be safely copied this way).
 2225|       |             * 2) Further if the match length is 4..18, copy 18 bytes in a similar
 2226|       |             * manner; but we ensure that there's enough space in the output for
 2227|       |             * those 18 bytes earlier, upon entering the shortcut (in other words,
 2228|       |             * there is a combined check for both stages).
 2229|       |             */
 2230|  1.44k|            if ( (length != RUN_MASK)
  ------------------
  |  |  263|  1.44k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|  1.44k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|  1.44k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2230:18): [True: 1.26k, False: 185]
  ------------------
 2231|       |                /* strictly "less than" on input, to re-enter the loop with at least one byte */
 2232|  1.26k|              && likely((ip < shortiend) & (op <= shortoend)) ) {
  ------------------
  |  |  177|  1.26k|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|  1.26k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 575, False: 689]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2233|       |                /* Copy the literals */
 2234|    575|                LZ4_memcpy(op, ip, 16);
  ------------------
  |  |  349|    575|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2235|    575|                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|    575|                length = token & ML_MASK; /* match length */
  ------------------
  |  |  261|    575|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    575|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2240|    575|                DEBUGLOG(7, "blockPos%6u: matchLength token = %u (len=%u)", (unsigned)(op-(BYTE*)dst), (unsigned)length, (unsigned)length + 4);
  ------------------
  |  |  289|    575|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2241|    575|                offset = LZ4_readLE16(ip); ip += 2;
 2242|    575|                match = op - offset;
 2243|    575|                assert(match <= op); /* check overflow */
  ------------------
  |  |  273|    575|#    define assert(condition) ((void)0)
  ------------------
 2244|       |
 2245|       |                /* Do not deal with overlapping matches. */
 2246|    575|                if ( (length != ML_MASK)
  ------------------
  |  |  261|    575|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    575|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2246:22): [True: 425, False: 150]
  ------------------
 2247|    425|                  && (offset >= 8)
  ------------------
  |  Branch (2247:22): [True: 196, False: 229]
  ------------------
 2248|    196|                  && (dict==withPrefix64k || match >= lowPrefix) ) {
  ------------------
  |  Branch (2248:23): [True: 0, False: 196]
  |  Branch (2248:46): [True: 180, False: 16]
  ------------------
 2249|       |                    /* Copy the match. */
 2250|    180|                    LZ4_memcpy(op + 0, match + 0, 8);
  ------------------
  |  |  349|    180|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2251|    180|                    LZ4_memcpy(op + 8, match + 8, 8);
  ------------------
  |  |  349|    180|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2252|    180|                    LZ4_memcpy(op +16, match +16, 2);
  ------------------
  |  |  349|    180|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2253|    180|                    op += length + MINMATCH;
  ------------------
  |  |  242|    180|#define MINMATCH 4
  ------------------
 2254|       |                    /* Both stages worked, load the next token. */
 2255|    180|                    continue;
 2256|    180|                }
 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|    395|                goto _copy_match;
 2261|    575|            }
 2262|       |
 2263|       |            /* decode literal length */
 2264|    874|            if (length == RUN_MASK) {
  ------------------
  |  |  263|    874|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|    874|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|    874|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2264:17): [True: 185, False: 689]
  ------------------
 2265|    185|                size_t const addl = read_variable_length(&ip, iend-RUN_MASK, 1);
  ------------------
  |  |  263|    185|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|    185|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|    185|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2266|    185|                if (addl == rvl_error) { goto _output_error; }
  ------------------
  |  Branch (2266:21): [True: 1, False: 184]
  ------------------
 2267|    184|                length += addl;
 2268|    184|                if (unlikely((uptrval)(op)+length<(uptrval)(op))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|    184|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    184|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 184]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2269|    184|                if (unlikely((uptrval)(ip)+length<(uptrval)(ip))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|    184|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    184|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 184]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2270|    184|            }
 2271|       |
 2272|    873|#if LZ4_FAST_DEC_LOOP
 2273|    946|        safe_literal_copy:
 2274|    946|#endif
 2275|       |            /* copy literals */
 2276|    946|            cpy = op+length;
 2277|       |
 2278|    946|            LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH);
  ------------------
  |  |  277|    946|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
 2279|    946|            if ((cpy>oend-MFLIMIT) || (ip+length>iend-(2+1+LASTLITERALS))) {
  ------------------
  |  |  246|    946|#define MFLIMIT       12   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
                          if ((cpy>oend-MFLIMIT) || (ip+length>iend-(2+1+LASTLITERALS))) {
  ------------------
  |  |  245|    723|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (2279:17): [True: 223, False: 723]
  |  Branch (2279:39): [True: 24, False: 699]
  ------------------
 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|    247|                if (partialDecoding) {
  ------------------
  |  Branch (2285:21): [True: 0, False: 247]
  ------------------
 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|    247|                } 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|    247|                    if ((ip+length != iend) || (cpy > oend)) {
  ------------------
  |  Branch (2312:25): [True: 110, False: 137]
  |  Branch (2312:48): [True: 0, False: 137]
  ------------------
 2313|    110|                        DEBUGLOG(5, "should have been last run of literals")
  ------------------
  |  |  289|    110|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2314|    110|                        DEBUGLOG(5, "ip(%p) + length(%i) = %p != iend (%p)", ip, (int)length, ip+length, iend);
  ------------------
  |  |  289|    110|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2315|    110|                        DEBUGLOG(5, "or cpy(%p) > (oend-MFLIMIT)(%p)", cpy, oend-MFLIMIT);
  ------------------
  |  |  289|    110|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2316|    110|                        DEBUGLOG(5, "after writing %u bytes / %i bytes available", (unsigned)(op-(BYTE*)dst), outputSize);
  ------------------
  |  |  289|    110|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2317|    110|                        goto _output_error;
 2318|    110|                    }
 2319|    247|                }
 2320|    137|                LZ4_memmove(op, ip, length);  /* supports overlapping memory regions, for in-place decompression scenarios */
  ------------------
  |  |  357|    137|#    define LZ4_memmove __builtin_memmove
  ------------------
 2321|    137|                ip += length;
 2322|    137|                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|    137|                if (!partialDecoding || (cpy == oend) || (ip >= (iend-2))) {
  ------------------
  |  Branch (2328:21): [True: 137, False: 0]
  |  Branch (2328:41): [True: 0, False: 0]
  |  Branch (2328:58): [True: 0, False: 0]
  ------------------
 2329|    137|                    break;
 2330|    137|                }
 2331|    699|            } else {
 2332|    699|                LZ4_wildCopy8(op, ip, cpy);   /* can overwrite up to 8 bytes beyond cpy */
 2333|    699|                ip += length; op = cpy;
 2334|    699|            }
 2335|       |
 2336|       |            /* get offset */
 2337|    699|            offset = LZ4_readLE16(ip); ip+=2;
 2338|    699|            match = op - offset;
 2339|       |
 2340|       |            /* get matchlength */
 2341|    699|            length = token & ML_MASK;
  ------------------
  |  |  261|    699|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    699|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2342|    699|            DEBUGLOG(7, "blockPos%6u: matchLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)length);
  ------------------
  |  |  289|    699|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2343|       |
 2344|  1.09k|    _copy_match:
 2345|  1.09k|            if (length == ML_MASK) {
  ------------------
  |  |  261|  1.09k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|  1.09k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2345:17): [True: 208, False: 886]
  ------------------
 2346|    208|                size_t const addl = read_variable_length(&ip, iend - LASTLITERALS + 1, 0);
  ------------------
  |  |  245|    208|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2347|    208|                if (addl == rvl_error) { goto _output_error; }
  ------------------
  |  Branch (2347:21): [True: 1, False: 207]
  ------------------
 2348|    207|                length += addl;
 2349|    207|                if (unlikely((uptrval)(op)+length<(uptrval)op)) goto _output_error;   /* overflow detection */
  ------------------
  |  |  180|    207|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    207|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 207]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2350|    207|            }
 2351|  1.09k|            length += MINMATCH;
  ------------------
  |  |  242|  1.09k|#define MINMATCH 4
  ------------------
 2352|       |
 2353|  1.09k|#if LZ4_FAST_DEC_LOOP
 2354|  1.34k|        safe_match_copy:
 2355|  1.34k|#endif
 2356|  1.34k|            if ((checkOffset) && (unlikely(match + dictSize < lowPrefix))) goto _output_error;   /* Error : offset outside buffers */
  ------------------
  |  |  180|  1.34k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.34k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  ------------------
  ------------------
  |  Branch (2356:17): [True: 1.34k, False: 0]
  |  Branch (2356:34): [True: 66, False: 1.27k]
  ------------------
 2357|       |            /* match starting within external dictionary */
 2358|  1.27k|            if ((dict==usingExtDict) && (match < lowPrefix)) {
  ------------------
  |  Branch (2358:17): [True: 121, False: 1.15k]
  |  Branch (2358:41): [True: 7, False: 114]
  ------------------
 2359|      7|                assert(dictEnd != NULL);
  ------------------
  |  |  273|      7|#    define assert(condition) ((void)0)
  ------------------
 2360|      7|                if (unlikely(op+length > oend-LASTLITERALS)) {
  ------------------
  |  |  180|      7|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|      7|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2361|      0|                    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: 0]
  ------------------
 2362|      0|                    else goto _output_error;   /* doesn't respect parsing restriction */
 2363|      0|                }
 2364|       |
 2365|      7|                if (length <= (size_t)(lowPrefix-match)) {
  ------------------
  |  Branch (2365:21): [True: 2, False: 5]
  ------------------
 2366|       |                    /* match fits entirely within external dictionary : just copy */
 2367|      2|                    LZ4_memmove(op, dictEnd - (lowPrefix-match), length);
  ------------------
  |  |  357|      2|#    define LZ4_memmove __builtin_memmove
  ------------------
 2368|      2|                    op += length;
 2369|      5|                } else {
 2370|       |                    /* match stretches into both external dictionary and current block */
 2371|      5|                    size_t const copySize = (size_t)(lowPrefix - match);
 2372|      5|                    size_t const restSize = length - copySize;
 2373|      5|                    LZ4_memcpy(op, dictEnd - copySize, copySize);
  ------------------
  |  |  349|      5|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2374|      5|                    op += copySize;
 2375|      5|                    if (restSize > (size_t)(op - lowPrefix)) {  /* overlap copy */
  ------------------
  |  Branch (2375:25): [True: 5, False: 0]
  ------------------
 2376|      5|                        BYTE* const endOfMatch = op + restSize;
 2377|      5|                        const BYTE* copyFrom = lowPrefix;
 2378|  2.06k|                        while (op < endOfMatch) *op++ = *copyFrom++;
  ------------------
  |  Branch (2378:32): [True: 2.05k, False: 5]
  ------------------
 2379|      5|                    } else {
 2380|      0|                        LZ4_memcpy(op, lowPrefix, restSize);
  ------------------
  |  |  349|      0|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2381|      0|                        op += restSize;
 2382|      0|                }   }
 2383|      7|                continue;
 2384|      7|            }
 2385|  1.27k|            assert(match >= lowPrefix);
  ------------------
  |  |  273|  1.27k|#    define assert(condition) ((void)0)
  ------------------
 2386|       |
 2387|       |            /* copy match within block */
 2388|  1.27k|            cpy = op + length;
 2389|       |
 2390|       |            /* partialDecoding : may end anywhere within the block */
 2391|  1.27k|            assert(op<=oend);
  ------------------
  |  |  273|  1.27k|#    define assert(condition) ((void)0)
  ------------------
 2392|  1.27k|            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.27k]
  |  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.27k|            if (unlikely(offset<8)) {
  ------------------
  |  |  180|  1.27k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.27k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 732, False: 539]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2407|    732|                LZ4_write32(op, 0);   /* silence msan warning when offset==0 */
 2408|    732|                op[0] = match[0];
 2409|    732|                op[1] = match[1];
 2410|    732|                op[2] = match[2];
 2411|    732|                op[3] = match[3];
 2412|    732|                match += inc32table[offset];
 2413|    732|                LZ4_memcpy(op+4, match, 4);
  ------------------
  |  |  349|    732|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2414|    732|                match -= dec64table[offset];
 2415|    732|            } else {
 2416|    539|                LZ4_memcpy(op, match, 8);
  ------------------
  |  |  349|    539|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2417|    539|                match += 8;
 2418|    539|            }
 2419|  1.27k|            op += 8;
 2420|       |
 2421|  1.27k|            if (unlikely(cpy > oend-MATCH_SAFEGUARD_DISTANCE)) {
  ------------------
  |  |  180|  1.27k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.27k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 63, False: 1.20k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2422|     63|                BYTE* const oCopyLimit = oend - (WILDCOPYLENGTH-1);
  ------------------
  |  |  244|     63|#define WILDCOPYLENGTH 8
  ------------------
 2423|     63|                if (cpy > oend-LASTLITERALS) { goto _output_error; } /* Error : last LASTLITERALS bytes must be literals (uncompressed) */
  ------------------
  |  |  245|     63|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (2423:21): [True: 21, False: 42]
  ------------------
 2424|     42|                if (op < oCopyLimit) {
  ------------------
  |  Branch (2424:21): [True: 27, False: 15]
  ------------------
 2425|     27|                    LZ4_wildCopy8(op, match, oCopyLimit);
 2426|     27|                    match += oCopyLimit - op;
 2427|     27|                    op = oCopyLimit;
 2428|     27|                }
 2429|     51|                while (op < cpy) { *op++ = *match++; }
  ------------------
  |  Branch (2429:24): [True: 9, False: 42]
  ------------------
 2430|  1.20k|            } else {
 2431|  1.20k|                LZ4_memcpy(op, match, 8);
  ------------------
  |  |  349|  1.20k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2432|  1.20k|                if (length > 16) { LZ4_wildCopy8(op+8, match+8, cpy); }
  ------------------
  |  Branch (2432:21): [True: 215, False: 993]
  ------------------
 2433|  1.20k|            }
 2434|  1.25k|            op = cpy;   /* wildcopy correction */
 2435|  1.25k|        }
 2436|       |
 2437|       |        /* end of decoding */
 2438|    137|        DEBUGLOG(5, "decoded %i bytes", (int) (((char*)op)-dst));
  ------------------
  |  |  289|    137|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2439|    137|        return (int) (((char*)op)-dst);     /* Nb of output bytes decoded */
 2440|       |
 2441|       |        /* Overflow error detected */
 2442|    261|    _output_error:
 2443|    261|        return (int) (-(((const char*)ip)-src))-1;
 2444|     12|    }
 2445|     12|}
lz4.c:read_variable_length:
 1981|  24.6k|{
 1982|  24.6k|    Rvl_t s, length = 0;
 1983|  24.6k|    assert(ip != NULL);
  ------------------
  |  |  273|  24.6k|#    define assert(condition) ((void)0)
  ------------------
 1984|  24.6k|    assert(*ip !=  NULL);
  ------------------
  |  |  273|  24.6k|#    define assert(condition) ((void)0)
  ------------------
 1985|  24.6k|    assert(ilimit != NULL);
  ------------------
  |  |  273|  24.6k|#    define assert(condition) ((void)0)
  ------------------
 1986|  24.6k|    if (initial_check && unlikely((*ip) >= ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  11.1k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  11.1k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 11.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1986:9): [True: 11.1k, False: 13.5k]
  ------------------
 1987|      0|        return rvl_error;
 1988|      0|    }
 1989|  24.6k|    s = **ip;
 1990|  24.6k|    (*ip)++;
 1991|  24.6k|    length += s;
 1992|  24.6k|    if (unlikely((*ip) > ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  24.6k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  24.6k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 24.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1993|      0|        return rvl_error;
 1994|      0|    }
 1995|       |    /* accumulator overflow detection (32-bit mode only) */
 1996|  24.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: 24.6k]
  ------------------
 1997|      0|        return rvl_error;
 1998|      0|    }
 1999|  24.6k|    if (likely(s != 255)) return length;
  ------------------
  |  |  177|  24.6k|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|  24.6k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 23.4k, False: 1.16k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2000|  6.06k|    do {
 2001|  6.06k|        s = **ip;
 2002|  6.06k|        (*ip)++;
 2003|  6.06k|        length += s;
 2004|  6.06k|        if (unlikely((*ip) > ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  6.06k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  6.06k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 3, False: 6.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2005|      3|            return rvl_error;
 2006|      3|        }
 2007|       |        /* accumulator overflow detection (32-bit mode only) */
 2008|  6.06k|        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.06k]
  ------------------
 2009|      0|            return rvl_error;
 2010|      0|        }
 2011|  6.06k|    } while (s == 255);
  ------------------
  |  Branch (2011:14): [True: 4.89k, False: 1.16k]
  ------------------
 2012|       |
 2013|  1.16k|    return length;
 2014|  1.16k|}
lz4.c:LZ4_wildCopy32:
  523|  13.9k|{
  524|  13.9k|    BYTE* d = (BYTE*)dstPtr;
  525|  13.9k|    const BYTE* s = (const BYTE*)srcPtr;
  526|  13.9k|    BYTE* const e = (BYTE*)dstEnd;
  527|       |
  528|  41.9k|    do { LZ4_memcpy(d,s,16); LZ4_memcpy(d+16,s+16,16); d+=32; s+=32; } while (d<e);
  ------------------
  |  |  349|  41.9k|#    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|  41.9k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (528:79): [True: 27.9k, False: 13.9k]
  ------------------
  529|  13.9k|}
lz4.c:LZ4_readLE16:
  431|   120k|{
  432|   120k|    if (LZ4_isLittleEndian()) {
  ------------------
  |  Branch (432:9): [True: 120k, False: 0]
  ------------------
  433|   120k|        return LZ4_read16(memPtr);
  434|   120k|    } else {
  435|      0|        const BYTE* p = (const BYTE*)memPtr;
  436|      0|        return (U16)((U16)p[0] | (p[1]<<8));
  437|      0|    }
  438|   120k|}
lz4.c:LZ4_memcpy_using_offset:
  536|  67.1k|{
  537|  67.1k|    BYTE v[8];
  538|       |
  539|  67.1k|    assert(dstEnd >= dstPtr + MINMATCH);
  ------------------
  |  |  273|  67.1k|#    define assert(condition) ((void)0)
  ------------------
  540|       |
  541|  67.1k|    switch(offset) {
  542|  7.22k|    case 1:
  ------------------
  |  Branch (542:5): [True: 7.22k, False: 59.9k]
  ------------------
  543|  7.22k|        MEM_INIT(v, *srcPtr, 8);
  ------------------
  |  |  236|  7.22k|#define MEM_INIT(p,v,s)   LZ4_memset((p),(v),(s))
  |  |  ------------------
  |  |  |  |  234|  7.22k|#  define LZ4_memset(p,v,s) memset((p),(v),(s))
  |  |  ------------------
  ------------------
  544|  7.22k|        break;
  545|  2.07k|    case 2:
  ------------------
  |  Branch (545:5): [True: 2.07k, False: 65.0k]
  ------------------
  546|  2.07k|        LZ4_memcpy(v, srcPtr, 2);
  ------------------
  |  |  349|  2.07k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  547|  2.07k|        LZ4_memcpy(&v[2], srcPtr, 2);
  ------------------
  |  |  349|  2.07k|#    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.07k|        LZ4_memcpy(&v[4], v, 4);
  ------------------
  |  |  349|  2.07k|#    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.07k|        break;
  557|  2.50k|    case 4:
  ------------------
  |  Branch (557:5): [True: 2.50k, False: 64.6k]
  ------------------
  558|  2.50k|        LZ4_memcpy(v, srcPtr, 4);
  ------------------
  |  |  349|  2.50k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  559|  2.50k|        LZ4_memcpy(&v[4], srcPtr, 4);
  ------------------
  |  |  349|  2.50k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  560|  2.50k|        break;
  561|  55.3k|    default:
  ------------------
  |  Branch (561:5): [True: 55.3k, False: 11.8k]
  ------------------
  562|  55.3k|        LZ4_memcpy_using_offset_base(dstPtr, srcPtr, dstEnd, offset);
  563|  55.3k|        return;
  564|  67.1k|    }
  565|       |
  566|  11.8k|    LZ4_memcpy(dstPtr, v, 8);
  ------------------
  |  |  349|  11.8k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  567|  11.8k|    dstPtr += 8;
  568|  39.1k|    while (dstPtr < dstEnd) {
  ------------------
  |  Branch (568:12): [True: 27.3k, False: 11.8k]
  ------------------
  569|  27.3k|        LZ4_memcpy(dstPtr, v, 8);
  ------------------
  |  |  349|  27.3k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  570|  27.3k|        dstPtr += 8;
  571|  27.3k|    }
  572|  11.8k|}
lz4.c:LZ4_memcpy_using_offset_base:
  497|  55.3k|{
  498|  55.3k|    assert(srcPtr + offset == dstPtr);
  ------------------
  |  |  273|  55.3k|#    define assert(condition) ((void)0)
  ------------------
  499|  55.3k|    if (offset < 8) {
  ------------------
  |  Branch (499:9): [True: 54.6k, False: 742]
  ------------------
  500|  54.6k|        LZ4_write32(dstPtr, 0);   /* silence an msan warning when offset==0 */
  501|  54.6k|        dstPtr[0] = srcPtr[0];
  502|  54.6k|        dstPtr[1] = srcPtr[1];
  503|  54.6k|        dstPtr[2] = srcPtr[2];
  504|  54.6k|        dstPtr[3] = srcPtr[3];
  505|  54.6k|        srcPtr += inc32table[offset];
  506|  54.6k|        LZ4_memcpy(dstPtr+4, srcPtr, 4);
  ------------------
  |  |  349|  54.6k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  507|  54.6k|        srcPtr -= dec64table[offset];
  508|  54.6k|        dstPtr += 8;
  509|  54.6k|    } else {
  510|    742|        LZ4_memcpy(dstPtr, srcPtr, 8);
  ------------------
  |  |  349|    742|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  511|    742|        dstPtr += 8;
  512|    742|        srcPtr += 8;
  513|    742|    }
  514|       |
  515|  55.3k|    LZ4_wildCopy8(dstPtr, srcPtr, dstEnd);
  516|  55.3k|}

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

adler32_avx2:
  172|     91|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|     91|}
adler32_fold_copy_avx2:
  176|    212|Z_INTERNAL uint32_t adler32_fold_copy_avx2(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len) {
  177|    212|    return adler32_fold_copy_impl(adler, dst, src, len, 1);
  178|    212|}
adler32_avx2.c:adler32_fold_copy_impl:
   21|    303|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|    303|    if (src == NULL) return 1L;
  ------------------
  |  Branch (22:9): [True: 0, False: 303]
  ------------------
   23|    303|    if (len == 0) return adler;
  ------------------
  |  Branch (23:9): [True: 0, False: 303]
  ------------------
   24|       |
   25|    303|    uint32_t adler0, adler1;
   26|    303|    adler1 = (adler >> 16) & 0xffff;
   27|    303|    adler0 = adler & 0xffff;
   28|       |
   29|    548|rem_peel:
   30|    548|    if (len < 16) {
  ------------------
  |  Branch (30:9): [True: 123, False: 425]
  ------------------
   31|    123|        if (COPY) {
  ------------------
  |  Branch (31:13): [True: 80, False: 43]
  ------------------
   32|     80|            return adler32_copy_len_16(adler0, src, dst, len, adler1);
   33|     80|        } else {
   34|     43|            return adler32_len_16(adler0, src, len, adler1);
   35|     43|        }
   36|    425|    } else if (len < 32) {
  ------------------
  |  Branch (36:16): [True: 123, False: 302]
  ------------------
   37|    123|        if (COPY) {
  ------------------
  |  Branch (37:13): [True: 83, False: 40]
  ------------------
   38|     83|            return adler32_fold_copy_sse42(adler, dst, src, len);
   39|     83|        } else {
   40|     40|            return adler32_ssse3(adler, src, len);
   41|     40|        }
   42|    123|    }
   43|       |
   44|    302|    __m256i vs1, vs2, vs2_0;
   45|       |
   46|    302|    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|    302|                                           46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33);
   48|    302|    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|    302|                                             14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
   50|    302|    const __m256i dot3v = _mm256_set1_epi16(1);
   51|    302|    const __m256i zero = _mm256_setzero_si256();
   52|       |
   53|  2.08k|    while (len >= 32) {
  ------------------
  |  Branch (53:12): [True: 1.77k, False: 302]
  ------------------
   54|  1.77k|        vs1 = _mm256_zextsi128_si256(_mm_cvtsi32_si128(adler0));
   55|  1.77k|        vs2 = _mm256_zextsi128_si256(_mm_cvtsi32_si128(adler1));
   56|  1.77k|        __m256i vs1_0 = vs1;
   57|  1.77k|        __m256i vs3 = _mm256_setzero_si256();
   58|  1.77k|        vs2_0 = vs3;
   59|       |
   60|  1.77k|        size_t k = MIN(len, NMAX);
  ------------------
  |  |  124|  1.77k|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 1.47k, False: 302]
  |  |  ------------------
  ------------------
   61|  1.77k|        k -= k % 32;
   62|  1.77k|        len -= k;
   63|       |
   64|   137k|        while (k >= 64) {
  ------------------
  |  Branch (64:16): [True: 135k, False: 1.77k]
  ------------------
   65|   135k|            __m256i vbuf = _mm256_loadu_si256((__m256i*)src);
   66|   135k|            __m256i vbuf_0 = _mm256_loadu_si256((__m256i*)(src + 32));
   67|   135k|            src += 64;
   68|   135k|            k -= 64;
   69|       |
   70|   135k|            __m256i vs1_sad = _mm256_sad_epu8(vbuf, zero);
   71|   135k|            __m256i vs1_sad2 = _mm256_sad_epu8(vbuf_0, zero);
   72|       |
   73|   135k|            if (COPY) {
  ------------------
  |  Branch (73:17): [True: 28.6k, False: 106k]
  ------------------
   74|  28.6k|                _mm256_storeu_si256((__m256i*)dst, vbuf);
   75|  28.6k|                _mm256_storeu_si256((__m256i*)(dst + 32), vbuf_0);
   76|  28.6k|                dst += 64;
   77|  28.6k|            }
   78|       |
   79|   135k|            vs1 = _mm256_add_epi32(vs1, vs1_sad);
   80|   135k|            vs3 = _mm256_add_epi32(vs3, vs1_0);
   81|   135k|            __m256i v_short_sum2 = _mm256_maddubs_epi16(vbuf, dot2v); // sum 32 uint8s to 16 shorts
   82|   135k|            __m256i v_short_sum2_0 = _mm256_maddubs_epi16(vbuf_0, dot2v_0); // sum 32 uint8s to 16 shorts
   83|   135k|            __m256i vsum2 = _mm256_madd_epi16(v_short_sum2, dot3v); // sum 16 shorts to 8 uint32s
   84|   135k|            __m256i vsum2_0 = _mm256_madd_epi16(v_short_sum2_0, dot3v); // sum 16 shorts to 8 uint32s
   85|   135k|            vs1 = _mm256_add_epi32(vs1_sad2, vs1);
   86|   135k|            vs2 = _mm256_add_epi32(vsum2, vs2);
   87|   135k|            vs2_0 = _mm256_add_epi32(vsum2_0, vs2_0);
   88|   135k|            vs1_0 = vs1;
   89|   135k|        }
   90|       |
   91|  1.77k|        vs2 = _mm256_add_epi32(vs2_0, vs2);
   92|  1.77k|        vs3 = _mm256_slli_epi32(vs3, 6);
   93|  1.77k|        vs2 = _mm256_add_epi32(vs3, vs2);
   94|  1.77k|        vs3 = _mm256_setzero_si256();
   95|       |
   96|  3.40k|        while (k >= 32) {
  ------------------
  |  Branch (96:16): [True: 1.62k, False: 1.77k]
  ------------------
   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: 378, False: 1.25k]
  ------------------
  108|    378|                _mm256_storeu_si256((__m256i*)dst, vbuf);
  109|    378|                dst += 32;
  110|    378|            }
  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.77k|        vs3 = _mm256_slli_epi32(vs3, 5);
  122|  1.77k|        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.77k|         adler0 = partial_hsum256(vs1) % BASE;
  ------------------
  |  |   11|  1.77k|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  160|  1.77k|         adler1 = hsum256(vs2) % BASE;
  ------------------
  |  |   11|  1.77k|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  161|  1.77k|    }
  162|       |
  163|    302|    adler = adler0 | (adler1 << 16);
  164|       |
  165|    302|    if (len) {
  ------------------
  |  Branch (165:9): [True: 245, False: 57]
  ------------------
  166|    245|        goto rem_peel;
  167|    245|    }
  168|       |
  169|     57|    return adler;
  170|    302|}

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

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

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

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

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

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

chunkmemset_safe_avx2:
  229|  2.94k|Z_INTERNAL uint8_t* CHUNKMEMSET_SAFE(uint8_t *out, uint8_t *from, unsigned len, unsigned left) {
  230|       |#if OPTIMAL_CMP < 32
  231|       |    static const uint32_t align_mask = 7;
  232|       |#elif OPTIMAL_CMP == 32
  233|       |    static const uint32_t align_mask = 3;
  234|       |#endif
  235|       |
  236|  2.94k|    len = MIN(len, left);
  ------------------
  |  |  124|  2.94k|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 0, False: 2.94k]
  |  |  ------------------
  ------------------
  237|       |
  238|       |#if OPTIMAL_CMP < 64
  239|       |    while (((uintptr_t)out & align_mask) && (len > 0)) {
  240|       |        *out++ = *from++;
  241|       |        --len;
  242|       |        --left;
  243|       |    }
  244|       |#endif
  245|       |
  246|  2.94k|#ifndef HAVE_MASKED_READWRITE
  247|  2.94k|    if (UNLIKELY(left < sizeof(chunk_t))) {
  ------------------
  |  |  214|  2.94k|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 262, False: 2.68k]
  |  |  ------------------
  ------------------
  248|  1.90k|        while (len > 0) {
  ------------------
  |  Branch (248:16): [True: 1.64k, False: 262]
  ------------------
  249|  1.64k|            *out++ = *from++;
  250|  1.64k|            --len;
  251|  1.64k|        }
  252|       |
  253|    262|        return out;
  254|    262|    }
  255|  2.68k|#endif
  256|       |
  257|  2.68k|    if (len)
  ------------------
  |  Branch (257:9): [True: 2.68k, False: 0]
  ------------------
  258|  2.68k|        out = CHUNKMEMSET(out, from, len);
  ------------------
  |  |  121|  2.68k|#define CHUNKMEMSET      chunkmemset_avx2
  ------------------
  259|       |
  260|  2.68k|    return out;
  261|  2.94k|}
chunkset_avx2.c:chunkmemset_avx2:
  112|  62.1k|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|  62.1k|    Assert(from != out, "chunkmemset cannot have a distance 0");
  116|       |
  117|  62.1k|    chunk_t chunk_load;
  118|  62.1k|    uint32_t chunk_mod = 0;
  119|  62.1k|    uint32_t adv_amount;
  120|  62.1k|    int64_t sdist = out - from;
  121|  62.1k|    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|  62.1k|    if (sdist < 0 && dist < len) {
  ------------------
  |  Branch (127:9): [True: 0, False: 62.1k]
  |  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|  62.1k|    if (dist == 1) {
  ------------------
  |  Branch (143:9): [True: 13.4k, False: 48.6k]
  ------------------
  144|  13.4k|        memset(out, *from, len);
  145|  13.4k|        return out + len;
  146|  48.6k|    } else if (dist >= sizeof(chunk_t)) {
  ------------------
  |  Branch (146:16): [True: 368, False: 48.2k]
  ------------------
  147|    368|        return CHUNKCOPY(out, from, len);
  ------------------
  |  |  119|    368|#define CHUNKCOPY        chunkcopy_avx2
  ------------------
  148|    368|    }
  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|  48.2k|#ifdef HAVE_HALF_CHUNK
  158|  48.2k|    if (len <= sizeof(halfchunk_t)) {
  ------------------
  |  Branch (158:9): [True: 39.2k, False: 8.97k]
  ------------------
  159|  39.2k|        if (dist >= sizeof(halfchunk_t))
  ------------------
  |  Branch (159:13): [True: 91, False: 39.1k]
  ------------------
  160|     91|            return HALFCHUNKCOPY(out, from, len);
  161|       |
  162|  39.1k|        if ((dist % 2) != 0 || dist == 6) {
  ------------------
  |  Branch (162:13): [True: 10.3k, False: 28.7k]
  |  Branch (162:32): [True: 669, False: 28.1k]
  ------------------
  163|  11.0k|            halfchunk_t halfchunk_load = GET_HALFCHUNK_MAG(from, &chunk_mod, (unsigned)dist);
  164|       |
  165|  11.0k|            if (len == sizeof(halfchunk_t)) {
  ------------------
  |  Branch (165:17): [True: 631, False: 10.4k]
  ------------------
  166|    631|                storehalfchunk(out, &halfchunk_load);
  167|    631|                len -= sizeof(halfchunk_t);
  168|    631|                out += sizeof(halfchunk_t);
  169|    631|            }
  170|       |
  171|  11.0k|            chunk_load = halfchunk2whole(&halfchunk_load);
  172|  11.0k|            goto rem_bytes;
  173|  11.0k|        }
  174|  39.1k|    }
  175|  37.1k|#endif
  176|       |
  177|  37.1k|#ifdef HAVE_CHUNKMEMSET_2
  178|  37.1k|    if (dist == 2) {
  ------------------
  |  Branch (178:9): [True: 8.37k, False: 28.7k]
  ------------------
  179|  8.37k|        chunkmemset_2(from, &chunk_load);
  180|  8.37k|    } else
  181|  28.7k|#endif
  182|  28.7k|#ifdef HAVE_CHUNKMEMSET_4
  183|  28.7k|    if (dist == 4) {
  ------------------
  |  Branch (183:9): [True: 22.2k, False: 6.46k]
  ------------------
  184|  22.2k|        chunkmemset_4(from, &chunk_load);
  185|  22.2k|    } else
  186|  6.46k|#endif
  187|  6.46k|#ifdef HAVE_CHUNKMEMSET_8
  188|  6.46k|    if (dist == 8) {
  ------------------
  |  Branch (188:9): [True: 2.33k, False: 4.13k]
  ------------------
  189|  2.33k|        chunkmemset_8(from, &chunk_load);
  190|  2.33k|    } else
  191|  4.13k|#endif
  192|  4.13k|#ifdef HAVE_CHUNKMEMSET_16
  193|  4.13k|    if (dist == 16) {
  ------------------
  |  Branch (193:9): [True: 1.11k, False: 3.02k]
  ------------------
  194|  1.11k|        chunkmemset_16(from, &chunk_load);
  195|  1.11k|    } else
  196|  3.02k|#endif
  197|  3.02k|    chunk_load = GET_CHUNK_MAG(from, &chunk_mod, (unsigned)dist);
  198|       |
  199|  37.1k|    adv_amount = sizeof(chunk_t) - chunk_mod;
  200|       |
  201|  40.8k|    while (len >= (2 * sizeof(chunk_t))) {
  ------------------
  |  Branch (201:12): [True: 3.75k, False: 37.1k]
  ------------------
  202|  3.75k|        storechunk(out, &chunk_load);
  203|  3.75k|        storechunk(out + adv_amount, &chunk_load);
  204|  3.75k|        out += 2 * adv_amount;
  205|  3.75k|        len -= 2 * adv_amount;
  206|  3.75k|    }
  207|       |
  208|       |    /* If we don't have a "dist" length that divides evenly into a vector
  209|       |     * register, we can write the whole vector register but we need only
  210|       |     * advance by the amount of the whole string that fits in our chunk_t.
  211|       |     * If we do divide evenly into the vector length, adv_amount = chunk_t size*/
  212|  42.9k|    while (len >= sizeof(chunk_t)) {
  ------------------
  |  Branch (212:12): [True: 5.83k, False: 37.1k]
  ------------------
  213|  5.83k|        storechunk(out, &chunk_load);
  214|  5.83k|        len -= adv_amount;
  215|  5.83k|        out += adv_amount;
  216|  5.83k|    }
  217|       |
  218|  37.1k|#ifdef HAVE_HALF_CHUNK
  219|  48.1k|rem_bytes:
  220|  48.1k|#endif
  221|  48.1k|    if (len) {
  ------------------
  |  Branch (221:9): [True: 47.5k, False: 654]
  ------------------
  222|  47.5k|        memcpy(out, &chunk_load, len);
  223|  47.5k|        out += len;
  224|  47.5k|    }
  225|       |
  226|  48.1k|    return out;
  227|  37.1k|}
chunkset_avx2.c:HALFCHUNKCOPY:
   91|     91|static inline uint8_t* HALFCHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
   92|     91|    halfchunk_t chunk;
   93|     91|    int32_t align = ((len - 1) % sizeof(halfchunk_t)) + 1;
   94|     91|    loadhalfchunk(from, &chunk);
   95|     91|    storehalfchunk(out, &chunk);
   96|     91|    out += align;
   97|     91|    from += align;
   98|     91|    len -= align;
   99|     91|    while (len > 0) {
  ------------------
  |  Branch (99:12): [True: 0, False: 91]
  ------------------
  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|     91|    return out;
  107|     91|}
chunkset_avx2.c:chunksize_avx2:
    9|  67.4k|static inline size_t CHUNKSIZE(void) {
   10|  67.4k|    return sizeof(chunk_t);
   11|  67.4k|}
chunkset_avx2.c:chunkcopy_avx2:
   24|   110k|static inline uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
   25|   110k|    Assert(len > 0, "chunkcopy should never have a length 0");
   26|   110k|    chunk_t chunk;
   27|   110k|    int32_t align = ((len - 1) % sizeof(chunk_t)) + 1;
   28|   110k|    loadchunk(from, &chunk);
   29|   110k|    storechunk(out, &chunk);
   30|   110k|    out += align;
   31|   110k|    from += align;
   32|   110k|    len -= align;
   33|   131k|    while (len > 0) {
  ------------------
  |  Branch (33:12): [True: 21.1k, False: 110k]
  ------------------
   34|  21.1k|        loadchunk(from, &chunk);
   35|  21.1k|        storechunk(out, &chunk);
   36|  21.1k|        out += sizeof(chunk_t);
   37|  21.1k|        from += sizeof(chunk_t);
   38|  21.1k|        len -= sizeof(chunk_t);
   39|  21.1k|    }
   40|   110k|    return out;
   41|   110k|}

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

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

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

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

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

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

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

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

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

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

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

zstd_decompress_block.c:BIT_initDStream:
  255|  3.19k|{
  256|  3.19k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|      1|# 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|      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 (256:9): [True: 1, False: 3.19k]
  ------------------
  257|       |
  258|  3.19k|    bitD->start = (const char*)srcBuffer;
  259|  3.19k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  3.19k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 1.17k, False: 2.02k]
  ------------------
  262|  1.17k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|  1.17k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|  1.17k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|  1.17k|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 1.12k, False: 56]
  ------------------
  266|  1.17k|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   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 (266:15): [True: 56, False: 1.12k]
  ------------------
  267|  2.02k|    } else {
  268|  2.02k|        bitD->ptr   = bitD->start;
  269|  2.02k|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|  2.02k|        switch(srcSize)
  271|  2.02k|        {
  272|    182|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 182, False: 1.83k]
  ------------------
  273|    182|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    182|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|    344|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 162, False: 1.85k]
  ------------------
  276|    344|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    344|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|    514|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 170, False: 1.85k]
  ------------------
  279|    514|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    514|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|  1.14k|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 634, False: 1.38k]
  ------------------
  282|  1.14k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.14k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|  1.32k|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 173, False: 1.84k]
  ------------------
  285|  1.32k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.32k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|  1.72k|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 402, False: 1.61k]
  ------------------
  288|  1.72k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.72k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|  2.02k|        default: break;
  ------------------
  |  Branch (290:9): [True: 297, False: 1.72k]
  ------------------
  291|  2.02k|        }
  292|  2.02k|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|  2.02k|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 2.01k, False: 5]
  ------------------
  294|  2.02k|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   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 (294:17): [True: 5, False: 2.01k]
  ------------------
  295|  2.02k|        }
  296|  2.01k|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|  2.01k|    }
  298|       |
  299|  3.13k|    return srcSize;
  300|  3.19k|}
zstd_decompress_block.c:BIT_readBits:
  363|  14.7M|{
  364|  14.7M|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|  14.7M|    BIT_skipBits(bitD, nbBits);
  366|  14.7M|    return value;
  367|  14.7M|}
zstd_decompress_block.c:BIT_lookBits:
  331|  14.7M|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|  14.7M|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|  14.7M|    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|  14.7M|}
zstd_decompress_block.c:BIT_getMiddleBits:
  308|  14.7M|{
  309|  14.7M|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|  14.7M|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|  14.7M|#    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|  14.7M|#if defined(__x86_64__) || defined(_M_X64)
  318|  14.7M|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|  14.7M|}
zstd_decompress_block.c:BIT_skipBits:
  354|  19.2M|{
  355|  19.2M|    bitD->bitsConsumed += nbBits;
  356|  19.2M|}
zstd_decompress_block.c:BIT_reloadDStream:
  413|  4.91M|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|  4.91M|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|  4.91M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 177k, False: 4.74M]
  |  |  ------------------
  ------------------
  416|   177k|        static const BitContainerType zeroFilled = 0;
  417|   177k|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|   177k|        return BIT_DStream_overflow;
  420|   177k|    }
  421|       |
  422|  4.74M|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  4.74M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|  4.74M|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 4.72M, False: 11.5k]
  ------------------
  425|  4.72M|        return BIT_reloadDStream_internal(bitD);
  426|  4.72M|    }
  427|  11.5k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 10.6k, False: 865]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  10.6k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 9.99k, False: 650]
  ------------------
  430|    650|        return BIT_DStream_completed;
  431|  10.6k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|    865|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|    865|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|    865|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 38, False: 827]
  ------------------
  436|     38|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|     38|            result = BIT_DStream_endOfBuffer;
  438|     38|        }
  439|    865|        bitD->ptr -= nbBytes;
  440|    865|        bitD->bitsConsumed -= nbBytes*8;
  441|    865|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|    865|        return result;
  443|  11.5k|    }
  444|  11.5k|}
zstd_decompress_block.c:BIT_reloadDStream_internal:
  385|  4.72M|{
  386|  4.72M|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  4.72M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  4.72M|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  4.72M|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  4.72M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  4.72M|    bitD->bitsConsumed &= 7;
  390|  4.72M|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  4.72M|    return BIT_DStream_unfinished;
  392|  4.72M|}
zstd_decompress_block.c:BIT_readBitsFast:
  372|  4.51M|{
  373|  4.51M|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  4.51M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  4.51M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  4.51M|    BIT_skipBits(bitD, nbBits);
  376|  4.51M|    return value;
  377|  4.51M|}
zstd_decompress_block.c:BIT_lookBitsFast:
  347|  4.51M|{
  348|  4.51M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  4.51M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  4.51M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  4.51M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  4.51M|}
zstd_decompress_block.c:BIT_endOfDStream:
  450|  2.09k|{
  451|  2.09k|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 2.07k, False: 19]
  |  Branch (451:49): [True: 2.07k, False: 9]
  ------------------
  452|  2.09k|}
fse_decompress.c:BIT_initDStream:
  255|  4.05k|{
  256|  4.05k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|      0|# 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|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (256:9): [True: 0, False: 4.05k]
  ------------------
  257|       |
  258|  4.05k|    bitD->start = (const char*)srcBuffer;
  259|  4.05k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  4.05k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 3.69k, False: 361]
  ------------------
  262|  3.69k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|  3.69k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|  3.69k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|  3.69k|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 3.68k, False: 4]
  ------------------
  266|  3.69k|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   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 (266:15): [True: 4, False: 3.68k]
  ------------------
  267|  3.69k|    } else {
  268|    361|        bitD->ptr   = bitD->start;
  269|    361|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|    361|        switch(srcSize)
  271|    361|        {
  272|     91|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 91, False: 270]
  ------------------
  273|     91|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     91|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|    142|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 51, False: 310]
  ------------------
  276|    142|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    142|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|    197|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 55, False: 306]
  ------------------
  279|    197|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    197|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|    249|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 52, False: 309]
  ------------------
  282|    249|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    249|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|    293|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 44, False: 317]
  ------------------
  285|    293|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    293|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|    360|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 67, False: 294]
  ------------------
  288|    360|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    360|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|    361|        default: break;
  ------------------
  |  Branch (290:9): [True: 1, False: 360]
  ------------------
  291|    361|        }
  292|    361|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|    361|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 361, False: 0]
  ------------------
  294|    361|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 0, False: 361]
  ------------------
  295|    361|        }
  296|    361|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|    361|    }
  298|       |
  299|  4.05k|    return srcSize;
  300|  4.05k|}
fse_decompress.c:BIT_readBits:
  363|   364k|{
  364|   364k|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|   364k|    BIT_skipBits(bitD, nbBits);
  366|   364k|    return value;
  367|   364k|}
fse_decompress.c:BIT_lookBits:
  331|   364k|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|   364k|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|   364k|    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|   364k|}
fse_decompress.c:BIT_getMiddleBits:
  308|   364k|{
  309|   364k|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|   364k|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|   364k|#    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|   364k|#if defined(__x86_64__) || defined(_M_X64)
  318|   364k|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|   364k|}
fse_decompress.c:BIT_skipBits:
  354|   410k|{
  355|   410k|    bitD->bitsConsumed += nbBits;
  356|   410k|}
fse_decompress.c:BIT_reloadDStream:
  413|   272k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|   272k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|   272k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 4.05k, False: 268k]
  |  |  ------------------
  ------------------
  416|  4.05k|        static const BitContainerType zeroFilled = 0;
  417|  4.05k|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|  4.05k|        return BIT_DStream_overflow;
  420|  4.05k|    }
  421|       |
  422|   268k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   268k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|   268k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 12.8k, False: 255k]
  ------------------
  425|  12.8k|        return BIT_reloadDStream_internal(bitD);
  426|  12.8k|    }
  427|   255k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 209k, False: 45.6k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|   209k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 204k, False: 5.33k]
  ------------------
  430|  5.33k|        return BIT_DStream_completed;
  431|   209k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  45.6k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  45.6k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  45.6k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 315, False: 45.3k]
  ------------------
  436|    315|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    315|            result = BIT_DStream_endOfBuffer;
  438|    315|        }
  439|  45.6k|        bitD->ptr -= nbBytes;
  440|  45.6k|        bitD->bitsConsumed -= nbBytes*8;
  441|  45.6k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  45.6k|        return result;
  443|   255k|    }
  444|   255k|}
fse_decompress.c:BIT_reloadDStream_internal:
  385|  12.8k|{
  386|  12.8k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  12.8k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  12.8k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  12.8k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  12.8k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  12.8k|    bitD->bitsConsumed &= 7;
  390|  12.8k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  12.8k|    return BIT_DStream_unfinished;
  392|  12.8k|}
fse_decompress.c:BIT_readBitsFast:
  372|  46.3k|{
  373|  46.3k|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  46.3k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  46.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  46.3k|    BIT_skipBits(bitD, nbBits);
  376|  46.3k|    return value;
  377|  46.3k|}
fse_decompress.c:BIT_lookBitsFast:
  347|  46.3k|{
  348|  46.3k|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  46.3k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  46.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  46.3k|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  46.3k|}
huf_decompress.c:BIT_initDStream:
  255|  1.59k|{
  256|  1.59k|    if (srcSize < 1) { ZSTD_memset(bitD, 0, sizeof(*bitD)); return ERROR(srcSize_wrong); }
  ------------------
  |  |   46|      2|# 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|      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 (256:9): [True: 2, False: 1.58k]
  ------------------
  257|       |
  258|  1.58k|    bitD->start = (const char*)srcBuffer;
  259|  1.58k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  1.58k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 525, False: 1.06k]
  ------------------
  262|    525|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|    525|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|    525|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|    525|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 520, False: 5]
  ------------------
  266|    525|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   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 (266:15): [True: 5, False: 520]
  ------------------
  267|  1.06k|    } else {
  268|  1.06k|        bitD->ptr   = bitD->start;
  269|  1.06k|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|  1.06k|        switch(srcSize)
  271|  1.06k|        {
  272|     50|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 50, False: 1.01k]
  ------------------
  273|     50|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     50|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|     84|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 34, False: 1.03k]
  ------------------
  276|     84|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     84|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|     92|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 8, False: 1.05k]
  ------------------
  279|     92|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     92|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|     98|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 6, False: 1.05k]
  ------------------
  282|     98|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     98|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|    617|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 519, False: 545]
  ------------------
  285|    617|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    617|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|    622|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 5, False: 1.05k]
  ------------------
  288|    622|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    622|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|  1.06k|        default: break;
  ------------------
  |  Branch (290:9): [True: 442, False: 622]
  ------------------
  291|  1.06k|        }
  292|  1.06k|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|  1.06k|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 1.06k, False: 0]
  ------------------
  294|  1.06k|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 0, False: 1.06k]
  ------------------
  295|  1.06k|        }
  296|  1.06k|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|  1.06k|    }
  298|       |
  299|  1.58k|    return srcSize;
  300|  1.58k|}
huf_decompress.c:BIT_reloadDStream:
  413|   335k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|   335k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|   335k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 47, False: 335k]
  |  |  ------------------
  ------------------
  416|     47|        static const BitContainerType zeroFilled = 0;
  417|     47|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|     47|        return BIT_DStream_overflow;
  420|     47|    }
  421|       |
  422|   335k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   335k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|   335k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 319k, False: 15.4k]
  ------------------
  425|   319k|        return BIT_reloadDStream_internal(bitD);
  426|   319k|    }
  427|  15.4k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 2.54k, False: 12.9k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  2.54k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 2.11k, False: 423]
  ------------------
  430|    423|        return BIT_DStream_completed;
  431|  2.54k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  12.9k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  12.9k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  12.9k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 1.57k, False: 11.3k]
  ------------------
  436|  1.57k|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|  1.57k|            result = BIT_DStream_endOfBuffer;
  438|  1.57k|        }
  439|  12.9k|        bitD->ptr -= nbBytes;
  440|  12.9k|        bitD->bitsConsumed -= nbBytes*8;
  441|  12.9k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  12.9k|        return result;
  443|  15.4k|    }
  444|  15.4k|}
huf_decompress.c:BIT_reloadDStream_internal:
  385|   387k|{
  386|   387k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|   387k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|   387k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|   387k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   387k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|   387k|    bitD->bitsConsumed &= 7;
  390|   387k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|   387k|    return BIT_DStream_unfinished;
  392|   387k|}
huf_decompress.c:BIT_lookBitsFast:
  347|  3.48M|{
  348|  3.48M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  3.48M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  3.48M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  3.48M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  3.48M|}
huf_decompress.c:BIT_skipBits:
  354|  3.48M|{
  355|  3.48M|    bitD->bitsConsumed += nbBits;
  356|  3.48M|}
huf_decompress.c:BIT_endOfDStream:
  450|  1.57k|{
  451|  1.57k|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 1.44k, False: 125]
  |  Branch (451:49): [True: 1.16k, False: 281]
  ------------------
  452|  1.57k|}
huf_decompress.c:BIT_reloadDStreamFast:
  401|  67.9k|{
  402|  67.9k|    if (UNLIKELY(bitD->ptr < bitD->limitPtr))
  ------------------
  |  |  188|  67.9k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 141, False: 67.7k]
  |  |  ------------------
  ------------------
  403|    141|        return BIT_DStream_overflow;
  404|  67.7k|    return BIT_reloadDStream_internal(bitD);
  405|  67.9k|}

zstd_decompress_block.c:ZSTD_maybeNullPtrAdd:
  386|  11.3k|{
  387|  11.3k|    return add > 0 ? ptr + add : ptr;
  ------------------
  |  Branch (387:12): [True: 11.2k, False: 166]
  ------------------
  388|  11.3k|}
zstd_decompress_block.c:ZSTD_wrappedPtrSub:
  374|  1.93M|{
  375|  1.93M|    return ptr - sub;
  376|  1.93M|}
zstd_decompress_block.c:ZSTD_wrappedPtrAdd:
  361|  1.93M|{
  362|  1.93M|    return ptr + add;
  363|  1.93M|}
huf_decompress.c:ZSTD_maybeNullPtrAdd:
  386|  7.27k|{
  387|  7.27k|    return add > 0 ? ptr + add : ptr;
  ------------------
  |  Branch (387:12): [True: 6.85k, False: 422]
  ------------------
  388|  7.27k|}

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

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

zstd_common.c:ERR_isError:
   52|  19.7k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  19.7k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  19.7k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  19.7k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_common.c:ERR_getErrorCode:
   54|  16.9k|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: 15.3k, False: 1.56k]
  ------------------
zstd_ddict.c:ERR_isError:
   52|  1.65k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  1.65k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  1.65k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.65k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress.c:ERR_isError:
   52|   222k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|   222k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|   222k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   222k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress_block.c:ERR_isError:
   52|  4.94M|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  4.94M|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  4.94M|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  4.94M|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v05.c:ERR_isError:
   52|  2.57k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  2.57k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  2.57k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.57k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v06.c:ERR_isError:
   52|  1.14k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  1.14k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  1.14k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.14k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v07.c:ERR_isError:
   52|  1.12k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  1.12k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  1.12k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.12k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
entropy_common.c:ERR_isError:
   52|  4.80k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  4.80k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  4.80k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  4.80k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
fse_decompress.c:ERR_isError:
   52|  12.1k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  12.1k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  12.1k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  12.1k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
huf_decompress.c:ERR_isError:
   52|  24.4k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  24.4k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  24.4k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  24.4k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------

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

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

zstd_ddict.c:MEM_readLE32:
  322|    872|{
  323|    872|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 872, False: 0]
  ------------------
  324|    872|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|    872|}
zstd_ddict.c:MEM_isLittleEndian:
  141|    872|{
  142|    872|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|    872|    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|    872|}
zstd_ddict.c:MEM_read32:
  183|    872|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE32:
  322|  55.6k|{
  323|  55.6k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 55.6k, False: 0]
  ------------------
  324|  55.6k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  55.6k|}
zstd_decompress.c:MEM_isLittleEndian:
  141|  58.9k|{
  142|  58.9k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  58.9k|    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|  58.9k|}
zstd_decompress.c:MEM_read32:
  183|  55.6k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE16:
  290|  1.04k|{
  291|  1.04k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 1.04k, False: 0]
  ------------------
  292|  1.04k|        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.04k|}
zstd_decompress.c:MEM_read16:
  182|  1.04k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress.c:MEM_readLE64:
  338|  2.27k|{
  339|  2.27k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 2.27k, False: 0]
  ------------------
  340|  2.27k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  2.27k|}
zstd_decompress.c:MEM_read64:
  184|  2.27k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_decompress_block.c:MEM_readLE24:
  311|  61.0k|{
  312|  61.0k|    return (U32)MEM_readLE16(memPtr) + ((U32)(((const BYTE*)memPtr)[2]) << 16);
  313|  61.0k|}
zstd_decompress_block.c:MEM_readLE32:
  322|  4.27k|{
  323|  4.27k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 4.27k, False: 0]
  ------------------
  324|  4.27k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  4.27k|}
zstd_decompress_block.c:MEM_isLittleEndian:
  141|  4.79M|{
  142|  4.79M|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  4.79M|    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.79M|}
zstd_decompress_block.c:MEM_read32:
  183|  4.27k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress_block.c:MEM_write64:
  189|  20.0k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
zstd_decompress_block.c:MEM_readLE16:
  290|  61.9k|{
  291|  61.9k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 61.9k, False: 0]
  ------------------
  292|  61.9k|        return MEM_read16(memPtr);
  293|      0|    else {
  294|      0|        const BYTE* p = (const BYTE*)memPtr;
  295|      0|        return (U16)(p[0] + (p[1]<<8));
  296|      0|    }
  297|  61.9k|}
zstd_decompress_block.c:MEM_read16:
  182|  61.9k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress_block.c:MEM_32bits:
  137|  32.9M|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_decompress_block.c:MEM_64bits:
  138|  4.91M|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_decompress_block.c:MEM_readLEST:
  354|  4.73M|{
  355|  4.73M|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 4.73M]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  4.73M|    else
  358|  4.73M|        return (size_t)MEM_readLE64(memPtr);
  359|  4.73M|}
zstd_decompress_block.c:MEM_readLE64:
  338|  4.73M|{
  339|  4.73M|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 4.73M, False: 0]
  ------------------
  340|  4.73M|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  4.73M|}
zstd_decompress_block.c:MEM_read64:
  184|  4.73M|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_v05.c:MEM_readLE32:
  322|  1.30k|{
  323|  1.30k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 1.30k, False: 0]
  ------------------
  324|  1.30k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  1.30k|}
zstd_v05.c:MEM_isLittleEndian:
  141|  2.32k|{
  142|  2.32k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  2.32k|    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|  2.32k|}
zstd_v05.c:MEM_read32:
  183|  1.30k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_v05.c:MEM_readLEST:
  354|  1.01k|{
  355|  1.01k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 1.01k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  1.01k|    else
  358|  1.01k|        return (size_t)MEM_readLE64(memPtr);
  359|  1.01k|}
zstd_v05.c:MEM_32bits:
  137|  2.72k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_v05.c:MEM_readLE64:
  338|  1.01k|{
  339|  1.01k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 1.01k, False: 0]
  ------------------
  340|  1.01k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  1.01k|}
zstd_v05.c:MEM_read64:
  184|  1.01k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_v05.c:MEM_readLE16:
  290|      7|{
  291|      7|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 7, False: 0]
  ------------------
  292|      7|        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|      7|}
zstd_v05.c:MEM_read16:
  182|      7|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_v05.c:MEM_64bits:
  138|    765|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
entropy_common.c:MEM_readLE32:
  322|  75.6k|{
  323|  75.6k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 75.6k, False: 0]
  ------------------
  324|  75.6k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  75.6k|}
entropy_common.c:MEM_isLittleEndian:
  141|  75.6k|{
  142|  75.6k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  75.6k|    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|  75.6k|}
entropy_common.c:MEM_read32:
  183|  75.6k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
fse_decompress.c:MEM_write64:
  189|  13.9k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
fse_decompress.c:MEM_readLEST:
  354|  62.1k|{
  355|  62.1k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 62.1k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  62.1k|    else
  358|  62.1k|        return (size_t)MEM_readLE64(memPtr);
  359|  62.1k|}
fse_decompress.c:MEM_32bits:
  137|  62.1k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
fse_decompress.c:MEM_isLittleEndian:
  141|  62.1k|{
  142|  62.1k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  62.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|  62.1k|}
fse_decompress.c:MEM_readLE64:
  338|  62.1k|{
  339|  62.1k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 62.1k, False: 0]
  ------------------
  340|  62.1k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  62.1k|}
fse_decompress.c:MEM_read64:
  184|  62.1k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_isLittleEndian:
  141|   727k|{
  142|   727k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   727k|    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|   727k|}
huf_decompress.c:MEM_write64:
  189|  1.98M|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
huf_decompress.c:MEM_readLEST:
  354|   424k|{
  355|   424k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 424k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|   424k|    else
  358|   424k|        return (size_t)MEM_readLE64(memPtr);
  359|   424k|}
huf_decompress.c:MEM_32bits:
  137|   439k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
huf_decompress.c:MEM_readLE64:
  338|   424k|{
  339|   424k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 424k, False: 0]
  ------------------
  340|   424k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|   424k|}
huf_decompress.c:MEM_read64:
  184|   424k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_64bits:
  138|   631k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
huf_decompress.c:MEM_readLE16:
  290|  9.29k|{
  291|  9.29k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 9.29k, False: 0]
  ------------------
  292|  9.29k|        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.29k|}
huf_decompress.c:MEM_read16:
  182|  9.29k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }

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

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

zstd_decompress.c:ZSTD_cpuSupportsBmi2:
  319|  1.86k|{
  320|  1.86k|    ZSTD_cpuid_t cpuid = ZSTD_cpuid();
  321|  1.86k|    return ZSTD_cpuid_bmi1(cpuid) && ZSTD_cpuid_bmi2(cpuid);
  ------------------
  |  Branch (321:12): [True: 1.86k, False: 0]
  |  Branch (321:38): [True: 1.86k, False: 0]
  ------------------
  322|  1.86k|}
zstd_decompress_block.c:ZSTD_wildcopy:
  217|  3.52M|{
  218|  3.52M|    ptrdiff_t diff = (BYTE*)dst - (const BYTE*)src;
  219|  3.52M|    const BYTE* ip = (const BYTE*)src;
  220|  3.52M|    BYTE* op = (BYTE*)dst;
  221|  3.52M|    BYTE* const oend = op + length;
  222|       |
  223|  3.52M|    if (ovtype == ZSTD_overlap_src_before_dst && diff < WILDCOPY_VECLEN) {
  ------------------
  |  |  200|   160k|#define WILDCOPY_VECLEN 16
  ------------------
  |  Branch (223:9): [True: 160k, False: 3.36M]
  |  Branch (223:50): [True: 160k, False: 163]
  ------------------
  224|       |        /* Handle short offset copies. */
  225|  1.14M|        do {
  226|  1.14M|            COPY8(op, ip);
  ------------------
  |  |  177|  1.14M|#define COPY8(d,s) do { ZSTD_copy8(d,s); d+=8; s+=8; } while (0)
  |  |  ------------------
  |  |  |  Branch (177:63): [Folded, False: 1.14M]
  |  |  ------------------
  ------------------
  227|  1.14M|        } while (op < oend);
  ------------------
  |  Branch (227:18): [True: 983k, False: 160k]
  ------------------
  228|  3.36M|    } else {
  229|  3.36M|        assert(diff >= WILDCOPY_VECLEN || diff <= -WILDCOPY_VECLEN);
  ------------------
  |  |   70|  3.36M|#    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.36M|        ZSTD_copy16(op, ip);
  237|  3.36M|        if (16 >= length) return;
  ------------------
  |  Branch (237:13): [True: 3.24M, False: 125k]
  ------------------
  238|   125k|        op += 16;
  239|   125k|        ip += 16;
  240|   829k|        do {
  241|   829k|            COPY16(op, ip);
  ------------------
  |  |  197|   829k|#define COPY16(d,s) do { ZSTD_copy16(d,s); d+=16; s+=16; } while (0)
  |  |  ------------------
  |  |  |  Branch (197:67): [Folded, False: 829k]
  |  |  ------------------
  ------------------
  242|   829k|            COPY16(op, ip);
  ------------------
  |  |  197|   829k|#define COPY16(d,s) do { ZSTD_copy16(d,s); d+=16; s+=16; } while (0)
  |  |  ------------------
  |  |  |  Branch (197:67): [Folded, False: 829k]
  |  |  ------------------
  ------------------
  243|   829k|        }
  244|   829k|        while (op < oend);
  ------------------
  |  Branch (244:16): [True: 703k, False: 125k]
  ------------------
  245|   125k|    }
  246|  3.52M|}
zstd_decompress_block.c:ZSTD_copy8:
  170|  1.98M|static void ZSTD_copy8(void* dst, const void* src) {
  171|       |#if defined(ZSTD_ARCH_ARM_NEON)
  172|       |    vst1_u8((uint8_t*)dst, vld1_u8((const uint8_t*)src));
  173|       |#else
  174|  1.98M|    ZSTD_memcpy(dst, src, 8);
  ------------------
  |  |   44|  1.98M|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  175|  1.98M|#endif
  176|  1.98M|}
zstd_decompress_block.c:ZSTD_copy16:
  183|  9.88M|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|  9.88M|}

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

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

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

ZSTD_getcBlockSize:
   65|  59.9k|{
   66|  59.9k|    RETURN_ERROR_IF(srcSize < ZSTD_blockHeaderSize, srcSize_wrong, "");
  ------------------
  |  |  114|  59.9k|    do {                                                                       \
  |  |  115|  59.9k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 59.9k]
  |  |  ------------------
  |  |  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|  59.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 59.9k]
  |  |  ------------------
  ------------------
   67|       |
   68|  59.9k|    {   U32 const cBlockHeader = MEM_readLE24(src);
   69|  59.9k|        U32 const cSize = cBlockHeader >> 3;
   70|  59.9k|        bpPtr->lastBlock = cBlockHeader & 1;
   71|  59.9k|        bpPtr->blockType = (blockType_e)((cBlockHeader >> 1) & 3);
   72|  59.9k|        bpPtr->origSize = cSize;   /* only useful for RLE */
   73|  59.9k|        if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (73:13): [True: 1.82k, False: 58.0k]
  ------------------
   74|  58.0k|        RETURN_ERROR_IF(bpPtr->blockType == bt_reserved, corruption_detected, "");
  ------------------
  |  |  114|  58.0k|    do {                                                                       \
  |  |  115|  58.0k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 12, False: 58.0k]
  |  |  ------------------
  |  |  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|  58.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 58.0k]
  |  |  ------------------
  ------------------
   75|  58.0k|        return cSize;
   76|  58.0k|    }
   77|  58.0k|}
ZSTD_buildFSETable:
  630|  4.23k|{
  631|  4.23k|#if DYNAMIC_BMI2
  632|  4.23k|    if (bmi2) {
  ------------------
  |  Branch (632:9): [True: 3.97k, False: 259]
  ------------------
  633|  3.97k|        ZSTD_buildFSETable_body_bmi2(dt, normalizedCounter, maxSymbolValue,
  634|  3.97k|                baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  635|  3.97k|        return;
  636|  3.97k|    }
  637|    259|#endif
  638|    259|    (void)bmi2;
  639|    259|    ZSTD_buildFSETable_body_default(dt, normalizedCounter, maxSymbolValue,
  640|    259|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  641|    259|}
ZSTD_decodeSeqHeaders:
  697|  7.01k|{
  698|  7.01k|    const BYTE* const istart = (const BYTE*)src;
  699|  7.01k|    const BYTE* const iend = istart + srcSize;
  700|  7.01k|    const BYTE* ip = istart;
  701|  7.01k|    int nbSeq;
  702|  7.01k|    DEBUGLOG(5, "ZSTD_decodeSeqHeaders");
  ------------------
  |  |  104|  7.01k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 7.01k]
  |  |  ------------------
  ------------------
  703|       |
  704|       |    /* check */
  705|  7.01k|    RETURN_ERROR_IF(srcSize < MIN_SEQUENCES_SIZE, srcSize_wrong, "");
  ------------------
  |  |  114|  7.01k|    do {                                                                       \
  |  |  115|  7.01k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 7.01k]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|  7.01k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 7.01k]
  |  |  ------------------
  ------------------
  706|       |
  707|       |    /* SeqHead */
  708|  7.01k|    nbSeq = *ip++;
  709|  7.01k|    if (nbSeq > 0x7F) {
  ------------------
  |  Branch (709:9): [True: 1.01k, False: 6.00k]
  ------------------
  710|  1.01k|        if (nbSeq == 0xFF) {
  ------------------
  |  Branch (710:13): [True: 576, False: 435]
  ------------------
  711|    576|            RETURN_ERROR_IF(ip+2 > iend, srcSize_wrong, "");
  ------------------
  |  |  114|    576|    do {                                                                       \
  |  |  115|    576|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 573]
  |  |  ------------------
  |  |  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|    576|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 573]
  |  |  ------------------
  ------------------
  712|    573|            nbSeq = MEM_readLE16(ip) + LONGNBSEQ;
  ------------------
  |  |   96|    573|#define LONGNBSEQ 0x7F00
  ------------------
  713|    573|            ip+=2;
  714|    573|        } else {
  715|    435|            RETURN_ERROR_IF(ip >= iend, srcSize_wrong, "");
  ------------------
  |  |  114|    435|    do {                                                                       \
  |  |  115|    435|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 433]
  |  |  ------------------
  |  |  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|    435|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 433]
  |  |  ------------------
  ------------------
  716|    433|            nbSeq = ((nbSeq-0x80)<<8) + *ip++;
  717|    433|        }
  718|  1.01k|    }
  719|  7.01k|    *nbSeqPtr = nbSeq;
  720|       |
  721|  7.01k|    if (nbSeq == 0) {
  ------------------
  |  Branch (721:9): [True: 3.78k, False: 3.22k]
  ------------------
  722|       |        /* No sequence : section ends immediately */
  723|  3.78k|        RETURN_ERROR_IF(ip != iend, corruption_detected,
  ------------------
  |  |  114|  3.78k|    do {                                                                       \
  |  |  115|  3.78k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 25, False: 3.76k]
  |  |  ------------------
  |  |  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|  3.78k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.76k]
  |  |  ------------------
  ------------------
  724|  3.78k|            "extraneous data present in the Sequences section");
  725|  3.76k|        return (size_t)(ip - istart);
  726|  3.78k|    }
  727|       |
  728|       |    /* FSE table descriptors */
  729|  3.22k|    RETURN_ERROR_IF(ip+1 > iend, srcSize_wrong, ""); /* minimum possible size: 1 byte for symbol encoding types */
  ------------------
  |  |  114|  3.22k|    do {                                                                       \
  |  |  115|  3.22k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 10, False: 3.21k]
  |  |  ------------------
  |  |  116|     10|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     10|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     10|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     10|    do {                                           \
  |  |  |  |   99|     10|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     10|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     10|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     10|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     10|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     10|        }                                                                      \
  |  |  123|  3.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.21k]
  |  |  ------------------
  ------------------
  730|  3.21k|    RETURN_ERROR_IF(*ip & 3, corruption_detected, ""); /* The last field, Reserved, must be all-zeroes. */
  ------------------
  |  |  114|  3.21k|    do {                                                                       \
  |  |  115|  3.21k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 10, False: 3.20k]
  |  |  ------------------
  |  |  116|     10|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     10|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     10|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     10|    do {                                           \
  |  |  |  |   99|     10|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     10|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     10|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     10|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     10|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     10|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     10|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     10|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     10|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     10|        }                                                                      \
  |  |  123|  3.21k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.20k]
  |  |  ------------------
  ------------------
  731|  3.20k|    {   SymbolEncodingType_e const LLtype = (SymbolEncodingType_e)(*ip >> 6);
  732|  3.20k|        SymbolEncodingType_e const OFtype = (SymbolEncodingType_e)((*ip >> 4) & 3);
  733|  3.20k|        SymbolEncodingType_e const MLtype = (SymbolEncodingType_e)((*ip >> 2) & 3);
  734|  3.20k|        ip++;
  735|       |
  736|       |        /* Build DTables */
  737|  3.20k|        {   size_t const llhSize = ZSTD_buildSeqTable(dctx->entropy.LLTable, &dctx->LLTptr,
  738|  3.20k|                                                      LLtype, MaxLL, LLFSELog,
  ------------------
  |  |  104|  3.20k|#define MaxLL   35
  ------------------
                                                                    LLtype, MaxLL, LLFSELog,
  ------------------
  |  |  109|  3.20k|#define LLFSELog    9
  ------------------
  739|  3.20k|                                                      ip, iend-ip,
  740|  3.20k|                                                      LL_base, LL_bits,
  741|  3.20k|                                                      LL_defaultDTable, dctx->fseEntropy,
  742|  3.20k|                                                      dctx->ddictIsCold, nbSeq,
  743|  3.20k|                                                      dctx->workspace, sizeof(dctx->workspace),
  744|  3.20k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  745|  3.20k|            RETURN_ERROR_IF(ZSTD_isError(llhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  3.20k|    do {                                                                       \
  |  |  115|  3.20k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 3.20k]
  |  |  ------------------
  |  |  116|      2|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      2|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      2|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      2|    do {                                           \
  |  |  |  |   99|      2|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      2|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      2|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      2|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      2|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      2|        }                                                                      \
  |  |  123|  3.20k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.20k]
  |  |  ------------------
  ------------------
  746|  3.20k|            ip += llhSize;
  747|  3.20k|        }
  748|       |
  749|      0|        {   size_t const ofhSize = ZSTD_buildSeqTable(dctx->entropy.OFTable, &dctx->OFTptr,
  750|  3.20k|                                                      OFtype, MaxOff, OffFSELog,
  ------------------
  |  |  106|  3.20k|#define MaxOff  31
  ------------------
                                                                    OFtype, MaxOff, OffFSELog,
  ------------------
  |  |  110|  3.20k|#define OffFSELog   8
  ------------------
  751|  3.20k|                                                      ip, iend-ip,
  752|  3.20k|                                                      OF_base, OF_bits,
  753|  3.20k|                                                      OF_defaultDTable, dctx->fseEntropy,
  754|  3.20k|                                                      dctx->ddictIsCold, nbSeq,
  755|  3.20k|                                                      dctx->workspace, sizeof(dctx->workspace),
  756|  3.20k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  757|  3.20k|            RETURN_ERROR_IF(ZSTD_isError(ofhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  3.20k|    do {                                                                       \
  |  |  115|  3.20k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 3.20k]
  |  |  ------------------
  |  |  116|      2|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      2|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      2|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      2|    do {                                           \
  |  |  |  |   99|      2|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      2|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      2|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      2|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      2|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      2|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      2|        }                                                                      \
  |  |  123|  3.20k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.20k]
  |  |  ------------------
  ------------------
  758|  3.20k|            ip += ofhSize;
  759|  3.20k|        }
  760|       |
  761|      0|        {   size_t const mlhSize = ZSTD_buildSeqTable(dctx->entropy.MLTable, &dctx->MLTptr,
  762|  3.20k|                                                      MLtype, MaxML, MLFSELog,
  ------------------
  |  |  103|  3.20k|#define MaxML   52
  ------------------
                                                                    MLtype, MaxML, MLFSELog,
  ------------------
  |  |  108|  3.20k|#define MLFSELog    9
  ------------------
  763|  3.20k|                                                      ip, iend-ip,
  764|  3.20k|                                                      ML_base, ML_bits,
  765|  3.20k|                                                      ML_defaultDTable, dctx->fseEntropy,
  766|  3.20k|                                                      dctx->ddictIsCold, nbSeq,
  767|  3.20k|                                                      dctx->workspace, sizeof(dctx->workspace),
  768|  3.20k|                                                      ZSTD_DCtx_get_bmi2(dctx));
  769|  3.20k|            RETURN_ERROR_IF(ZSTD_isError(mlhSize), corruption_detected, "ZSTD_buildSeqTable failed");
  ------------------
  |  |  114|  3.20k|    do {                                                                       \
  |  |  115|  3.20k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 3.19k]
  |  |  ------------------
  |  |  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|  3.20k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.19k]
  |  |  ------------------
  ------------------
  770|  3.19k|            ip += mlhSize;
  771|  3.19k|        }
  772|  3.19k|    }
  773|       |
  774|      0|    return ip-istart;
  775|  3.20k|}
ZSTD_decompressBlock_internal:
 2069|  7.23k|{   /* blockType == blockCompressed */
 2070|  7.23k|    const BYTE* ip = (const BYTE*)src;
 2071|  7.23k|    DEBUGLOG(5, "ZSTD_decompressBlock_internal (cSize : %u)", (unsigned)srcSize);
  ------------------
  |  |  104|  7.23k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 7.23k]
  |  |  ------------------
  ------------------
 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|  7.23k|    RETURN_ERROR_IF(srcSize > ZSTD_blockSizeMax(dctx), srcSize_wrong, "");
  ------------------
  |  |  114|  7.23k|    do {                                                                       \
  |  |  115|  7.23k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 11, False: 7.22k]
  |  |  ------------------
  |  |  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|  7.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 7.22k]
  |  |  ------------------
  ------------------
 2082|       |
 2083|       |    /* Decode literals section */
 2084|  7.22k|    {   size_t const litCSize = ZSTD_decodeLiteralsBlock(dctx, src, srcSize, dst, dstCapacity, streaming);
 2085|  7.22k|        DEBUGLOG(5, "ZSTD_decodeLiteralsBlock : cSize=%u, nbLiterals=%zu", (U32)litCSize, dctx->litSize);
  ------------------
  |  |  104|  7.22k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 7.22k]
  |  |  ------------------
  ------------------
 2086|  7.22k|        if (ZSTD_isError(litCSize)) return litCSize;
  ------------------
  |  |   44|  7.22k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (2086:13): [True: 208, False: 7.01k]
  ------------------
 2087|  7.01k|        ip += litCSize;
 2088|  7.01k|        srcSize -= litCSize;
 2089|  7.01k|    }
 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|  7.01k|        size_t const blockSizeMax = MIN(dstCapacity, ZSTD_blockSizeMax(dctx));
  ------------------
  |  |   54|  7.01k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 4.13k, False: 2.88k]
  |  |  ------------------
  ------------------
 2097|  7.01k|        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|  7.01k|        ZSTD_longOffset_e isLongOffset = (ZSTD_longOffset_e)(MEM_32bits() && (totalHistorySize > ZSTD_maxShortOffset()));
  ------------------
  |  Branch (2109:62): [True: 0, False: 7.01k]
  |  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|  7.01k|#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \
 2115|  7.01k|    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)
 2116|  7.01k|        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|  7.01k|        int nbSeq;
 2124|  7.01k|        size_t const seqHSize = ZSTD_decodeSeqHeaders(dctx, &nbSeq, ip, srcSize);
 2125|  7.01k|        if (ZSTD_isError(seqHSize)) return seqHSize;
  ------------------
  |  |   44|  7.01k|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (2125:13): [True: 58, False: 6.95k]
  ------------------
 2126|  6.95k|        ip += seqHSize;
 2127|  6.95k|        srcSize -= seqHSize;
 2128|       |
 2129|  6.95k|        RETURN_ERROR_IF((dst == NULL || dstCapacity == 0) && nbSeq > 0, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  6.95k|    do {                                                                       \
  |  |  115|  27.9k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 6.95k]
  |  |  |  Branch (115:13): [True: 83, False: 6.87k]
  |  |  |  Branch (115:13): [True: 0, False: 83]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  6.95k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 6.95k]
  |  |  ------------------
  ------------------
 2130|  6.95k|        RETURN_ERROR_IF(MEM_64bits() && sizeof(size_t) == sizeof(void*) && (size_t)(-1) - (size_t)dst < (size_t)(1 << 20), dstSize_tooSmall,
  ------------------
  |  |  114|  6.95k|    do {                                                                       \
  |  |  115|  34.7k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 6.95k, False: 0]
  |  |  |  Branch (115:13): [True: 0, Folded]
  |  |  |  Branch (115:13): [True: 0, False: 6.95k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  6.95k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 6.95k]
  |  |  ------------------
  ------------------
 2131|  6.95k|                "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|  6.95k|        if (isLongOffset || (!usePrefetchDecoder && (totalHistorySize > (1u << 24)) && (nbSeq > 8))) {
  ------------------
  |  Branch (2137:13): [True: 0, False: 6.95k]
  |  Branch (2137:30): [True: 6.37k, False: 583]
  |  Branch (2137:53): [True: 83, False: 6.29k]
  |  Branch (2137:88): [True: 0, False: 83]
  ------------------
 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|  6.95k|        dctx->ddictIsCold = 0;
 2153|       |
 2154|  6.95k|#if !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT) && \
 2155|  6.95k|    !defined(ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG)
 2156|  6.95k|        if (usePrefetchDecoder) {
  ------------------
  |  Branch (2156:13): [True: 583, False: 6.37k]
  ------------------
 2157|       |#else
 2158|       |        (void)usePrefetchDecoder;
 2159|       |        {
 2160|       |#endif
 2161|    583|#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT
 2162|    583|            return ZSTD_decompressSequencesLong(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2163|    583|#endif
 2164|    583|        }
 2165|       |
 2166|  6.37k|#ifndef ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG
 2167|       |        /* else */
 2168|  6.37k|        if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (2168:13): [True: 562, False: 5.81k]
  ------------------
 2169|    562|            return ZSTD_decompressSequencesSplitLitBuffer(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2170|  5.81k|        else
 2171|  5.81k|            return ZSTD_decompressSequences(dctx, dst, dstCapacity, ip, srcSize, nbSeq, isLongOffset);
 2172|  6.37k|#endif
 2173|  6.37k|    }
 2174|  6.37k|}
ZSTD_checkContinuity:
 2179|  16.9k|{
 2180|  16.9k|    if (dst != dctx->previousDstEnd && dstSize > 0) {   /* not contiguous */
  ------------------
  |  Branch (2180:9): [True: 16.9k, False: 0]
  |  Branch (2180:40): [True: 16.7k, False: 165]
  ------------------
 2181|  16.7k|        dctx->dictEnd = dctx->previousDstEnd;
 2182|  16.7k|        dctx->virtualStart = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->prefixStart));
 2183|  16.7k|        dctx->prefixStart = dst;
 2184|  16.7k|        dctx->previousDstEnd = dst;
 2185|  16.7k|    }
 2186|  16.9k|}
zstd_decompress_block.c:ZSTD_decodeLiteralsBlock:
  137|  7.22k|{
  138|  7.22k|    DEBUGLOG(5, "ZSTD_decodeLiteralsBlock");
  ------------------
  |  |  104|  7.22k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 7.22k]
  |  |  ------------------
  ------------------
  139|  7.22k|    RETURN_ERROR_IF(srcSize < MIN_CBLOCK_SIZE, corruption_detected, "");
  ------------------
  |  |  114|  7.22k|    do {                                                                       \
  |  |  115|  7.22k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 7.22k]
  |  |  ------------------
  |  |  116|      1|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      1|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      1|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      1|    do {                                           \
  |  |  |  |   99|      1|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      1|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      1|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      1|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      1|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      1|        }                                                                      \
  |  |  123|  7.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 7.22k]
  |  |  ------------------
  ------------------
  140|       |
  141|  7.22k|    {   const BYTE* const istart = (const BYTE*) src;
  142|  7.22k|        SymbolEncodingType_e const litEncType = (SymbolEncodingType_e)(istart[0] & 3);
  143|  7.22k|        size_t const blockSizeMax = ZSTD_blockSizeMax(dctx);
  144|       |
  145|  7.22k|        switch(litEncType)
  146|  7.22k|        {
  147|    257|        case set_repeat:
  ------------------
  |  Branch (147:9): [True: 257, False: 6.96k]
  ------------------
  148|    257|            DEBUGLOG(5, "set_repeat flag : re-using stats from previous compressed literals block");
  ------------------
  |  |  104|    257|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 257]
  |  |  ------------------
  ------------------
  149|    257|            RETURN_ERROR_IF(dctx->litEntropy==0, dictionary_corrupted, "");
  ------------------
  |  |  114|    257|    do {                                                                       \
  |  |  115|    257|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 257]
  |  |  ------------------
  |  |  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|    257|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 257]
  |  |  ------------------
  ------------------
  150|    257|            ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    257|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  151|       |
  152|  4.27k|        case set_compressed:
  ------------------
  |  Branch (152:9): [True: 4.01k, False: 3.20k]
  ------------------
  153|  4.27k|            RETURN_ERROR_IF(srcSize < 5, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need up to 5 for case 3");
  ------------------
  |  |  114|  4.27k|    do {                                                                       \
  |  |  115|  4.27k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 4.27k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  4.27k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.27k]
  |  |  ------------------
  ------------------
  154|  4.27k|            {   size_t lhSize, litSize, litCSize;
  155|  4.27k|                U32 singleStream=0;
  156|  4.27k|                U32 const lhlCode = (istart[0] >> 2) & 3;
  157|  4.27k|                U32 const lhc = MEM_readLE32(istart);
  158|  4.27k|                size_t hufSuccess;
  159|  4.27k|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|  4.27k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 2.07k, False: 2.20k]
  |  |  ------------------
  ------------------
  160|  4.27k|                int const flags = 0
  161|  4.27k|                    | (ZSTD_DCtx_get_bmi2(dctx) ? HUF_flags_bmi2 : 0)
  ------------------
  |  Branch (161:24): [True: 4.27k, False: 0]
  ------------------
  162|  4.27k|                    | (dctx->disableHufAsm ? HUF_flags_disableAsm : 0);
  ------------------
  |  Branch (162:24): [True: 0, False: 4.27k]
  ------------------
  163|  4.27k|                switch(lhlCode)
  164|  4.27k|                {
  165|  4.18k|                case 0: case 1: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (165:17): [True: 1.18k, False: 3.08k]
  |  Branch (165:25): [True: 2.99k, False: 1.28k]
  |  Branch (165:33): [True: 0, False: 4.27k]
  ------------------
  166|       |                    /* 2 - 2 - 10 - 10 */
  167|  4.18k|                    singleStream = !lhlCode;
  168|  4.18k|                    lhSize = 3;
  169|  4.18k|                    litSize  = (lhc >> 4) & 0x3FF;
  170|  4.18k|                    litCSize = (lhc >> 14) & 0x3FF;
  171|  4.18k|                    break;
  172|     26|                case 2:
  ------------------
  |  Branch (172:17): [True: 26, False: 4.25k]
  ------------------
  173|       |                    /* 2 - 2 - 14 - 14 */
  174|     26|                    lhSize = 4;
  175|     26|                    litSize  = (lhc >> 4) & 0x3FFF;
  176|     26|                    litCSize = lhc >> 18;
  177|     26|                    break;
  178|     68|                case 3:
  ------------------
  |  Branch (178:17): [True: 68, False: 4.20k]
  ------------------
  179|       |                    /* 2 - 2 - 18 - 18 */
  180|     68|                    lhSize = 5;
  181|     68|                    litSize  = (lhc >> 4) & 0x3FFFF;
  182|     68|                    litCSize = (lhc >> 22) + ((size_t)istart[4] << 10);
  183|     68|                    break;
  184|  4.27k|                }
  185|  4.27k|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  4.27k|    do {                                                                       \
  |  |  115|  12.3k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3.84k, False: 432]
  |  |  |  Branch (115:13): [True: 0, False: 3.84k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  4.27k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.27k]
  |  |  ------------------
  ------------------
  186|  4.27k|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|  4.27k|    do {                                                                       \
  |  |  115|  4.27k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 4.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|  4.27k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.27k]
  |  |  ------------------
  ------------------
  187|  4.27k|                if (!singleStream)
  ------------------
  |  Branch (187:21): [True: 3.08k, False: 1.18k]
  ------------------
  188|  3.08k|                    RETURN_ERROR_IF(litSize < MIN_LITERALS_FOR_4_STREAMS, literals_headerWrong,
  ------------------
  |  |  114|  3.08k|    do {                                                                       \
  |  |  115|  3.08k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 3.08k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  3.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.08k]
  |  |  ------------------
  ------------------
  189|  4.27k|                        "Not enough literals (%zu) for the 4-streams mode (min %u)",
  190|  4.27k|                        litSize, MIN_LITERALS_FOR_4_STREAMS);
  191|  4.27k|                RETURN_ERROR_IF(litCSize + lhSize > srcSize, corruption_detected, "");
  ------------------
  |  |  114|  4.27k|    do {                                                                       \
  |  |  115|  4.27k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 4.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|  4.27k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.27k]
  |  |  ------------------
  ------------------
  192|  4.27k|                RETURN_ERROR_IF(expectedWriteSize < litSize , dstSize_tooSmall, "");
  ------------------
  |  |  114|  4.27k|    do {                                                                       \
  |  |  115|  4.27k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 5, False: 4.26k]
  |  |  ------------------
  |  |  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|  4.27k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.26k]
  |  |  ------------------
  ------------------
  193|  4.26k|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 0);
  194|       |
  195|       |                /* prefetch huffman table if cold */
  196|  4.26k|                if (dctx->ddictIsCold && (litSize > 768 /* heuristic */)) {
  ------------------
  |  Branch (196:21): [True: 189, False: 4.08k]
  |  Branch (196:42): [True: 51, False: 138]
  ------------------
  197|     51|                    PREFETCH_AREA(dctx->HUFptr, sizeof(dctx->entropy.hufTable));
  ------------------
  |  |  159|     51|    do {                                                 \
  |  |  160|     51|        const char* const _ptr = (const char*)(p);       \
  |  |  161|     51|        size_t const _size = (size_t)(s);                \
  |  |  162|     51|        size_t _pos;                                     \
  |  |  163|  13.1k|        for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \
  |  |  ------------------
  |  |  |  |  156|  13.1k|#define CACHELINE_SIZE 64
  |  |  ------------------
  |  |  |  Branch (163:22): [True: 13.1k, False: 51]
  |  |  ------------------
  |  |  164|  13.1k|            PREFETCH_L2(_ptr + _pos);                    \
  |  |  ------------------
  |  |  |  |  146|  13.1k|#    define PREFETCH_L2(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */)
  |  |  ------------------
  |  |  165|  13.1k|        }                                                \
  |  |  166|     51|    } while (0)
  |  |  ------------------
  |  |  |  Branch (166:14): [Folded, False: 51]
  |  |  ------------------
  ------------------
  198|     51|                }
  199|       |
  200|  4.26k|                if (litEncType==set_repeat) {
  ------------------
  |  Branch (200:21): [True: 254, False: 4.01k]
  ------------------
  201|    254|                    if (singleStream) {
  ------------------
  |  Branch (201:25): [True: 165, False: 89]
  ------------------
  202|    165|                        hufSuccess = HUF_decompress1X_usingDTable(
  203|    165|                            dctx->litBuffer, litSize, istart+lhSize, litCSize,
  204|    165|                            dctx->HUFptr, flags);
  205|    165|                    } else {
  206|     89|                        assert(litSize >= MIN_LITERALS_FOR_4_STREAMS);
  ------------------
  |  |   70|     89|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  207|     89|                        hufSuccess = HUF_decompress4X_usingDTable(
  208|     89|                            dctx->litBuffer, litSize, istart+lhSize, litCSize,
  209|     89|                            dctx->HUFptr, flags);
  210|     89|                    }
  211|  4.01k|                } else {
  212|  4.01k|                    if (singleStream) {
  ------------------
  |  Branch (212:25): [True: 1.01k, False: 2.99k]
  ------------------
  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.01k|                        hufSuccess = HUF_decompress1X1_DCtx_wksp(
  220|  1.01k|                            dctx->entropy.hufTable, dctx->litBuffer, litSize,
  221|  1.01k|                            istart+lhSize, litCSize, dctx->workspace,
  222|  1.01k|                            sizeof(dctx->workspace), flags);
  223|  1.01k|#endif
  224|  2.99k|                    } else {
  225|  2.99k|                        hufSuccess = HUF_decompress4X_hufOnly_wksp(
  226|  2.99k|                            dctx->entropy.hufTable, dctx->litBuffer, litSize,
  227|  2.99k|                            istart+lhSize, litCSize, dctx->workspace,
  228|  2.99k|                            sizeof(dctx->workspace), flags);
  229|  2.99k|                    }
  230|  4.01k|                }
  231|  4.26k|                if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (231:21): [True: 35, False: 4.23k]
  ------------------
  232|     35|                {
  233|     35|                    assert(litSize > ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   70|     35|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  234|     35|                    ZSTD_memcpy(dctx->litExtraBuffer, dctx->litBufferEnd - ZSTD_LITBUFFEREXTRASIZE, ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   44|    210|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  |  |  ------------------
  |  |  |  Branch (44:51): [True: 0, Folded]
  |  |  |  Branch (44:51): [True: 35, Folded]
  |  |  |  Branch (44:51): [Folded, False: 35]
  |  |  |  Branch (44:55): [True: 0, Folded]
  |  |  |  Branch (44:55): [True: 35, Folded]
  |  |  |  Branch (44:55): [Folded, False: 35]
  |  |  ------------------
  ------------------
  235|     35|                    ZSTD_memmove(dctx->litBuffer + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH, dctx->litBuffer, litSize - ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   45|    210|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  |  |  ------------------
  |  |  |  Branch (45:49): [True: 0, Folded]
  |  |  |  Branch (45:49): [True: 35, Folded]
  |  |  |  Branch (45:49): [Folded, False: 35]
  |  |  |  Branch (45:57): [True: 0, Folded]
  |  |  |  Branch (45:57): [True: 35, Folded]
  |  |  |  Branch (45:57): [Folded, False: 35]
  |  |  ------------------
  ------------------
  236|     35|                    dctx->litBuffer += ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  118|     35|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|     35|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|     70|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 35]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 35, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  dctx->litBuffer += ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|     35|#define WILDCOPY_OVERLENGTH 32
  ------------------
  237|     35|                    dctx->litBufferEnd -= WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|     35|#define WILDCOPY_OVERLENGTH 32
  ------------------
  238|     35|                    assert(dctx->litBufferEnd <= (BYTE*)dst + blockSizeMax);
  ------------------
  |  |   70|     35|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  239|     35|                }
  240|       |
  241|  4.26k|                RETURN_ERROR_IF(HUF_isError(hufSuccess), corruption_detected, "");
  ------------------
  |  |  114|  4.26k|    do {                                                                       \
  |  |  115|  4.26k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 179, False: 4.09k]
  |  |  ------------------
  |  |  116|    179|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    179|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 179]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    179|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    179|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    179|    do {                                           \
  |  |  |  |   99|    179|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 179]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    179|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 179]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    179|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    179|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 179]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    179|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    179|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 179]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    179|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    179|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    179|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    179|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    179|        }                                                                      \
  |  |  123|  4.26k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.09k]
  |  |  ------------------
  ------------------
  242|       |
  243|  4.09k|                dctx->litPtr = dctx->litBuffer;
  244|  4.09k|                dctx->litSize = litSize;
  245|  4.09k|                dctx->litEntropy = 1;
  246|  4.09k|                if (litEncType==set_compressed) dctx->HUFptr = dctx->entropy.hufTable;
  ------------------
  |  Branch (246:21): [True: 3.85k, False: 234]
  ------------------
  247|  4.09k|                return litCSize + lhSize;
  248|  4.26k|            }
  249|       |
  250|  1.37k|        case set_basic:
  ------------------
  |  Branch (250:9): [True: 1.37k, False: 5.84k]
  ------------------
  251|  1.37k|            {   size_t litSize, lhSize;
  252|  1.37k|                U32 const lhlCode = ((istart[0]) >> 2) & 3;
  253|  1.37k|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|  1.37k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 447, False: 932]
  |  |  ------------------
  ------------------
  254|  1.37k|                switch(lhlCode)
  255|  1.37k|                {
  256|  1.02k|                case 0: case 2: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (256:17): [True: 752, False: 627]
  |  Branch (256:25): [True: 274, False: 1.10k]
  |  Branch (256:33): [True: 0, False: 1.37k]
  ------------------
  257|  1.02k|                    lhSize = 1;
  258|  1.02k|                    litSize = istart[0] >> 3;
  259|  1.02k|                    break;
  260|    340|                case 1:
  ------------------
  |  Branch (260:17): [True: 340, False: 1.03k]
  ------------------
  261|    340|                    lhSize = 2;
  262|    340|                    litSize = MEM_readLE16(istart) >> 4;
  263|    340|                    break;
  264|     13|                case 3:
  ------------------
  |  Branch (264:17): [True: 13, False: 1.36k]
  ------------------
  265|     13|                    lhSize = 3;
  266|     13|                    RETURN_ERROR_IF(srcSize<3, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize = 3");
  ------------------
  |  |  114|     13|    do {                                                                       \
  |  |  115|     13|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 13]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|     13|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 13]
  |  |  ------------------
  ------------------
  267|     13|                    litSize = MEM_readLE24(istart) >> 4;
  268|     13|                    break;
  269|  1.37k|                }
  270|       |
  271|  1.37k|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  1.37k|    do {                                                                       \
  |  |  115|  3.08k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 322, False: 1.05k]
  |  |  |  Branch (115:13): [True: 0, False: 322]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  1.37k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.37k]
  |  |  ------------------
  ------------------
  272|  1.37k|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|  1.37k|    do {                                                                       \
  |  |  115|  1.37k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 1.37k]
  |  |  ------------------
  |  |  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.37k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.37k]
  |  |  ------------------
  ------------------
  273|  1.37k|                RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, "");
  ------------------
  |  |  114|  1.37k|    do {                                                                       \
  |  |  115|  1.37k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 1.37k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  1.37k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.37k]
  |  |  ------------------
  ------------------
  274|  1.37k|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1);
  275|  1.37k|                if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */
  ------------------
  |  |  199|  1.37k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  |  Branch (275:21): [True: 1.31k, False: 60]
  ------------------
  276|  1.31k|                    RETURN_ERROR_IF(litSize+lhSize > srcSize, corruption_detected, "");
  ------------------
  |  |  114|  1.31k|    do {                                                                       \
  |  |  115|  1.31k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 15, False: 1.30k]
  |  |  ------------------
  |  |  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|  1.31k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.30k]
  |  |  ------------------
  ------------------
  277|  1.30k|                    if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (277:25): [True: 0, False: 1.30k]
  ------------------
  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|  1.30k|                    else
  283|  1.30k|                    {
  284|  1.30k|                        ZSTD_memcpy(dctx->litBuffer, istart + lhSize, litSize);
  ------------------
  |  |   44|  1.30k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  285|  1.30k|                    }
  286|  1.30k|                    dctx->litPtr = dctx->litBuffer;
  287|  1.30k|                    dctx->litSize = litSize;
  288|  1.30k|                    return lhSize+litSize;
  289|  1.31k|                }
  290|       |                /* direct reference into compressed stream */
  291|     60|                dctx->litPtr = istart+lhSize;
  292|     60|                dctx->litSize = litSize;
  293|     60|                dctx->litBufferEnd = dctx->litPtr + litSize;
  294|     60|                dctx->litBufferLocation = ZSTD_not_in_dst;
  295|     60|                return lhSize+litSize;
  296|  1.37k|            }
  297|       |
  298|  1.56k|        case set_rle:
  ------------------
  |  Branch (298:9): [True: 1.56k, False: 5.65k]
  ------------------
  299|  1.56k|            {   U32 const lhlCode = ((istart[0]) >> 2) & 3;
  300|  1.56k|                size_t litSize, lhSize;
  301|  1.56k|                size_t expectedWriteSize = MIN(blockSizeMax, dstCapacity);
  ------------------
  |  |   54|  1.56k|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 395, False: 1.17k]
  |  |  ------------------
  ------------------
  302|  1.56k|                switch(lhlCode)
  303|  1.56k|                {
  304|    455|                case 0: case 2: default:   /* note : default is impossible, since lhlCode into [0..3] */
  ------------------
  |  Branch (304:17): [True: 341, False: 1.22k]
  |  Branch (304:25): [True: 114, False: 1.45k]
  |  Branch (304:33): [True: 0, False: 1.56k]
  ------------------
  305|    455|                    lhSize = 1;
  306|    455|                    litSize = istart[0] >> 3;
  307|    455|                    break;
  308|     37|                case 1:
  ------------------
  |  Branch (308:17): [True: 37, False: 1.53k]
  ------------------
  309|     37|                    lhSize = 2;
  310|     37|                    RETURN_ERROR_IF(srcSize<3, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize+1 = 3");
  ------------------
  |  |  114|     37|    do {                                                                       \
  |  |  115|     37|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 37]
  |  |  ------------------
  |  |  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|     37|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 37]
  |  |  ------------------
  ------------------
  311|     37|                    litSize = MEM_readLE16(istart) >> 4;
  312|     37|                    break;
  313|  1.07k|                case 3:
  ------------------
  |  Branch (313:17): [True: 1.07k, False: 492]
  ------------------
  314|  1.07k|                    lhSize = 3;
  315|  1.07k|                    RETURN_ERROR_IF(srcSize<4, corruption_detected, "srcSize >= MIN_CBLOCK_SIZE == 2; here we need lhSize+1 = 4");
  ------------------
  |  |  114|  1.07k|    do {                                                                       \
  |  |  115|  1.07k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 1.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|  1.07k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.07k]
  |  |  ------------------
  ------------------
  316|  1.07k|                    litSize = MEM_readLE24(istart) >> 4;
  317|  1.07k|                    break;
  318|  1.56k|                }
  319|  1.56k|                RETURN_ERROR_IF(litSize > 0 && dst == NULL, dstSize_tooSmall, "NULL not handled");
  ------------------
  |  |  114|  1.56k|    do {                                                                       \
  |  |  115|  4.56k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1.42k, False: 144]
  |  |  |  Branch (115:13): [True: 0, False: 1.42k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  1.56k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.56k]
  |  |  ------------------
  ------------------
  320|  1.56k|                RETURN_ERROR_IF(litSize > blockSizeMax, corruption_detected, "");
  ------------------
  |  |  114|  1.56k|    do {                                                                       \
  |  |  115|  1.56k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 1.56k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  1.56k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.56k]
  |  |  ------------------
  ------------------
  321|  1.56k|                RETURN_ERROR_IF(expectedWriteSize < litSize, dstSize_tooSmall, "");
  ------------------
  |  |  114|  1.56k|    do {                                                                       \
  |  |  115|  1.56k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 5, False: 1.56k]
  |  |  ------------------
  |  |  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|  1.56k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.56k]
  |  |  ------------------
  ------------------
  322|  1.56k|                ZSTD_allocateLiteralsBuffer(dctx, dst, dstCapacity, litSize, streaming, expectedWriteSize, 1);
  323|  1.56k|                if (dctx->litBufferLocation == ZSTD_split)
  ------------------
  |  Branch (323:21): [True: 893, False: 670]
  ------------------
  324|    893|                {
  325|    893|                    ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize - ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   46|  5.35k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  |  |  ------------------
  |  |  |  Branch (46:55): [True: 0, Folded]
  |  |  |  Branch (46:55): [True: 893, Folded]
  |  |  |  Branch (46:55): [Folded, False: 893]
  |  |  ------------------
  ------------------
  326|    893|                    ZSTD_memset(dctx->litExtraBuffer, istart[lhSize], ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   46|  5.35k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  |  |  ------------------
  |  |  |  Branch (46:55): [True: 0, Folded]
  |  |  |  Branch (46:55): [True: 893, Folded]
  |  |  |  Branch (46:55): [Folded, False: 893]
  |  |  ------------------
  ------------------
  327|    893|                }
  328|    670|                else
  329|    670|                {
  330|    670|                    ZSTD_memset(dctx->litBuffer, istart[lhSize], litSize);
  ------------------
  |  |   46|    670|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  331|    670|                }
  332|  1.56k|                dctx->litPtr = dctx->litBuffer;
  333|  1.56k|                dctx->litSize = litSize;
  334|  1.56k|                return lhSize+1;
  335|  1.56k|            }
  336|      0|        default:
  ------------------
  |  Branch (336:9): [True: 0, False: 7.22k]
  ------------------
  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|  7.22k|        }
  339|  7.22k|    }
  340|  7.22k|}
zstd_decompress_block.c:ZSTD_allocateLiteralsBuffer:
   82|  7.21k|{
   83|  7.21k|    size_t const blockSizeMax = ZSTD_blockSizeMax(dctx);
   84|  7.21k|    assert(litSize <= blockSizeMax);
  ------------------
  |  |   70|  7.21k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   85|  7.21k|    assert(dctx->isFrameDecompression || streaming == not_streaming);
  ------------------
  |  |   70|  7.21k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   86|  7.21k|    assert(expectedWriteSize <= blockSizeMax);
  ------------------
  |  |   70|  7.21k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   87|  7.21k|    if (streaming == not_streaming && dstCapacity > blockSizeMax + WILDCOPY_OVERLENGTH + litSize + WILDCOPY_OVERLENGTH) {
  ------------------
  |  |  199|  7.21k|#define WILDCOPY_OVERLENGTH 32
  ------------------
                  if (streaming == not_streaming && dstCapacity > blockSizeMax + WILDCOPY_OVERLENGTH + litSize + WILDCOPY_OVERLENGTH) {
  ------------------
  |  |  199|  7.21k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  |  Branch (87:9): [True: 7.21k, False: 0]
  |  Branch (87:39): [True: 2.64k, False: 4.56k]
  ------------------
   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.64k|        dctx->litBuffer = (BYTE*)dst + blockSizeMax + WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|  2.64k|#define WILDCOPY_OVERLENGTH 32
  ------------------
   94|  2.64k|        dctx->litBufferEnd = dctx->litBuffer + litSize;
   95|  2.64k|        dctx->litBufferLocation = ZSTD_in_dst;
   96|  4.56k|    } else if (litSize <= ZSTD_LITBUFFEREXTRASIZE) {
  ------------------
  |  |  118|  4.56k|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|  4.56k|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  9.13k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 4.56k]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 4.56k, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (96:16): [True: 3.63k, False: 933]
  ------------------
   97|       |        /* Literals fit entirely within the extra buffer, put them there to avoid
   98|       |         * having to split the literals.
   99|       |         */
  100|  3.63k|        dctx->litBuffer = dctx->litExtraBuffer;
  101|  3.63k|        dctx->litBufferEnd = dctx->litBuffer + litSize;
  102|  3.63k|        dctx->litBufferLocation = ZSTD_not_in_dst;
  103|  3.63k|    } else {
  104|    933|        assert(blockSizeMax > ZSTD_LITBUFFEREXTRASIZE);
  ------------------
  |  |   70|    933|#    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|    933|        if (splitImmediately) {
  ------------------
  |  Branch (112:13): [True: 898, False: 35]
  ------------------
  113|       |            /* won't fit in litExtraBuffer, so it will be split between end of dst and extra buffer */
  114|    898|            dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  118|    898|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    898|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.79k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 898]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 898, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize + ZSTD_LITBUFFEREXTRASIZE - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|    898|#define WILDCOPY_OVERLENGTH 32
  ------------------
  115|    898|            dctx->litBufferEnd = dctx->litBuffer + litSize - ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    898|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    898|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.79k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 898]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 898, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|    898|        } else {
  117|       |            /* initially this will be stored entirely in dst during huffman decoding, it will partially be shifted to litExtraBuffer after */
  118|     35|            dctx->litBuffer = (BYTE*)dst + expectedWriteSize - litSize;
  119|     35|            dctx->litBufferEnd = (BYTE*)dst + expectedWriteSize;
  120|     35|        }
  121|    933|        dctx->litBufferLocation = ZSTD_split;
  122|    933|        assert(dctx->litBufferEnd <= (BYTE*)dst + expectedWriteSize);
  ------------------
  |  |   70|    933|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  123|    933|    }
  124|  7.21k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body_bmi2:
  620|  3.97k|{
  621|  3.97k|    ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,
  622|  3.97k|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  623|  3.97k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body:
  489|  4.23k|{
  490|  4.23k|    ZSTD_seqSymbol* const tableDecode = dt+1;
  491|  4.23k|    U32 const maxSV1 = maxSymbolValue + 1;
  492|  4.23k|    U32 const tableSize = 1 << tableLog;
  493|       |
  494|  4.23k|    U16* symbolNext = (U16*)wksp;
  495|  4.23k|    BYTE* spread = (BYTE*)(symbolNext + MaxSeq + 1);
  ------------------
  |  |  107|  4.23k|#define MaxSeq MAX(MaxLL, MaxML)   /* Assumption : MaxOff < MaxLL,MaxML */
  |  |  ------------------
  |  |  |  |   55|  4.23k|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (55:19): [Folded, False: 4.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  496|  4.23k|    U32 highThreshold = tableSize - 1;
  497|       |
  498|       |
  499|       |    /* Sanity Checks */
  500|  4.23k|    assert(maxSymbolValue <= MaxSeq);
  ------------------
  |  |   70|  4.23k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  501|  4.23k|    assert(tableLog <= MaxFSELog);
  ------------------
  |  |   70|  4.23k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  502|  4.23k|    assert(wkspSize >= ZSTD_BUILD_FSE_TABLE_WKSP_SIZE);
  ------------------
  |  |   70|  4.23k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  503|  4.23k|    (void)wkspSize;
  504|       |    /* Init, lay down lowprob symbols */
  505|  4.23k|    {   ZSTD_seqSymbol_header DTableH;
  506|  4.23k|        DTableH.tableLog = tableLog;
  507|  4.23k|        DTableH.fastMode = 1;
  508|  4.23k|        {   S16 const largeLimit= (S16)(1 << (tableLog-1));
  509|  4.23k|            U32 s;
  510|  67.2k|            for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (510:23): [True: 63.0k, False: 4.23k]
  ------------------
  511|  63.0k|                if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (511:21): [True: 22.2k, False: 40.7k]
  ------------------
  512|  22.2k|                    tableDecode[highThreshold--].baseValue = s;
  513|  22.2k|                    symbolNext[s] = 1;
  514|  40.7k|                } else {
  515|  40.7k|                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
  ------------------
  |  Branch (515:25): [True: 2.13k, False: 38.6k]
  ------------------
  516|  40.7k|                    assert(normalizedCounter[s]>=0);
  ------------------
  |  |   70|  40.7k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  517|  40.7k|                    symbolNext[s] = (U16)normalizedCounter[s];
  518|  40.7k|        }   }   }
  519|  4.23k|        ZSTD_memcpy(dt, &DTableH, sizeof(DTableH));
  ------------------
  |  |   44|  4.23k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
  520|  4.23k|    }
  521|       |
  522|       |    /* Spread symbols */
  523|  4.23k|    assert(tableSize <= 512);
  ------------------
  |  |   70|  4.23k|#    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|  4.23k|    if (highThreshold == tableSize - 1) {
  ------------------
  |  Branch (529:9): [True: 983, False: 3.25k]
  ------------------
  530|    983|        size_t const tableMask = tableSize-1;
  531|    983|        size_t const step = FSE_TABLESTEP(tableSize);
  ------------------
  |  |  623|    983|#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|    983|        {
  539|    983|            U64 const add = 0x0101010101010101ull;
  540|    983|            size_t pos = 0;
  541|    983|            U64 sv = 0;
  542|    983|            U32 s;
  543|  5.02k|            for (s=0; s<maxSV1; ++s, sv += add) {
  ------------------
  |  Branch (543:23): [True: 4.04k, False: 983]
  ------------------
  544|  4.04k|                int i;
  545|  4.04k|                int const n = normalizedCounter[s];
  546|  4.04k|                MEM_write64(spread + pos, sv);
  547|  20.0k|                for (i = 8; i < n; i += 8) {
  ------------------
  |  Branch (547:29): [True: 16.0k, False: 4.04k]
  ------------------
  548|  16.0k|                    MEM_write64(spread + pos + i, sv);
  549|  16.0k|                }
  550|  4.04k|                assert(n>=0);
  ------------------
  |  |   70|  4.04k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  551|  4.04k|                pos += (size_t)n;
  552|  4.04k|            }
  553|    983|        }
  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|    983|        {
  561|    983|            size_t position = 0;
  562|    983|            size_t s;
  563|    983|            size_t const unroll = 2;
  564|    983|            assert(tableSize % unroll == 0); /* FSE_MIN_TABLELOG is 5 */
  ------------------
  |  |   70|    983|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  565|  72.3k|            for (s = 0; s < (size_t)tableSize; s += unroll) {
  ------------------
  |  Branch (565:25): [True: 71.3k, False: 983]
  ------------------
  566|  71.3k|                size_t u;
  567|   213k|                for (u = 0; u < unroll; ++u) {
  ------------------
  |  Branch (567:29): [True: 142k, False: 71.3k]
  ------------------
  568|   142k|                    size_t const uPosition = (position + (u * step)) & tableMask;
  569|   142k|                    tableDecode[uPosition].baseValue = spread[s + u];
  570|   142k|                }
  571|  71.3k|                position = (position + (unroll * step)) & tableMask;
  572|  71.3k|            }
  573|    983|            assert(position == 0);
  ------------------
  |  |   70|    983|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  574|    983|        }
  575|  3.25k|    } else {
  576|  3.25k|        U32 const tableMask = tableSize-1;
  577|  3.25k|        U32 const step = FSE_TABLESTEP(tableSize);
  ------------------
  |  |  623|  3.25k|#define FSE_TABLESTEP(tableSize) (((tableSize)>>1) + ((tableSize)>>3) + 3)
  ------------------
  578|  3.25k|        U32 s, position = 0;
  579|  62.2k|        for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (579:19): [True: 59.0k, False: 3.25k]
  ------------------
  580|  59.0k|            int i;
  581|  59.0k|            int const n = normalizedCounter[s];
  582|   444k|            for (i=0; i<n; i++) {
  ------------------
  |  Branch (582:23): [True: 385k, False: 59.0k]
  ------------------
  583|   385k|                tableDecode[position].baseValue = s;
  584|   385k|                position = (position + step) & tableMask;
  585|   407k|                while (UNLIKELY(position > highThreshold)) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  |  188|   407k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 21.8k, False: 385k]
  |  |  ------------------
  ------------------
  586|   385k|        }   }
  587|  3.25k|        assert(position == 0); /* position must reach all cells once, otherwise normalizedCounter is incorrect */
  ------------------
  |  |   70|  3.25k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  588|  3.25k|    }
  589|       |
  590|       |    /* Build Decoding table */
  591|  4.23k|    {
  592|  4.23k|        U32 u;
  593|   554k|        for (u=0; u<tableSize; u++) {
  ------------------
  |  Branch (593:19): [True: 550k, False: 4.23k]
  ------------------
  594|   550k|            U32 const symbol = tableDecode[u].baseValue;
  595|   550k|            U32 const nextState = symbolNext[symbol]++;
  596|   550k|            tableDecode[u].nbBits = (BYTE) (tableLog - ZSTD_highbit32(nextState) );
  597|   550k|            tableDecode[u].nextState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
  598|   550k|            assert(nbAdditionalBits[symbol] < 255);
  ------------------
  |  |   70|   550k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  599|   550k|            tableDecode[u].nbAdditionalBits = nbAdditionalBits[symbol];
  600|   550k|            tableDecode[u].baseValue = baseValue[symbol];
  601|   550k|        }
  602|  4.23k|    }
  603|  4.23k|}
zstd_decompress_block.c:ZSTD_buildFSETable_body_default:
  610|    259|{
  611|    259|    ZSTD_buildFSETable_body(dt, normalizedCounter, maxSymbolValue,
  612|    259|            baseValue, nbAdditionalBits, tableLog, wksp, wkspSize);
  613|    259|}
zstd_decompress_block.c:ZSTD_buildSeqTable:
  654|  9.60k|{
  655|  9.60k|    switch(type)
  656|  9.60k|    {
  657|  1.86k|    case set_rle :
  ------------------
  |  Branch (657:5): [True: 1.86k, False: 7.74k]
  ------------------
  658|  1.86k|        RETURN_ERROR_IF(!srcSize, srcSize_wrong, "");
  ------------------
  |  |  114|  1.86k|    do {                                                                       \
  |  |  115|  1.86k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 1.86k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  1.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.86k]
  |  |  ------------------
  ------------------
  659|  1.86k|        RETURN_ERROR_IF((*(const BYTE*)src) > max, corruption_detected, "");
  ------------------
  |  |  114|  1.86k|    do {                                                                       \
  |  |  115|  1.86k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 1, False: 1.86k]
  |  |  ------------------
  |  |  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.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.86k]
  |  |  ------------------
  ------------------
  660|  1.86k|        {   U32 const symbol = *(const BYTE*)src;
  661|  1.86k|            U32 const baseline = baseValue[symbol];
  662|  1.86k|            U8 const nbBits = nbAdditionalBits[symbol];
  663|  1.86k|            ZSTD_buildSeqTable_rle(DTableSpace, baseline, nbBits);
  664|  1.86k|        }
  665|  1.86k|        *DTablePtr = DTableSpace;
  666|  1.86k|        return 1;
  667|  3.43k|    case set_basic :
  ------------------
  |  Branch (667:5): [True: 3.43k, False: 6.17k]
  ------------------
  668|  3.43k|        *DTablePtr = defaultTable;
  669|  3.43k|        return 0;
  670|    328|    case set_repeat:
  ------------------
  |  Branch (670:5): [True: 328, False: 9.27k]
  ------------------
  671|    328|        RETURN_ERROR_IF(!flagRepeatTable, corruption_detected, "");
  ------------------
  |  |  114|    328|    do {                                                                       \
  |  |  115|    328|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 2, False: 326]
  |  |  ------------------
  |  |  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|    328|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 326]
  |  |  ------------------
  ------------------
  672|       |        /* prefetch FSE table if used */
  673|    326|        if (ddictIsCold && (nbSeq > 24 /* heuristic */)) {
  ------------------
  |  Branch (673:13): [True: 69, False: 257]
  |  Branch (673:28): [True: 1, False: 68]
  ------------------
  674|      1|            const void* const pStart = *DTablePtr;
  675|      1|            size_t const pSize = sizeof(ZSTD_seqSymbol) * (SEQSYMBOL_TABLE_SIZE(maxLog));
  ------------------
  |  |   74|      1| #define SEQSYMBOL_TABLE_SIZE(log)   (1 + (1 << (log)))
  ------------------
  676|      1|            PREFETCH_AREA(pStart, pSize);
  ------------------
  |  |  159|      1|    do {                                                 \
  |  |  160|      1|        const char* const _ptr = (const char*)(p);       \
  |  |  161|      1|        size_t const _size = (size_t)(s);                \
  |  |  162|      1|        size_t _pos;                                     \
  |  |  163|     66|        for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \
  |  |  ------------------
  |  |  |  |  156|     65|#define CACHELINE_SIZE 64
  |  |  ------------------
  |  |  |  Branch (163:22): [True: 65, False: 1]
  |  |  ------------------
  |  |  164|     65|            PREFETCH_L2(_ptr + _pos);                    \
  |  |  ------------------
  |  |  |  |  146|     65|#    define PREFETCH_L2(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 2 /* locality */)
  |  |  ------------------
  |  |  165|     65|        }                                                \
  |  |  166|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (166:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
  677|      1|        }
  678|    326|        return 0;
  679|  3.98k|    case set_compressed :
  ------------------
  |  Branch (679:5): [True: 3.98k, False: 5.62k]
  ------------------
  680|  3.98k|        {   unsigned tableLog;
  681|  3.98k|            S16 norm[MaxSeq+1];
  682|  3.98k|            size_t const headerSize = FSE_readNCount(norm, &max, &tableLog, src, srcSize);
  683|  3.98k|            RETURN_ERROR_IF(FSE_isError(headerSize), corruption_detected, "");
  ------------------
  |  |  114|  3.98k|    do {                                                                       \
  |  |  115|  3.98k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4, False: 3.97k]
  |  |  ------------------
  |  |  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|  3.98k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.97k]
  |  |  ------------------
  ------------------
  684|  3.97k|            RETURN_ERROR_IF(tableLog > maxLog, corruption_detected, "");
  ------------------
  |  |  114|  3.97k|    do {                                                                       \
  |  |  115|  3.97k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 3.97k]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|  3.97k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 3.97k]
  |  |  ------------------
  ------------------
  685|  3.97k|            ZSTD_buildFSETable(DTableSpace, norm, max, baseValue, nbAdditionalBits, tableLog, wksp, wkspSize, bmi2);
  686|  3.97k|            *DTablePtr = DTableSpace;
  687|  3.97k|            return headerSize;
  688|  3.97k|        }
  689|      0|    default :
  ------------------
  |  Branch (689:5): [True: 0, False: 9.60k]
  ------------------
  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|  9.60k|    }
  693|  9.60k|}
zstd_decompress_block.c:ZSTD_buildSeqTable_rle:
  464|  1.86k|{
  465|  1.86k|    void* ptr = dt;
  466|  1.86k|    ZSTD_seqSymbol_header* const DTableH = (ZSTD_seqSymbol_header*)ptr;
  467|  1.86k|    ZSTD_seqSymbol* const cell = dt + 1;
  468|       |
  469|  1.86k|    DTableH->tableLog = 0;
  470|  1.86k|    DTableH->fastMode = 0;
  471|       |
  472|  1.86k|    cell->nbBits = 0;
  473|  1.86k|    cell->nextState = 0;
  474|  1.86k|    assert(nbAddBits < 255);
  ------------------
  |  |   70|  1.86k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  475|  1.86k|    cell->nbAdditionalBits = nbAddBits;
  476|  1.86k|    cell->baseValue = baseValue;
  477|  1.86k|}
zstd_decompress_block.c:ZSTD_blockSizeMax:
   55|  31.5k|{
   56|  31.5k|    size_t const blockSizeMax = dctx->isFrameDecompression ? dctx->fParams.blockSizeMax : ZSTD_BLOCKSIZE_MAX;
  ------------------
  |  |  148|  31.5k|#define ZSTD_BLOCKSIZE_MAX     (1<<ZSTD_BLOCKSIZELOG_MAX)
  |  |  ------------------
  |  |  |  |  147|      0|#define ZSTD_BLOCKSIZELOG_MAX  17
  |  |  ------------------
  ------------------
  |  Branch (56:33): [True: 31.5k, False: 0]
  ------------------
   57|  31.5k|    assert(blockSizeMax <= ZSTD_BLOCKSIZE_MAX);
  ------------------
  |  |   70|  31.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   58|  31.5k|    return blockSizeMax;
   59|  31.5k|}
zstd_decompress_block.c:ZSTD_totalHistorySize:
 1997|  7.01k|{
 1998|  7.01k|    return (size_t)(op - virtualStart);
 1999|  7.01k|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong:
 1979|    583|{
 1980|    583|    DEBUGLOG(5, "ZSTD_decompressSequencesLong");
  ------------------
  |  |  104|    583|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 583]
  |  |  ------------------
  ------------------
 1981|    583|#if DYNAMIC_BMI2
 1982|    583|    if (ZSTD_DCtx_get_bmi2(dctx)) {
  ------------------
  |  Branch (1982:9): [True: 583, False: 0]
  ------------------
 1983|    583|        return ZSTD_decompressSequencesLong_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1984|    583|    }
 1985|      0|#endif
 1986|      0|  return ZSTD_decompressSequencesLong_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1987|    583|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong_bmi2:
 1931|    583|{
 1932|    583|    return ZSTD_decompressSequencesLong_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1933|    583|}
zstd_decompress_block.c:ZSTD_decompressSequencesLong_body:
 1738|    583|{
 1739|    583|    const BYTE* ip = (const BYTE*)seqStart;
 1740|    583|    const BYTE* const iend = ip + seqSize;
 1741|    583|    BYTE* const ostart = (BYTE*)dst;
 1742|    583|    BYTE* const oend = dctx->litBufferLocation == ZSTD_in_dst ? dctx->litBuffer : ZSTD_maybeNullPtrAdd(ostart, maxDstSize);
  ------------------
  |  Branch (1742:24): [True: 29, False: 554]
  ------------------
 1743|    583|    BYTE* op = ostart;
 1744|    583|    const BYTE* litPtr = dctx->litPtr;
 1745|    583|    const BYTE* litBufferEnd = dctx->litBufferEnd;
 1746|    583|    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);
 1747|    583|    const BYTE* const dictStart = (const BYTE*) (dctx->virtualStart);
 1748|    583|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 1749|       |
 1750|       |    /* Regen sequences */
 1751|    583|    if (nbSeq) {
  ------------------
  |  Branch (1751:9): [True: 505, False: 78]
  ------------------
 1752|    505|#define STORED_SEQS 8
 1753|    505|#define STORED_SEQS_MASK (STORED_SEQS-1)
 1754|    505|#define ADVANCED_SEQS STORED_SEQS
 1755|    505|        seq_t sequences[STORED_SEQS];
 1756|    505|        int const seqAdvance = MIN(nbSeq, ADVANCED_SEQS);
  ------------------
  |  |   54|    505|#define MIN(a,b) ((a)<(b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (54:19): [True: 88, False: 417]
  |  |  ------------------
  ------------------
 1757|    505|        seqState_t seqState;
 1758|    505|        int seqNb;
 1759|    505|        size_t prefetchPos = (size_t)(op-prefixStart); /* track position relative to prefixStart */
 1760|       |
 1761|    505|        dctx->fseEntropy = 1;
 1762|  2.02k|        { int i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  2.02k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1762:28): [True: 1.51k, False: 505]
  ------------------
 1763|    505|        assert(dst != NULL);
  ------------------
  |  |   70|    505|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1764|    505|        assert(iend >= ip);
  ------------------
  |  |   70|    505|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1765|    505|        RETURN_ERROR_IF(
  ------------------
  |  |  114|    505|    do {                                                                       \
  |  |  115|    505|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 9, False: 496]
  |  |  ------------------
  |  |  116|      9|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      9|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      9|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      9|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      9|    do {                                           \
  |  |  |  |   99|      9|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 9]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      9|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      9|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      9|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      9|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      9|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      9|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      9|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      9|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      9|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      9|        }                                                                      \
  |  |  123|    505|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 496]
  |  |  ------------------
  ------------------
 1766|    505|            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)),
 1767|    505|            corruption_detected, "");
 1768|    496|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1769|    496|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1770|    496|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1771|       |
 1772|       |        /* prepare in advance */
 1773|  4.06k|        for (seqNb=0; seqNb<seqAdvance; seqNb++) {
  ------------------
  |  Branch (1773:23): [True: 3.56k, False: 496]
  ------------------
 1774|  3.56k|            seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1);
 1775|  3.56k|            prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1776|  3.56k|            sequences[seqNb] = sequence;
 1777|  3.56k|        }
 1778|       |
 1779|       |        /* decompress without stomping litBuffer */
 1780|  1.93M|        for (; seqNb < nbSeq; seqNb++) {
  ------------------
  |  Branch (1780:16): [True: 1.93M, False: 93]
  ------------------
 1781|  1.93M|            seq_t sequence = ZSTD_decodeSequence(&seqState, isLongOffset, seqNb == nbSeq-1);
 1782|       |
 1783|  1.93M|            if (dctx->litBufferLocation == ZSTD_split && litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength > dctx->litBufferEnd) {
  ------------------
  |  | 1754|  1.83M|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|  1.83M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                          if (dctx->litBufferLocation == ZSTD_split && litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength > dctx->litBufferEnd) {
  ------------------
  |  | 1753|  1.83M|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|  1.83M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
  |  Branch (1783:17): [True: 1.83M, False: 98.4k]
  |  Branch (1783:58): [True: 234, False: 1.83M]
  ------------------
 1784|       |                /* lit buffer is reaching split point, empty out the first buffer and transition to litExtraBuffer */
 1785|    234|                const size_t leftoverLit = dctx->litBufferEnd - litPtr;
 1786|    234|                if (leftoverLit)
  ------------------
  |  Branch (1786:21): [True: 229, False: 5]
  ------------------
 1787|    229|                {
 1788|    229|                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer");
  ------------------
  |  |  114|    229|    do {                                                                       \
  |  |  115|    229|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 12, False: 217]
  |  |  ------------------
  |  |  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|    229|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 217]
  |  |  ------------------
  ------------------
 1789|    217|                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);
 1790|    217|                    sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength -= leftoverLit;
  ------------------
  |  | 1754|    217|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|    217|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength -= leftoverLit;
  ------------------
  |  | 1753|    217|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    217|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1791|    217|                    op += leftoverLit;
 1792|    217|                }
 1793|    222|                litPtr = dctx->litExtraBuffer;
 1794|    222|                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    222|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    222|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|    444|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 222]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 222, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1795|    222|                dctx->litBufferLocation = ZSTD_not_in_dst;
 1796|    222|                {   size_t const oneSeqSize = ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1754|    222|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|    222|#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|    222|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    222|#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|    222|                    if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|    222|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1801:25): [True: 50, False: 172]
  ------------------
 1802|       |
 1803|    172|                    prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1804|    172|                    sequences[seqNb & STORED_SEQS_MASK] = sequence;
  ------------------
  |  | 1753|    172|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    172|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1805|    172|                    op += oneSeqSize;
 1806|    172|            }   }
 1807|  1.93M|            else
 1808|  1.93M|            {
 1809|       |                /* lit buffer is either wholly contained in first or second split, or not split at all*/
 1810|  1.93M|                size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ?
  ------------------
  |  Branch (1810:43): [True: 1.83M, False: 98.4k]
  ------------------
 1811|  1.83M|                    ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY_OVERLENGTH, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  | 1754|  1.83M|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|  1.83M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY_OVERLENGTH, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  | 1753|  1.83M|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|  1.83M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY_OVERLENGTH, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  |  199|  1.83M|#define WILDCOPY_OVERLENGTH 32
  ------------------
                                  ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY_OVERLENGTH, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  | 1754|  1.83M|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|  1.83M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK].litLength - WILDCOPY_OVERLENGTH, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  | 1753|  1.83M|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|  1.83M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1812|  1.93M|                    ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1754|  98.4k|#define ADVANCED_SEQS STORED_SEQS
  |  |  ------------------
  |  |  |  | 1752|  98.4k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
                                  ZSTD_execSequence(op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd);
  ------------------
  |  | 1753|  98.4k|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|  98.4k|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1813|       |#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
 1814|       |                assert(!ZSTD_isError(oneSeqSize));
 1815|       |                ZSTD_assertValidSequence(dctx, op, oend, sequences[(seqNb - ADVANCED_SEQS) & STORED_SEQS_MASK], prefixStart, dictStart);
 1816|       |#endif
 1817|  1.93M|                if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|  1.93M|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1817:21): [True: 341, False: 1.93M]
  ------------------
 1818|       |
 1819|  1.93M|                prefetchPos = ZSTD_prefetchMatch(prefetchPos, sequence, prefixStart, dictEnd);
 1820|  1.93M|                sequences[seqNb & STORED_SEQS_MASK] = sequence;
  ------------------
  |  | 1753|  1.93M|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|  1.93M|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1821|  1.93M|                op += oneSeqSize;
 1822|  1.93M|            }
 1823|  1.93M|        }
 1824|     93|        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, "");
  ------------------
  |  |  114|     93|    do {                                                                       \
  |  |  115|     93|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 3, False: 90]
  |  |  ------------------
  |  |  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|     93|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 90]
  |  |  ------------------
  ------------------
 1825|       |
 1826|       |        /* finish queue */
 1827|     90|        seqNb -= seqAdvance;
 1828|    376|        for ( ; seqNb<nbSeq ; seqNb++) {
  ------------------
  |  Branch (1828:17): [True: 296, False: 80]
  ------------------
 1829|    296|            seq_t *sequence = &(sequences[seqNb&STORED_SEQS_MASK]);
  ------------------
  |  | 1753|    296|#define STORED_SEQS_MASK (STORED_SEQS-1)
  |  |  ------------------
  |  |  |  | 1752|    296|#define STORED_SEQS 8
  |  |  ------------------
  ------------------
 1830|    296|            if (dctx->litBufferLocation == ZSTD_split && litPtr + sequence->litLength > dctx->litBufferEnd) {
  ------------------
  |  Branch (1830:17): [True: 0, False: 296]
  |  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|    296|            else
 1851|    296|            {
 1852|    296|                size_t const oneSeqSize = dctx->litBufferLocation == ZSTD_split ?
  ------------------
  |  Branch (1852:43): [True: 0, False: 296]
  ------------------
 1853|      0|                    ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence->litLength - WILDCOPY_OVERLENGTH, *sequence, &litPtr, litBufferEnd, prefixStart, dictStart, dictEnd) :
  ------------------
  |  |  199|      0|#define WILDCOPY_OVERLENGTH 32
  ------------------
 1854|    296|                    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|    296|                if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  |   44|    296|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (1859:21): [True: 10, False: 286]
  ------------------
 1860|    286|                op += oneSeqSize;
 1861|    286|            }
 1862|    296|        }
 1863|       |
 1864|       |        /* save reps for next block */
 1865|    320|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  |   64|    320|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1865:28): [True: 240, False: 80]
  ------------------
 1866|     80|    }
 1867|       |
 1868|       |    /* last literal segment */
 1869|    158|    if (dctx->litBufferLocation == ZSTD_split) { /* first deplete literal buffer in dst, then copy litExtraBuffer */
  ------------------
  |  Branch (1869:9): [True: 0, False: 158]
  ------------------
 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|    158|    {   size_t const lastLLSize = litBufferEnd - litPtr;
 1880|    158|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, "");
  ------------------
  |  |  114|    158|    do {                                                                       \
  |  |  115|    158|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 158]
  |  |  ------------------
  |  |  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|    158|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 158]
  |  |  ------------------
  ------------------
 1881|    158|        if (op != NULL) {
  ------------------
  |  Branch (1881:13): [True: 158, False: 0]
  ------------------
 1882|    158|            ZSTD_memmove(op, litPtr, lastLLSize);
  ------------------
  |  |   45|    158|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1883|    158|            op += lastLLSize;
 1884|    158|        }
 1885|    158|    }
 1886|       |
 1887|      0|    return (size_t)(op - ostart);
 1888|    158|}
zstd_decompress_block.c:ZSTD_initFseState:
 1193|  9.40k|{
 1194|  9.40k|    const void* ptr = dt;
 1195|  9.40k|    const ZSTD_seqSymbol_header* const DTableH = (const ZSTD_seqSymbol_header*)ptr;
 1196|  9.40k|    DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog);
 1197|  9.40k|    DEBUGLOG(6, "ZSTD_initFseState : val=%u using %u bits",
  ------------------
  |  |  104|  9.40k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 9.40k]
  |  |  ------------------
  ------------------
 1198|  9.40k|                (U32)DStatePtr->state, DTableH->tableLog);
 1199|  9.40k|    BIT_reloadDStream(bitD);
 1200|  9.40k|    DStatePtr->table = dt + 1;
 1201|  9.40k|}
zstd_decompress_block.c:ZSTD_decodeSequence:
 1230|  4.91M|{
 1231|  4.91M|    seq_t seq;
 1232|       |    /*
 1233|       |     * ZSTD_seqSymbol is a 64 bits wide structure.
 1234|       |     * It can be loaded in one operation
 1235|       |     * and its fields extracted by simply shifting or bit-extracting on aarch64.
 1236|       |     * GCC doesn't recognize this and generates more unnecessary ldr/ldrb/ldrh
 1237|       |     * operations that cause performance drop. This can be avoided by using this
 1238|       |     * ZSTD_memcpy hack.
 1239|       |     */
 1240|       |#if defined(__aarch64__) && (defined(__GNUC__) && !defined(__clang__))
 1241|       |    ZSTD_seqSymbol llDInfoS, mlDInfoS, ofDInfoS;
 1242|       |    ZSTD_seqSymbol* const llDInfo = &llDInfoS;
 1243|       |    ZSTD_seqSymbol* const mlDInfo = &mlDInfoS;
 1244|       |    ZSTD_seqSymbol* const ofDInfo = &ofDInfoS;
 1245|       |    ZSTD_memcpy(llDInfo, seqState->stateLL.table + seqState->stateLL.state, sizeof(ZSTD_seqSymbol));
 1246|       |    ZSTD_memcpy(mlDInfo, seqState->stateML.table + seqState->stateML.state, sizeof(ZSTD_seqSymbol));
 1247|       |    ZSTD_memcpy(ofDInfo, seqState->stateOffb.table + seqState->stateOffb.state, sizeof(ZSTD_seqSymbol));
 1248|       |#else
 1249|  4.91M|    const ZSTD_seqSymbol* const llDInfo = seqState->stateLL.table + seqState->stateLL.state;
 1250|  4.91M|    const ZSTD_seqSymbol* const mlDInfo = seqState->stateML.table + seqState->stateML.state;
 1251|  4.91M|    const ZSTD_seqSymbol* const ofDInfo = seqState->stateOffb.table + seqState->stateOffb.state;
 1252|  4.91M|#endif
 1253|  4.91M|    seq.matchLength = mlDInfo->baseValue;
 1254|  4.91M|    seq.litLength = llDInfo->baseValue;
 1255|  4.91M|    {   U32 const ofBase = ofDInfo->baseValue;
 1256|  4.91M|        BYTE const llBits = llDInfo->nbAdditionalBits;
 1257|  4.91M|        BYTE const mlBits = mlDInfo->nbAdditionalBits;
 1258|  4.91M|        BYTE const ofBits = ofDInfo->nbAdditionalBits;
 1259|  4.91M|        BYTE const totalBits = llBits+mlBits+ofBits;
 1260|       |
 1261|  4.91M|        U16 const llNext = llDInfo->nextState;
 1262|  4.91M|        U16 const mlNext = mlDInfo->nextState;
 1263|  4.91M|        U16 const ofNext = ofDInfo->nextState;
 1264|  4.91M|        U32 const llnbBits = llDInfo->nbBits;
 1265|  4.91M|        U32 const mlnbBits = mlDInfo->nbBits;
 1266|  4.91M|        U32 const ofnbBits = ofDInfo->nbBits;
 1267|       |
 1268|  4.91M|        assert(llBits <= MaxLLBits);
  ------------------
  |  |   70|  4.91M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1269|  4.91M|        assert(mlBits <= MaxMLBits);
  ------------------
  |  |   70|  4.91M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1270|  4.91M|        assert(ofBits <= MaxOff);
  ------------------
  |  |   70|  4.91M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1271|       |        /*
 1272|       |         * As gcc has better branch and block analyzers, sometimes it is only
 1273|       |         * valuable to mark likeliness for clang, it gives around 3-4% of
 1274|       |         * performance.
 1275|       |         */
 1276|       |
 1277|       |        /* sequence */
 1278|  4.91M|        {   size_t offset;
 1279|  4.91M|            if (ofBits > 1) {
  ------------------
  |  Branch (1279:17): [True: 4.32M, False: 581k]
  ------------------
 1280|  4.32M|                ZSTD_STATIC_ASSERT(ZSTD_lo_isLongOffset == 1);
  ------------------
  |  |   43|  4.32M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  4.32M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1281|  4.32M|                ZSTD_STATIC_ASSERT(LONG_OFFSETS_MAX_EXTRA_BITS_32 == 5);
  ------------------
  |  |   43|  4.32M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  4.32M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1282|  4.32M|                ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 > LONG_OFFSETS_MAX_EXTRA_BITS_32);
  ------------------
  |  |   43|  4.32M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  4.32M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1283|  4.32M|                ZSTD_STATIC_ASSERT(STREAM_ACCUMULATOR_MIN_32 - LONG_OFFSETS_MAX_EXTRA_BITS_32 >= MaxMLBits);
  ------------------
  |  |   43|  4.32M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  4.32M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1284|  4.32M|                if (MEM_32bits() && longOffsets && (ofBits >= STREAM_ACCUMULATOR_MIN_32)) {
  ------------------
  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  ------------------
  |  Branch (1284:21): [True: 0, False: 4.32M]
  |  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.32M|                } else {
 1293|  4.32M|                    offset = ofBase + BIT_readBitsFast(&seqState->DStream, ofBits/*>0*/);   /* <=  (ZSTD_WINDOWLOG_MAX-1) bits */
 1294|  4.32M|                    if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);
  ------------------
  |  Branch (1294:25): [True: 0, False: 4.32M]
  ------------------
 1295|  4.32M|                }
 1296|  4.32M|                seqState->prevOffset[2] = seqState->prevOffset[1];
 1297|  4.32M|                seqState->prevOffset[1] = seqState->prevOffset[0];
 1298|  4.32M|                seqState->prevOffset[0] = offset;
 1299|  4.32M|            } else {
 1300|   581k|                U32 const ll0 = (llDInfo->baseValue == 0);
 1301|   581k|                if (LIKELY((ofBits == 0))) {
  ------------------
  |  |  187|   581k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 480k, False: 100k]
  |  |  ------------------
  ------------------
 1302|   480k|                    offset = seqState->prevOffset[ll0];
 1303|   480k|                    seqState->prevOffset[1] = seqState->prevOffset[!ll0];
 1304|   480k|                    seqState->prevOffset[0] = offset;
 1305|   480k|                } else {
 1306|   100k|                    offset = ofBase + ll0 + BIT_readBitsFast(&seqState->DStream, 1);
 1307|   100k|                    {   size_t temp = (offset==3) ? seqState->prevOffset[0] - 1 : seqState->prevOffset[offset];
  ------------------
  |  Branch (1307:39): [True: 18.2k, False: 82.7k]
  ------------------
 1308|   100k|                        temp -= !temp; /* 0 is not valid: input corrupted => force offset to -1 => corruption detected at execSequence */
 1309|   100k|                        if (offset != 1) seqState->prevOffset[2] = seqState->prevOffset[1];
  ------------------
  |  Branch (1309:29): [True: 70.6k, False: 30.2k]
  ------------------
 1310|   100k|                        seqState->prevOffset[1] = seqState->prevOffset[0];
 1311|   100k|                        seqState->prevOffset[0] = offset = temp;
 1312|   100k|            }   }   }
 1313|  4.91M|            seq.offset = offset;
 1314|  4.91M|        }
 1315|       |
 1316|  4.91M|        if (mlBits > 0)
  ------------------
  |  Branch (1316:13): [True: 23.3k, False: 4.88M]
  ------------------
 1317|  23.3k|            seq.matchLength += BIT_readBitsFast(&seqState->DStream, mlBits/*>0*/);
 1318|       |
 1319|  4.91M|        if (MEM_32bits() && (mlBits+llBits >= STREAM_ACCUMULATOR_MIN_32-LONG_OFFSETS_MAX_EXTRA_BITS_32))
  ------------------
  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  ------------------
                      if (MEM_32bits() && (mlBits+llBits >= STREAM_ACCUMULATOR_MIN_32-LONG_OFFSETS_MAX_EXTRA_BITS_32))
  ------------------
  |  | 1216|      0|    (ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32       \
  |  |  ------------------
  |  |  |  | 1263|      0|#define ZSTD_WINDOWLOG_MAX_32    30
  |  |  ------------------
  |  |                   (ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32       \
  |  |  ------------------
  |  |  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  |  |  ------------------
  |  |  |  Branch (1216:6): [True: 0, Folded]
  |  |  ------------------
  |  | 1217|      0|        ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32  \
  |  |  ------------------
  |  |  |  | 1263|      0|#define ZSTD_WINDOWLOG_MAX_32    30
  |  |  ------------------
  |  |                       ? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32  \
  |  |  ------------------
  |  |  |  |   43|      0|#define STREAM_ACCUMULATOR_MIN_32  25
  |  |  ------------------
  |  | 1218|      0|        : 0)
  ------------------
  |  Branch (1319:13): [True: 0, False: 4.91M]
  |  Branch (1319:29): [True: 0, False: 0]
  ------------------
 1320|      0|            BIT_reloadDStream(&seqState->DStream);
 1321|  4.91M|        if (MEM_64bits() && UNLIKELY(totalBits >= STREAM_ACCUMULATOR_MIN_64-(LLFSELog+MLFSELog+OffFSELog)))
  ------------------
  |  |  188|  4.91M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 353, False: 4.91M]
  |  |  ------------------
  ------------------
  |  Branch (1321:13): [True: 4.91M, False: 0]
  ------------------
 1322|    353|            BIT_reloadDStream(&seqState->DStream);
 1323|       |        /* Ensure there are enough bits to read the rest of data in 64-bit mode. */
 1324|  4.91M|        ZSTD_STATIC_ASSERT(16+LLFSELog+MLFSELog+OffFSELog < STREAM_ACCUMULATOR_MIN_64);
  ------------------
  |  |   43|  4.91M|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|  4.91M|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1325|       |
 1326|  4.91M|        if (llBits > 0)
  ------------------
  |  Branch (1326:13): [True: 60.1k, False: 4.85M]
  ------------------
 1327|  60.1k|            seq.litLength += BIT_readBitsFast(&seqState->DStream, llBits/*>0*/);
 1328|       |
 1329|  4.91M|        if (MEM_32bits())
  ------------------
  |  Branch (1329:13): [True: 0, False: 4.91M]
  ------------------
 1330|      0|            BIT_reloadDStream(&seqState->DStream);
 1331|       |
 1332|  4.91M|        DEBUGLOG(6, "seq: litL=%u, matchL=%u, offset=%u",
  ------------------
  |  |  104|  4.91M|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 4.91M]
  |  |  ------------------
  ------------------
 1333|  4.91M|                    (U32)seq.litLength, (U32)seq.matchLength, (U32)seq.offset);
 1334|       |
 1335|  4.91M|        if (!isLastSeq) {
  ------------------
  |  Branch (1335:13): [True: 4.90M, False: 2.10k]
  ------------------
 1336|       |            /* don't update FSE state for last Sequence */
 1337|  4.90M|            ZSTD_updateFseStateWithDInfo(&seqState->stateLL, &seqState->DStream, llNext, llnbBits);    /* <=  9 bits */
 1338|  4.90M|            ZSTD_updateFseStateWithDInfo(&seqState->stateML, &seqState->DStream, mlNext, mlnbBits);    /* <=  9 bits */
 1339|  4.90M|            if (MEM_32bits()) BIT_reloadDStream(&seqState->DStream);    /* <= 18 bits */
  ------------------
  |  Branch (1339:17): [True: 0, False: 4.90M]
  ------------------
 1340|  4.90M|            ZSTD_updateFseStateWithDInfo(&seqState->stateOffb, &seqState->DStream, ofNext, ofnbBits);  /* <=  8 bits */
 1341|  4.90M|            BIT_reloadDStream(&seqState->DStream);
 1342|  4.90M|        }
 1343|  4.91M|    }
 1344|       |
 1345|  4.91M|    return seq;
 1346|  4.91M|}
zstd_decompress_block.c:ZSTD_updateFseStateWithDInfo:
 1205|  14.7M|{
 1206|  14.7M|    size_t const lowBits = BIT_readBits(bitD, nbBits);
 1207|  14.7M|    DStatePtr->state = nextState + lowBits;
 1208|  14.7M|}
zstd_decompress_block.c:ZSTD_prefetchMatch:
 1717|  1.93M|{
 1718|  1.93M|    prefetchPos += sequence.litLength;
 1719|  1.93M|    {   const BYTE* const matchBase = (sequence.offset > prefetchPos) ? dictEnd : prefixStart;
  ------------------
  |  Branch (1719:39): [True: 5.99k, False: 1.92M]
  ------------------
 1720|       |        /* note : this operation can overflow when seq.offset is really too large, which can only happen when input is corrupted.
 1721|       |         * No consequence though : memory address is only used for prefetching, not for dereferencing */
 1722|  1.93M|        const BYTE* const match = ZSTD_wrappedPtrSub(ZSTD_wrappedPtrAdd(matchBase, prefetchPos), sequence.offset);
 1723|  1.93M|        PREFETCH_L1(match); PREFETCH_L1(match+CACHELINE_SIZE);   /* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */
  ------------------
  |  |  145|  1.93M|#    define PREFETCH_L1(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */)
  ------------------
                      PREFETCH_L1(match); PREFETCH_L1(match+CACHELINE_SIZE);   /* note : it's safe to invoke PREFETCH() on any memory address, including invalid ones */
  ------------------
  |  |  145|  1.93M|#    define PREFETCH_L1(ptr)  __builtin_prefetch((ptr), 0 /* rw==read */, 3 /* locality */)
  ------------------
 1724|  1.93M|    }
 1725|  1.93M|    return prefetchPos + sequence.matchLength;
 1726|  1.93M|}
zstd_decompress_block.c:ZSTD_safecopyDstBeforeSrc:
  877|  46.9k|static void ZSTD_safecopyDstBeforeSrc(BYTE* op, const BYTE* ip, ptrdiff_t length) {
  878|  46.9k|    ptrdiff_t const diff = op - ip;
  879|  46.9k|    BYTE* const oend = op + length;
  880|       |
  881|  46.9k|    if (length < 8 || diff > -8) {
  ------------------
  |  Branch (881:9): [True: 43.4k, False: 3.52k]
  |  Branch (881:23): [True: 2.94k, False: 578]
  ------------------
  882|       |        /* Handle short lengths, close overlaps, and dst not before src. */
  883|   440k|        while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (883:16): [True: 394k, False: 46.3k]
  ------------------
  884|  46.3k|        return;
  885|  46.3k|    }
  886|       |
  887|    578|    if (op <= oend - WILDCOPY_OVERLENGTH && diff < -WILDCOPY_VECLEN) {
  ------------------
  |  |  199|  1.15k|#define WILDCOPY_OVERLENGTH 32
  ------------------
                  if (op <= oend - WILDCOPY_OVERLENGTH && diff < -WILDCOPY_VECLEN) {
  ------------------
  |  |  200|    406|#define WILDCOPY_VECLEN 16
  ------------------
  |  Branch (887:9): [True: 406, False: 172]
  |  Branch (887:45): [True: 354, False: 52]
  ------------------
  888|    354|        ZSTD_wildcopy(op, ip, oend - WILDCOPY_OVERLENGTH - op, ZSTD_no_overlap);
  ------------------
  |  |  199|    354|#define WILDCOPY_OVERLENGTH 32
  ------------------
  889|    354|        ip += oend - WILDCOPY_OVERLENGTH - op;
  ------------------
  |  |  199|    354|#define WILDCOPY_OVERLENGTH 32
  ------------------
  890|    354|        op += oend - WILDCOPY_OVERLENGTH - op;
  ------------------
  |  |  199|    354|#define WILDCOPY_OVERLENGTH 32
  ------------------
  891|    354|    }
  892|       |
  893|       |    /* Handle the leftovers. */
  894|  67.9k|    while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (894:12): [True: 67.3k, False: 578]
  ------------------
  895|    578|}
zstd_decompress_block.c:ZSTD_execSequence:
 1005|   457k|{
 1006|   457k|    BYTE* const oLitEnd = op + sequence.litLength;
 1007|   457k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 1008|   457k|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 1009|   457k|    BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;   /* risk : address space underflow on oend=NULL */
  ------------------
  |  |  199|   457k|#define WILDCOPY_OVERLENGTH 32
  ------------------
 1010|   457k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 1011|   457k|    const BYTE* match = oLitEnd - sequence.offset;
 1012|       |
 1013|   457k|    assert(op != NULL /* Precondition */);
  ------------------
  |  |   70|   457k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1014|   457k|    assert(oend_w < oend /* No underflow */);
  ------------------
  |  |   70|   457k|#    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|   457k|    if (UNLIKELY(
  ------------------
  |  |  188|  2.27M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 2.90k, False: 454k]
  |  |  |  Branch (188:40): [True: 87, False: 456k]
  |  |  |  Branch (188:40): [True: 2.82k, False: 454k]
  |  |  |  Branch (188:40): [True: 0, False: 454k]
  |  |  |  Branch (188:40): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1026|   457k|        iLitEnd > litLimit ||
 1027|   457k|        oMatchEnd > oend_w ||
 1028|   457k|        (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH)))
 1029|  2.90k|        return ZSTD_execSequenceEnd(op, oend, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd);
 1030|       |
 1031|       |    /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */
 1032|   454k|    assert(op <= oLitEnd /* No overflow */);
  ------------------
  |  |   70|   454k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1033|   454k|    assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */);
  ------------------
  |  |   70|   454k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1034|   454k|    assert(oMatchEnd <= oend /* No underflow */);
  ------------------
  |  |   70|   454k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1035|   454k|    assert(iLitEnd <= litLimit /* Literal length is in bounds */);
  ------------------
  |  |   70|   454k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1036|   454k|    assert(oLitEnd <= oend_w /* Can wildcopy literals */);
  ------------------
  |  |   70|   454k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1037|   454k|    assert(oMatchEnd <= oend_w /* Can wildcopy matches */);
  ------------------
  |  |   70|   454k|#    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|   454k|    assert(WILDCOPY_OVERLENGTH >= 16);
  ------------------
  |  |   70|   454k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1044|   454k|    ZSTD_copy16(op, (*litPtr));
 1045|   454k|    if (UNLIKELY(sequence.litLength > 16)) {
  ------------------
  |  |  188|   454k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 13.0k, False: 441k]
  |  |  ------------------
  ------------------
 1046|  13.0k|        ZSTD_wildcopy(op + 16, (*litPtr) + 16, sequence.litLength - 16, ZSTD_no_overlap);
 1047|  13.0k|    }
 1048|   454k|    op = oLitEnd;
 1049|   454k|    *litPtr = iLitEnd;   /* update for next sequence */
 1050|       |
 1051|       |    /* Copy Match */
 1052|   454k|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (1052:9): [True: 1.20k, False: 452k]
  ------------------
 1053|       |        /* offset beyond prefix -> go into extDict */
 1054|  1.20k|        RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected, "");
  ------------------
  |  |  114|  1.20k|    do {                                                                       \
  |  |  115|  1.20k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 252, False: 950]
  |  |  ------------------
  |  |  116|    252|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    252|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 252]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    252|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    252|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    252|    do {                                           \
  |  |  |  |   99|    252|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 252]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    252|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 252]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    252|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    252|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 252]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    252|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    252|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 252]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    252|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    252|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    252|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    252|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    252|        }                                                                      \
  |  |  123|  1.20k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 950]
  |  |  ------------------
  ------------------
 1055|    950|        match = dictEnd + (match - prefixStart);
 1056|    950|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (1056:13): [True: 874, False: 76]
  ------------------
 1057|    874|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|    874|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1058|    874|            return sequenceLength;
 1059|    874|        }
 1060|       |        /* span extDict & currentPrefixSegment */
 1061|     76|        {   size_t const length1 = dictEnd - match;
 1062|     76|        ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|     76|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1063|     76|        op = oLitEnd + length1;
 1064|     76|        sequence.matchLength -= length1;
 1065|     76|        match = prefixStart;
 1066|     76|        }
 1067|     76|    }
 1068|       |    /* Match within prefix of 1 or more bytes */
 1069|   453k|    assert(op <= oMatchEnd);
  ------------------
  |  |   70|   453k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1070|   453k|    assert(oMatchEnd <= oend_w);
  ------------------
  |  |   70|   453k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1071|   453k|    assert(match >= prefixStart);
  ------------------
  |  |   70|   453k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1072|   453k|    assert(sequence.matchLength >= 1);
  ------------------
  |  |   70|   453k|#    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|   453k|    if (LIKELY(sequence.offset >= WILDCOPY_VECLEN)) {
  ------------------
  |  |  187|   453k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 368k, False: 84.7k]
  |  |  ------------------
  ------------------
 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|   368k|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength, ZSTD_no_overlap);
 1083|   368k|        return sequenceLength;
 1084|   368k|    }
 1085|  84.7k|    assert(sequence.offset < WILDCOPY_VECLEN);
  ------------------
  |  |   70|  84.7k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1086|       |
 1087|       |    /* Copy 8 bytes and spread the offset to be >= 8. */
 1088|  84.7k|    ZSTD_overlapCopy8(&op, &match, sequence.offset);
 1089|       |
 1090|       |    /* If the match length is > 8 bytes, then continue with the wildcopy. */
 1091|  84.7k|    if (sequence.matchLength > 8) {
  ------------------
  |  Branch (1091:9): [True: 17.2k, False: 67.4k]
  ------------------
 1092|  17.2k|        assert(op < oMatchEnd);
  ------------------
  |  |   70|  17.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1093|  17.2k|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength - 8, ZSTD_overlap_src_before_dst);
 1094|  17.2k|    }
 1095|  84.7k|    return sequenceLength;
 1096|   453k|}
zstd_decompress_block.c:ZSTD_execSequenceEnd:
  911|  2.90k|{
  912|  2.90k|    BYTE* const oLitEnd = op + sequence.litLength;
  913|  2.90k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
  914|  2.90k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
  915|  2.90k|    const BYTE* match = oLitEnd - sequence.offset;
  916|  2.90k|    BYTE* const oend_w = oend - WILDCOPY_OVERLENGTH;
  ------------------
  |  |  199|  2.90k|#define WILDCOPY_OVERLENGTH 32
  ------------------
  917|       |
  918|       |    /* bounds checks : careful of address space overflow in 32-bit mode */
  919|  2.90k|    RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, "last match must fit within dstBuffer");
  ------------------
  |  |  114|  2.90k|    do {                                                                       \
  |  |  115|  2.90k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 419, False: 2.49k]
  |  |  ------------------
  |  |  116|    419|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    419|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 419]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    419|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    419|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    419|    do {                                           \
  |  |  |  |   99|    419|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 419]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    419|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 419]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    419|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    419|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 419]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    419|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    419|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 419]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    419|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    419|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    419|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    419|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    419|        }                                                                      \
  |  |  123|  2.90k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  920|  2.49k|    RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, "try to read beyond literal buffer");
  ------------------
  |  |  114|  2.49k|    do {                                                                       \
  |  |  115|  2.49k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 37, False: 2.45k]
  |  |  ------------------
  |  |  116|     37|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     37|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 37]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     37|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     37|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     37|    do {                                           \
  |  |  |  |   99|     37|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 37]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     37|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 37]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     37|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     37|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 37]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     37|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     37|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 37]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     37|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     37|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     37|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     37|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     37|        }                                                                      \
  |  |  123|  2.49k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.45k]
  |  |  ------------------
  ------------------
  921|  2.45k|    assert(op < op + sequenceLength);
  ------------------
  |  |   70|  2.45k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  922|  2.45k|    assert(oLitEnd < op + sequenceLength);
  ------------------
  |  |   70|  2.45k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  923|       |
  924|       |    /* copy literals */
  925|  2.45k|    ZSTD_safecopy(op, oend_w, *litPtr, sequence.litLength, ZSTD_no_overlap);
  926|  2.45k|    op = oLitEnd;
  927|  2.45k|    *litPtr = iLitEnd;
  928|       |
  929|       |    /* copy Match */
  930|  2.45k|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (930:9): [True: 256, False: 2.19k]
  ------------------
  931|       |        /* offset beyond prefix */
  932|    256|        RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, "");
  ------------------
  |  |  114|    256|    do {                                                                       \
  |  |  115|    256|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 17, False: 239]
  |  |  ------------------
  |  |  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|    256|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 239]
  |  |  ------------------
  ------------------
  933|    239|        match = dictEnd - (prefixStart - match);
  934|    239|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (934:13): [True: 137, False: 102]
  ------------------
  935|    137|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|    137|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  936|    137|            return sequenceLength;
  937|    137|        }
  938|       |        /* span extDict & currentPrefixSegment */
  939|    102|        {   size_t const length1 = dictEnd - match;
  940|    102|        ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|    102|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  941|    102|        op = oLitEnd + length1;
  942|    102|        sequence.matchLength -= length1;
  943|    102|        match = prefixStart;
  944|    102|        }
  945|    102|    }
  946|  2.29k|    ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst);
  947|  2.29k|    return sequenceLength;
  948|  2.45k|}
zstd_decompress_block.c:ZSTD_safecopy:
  837|  51.1k|static void ZSTD_safecopy(BYTE* op, const BYTE* const oend_w, BYTE const* ip, ptrdiff_t length, ZSTD_overlap_e ovtype) {
  838|  51.1k|    ptrdiff_t const diff = op - ip;
  839|  51.1k|    BYTE* const oend = op + length;
  840|       |
  841|  51.1k|    assert((ovtype == ZSTD_no_overlap && (diff <= -8 || diff >= 8 || op >= oend_w)) ||
  ------------------
  |  |   70|  51.1k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  842|  51.1k|           (ovtype == ZSTD_overlap_src_before_dst && diff >= 0));
  843|       |
  844|  51.1k|    if (length < 8) {
  ------------------
  |  Branch (844:9): [True: 37.5k, False: 13.5k]
  ------------------
  845|       |        /* Handle short lengths. */
  846|   186k|        while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (846:16): [True: 149k, False: 37.5k]
  ------------------
  847|  37.5k|        return;
  848|  37.5k|    }
  849|  13.5k|    if (ovtype == ZSTD_overlap_src_before_dst) {
  ------------------
  |  Branch (849:9): [True: 12.9k, False: 600]
  ------------------
  850|       |        /* Copy 8 bytes and ensure the offset >= 8 when there can be overlap. */
  851|  12.9k|        assert(length >= 8);
  ------------------
  |  |   70|  12.9k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  852|  12.9k|        ZSTD_overlapCopy8(&op, &ip, diff);
  853|  12.9k|        length -= 8;
  854|  12.9k|        assert(op - ip >= 8);
  ------------------
  |  |   70|  12.9k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  855|  12.9k|        assert(op <= oend);
  ------------------
  |  |   70|  12.9k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  856|  12.9k|    }
  857|       |
  858|  13.5k|    if (oend <= oend_w) {
  ------------------
  |  Branch (858:9): [True: 24, False: 13.5k]
  ------------------
  859|       |        /* No risk of overwrite. */
  860|     24|        ZSTD_wildcopy(op, ip, length, ovtype);
  861|     24|        return;
  862|     24|    }
  863|  13.5k|    if (op <= oend_w) {
  ------------------
  |  Branch (863:9): [True: 320, False: 13.1k]
  ------------------
  864|       |        /* Wildcopy until we get close to the end. */
  865|    320|        assert(oend > oend_w);
  ------------------
  |  |   70|    320|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  866|    320|        ZSTD_wildcopy(op, ip, oend_w - op, ovtype);
  867|    320|        ip += oend_w - op;
  868|    320|        op += oend_w - op;
  869|    320|    }
  870|       |    /* Handle the leftovers. */
  871|  1.72M|    while (op < oend) *op++ = *ip++;
  ------------------
  |  Branch (871:12): [True: 1.71M, False: 13.5k]
  ------------------
  872|  13.5k|}
zstd_decompress_block.c:ZSTD_overlapCopy8:
  804|  1.55M|HINT_INLINE void ZSTD_overlapCopy8(BYTE** op, BYTE const** ip, size_t offset) {
  805|  1.55M|    assert(*ip <= *op);
  ------------------
  |  |   70|  1.55M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  806|  1.55M|    if (offset < 8) {
  ------------------
  |  Branch (806:9): [True: 708k, False: 842k]
  ------------------
  807|       |        /* close range match, overlap */
  808|   708k|        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
  809|   708k|        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
  810|   708k|        int const sub2 = dec64table[offset];
  811|   708k|        (*op)[0] = (*ip)[0];
  812|   708k|        (*op)[1] = (*ip)[1];
  813|   708k|        (*op)[2] = (*ip)[2];
  814|   708k|        (*op)[3] = (*ip)[3];
  815|   708k|        *ip += dec32table[offset];
  816|   708k|        ZSTD_copy4(*op+4, *ip);
  817|   708k|        *ip -= sub2;
  818|   842k|    } else {
  819|   842k|        ZSTD_copy8(*op, *ip);
  820|   842k|    }
  821|  1.55M|    *ip += 8;
  822|  1.55M|    *op += 8;
  823|  1.55M|    assert(*op - *ip >= 8);
  ------------------
  |  |   70|  1.55M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  824|  1.55M|}
zstd_decompress_block.c:ZSTD_copy4:
   47|   708k|static void ZSTD_copy4(void* dst, const void* src) { ZSTD_memcpy(dst, src, 4); }
  ------------------
  |  |   44|   708k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
zstd_decompress_block.c:ZSTD_execSequenceSplitLitBuffer:
 1104|  4.45M|{
 1105|  4.45M|    BYTE* const oLitEnd = op + sequence.litLength;
 1106|  4.45M|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 1107|  4.45M|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 1108|  4.45M|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 1109|  4.45M|    const BYTE* match = oLitEnd - sequence.offset;
 1110|       |
 1111|  4.45M|    assert(op != NULL /* Precondition */);
  ------------------
  |  |   70|  4.45M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1112|  4.45M|    assert(oend_w < oend /* No underflow */);
  ------------------
  |  |   70|  4.45M|#    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.45M|    if (UNLIKELY(
  ------------------
  |  |  188|  22.1M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 46.6k, False: 4.40M]
  |  |  |  Branch (188:40): [True: 0, False: 4.45M]
  |  |  |  Branch (188:40): [True: 46.6k, False: 4.40M]
  |  |  |  Branch (188:40): [True: 0, False: 4.40M]
  |  |  |  Branch (188:40): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1119|  4.45M|            iLitEnd > litLimit ||
 1120|  4.45M|            oMatchEnd > oend_w ||
 1121|  4.45M|            (MEM_32bits() && (size_t)(oend - op) < sequenceLength + WILDCOPY_OVERLENGTH)))
 1122|  46.6k|        return ZSTD_execSequenceEndSplitLitBuffer(op, oend, oend_w, sequence, litPtr, litLimit, prefixStart, virtualStart, dictEnd);
 1123|       |
 1124|       |    /* Assumptions (everything else goes into ZSTD_execSequenceEnd()) */
 1125|  4.40M|    assert(op <= oLitEnd /* No overflow */);
  ------------------
  |  |   70|  4.40M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1126|  4.40M|    assert(oLitEnd < oMatchEnd /* Non-zero match & no overflow */);
  ------------------
  |  |   70|  4.40M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1127|  4.40M|    assert(oMatchEnd <= oend /* No underflow */);
  ------------------
  |  |   70|  4.40M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1128|  4.40M|    assert(iLitEnd <= litLimit /* Literal length is in bounds */);
  ------------------
  |  |   70|  4.40M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1129|  4.40M|    assert(oLitEnd <= oend_w /* Can wildcopy literals */);
  ------------------
  |  |   70|  4.40M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1130|  4.40M|    assert(oMatchEnd <= oend_w /* Can wildcopy matches */);
  ------------------
  |  |   70|  4.40M|#    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.40M|    assert(WILDCOPY_OVERLENGTH >= 16);
  ------------------
  |  |   70|  4.40M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1137|  4.40M|    ZSTD_copy16(op, (*litPtr));
 1138|  4.40M|    if (UNLIKELY(sequence.litLength > 16)) {
  ------------------
  |  |  188|  4.40M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 41.3k, False: 4.36M]
  |  |  ------------------
  ------------------
 1139|  41.3k|        ZSTD_wildcopy(op+16, (*litPtr)+16, sequence.litLength-16, ZSTD_no_overlap);
 1140|  41.3k|    }
 1141|  4.40M|    op = oLitEnd;
 1142|  4.40M|    *litPtr = iLitEnd;   /* update for next sequence */
 1143|       |
 1144|       |    /* Copy Match */
 1145|  4.40M|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (1145:9): [True: 5.08k, False: 4.39M]
  ------------------
 1146|       |        /* offset beyond prefix -> go into extDict */
 1147|  5.08k|        RETURN_ERROR_IF(UNLIKELY(sequence.offset > (size_t)(oLitEnd - virtualStart)), corruption_detected, "");
  ------------------
  |  |  114|  5.08k|    do {                                                                       \
  |  |  115|  5.08k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 91, False: 4.99k]
  |  |  ------------------
  |  |  116|     91|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     91|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 91]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     91|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     91|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     91|    do {                                           \
  |  |  |  |   99|     91|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 91]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     91|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 91]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     91|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     91|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 91]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     91|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     91|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 91]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     91|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     91|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     91|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     91|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     91|        }                                                                      \
  |  |  123|  5.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 4.99k]
  |  |  ------------------
  ------------------
 1148|  4.99k|        match = dictEnd + (match - prefixStart);
 1149|  4.99k|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (1149:13): [True: 4.86k, False: 122]
  ------------------
 1150|  4.86k|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|  4.86k|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1151|  4.86k|            return sequenceLength;
 1152|  4.86k|        }
 1153|       |        /* span extDict & currentPrefixSegment */
 1154|    122|        {   size_t const length1 = dictEnd - match;
 1155|    122|            ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|    122|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
 1156|    122|            op = oLitEnd + length1;
 1157|    122|            sequence.matchLength -= length1;
 1158|    122|            match = prefixStart;
 1159|    122|    }   }
 1160|       |    /* Match within prefix of 1 or more bytes */
 1161|  4.39M|    assert(op <= oMatchEnd);
  ------------------
  |  |   70|  4.39M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1162|  4.39M|    assert(oMatchEnd <= oend_w);
  ------------------
  |  |   70|  4.39M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1163|  4.39M|    assert(match >= prefixStart);
  ------------------
  |  |   70|  4.39M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1164|  4.39M|    assert(sequence.matchLength >= 1);
  ------------------
  |  |   70|  4.39M|#    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.39M|    if (LIKELY(sequence.offset >= WILDCOPY_VECLEN)) {
  ------------------
  |  |  187|  4.39M|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 2.94M, False: 1.45M]
  |  |  ------------------
  ------------------
 1170|       |        /* We bet on a full wildcopy for matches, since we expect matches to be
 1171|       |         * longer than literals (in general). In silesia, ~10% of matches are longer
 1172|       |         * than 16 bytes.
 1173|       |         */
 1174|  2.94M|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength, ZSTD_no_overlap);
 1175|  2.94M|        return sequenceLength;
 1176|  2.94M|    }
 1177|  1.45M|    assert(sequence.offset < WILDCOPY_VECLEN);
  ------------------
  |  |   70|  1.45M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1178|       |
 1179|       |    /* Copy 8 bytes and spread the offset to be >= 8. */
 1180|  1.45M|    ZSTD_overlapCopy8(&op, &match, sequence.offset);
 1181|       |
 1182|       |    /* If the match length is > 8 bytes, then continue with the wildcopy. */
 1183|  1.45M|    if (sequence.matchLength > 8) {
  ------------------
  |  Branch (1183:9): [True: 143k, False: 1.31M]
  ------------------
 1184|   143k|        assert(op < oMatchEnd);
  ------------------
  |  |   70|   143k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1185|   143k|        ZSTD_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8, ZSTD_overlap_src_before_dst);
 1186|   143k|    }
 1187|  1.45M|    return sequenceLength;
 1188|  4.39M|}
zstd_decompress_block.c:ZSTD_execSequenceEndSplitLitBuffer:
  959|  46.6k|{
  960|  46.6k|    BYTE* const oLitEnd = op + sequence.litLength;
  961|  46.6k|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
  962|  46.6k|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
  963|  46.6k|    const BYTE* match = oLitEnd - sequence.offset;
  964|       |
  965|       |
  966|       |    /* bounds checks : careful of address space overflow in 32-bit mode */
  967|  46.6k|    RETURN_ERROR_IF(sequenceLength > (size_t)(oend - op), dstSize_tooSmall, "last match must fit within dstBuffer");
  ------------------
  |  |  114|  46.6k|    do {                                                                       \
  |  |  115|  46.6k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 130, False: 46.4k]
  |  |  ------------------
  |  |  116|    130|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|    130|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 130]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|    130|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|    130|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|    130|    do {                                           \
  |  |  |  |   99|    130|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 130]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|    130|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 130]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|    130|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|    130|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 130]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    130|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|    130|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 130]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|    130|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|    130|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|    130|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|    130|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|    130|        }                                                                      \
  |  |  123|  46.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 46.4k]
  |  |  ------------------
  ------------------
  968|  46.4k|    RETURN_ERROR_IF(sequence.litLength > (size_t)(litLimit - *litPtr), corruption_detected, "try to read beyond literal buffer");
  ------------------
  |  |  114|  46.4k|    do {                                                                       \
  |  |  115|  46.4k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 46.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|  46.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 46.4k]
  |  |  ------------------
  ------------------
  969|  46.4k|    assert(op < op + sequenceLength);
  ------------------
  |  |   70|  46.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  970|  46.4k|    assert(oLitEnd < op + sequenceLength);
  ------------------
  |  |   70|  46.4k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  971|       |
  972|       |    /* copy literals */
  973|  46.4k|    RETURN_ERROR_IF(op > *litPtr && op < *litPtr + sequence.litLength, dstSize_tooSmall, "output should not catch up to and overwrite literal buffer");
  ------------------
  |  |  114|  46.4k|    do {                                                                       \
  |  |  115|   138k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 45.1k, False: 1.30k]
  |  |  |  Branch (115:13): [True: 27, False: 45.1k]
  |  |  ------------------
  |  |  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|  46.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 46.4k]
  |  |  ------------------
  ------------------
  974|  46.4k|    ZSTD_safecopyDstBeforeSrc(op, *litPtr, sequence.litLength);
  975|  46.4k|    op = oLitEnd;
  976|  46.4k|    *litPtr = iLitEnd;
  977|       |
  978|       |    /* copy Match */
  979|  46.4k|    if (sequence.offset > (size_t)(oLitEnd - prefixStart)) {
  ------------------
  |  Branch (979:9): [True: 85, False: 46.3k]
  ------------------
  980|       |        /* offset beyond prefix */
  981|     85|        RETURN_ERROR_IF(sequence.offset > (size_t)(oLitEnd - virtualStart), corruption_detected, "");
  ------------------
  |  |  114|     85|    do {                                                                       \
  |  |  115|     85|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 54, False: 31]
  |  |  ------------------
  |  |  116|     54|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     54|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 54]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     54|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     54|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|     54|    do {                                           \
  |  |  |  |   99|     54|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 54]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|     54|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 54]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     54|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     54|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 54]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     54|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     54|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 54]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     54|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|     54|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|     54|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|     54|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     54|        }                                                                      \
  |  |  123|     85|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 31]
  |  |  ------------------
  ------------------
  982|     31|        match = dictEnd - (prefixStart - match);
  983|     31|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (983:13): [True: 20, False: 11]
  ------------------
  984|     20|            ZSTD_memmove(oLitEnd, match, sequence.matchLength);
  ------------------
  |  |   45|     20|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  985|     20|            return sequenceLength;
  986|     20|        }
  987|       |        /* span extDict & currentPrefixSegment */
  988|     11|        {   size_t const length1 = dictEnd - match;
  989|     11|        ZSTD_memmove(oLitEnd, match, length1);
  ------------------
  |  |   45|     11|# define ZSTD_memmove(d,s,l) __builtin_memmove((d),(s),(l))
  ------------------
  990|     11|        op = oLitEnd + length1;
  991|     11|        sequence.matchLength -= length1;
  992|     11|        match = prefixStart;
  993|     11|        }
  994|     11|    }
  995|  46.3k|    ZSTD_safecopy(op, oend_w, match, sequence.matchLength, ZSTD_overlap_src_before_dst);
  996|  46.3k|    return sequenceLength;
  997|  46.4k|}
zstd_decompress_block.c:ZSTD_decompressSequencesSplitLitBuffer:
 1956|    562|{
 1957|    562|    DEBUGLOG(5, "ZSTD_decompressSequencesSplitLitBuffer");
  ------------------
  |  |  104|    562|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 562]
  |  |  ------------------
  ------------------
 1958|    562|#if DYNAMIC_BMI2
 1959|    562|    if (ZSTD_DCtx_get_bmi2(dctx)) {
  ------------------
  |  Branch (1959:9): [True: 562, False: 0]
  ------------------
 1960|    562|        return ZSTD_decompressSequencesSplitLitBuffer_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1961|    562|    }
 1962|      0|#endif
 1963|      0|    return ZSTD_decompressSequencesSplitLitBuffer_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1964|    562|}
zstd_decompress_block.c:ZSTD_decompressSequencesSplitLitBuffer_bmi2:
 1920|    562|{
 1921|    562|    return ZSTD_decompressSequences_bodySplitLitBuffer(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1922|    562|}
zstd_decompress_block.c:ZSTD_decompressSequences_bodySplitLitBuffer:
 1407|    562|{
 1408|    562|    const BYTE* ip = (const BYTE*)seqStart;
 1409|    562|    const BYTE* const iend = ip + seqSize;
 1410|    562|    BYTE* const ostart = (BYTE*)dst;
 1411|    562|    BYTE* const oend = ZSTD_maybeNullPtrAdd(ostart, maxDstSize);
 1412|    562|    BYTE* op = ostart;
 1413|    562|    const BYTE* litPtr = dctx->litPtr;
 1414|    562|    const BYTE* litBufferEnd = dctx->litBufferEnd;
 1415|    562|    const BYTE* const prefixStart = (const BYTE*) (dctx->prefixStart);
 1416|    562|    const BYTE* const vBase = (const BYTE*) (dctx->virtualStart);
 1417|    562|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 1418|    562|    DEBUGLOG(5, "ZSTD_decompressSequences_bodySplitLitBuffer (%i seqs)", nbSeq);
  ------------------
  |  |  104|    562|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 562]
  |  |  ------------------
  ------------------
 1419|       |
 1420|       |    /* Literals are split between internal buffer & output buffer */
 1421|    562|    if (nbSeq) {
  ------------------
  |  Branch (1421:9): [True: 562, False: 0]
  ------------------
 1422|    562|        seqState_t seqState;
 1423|    562|        dctx->fseEntropy = 1;
 1424|  2.24k|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  2.24k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1424:28): [True: 1.68k, False: 562]
  ------------------
 1425|    562|        RETURN_ERROR_IF(
  ------------------
  |  |  114|    562|    do {                                                                       \
  |  |  115|    562|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 47, False: 515]
  |  |  ------------------
  |  |  116|     47|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|     47|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 47]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|     47|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|     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]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|     47|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|     47|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 47]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|     47|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|     47|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 47]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|     47|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   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
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|     47|        }                                                                      \
  |  |  123|    562|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 515]
  |  |  ------------------
  ------------------
 1426|    562|            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend-ip)),
 1427|    562|            corruption_detected, "");
 1428|    515|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1429|    515|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1430|    515|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1431|    515|        assert(dst != NULL);
  ------------------
  |  |   70|    515|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1432|       |
 1433|    515|        ZSTD_STATIC_ASSERT(
  ------------------
  |  |   43|    515|#define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
  |  |  ------------------
  |  |  |  |   39|    515|#define DEBUG_STATIC_ASSERT(c) (void)sizeof(char[(c) ? 1 : -1])
  |  |  ------------------
  ------------------
 1434|    515|                BIT_DStream_unfinished < BIT_DStream_completed &&
 1435|    515|                BIT_DStream_endOfBuffer < BIT_DStream_completed &&
 1436|    515|                BIT_DStream_completed < BIT_DStream_overflow);
 1437|       |
 1438|       |        /* decompress without overrunning litPtr begins */
 1439|    515|        {   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|    515|#if defined(__GNUC__) && defined(__x86_64__)
 1485|    515|            __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|    515|#endif
 1499|       |
 1500|       |            /* Handle the initial state where litBuffer is currently split between dst and litExtraBuffer */
 1501|  2.61M|            for ( ; nbSeq; nbSeq--) {
  ------------------
  |  Branch (1501:21): [True: 2.61M, False: 1]
  ------------------
 1502|  2.61M|                sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1503|  2.61M|                if (litPtr + sequence.litLength > dctx->litBufferEnd) break;
  ------------------
  |  Branch (1503:21): [True: 319, False: 2.61M]
  ------------------
 1504|  2.61M|                {   size_t const oneSeqSize = ZSTD_execSequenceSplitLitBuffer(op, oend, litPtr + sequence.litLength - WILDCOPY_OVERLENGTH, sequence, &litPtr, litBufferEnd, prefixStart, vBase, dictEnd);
  ------------------
  |  |  199|  2.61M|#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.61M|                    if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|  2.61M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 195, False: 2.61M]
  |  |  ------------------
  ------------------
 1510|    195|                        return oneSeqSize;
 1511|  2.61M|                    DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|  2.61M|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 2.61M]
  |  |  ------------------
  ------------------
 1512|  2.61M|                    op += oneSeqSize;
 1513|  2.61M|            }   }
 1514|    320|            DEBUGLOG(6, "reached: (litPtr + sequence.litLength > dctx->litBufferEnd)");
  ------------------
  |  |  104|    320|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 320]
  |  |  ------------------
  ------------------
 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|    320|            if (nbSeq > 0) {
  ------------------
  |  Branch (1517:17): [True: 319, False: 1]
  ------------------
 1518|    319|                const size_t leftoverLit = dctx->litBufferEnd - litPtr;
 1519|    319|                DEBUGLOG(6, "There are %i sequences left, and %zu/%zu literals left in buffer", nbSeq, leftoverLit, sequence.litLength);
  ------------------
  |  |  104|    319|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 319]
  |  |  ------------------
  ------------------
 1520|    319|                if (leftoverLit) {
  ------------------
  |  Branch (1520:21): [True: 284, False: 35]
  ------------------
 1521|    284|                    RETURN_ERROR_IF(leftoverLit > (size_t)(oend - op), dstSize_tooSmall, "remaining lit must fit within dstBuffer");
  ------------------
  |  |  114|    284|    do {                                                                       \
  |  |  115|    284|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 8, False: 276]
  |  |  ------------------
  |  |  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|    284|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 276]
  |  |  ------------------
  ------------------
 1522|    276|                    ZSTD_safecopyDstBeforeSrc(op, litPtr, leftoverLit);
 1523|    276|                    sequence.litLength -= leftoverLit;
 1524|    276|                    op += leftoverLit;
 1525|    276|                }
 1526|    311|                litPtr = dctx->litExtraBuffer;
 1527|    311|                litBufferEnd = dctx->litExtraBuffer + ZSTD_LITBUFFEREXTRASIZE;
  ------------------
  |  |  118|    311|#define ZSTD_LITBUFFEREXTRASIZE  BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
  |  |  ------------------
  |  |  |  |   56|    311|#define BOUNDED(min,val,max) (MAX(min,MIN(val,max)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|    622|#define MAX(a,b) ((a)>(b) ? (a) : (b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (55:19): [Folded, False: 311]
  |  |  |  |  |  |  |  Branch (55:24): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (55:36): [True: 311, Folded]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1528|    311|                dctx->litBufferLocation = ZSTD_not_in_dst;
 1529|    311|                {   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|    311|                    if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|    311|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 64, False: 247]
  |  |  ------------------
  ------------------
 1535|     64|                        return oneSeqSize;
 1536|    247|                    DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|    247|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 247]
  |  |  ------------------
  ------------------
 1537|    247|                    op += oneSeqSize;
 1538|    247|                }
 1539|      0|                nbSeq--;
 1540|    247|            }
 1541|    320|        }
 1542|       |
 1543|    248|        if (nbSeq > 0) {
  ------------------
  |  Branch (1543:13): [True: 245, False: 3]
  ------------------
 1544|       |            /* there is remaining lit from extra buffer */
 1545|       |
 1546|    245|#if defined(__GNUC__) && defined(__x86_64__)
 1547|    245|            __asm__(".p2align 6");
 1548|    245|            __asm__("nop");
 1549|    245|#  if __GNUC__ != 7
 1550|       |            /* worse for gcc-7 better for gcc-8, gcc-9, and gcc-10 and clang */
 1551|    245|            __asm__(".p2align 4");
 1552|    245|            __asm__("nop");
 1553|    245|            __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|    245|#endif
 1562|       |
 1563|   196k|            for ( ; nbSeq ; nbSeq--) {
  ------------------
  |  Branch (1563:21): [True: 196k, False: 3]
  ------------------
 1564|   196k|                seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1565|   196k|                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|   196k|                if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|   196k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 242, False: 196k]
  |  |  ------------------
  ------------------
 1571|    242|                    return oneSeqSize;
 1572|   196k|                DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|   196k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 196k]
  |  |  ------------------
  ------------------
 1573|   196k|                op += oneSeqSize;
 1574|   196k|            }
 1575|    245|        }
 1576|       |
 1577|       |        /* check if reached exact end */
 1578|      6|        DEBUGLOG(5, "ZSTD_decompressSequences_bodySplitLitBuffer: after decode loop, remaining nbSeq : %i", nbSeq);
  ------------------
  |  |  104|      6|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 6]
  |  |  ------------------
  ------------------
 1579|      6|        RETURN_ERROR_IF(nbSeq, corruption_detected, "");
  ------------------
  |  |  114|      6|    do {                                                                       \
  |  |  115|      6|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 0, False: 6]
  |  |  ------------------
  |  |  116|      0|            RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s",          \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  117|      0|                  __FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
  |  |  118|      0|            _FORCE_HAS_FORMAT_STRING(__VA_ARGS__);                             \
  |  |  ------------------
  |  |  |  |   98|      0|    do {                                           \
  |  |  |  |   99|      0|        if (0) {                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|            _force_has_format_string(__VA_ARGS__); \
  |  |  |  |  101|      0|        }                                          \
  |  |  |  |  102|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  119|      0|            RAWLOG(3, ": " __VA_ARGS__);                                       \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|      0|            RAWLOG(3, "\n");                                                   \
  |  |  ------------------
  |  |  |  |  103|      0|#  define RAWLOG(l, ...)   do { } while (0)    /* disabled */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:42): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  121|      0|            return ERROR(err);                                                 \
  |  |  ------------------
  |  |  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  |  |  ------------------
  |  |  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  122|      0|        }                                                                      \
  |  |  123|      6|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 6]
  |  |  ------------------
  ------------------
 1580|      6|        DEBUGLOG(5, "bitStream : start=%p, ptr=%p, bitsConsumed=%u", seqState.DStream.start, seqState.DStream.ptr, seqState.DStream.bitsConsumed);
  ------------------
  |  |  104|      6|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 6]
  |  |  ------------------
  ------------------
 1581|      6|        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, "");
  ------------------
  |  |  114|      6|    do {                                                                       \
  |  |  115|      6|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 6, False: 0]
  |  |  ------------------
  |  |  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|      6|    } 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|  5.81k|{
 1944|  5.81k|    DEBUGLOG(5, "ZSTD_decompressSequences");
  ------------------
  |  |  104|  5.81k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 5.81k]
  |  |  ------------------
  ------------------
 1945|  5.81k|#if DYNAMIC_BMI2
 1946|  5.81k|    if (ZSTD_DCtx_get_bmi2(dctx)) {
  ------------------
  |  Branch (1946:9): [True: 5.81k, False: 0]
  ------------------
 1947|  5.81k|        return ZSTD_decompressSequences_bmi2(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1948|  5.81k|    }
 1949|      0|#endif
 1950|      0|    return ZSTD_decompressSequences_default(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1951|  5.81k|}
zstd_decompress_block.c:ZSTD_decompressSequences_bmi2:
 1911|  5.81k|{
 1912|  5.81k|    return ZSTD_decompressSequences_body(dctx, dst, maxDstSize, seqStart, seqSize, nbSeq, isLongOffset);
 1913|  5.81k|}
zstd_decompress_block.c:ZSTD_decompressSequences_body:
 1619|  5.81k|{
 1620|  5.81k|    const BYTE* ip = (const BYTE*)seqStart;
 1621|  5.81k|    const BYTE* const iend = ip + seqSize;
 1622|  5.81k|    BYTE* const ostart = (BYTE*)dst;
 1623|  5.81k|    BYTE* const oend = dctx->litBufferLocation == ZSTD_not_in_dst ? ZSTD_maybeNullPtrAdd(ostart, maxDstSize) : dctx->litBuffer;
  ------------------
  |  Branch (1623:24): [True: 3.24k, False: 2.57k]
  ------------------
 1624|  5.81k|    BYTE* op = ostart;
 1625|  5.81k|    const BYTE* litPtr = dctx->litPtr;
 1626|  5.81k|    const BYTE* const litEnd = litPtr + dctx->litSize;
 1627|  5.81k|    const BYTE* const prefixStart = (const BYTE*)(dctx->prefixStart);
 1628|  5.81k|    const BYTE* const vBase = (const BYTE*)(dctx->virtualStart);
 1629|  5.81k|    const BYTE* const dictEnd = (const BYTE*)(dctx->dictEnd);
 1630|  5.81k|    DEBUGLOG(5, "ZSTD_decompressSequences_body: nbSeq = %d", nbSeq);
  ------------------
  |  |  104|  5.81k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 5.81k]
  |  |  ------------------
  ------------------
 1631|       |
 1632|       |    /* Regen sequences */
 1633|  5.81k|    if (nbSeq) {
  ------------------
  |  Branch (1633:9): [True: 2.13k, False: 3.68k]
  ------------------
 1634|  2.13k|        seqState_t seqState;
 1635|  2.13k|        dctx->fseEntropy = 1;
 1636|  8.52k|        { U32 i; for (i = 0; i < ZSTD_REP_NUM; i++) seqState.prevOffset[i] = dctx->entropy.rep[i]; }
  ------------------
  |  |   64|  8.52k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1636:30): [True: 6.39k, False: 2.13k]
  ------------------
 1637|  2.13k|        RETURN_ERROR_IF(
  ------------------
  |  |  114|  2.13k|    do {                                                                       \
  |  |  115|  2.13k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 6, False: 2.12k]
  |  |  ------------------
  |  |  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|  2.13k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 2.12k]
  |  |  ------------------
  ------------------
 1638|  2.13k|            ERR_isError(BIT_initDStream(&seqState.DStream, ip, iend - ip)),
 1639|  2.13k|            corruption_detected, "");
 1640|  2.12k|        ZSTD_initFseState(&seqState.stateLL, &seqState.DStream, dctx->LLTptr);
 1641|  2.12k|        ZSTD_initFseState(&seqState.stateOffb, &seqState.DStream, dctx->OFTptr);
 1642|  2.12k|        ZSTD_initFseState(&seqState.stateML, &seqState.DStream, dctx->MLTptr);
 1643|  2.12k|        assert(dst != NULL);
  ------------------
  |  |   70|  2.12k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1644|       |
 1645|  2.12k|#if defined(__GNUC__) && defined(__x86_64__)
 1646|  2.12k|            __asm__(".p2align 6");
 1647|  2.12k|            __asm__("nop");
 1648|       |#  if __GNUC__ >= 7
 1649|       |            __asm__(".p2align 5");
 1650|       |            __asm__("nop");
 1651|       |            __asm__(".p2align 3");
 1652|       |#  else
 1653|  2.12k|            __asm__(".p2align 4");
 1654|  2.12k|            __asm__("nop");
 1655|  2.12k|            __asm__(".p2align 3");
 1656|  2.12k|#  endif
 1657|  2.12k|#endif
 1658|       |
 1659|   163k|        for ( ; nbSeq ; nbSeq--) {
  ------------------
  |  Branch (1659:17): [True: 161k, False: 1.99k]
  ------------------
 1660|   161k|            seq_t const sequence = ZSTD_decodeSequence(&seqState, isLongOffset, nbSeq==1);
 1661|   161k|            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|   161k|            if (UNLIKELY(ZSTD_isError(oneSeqSize)))
  ------------------
  |  |  188|   161k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 125, False: 160k]
  |  |  ------------------
  ------------------
 1667|    125|                return oneSeqSize;
 1668|   160k|            DEBUGLOG(6, "regenerated sequence size : %u", (U32)oneSeqSize);
  ------------------
  |  |  104|   160k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 160k]
  |  |  ------------------
  ------------------
 1669|   160k|            op += oneSeqSize;
 1670|   160k|        }
 1671|       |
 1672|       |        /* check if reached exact end */
 1673|  1.99k|        assert(nbSeq == 0);
  ------------------
  |  |   70|  1.99k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 1674|  1.99k|        RETURN_ERROR_IF(!BIT_endOfDStream(&seqState.DStream), corruption_detected, "");
  ------------------
  |  |  114|  1.99k|    do {                                                                       \
  |  |  115|  1.99k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 19, False: 1.98k]
  |  |  ------------------
  |  |  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|  1.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 1.98k]
  |  |  ------------------
  ------------------
 1675|       |        /* save reps for next block */
 1676|  7.92k|        { U32 i; for (i=0; i<ZSTD_REP_NUM; i++) dctx->entropy.rep[i] = (U32)(seqState.prevOffset[i]); }
  ------------------
  |  |   64|  7.92k|#define ZSTD_REP_NUM      3                 /* number of repcodes */
  ------------------
  |  Branch (1676:28): [True: 5.94k, False: 1.98k]
  ------------------
 1677|  1.98k|    }
 1678|       |
 1679|       |    /* last literal segment */
 1680|  5.66k|    {   size_t const lastLLSize = (size_t)(litEnd - litPtr);
 1681|  5.66k|        DEBUGLOG(6, "copy last literals : %u", (U32)lastLLSize);
  ------------------
  |  |  104|  5.66k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 5.66k]
  |  |  ------------------
  ------------------
 1682|  5.66k|        RETURN_ERROR_IF(lastLLSize > (size_t)(oend-op), dstSize_tooSmall, "");
  ------------------
  |  |  114|  5.66k|    do {                                                                       \
  |  |  115|  5.66k|        if (cond) {                                                            \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 4, False: 5.65k]
  |  |  ------------------
  |  |  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|  5.66k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (123:14): [Folded, False: 5.65k]
  |  |  ------------------
  ------------------
 1683|  5.65k|        if (op != NULL) {
  ------------------
  |  Branch (1683:13): [True: 5.65k, False: 0]
  ------------------
 1684|  5.65k|            ZSTD_memcpy(op, litPtr, lastLLSize);
  ------------------
  |  |   44|  5.65k|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
 1685|  5.65k|            op += lastLLSize;
 1686|  5.65k|    }   }
 1687|       |
 1688|  5.65k|    DEBUGLOG(6, "decoded block of size %u bytes", (U32)(op - ostart));
  ------------------
  |  |  104|  5.65k|#  define DEBUGLOG(l, ...) do { } while (0)    /* disabled */
  |  |  ------------------
  |  |  |  Branch (104:42): [Folded, False: 5.65k]
  |  |  ------------------
  ------------------
 1689|  5.65k|    return (size_t)(op - ostart);
 1690|  5.66k|}

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

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

FSEv05_buildDTable:
 1158|     62|{
 1159|     62|    FSEv05_DTableHeader DTableH;
 1160|     62|    void* const tdPtr = dt+1;   /* because dt is unsigned, 32-bits aligned on 32-bits */
 1161|     62|    FSEv05_DECODE_TYPE* const tableDecode = (FSEv05_DECODE_TYPE*) (tdPtr);
  ------------------
  |  | 1056|     62|#define FSEv05_DECODE_TYPE FSEv05_decode_t
  ------------------
 1162|     62|    const U32 tableSize = 1 << tableLog;
 1163|     62|    const U32 tableMask = tableSize-1;
 1164|     62|    const U32 step = FSEv05_tableStep(tableSize);
 1165|     62|    U16 symbolNext[FSEv05_MAX_SYMBOL_VALUE+1];
 1166|     62|    U32 position = 0;
 1167|     62|    U32 highThreshold = tableSize-1;
 1168|     62|    const S16 largeLimit= (S16)(1 << (tableLog-1));
 1169|     62|    U32 noLarge = 1;
 1170|     62|    U32 s;
 1171|       |
 1172|       |    /* Sanity Checks */
 1173|     62|    if (maxSymbolValue > FSEv05_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  | 1048|     62|#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: 62]
  ------------------
 1174|     62|    if (tableLog > FSEv05_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1094|     62|#define FSEv05_MAX_TABLELOG  (FSEv05_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1042|     62|#define FSEv05_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
                  if (tableLog > FSEv05_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1174:9): [True: 1, False: 61]
  ------------------
 1175|       |
 1176|       |    /* Init, lay down lowprob symbols */
 1177|     61|    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|     61|    DTableH.tableLog = (U16)tableLog;
 1179|    871|    for (s=0; s<=maxSymbolValue; s++) {
  ------------------
  |  Branch (1179:15): [True: 810, False: 61]
  ------------------
 1180|    810|        if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (1180:13): [True: 521, False: 289]
  ------------------
 1181|    521|            tableDecode[highThreshold--].symbol = (FSEv05_FUNCTION_TYPE)s;
 1182|    521|            symbolNext[s] = 1;
 1183|    521|        } else {
 1184|    289|            if (normalizedCounter[s] >= largeLimit) noLarge=0;
  ------------------
  |  Branch (1184:17): [True: 21, False: 268]
  ------------------
 1185|    289|            symbolNext[s] = normalizedCounter[s];
 1186|    289|    }   }
 1187|       |
 1188|       |    /* Spread symbols */
 1189|    871|    for (s=0; s<=maxSymbolValue; s++) {
  ------------------
  |  Branch (1189:15): [True: 810, False: 61]
  ------------------
 1190|    810|        int i;
 1191|  4.32k|        for (i=0; i<normalizedCounter[s]; i++) {
  ------------------
  |  Branch (1191:19): [True: 3.51k, False: 810]
  ------------------
 1192|  3.51k|            tableDecode[position].symbol = (FSEv05_FUNCTION_TYPE)s;
 1193|  3.51k|            position = (position + step) & tableMask;
 1194|  3.87k|            while (position > highThreshold) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  Branch (1194:20): [True: 361, False: 3.51k]
  ------------------
 1195|  3.51k|    }   }
 1196|       |
 1197|     61|    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: 61]
  ------------------
 1198|       |
 1199|       |    /* Build Decoding table */
 1200|     61|    {
 1201|     61|        U32 i;
 1202|  4.09k|        for (i=0; i<tableSize; i++) {
  ------------------
  |  Branch (1202:19): [True: 4.03k, False: 61]
  ------------------
 1203|  4.03k|            FSEv05_FUNCTION_TYPE symbol = (FSEv05_FUNCTION_TYPE)(tableDecode[i].symbol);
  ------------------
  |  | 1054|  4.03k|#define FSEv05_FUNCTION_TYPE BYTE
  ------------------
 1204|  4.03k|            U16 nextState = symbolNext[symbol]++;
 1205|  4.03k|            tableDecode[i].nbBits = (BYTE) (tableLog - BITv05_highbit32 ((U32)nextState) );
 1206|  4.03k|            tableDecode[i].newState = (U16) ( (nextState << tableDecode[i].nbBits) - tableSize);
 1207|  4.03k|    }   }
 1208|       |
 1209|     61|    DTableH.fastMode = (U16)noLarge;
 1210|     61|    memcpy(dt, &DTableH, sizeof(DTableH));
 1211|     61|    return 0;
 1212|     61|}
FSEv05_isError:
 1219|     77|unsigned FSEv05_isError(size_t code) { return ERR_isError(code); }
FSEv05_readNCount:
 1232|     64|{
 1233|     64|    const BYTE* const istart = (const BYTE*) headerBuffer;
 1234|     64|    const BYTE* const iend = istart + hbSize;
 1235|     64|    const BYTE* ip = istart;
 1236|     64|    int nbBits;
 1237|     64|    int remaining;
 1238|     64|    int threshold;
 1239|     64|    U32 bitStream;
 1240|     64|    int bitCount;
 1241|     64|    unsigned charnum = 0;
 1242|     64|    int previous0 = 0;
 1243|       |
 1244|     64|    if (hbSize < 4) 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 (1244:9): [True: 0, False: 64]
  ------------------
 1245|     64|    bitStream = MEM_readLE32(ip);
 1246|     64|    nbBits = (bitStream & 0xF) + FSEv05_MIN_TABLELOG;   /* extract tableLog */
  ------------------
  |  | 1098|     64|#define FSEv05_MIN_TABLELOG 5
  ------------------
 1247|     64|    if (nbBits > FSEv05_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1100|     64|#define FSEv05_TABLELOG_ABSOLUTE_MAX 15
  ------------------
                  if (nbBits > FSEv05_TABLELOG_ABSOLUTE_MAX) 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 (1247:9): [True: 2, False: 62]
  ------------------
 1248|     62|    bitStream >>= 4;
 1249|     62|    bitCount = 4;
 1250|     62|    *tableLogPtr = nbBits;
 1251|     62|    remaining = (1<<nbBits)+1;
 1252|     62|    threshold = 1<<nbBits;
 1253|     62|    nbBits++;
 1254|       |
 1255|    847|    while ((remaining>1) && (charnum<=*maxSVPtr)) {
  ------------------
  |  Branch (1255:12): [True: 785, False: 62]
  |  Branch (1255:29): [True: 785, False: 0]
  ------------------
 1256|    785|        if (previous0) {
  ------------------
  |  Branch (1256:13): [True: 47, False: 738]
  ------------------
 1257|     47|            unsigned n0 = charnum;
 1258|     47|            while ((bitStream & 0xFFFF) == 0xFFFF) {
  ------------------
  |  Branch (1258:20): [True: 0, False: 47]
  ------------------
 1259|      0|                n0+=24;
 1260|      0|                if (ip < iend-5) {
  ------------------
  |  Branch (1260:21): [True: 0, False: 0]
  ------------------
 1261|      0|                    ip+=2;
 1262|      0|                    bitStream = MEM_readLE32(ip) >> bitCount;
 1263|      0|                } else {
 1264|      0|                    bitStream >>= 16;
 1265|      0|                    bitCount+=16;
 1266|      0|            }   }
 1267|     54|            while ((bitStream & 3) == 3) {
  ------------------
  |  Branch (1267:20): [True: 7, False: 47]
  ------------------
 1268|      7|                n0+=3;
 1269|      7|                bitStream>>=2;
 1270|      7|                bitCount+=2;
 1271|      7|            }
 1272|     47|            n0 += bitStream & 3;
 1273|     47|            bitCount += 2;
 1274|     47|            if (n0 > *maxSVPtr) 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 (1274:17): [True: 0, False: 47]
  ------------------
 1275|     94|            while (charnum < n0) normalizedCounter[charnum++] = 0;
  ------------------
  |  Branch (1275:20): [True: 47, False: 47]
  ------------------
 1276|     47|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1276:17): [True: 46, False: 1]
  |  Branch (1276:35): [True: 1, False: 0]
  ------------------
 1277|     47|                ip += bitCount>>3;
 1278|     47|                bitCount &= 7;
 1279|     47|                bitStream = MEM_readLE32(ip) >> bitCount;
 1280|     47|            }
 1281|      0|            else
 1282|      0|                bitStream >>= 2;
 1283|     47|        }
 1284|    785|        {
 1285|    785|            const short max = (short)((2*threshold-1)-remaining);
 1286|    785|            short count;
 1287|       |
 1288|    785|            if ((bitStream & (threshold-1)) < (U32)max) {
  ------------------
  |  Branch (1288:17): [True: 584, False: 201]
  ------------------
 1289|    584|                count = (short)(bitStream & (threshold-1));
 1290|    584|                bitCount   += nbBits-1;
 1291|    584|            } else {
 1292|    201|                count = (short)(bitStream & (2*threshold-1));
 1293|    201|                if (count >= threshold) count -= max;
  ------------------
  |  Branch (1293:21): [True: 69, False: 132]
  ------------------
 1294|    201|                bitCount   += nbBits;
 1295|    201|            }
 1296|       |
 1297|    785|            count--;   /* extra accuracy */
 1298|    785|            remaining -= FSEv05_abs(count);
 1299|    785|            normalizedCounter[charnum++] = count;
 1300|    785|            previous0 = !count;
 1301|  1.13k|            while (remaining < threshold) {
  ------------------
  |  Branch (1301:20): [True: 352, False: 785]
  ------------------
 1302|    352|                nbBits--;
 1303|    352|                threshold >>= 1;
 1304|    352|            }
 1305|       |
 1306|    785|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1306:17): [True: 766, False: 19]
  |  Branch (1306:35): [True: 19, False: 0]
  ------------------
 1307|    785|                ip += bitCount>>3;
 1308|    785|                bitCount &= 7;
 1309|    785|            } else {
 1310|      0|                bitCount -= (int)(8 * (iend - 4 - ip));
 1311|      0|                ip = iend - 4;
 1312|      0|            }
 1313|    785|            bitStream = MEM_readLE32(ip) >> (bitCount & 31);
 1314|    785|    }   }
 1315|     62|    if (remaining != 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 (1315:9): [True: 0, False: 62]
  ------------------
 1316|     62|    *maxSVPtr = charnum-1;
 1317|       |
 1318|     62|    ip += (bitCount+7)>>3;
 1319|     62|    if ((size_t)(ip-istart) > hbSize) 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 (1319:9): [True: 0, False: 62]
  ------------------
 1320|     62|    return ip-istart;
 1321|     62|}
FSEv05_buildDTable_rle:
 1329|     56|{
 1330|     56|    void* ptr = dt;
 1331|     56|    FSEv05_DTableHeader* const DTableH = (FSEv05_DTableHeader*)ptr;
 1332|     56|    void* dPtr = dt + 1;
 1333|     56|    FSEv05_decode_t* const cell = (FSEv05_decode_t*)dPtr;
 1334|       |
 1335|     56|    DTableH->tableLog = 0;
 1336|     56|    DTableH->fastMode = 0;
 1337|       |
 1338|     56|    cell->newState = 0;
 1339|     56|    cell->symbol = symbolValue;
 1340|     56|    cell->nbBits = 0;
 1341|       |
 1342|     56|    return 0;
 1343|     56|}
FSEv05_buildDTable_raw:
 1347|     69|{
 1348|     69|    void* ptr = dt;
 1349|     69|    FSEv05_DTableHeader* const DTableH = (FSEv05_DTableHeader*)ptr;
 1350|     69|    void* dPtr = dt + 1;
 1351|     69|    FSEv05_decode_t* const dinfo = (FSEv05_decode_t*)dPtr;
 1352|     69|    const unsigned tableSize = 1 << nbBits;
 1353|     69|    const unsigned tableMask = tableSize - 1;
 1354|     69|    const unsigned maxSymbolValue = tableMask;
 1355|     69|    unsigned s;
 1356|       |
 1357|       |    /* Sanity checks */
 1358|     69|    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: 69]
  ------------------
 1359|       |
 1360|       |    /* Build Decoding Table */
 1361|     69|    DTableH->tableLog = (U16)nbBits;
 1362|     69|    DTableH->fastMode = 1;
 1363|  5.50k|    for (s=0; s<=maxSymbolValue; s++) {
  ------------------
  |  Branch (1363:15): [True: 5.44k, False: 69]
  ------------------
 1364|  5.44k|        dinfo[s].newState = 0;
 1365|  5.44k|        dinfo[s].symbol = (BYTE)s;
 1366|  5.44k|        dinfo[s].nbBits = (BYTE)nbBits;
 1367|  5.44k|    }
 1368|       |
 1369|     69|    return 0;
 1370|     69|}
FSEv05_decompress_usingDTable:
 1443|      2|{
 1444|      2|    const void* ptr = dt;
 1445|      2|    const FSEv05_DTableHeader* DTableH = (const FSEv05_DTableHeader*)ptr;
 1446|      2|    const U32 fastMode = DTableH->fastMode;
 1447|       |
 1448|       |    /* select fast mode (static) */
 1449|      2|    if (fastMode) return FSEv05_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 1);
  ------------------
  |  Branch (1449:9): [True: 1, False: 1]
  ------------------
 1450|      1|    return FSEv05_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 0);
 1451|      2|}
FSEv05_decompress:
 1455|      8|{
 1456|      8|    const BYTE* const istart = (const BYTE*)cSrc;
 1457|      8|    const BYTE* ip = istart;
 1458|      8|    short counting[FSEv05_MAX_SYMBOL_VALUE+1];
 1459|      8|    DTable_max_t dt;   /* Static analyzer seems unable to understand this table will be properly initialized later */
 1460|      8|    unsigned tableLog;
 1461|      8|    unsigned maxSymbolValue = FSEv05_MAX_SYMBOL_VALUE;
  ------------------
  |  | 1048|      8|#define FSEv05_MAX_SYMBOL_VALUE 255
  ------------------
 1462|      8|    size_t errorCode;
 1463|       |
 1464|      8|    if (cSrcSize<2) return ERROR(srcSize_wrong);   /* too small input size */
  ------------------
  |  |   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 (1464:9): [True: 3, False: 5]
  ------------------
 1465|       |
 1466|       |    /* normal FSEv05 decoding mode */
 1467|      5|    errorCode = FSEv05_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize);
 1468|      5|    if (FSEv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1468:9): [True: 2, False: 3]
  ------------------
 1469|      3|    if (errorCode >= cSrcSize) return ERROR(srcSize_wrong);   /* too small input 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 (1469:9): [True: 0, False: 3]
  ------------------
 1470|      3|    ip += errorCode;
 1471|      3|    cSrcSize -= errorCode;
 1472|       |
 1473|      3|    errorCode = FSEv05_buildDTable (dt, counting, maxSymbolValue, tableLog);
 1474|      3|    if (FSEv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1474:9): [True: 1, False: 2]
  ------------------
 1475|       |
 1476|       |    /* always return, even if it is an error code */
 1477|      2|    return FSEv05_decompress_usingDTable (dst, maxDstSize, ip, cSrcSize, dt);
 1478|      3|}
HUFv05_isError:
 1723|     58|unsigned HUFv05_isError(size_t code) { return ERR_isError(code); }
HUFv05_readDTableX2:
 1818|     12|{
 1819|     12|    BYTE huffWeight[HUFv05_MAX_SYMBOL_VALUE + 1];
 1820|     12|    U32 rankVal[HUFv05_ABSOLUTEMAX_TABLELOG + 1];   /* large enough for values from 0 to 16 */
 1821|     12|    U32 tableLog = 0;
 1822|     12|    size_t iSize;
 1823|     12|    U32 nbSymbols = 0;
 1824|     12|    U32 n;
 1825|     12|    U32 nextRankStart;
 1826|     12|    void* const dtPtr = DTable + 1;
 1827|     12|    HUFv05_DEltX2* const dt = (HUFv05_DEltX2*)dtPtr;
 1828|       |
 1829|     12|    HUFv05_STATIC_ASSERT(sizeof(HUFv05_DEltX2) == sizeof(U16));   /* if compilation fails here, assertion is false */
  ------------------
  |  | 1725|     12|#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|     12|    iSize = HUFv05_readStats(huffWeight, HUFv05_MAX_SYMBOL_VALUE + 1, rankVal, &nbSymbols, &tableLog, src, srcSize);
  ------------------
  |  | 1714|     12|#define HUFv05_MAX_SYMBOL_VALUE 255
  ------------------
 1833|     12|    if (HUFv05_isError(iSize)) return iSize;
  ------------------
  |  Branch (1833:9): [True: 8, False: 4]
  ------------------
 1834|       |
 1835|       |    /* check result */
 1836|      4|    if (tableLog > DTable[0]) return ERROR(tableLog_tooLarge);   /* DTable is too small */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1836:9): [True: 0, False: 4]
  ------------------
 1837|      4|    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|      4|    nextRankStart = 0;
 1841|     23|    for (n=1; n<=tableLog; n++) {
  ------------------
  |  Branch (1841:15): [True: 19, False: 4]
  ------------------
 1842|     19|        U32 current = nextRankStart;
 1843|     19|        nextRankStart += (rankVal[n] << (n-1));
 1844|     19|        rankVal[n] = current;
 1845|     19|    }
 1846|       |
 1847|       |    /* fill DTable */
 1848|    159|    for (n=0; n<nbSymbols; n++) {
  ------------------
  |  Branch (1848:15): [True: 155, False: 4]
  ------------------
 1849|    155|        const U32 w = huffWeight[n];
 1850|    155|        const U32 length = (1 << w) >> 1;
 1851|    155|        U32 i;
 1852|    155|        HUFv05_DEltX2 D;
 1853|    155|        D.byte = (BYTE)n; D.nbBits = (BYTE)(tableLog + 1 - w);
 1854|    331|        for (i = rankVal[w]; i < rankVal[w] + length; i++)
  ------------------
  |  Branch (1854:30): [True: 176, False: 155]
  ------------------
 1855|    176|            dt[i] = D;
 1856|    155|        rankVal[w] += length;
 1857|    155|    }
 1858|       |
 1859|      4|    return iSize;
 1860|      4|}
HUFv05_decompress1X2_usingDTable:
 1908|      2|{
 1909|      2|    BYTE* op = (BYTE*)dst;
 1910|      2|    BYTE* const oend = op + dstSize;
 1911|      2|    const U32 dtLog = DTable[0];
 1912|      2|    const void* dtPtr = DTable;
 1913|      2|    const HUFv05_DEltX2* const dt = ((const HUFv05_DEltX2*)dtPtr)+1;
 1914|      2|    BITv05_DStream_t bitD;
 1915|       |
 1916|      2|    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: 1]
  ------------------
 1917|      1|    { size_t const errorCode = BITv05_initDStream(&bitD, cSrc, cSrcSize);
 1918|      1|      if (HUFv05_isError(errorCode)) return errorCode; }
  ------------------
  |  Branch (1918:11): [True: 0, False: 1]
  ------------------
 1919|       |
 1920|      1|    HUFv05_decodeStreamX2(op, &bitD, oend, dt, dtLog);
 1921|       |
 1922|       |    /* check */
 1923|      1|    if (!BITv05_endOfDStream(&bitD)) 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 (1923:9): [True: 1, False: 0]
  ------------------
 1924|       |
 1925|      0|    return dstSize;
 1926|      1|}
HUFv05_decompress1X2:
 1929|      3|{
 1930|      3|    HUFv05_CREATE_STATIC_DTABLEX2(DTable, HUFv05_MAX_TABLELOG);
  ------------------
  |  | 1604|      3|        unsigned short DTable[HUFv05_DTABLE_SIZE(maxTableLog)] = { maxTableLog }
  ------------------
 1931|      3|    const BYTE* ip = (const BYTE*) cSrc;
 1932|      3|    size_t errorCode;
 1933|       |
 1934|      3|    errorCode = HUFv05_readDTableX2 (DTable, cSrc, cSrcSize);
 1935|      3|    if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1935:9): [True: 1, False: 2]
  ------------------
 1936|      2|    if (errorCode >= 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 (1936:9): [True: 0, False: 2]
  ------------------
 1937|      2|    ip += errorCode;
 1938|      2|    cSrcSize -= errorCode;
 1939|       |
 1940|      2|    return HUFv05_decompress1X2_usingDTable (dst, dstSize, ip, cSrcSize, DTable);
 1941|      2|}
HUFv05_decompress4X2_usingDTable:
 1948|      2|{
 1949|       |    /* Check */
 1950|      2|    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 (1950:9): [True: 0, False: 2]
  ------------------
 1951|      2|    {
 1952|      2|        const BYTE* const istart = (const BYTE*) cSrc;
 1953|      2|        BYTE* const ostart = (BYTE*) dst;
 1954|      2|        BYTE* const oend = ostart + dstSize;
 1955|      2|        const void* const dtPtr = DTable;
 1956|      2|        const HUFv05_DEltX2* const dt = ((const HUFv05_DEltX2*)dtPtr) +1;
 1957|      2|        const U32 dtLog = DTable[0];
 1958|      2|        size_t errorCode;
 1959|       |
 1960|       |        /* Init */
 1961|      2|        BITv05_DStream_t bitD1;
 1962|      2|        BITv05_DStream_t bitD2;
 1963|      2|        BITv05_DStream_t bitD3;
 1964|      2|        BITv05_DStream_t bitD4;
 1965|      2|        const size_t length1 = MEM_readLE16(istart);
 1966|      2|        const size_t length2 = MEM_readLE16(istart+2);
 1967|      2|        const size_t length3 = MEM_readLE16(istart+4);
 1968|      2|        size_t length4;
 1969|      2|        const BYTE* const istart1 = istart + 6;  /* jumpTable */
 1970|      2|        const BYTE* const istart2 = istart1 + length1;
 1971|      2|        const BYTE* const istart3 = istart2 + length2;
 1972|      2|        const BYTE* const istart4 = istart3 + length3;
 1973|      2|        const size_t segmentSize = (dstSize+3) / 4;
 1974|      2|        BYTE* const opStart2 = ostart + segmentSize;
 1975|      2|        BYTE* const opStart3 = opStart2 + segmentSize;
 1976|      2|        BYTE* const opStart4 = opStart3 + segmentSize;
 1977|      2|        BYTE* op1 = ostart;
 1978|      2|        BYTE* op2 = opStart2;
 1979|      2|        BYTE* op3 = opStart3;
 1980|      2|        BYTE* op4 = opStart4;
 1981|      2|        U32 endSignal;
 1982|       |
 1983|      2|        length4 = cSrcSize - (length1 + length2 + length3 + 6);
 1984|      2|        if (length4 > cSrcSize) return ERROR(corruption_detected);   /* overflow */
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1984:13): [True: 2, False: 0]
  ------------------
 1985|      0|        errorCode = BITv05_initDStream(&bitD1, istart1, length1);
 1986|      0|        if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1986:13): [True: 0, False: 0]
  ------------------
 1987|      0|        errorCode = BITv05_initDStream(&bitD2, istart2, length2);
 1988|      0|        if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1988:13): [True: 0, False: 0]
  ------------------
 1989|      0|        errorCode = BITv05_initDStream(&bitD3, istart3, length3);
 1990|      0|        if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1990:13): [True: 0, False: 0]
  ------------------
 1991|      0|        errorCode = BITv05_initDStream(&bitD4, istart4, length4);
 1992|      0|        if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1992:13): [True: 0, False: 0]
  ------------------
 1993|       |
 1994|       |        /* 16-32 symbols per loop (4-8 symbols per stream) */
 1995|      0|        endSignal = BITv05_reloadDStream(&bitD1) | BITv05_reloadDStream(&bitD2) | BITv05_reloadDStream(&bitD3) | BITv05_reloadDStream(&bitD4);
 1996|      0|        for ( ; (endSignal==BITv05_DStream_unfinished) && (op4<(oend-7)) ; ) {
  ------------------
  |  Branch (1996:17): [True: 0, False: 0]
  |  Branch (1996:59): [True: 0, False: 0]
  ------------------
 1997|      0|            HUFv05_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 1878|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1879|      0|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|      0|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1998|      0|            HUFv05_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 1878|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1879|      0|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|      0|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1999|      0|            HUFv05_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 1878|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1879|      0|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|      0|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2000|      0|            HUFv05_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 1878|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1879|      0|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|      0|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2001|      0|            HUFv05_DECODE_SYMBOLX2_1(op1, &bitD1);
  ------------------
  |  | 1874|      0|    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: 0, False: 0]
  |  |  |  Branch (1874:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1875|      0|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|      0|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2002|      0|            HUFv05_DECODE_SYMBOLX2_1(op2, &bitD2);
  ------------------
  |  | 1874|      0|    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: 0, False: 0]
  |  |  |  Branch (1874:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1875|      0|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|      0|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2003|      0|            HUFv05_DECODE_SYMBOLX2_1(op3, &bitD3);
  ------------------
  |  | 1874|      0|    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: 0, False: 0]
  |  |  |  Branch (1874:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1875|      0|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|      0|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2004|      0|            HUFv05_DECODE_SYMBOLX2_1(op4, &bitD4);
  ------------------
  |  | 1874|      0|    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: 0, False: 0]
  |  |  |  Branch (1874:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1875|      0|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|      0|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2005|      0|            HUFv05_DECODE_SYMBOLX2_2(op1, &bitD1);
  ------------------
  |  | 1878|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1879|      0|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|      0|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2006|      0|            HUFv05_DECODE_SYMBOLX2_2(op2, &bitD2);
  ------------------
  |  | 1878|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1879|      0|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|      0|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2007|      0|            HUFv05_DECODE_SYMBOLX2_2(op3, &bitD3);
  ------------------
  |  | 1878|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1879|      0|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|      0|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2008|      0|            HUFv05_DECODE_SYMBOLX2_2(op4, &bitD4);
  ------------------
  |  | 1878|      0|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 1879|      0|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|      0|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 2009|      0|            HUFv05_DECODE_SYMBOLX2_0(op1, &bitD1);
  ------------------
  |  | 1871|      0|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2010|      0|            HUFv05_DECODE_SYMBOLX2_0(op2, &bitD2);
  ------------------
  |  | 1871|      0|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2011|      0|            HUFv05_DECODE_SYMBOLX2_0(op3, &bitD3);
  ------------------
  |  | 1871|      0|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2012|      0|            HUFv05_DECODE_SYMBOLX2_0(op4, &bitD4);
  ------------------
  |  | 1871|      0|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 2013|      0|            endSignal = BITv05_reloadDStream(&bitD1) | BITv05_reloadDStream(&bitD2) | BITv05_reloadDStream(&bitD3) | BITv05_reloadDStream(&bitD4);
 2014|      0|        }
 2015|       |
 2016|       |        /* check corruption */
 2017|      0|        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: 0]
  ------------------
 2018|      0|        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: 0]
  ------------------
 2019|      0|        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: 0]
  ------------------
 2020|       |        /* note : op4 supposed already verified within main loop */
 2021|       |
 2022|       |        /* finish bitStreams one by one */
 2023|      0|        HUFv05_decodeStreamX2(op1, &bitD1, opStart2, dt, dtLog);
 2024|      0|        HUFv05_decodeStreamX2(op2, &bitD2, opStart3, dt, dtLog);
 2025|      0|        HUFv05_decodeStreamX2(op3, &bitD3, opStart4, dt, dtLog);
 2026|      0|        HUFv05_decodeStreamX2(op4, &bitD4, oend,     dt, dtLog);
 2027|       |
 2028|       |        /* check */
 2029|      0|        endSignal = BITv05_endOfDStream(&bitD1) & BITv05_endOfDStream(&bitD2) & BITv05_endOfDStream(&bitD3) & BITv05_endOfDStream(&bitD4);
 2030|      0|        if (!endSignal) 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 (2030:13): [True: 0, False: 0]
  ------------------
 2031|       |
 2032|       |        /* decoded size */
 2033|      0|        return dstSize;
 2034|      0|    }
 2035|      0|}
HUFv05_decompress4X2:
 2039|      9|{
 2040|      9|    HUFv05_CREATE_STATIC_DTABLEX2(DTable, HUFv05_MAX_TABLELOG);
  ------------------
  |  | 1604|      9|        unsigned short DTable[HUFv05_DTABLE_SIZE(maxTableLog)] = { maxTableLog }
  ------------------
 2041|      9|    const BYTE* ip = (const BYTE*) cSrc;
 2042|      9|    size_t errorCode;
 2043|       |
 2044|      9|    errorCode = HUFv05_readDTableX2 (DTable, cSrc, cSrcSize);
 2045|      9|    if (HUFv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (2045:9): [True: 7, False: 2]
  ------------------
 2046|      2|    if (errorCode >= 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 (2046:9): [True: 0, False: 2]
  ------------------
 2047|      2|    ip += errorCode;
 2048|      2|    cSrcSize -= errorCode;
 2049|       |
 2050|      2|    return HUFv05_decompress4X2_usingDTable (dst, dstSize, ip, cSrcSize, DTable);
 2051|      2|}
HUFv05_readDTableX4:
 2146|      2|{
 2147|      2|    BYTE weightList[HUFv05_MAX_SYMBOL_VALUE + 1];
 2148|      2|    sortedSymbol_t sortedSymbol[HUFv05_MAX_SYMBOL_VALUE + 1];
 2149|      2|    U32 rankStats[HUFv05_ABSOLUTEMAX_TABLELOG + 1] = { 0 };
 2150|      2|    U32 rankStart0[HUFv05_ABSOLUTEMAX_TABLELOG + 2] = { 0 };
 2151|      2|    U32* const rankStart = rankStart0+1;
 2152|      2|    rankVal_t rankVal;
 2153|      2|    U32 tableLog, maxW, sizeOfSort, nbSymbols;
 2154|      2|    const U32 memLog = DTable[0];
 2155|      2|    size_t iSize;
 2156|      2|    void* dtPtr = DTable;
 2157|      2|    HUFv05_DEltX4* const dt = ((HUFv05_DEltX4*)dtPtr) + 1;
 2158|       |
 2159|      2|    HUFv05_STATIC_ASSERT(sizeof(HUFv05_DEltX4) == sizeof(unsigned));   /* if compilation fails here, assertion is false */
  ------------------
  |  | 1725|      2|#define HUFv05_STATIC_ASSERT(c) { enum { HUFv05_static_assert = 1/(int)(!!(c)) }; }   /* use only *after* variable declarations */
  ------------------
 2160|      2|    if (memLog > HUFv05_ABSOLUTEMAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1711|      2|#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]
  ------------------
 2161|       |    /* memset(weightList, 0, sizeof(weightList)); */   /* is not necessary, even though some analyzer complain ... */
 2162|       |
 2163|      2|    iSize = HUFv05_readStats(weightList, HUFv05_MAX_SYMBOL_VALUE + 1, rankStats, &nbSymbols, &tableLog, src, srcSize);
  ------------------
  |  | 1714|      2|#define HUFv05_MAX_SYMBOL_VALUE 255
  ------------------
 2164|      2|    if (HUFv05_isError(iSize)) return iSize;
  ------------------
  |  Branch (2164:9): [True: 2, False: 0]
  ------------------
 2165|       |
 2166|       |    /* check result */
 2167|      0|    if (tableLog > memLog) return ERROR(tableLog_tooLarge);   /* DTable can't fit code depth */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2167:9): [True: 0, False: 0]
  ------------------
 2168|       |
 2169|       |    /* find maxWeight */
 2170|      0|    for (maxW = tableLog; rankStats[maxW]==0; maxW--) {}  /* necessarily finds a solution before 0 */
  ------------------
  |  Branch (2170:27): [True: 0, False: 0]
  ------------------
 2171|       |
 2172|       |    /* Get start index of each weight */
 2173|      0|    {
 2174|      0|        U32 w, nextRankStart = 0;
 2175|      0|        for (w=1; w<=maxW; w++) {
  ------------------
  |  Branch (2175:19): [True: 0, False: 0]
  ------------------
 2176|      0|            U32 current = nextRankStart;
 2177|      0|            nextRankStart += rankStats[w];
 2178|      0|            rankStart[w] = current;
 2179|      0|        }
 2180|      0|        rankStart[0] = nextRankStart;   /* put all 0w symbols at the end of sorted list*/
 2181|      0|        sizeOfSort = nextRankStart;
 2182|      0|    }
 2183|       |
 2184|       |    /* sort symbols by weight */
 2185|      0|    {
 2186|      0|        U32 s;
 2187|      0|        for (s=0; s<nbSymbols; s++) {
  ------------------
  |  Branch (2187:19): [True: 0, False: 0]
  ------------------
 2188|      0|            U32 w = weightList[s];
 2189|      0|            U32 r = rankStart[w]++;
 2190|      0|            sortedSymbol[r].symbol = (BYTE)s;
 2191|      0|            sortedSymbol[r].weight = (BYTE)w;
 2192|      0|        }
 2193|      0|        rankStart[0] = 0;   /* forget 0w symbols; this is beginning of weight(1) */
 2194|      0|    }
 2195|       |
 2196|       |    /* Build rankVal */
 2197|      0|    {
 2198|      0|        const U32 minBits = tableLog+1 - maxW;
 2199|      0|        U32 nextRankVal = 0;
 2200|      0|        U32 w, consumed;
 2201|      0|        const int rescale = (memLog-tableLog) - 1;   /* tableLog <= memLog */
 2202|      0|        U32* rankVal0 = rankVal[0];
 2203|      0|        for (w=1; w<=maxW; w++) {
  ------------------
  |  Branch (2203:19): [True: 0, False: 0]
  ------------------
 2204|      0|            U32 current = nextRankVal;
 2205|      0|            nextRankVal += rankStats[w] << (w+rescale);
 2206|      0|            rankVal0[w] = current;
 2207|      0|        }
 2208|      0|        for (consumed = minBits; consumed <= memLog - minBits; consumed++) {
  ------------------
  |  Branch (2208:34): [True: 0, False: 0]
  ------------------
 2209|      0|            U32* rankValPtr = rankVal[consumed];
 2210|      0|            for (w = 1; w <= maxW; w++) {
  ------------------
  |  Branch (2210:25): [True: 0, False: 0]
  ------------------
 2211|      0|                rankValPtr[w] = rankVal0[w] >> consumed;
 2212|      0|    }   }   }
 2213|       |
 2214|      0|    HUFv05_fillDTableX4(dt, memLog,
 2215|      0|                   sortedSymbol, sizeOfSort,
 2216|      0|                   rankStart0, rankVal, maxW,
 2217|      0|                   tableLog+1);
 2218|       |
 2219|      0|    return iSize;
 2220|      0|}
HUFv05_decompress4X4:
 2422|      2|{
 2423|      2|    HUFv05_CREATE_STATIC_DTABLEX4(DTable, HUFv05_MAX_TABLELOG);
  ------------------
  |  | 1606|      2|        unsigned int DTable[HUFv05_DTABLE_SIZE(maxTableLog)] = { maxTableLog }
  ------------------
 2424|      2|    const BYTE* ip = (const BYTE*) cSrc;
 2425|       |
 2426|      2|    size_t hSize = HUFv05_readDTableX4 (DTable, cSrc, cSrcSize);
 2427|      2|    if (HUFv05_isError(hSize)) return hSize;
  ------------------
  |  Branch (2427:9): [True: 2, False: 0]
  ------------------
 2428|      0|    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: 0]
  ------------------
 2429|      0|    ip += hSize;
 2430|      0|    cSrcSize -= hSize;
 2431|       |
 2432|      0|    return HUFv05_decompress4X4_usingDTable (dst, dstSize, ip, cSrcSize, DTable);
 2433|      0|}
HUFv05_decompress:
 2465|     26|{
 2466|     26|    static const decompressionAlgo decompress[3] = { HUFv05_decompress4X2, HUFv05_decompress4X4, NULL };
 2467|       |    /* estimate decompression time */
 2468|     26|    U32 Q;
 2469|     26|    const U32 D256 = (U32)(dstSize >> 8);
 2470|     26|    U32 Dtime[3];
 2471|     26|    U32 algoNb = 0;
 2472|     26|    int n;
 2473|       |
 2474|       |    /* validation checks */
 2475|     26|    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: 22]
  ------------------
 2476|     22|    if (cSrcSize >= dstSize) return ERROR(corruption_detected);   /* invalid, or not compressed, but not compressed already dealt with */
  ------------------
  |  |   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 (2476:9): [True: 7, False: 15]
  ------------------
 2477|     15|    if (cSrcSize == 1) { memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; }   /* RLE */
  ------------------
  |  Branch (2477:9): [True: 4, False: 11]
  ------------------
 2478|       |
 2479|       |    /* decoder timing evaluation */
 2480|     11|    Q = (U32)(cSrcSize * 16 / dstSize);   /* Q < 16 since dstSize > cSrcSize */
 2481|     44|    for (n=0; n<3; n++)
  ------------------
  |  Branch (2481:15): [True: 33, False: 11]
  ------------------
 2482|     33|        Dtime[n] = algoTime[Q][n].tableTime + (algoTime[Q][n].decode256Time * D256);
 2483|       |
 2484|     11|    Dtime[1] += Dtime[1] >> 4; Dtime[2] += Dtime[2] >> 3; /* advantage to algorithms using less memory, for cache eviction */
 2485|       |
 2486|     11|    if (Dtime[1] < Dtime[0]) algoNb = 1;
  ------------------
  |  Branch (2486:9): [True: 2, False: 9]
  ------------------
 2487|       |
 2488|     11|    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|     15|}
ZSTDv05_isError:
 2577|  2.37k|unsigned ZSTDv05_isError(size_t code) { return ERR_isError(code); }
ZSTDv05_decompressBegin:
 2617|    238|{
 2618|    238|    dctx->expected = ZSTDv05_frameHeaderSize_min;
 2619|    238|    dctx->stage = ZSTDv05ds_getFrameHeaderSize;
 2620|    238|    dctx->previousDstEnd = NULL;
 2621|    238|    dctx->base = NULL;
 2622|    238|    dctx->vBase = NULL;
 2623|    238|    dctx->dictEnd = NULL;
 2624|    238|    dctx->hufTableX4[0] = ZSTD_HUFFDTABLE_CAPACITY_LOG;
  ------------------
  |  |  436|    238|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
 2625|    238|    dctx->flagStaticTables = 0;
 2626|    238|    return 0;
 2627|    238|}
ZSTDv05_createDCtx:
 2630|    119|{
 2631|    119|    ZSTDv05_DCtx* dctx = (ZSTDv05_DCtx*)malloc(sizeof(ZSTDv05_DCtx));
 2632|    119|    if (dctx==NULL) return NULL;
  ------------------
  |  Branch (2632:9): [True: 0, False: 119]
  ------------------
 2633|    119|    ZSTDv05_decompressBegin(dctx);
 2634|    119|    return dctx;
 2635|    119|}
ZSTDv05_freeDCtx:
 2638|    119|{
 2639|    119|    free(dctx);
 2640|    119|    return 0;   /* reserved as a potential error code in the future */
 2641|    119|}
ZSTDv05_getFrameParams:
 2752|    139|{
 2753|    139|    U32 magicNumber;
 2754|    139|    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: 139]
  ------------------
 2755|    139|    magicNumber = MEM_readLE32(src);
 2756|    139|    if (magicNumber != ZSTDv05_MAGICNUMBER) return ERROR(prefix_unknown);
  ------------------
  |  |  153|    139|#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: 139]
  ------------------
 2757|    139|    memset(params, 0, sizeof(*params));
 2758|    139|    params->windowLog = (((const BYTE*)src)[4] & 15) + ZSTDv05_WINDOWLOG_ABSOLUTEMIN;
  ------------------
  |  |  256|    139|#define ZSTDv05_WINDOWLOG_ABSOLUTEMIN 11
  ------------------
 2759|    139|    if ((((const BYTE*)src)[4] >> 4) != 0) return ERROR(frameParameter_unsupported);   /* reserved bits */
  ------------------
  |  |   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 (2759:9): [True: 2, False: 137]
  ------------------
 2760|    137|    return 0;
 2761|    139|}
ZSTDv05_decompress_usingDict:
 3449|    119|{
 3450|    119|    ZSTDv05_decompressBegin_usingDict(dctx, dict, dictSize);
 3451|    119|    ZSTDv05_checkContinuity(dctx, dst);
 3452|    119|    return ZSTDv05_decompress_continueDCtx(dctx, dst, maxDstSize, src, srcSize);
 3453|    119|}
ZSTDv05_findFrameSizeInfoLegacy:
 3485|    123|{
 3486|    123|    const BYTE* ip = (const BYTE*)src;
 3487|    123|    size_t remainingSize = srcSize;
 3488|    123|    size_t nbBlocks = 0;
 3489|    123|    blockProperties_t blockProperties;
 3490|       |
 3491|       |    /* Frame Header */
 3492|    123|    if (srcSize < ZSTDv05_frameHeaderSize_min) {
  ------------------
  |  Branch (3492:9): [True: 0, False: 123]
  ------------------
 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|    123|    if (MEM_readLE32(src) != ZSTDv05_MAGICNUMBER) {
  ------------------
  |  |  153|    123|#define ZSTDv05_MAGICNUMBER 0xFD2FB525   /* v0.5 */
  ------------------
  |  Branch (3496:9): [True: 0, False: 123]
  ------------------
 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|    123|    ip += ZSTDv05_frameHeaderSize_min; remainingSize -= ZSTDv05_frameHeaderSize_min;
 3501|       |
 3502|       |    /* Loop on each block */
 3503|    502|    while (1)
  ------------------
  |  Branch (3503:12): [True: 502, Folded]
  ------------------
 3504|    502|    {
 3505|    502|        size_t cBlockSize = ZSTDv05_getcBlockSize(ip, remainingSize, &blockProperties);
 3506|    502|        if (ZSTDv05_isError(cBlockSize)) {
  ------------------
  |  Branch (3506:13): [True: 0, False: 502]
  ------------------
 3507|      0|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, cBlockSize);
 3508|      0|            return;
 3509|      0|        }
 3510|       |
 3511|    502|        ip += ZSTDv05_blockHeaderSize;
 3512|    502|        remainingSize -= ZSTDv05_blockHeaderSize;
 3513|    502|        if (cBlockSize > remainingSize) {
  ------------------
  |  Branch (3513:13): [True: 4, False: 498]
  ------------------
 3514|      4|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, 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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3515|      4|            return;
 3516|      4|        }
 3517|       |
 3518|    498|        if (cBlockSize == 0) break;   /* bt_end */
  ------------------
  |  Branch (3518:13): [True: 119, False: 379]
  ------------------
 3519|       |
 3520|    379|        ip += cBlockSize;
 3521|    379|        remainingSize -= cBlockSize;
 3522|    379|        nbBlocks++;
 3523|    379|    }
 3524|       |
 3525|    119|    *cSize = ip - (const BYTE*)src;
 3526|    119|    *dBound = nbBlocks * BLOCKSIZE;
  ------------------
  |  |  396|    119|#define BLOCKSIZE (128 KB)                 /* define, for static allocation */
  |  |  ------------------
  |  |  |  |  392|    119|#define KB *(1 <<10)
  |  |  ------------------
  ------------------
 3527|    119|}
ZSTDv05_decompressBegin_usingDict:
 3687|    119|{
 3688|    119|    size_t errorCode;
 3689|    119|    errorCode = ZSTDv05_decompressBegin(dctx);
 3690|    119|    if (ZSTDv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (3690:9): [True: 0, False: 119]
  ------------------
 3691|       |
 3692|    119|    if (dict && dictSize) {
  ------------------
  |  Branch (3692:9): [True: 119, False: 0]
  |  Branch (3692:17): [True: 28, False: 91]
  ------------------
 3693|     28|        errorCode = ZSTDv05_decompress_insertDictionary(dctx, dict, dictSize);
 3694|     28|        if (ZSTDv05_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 (3694:13): [True: 0, False: 28]
  ------------------
 3695|     28|    }
 3696|       |
 3697|    119|    return 0;
 3698|    119|}
zstd_v05.c:FSEv05_tableStep:
 1142|     62|static U32 FSEv05_tableStep(U32 tableSize) { return (tableSize>>1) + (tableSize>>3) + 3; }
zstd_v05.c:BITv05_highbit32:
  702|  4.10k|{
  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|  4.10k|}
zstd_v05.c:FSEv05_abs:
 1227|    785|static short FSEv05_abs(short a) { return a<0 ? -a : a; }
  ------------------
  |  Branch (1227:43): [True: 528, False: 257]
  ------------------
zstd_v05.c:FSEv05_decompress_usingDTable_generic:
 1376|      2|{
 1377|      2|    BYTE* const ostart = (BYTE*) dst;
 1378|      2|    BYTE* op = ostart;
 1379|      2|    BYTE* const omax = op + maxDstSize;
 1380|      2|    BYTE* const olimit = omax-3;
 1381|       |
 1382|      2|    BITv05_DStream_t bitD;
 1383|      2|    FSEv05_DState_t state1;
 1384|      2|    FSEv05_DState_t state2;
 1385|      2|    size_t errorCode;
 1386|       |
 1387|       |    /* Init */
 1388|      2|    errorCode = BITv05_initDStream(&bitD, cSrc, cSrcSize);   /* replaced last arg by maxCompressed Size */
 1389|      2|    if (FSEv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1389:9): [True: 0, False: 2]
  ------------------
 1390|       |
 1391|      2|    FSEv05_initDState(&state1, &bitD, dt);
 1392|      2|    FSEv05_initDState(&state2, &bitD, dt);
 1393|       |
 1394|      2|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
 1395|       |
 1396|       |    /* 4 symbols per loop */
 1397|     65|    for ( ; (BITv05_reloadDStream(&bitD)==BITv05_DStream_unfinished) && (op<olimit) ; op+=4) {
  ------------------
  |  Branch (1397:13): [True: 64, False: 1]
  |  Branch (1397:73): [True: 63, False: 1]
  ------------------
 1398|     63|        op[0] = FSEv05_GETSYMBOL(&state1);
  ------------------
  |  | 1394|     63|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 63, False: 0]
  |  |  ------------------
  ------------------
 1399|       |
 1400|     63|        if (FSEv05_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1094|     63|#define FSEv05_MAX_TABLELOG  (FSEv05_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1042|     63|#define FSEv05_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1400:13): [Folded, False: 63]
  ------------------
 1401|      0|            BITv05_reloadDStream(&bitD);
 1402|       |
 1403|     63|        op[1] = FSEv05_GETSYMBOL(&state2);
  ------------------
  |  | 1394|     63|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 63, False: 0]
  |  |  ------------------
  ------------------
 1404|       |
 1405|     63|        if (FSEv05_MAX_TABLELOG*4+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1094|     63|#define FSEv05_MAX_TABLELOG  (FSEv05_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1042|     63|#define FSEv05_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1405:13): [Folded, False: 63]
  ------------------
 1406|      0|            { if (BITv05_reloadDStream(&bitD) > BITv05_DStream_unfinished) { op+=2; break; } }
  ------------------
  |  Branch (1406:19): [True: 0, False: 0]
  ------------------
 1407|       |
 1408|     63|        op[2] = FSEv05_GETSYMBOL(&state1);
  ------------------
  |  | 1394|     63|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 63, False: 0]
  |  |  ------------------
  ------------------
 1409|       |
 1410|     63|        if (FSEv05_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1094|     63|#define FSEv05_MAX_TABLELOG  (FSEv05_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1042|     63|#define FSEv05_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1410:13): [Folded, False: 63]
  ------------------
 1411|      0|            BITv05_reloadDStream(&bitD);
 1412|       |
 1413|     63|        op[3] = FSEv05_GETSYMBOL(&state2);
  ------------------
  |  | 1394|     63|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 63, False: 0]
  |  |  ------------------
  ------------------
 1414|     63|    }
 1415|       |
 1416|       |    /* tail */
 1417|       |    /* note : BITv05_reloadDStream(&bitD) >= FSEv05_DStream_partiallyFilled; Ends at exactly BITv05_DStream_completed */
 1418|     15|    while (1) {
  ------------------
  |  Branch (1418:12): [True: 15, Folded]
  ------------------
 1419|     15|        if ( (BITv05_reloadDStream(&bitD)>BITv05_DStream_completed) || (op==omax) || (BITv05_endOfDStream(&bitD) && (fast || FSEv05_endOfDState(&state1))) )
  ------------------
  |  Branch (1419:14): [True: 0, False: 15]
  |  Branch (1419:72): [True: 0, False: 15]
  |  Branch (1419:87): [True: 1, False: 14]
  |  Branch (1419:118): [True: 0, False: 1]
  |  Branch (1419:126): [True: 0, False: 1]
  ------------------
 1420|      0|            break;
 1421|       |
 1422|     15|        *op++ = FSEv05_GETSYMBOL(&state1);
  ------------------
  |  | 1394|     15|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 2, False: 13]
  |  |  ------------------
  ------------------
 1423|       |
 1424|     15|        if ( (BITv05_reloadDStream(&bitD)>BITv05_DStream_completed) || (op==omax) || (BITv05_endOfDStream(&bitD) && (fast || FSEv05_endOfDState(&state2))) )
  ------------------
  |  Branch (1424:14): [True: 1, False: 14]
  |  Branch (1424:72): [True: 1, False: 13]
  |  Branch (1424:87): [True: 0, False: 13]
  |  Branch (1424:118): [True: 0, False: 0]
  |  Branch (1424:126): [True: 0, False: 0]
  ------------------
 1425|      2|            break;
 1426|       |
 1427|     13|        *op++ = FSEv05_GETSYMBOL(&state2);
  ------------------
  |  | 1394|     13|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 1, False: 12]
  |  |  ------------------
  ------------------
 1428|     13|    }
 1429|       |
 1430|       |    /* end ? */
 1431|      2|    if (BITv05_endOfDStream(&bitD) && FSEv05_endOfDState(&state1) && FSEv05_endOfDState(&state2))
  ------------------
  |  Branch (1431:9): [True: 0, False: 2]
  |  Branch (1431:39): [True: 0, False: 0]
  |  Branch (1431:70): [True: 0, False: 0]
  ------------------
 1432|      0|        return op-ostart;
 1433|       |
 1434|      2|    if (op==omax) return ERROR(dstSize_tooSmall);   /* dst buffer is full, but cSrc unfinished */
  ------------------
  |  |   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 (1434:9): [True: 1, False: 1]
  ------------------
 1435|       |
 1436|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1437|      2|}
zstd_v05.c:FSEv05_initDState:
  951|    181|{
  952|    181|    const void* ptr = dt;
  953|    181|    const FSEv05_DTableHeader* const DTableH = (const FSEv05_DTableHeader*)ptr;
  954|    181|    DStatePtr->state = BITv05_readBits(bitD, DTableH->tableLog);
  955|    181|    BITv05_reloadDStream(bitD);
  956|    181|    DStatePtr->table = dt + 1;
  957|    181|}
zstd_v05.c:BITv05_readBits:
  790|  3.38k|{
  791|  3.38k|    size_t value = BITv05_lookBits(bitD, nbBits);
  792|  3.38k|    BITv05_skipBits(bitD, nbBits);
  793|  3.38k|    return value;
  794|  3.38k|}
zstd_v05.c:BITv05_lookBits:
  771|  3.38k|{
  772|  3.38k|    const U32 bitMask = sizeof(bitD->bitContainer)*8 - 1;
  773|  3.38k|    return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask);
  774|  3.38k|}
zstd_v05.c:BITv05_skipBits:
  785|  4.66k|{
  786|  4.66k|    bitD->bitsConsumed += nbBits;
  787|  4.66k|}
zstd_v05.c:FSEv05_decodeSymbolFast:
  977|    255|{
  978|    255|    const FSEv05_decode_t DInfo = ((const FSEv05_decode_t*)(DStatePtr->table))[DStatePtr->state];
  979|    255|    const U32 nbBits = DInfo.nbBits;
  980|    255|    BYTE symbol = DInfo.symbol;
  981|    255|    size_t lowBits = BITv05_readBitsFast(bitD, nbBits);
  982|       |
  983|    255|    DStatePtr->state = DInfo.newState + lowBits;
  984|    255|    return symbol;
  985|    255|}
zstd_v05.c:BITv05_readBitsFast:
  799|    255|{
  800|    255|    size_t value = BITv05_lookBitsFast(bitD, nbBits);
  801|    255|    BITv05_skipBits(bitD, nbBits);
  802|    255|    return value;
  803|    255|}
zstd_v05.c:BITv05_lookBitsFast:
  779|  1.27k|{
  780|  1.27k|    const U32 bitMask = sizeof(bitD->bitContainer)*8 - 1;
  781|  1.27k|    return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask);
  782|  1.27k|}
zstd_v05.c:FSEv05_decodeSymbol:
  966|  2.41k|{
  967|  2.41k|    const FSEv05_decode_t DInfo = ((const FSEv05_decode_t*)(DStatePtr->table))[DStatePtr->state];
  968|  2.41k|    const U32  nbBits = DInfo.nbBits;
  969|  2.41k|    BYTE symbol = DInfo.symbol;
  970|  2.41k|    size_t lowBits = BITv05_readBits(bitD, nbBits);
  971|       |
  972|  2.41k|    DStatePtr->state = DInfo.newState + lowBits;
  973|  2.41k|    return symbol;
  974|  2.41k|}
zstd_v05.c:FSEv05_endOfDState:
  988|      1|{
  989|      1|    return DStatePtr->state == 0;
  990|      1|}
zstd_v05.c:HUFv05_readStats:
 1745|     14|{
 1746|     14|    U32 weightTotal;
 1747|     14|    U32 tableLog;
 1748|     14|    const BYTE* ip = (const BYTE*) src;
 1749|     14|    size_t iSize;
 1750|     14|    size_t oSize;
 1751|     14|    U32 n;
 1752|       |
 1753|     14|    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 (1753:9): [True: 1, False: 13]
  ------------------
 1754|     13|    iSize = ip[0];
 1755|       |    /* memset(huffWeight, 0, hwSize); */   /* is not necessary, even though some analyzer complain ... */
 1756|       |
 1757|     13|    if (iSize >= 128)  { /* special header */
  ------------------
  |  Branch (1757:9): [True: 4, False: 9]
  ------------------
 1758|      4|        if (iSize >= (242)) {  /* RLE */
  ------------------
  |  Branch (1758:13): [True: 4, False: 0]
  ------------------
 1759|      4|            static int l[14] = { 1, 2, 3, 4, 7, 8, 15, 16, 31, 32, 63, 64, 127, 128 };
 1760|      4|            oSize = l[iSize-242];
 1761|      4|            memset(huffWeight, 1, hwSize);
 1762|      4|            iSize = 0;
 1763|      4|        }
 1764|      0|        else {   /* Incompressible */
 1765|      0|            oSize = iSize - 127;
 1766|      0|            iSize = ((oSize+1)/2);
 1767|      0|            if (iSize+1 > srcSize) 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 (1767:17): [True: 0, False: 0]
  ------------------
 1768|      0|            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: 0]
  ------------------
 1769|      0|            ip += 1;
 1770|      0|            for (n=0; n<oSize; n+=2) {
  ------------------
  |  Branch (1770:23): [True: 0, False: 0]
  ------------------
 1771|      0|                huffWeight[n]   = ip[n/2] >> 4;
 1772|      0|                huffWeight[n+1] = ip[n/2] & 15;
 1773|      0|    }   }   }
 1774|      9|    else  {   /* header compressed with FSEv05 (normal case) */
 1775|      9|        if (iSize+1 > srcSize) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1775:13): [True: 1, False: 8]
  ------------------
 1776|      8|        oSize = FSEv05_decompress(huffWeight, hwSize-1, ip+1, iSize);   /* max (hwSize-1) values decoded, as last one is implied */
 1777|      8|        if (FSEv05_isError(oSize)) return oSize;
  ------------------
  |  Branch (1777:13): [True: 8, False: 0]
  ------------------
 1778|      8|    }
 1779|       |
 1780|       |    /* collect weight stats */
 1781|      4|    memset(rankStats, 0, (HUFv05_ABSOLUTEMAX_TABLELOG + 1) * sizeof(U32));
  ------------------
  |  | 1711|      4|#define HUFv05_ABSOLUTEMAX_TABLELOG  16   /* absolute limit of HUFv05_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
 1782|      4|    weightTotal = 0;
 1783|    155|    for (n=0; n<oSize; n++) {
  ------------------
  |  Branch (1783:15): [True: 151, False: 4]
  ------------------
 1784|    151|        if (huffWeight[n] >= HUFv05_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  | 1711|    151|#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|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1784:13): [True: 0, False: 151]
  ------------------
 1785|    151|        rankStats[huffWeight[n]]++;
 1786|    151|        weightTotal += (1 << huffWeight[n]) >> 1;
 1787|    151|    }
 1788|      4|    if (weightTotal == 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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1788:9): [True: 0, False: 4]
  ------------------
 1789|       |
 1790|       |    /* get last non-null symbol weight (implied, total must be 2^n) */
 1791|      4|    tableLog = BITv05_highbit32(weightTotal) + 1;
 1792|      4|    if (tableLog > HUFv05_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  | 1711|      4|#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|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1792:9): [True: 0, False: 4]
  ------------------
 1793|      4|    {   /* determine last weight */
 1794|      4|        U32 total = 1 << tableLog;
 1795|      4|        U32 rest = total - weightTotal;
 1796|      4|        U32 verif = 1 << BITv05_highbit32(rest);
 1797|      4|        U32 lastWeight = BITv05_highbit32(rest) + 1;
 1798|      4|        if (verif != rest) return ERROR(corruption_detected);    /* last value must be a clean power of 2 */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1798:13): [True: 0, False: 4]
  ------------------
 1799|      4|        huffWeight[oSize] = (BYTE)lastWeight;
 1800|      4|        rankStats[lastWeight]++;
 1801|      4|    }
 1802|       |
 1803|       |    /* check tree construction validity */
 1804|      4|    if ((rankStats[1] < 2) || (rankStats[1] & 1)) return ERROR(corruption_detected);   /* by construction : at least 2 elts of rank 1, must be even */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1804:9): [True: 0, False: 4]
  |  Branch (1804:31): [True: 0, False: 4]
  ------------------
 1805|       |
 1806|       |    /* results */
 1807|      4|    *nbSymbolsPtr = (U32)(oSize+1);
 1808|      4|    *tableLogPtr = tableLog;
 1809|      4|    return iSize+1;
 1810|      4|}
zstd_v05.c:BITv05_initDStream:
  735|     64|{
  736|     64|    if (srcSize < 1) { memset(bitD, 0, sizeof(*bitD)); 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 (736:9): [True: 0, False: 64]
  ------------------
  737|       |
  738|     64|    if (srcSize >=  sizeof(size_t)) {  /* normal case */
  ------------------
  |  Branch (738:9): [True: 54, False: 10]
  ------------------
  739|     54|        U32 contain32;
  740|     54|        bitD->start = (const char*)srcBuffer;
  741|     54|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(size_t);
  742|     54|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  743|     54|        contain32 = ((const BYTE*)srcBuffer)[srcSize-1];
  744|     54|        if (contain32 == 0) return ERROR(GENERIC);   /* endMark not present */
  ------------------
  |  |   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 (744:13): [True: 2, False: 52]
  ------------------
  745|     52|        bitD->bitsConsumed = 8 - BITv05_highbit32(contain32);
  746|     52|    } else {
  747|     10|        U32 contain32;
  748|     10|        bitD->start = (const char*)srcBuffer;
  749|     10|        bitD->ptr   = bitD->start;
  750|     10|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  751|     10|        switch(srcSize)
  752|     10|        {
  753|      5|            case 7: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[6]) << (sizeof(size_t)*8 - 16);/* fall-through */
  ------------------
  |  Branch (753:13): [True: 5, False: 5]
  ------------------
  754|      5|            case 6: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[5]) << (sizeof(size_t)*8 - 24);/* fall-through */
  ------------------
  |  Branch (754:13): [True: 0, False: 10]
  ------------------
  755|      5|            case 5: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[4]) << (sizeof(size_t)*8 - 32);/* fall-through */
  ------------------
  |  Branch (755:13): [True: 0, False: 10]
  ------------------
  756|      8|            case 4: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[3]) << 24; /* fall-through */
  ------------------
  |  Branch (756:13): [True: 3, False: 7]
  ------------------
  757|      9|            case 3: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[2]) << 16; /* fall-through */
  ------------------
  |  Branch (757:13): [True: 1, False: 9]
  ------------------
  758|      9|            case 2: bitD->bitContainer += (size_t)(((const BYTE*)(bitD->start))[1]) <<  8; /* fall-through */
  ------------------
  |  Branch (758:13): [True: 0, False: 10]
  ------------------
  759|     10|            default: break;
  ------------------
  |  Branch (759:13): [True: 1, False: 9]
  ------------------
  760|     10|        }
  761|     10|        contain32 = ((const BYTE*)srcBuffer)[srcSize-1];
  762|     10|        if (contain32 == 0) return ERROR(GENERIC);   /* endMark not present */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (762:13): [True: 0, False: 10]
  ------------------
  763|     10|        bitD->bitsConsumed = 8 - BITv05_highbit32(contain32);
  764|     10|        bitD->bitsConsumed += (U32)(sizeof(size_t) - srcSize)*8;
  765|     10|    }
  766|       |
  767|     62|    return srcSize;
  768|     64|}
zstd_v05.c:HUFv05_decodeStreamX2:
 1882|      1|{
 1883|      1|    BYTE* const pStart = p;
 1884|       |
 1885|       |    /* up to 4 symbols at a time */
 1886|    256|    while ((BITv05_reloadDStream(bitDPtr) == BITv05_DStream_unfinished) && (p <= pEnd-4)) {
  ------------------
  |  Branch (1886:12): [True: 256, False: 0]
  |  Branch (1886:76): [True: 255, False: 1]
  ------------------
 1887|    255|        HUFv05_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1878|    255|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 255, False: 0]
  |  |  ------------------
  |  | 1879|    255|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    255|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1888|    255|        HUFv05_DECODE_SYMBOLX2_1(p, bitDPtr);
  ------------------
  |  | 1874|    255|    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: 255, False: 0]
  |  |  |  Branch (1874:25): [True: 0, Folded]
  |  |  ------------------
  |  | 1875|    255|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    255|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1889|    255|        HUFv05_DECODE_SYMBOLX2_2(p, bitDPtr);
  ------------------
  |  | 1878|    255|    if (MEM_64bits()) \
  |  |  ------------------
  |  |  |  Branch (1878:9): [True: 255, False: 0]
  |  |  ------------------
  |  | 1879|    255|        HUFv05_DECODE_SYMBOLX2_0(ptr, DStreamPtr)
  |  |  ------------------
  |  |  |  | 1871|    255|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  |  |  ------------------
  ------------------
 1890|    255|        HUFv05_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1871|    255|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1891|    255|    }
 1892|       |
 1893|       |    /* closer to the end */
 1894|      4|    while ((BITv05_reloadDStream(bitDPtr) == BITv05_DStream_unfinished) && (p < pEnd))
  ------------------
  |  Branch (1894:12): [True: 4, False: 0]
  |  Branch (1894:76): [True: 3, False: 1]
  ------------------
 1895|      3|        HUFv05_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1871|      3|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1896|       |
 1897|       |    /* no more data to retrieve from bitstream, hence no need to reload */
 1898|      1|    while (p < pEnd)
  ------------------
  |  Branch (1898:12): [True: 0, False: 1]
  ------------------
 1899|      0|        HUFv05_DECODE_SYMBOLX2_0(p, bitDPtr);
  ------------------
  |  | 1871|      0|    *ptr++ = HUFv05_decodeSymbolX2(DStreamPtr, dt, dtLog)
  ------------------
 1900|       |
 1901|      1|    return pEnd-pStart;
 1902|      1|}
zstd_v05.c:BITv05_endOfDStream:
  838|     31|{
  839|     31|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (839:13): [True: 26, False: 5]
  |  Branch (839:49): [True: 1, False: 25]
  ------------------
  840|     31|}
zstd_v05.c:BITv05_reloadDStream:
  806|  1.35k|{
  807|  1.35k|    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))  /* should never happen */
  ------------------
  |  Branch (807:9): [True: 9, False: 1.34k]
  ------------------
  808|      9|        return BITv05_DStream_overflow;
  809|       |
  810|  1.34k|    if (bitD->ptr >= bitD->start + sizeof(bitD->bitContainer)) {
  ------------------
  |  Branch (810:9): [True: 789, False: 552]
  ------------------
  811|    789|        bitD->ptr -= bitD->bitsConsumed >> 3;
  812|    789|        bitD->bitsConsumed &= 7;
  813|    789|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  814|    789|        return BITv05_DStream_unfinished;
  815|    789|    }
  816|    552|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (816:9): [True: 383, False: 169]
  ------------------
  817|    383|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BITv05_DStream_endOfBuffer;
  ------------------
  |  Branch (817:13): [True: 370, False: 13]
  ------------------
  818|     13|        return BITv05_DStream_completed;
  819|    383|    }
  820|    169|    {
  821|    169|        U32 nbBytes = bitD->bitsConsumed >> 3;
  822|    169|        BITv05_DStream_status result = BITv05_DStream_unfinished;
  823|    169|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (823:13): [True: 3, False: 166]
  ------------------
  824|      3|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  825|      3|            result = BITv05_DStream_endOfBuffer;
  826|      3|        }
  827|    169|        bitD->ptr -= nbBytes;
  828|    169|        bitD->bitsConsumed -= nbBytes*8;
  829|    169|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD) */
  830|    169|        return result;
  831|    552|    }
  832|    552|}
zstd_v05.c:HUFv05_decodeSymbolX2:
 1863|  1.02k|{
 1864|  1.02k|        const size_t val = BITv05_lookBitsFast(Dstream, dtLog); /* note : dtLog >= 1 */
 1865|  1.02k|        const BYTE c = dt[val].byte;
 1866|  1.02k|        BITv05_skipBits(Dstream, dt[val].nbBits);
 1867|  1.02k|        return c;
 1868|  1.02k|}
zstd_v05.c:ZSTDv05_checkContinuity:
 3330|    119|{
 3331|    119|    if (dst != dctx->previousDstEnd) {   /* not contiguous */
  ------------------
  |  Branch (3331:9): [True: 119, False: 0]
  ------------------
 3332|    119|        dctx->dictEnd = dctx->previousDstEnd;
 3333|    119|        dctx->vBase = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3334|    119|        dctx->base = dst;
 3335|    119|        dctx->previousDstEnd = dst;
 3336|    119|    }
 3337|    119|}
zstd_v05.c:ZSTDv05_decompressBlock_internal:
 3343|    142|{   /* blockType == blockCompressed */
 3344|    142|    const BYTE* ip = (const BYTE*)src;
 3345|    142|    size_t litCSize;
 3346|       |
 3347|    142|    if (srcSize >= BLOCKSIZE) return ERROR(srcSize_wrong);
  ------------------
  |  |  396|    142|#define BLOCKSIZE (128 KB)                 /* define, for static allocation */
  |  |  ------------------
  |  |  |  |  392|    142|#define KB *(1 <<10)
  |  |  ------------------
  ------------------
                  if (srcSize >= BLOCKSIZE) 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 (3347:9): [True: 9, False: 133]
  ------------------
 3348|       |
 3349|       |    /* Decode literals sub-block */
 3350|    133|    litCSize = ZSTDv05_decodeLiteralsBlock(dctx, src, srcSize);
 3351|    133|    if (ZSTDv05_isError(litCSize)) return litCSize;
  ------------------
  |  Branch (3351:9): [True: 44, False: 89]
  ------------------
 3352|     89|    ip += litCSize;
 3353|     89|    srcSize -= litCSize;
 3354|       |
 3355|     89|    return ZSTDv05_decompressSequences(dctx, dst, dstCapacity, ip, srcSize);
 3356|    133|}
zstd_v05.c:ZSTDv05_decodeLiteralsBlock:
 2812|    133|{
 2813|    133|    const BYTE* const istart = (const BYTE*) src;
 2814|       |
 2815|       |    /* any compressed block with literals segment must be at least this size */
 2816|    133|    if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  |  439|    133|#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */ + MIN_SEQUENCES_SIZE /* nbSeq==0 */)   /* for a non-null block */
  |  |  ------------------
  |  |  |  |  438|    133|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  |  |  ------------------
  ------------------
                  if (srcSize < MIN_CBLOCK_SIZE) 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 (2816:9): [True: 12, False: 121]
  ------------------
 2817|       |
 2818|    121|    switch(istart[0]>> 6)
 2819|    121|    {
 2820|     29|    case IS_HUFv05:
  ------------------
  |  |  409|     29|#define IS_HUFv05 0
  ------------------
  |  Branch (2820:5): [True: 29, False: 92]
  ------------------
 2821|     29|        {
 2822|     29|            size_t litSize, litCSize, singleStream=0;
 2823|     29|            U32 lhSize = ((istart[0]) >> 4) & 3;
 2824|     29|            if (srcSize < 5) return ERROR(corruption_detected);   /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for case 3 */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2824:17): [True: 0, False: 29]
  ------------------
 2825|     29|            switch(lhSize)
 2826|     29|            {
 2827|     25|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (2827:13): [True: 22, False: 7]
  |  Branch (2827:21): [True: 3, False: 26]
  |  Branch (2827:29): [True: 0, False: 29]
  ------------------
 2828|       |                /* 2 - 2 - 10 - 10 */
 2829|     25|                lhSize=3;
 2830|     25|                singleStream = istart[0] & 16;
 2831|     25|                litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 2832|     25|                litCSize = ((istart[1] &  3) << 8) + istart[2];
 2833|     25|                break;
 2834|      4|            case 2:
  ------------------
  |  Branch (2834:13): [True: 4, False: 25]
  ------------------
 2835|       |                /* 2 - 2 - 14 - 14 */
 2836|      4|                lhSize=4;
 2837|      4|                litSize  = ((istart[0] & 15) << 10) + (istart[1] << 2) + (istart[2] >> 6);
 2838|      4|                litCSize = ((istart[2] & 63) <<  8) + istart[3];
 2839|      4|                break;
 2840|      0|            case 3:
  ------------------
  |  Branch (2840:13): [True: 0, False: 29]
  ------------------
 2841|       |                /* 2 - 2 - 18 - 18 */
 2842|      0|                lhSize=5;
 2843|      0|                litSize  = ((istart[0] & 15) << 14) + (istart[1] << 6) + (istart[2] >> 2);
 2844|      0|                litCSize = ((istart[2] &  3) << 16) + (istart[3] << 8) + istart[4];
 2845|      0|                break;
 2846|     29|            }
 2847|     29|            if (litSize > BLOCKSIZE) return ERROR(corruption_detected);
  ------------------
  |  |  396|     29|#define BLOCKSIZE (128 KB)                 /* define, for static allocation */
  |  |  ------------------
  |  |  |  |  392|     29|#define KB *(1 <<10)
  |  |  ------------------
  ------------------
                          if (litSize > BLOCKSIZE) 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 (2847:17): [True: 0, False: 29]
  ------------------
 2848|     29|            if (litCSize + lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2848:17): [True: 0, False: 29]
  ------------------
 2849|       |
 2850|     29|            if (HUFv05_isError(singleStream ?
  ------------------
  |  Branch (2850:17): [True: 25, False: 4]
  |  Branch (2850:32): [True: 3, False: 26]
  ------------------
 2851|      3|                            HUFv05_decompress1X2(dctx->litBuffer, litSize, istart+lhSize, litCSize) :
 2852|     29|                            HUFv05_decompress   (dctx->litBuffer, litSize, istart+lhSize, litCSize) ))
 2853|     25|                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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2854|       |
 2855|      4|            dctx->litPtr = dctx->litBuffer;
 2856|      4|            dctx->litSize = litSize;
 2857|      4|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  441|      4|#define WILDCOPY_OVERLENGTH 8
  ------------------
 2858|      4|            return litCSize + lhSize;
 2859|     29|        }
 2860|      2|    case IS_PCH:
  ------------------
  |  |  410|      2|#define IS_PCH 1
  ------------------
  |  Branch (2860:5): [True: 2, False: 119]
  ------------------
 2861|      2|        {
 2862|      2|            size_t errorCode;
 2863|      2|            size_t litSize, litCSize;
 2864|      2|            U32 lhSize = ((istart[0]) >> 4) & 3;
 2865|      2|            if (lhSize != 1)  /* only case supported for now : small litSize, single stream */
  ------------------
  |  Branch (2865:17): [True: 2, False: 0]
  ------------------
 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|      0|            if (!dctx->flagStaticTables)
  ------------------
  |  Branch (2867:17): [True: 0, False: 0]
  ------------------
 2868|      0|                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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2869|       |
 2870|       |            /* 2 - 2 - 10 - 10 */
 2871|      0|            lhSize=3;
 2872|      0|            litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 2873|      0|            litCSize = ((istart[1] &  3) << 8) + istart[2];
 2874|      0|            if (litCSize + lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2874:17): [True: 0, False: 0]
  ------------------
 2875|       |
 2876|      0|            errorCode = HUFv05_decompress1X4_usingDTable(dctx->litBuffer, litSize, istart+lhSize, litCSize, dctx->hufTableX4);
 2877|      0|            if (HUFv05_isError(errorCode)) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2877:17): [True: 0, False: 0]
  ------------------
 2878|       |
 2879|      0|            dctx->litPtr = dctx->litBuffer;
 2880|      0|            dctx->litSize = litSize;
 2881|      0|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  441|      0|#define WILDCOPY_OVERLENGTH 8
  ------------------
 2882|      0|            return litCSize + lhSize;
 2883|      0|        }
 2884|     12|    case IS_RAW:
  ------------------
  |  |  411|     12|#define IS_RAW 2
  ------------------
  |  Branch (2884:5): [True: 12, False: 109]
  ------------------
 2885|     12|        {
 2886|     12|            size_t litSize;
 2887|     12|            U32 lhSize = ((istart[0]) >> 4) & 3;
 2888|     12|            switch(lhSize)
 2889|     12|            {
 2890|     10|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (2890:13): [True: 3, False: 9]
  |  Branch (2890:21): [True: 7, False: 5]
  |  Branch (2890:29): [True: 0, False: 12]
  ------------------
 2891|     10|                lhSize=1;
 2892|     10|                litSize = istart[0] & 31;
 2893|     10|                break;
 2894|      2|            case 2:
  ------------------
  |  Branch (2894:13): [True: 2, False: 10]
  ------------------
 2895|      2|                litSize = ((istart[0] & 15) << 8) + istart[1];
 2896|      2|                break;
 2897|      0|            case 3:
  ------------------
  |  Branch (2897:13): [True: 0, False: 12]
  ------------------
 2898|      0|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 2899|      0|                break;
 2900|     12|            }
 2901|       |
 2902|     12|            if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */
  ------------------
  |  |  441|     12|#define WILDCOPY_OVERLENGTH 8
  ------------------
  |  Branch (2902:17): [True: 0, False: 12]
  ------------------
 2903|      0|                if (litSize+lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2903:21): [True: 0, False: 0]
  ------------------
 2904|      0|                memcpy(dctx->litBuffer, istart+lhSize, litSize);
 2905|      0|                dctx->litPtr = dctx->litBuffer;
 2906|      0|                dctx->litSize = litSize;
 2907|      0|                memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  441|      0|#define WILDCOPY_OVERLENGTH 8
  ------------------
 2908|      0|                return lhSize+litSize;
 2909|      0|            }
 2910|       |            /* direct reference into compressed stream */
 2911|     12|            dctx->litPtr = istart+lhSize;
 2912|     12|            dctx->litSize = litSize;
 2913|     12|            return lhSize+litSize;
 2914|     12|        }
 2915|     78|    case IS_RLE:
  ------------------
  |  |  412|     78|#define IS_RLE 3
  ------------------
  |  Branch (2915:5): [True: 78, False: 43]
  ------------------
 2916|     78|        {
 2917|     78|            size_t litSize;
 2918|     78|            U32 lhSize = ((istart[0]) >> 4) & 3;
 2919|     78|            switch(lhSize)
 2920|     78|            {
 2921|     24|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (2921:13): [True: 5, False: 73]
  |  Branch (2921:21): [True: 19, False: 59]
  |  Branch (2921:29): [True: 0, False: 78]
  ------------------
 2922|     24|                lhSize = 1;
 2923|     24|                litSize = istart[0] & 31;
 2924|     24|                break;
 2925|     44|            case 2:
  ------------------
  |  Branch (2925:13): [True: 44, False: 34]
  ------------------
 2926|     44|                litSize = ((istart[0] & 15) << 8) + istart[1];
 2927|     44|                break;
 2928|     10|            case 3:
  ------------------
  |  Branch (2928:13): [True: 10, False: 68]
  ------------------
 2929|     10|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 2930|     10|                if (srcSize<4) return ERROR(corruption_detected);   /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need lhSize+1 = 4 */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2930:21): [True: 0, False: 10]
  ------------------
 2931|     10|                break;
 2932|     78|            }
 2933|     78|            if (litSize > BLOCKSIZE) return ERROR(corruption_detected);
  ------------------
  |  |  396|     78|#define BLOCKSIZE (128 KB)                 /* define, for static allocation */
  |  |  ------------------
  |  |  |  |  392|     78|#define KB *(1 <<10)
  |  |  ------------------
  ------------------
                          if (litSize > BLOCKSIZE) 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 (2933:17): [True: 5, False: 73]
  ------------------
 2934|     73|            memset(dctx->litBuffer, istart[lhSize], litSize + WILDCOPY_OVERLENGTH);
  ------------------
  |  |  441|     73|#define WILDCOPY_OVERLENGTH 8
  ------------------
 2935|     73|            dctx->litPtr = dctx->litBuffer;
 2936|     73|            dctx->litSize = litSize;
 2937|     73|            return lhSize+1;
 2938|     78|        }
 2939|      0|    default:
  ------------------
  |  Branch (2939:5): [True: 0, False: 121]
  ------------------
 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|    121|    }
 2942|    121|}
zstd_v05.c:ZSTDv05_decompressSequences:
 3260|     89|{
 3261|     89|    const BYTE* ip = (const BYTE*)seqStart;
 3262|     89|    const BYTE* const iend = ip + seqSize;
 3263|     89|    BYTE* const ostart = (BYTE*)dst;
 3264|     89|    BYTE* op = ostart;
 3265|     89|    BYTE* const oend = ostart + maxDstSize;
 3266|     89|    size_t errorCode, dumpsLength=0;
 3267|     89|    const BYTE* litPtr = dctx->litPtr;
 3268|     89|    const BYTE* const litEnd = litPtr + dctx->litSize;
 3269|     89|    int nbSeq=0;
 3270|     89|    const BYTE* dumps = NULL;
 3271|     89|    unsigned* DTableLL = dctx->LLTable;
 3272|     89|    unsigned* DTableML = dctx->MLTable;
 3273|     89|    unsigned* DTableOffb = dctx->OffTable;
 3274|     89|    const BYTE* const base = (const BYTE*) (dctx->base);
 3275|     89|    const BYTE* const vBase = (const BYTE*) (dctx->vBase);
 3276|     89|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 3277|       |
 3278|       |    /* Build Decoding Tables */
 3279|     89|    errorCode = ZSTDv05_decodeSeqHeaders(&nbSeq, &dumps, &dumpsLength,
 3280|     89|                                      DTableLL, DTableML, DTableOffb,
 3281|     89|                                      ip, seqSize, dctx->flagStaticTables);
 3282|     89|    if (ZSTDv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (3282:9): [True: 1, False: 88]
  ------------------
 3283|     88|    ip += errorCode;
 3284|       |
 3285|       |    /* Regen sequences */
 3286|     88|    if (nbSeq) {
  ------------------
  |  Branch (3286:9): [True: 61, False: 27]
  ------------------
 3287|     61|        seq_t sequence;
 3288|     61|        seqState_t seqState;
 3289|       |
 3290|     61|        memset(&sequence, 0, sizeof(sequence));
 3291|     61|        sequence.offset = REPCODE_STARTVALUE;
  ------------------
  |  |  415|     61|#define REPCODE_STARTVALUE 1
  ------------------
 3292|     61|        seqState.dumps = dumps;
 3293|     61|        seqState.dumpsEnd = dumps + dumpsLength;
 3294|     61|        seqState.prevOffset = REPCODE_STARTVALUE;
  ------------------
  |  |  415|     61|#define REPCODE_STARTVALUE 1
  ------------------
 3295|     61|        errorCode = BITv05_initDStream(&(seqState.DStream), ip, iend-ip);
 3296|     61|        if (ERR_isError(errorCode)) 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 (3296:13): [True: 2, False: 59]
  ------------------
 3297|     59|        FSEv05_initDState(&(seqState.stateLL), &(seqState.DStream), DTableLL);
 3298|     59|        FSEv05_initDState(&(seqState.stateOffb), &(seqState.DStream), DTableOffb);
 3299|     59|        FSEv05_initDState(&(seqState.stateML), &(seqState.DStream), DTableML);
 3300|       |
 3301|    814|        for ( ; (BITv05_reloadDStream(&(seqState.DStream)) <= BITv05_DStream_completed) && nbSeq ; ) {
  ------------------
  |  Branch (3301:17): [True: 806, False: 8]
  |  Branch (3301:92): [True: 795, False: 11]
  ------------------
 3302|    795|            size_t oneSeqSize;
 3303|    795|            nbSeq--;
 3304|    795|            ZSTDv05_decodeSequence(&sequence, &seqState);
 3305|    795|            oneSeqSize = ZSTDv05_execSequence(op, oend, sequence, &litPtr, litEnd, base, vBase, dictEnd);
 3306|    795|            if (ZSTDv05_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  Branch (3306:17): [True: 40, False: 755]
  ------------------
 3307|    755|            op += oneSeqSize;
 3308|    755|        }
 3309|       |
 3310|       |        /* check if reached exact end */
 3311|     19|        if (nbSeq) 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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3311:13): [True: 8, False: 11]
  ------------------
 3312|     19|    }
 3313|       |
 3314|       |    /* last literal segment */
 3315|     38|    {
 3316|     38|        size_t lastLLSize = litEnd - litPtr;
 3317|     38|        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: 38]
  ------------------
 3318|     38|        if (op+lastLLSize > oend) 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 (3318:13): [True: 0, False: 38]
  ------------------
 3319|     38|        if (lastLLSize > 0) {
  ------------------
  |  Branch (3319:13): [True: 37, False: 1]
  ------------------
 3320|     37|            memcpy(op, litPtr, lastLLSize);
 3321|     37|            op += lastLLSize;
 3322|     37|        }
 3323|     38|    }
 3324|       |
 3325|      0|    return op-ostart;
 3326|     38|}
zstd_v05.c:ZSTDv05_decodeSeqHeaders:
 2948|     89|{
 2949|     89|    const BYTE* const istart = (const BYTE*)src;
 2950|     89|    const BYTE* ip = istart;
 2951|     89|    const BYTE* const iend = istart + srcSize;
 2952|     89|    U32 LLtype, Offtype, MLtype;
 2953|     89|    unsigned LLlog, Offlog, MLlog;
 2954|     89|    size_t dumpsLength;
 2955|       |
 2956|       |    /* check */
 2957|     89|    if (srcSize < MIN_SEQUENCES_SIZE)
  ------------------
  |  |  438|     89|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  ------------------
  |  Branch (2957:9): [True: 0, False: 89]
  ------------------
 2958|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2959|       |
 2960|       |    /* SeqHead */
 2961|     89|    *nbSeq = *ip++;
 2962|     89|    if (*nbSeq==0) return 1;
  ------------------
  |  Branch (2962:9): [True: 27, False: 62]
  ------------------
 2963|     62|    if (*nbSeq >= 128) {
  ------------------
  |  Branch (2963:9): [True: 17, False: 45]
  ------------------
 2964|     17|        if (ip >= iend) 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 (2964:13): [True: 0, False: 17]
  ------------------
 2965|     17|        *nbSeq = ((nbSeq[0]-128)<<8) + *ip++;
 2966|     17|    }
 2967|       |
 2968|     62|    if (ip >= iend) 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 (2968:9): [True: 0, False: 62]
  ------------------
 2969|     62|    LLtype  = *ip >> 6;
 2970|     62|    Offtype = (*ip >> 4) & 3;
 2971|     62|    MLtype  = (*ip >> 2) & 3;
 2972|     62|    if (*ip & 2) {
  ------------------
  |  Branch (2972:9): [True: 31, False: 31]
  ------------------
 2973|     31|        if (ip+3 > iend) 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 (2973:13): [True: 0, False: 31]
  ------------------
 2974|     31|        dumpsLength  = ip[2];
 2975|     31|        dumpsLength += ip[1] << 8;
 2976|     31|        ip += 3;
 2977|     31|    } else {
 2978|     31|        if (ip+2 > iend) 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 (2978:13): [True: 0, False: 31]
  ------------------
 2979|     31|        dumpsLength  = ip[1];
 2980|     31|        dumpsLength += (ip[0] & 1) << 8;
 2981|     31|        ip += 2;
 2982|     31|    }
 2983|     62|    *dumpsPtr = ip;
 2984|     62|    ip += dumpsLength;
 2985|     62|    *dumpsLengthPtr = dumpsLength;
 2986|       |
 2987|       |    /* check */
 2988|     62|    if (ip > iend-3) return ERROR(srcSize_wrong); /* min : all 3 are "raw", hence no header, but at least xxLog bits per type */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2988:9): [True: 0, False: 62]
  ------------------
 2989|       |
 2990|       |    /* sequences */
 2991|     62|    {
 2992|     62|        S16 norm[MaxML+1];    /* assumption : MaxML >= MaxLL >= MaxOff */
 2993|     62|        size_t headerSize;
 2994|       |
 2995|       |        /* Build DTables */
 2996|     62|        switch(LLtype)
 2997|     62|        {
 2998|     19|        case FSEv05_ENCODING_RLE :
  ------------------
  |  |  431|     19|#define FSEv05_ENCODING_RLE     1
  ------------------
  |  Branch (2998:9): [True: 19, False: 43]
  ------------------
 2999|     19|            LLlog = 0;
 3000|     19|            FSEv05_buildDTable_rle(DTableLL, *ip++);
 3001|     19|            break;
 3002|     32|        case FSEv05_ENCODING_RAW :
  ------------------
  |  |  430|     32|#define FSEv05_ENCODING_RAW     0
  ------------------
  |  Branch (3002:9): [True: 32, False: 30]
  ------------------
 3003|     32|            LLlog = LLbits;
  ------------------
  |  |  419|     32|#define LLbits   6
  ------------------
 3004|     32|            FSEv05_buildDTable_raw(DTableLL, LLbits);
  ------------------
  |  |  419|     32|#define LLbits   6
  ------------------
 3005|     32|            break;
 3006|      0|        case FSEv05_ENCODING_STATIC:
  ------------------
  |  |  432|      0|#define FSEv05_ENCODING_STATIC  2
  ------------------
  |  Branch (3006:9): [True: 0, False: 62]
  ------------------
 3007|      0|            if (!flagStaticTable) 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 (3007:17): [True: 0, False: 0]
  ------------------
 3008|      0|            break;
 3009|     11|        case FSEv05_ENCODING_DYNAMIC :
  ------------------
  |  |  433|     11|#define FSEv05_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3009:9): [True: 11, False: 51]
  ------------------
 3010|     11|        default :   /* impossible */
  ------------------
  |  Branch (3010:9): [True: 0, False: 62]
  ------------------
 3011|     11|            {   unsigned max = MaxLL;
  ------------------
  |  |  423|     11|#define MaxLL  ((1<<LLbits) - 1)
  |  |  ------------------
  |  |  |  |  419|     11|#define LLbits   6
  |  |  ------------------
  ------------------
 3012|     11|                headerSize = FSEv05_readNCount(norm, &max, &LLlog, ip, iend-ip);
 3013|     11|                if (FSEv05_isError(headerSize)) 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 (3013:21): [True: 0, False: 11]
  ------------------
 3014|     11|                if (LLlog > LLFSEv05Log) return ERROR(corruption_detected);
  ------------------
  |  |  426|     11|#define LLFSEv05Log   10
  ------------------
                              if (LLlog > LLFSEv05Log) 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 (3014:21): [True: 0, False: 11]
  ------------------
 3015|     11|                ip += headerSize;
 3016|     11|                FSEv05_buildDTable(DTableLL, norm, max, LLlog);
 3017|     11|        }   }
 3018|       |
 3019|     62|        switch(Offtype)
 3020|     62|        {
 3021|     12|        case FSEv05_ENCODING_RLE :
  ------------------
  |  |  431|     12|#define FSEv05_ENCODING_RLE     1
  ------------------
  |  Branch (3021:9): [True: 12, False: 50]
  ------------------
 3022|     12|            Offlog = 0;
 3023|     12|            if (ip > iend-2) return ERROR(srcSize_wrong);   /* min : "raw", hence no header, but at least xxLog bits */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3023:17): [True: 0, False: 12]
  ------------------
 3024|     12|            FSEv05_buildDTable_rle(DTableOffb, *ip++ & MaxOff); /* if *ip > MaxOff, data is corrupted */
  ------------------
  |  |  424|     12|#define MaxOff ((1<<Offbits)- 1)
  |  |  ------------------
  |  |  |  |  420|     12|#define Offbits  5
  |  |  ------------------
  ------------------
 3025|     12|            break;
 3026|     14|        case FSEv05_ENCODING_RAW :
  ------------------
  |  |  430|     14|#define FSEv05_ENCODING_RAW     0
  ------------------
  |  Branch (3026:9): [True: 14, False: 48]
  ------------------
 3027|     14|            Offlog = Offbits;
  ------------------
  |  |  420|     14|#define Offbits  5
  ------------------
 3028|     14|            FSEv05_buildDTable_raw(DTableOffb, Offbits);
  ------------------
  |  |  420|     14|#define Offbits  5
  ------------------
 3029|     14|            break;
 3030|      1|        case FSEv05_ENCODING_STATIC:
  ------------------
  |  |  432|      1|#define FSEv05_ENCODING_STATIC  2
  ------------------
  |  Branch (3030:9): [True: 1, False: 61]
  ------------------
 3031|      1|            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 (3031:17): [True: 1, False: 0]
  ------------------
 3032|      0|            break;
 3033|     35|        case FSEv05_ENCODING_DYNAMIC :
  ------------------
  |  |  433|     35|#define FSEv05_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3033:9): [True: 35, False: 27]
  ------------------
 3034|     35|        default :   /* impossible */
  ------------------
  |  Branch (3034:9): [True: 0, False: 62]
  ------------------
 3035|     35|            {   unsigned max = MaxOff;
  ------------------
  |  |  424|     35|#define MaxOff ((1<<Offbits)- 1)
  |  |  ------------------
  |  |  |  |  420|     35|#define Offbits  5
  |  |  ------------------
  ------------------
 3036|     35|                headerSize = FSEv05_readNCount(norm, &max, &Offlog, ip, iend-ip);
 3037|     35|                if (FSEv05_isError(headerSize)) 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 (3037:21): [True: 0, False: 35]
  ------------------
 3038|     35|                if (Offlog > OffFSEv05Log) return ERROR(corruption_detected);
  ------------------
  |  |  427|     35|#define OffFSEv05Log   9
  ------------------
                              if (Offlog > OffFSEv05Log) 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 (3038:21): [True: 0, False: 35]
  ------------------
 3039|     35|                ip += headerSize;
 3040|     35|                FSEv05_buildDTable(DTableOffb, norm, max, Offlog);
 3041|     35|        }   }
 3042|       |
 3043|     61|        switch(MLtype)
 3044|     61|        {
 3045|     25|        case FSEv05_ENCODING_RLE :
  ------------------
  |  |  431|     25|#define FSEv05_ENCODING_RLE     1
  ------------------
  |  Branch (3045:9): [True: 25, False: 36]
  ------------------
 3046|     25|            MLlog = 0;
 3047|     25|            if (ip > iend-2) return ERROR(srcSize_wrong); /* min : "raw", hence no header, but at least xxLog bits */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3047:17): [True: 0, False: 25]
  ------------------
 3048|     25|            FSEv05_buildDTable_rle(DTableML, *ip++);
 3049|     25|            break;
 3050|     23|        case FSEv05_ENCODING_RAW :
  ------------------
  |  |  430|     23|#define FSEv05_ENCODING_RAW     0
  ------------------
  |  Branch (3050:9): [True: 23, False: 38]
  ------------------
 3051|     23|            MLlog = MLbits;
  ------------------
  |  |  418|     23|#define MLbits   7
  ------------------
 3052|     23|            FSEv05_buildDTable_raw(DTableML, MLbits);
  ------------------
  |  |  418|     23|#define MLbits   7
  ------------------
 3053|     23|            break;
 3054|      0|        case FSEv05_ENCODING_STATIC:
  ------------------
  |  |  432|      0|#define FSEv05_ENCODING_STATIC  2
  ------------------
  |  Branch (3054:9): [True: 0, False: 61]
  ------------------
 3055|      0|            if (!flagStaticTable) 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 (3055:17): [True: 0, False: 0]
  ------------------
 3056|      0|            break;
 3057|     13|        case FSEv05_ENCODING_DYNAMIC :
  ------------------
  |  |  433|     13|#define FSEv05_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3057:9): [True: 13, False: 48]
  ------------------
 3058|     13|        default :   /* impossible */
  ------------------
  |  Branch (3058:9): [True: 0, False: 61]
  ------------------
 3059|     13|            {   unsigned max = MaxML;
  ------------------
  |  |  422|     13|#define MaxML  ((1<<MLbits) - 1)
  |  |  ------------------
  |  |  |  |  418|     13|#define MLbits   7
  |  |  ------------------
  ------------------
 3060|     13|                headerSize = FSEv05_readNCount(norm, &max, &MLlog, ip, iend-ip);
 3061|     13|                if (FSEv05_isError(headerSize)) 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 (3061:21): [True: 0, False: 13]
  ------------------
 3062|     13|                if (MLlog > MLFSEv05Log) return ERROR(corruption_detected);
  ------------------
  |  |  425|     13|#define MLFSEv05Log   10
  ------------------
                              if (MLlog > MLFSEv05Log) 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 (3062:21): [True: 0, False: 13]
  ------------------
 3063|     13|                ip += headerSize;
 3064|     13|                FSEv05_buildDTable(DTableML, norm, max, MLlog);
 3065|     13|    }   }   }
 3066|       |
 3067|     61|    return ip-istart;
 3068|     61|}
zstd_v05.c:ZSTDv05_decodeSequence:
 3090|    795|{
 3091|    795|    size_t litLength;
 3092|    795|    size_t prevOffset;
 3093|    795|    size_t offset;
 3094|    795|    size_t matchLength;
 3095|    795|    const BYTE* dumps = seqState->dumps;
 3096|    795|    const BYTE* const de = seqState->dumpsEnd;
 3097|       |
 3098|       |    /* Literal length */
 3099|    795|    litLength = FSEv05_peakSymbol(&(seqState->stateLL));
 3100|    795|    prevOffset = litLength ? seq->offset : seqState->prevOffset;
  ------------------
  |  Branch (3100:18): [True: 545, False: 250]
  ------------------
 3101|    795|    if (litLength == MaxLL) {
  ------------------
  |  |  423|    795|#define MaxLL  ((1<<LLbits) - 1)
  |  |  ------------------
  |  |  |  |  419|    795|#define LLbits   6
  |  |  ------------------
  ------------------
  |  Branch (3101:9): [True: 28, False: 767]
  ------------------
 3102|     28|        const U32 add = *dumps++;
 3103|     28|        if (add < 255) litLength += add;
  ------------------
  |  Branch (3103:13): [True: 27, False: 1]
  ------------------
 3104|      1|        else if (dumps + 2 <= de) {
  ------------------
  |  Branch (3104:18): [True: 1, False: 0]
  ------------------
 3105|      1|            litLength = MEM_readLE16(dumps);
 3106|      1|            dumps += 2;
 3107|      1|            if ((litLength & 1) && dumps < de) {
  ------------------
  |  Branch (3107:17): [True: 0, False: 1]
  |  Branch (3107:36): [True: 0, False: 0]
  ------------------
 3108|      0|                litLength += *dumps << 16;
 3109|      0|                dumps += 1;
 3110|      0|            }
 3111|      1|            litLength>>=1;
 3112|      1|        }
 3113|     28|        if (dumps >= de) { dumps = de-1; }  /* late correction, to avoid read overflow (data is now corrupted anyway) */
  ------------------
  |  Branch (3113:13): [True: 20, False: 8]
  ------------------
 3114|     28|    }
 3115|       |
 3116|       |    /* Offset */
 3117|    795|    {
 3118|    795|        static const U32 offsetPrefix[MaxOff+1] = {
 3119|    795|                1 /*fake*/, 1, 2, 4, 8, 16, 32, 64, 128, 256,
 3120|    795|                512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144,
 3121|    795|                524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, /*fake*/ 1, 1, 1, 1, 1 };
 3122|    795|        U32 offsetCode = FSEv05_peakSymbol(&(seqState->stateOffb));   /* <= maxOff, by table construction */
 3123|    795|        U32 nbBits = offsetCode - 1;
 3124|    795|        if (offsetCode==0) nbBits = 0;   /* cmove */
  ------------------
  |  Branch (3124:13): [True: 266, False: 529]
  ------------------
 3125|    795|        offset = offsetPrefix[offsetCode] + BITv05_readBits(&(seqState->DStream), nbBits);
 3126|    795|        if (MEM_32bits()) BITv05_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3126:13): [True: 0, False: 795]
  ------------------
 3127|    795|        if (offsetCode==0) offset = prevOffset;   /* repcode, cmove */
  ------------------
  |  Branch (3127:13): [True: 266, False: 529]
  ------------------
 3128|    795|        if (offsetCode | !litLength) seqState->prevOffset = seq->offset;   /* cmove */
  ------------------
  |  Branch (3128:13): [True: 615, False: 180]
  ------------------
 3129|    795|        FSEv05_decodeSymbol(&(seqState->stateOffb), &(seqState->DStream));    /* update */
 3130|    795|    }
 3131|       |
 3132|       |    /* Literal length update */
 3133|    795|    FSEv05_decodeSymbol(&(seqState->stateLL), &(seqState->DStream));   /* update */
 3134|    795|    if (MEM_32bits()) BITv05_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3134:9): [True: 0, False: 795]
  ------------------
 3135|       |
 3136|       |    /* MatchLength */
 3137|    795|    matchLength = FSEv05_decodeSymbol(&(seqState->stateML), &(seqState->DStream));
 3138|    795|    if (matchLength == MaxML) {
  ------------------
  |  |  422|    795|#define MaxML  ((1<<MLbits) - 1)
  |  |  ------------------
  |  |  |  |  418|    795|#define MLbits   7
  |  |  ------------------
  ------------------
  |  Branch (3138:9): [True: 41, False: 754]
  ------------------
 3139|     41|        const U32 add = dumps<de ? *dumps++ : 0;
  ------------------
  |  Branch (3139:25): [True: 37, False: 4]
  ------------------
 3140|     41|        if (add < 255) matchLength += add;
  ------------------
  |  Branch (3140:13): [True: 41, False: 0]
  ------------------
 3141|      0|        else if (dumps + 2 <= de) {
  ------------------
  |  Branch (3141:18): [True: 0, False: 0]
  ------------------
 3142|      0|            matchLength = MEM_readLE16(dumps);
 3143|      0|            dumps += 2;
 3144|      0|            if ((matchLength & 1) && dumps < de) {
  ------------------
  |  Branch (3144:17): [True: 0, False: 0]
  |  Branch (3144:38): [True: 0, False: 0]
  ------------------
 3145|      0|                matchLength += *dumps << 16;
 3146|      0|                dumps += 1;
 3147|      0|            }
 3148|      0|            matchLength >>= 1;
 3149|      0|        }
 3150|     41|        if (dumps >= de) { dumps = de-1; }  /* late correction, to avoid read overflow (data is now corrupted anyway) */
  ------------------
  |  Branch (3150:13): [True: 27, False: 14]
  ------------------
 3151|     41|    }
 3152|    795|    matchLength += MINMATCH;
  ------------------
  |  |  414|    795|#define MINMATCH 4
  ------------------
 3153|       |
 3154|       |    /* save result */
 3155|    795|    seq->litLength = litLength;
 3156|    795|    seq->offset = offset;
 3157|    795|    seq->matchLength = matchLength;
 3158|    795|    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|    795|}
zstd_v05.c:FSEv05_peakSymbol:
  960|  1.59k|{
  961|  1.59k|    const FSEv05_decode_t DInfo = ((const FSEv05_decode_t*)(DStatePtr->table))[DStatePtr->state];
  962|  1.59k|    return DInfo.symbol;
  963|  1.59k|}
zstd_v05.c:ZSTDv05_execSequence:
 3175|    795|{
 3176|    795|    static const int dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
 3177|    795|    static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
 3178|    795|    BYTE* const oLitEnd = op + sequence.litLength;
 3179|    795|    const size_t sequenceLength = sequence.litLength + sequence.matchLength;
 3180|    795|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 3181|    795|    BYTE* const oend_8 = oend-8;
 3182|    795|    const BYTE* const litEnd = *litPtr + sequence.litLength;
 3183|    795|    const BYTE* match = oLitEnd - sequence.offset;
 3184|       |
 3185|       |    /* checks */
 3186|    795|    size_t const seqLength = sequence.litLength + sequence.matchLength;
 3187|       |
 3188|    795|    if (seqLength > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|     26|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     26|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     26|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3188:9): [True: 26, False: 769]
  ------------------
 3189|    769|    if (sequence.litLength > (size_t)(litLimit - *litPtr)) 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 (3189:9): [True: 5, False: 764]
  ------------------
 3190|       |    /* Now we know there are no overflow in literal nor match lengths, can use pointer checks */
 3191|    764|    if (oLitEnd > oend_8) 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 (3191:9): [True: 2, False: 762]
  ------------------
 3192|       |
 3193|    762|    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: 762]
  ------------------
 3194|    762|    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: 762]
  ------------------
 3195|       |
 3196|       |    /* copy Literals */
 3197|    762|    ZSTDv05_wildcopy(op, *litPtr, (ptrdiff_t)sequence.litLength);   /* note : oLitEnd <= oend-8 : no risk of overwrite beyond oend */
 3198|    762|    op = oLitEnd;
 3199|    762|    *litPtr = litEnd;   /* update for next sequence */
 3200|       |
 3201|       |    /* copy Match */
 3202|    762|    if (sequence.offset > (size_t)(oLitEnd - base)) {
  ------------------
  |  Branch (3202:9): [True: 27, False: 735]
  ------------------
 3203|       |        /* offset beyond prefix */
 3204|     27|        if (sequence.offset > (size_t)(oLitEnd - vBase))
  ------------------
  |  Branch (3204:13): [True: 7, False: 20]
  ------------------
 3205|      7|            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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3206|     20|        match = dictEnd - (base-match);
 3207|     20|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (3207:13): [True: 5, False: 15]
  ------------------
 3208|      5|            memmove(oLitEnd, match, sequence.matchLength);
 3209|      5|            return sequenceLength;
 3210|      5|        }
 3211|       |        /* span extDict & currentPrefixSegment */
 3212|     15|        {
 3213|     15|            size_t length1 = dictEnd - match;
 3214|     15|            memmove(oLitEnd, match, length1);
 3215|     15|            op = oLitEnd + length1;
 3216|     15|            sequence.matchLength -= length1;
 3217|     15|            match = base;
 3218|     15|            if (op > oend_8 || sequence.matchLength < MINMATCH) {
  ------------------
  |  |  414|     15|#define MINMATCH 4
  ------------------
  |  Branch (3218:17): [True: 0, False: 15]
  |  Branch (3218:32): [True: 4, False: 11]
  ------------------
 3219|     15|              while (op < oMatchEnd) *op++ = *match++;
  ------------------
  |  Branch (3219:22): [True: 11, False: 4]
  ------------------
 3220|      4|              return sequenceLength;
 3221|      4|            }
 3222|     15|    }   }
 3223|       |    /* Requirement: op <= oend_8 */
 3224|       |
 3225|       |    /* match within prefix */
 3226|    746|    if (sequence.offset < 8) {
  ------------------
  |  Branch (3226:9): [True: 477, False: 269]
  ------------------
 3227|       |        /* close range match, overlap */
 3228|    477|        const int sub2 = dec64table[sequence.offset];
 3229|    477|        op[0] = match[0];
 3230|    477|        op[1] = match[1];
 3231|    477|        op[2] = match[2];
 3232|    477|        op[3] = match[3];
 3233|    477|        match += dec32table[sequence.offset];
 3234|    477|        ZSTDv05_copy4(op+4, match);
 3235|    477|        match -= sub2;
 3236|    477|    } else {
 3237|    269|        ZSTDv05_copy8(op, match);
 3238|    269|    }
 3239|    746|    op += 8; match += 8;
 3240|       |
 3241|    746|    if (oMatchEnd > oend-(16-MINMATCH)) {
  ------------------
  |  |  414|    746|#define MINMATCH 4
  ------------------
  |  Branch (3241:9): [True: 10, False: 736]
  ------------------
 3242|     10|        if (op < oend_8) {
  ------------------
  |  Branch (3242:13): [True: 6, False: 4]
  ------------------
 3243|      6|            ZSTDv05_wildcopy(op, match, oend_8 - op);
 3244|      6|            match += oend_8 - op;
 3245|      6|            op = oend_8;
 3246|      6|        }
 3247|     35|        while (op < oMatchEnd)
  ------------------
  |  Branch (3247:16): [True: 25, False: 10]
  ------------------
 3248|     25|            *op++ = *match++;
 3249|    736|    } else {
 3250|    736|        ZSTDv05_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8);   /* works even if matchLength < 8 */
 3251|    736|    }
 3252|    746|    return sequenceLength;
 3253|    762|}
zstd_v05.c:ZSTDv05_wildcopy:
  458|  1.50k|{
  459|  1.50k|    const BYTE* ip = (const BYTE*)src;
  460|  1.50k|    BYTE* op = (BYTE*)dst;
  461|  1.50k|    BYTE* const oend = op + length;
  462|  1.50k|    do
  463|  3.98k|        COPY8(op, ip)
  ------------------
  |  |  453|  3.98k|#define COPY8(d,s) { ZSTDv05_copy8(d,s); d+=8; s+=8; }
  ------------------
  464|  3.98k|    while (op < oend);
  ------------------
  |  Branch (464:12): [True: 2.48k, False: 1.50k]
  ------------------
  465|  1.50k|}
zstd_v05.c:ZSTDv05_copy4:
 2569|    477|static void ZSTDv05_copy4(void* dst, const void* src) { memcpy(dst, src, 4); }
zstd_v05.c:ZSTDv05_copy8:
  451|  4.25k|static void ZSTDv05_copy8(void* dst, const void* src) { memcpy(dst, src, 8); }
zstd_v05.c:ZSTDv05_decompress_continueDCtx:
 3373|    119|{
 3374|    119|    const BYTE* ip = (const BYTE*)src;
 3375|    119|    const BYTE* iend = ip + srcSize;
 3376|    119|    BYTE* const ostart = (BYTE*)dst;
 3377|    119|    BYTE* op = ostart;
 3378|    119|    BYTE* const oend = ostart + maxDstSize;
 3379|    119|    size_t remainingSize = srcSize;
 3380|    119|    blockProperties_t blockProperties;
 3381|    119|    memset(&blockProperties, 0, sizeof(blockProperties));
 3382|       |
 3383|       |    /* Frame Header */
 3384|    119|    {   size_t frameHeaderSize;
 3385|    119|        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: 119]
  ------------------
 3386|    119|        frameHeaderSize = ZSTDv05_decodeFrameHeader_Part1(dctx, src, ZSTDv05_frameHeaderSize_min);
 3387|    119|        if (ZSTDv05_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  Branch (3387:13): [True: 0, False: 119]
  ------------------
 3388|    119|        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: 119]
  ------------------
 3389|    119|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3390|    119|        frameHeaderSize = ZSTDv05_decodeFrameHeader_Part2(dctx, src, frameHeaderSize);
 3391|    119|        if (ZSTDv05_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  Branch (3391:13): [True: 2, False: 117]
  ------------------
 3392|    119|    }
 3393|       |
 3394|       |    /* Loop on each block */
 3395|    248|    while (1)
  ------------------
  |  Branch (3395:12): [True: 248, Folded]
  ------------------
 3396|    248|    {
 3397|    248|        size_t decodedSize=0;
 3398|    248|        size_t cBlockSize = ZSTDv05_getcBlockSize(ip, iend-ip, &blockProperties);
 3399|    248|        if (ZSTDv05_isError(cBlockSize)) return cBlockSize;
  ------------------
  |  Branch (3399:13): [True: 0, False: 248]
  ------------------
 3400|       |
 3401|    248|        ip += ZSTDv05_blockHeaderSize;
 3402|    248|        remainingSize -= ZSTDv05_blockHeaderSize;
 3403|    248|        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: 248]
  ------------------
 3404|       |
 3405|    248|        switch(blockProperties.blockType)
 3406|    248|        {
 3407|    142|        case bt_compressed:
  ------------------
  |  Branch (3407:9): [True: 142, False: 106]
  ------------------
 3408|    142|            decodedSize = ZSTDv05_decompressBlock_internal(dctx, op, oend-op, ip, cBlockSize);
 3409|    142|            break;
 3410|     98|        case bt_raw :
  ------------------
  |  Branch (3410:9): [True: 98, False: 150]
  ------------------
 3411|     98|            decodedSize = ZSTDv05_copyRawBlock(op, oend-op, ip, cBlockSize);
 3412|     98|            break;
 3413|      1|        case bt_rle :
  ------------------
  |  Branch (3413:9): [True: 1, False: 247]
  ------------------
 3414|      1|            return ERROR(GENERIC);   /* not yet supported */
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3415|      0|            break;
 3416|      7|        case bt_end :
  ------------------
  |  Branch (3416:9): [True: 7, False: 241]
  ------------------
 3417|       |            /* end of frame */
 3418|      7|            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: 7]
  ------------------
 3419|      7|            break;
 3420|      7|        default:
  ------------------
  |  Branch (3420:9): [True: 0, False: 248]
  ------------------
 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|    248|        }
 3423|    247|        if (cBlockSize == 0) break;   /* bt_end */
  ------------------
  |  Branch (3423:13): [True: 20, False: 227]
  ------------------
 3424|       |
 3425|    227|        if (ZSTDv05_isError(decodedSize)) return decodedSize;
  ------------------
  |  Branch (3425:13): [True: 96, False: 131]
  ------------------
 3426|    131|        op += decodedSize;
 3427|    131|        ip += cBlockSize;
 3428|    131|        remainingSize -= cBlockSize;
 3429|    131|    }
 3430|       |
 3431|     20|    return op-ostart;
 3432|    117|}
zstd_v05.c:ZSTD_errorFrameSizeInfoLegacy:
 3479|      4|{
 3480|      4|    *cSize = ret;
 3481|      4|    *dBound = ZSTD_CONTENTSIZE_ERROR;
  ------------------
  |  |  443|      4|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
 3482|      4|}
zstd_v05.c:ZSTDv05_getcBlockSize:
 2779|    750|{
 2780|    750|    const BYTE* const in = (const BYTE*)src;
 2781|    750|    BYTE headerFlags;
 2782|    750|    U32 cSize;
 2783|       |
 2784|    750|    if (srcSize < 3)
  ------------------
  |  Branch (2784:9): [True: 0, False: 750]
  ------------------
 2785|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2786|       |
 2787|    750|    headerFlags = *in;
 2788|    750|    cSize = in[2] + (in[1]<<8) + ((in[0] & 7)<<16);
 2789|       |
 2790|    750|    bpPtr->blockType = (blockType_t)(headerFlags >> 6);
 2791|    750|    bpPtr->origSize = (bpPtr->blockType == bt_rle) ? cSize : 0;
  ------------------
  |  Branch (2791:23): [True: 13, False: 737]
  ------------------
 2792|       |
 2793|    750|    if (bpPtr->blockType == bt_end) return 0;
  ------------------
  |  Branch (2793:9): [True: 73, False: 677]
  ------------------
 2794|    677|    if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (2794:9): [True: 13, False: 664]
  ------------------
 2795|    664|    return cSize;
 2796|    677|}
zstd_v05.c:ZSTDv05_decodeFrameHeader_Part1:
 2740|    119|{
 2741|    119|    U32 magicNumber;
 2742|    119|    if (srcSize != ZSTDv05_frameHeaderSize_min)
  ------------------
  |  Branch (2742:9): [True: 0, False: 119]
  ------------------
 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|    119|    magicNumber = MEM_readLE32(src);
 2745|    119|    if (magicNumber != ZSTDv05_MAGICNUMBER) return ERROR(prefix_unknown);
  ------------------
  |  |  153|    119|#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: 119]
  ------------------
 2746|    119|    zc->headerSize = ZSTDv05_frameHeaderSize_min;
 2747|    119|    return zc->headerSize;
 2748|    119|}
zstd_v05.c:ZSTDv05_decodeFrameHeader_Part2:
 2768|    119|{
 2769|    119|    size_t result;
 2770|    119|    if (srcSize != zc->headerSize)
  ------------------
  |  Branch (2770:9): [True: 0, False: 119]
  ------------------
 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|    119|    result = ZSTDv05_getFrameParams(&(zc->params), src, srcSize);
 2773|    119|    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: 119]
  |  Branch (2773:27): [True: 0, False: 0]
  ------------------
 2774|    119|    return result;
 2775|    119|}
zstd_v05.c:ZSTDv05_copyRawBlock:
 2800|     98|{
 2801|     98|    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: 98]
  ------------------
 2802|     98|    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: 94]
  ------------------
 2803|     94|    memcpy(dst, src, srcSize);
 2804|     94|    return srcSize;
 2805|     98|}
zstd_v05.c:ZSTDv05_decompress_insertDictionary:
 3663|     28|{
 3664|     28|    size_t eSize;
 3665|     28|    U32 magic = MEM_readLE32(dict);
 3666|     28|    if (magic != ZSTDv05_DICT_MAGIC) {
  ------------------
  |  |  390|     28|#define ZSTDv05_DICT_MAGIC  0xEC30A435
  ------------------
  |  Branch (3666:9): [True: 28, False: 0]
  ------------------
 3667|       |        /* pure content mode */
 3668|     28|        ZSTDv05_refDictContent(dctx, dict, dictSize);
 3669|     28|        return 0;
 3670|     28|    }
 3671|       |    /* load entropy tables */
 3672|      0|    dict = (const char*)dict + 4;
 3673|      0|    dictSize -= 4;
 3674|      0|    eSize = ZSTDv05_loadEntropy(dctx, dict, dictSize);
 3675|      0|    if (ZSTDv05_isError(eSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3675:9): [True: 0, False: 0]
  ------------------
 3676|       |
 3677|       |    /* reference dictionary content */
 3678|      0|    dict = (const char*)dict + eSize;
 3679|      0|    dictSize -= eSize;
 3680|      0|    ZSTDv05_refDictContent(dctx, dict, dictSize);
 3681|       |
 3682|      0|    return 0;
 3683|      0|}
zstd_v05.c:ZSTDv05_refDictContent:
 3614|     28|{
 3615|     28|    dctx->dictEnd = dctx->previousDstEnd;
 3616|     28|    dctx->vBase = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3617|     28|    dctx->base = dict;
 3618|     28|    dctx->previousDstEnd = (const char*)dict + dictSize;
 3619|     28|}

FSEv06_readNCount:
 1209|     27|{
 1210|     27|    const BYTE* const istart = (const BYTE*) headerBuffer;
 1211|     27|    const BYTE* const iend = istart + hbSize;
 1212|     27|    const BYTE* ip = istart;
 1213|     27|    int nbBits;
 1214|     27|    int remaining;
 1215|     27|    int threshold;
 1216|     27|    U32 bitStream;
 1217|     27|    int bitCount;
 1218|     27|    unsigned charnum = 0;
 1219|     27|    int previous0 = 0;
 1220|       |
 1221|     27|    if (hbSize < 4) 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 (1221:9): [True: 0, False: 27]
  ------------------
 1222|     27|    bitStream = MEM_readLE32(ip);
 1223|     27|    nbBits = (bitStream & 0xF) + FSEv06_MIN_TABLELOG;   /* extract tableLog */
  ------------------
  |  | 1138|     27|#define FSEv06_MIN_TABLELOG 5
  ------------------
 1224|     27|    if (nbBits > FSEv06_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1140|     27|#define FSEv06_TABLELOG_ABSOLUTE_MAX 15
  ------------------
                  if (nbBits > FSEv06_TABLELOG_ABSOLUTE_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 (1224:9): [True: 0, False: 27]
  ------------------
 1225|     27|    bitStream >>= 4;
 1226|     27|    bitCount = 4;
 1227|     27|    *tableLogPtr = nbBits;
 1228|     27|    remaining = (1<<nbBits)+1;
 1229|     27|    threshold = 1<<nbBits;
 1230|     27|    nbBits++;
 1231|       |
 1232|    235|    while ((remaining>1) && (charnum<=*maxSVPtr)) {
  ------------------
  |  Branch (1232:12): [True: 208, False: 27]
  |  Branch (1232:29): [True: 208, False: 0]
  ------------------
 1233|    208|        if (previous0) {
  ------------------
  |  Branch (1233:13): [True: 14, False: 194]
  ------------------
 1234|     14|            unsigned n0 = charnum;
 1235|     15|            while ((bitStream & 0xFFFF) == 0xFFFF) {
  ------------------
  |  Branch (1235:20): [True: 1, False: 14]
  ------------------
 1236|      1|                n0+=24;
 1237|      1|                if (ip < iend-5) {
  ------------------
  |  Branch (1237:21): [True: 1, False: 0]
  ------------------
 1238|      1|                    ip+=2;
 1239|      1|                    bitStream = MEM_readLE32(ip) >> bitCount;
 1240|      1|                } else {
 1241|      0|                    bitStream >>= 16;
 1242|      0|                    bitCount+=16;
 1243|      0|            }   }
 1244|     14|            while ((bitStream & 3) == 3) {
  ------------------
  |  Branch (1244:20): [True: 0, False: 14]
  ------------------
 1245|      0|                n0+=3;
 1246|      0|                bitStream>>=2;
 1247|      0|                bitCount+=2;
 1248|      0|            }
 1249|     14|            n0 += bitStream & 3;
 1250|     14|            bitCount += 2;
 1251|     14|            if (n0 > *maxSVPtr) 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 (1251:17): [True: 0, False: 14]
  ------------------
 1252|     46|            while (charnum < n0) normalizedCounter[charnum++] = 0;
  ------------------
  |  Branch (1252:20): [True: 32, False: 14]
  ------------------
 1253|     14|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1253:17): [True: 12, False: 2]
  |  Branch (1253:35): [True: 0, False: 2]
  ------------------
 1254|     12|                ip += bitCount>>3;
 1255|     12|                bitCount &= 7;
 1256|     12|                bitStream = MEM_readLE32(ip) >> bitCount;
 1257|     12|            }
 1258|      2|            else
 1259|      2|                bitStream >>= 2;
 1260|     14|        }
 1261|    208|        {   short const max = (short)((2*threshold-1)-remaining);
 1262|    208|            short count;
 1263|       |
 1264|    208|            if ((bitStream & (threshold-1)) < (U32)max) {
  ------------------
  |  Branch (1264:17): [True: 119, False: 89]
  ------------------
 1265|    119|                count = (short)(bitStream & (threshold-1));
 1266|    119|                bitCount   += nbBits-1;
 1267|    119|            } else {
 1268|     89|                count = (short)(bitStream & (2*threshold-1));
 1269|     89|                if (count >= threshold) count -= max;
  ------------------
  |  Branch (1269:21): [True: 37, False: 52]
  ------------------
 1270|     89|                bitCount   += nbBits;
 1271|     89|            }
 1272|       |
 1273|    208|            count--;   /* extra accuracy */
 1274|    208|            remaining -= FSEv06_abs(count);
 1275|    208|            normalizedCounter[charnum++] = count;
 1276|    208|            previous0 = !count;
 1277|    373|            while (remaining < threshold) {
  ------------------
  |  Branch (1277:20): [True: 165, False: 208]
  ------------------
 1278|    165|                nbBits--;
 1279|    165|                threshold >>= 1;
 1280|    165|            }
 1281|       |
 1282|    208|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1282:17): [True: 180, False: 28]
  |  Branch (1282:35): [True: 2, False: 26]
  ------------------
 1283|    182|                ip += bitCount>>3;
 1284|    182|                bitCount &= 7;
 1285|    182|            } else {
 1286|     26|                bitCount -= (int)(8 * (iend - 4 - ip));
 1287|     26|                ip = iend - 4;
 1288|     26|            }
 1289|    208|            bitStream = MEM_readLE32(ip) >> (bitCount & 31);
 1290|    208|    }   }   /* while ((remaining>1) && (charnum<=*maxSVPtr)) */
 1291|     27|    if (remaining != 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 (1291:9): [True: 0, False: 27]
  ------------------
 1292|     27|    *maxSVPtr = charnum-1;
 1293|       |
 1294|     27|    ip += (bitCount+7)>>3;
 1295|     27|    if ((size_t)(ip-istart) > hbSize) 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 (1295:9): [True: 1, False: 26]
  ------------------
 1296|     26|    return ip-istart;
 1297|     27|}
FSEv06_buildDTable:
 1403|     72|{
 1404|     72|    void* const tdPtr = dt+1;   /* because *dt is unsigned, 32-bits aligned on 32-bits */
 1405|     72|    FSEv06_DECODE_TYPE* const tableDecode = (FSEv06_DECODE_TYPE*) (tdPtr);
  ------------------
  |  | 1125|     72|#define FSEv06_DECODE_TYPE FSEv06_decode_t
  ------------------
 1406|     72|    U16 symbolNext[FSEv06_MAX_SYMBOL_VALUE+1];
 1407|       |
 1408|     72|    U32 const maxSV1 = maxSymbolValue + 1;
 1409|     72|    U32 const tableSize = 1 << tableLog;
 1410|     72|    U32 highThreshold = tableSize-1;
 1411|       |
 1412|       |    /* Sanity Checks */
 1413|     72|    if (maxSymbolValue > FSEv06_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  | 1117|     72|#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: 72]
  ------------------
 1414|     72|    if (tableLog > FSEv06_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1134|     72|#define FSEv06_MAX_TABLELOG  (FSEv06_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1111|     72|#define FSEv06_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
                  if (tableLog > FSEv06_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 (1414:9): [True: 0, False: 72]
  ------------------
 1415|       |
 1416|       |    /* Init, lay down lowprob symbols */
 1417|     72|    {   FSEv06_DTableHeader DTableH;
 1418|     72|        DTableH.tableLog = (U16)tableLog;
 1419|     72|        DTableH.fastMode = 1;
 1420|     72|        {   S16 const largeLimit= (S16)(1 << (tableLog-1));
 1421|     72|            U32 s;
 1422|  2.13k|            for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (1422:23): [True: 2.06k, False: 72]
  ------------------
 1423|  2.06k|                if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (1423:21): [True: 298, False: 1.76k]
  ------------------
 1424|    298|                    tableDecode[highThreshold--].symbol = (FSEv06_FUNCTION_TYPE)s;
 1425|    298|                    symbolNext[s] = 1;
 1426|  1.76k|                } else {
 1427|  1.76k|                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
  ------------------
  |  Branch (1427:25): [True: 18, False: 1.75k]
  ------------------
 1428|  1.76k|                    symbolNext[s] = normalizedCounter[s];
 1429|  1.76k|        }   }   }
 1430|     72|        memcpy(dt, &DTableH, sizeof(DTableH));
 1431|     72|    }
 1432|       |
 1433|       |    /* Spread symbols */
 1434|     72|    {   U32 const tableMask = tableSize-1;
 1435|     72|        U32 const step = FSEv06_TABLESTEP(tableSize);
  ------------------
  |  | 1145|     72|#define FSEv06_TABLESTEP(tableSize) ((tableSize>>1) + (tableSize>>3) + 3)
  ------------------
 1436|     72|        U32 s, position = 0;
 1437|  2.13k|        for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (1437:19): [True: 2.06k, False: 72]
  ------------------
 1438|  2.06k|            int i;
 1439|  6.02k|            for (i=0; i<normalizedCounter[s]; i++) {
  ------------------
  |  Branch (1439:23): [True: 3.95k, False: 2.06k]
  ------------------
 1440|  3.95k|                tableDecode[position].symbol = (FSEv06_FUNCTION_TYPE)s;
 1441|  3.95k|                position = (position + step) & tableMask;
 1442|  4.25k|                while (position > highThreshold) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  Branch (1442:24): [True: 298, False: 3.95k]
  ------------------
 1443|  3.95k|        }   }
 1444|       |
 1445|     72|        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: 72]
  ------------------
 1446|     72|    }
 1447|       |
 1448|       |    /* Build Decoding table */
 1449|     72|    {   U32 u;
 1450|  4.32k|        for (u=0; u<tableSize; u++) {
  ------------------
  |  Branch (1450:19): [True: 4.25k, False: 72]
  ------------------
 1451|  4.25k|            FSEv06_FUNCTION_TYPE const symbol = (FSEv06_FUNCTION_TYPE)(tableDecode[u].symbol);
  ------------------
  |  | 1123|  4.25k|#define FSEv06_FUNCTION_TYPE BYTE
  ------------------
 1452|  4.25k|            U16 nextState = symbolNext[symbol]++;
 1453|  4.25k|            tableDecode[u].nbBits = (BYTE) (tableLog - BITv06_highbit32 ((U32)nextState) );
 1454|  4.25k|            tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
 1455|  4.25k|    }   }
 1456|       |
 1457|     72|    return 0;
 1458|     72|}
FSEv06_buildDTable_rle:
 1468|     39|{
 1469|     39|    void* ptr = dt;
 1470|     39|    FSEv06_DTableHeader* const DTableH = (FSEv06_DTableHeader*)ptr;
 1471|     39|    void* dPtr = dt + 1;
 1472|     39|    FSEv06_decode_t* const cell = (FSEv06_decode_t*)dPtr;
 1473|       |
 1474|     39|    DTableH->tableLog = 0;
 1475|     39|    DTableH->fastMode = 0;
 1476|       |
 1477|     39|    cell->newState = 0;
 1478|     39|    cell->symbol = symbolValue;
 1479|     39|    cell->nbBits = 0;
 1480|       |
 1481|     39|    return 0;
 1482|     39|}
FSEv06_decompress:
 1594|      1|{
 1595|      1|    const BYTE* const istart = (const BYTE*)cSrc;
 1596|      1|    const BYTE* ip = istart;
 1597|      1|    short counting[FSEv06_MAX_SYMBOL_VALUE+1];
 1598|      1|    DTable_max_t dt;   /* Static analyzer seems unable to understand this table will be properly initialized later */
 1599|      1|    unsigned tableLog;
 1600|      1|    unsigned maxSymbolValue = FSEv06_MAX_SYMBOL_VALUE;
  ------------------
  |  | 1117|      1|#define FSEv06_MAX_SYMBOL_VALUE 255
  ------------------
 1601|       |
 1602|      1|    if (cSrcSize<2) return ERROR(srcSize_wrong);   /* too small input 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 (1602:9): [True: 0, False: 1]
  ------------------
 1603|       |
 1604|       |    /* normal FSE decoding mode */
 1605|      1|    {   size_t const NCountLength = FSEv06_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize);
 1606|      1|        if (FSEv06_isError(NCountLength)) return NCountLength;
  ------------------
  |  | 1357|      1|#define FSEv06_isError ERR_isError
  ------------------
  |  Branch (1606:13): [True: 1, False: 0]
  ------------------
 1607|      0|        if (NCountLength >= cSrcSize) return ERROR(srcSize_wrong);   /* too small input 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 (1607:13): [True: 0, False: 0]
  ------------------
 1608|      0|        ip += NCountLength;
 1609|      0|        cSrcSize -= NCountLength;
 1610|      0|    }
 1611|       |
 1612|      0|    { size_t const errorCode = FSEv06_buildDTable (dt, counting, maxSymbolValue, tableLog);
 1613|      0|      if (FSEv06_isError(errorCode)) return errorCode; }
  ------------------
  |  | 1357|      0|#define FSEv06_isError ERR_isError
  ------------------
  |  Branch (1613:11): [True: 0, False: 0]
  ------------------
 1614|       |
 1615|      0|    return FSEv06_decompress_usingDTable (dst, maxDstSize, ip, cSrcSize, dt);   /* always return, even if it is an error code */
 1616|      0|}
HUFv06_readDTableX4:
 2272|      2|{
 2273|      2|    BYTE weightList[HUFv06_MAX_SYMBOL_VALUE + 1];
 2274|      2|    sortedSymbol_t sortedSymbol[HUFv06_MAX_SYMBOL_VALUE + 1];
 2275|      2|    U32 rankStats[HUFv06_ABSOLUTEMAX_TABLELOG + 1] = { 0 };
 2276|      2|    U32 rankStart0[HUFv06_ABSOLUTEMAX_TABLELOG + 2] = { 0 };
 2277|      2|    U32* const rankStart = rankStart0+1;
 2278|      2|    rankVal_t rankVal;
 2279|      2|    U32 tableLog, maxW, sizeOfSort, nbSymbols;
 2280|      2|    const U32 memLog = DTable[0];
 2281|      2|    size_t iSize;
 2282|      2|    void* dtPtr = DTable;
 2283|      2|    HUFv06_DEltX4* const dt = ((HUFv06_DEltX4*)dtPtr) + 1;
 2284|       |
 2285|      2|    HUFv06_STATIC_ASSERT(sizeof(HUFv06_DEltX4) == sizeof(U32));   /* if compilation fails here, assertion is false */
  ------------------
  |  | 1929|      2|#define HUFv06_STATIC_ASSERT(c) { enum { HUFv06_static_assert = 1/(int)(!!(c)) }; }   /* use only *after* variable declarations */
  ------------------
 2286|      2|    if (memLog > HUFv06_ABSOLUTEMAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1783|      2|#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: 2]
  ------------------
 2287|       |    /* memset(weightList, 0, sizeof(weightList)); */   /* is not necessary, even though some analyzer complain ... */
 2288|       |
 2289|      2|    iSize = HUFv06_readStats(weightList, HUFv06_MAX_SYMBOL_VALUE + 1, rankStats, &nbSymbols, &tableLog, src, srcSize);
  ------------------
  |  | 1786|      2|#define HUFv06_MAX_SYMBOL_VALUE 255
  ------------------
 2290|      2|    if (HUFv06_isError(iSize)) return iSize;
  ------------------
  |  Branch (2290:9): [True: 2, False: 0]
  ------------------
 2291|       |
 2292|       |    /* check result */
 2293|      0|    if (tableLog > memLog) return ERROR(tableLog_tooLarge);   /* DTable can't fit code depth */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2293:9): [True: 0, False: 0]
  ------------------
 2294|       |
 2295|       |    /* find maxWeight */
 2296|      0|    for (maxW = tableLog; rankStats[maxW]==0; maxW--) {}  /* necessarily finds a solution before 0 */
  ------------------
  |  Branch (2296:27): [True: 0, False: 0]
  ------------------
 2297|       |
 2298|       |    /* Get start index of each weight */
 2299|      0|    {   U32 w, nextRankStart = 0;
 2300|      0|        for (w=1; w<maxW+1; w++) {
  ------------------
  |  Branch (2300:19): [True: 0, False: 0]
  ------------------
 2301|      0|            U32 current = nextRankStart;
 2302|      0|            nextRankStart += rankStats[w];
 2303|      0|            rankStart[w] = current;
 2304|      0|        }
 2305|      0|        rankStart[0] = nextRankStart;   /* put all 0w symbols at the end of sorted list*/
 2306|      0|        sizeOfSort = nextRankStart;
 2307|      0|    }
 2308|       |
 2309|       |    /* sort symbols by weight */
 2310|      0|    {   U32 s;
 2311|      0|        for (s=0; s<nbSymbols; s++) {
  ------------------
  |  Branch (2311:19): [True: 0, False: 0]
  ------------------
 2312|      0|            U32 const w = weightList[s];
 2313|      0|            U32 const r = rankStart[w]++;
 2314|      0|            sortedSymbol[r].symbol = (BYTE)s;
 2315|      0|            sortedSymbol[r].weight = (BYTE)w;
 2316|      0|        }
 2317|      0|        rankStart[0] = 0;   /* forget 0w symbols; this is beginning of weight(1) */
 2318|      0|    }
 2319|       |
 2320|       |    /* Build rankVal */
 2321|      0|    {   U32* const rankVal0 = rankVal[0];
 2322|      0|        {   int const rescale = (memLog-tableLog) - 1;   /* tableLog <= memLog */
 2323|      0|            U32 nextRankVal = 0;
 2324|      0|            U32 w;
 2325|      0|            for (w=1; w<maxW+1; w++) {
  ------------------
  |  Branch (2325:23): [True: 0, False: 0]
  ------------------
 2326|      0|                U32 current = nextRankVal;
 2327|      0|                nextRankVal += rankStats[w] << (w+rescale);
 2328|      0|                rankVal0[w] = current;
 2329|      0|        }   }
 2330|      0|        {   U32 const minBits = tableLog+1 - maxW;
 2331|      0|            U32 consumed;
 2332|      0|            for (consumed = minBits; consumed < memLog - minBits + 1; consumed++) {
  ------------------
  |  Branch (2332:38): [True: 0, False: 0]
  ------------------
 2333|      0|                U32* const rankValPtr = rankVal[consumed];
 2334|      0|                U32 w;
 2335|      0|                for (w = 1; w < maxW+1; w++) {
  ------------------
  |  Branch (2335:29): [True: 0, False: 0]
  ------------------
 2336|      0|                    rankValPtr[w] = rankVal0[w] >> consumed;
 2337|      0|    }   }   }   }
 2338|       |
 2339|      0|    HUFv06_fillDTableX4(dt, memLog,
 2340|      0|                   sortedSymbol, sizeOfSort,
 2341|      0|                   rankStart0, rankVal, maxW,
 2342|      0|                   tableLog+1);
 2343|       |
 2344|      0|    return iSize;
 2345|      0|}
HUFv06_decompress:
 2590|      3|{
 2591|      3|    static const decompressionAlgo decompress[3] = { HUFv06_decompress4X2, HUFv06_decompress4X4, NULL };
 2592|      3|    U32 Dtime[3];   /* decompression time estimation */
 2593|       |
 2594|       |    /* validation checks */
 2595|      3|    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 (2595:9): [True: 0, False: 3]
  ------------------
 2596|      3|    if (cSrcSize > dstSize) return ERROR(corruption_detected);   /* invalid */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2596:9): [True: 0, False: 3]
  ------------------
 2597|      3|    if (cSrcSize == dstSize) { memcpy(dst, cSrc, dstSize); return dstSize; }   /* not compressed */
  ------------------
  |  Branch (2597:9): [True: 0, False: 3]
  ------------------
 2598|      3|    if (cSrcSize == 1) { memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; }   /* RLE */
  ------------------
  |  Branch (2598:9): [True: 3, False: 0]
  ------------------
 2599|       |
 2600|       |    /* decoder timing evaluation */
 2601|      0|    {   U32 const Q = (U32)(cSrcSize * 16 / dstSize);   /* Q < 16 since dstSize > cSrcSize */
 2602|      0|        U32 const D256 = (U32)(dstSize >> 8);
 2603|      0|        U32 n; for (n=0; n<3; n++)
  ------------------
  |  Branch (2603:26): [True: 0, False: 0]
  ------------------
 2604|      0|            Dtime[n] = algoTime[Q][n].tableTime + (algoTime[Q][n].decode256Time * D256);
 2605|      0|    }
 2606|       |
 2607|      0|    Dtime[1] += Dtime[1] >> 4; Dtime[2] += Dtime[2] >> 3; /* advantage to algorithms using less memory, for cache eviction */
 2608|       |
 2609|      0|    {   U32 algoNb = 0;
 2610|      0|        if (Dtime[1] < Dtime[0]) algoNb = 1;
  ------------------
  |  Branch (2610:13): [True: 0, False: 0]
  ------------------
 2611|       |        /* if (Dtime[2] < Dtime[algoNb]) algoNb = 2; */   /* current speed of HUFv06_decompress4X6 is not good */
 2612|      0|        return decompress[algoNb](dst, dstSize, cSrc, cSrcSize);
 2613|      3|    }
 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|      3|}
ZSTDv06_decompressBegin:
 2774|    100|{
 2775|    100|    dctx->expected = ZSTDv06_frameHeaderSize_min;
 2776|    100|    dctx->stage = ZSTDds_getFrameHeaderSize;
 2777|    100|    dctx->previousDstEnd = NULL;
 2778|    100|    dctx->base = NULL;
 2779|    100|    dctx->vBase = NULL;
 2780|    100|    dctx->dictEnd = NULL;
 2781|    100|    dctx->hufTableX4[0] = ZSTD_HUFFDTABLE_CAPACITY_LOG;
  ------------------
  |  |  426|    100|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
 2782|    100|    dctx->flagRepeatTable = 0;
 2783|    100|    return 0;
 2784|    100|}
ZSTDv06_createDCtx:
 2787|     50|{
 2788|     50|    ZSTDv06_DCtx* dctx = (ZSTDv06_DCtx*)malloc(sizeof(ZSTDv06_DCtx));
 2789|     50|    if (dctx==NULL) return NULL;
  ------------------
  |  Branch (2789:9): [True: 0, False: 50]
  ------------------
 2790|     50|    ZSTDv06_decompressBegin(dctx);
 2791|     50|    return dctx;
 2792|     50|}
ZSTDv06_freeDCtx:
 2795|     50|{
 2796|     50|    free(dctx);
 2797|     50|    return 0;   /* reserved as a potential error code in the future */
 2798|     50|}
ZSTDv06_getFrameParams:
 2925|     51|{
 2926|     51|    const BYTE* ip = (const BYTE*)src;
 2927|       |
 2928|     51|    if (srcSize < ZSTDv06_frameHeaderSize_min) return ZSTDv06_frameHeaderSize_min;
  ------------------
  |  Branch (2928:9): [True: 0, False: 51]
  ------------------
 2929|     51|    if (MEM_readLE32(src) != ZSTDv06_MAGICNUMBER) return ERROR(prefix_unknown);
  ------------------
  |  |  164|     51|#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: 51]
  ------------------
 2930|       |
 2931|       |    /* ensure there is enough `srcSize` to fully read/decode frame header */
 2932|     51|    { size_t const fhsize = ZSTDv06_frameHeaderSize(src, srcSize);
 2933|     51|      if (srcSize < fhsize) return fhsize; }
  ------------------
  |  Branch (2933:11): [True: 0, False: 51]
  ------------------
 2934|       |
 2935|     51|    memset(fparamsPtr, 0, sizeof(*fparamsPtr));
 2936|     51|    {   BYTE const frameDesc = ip[4];
 2937|     51|        fparamsPtr->windowLog = (frameDesc & 0xF) + ZSTDv06_WINDOWLOG_ABSOLUTEMIN;
  ------------------
  |  |  416|     51|#define ZSTDv06_WINDOWLOG_ABSOLUTEMIN 12
  ------------------
 2938|     51|        if ((frameDesc & 0x20) != 0) return ERROR(frameParameter_unsupported);   /* reserved 1 bit */
  ------------------
  |  |   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 (2938:13): [True: 9, False: 42]
  ------------------
 2939|     42|        switch(frameDesc >> 6)  /* fcsId */
 2940|     42|        {
 2941|      0|            default:   /* impossible */
  ------------------
  |  Branch (2941:13): [True: 0, False: 42]
  ------------------
 2942|     42|            case 0 : fparamsPtr->frameContentSize = 0; break;
  ------------------
  |  Branch (2942:13): [True: 42, False: 0]
  ------------------
 2943|      0|            case 1 : fparamsPtr->frameContentSize = ip[5]; break;
  ------------------
  |  Branch (2943:13): [True: 0, False: 42]
  ------------------
 2944|      0|            case 2 : fparamsPtr->frameContentSize = MEM_readLE16(ip+5)+256; break;
  ------------------
  |  Branch (2944:13): [True: 0, False: 42]
  ------------------
 2945|      0|            case 3 : fparamsPtr->frameContentSize = MEM_readLE64(ip+5); break;
  ------------------
  |  Branch (2945:13): [True: 0, False: 42]
  ------------------
 2946|     42|    }   }
 2947|     42|    return 0;
 2948|     42|}
ZSTDv06_decompress_usingDict:
 3581|     50|{
 3582|     50|    ZSTDv06_decompressBegin_usingDict(dctx, dict, dictSize);
 3583|     50|    ZSTDv06_checkContinuity(dctx, dst);
 3584|     50|    return ZSTDv06_decompressFrame(dctx, dst, dstCapacity, src, srcSize);
 3585|     50|}
ZSTDv06_findFrameSizeInfoLegacy:
 3618|     51|{
 3619|     51|    const BYTE* ip = (const BYTE*)src;
 3620|     51|    size_t remainingSize = srcSize;
 3621|     51|    size_t nbBlocks = 0;
 3622|     51|    blockProperties_t blockProperties = { bt_compressed, 0 };
 3623|       |
 3624|       |    /* Frame Header */
 3625|     51|    {   size_t const frameHeaderSize = ZSTDv06_frameHeaderSize(src, srcSize);
 3626|     51|        if (ZSTDv06_isError(frameHeaderSize)) {
  ------------------
  |  | 2731|     51|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3626:13): [True: 0, False: 51]
  ------------------
 3627|      0|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, frameHeaderSize);
 3628|      0|            return;
 3629|      0|        }
 3630|     51|        if (MEM_readLE32(src) != ZSTDv06_MAGICNUMBER) {
  ------------------
  |  |  164|     51|#define ZSTDv06_MAGICNUMBER 0xFD2FB526   /* v0.6 */
  ------------------
  |  Branch (3630:13): [True: 0, False: 51]
  ------------------
 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|     51|        if (srcSize < frameHeaderSize+ZSTDv06_blockHeaderSize) {
  ------------------
  |  Branch (3634:13): [True: 0, False: 51]
  ------------------
 3635|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3636|      0|            return;
 3637|      0|        }
 3638|     51|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3639|     51|    }
 3640|       |
 3641|       |    /* Loop on each block */
 3642|    230|    while (1) {
  ------------------
  |  Branch (3642:12): [True: 230, Folded]
  ------------------
 3643|    230|        size_t const cBlockSize = ZSTDv06_getcBlockSize(ip, remainingSize, &blockProperties);
 3644|    230|        if (ZSTDv06_isError(cBlockSize)) {
  ------------------
  |  | 2731|    230|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3644:13): [True: 0, False: 230]
  ------------------
 3645|      0|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, cBlockSize);
 3646|      0|            return;
 3647|      0|        }
 3648|       |
 3649|    230|        ip += ZSTDv06_blockHeaderSize;
 3650|    230|        remainingSize -= ZSTDv06_blockHeaderSize;
 3651|    230|        if (cBlockSize > remainingSize) {
  ------------------
  |  Branch (3651:13): [True: 1, False: 229]
  ------------------
 3652|      1|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(srcSize_wrong));
  ------------------
  |  |   49|      1|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      1|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      1|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3653|      1|            return;
 3654|      1|        }
 3655|       |
 3656|    229|        if (cBlockSize == 0) break;   /* bt_end */
  ------------------
  |  Branch (3656:13): [True: 50, False: 179]
  ------------------
 3657|       |
 3658|    179|        ip += cBlockSize;
 3659|    179|        remainingSize -= cBlockSize;
 3660|    179|        nbBlocks++;
 3661|    179|    }
 3662|       |
 3663|     50|    *cSize = ip - (const BYTE*)src;
 3664|     50|    *dBound = nbBlocks * ZSTDv06_BLOCKSIZE_MAX;
  ------------------
  |  |  344|     50|#define ZSTDv06_BLOCKSIZE_MAX (128 * 1024)   /* define, for static allocation */
  ------------------
 3665|     50|}
ZSTDv06_decompressBegin_usingDict:
 3827|     50|{
 3828|     50|    { size_t const errorCode = ZSTDv06_decompressBegin(dctx);
 3829|     50|      if (ZSTDv06_isError(errorCode)) return errorCode; }
  ------------------
  |  | 2731|     50|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3829:11): [True: 0, False: 50]
  ------------------
 3830|       |
 3831|     50|    if (dict && dictSize) {
  ------------------
  |  Branch (3831:9): [True: 50, False: 0]
  |  Branch (3831:17): [True: 33, False: 17]
  ------------------
 3832|     33|        size_t const errorCode = ZSTDv06_decompress_insertDictionary(dctx, dict, dictSize);
 3833|     33|        if (ZSTDv06_isError(errorCode)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2731|     33|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
                      if (ZSTDv06_isError(errorCode)) 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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3833:13): [True: 2, False: 31]
  ------------------
 3834|     33|    }
 3835|       |
 3836|     48|    return 0;
 3837|     50|}
zstd_v06.c:MEM_readLE32:
  190|    383|{
  191|    383|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (191:9): [True: 383, False: 0]
  ------------------
  192|    383|        return MEM_read32(memPtr);
  193|      0|    else
  194|      0|        return MEM_swap32(MEM_read32(memPtr));
  195|    383|}
zstd_v06.c:MEM_isLittleEndian:
  108|    723|{
  109|    723|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  110|    723|    return one.c[0];
  111|    723|}
zstd_v06.c:MEM_read32:
  119|    383|{
  120|    383|    U32 val; memcpy(&val, memPtr, sizeof(val)); return val;
  121|    383|}
zstd_v06.c:FSEv06_abs:
 1205|    208|static short FSEv06_abs(short a) { return a<0 ? -a : a; }
  ------------------
  |  Branch (1205:43): [True: 74, False: 134]
  ------------------
zstd_v06.c:BITv06_highbit32:
  802|  4.29k|{
  803|       |#   if defined(_MSC_VER)   /* Visual */
  804|       |    unsigned long r;
  805|       |    return _BitScanReverse(&r, val) ? (unsigned)r : 0;
  806|       |#   elif defined(__GNUC__) && (__GNUC__ >= 3)   /* Use GCC Intrinsic */
  807|       |    return __builtin_clz (val) ^ 31;
  808|       |#   else   /* Software version */
  809|       |    static const unsigned DeBruijnClz[32] = { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 };
  810|       |    U32 v = val;
  811|       |    unsigned r;
  812|       |    v |= v >> 1;
  813|       |    v |= v >> 2;
  814|       |    v |= v >> 4;
  815|       |    v |= v >> 8;
  816|       |    v |= v >> 16;
  817|       |    r = DeBruijnClz[ (U32) (v * 0x07C4ACDDU) >> 27];
  818|       |    return r;
  819|       |#   endif
  820|  4.29k|}
zstd_v06.c:FSEv06_initDState:
 1053|    111|{
 1054|    111|    const void* ptr = dt;
 1055|    111|    const FSEv06_DTableHeader* const DTableH = (const FSEv06_DTableHeader*)ptr;
 1056|    111|    DStatePtr->state = BITv06_readBits(bitD, DTableH->tableLog);
 1057|    111|    BITv06_reloadDStream(bitD);
 1058|    111|    DStatePtr->table = dt + 1;
 1059|    111|}
zstd_v06.c:BITv06_readBits:
  888|  1.63k|{
  889|  1.63k|    size_t const value = BITv06_lookBits(bitD, nbBits);
  890|  1.63k|    BITv06_skipBits(bitD, nbBits);
  891|  1.63k|    return value;
  892|  1.63k|}
zstd_v06.c:BITv06_lookBits:
  869|  1.63k|{
  870|  1.63k|    U32 const bitMask = sizeof(bitD->bitContainer)*8 - 1;
  871|  1.63k|    return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask);
  872|  1.63k|}
zstd_v06.c:BITv06_skipBits:
  883|  1.63k|{
  884|  1.63k|    bitD->bitsConsumed += nbBits;
  885|  1.63k|}
zstd_v06.c:HUFv06_readStats:
 1801|      2|{
 1802|      2|    U32 weightTotal;
 1803|      2|    const BYTE* ip = (const BYTE*) src;
 1804|      2|    size_t iSize;
 1805|      2|    size_t oSize;
 1806|       |
 1807|      2|    if (!srcSize) 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 (1807:9): [True: 0, False: 2]
  ------------------
 1808|      2|    iSize = ip[0];
 1809|       |    /* memset(huffWeight, 0, hwSize); */   /* is not necessary, even though some analyzer complain ... */
 1810|       |
 1811|      2|    if (iSize >= 128)  { /* special header */
  ------------------
  |  Branch (1811:9): [True: 1, False: 1]
  ------------------
 1812|      1|        if (iSize >= (242)) {  /* RLE */
  ------------------
  |  Branch (1812:13): [True: 0, False: 1]
  ------------------
 1813|      0|            static U32 l[14] = { 1, 2, 3, 4, 7, 8, 15, 16, 31, 32, 63, 64, 127, 128 };
 1814|      0|            oSize = l[iSize-242];
 1815|      0|            memset(huffWeight, 1, hwSize);
 1816|      0|            iSize = 0;
 1817|      0|        }
 1818|      1|        else {   /* Incompressible */
 1819|      1|            oSize = iSize - 127;
 1820|      1|            iSize = ((oSize+1)/2);
 1821|      1|            if (iSize+1 > srcSize) 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 (1821:17): [True: 0, False: 1]
  ------------------
 1822|      1|            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: 1]
  ------------------
 1823|      1|            ip += 1;
 1824|      1|            {   U32 n;
 1825|      3|                for (n=0; n<oSize; n+=2) {
  ------------------
  |  Branch (1825:27): [True: 2, False: 1]
  ------------------
 1826|      2|                    huffWeight[n]   = ip[n/2] >> 4;
 1827|      2|                    huffWeight[n+1] = ip[n/2] & 15;
 1828|      2|    }   }   }   }
 1829|      1|    else  {   /* header compressed with FSE (normal case) */
 1830|      1|        if (iSize+1 > srcSize) 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 (1830:13): [True: 0, False: 1]
  ------------------
 1831|      1|        oSize = FSEv06_decompress(huffWeight, hwSize-1, ip+1, iSize);   /* max (hwSize-1) values decoded, as last one is implied */
 1832|      1|        if (FSEv06_isError(oSize)) return oSize;
  ------------------
  |  | 1357|      1|#define FSEv06_isError ERR_isError
  ------------------
  |  Branch (1832:13): [True: 1, False: 0]
  ------------------
 1833|      1|    }
 1834|       |
 1835|       |    /* collect weight stats */
 1836|      1|    memset(rankStats, 0, (HUFv06_ABSOLUTEMAX_TABLELOG + 1) * sizeof(U32));
  ------------------
  |  | 1783|      1|#define HUFv06_ABSOLUTEMAX_TABLELOG  16   /* absolute limit of HUFv06_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
 1837|      1|    weightTotal = 0;
 1838|      4|    {   U32 n; for (n=0; n<oSize; n++) {
  ------------------
  |  Branch (1838:26): [True: 3, False: 1]
  ------------------
 1839|      3|            if (huffWeight[n] >= HUFv06_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  | 1783|      3|#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|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1839:17): [True: 0, False: 3]
  ------------------
 1840|      3|            rankStats[huffWeight[n]]++;
 1841|      3|            weightTotal += (1 << huffWeight[n]) >> 1;
 1842|      3|    }   }
 1843|      1|    if (weightTotal == 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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1843:9): [True: 0, False: 1]
  ------------------
 1844|       |
 1845|       |    /* get last non-null symbol weight (implied, total must be 2^n) */
 1846|      1|    {   U32 const tableLog = BITv06_highbit32(weightTotal) + 1;
 1847|      1|        if (tableLog > HUFv06_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  | 1783|      1|#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|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1847:13): [True: 0, False: 1]
  ------------------
 1848|      1|        *tableLogPtr = tableLog;
 1849|       |        /* determine last weight */
 1850|      1|        {   U32 const total = 1 << tableLog;
 1851|      1|            U32 const rest = total - weightTotal;
 1852|      1|            U32 const verif = 1 << BITv06_highbit32(rest);
 1853|      1|            U32 const lastWeight = BITv06_highbit32(rest) + 1;
 1854|      1|            if (verif != rest) return ERROR(corruption_detected);    /* last value must be a clean power of 2 */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1854:17): [True: 0, False: 1]
  ------------------
 1855|      1|            huffWeight[oSize] = (BYTE)lastWeight;
 1856|      1|            rankStats[lastWeight]++;
 1857|      1|    }   }
 1858|       |
 1859|       |    /* check tree construction validity */
 1860|      1|    if ((rankStats[1] < 2) || (rankStats[1] & 1)) return ERROR(corruption_detected);   /* by construction : at least 2 elts of rank 1, must be even */
  ------------------
  |  |   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 (1860:9): [True: 1, False: 0]
  |  Branch (1860:31): [True: 0, False: 0]
  ------------------
 1861|       |
 1862|       |    /* results */
 1863|      0|    *nbSymbolsPtr = (U32)(oSize+1);
 1864|      0|    return iSize+1;
 1865|      1|}
zstd_v06.c:HUFv06_isError:
 1199|      2|static unsigned HUFv06_isError(size_t code) { return ERR_isError(code); }
zstd_v06.c:BITv06_initDStream:
  834|     37|{
  835|     37|    if (srcSize < 1) { memset(bitD, 0, sizeof(*bitD)); 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 (835:9): [True: 0, False: 37]
  ------------------
  836|       |
  837|     37|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (837:9): [True: 37, False: 0]
  ------------------
  838|     37|        bitD->start = (const char*)srcBuffer;
  839|     37|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  840|     37|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  841|     37|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  842|     37|          if (lastByte == 0) return ERROR(GENERIC);   /* endMark not present */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (842:15): [True: 0, False: 37]
  ------------------
  843|     37|          bitD->bitsConsumed = 8 - BITv06_highbit32(lastByte); }
  844|     37|    } else {
  845|      0|        bitD->start = (const char*)srcBuffer;
  846|      0|        bitD->ptr   = bitD->start;
  847|      0|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  848|      0|        switch(srcSize)
  849|      0|        {
  850|      0|            case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);/* fall-through */
  ------------------
  |  Branch (850:13): [True: 0, False: 0]
  ------------------
  851|      0|            case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);/* fall-through */
  ------------------
  |  Branch (851:13): [True: 0, False: 0]
  ------------------
  852|      0|            case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);/* fall-through */
  ------------------
  |  Branch (852:13): [True: 0, False: 0]
  ------------------
  853|      0|            case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24; /* fall-through */
  ------------------
  |  Branch (853:13): [True: 0, False: 0]
  ------------------
  854|      0|            case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16; /* fall-through */
  ------------------
  |  Branch (854:13): [True: 0, False: 0]
  ------------------
  855|      0|            case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) <<  8; /* fall-through */
  ------------------
  |  Branch (855:13): [True: 0, False: 0]
  ------------------
  856|      0|            default: break;
  ------------------
  |  Branch (856:13): [True: 0, False: 0]
  ------------------
  857|      0|        }
  858|      0|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  859|      0|          if (lastByte == 0) return ERROR(GENERIC);   /* endMark not present */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (859:15): [True: 0, False: 0]
  ------------------
  860|      0|          bitD->bitsConsumed = 8 - BITv06_highbit32(lastByte); }
  861|      0|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  862|      0|    }
  863|       |
  864|     37|    return srcSize;
  865|     37|}
zstd_v06.c:MEM_readLEST:
  208|    339|{
  209|    339|    if (MEM_32bits())
  ------------------
  |  Branch (209:9): [True: 0, False: 339]
  ------------------
  210|      0|        return (size_t)MEM_readLE32(memPtr);
  211|    339|    else
  212|    339|        return (size_t)MEM_readLE64(memPtr);
  213|    339|}
zstd_v06.c:MEM_32bits:
  104|  1.70k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_v06.c:MEM_readLE16:
  169|      1|{
  170|      1|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (170:9): [True: 1, False: 0]
  ------------------
  171|      1|        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|}
zstd_v06.c:MEM_read16:
  114|      1|{
  115|      1|    U16 val; memcpy(&val, memPtr, sizeof(val)); return val;
  116|      1|}
zstd_v06.c:BITv06_reloadDStream:
  904|    505|{
  905|    505|    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))  /* should never happen */
  ------------------
  |  Branch (905:9): [True: 8, False: 497]
  ------------------
  906|      8|        return BITv06_DStream_overflow;
  907|       |
  908|    497|    if (bitD->ptr >= bitD->start + sizeof(bitD->bitContainer)) {
  ------------------
  |  Branch (908:9): [True: 53, False: 444]
  ------------------
  909|     53|        bitD->ptr -= bitD->bitsConsumed >> 3;
  910|     53|        bitD->bitsConsumed &= 7;
  911|     53|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  912|     53|        return BITv06_DStream_unfinished;
  913|     53|    }
  914|    444|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (914:9): [True: 195, False: 249]
  ------------------
  915|    195|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BITv06_DStream_endOfBuffer;
  ------------------
  |  Branch (915:13): [True: 194, False: 1]
  ------------------
  916|      1|        return BITv06_DStream_completed;
  917|    195|    }
  918|    249|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  919|    249|        BITv06_DStream_status result = BITv06_DStream_unfinished;
  920|    249|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (920:13): [True: 8, False: 241]
  ------------------
  921|      8|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  922|      8|            result = BITv06_DStream_endOfBuffer;
  923|      8|        }
  924|    249|        bitD->ptr -= nbBytes;
  925|    249|        bitD->bitsConsumed -= nbBytes*8;
  926|    249|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD) */
  927|    249|        return result;
  928|    444|    }
  929|    444|}
zstd_v06.c:ZSTDv06_frameHeaderSize:
 2912|    152|{
 2913|    152|    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: 152]
  ------------------
 2914|    152|    { U32 const fcsId = (((const BYTE*)src)[4]) >> 6;
 2915|    152|      return ZSTDv06_frameHeaderSize_min + ZSTDv06_fcs_fieldSize[fcsId]; }
 2916|    152|}
zstd_v06.c:MEM_readLE64:
  199|    339|{
  200|    339|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (200:9): [True: 339, False: 0]
  ------------------
  201|    339|        return MEM_read64(memPtr);
  202|      0|    else
  203|      0|        return MEM_swap64(MEM_read64(memPtr));
  204|    339|}
zstd_v06.c:MEM_read64:
  124|    339|{
  125|    339|    U64 val; memcpy(&val, memPtr, sizeof(val)); return val;
  126|    339|}
zstd_v06.c:ZSTDv06_checkContinuity:
 3465|     50|{
 3466|     50|    if (dst != dctx->previousDstEnd) {   /* not contiguous */
  ------------------
  |  Branch (3466:9): [True: 50, False: 0]
  ------------------
 3467|     50|        dctx->dictEnd = dctx->previousDstEnd;
 3468|     50|        dctx->vBase = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3469|     50|        dctx->base = dst;
 3470|     50|        dctx->previousDstEnd = dst;
 3471|     50|    }
 3472|     50|}
zstd_v06.c:ZSTDv06_decompressBlock_internal:
 3478|     38|{   /* blockType == blockCompressed */
 3479|     38|    const BYTE* ip = (const BYTE*)src;
 3480|       |
 3481|     38|    if (srcSize >= ZSTDv06_BLOCKSIZE_MAX) return ERROR(srcSize_wrong);
  ------------------
  |  |  344|     38|#define ZSTDv06_BLOCKSIZE_MAX (128 * 1024)   /* define, for static allocation */
  ------------------
                  if (srcSize >= ZSTDv06_BLOCKSIZE_MAX) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3481:9): [True: 0, False: 38]
  ------------------
 3482|       |
 3483|       |    /* Decode literals sub-block */
 3484|     38|    {   size_t const litCSize = ZSTDv06_decodeLiteralsBlock(dctx, src, srcSize);
 3485|     38|        if (ZSTDv06_isError(litCSize)) return litCSize;
  ------------------
  |  | 2731|     38|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3485:13): [True: 0, False: 38]
  ------------------
 3486|     38|        ip += litCSize;
 3487|     38|        srcSize -= litCSize;
 3488|     38|    }
 3489|      0|    return ZSTDv06_decompressSequences(dctx, dst, dstCapacity, ip, srcSize);
 3490|     38|}
zstd_v06.c:ZSTDv06_decodeLiteralsBlock:
 3000|     38|{
 3001|     38|    const BYTE* const istart = (const BYTE*) src;
 3002|       |
 3003|       |    /* any compressed block with literals segment must be at least this size */
 3004|     38|    if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  |  424|     38|#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */ + MIN_SEQUENCES_SIZE /* nbSeq==0 */)   /* for a non-null block */
  |  |  ------------------
  |  |  |  |  423|     38|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  |  |  ------------------
  ------------------
                  if (srcSize < MIN_CBLOCK_SIZE) 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 (3004:9): [True: 0, False: 38]
  ------------------
 3005|       |
 3006|     38|    switch(istart[0]>> 6)
 3007|     38|    {
 3008|      3|    case IS_HUF:
  ------------------
  |  |  428|      3|#define IS_HUF 0
  ------------------
  |  Branch (3008:5): [True: 3, False: 35]
  ------------------
 3009|      3|        {   size_t litSize, litCSize, singleStream=0;
 3010|      3|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3011|      3|            if (srcSize < 5) return ERROR(corruption_detected);   /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need up to 5 for lhSize, + cSize (+nbSeq) */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3011:17): [True: 0, False: 3]
  ------------------
 3012|      3|            switch(lhSize)
 3013|      3|            {
 3014|      3|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3014:13): [True: 3, False: 0]
  |  Branch (3014:21): [True: 0, False: 3]
  |  Branch (3014:29): [True: 0, False: 3]
  ------------------
 3015|       |                /* 2 - 2 - 10 - 10 */
 3016|      3|                lhSize=3;
 3017|      3|                singleStream = istart[0] & 16;
 3018|      3|                litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 3019|      3|                litCSize = ((istart[1] &  3) << 8) + istart[2];
 3020|      3|                break;
 3021|      0|            case 2:
  ------------------
  |  Branch (3021:13): [True: 0, False: 3]
  ------------------
 3022|       |                /* 2 - 2 - 14 - 14 */
 3023|      0|                lhSize=4;
 3024|      0|                litSize  = ((istart[0] & 15) << 10) + (istart[1] << 2) + (istart[2] >> 6);
 3025|      0|                litCSize = ((istart[2] & 63) <<  8) + istart[3];
 3026|      0|                break;
 3027|      0|            case 3:
  ------------------
  |  Branch (3027:13): [True: 0, False: 3]
  ------------------
 3028|       |                /* 2 - 2 - 18 - 18 */
 3029|      0|                lhSize=5;
 3030|      0|                litSize  = ((istart[0] & 15) << 14) + (istart[1] << 6) + (istart[2] >> 2);
 3031|      0|                litCSize = ((istart[2] &  3) << 16) + (istart[3] << 8) + istart[4];
 3032|      0|                break;
 3033|      3|            }
 3034|      3|            if (litSize > ZSTDv06_BLOCKSIZE_MAX) return ERROR(corruption_detected);
  ------------------
  |  |  344|      3|#define ZSTDv06_BLOCKSIZE_MAX (128 * 1024)   /* define, for static allocation */
  ------------------
                          if (litSize > ZSTDv06_BLOCKSIZE_MAX) 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 (3034:17): [True: 0, False: 3]
  ------------------
 3035|      3|            if (litCSize + lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3035:17): [True: 0, False: 3]
  ------------------
 3036|       |
 3037|      3|            if (HUFv06_isError(singleStream ?
  ------------------
  |  | 2733|      3|#define HUFv06_isError  ERR_isError
  ------------------
  |  Branch (3037:17): [True: 0, False: 3]
  |  Branch (3037:32): [True: 0, False: 3]
  ------------------
 3038|      0|                            HUFv06_decompress1X2(dctx->litBuffer, litSize, istart+lhSize, litCSize) :
 3039|      3|                            HUFv06_decompress   (dctx->litBuffer, litSize, istart+lhSize, litCSize) ))
 3040|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3041|       |
 3042|      3|            dctx->litPtr = dctx->litBuffer;
 3043|      3|            dctx->litSize = litSize;
 3044|      3|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  487|      3|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3045|      3|            return litCSize + lhSize;
 3046|      3|        }
 3047|      0|    case IS_PCH:
  ------------------
  |  |  429|      0|#define IS_PCH 1
  ------------------
  |  Branch (3047:5): [True: 0, False: 38]
  ------------------
 3048|      0|        {   size_t litSize, litCSize;
 3049|      0|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3050|      0|            if (lhSize != 1)  /* only case supported for now : small litSize, single stream */
  ------------------
  |  Branch (3050:17): [True: 0, False: 0]
  ------------------
 3051|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3052|      0|            if (!dctx->flagRepeatTable)
  ------------------
  |  Branch (3052:17): [True: 0, False: 0]
  ------------------
 3053|      0|                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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3054|       |
 3055|       |            /* 2 - 2 - 10 - 10 */
 3056|      0|            lhSize=3;
 3057|      0|            litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 3058|      0|            litCSize = ((istart[1] &  3) << 8) + istart[2];
 3059|      0|            if (litCSize + lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3059:17): [True: 0, False: 0]
  ------------------
 3060|       |
 3061|      0|            {   size_t const errorCode = HUFv06_decompress1X4_usingDTable(dctx->litBuffer, litSize, istart+lhSize, litCSize, dctx->hufTableX4);
 3062|      0|                if (HUFv06_isError(errorCode)) return ERROR(corruption_detected);
  ------------------
  |  | 2733|      0|#define HUFv06_isError  ERR_isError
  ------------------
                              if (HUFv06_isError(errorCode)) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3062:21): [True: 0, False: 0]
  ------------------
 3063|      0|            }
 3064|      0|            dctx->litPtr = dctx->litBuffer;
 3065|      0|            dctx->litSize = litSize;
 3066|      0|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  487|      0|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3067|      0|            return litCSize + lhSize;
 3068|      0|        }
 3069|      0|    case IS_RAW:
  ------------------
  |  |  430|      0|#define IS_RAW 2
  ------------------
  |  Branch (3069:5): [True: 0, False: 38]
  ------------------
 3070|      0|        {   size_t litSize;
 3071|      0|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3072|      0|            switch(lhSize)
 3073|      0|            {
 3074|      0|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3074:13): [True: 0, False: 0]
  |  Branch (3074:21): [True: 0, False: 0]
  |  Branch (3074:29): [True: 0, False: 0]
  ------------------
 3075|      0|                lhSize=1;
 3076|      0|                litSize = istart[0] & 31;
 3077|      0|                break;
 3078|      0|            case 2:
  ------------------
  |  Branch (3078:13): [True: 0, False: 0]
  ------------------
 3079|      0|                litSize = ((istart[0] & 15) << 8) + istart[1];
 3080|      0|                break;
 3081|      0|            case 3:
  ------------------
  |  Branch (3081:13): [True: 0, False: 0]
  ------------------
 3082|      0|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 3083|      0|                break;
 3084|      0|            }
 3085|       |
 3086|      0|            if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */
  ------------------
  |  |  487|      0|#define WILDCOPY_OVERLENGTH 8
  ------------------
  |  Branch (3086:17): [True: 0, False: 0]
  ------------------
 3087|      0|                if (litSize+lhSize > srcSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3087:21): [True: 0, False: 0]
  ------------------
 3088|      0|                memcpy(dctx->litBuffer, istart+lhSize, litSize);
 3089|      0|                dctx->litPtr = dctx->litBuffer;
 3090|      0|                dctx->litSize = litSize;
 3091|      0|                memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  487|      0|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3092|      0|                return lhSize+litSize;
 3093|      0|            }
 3094|       |            /* direct reference into compressed stream */
 3095|      0|            dctx->litPtr = istart+lhSize;
 3096|      0|            dctx->litSize = litSize;
 3097|      0|            return lhSize+litSize;
 3098|      0|        }
 3099|     35|    case IS_RLE:
  ------------------
  |  |  431|     35|#define IS_RLE 3
  ------------------
  |  Branch (3099:5): [True: 35, False: 3]
  ------------------
 3100|     35|        {   size_t litSize;
 3101|     35|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3102|     35|            switch(lhSize)
 3103|     35|            {
 3104|      4|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3104:13): [True: 3, False: 32]
  |  Branch (3104:21): [True: 1, False: 34]
  |  Branch (3104:29): [True: 0, False: 35]
  ------------------
 3105|      4|                lhSize = 1;
 3106|      4|                litSize = istart[0] & 31;
 3107|      4|                break;
 3108|     20|            case 2:
  ------------------
  |  Branch (3108:13): [True: 20, False: 15]
  ------------------
 3109|     20|                litSize = ((istart[0] & 15) << 8) + istart[1];
 3110|     20|                break;
 3111|     11|            case 3:
  ------------------
  |  Branch (3111:13): [True: 11, False: 24]
  ------------------
 3112|     11|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 3113|     11|                if (srcSize<4) return ERROR(corruption_detected);   /* srcSize >= MIN_CBLOCK_SIZE == 3; here we need lhSize+1 = 4 */
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3113:21): [True: 0, False: 11]
  ------------------
 3114|     11|                break;
 3115|     35|            }
 3116|     35|            if (litSize > ZSTDv06_BLOCKSIZE_MAX) return ERROR(corruption_detected);
  ------------------
  |  |  344|     35|#define ZSTDv06_BLOCKSIZE_MAX (128 * 1024)   /* define, for static allocation */
  ------------------
                          if (litSize > ZSTDv06_BLOCKSIZE_MAX) 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 (3116:17): [True: 0, False: 35]
  ------------------
 3117|     35|            memset(dctx->litBuffer, istart[lhSize], litSize + WILDCOPY_OVERLENGTH);
  ------------------
  |  |  487|     35|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3118|     35|            dctx->litPtr = dctx->litBuffer;
 3119|     35|            dctx->litSize = litSize;
 3120|     35|            return lhSize+1;
 3121|     35|        }
 3122|      0|    default:
  ------------------
  |  Branch (3122:5): [True: 0, False: 38]
  ------------------
 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|     38|    }
 3125|     38|}
zstd_v06.c:ZSTDv06_decompressSequences:
 3391|     38|{
 3392|     38|    const BYTE* ip = (const BYTE*)seqStart;
 3393|     38|    const BYTE* const iend = ip + seqSize;
 3394|     38|    BYTE* const ostart = (BYTE*)dst;
 3395|     38|    BYTE* const oend = ostart + maxDstSize;
 3396|     38|    BYTE* op = ostart;
 3397|     38|    const BYTE* litPtr = dctx->litPtr;
 3398|     38|    const BYTE* const litEnd = litPtr + dctx->litSize;
 3399|     38|    FSEv06_DTable* DTableLL = dctx->LLTable;
 3400|     38|    FSEv06_DTable* DTableML = dctx->MLTable;
 3401|     38|    FSEv06_DTable* DTableOffb = dctx->OffTable;
 3402|     38|    const BYTE* const base = (const BYTE*) (dctx->base);
 3403|     38|    const BYTE* const vBase = (const BYTE*) (dctx->vBase);
 3404|     38|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 3405|     38|    int nbSeq;
 3406|       |
 3407|       |    /* Build Decoding Tables */
 3408|     38|    {   size_t const seqHSize = ZSTDv06_decodeSeqHeaders(&nbSeq, DTableLL, DTableML, DTableOffb, dctx->flagRepeatTable, ip, seqSize);
 3409|     38|        if (ZSTDv06_isError(seqHSize)) return seqHSize;
  ------------------
  |  | 2731|     38|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3409:13): [True: 1, False: 37]
  ------------------
 3410|     37|        ip += seqHSize;
 3411|     37|        dctx->flagRepeatTable = 0;
 3412|     37|    }
 3413|       |
 3414|       |    /* Regen sequences */
 3415|     37|    if (nbSeq) {
  ------------------
  |  Branch (3415:9): [True: 37, False: 0]
  ------------------
 3416|     37|        seq_t sequence;
 3417|     37|        seqState_t seqState;
 3418|       |
 3419|     37|        memset(&sequence, 0, sizeof(sequence));
 3420|     37|        sequence.offset = REPCODE_STARTVALUE;
  ------------------
  |  |  437|     37|#define REPCODE_STARTVALUE 1
  ------------------
 3421|    148|        { U32 i; for (i=0; i<ZSTDv06_REP_INIT; i++) seqState.prevOffset[i] = REPCODE_STARTVALUE; }
  ------------------
  |  |  402|    148|#define ZSTDv06_REP_INIT   ZSTDv06_REP_NUM
  |  |  ------------------
  |  |  |  |  401|    148|#define ZSTDv06_REP_NUM    3
  |  |  ------------------
  ------------------
                      { U32 i; for (i=0; i<ZSTDv06_REP_INIT; i++) seqState.prevOffset[i] = REPCODE_STARTVALUE; }
  ------------------
  |  |  437|    111|#define REPCODE_STARTVALUE 1
  ------------------
  |  Branch (3421:28): [True: 111, False: 37]
  ------------------
 3422|     37|        { size_t const errorCode = BITv06_initDStream(&(seqState.DStream), ip, iend-ip);
 3423|     37|          if (ERR_isError(errorCode)) return ERROR(corruption_detected); }
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3423:15): [True: 0, False: 37]
  ------------------
 3424|     37|        FSEv06_initDState(&(seqState.stateLL), &(seqState.DStream), DTableLL);
 3425|     37|        FSEv06_initDState(&(seqState.stateOffb), &(seqState.DStream), DTableOffb);
 3426|     37|        FSEv06_initDState(&(seqState.stateML), &(seqState.DStream), DTableML);
 3427|       |
 3428|    393|        for ( ; (BITv06_reloadDStream(&(seqState.DStream)) <= BITv06_DStream_completed) && nbSeq ; ) {
  ------------------
  |  Branch (3428:17): [True: 385, False: 8]
  |  Branch (3428:92): [True: 384, False: 1]
  ------------------
 3429|    384|            nbSeq--;
 3430|    384|            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|    384|            {   size_t const oneSeqSize = ZSTDv06_execSequence(op, oend, sequence, &litPtr, litEnd, base, vBase, dictEnd);
 3442|    384|                if (ZSTDv06_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  | 2731|    384|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3442:21): [True: 28, False: 356]
  ------------------
 3443|    356|                op += oneSeqSize;
 3444|    356|        }   }
 3445|       |
 3446|       |        /* check if reached exact end */
 3447|      9|        if (nbSeq) 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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3447:13): [True: 8, False: 1]
  ------------------
 3448|      9|    }
 3449|       |
 3450|       |    /* last literal segment */
 3451|      1|    {   size_t const lastLLSize = litEnd - litPtr;
 3452|      1|        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: 1]
  ------------------
 3453|      1|        if (op+lastLLSize > oend) 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 (3453:13): [True: 1, False: 0]
  ------------------
 3454|      0|        if (lastLLSize > 0) {
  ------------------
  |  Branch (3454:13): [True: 0, False: 0]
  ------------------
 3455|      0|            memcpy(op, litPtr, lastLLSize);
 3456|      0|            op += lastLLSize;
 3457|      0|        }
 3458|      0|    }
 3459|       |
 3460|      0|    return op-ostart;
 3461|      1|}
zstd_v06.c:ZSTDv06_decodeSeqHeaders:
 3165|     38|{
 3166|     38|    const BYTE* const istart = (const BYTE*)src;
 3167|     38|    const BYTE* const iend = istart + srcSize;
 3168|     38|    const BYTE* ip = istart;
 3169|       |
 3170|       |    /* check */
 3171|     38|    if (srcSize < MIN_SEQUENCES_SIZE) return ERROR(srcSize_wrong);
  ------------------
  |  |  423|     38|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  ------------------
                  if (srcSize < MIN_SEQUENCES_SIZE) 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 (3171:9): [True: 0, False: 38]
  ------------------
 3172|       |
 3173|       |    /* SeqHead */
 3174|     38|    {   int nbSeq = *ip++;
 3175|     38|        if (!nbSeq) { *nbSeqPtr=0; return 1; }
  ------------------
  |  Branch (3175:13): [True: 0, False: 38]
  ------------------
 3176|     38|        if (nbSeq > 0x7F) {
  ------------------
  |  Branch (3176:13): [True: 24, False: 14]
  ------------------
 3177|     24|            if (nbSeq == 0xFF) {
  ------------------
  |  Branch (3177:17): [True: 1, False: 23]
  ------------------
 3178|      1|                if (ip+2 > iend) 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 (3178:21): [True: 0, False: 1]
  ------------------
 3179|      1|                nbSeq = MEM_readLE16(ip) + LONGNBSEQ, ip+=2;
  ------------------
  |  |  433|      1|#define LONGNBSEQ 0x7F00
  ------------------
 3180|     23|            } else {
 3181|     23|                if (ip >= iend) 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 (3181:21): [True: 0, False: 23]
  ------------------
 3182|     23|                nbSeq = ((nbSeq-0x80)<<8) + *ip++;
 3183|     23|            }
 3184|     24|        }
 3185|     38|        *nbSeqPtr = nbSeq;
 3186|     38|    }
 3187|       |
 3188|       |    /* FSE table descriptors */
 3189|     38|    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|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3189:9): [True: 0, False: 38]
  ------------------
 3190|     38|    {   U32 const LLtype  = *ip >> 6;
 3191|     38|        U32 const Offtype = (*ip >> 4) & 3;
 3192|     38|        U32 const MLtype  = (*ip >> 2) & 3;
 3193|     38|        ip++;
 3194|       |
 3195|       |        /* Build DTables */
 3196|     38|        {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableLL, LLtype, MaxLL, LLFSELog, ip, iend-ip, LL_defaultNorm, LL_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  442|     38|#define MaxLL  35
  ------------------
                      {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableLL, LLtype, MaxLL, LLFSELog, ip, iend-ip, LL_defaultNorm, LL_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  446|     38|#define LLFSELog    9
  ------------------
 3197|     38|            if (ZSTDv06_isError(bhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2731|     38|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
                          if (ZSTDv06_isError(bhSize)) 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 (3197:17): [True: 1, False: 37]
  ------------------
 3198|     37|            ip += bhSize;
 3199|     37|        }
 3200|     37|        {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableOffb, Offtype, MaxOff, OffFSELog, ip, iend-ip, OF_defaultNorm, OF_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  443|     37|#define MaxOff 28
  ------------------
                      {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableOffb, Offtype, MaxOff, OffFSELog, ip, iend-ip, OF_defaultNorm, OF_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  447|     37|#define OffFSELog   8
  ------------------
 3201|     37|            if (ZSTDv06_isError(bhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2731|     37|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
                          if (ZSTDv06_isError(bhSize)) 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 (3201:17): [True: 0, False: 37]
  ------------------
 3202|     37|            ip += bhSize;
 3203|     37|        }
 3204|     37|        {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableML, MLtype, MaxML, MLFSELog, ip, iend-ip, ML_defaultNorm, ML_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  441|     37|#define MaxML  52
  ------------------
                      {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableML, MLtype, MaxML, MLFSELog, ip, iend-ip, ML_defaultNorm, ML_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  445|     37|#define MLFSELog    9
  ------------------
 3205|     37|            if (ZSTDv06_isError(bhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2731|     37|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
                          if (ZSTDv06_isError(bhSize)) 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 (3205:17): [True: 0, False: 37]
  ------------------
 3206|     37|            ip += bhSize;
 3207|     37|    }   }
 3208|       |
 3209|      0|    return ip-istart;
 3210|     37|}
zstd_v06.c:ZSTDv06_buildSeqTable:
 3135|    112|{
 3136|    112|    switch(type)
 3137|    112|    {
 3138|     39|    case FSEv06_ENCODING_RLE :
  ------------------
  |  |  450|     39|#define FSEv06_ENCODING_RLE     1
  ------------------
  |  Branch (3138:5): [True: 39, False: 73]
  ------------------
 3139|     39|        if (!srcSize) 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 (3139:13): [True: 0, False: 39]
  ------------------
 3140|     39|        if ( (*(const BYTE*)src) > max) 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 (3140:14): [True: 0, False: 39]
  ------------------
 3141|     39|        FSEv06_buildDTable_rle(DTable, *(const BYTE*)src);   /* if *src > max, data is corrupted */
 3142|     39|        return 1;
 3143|     47|    case FSEv06_ENCODING_RAW :
  ------------------
  |  |  449|     47|#define FSEv06_ENCODING_RAW     0
  ------------------
  |  Branch (3143:5): [True: 47, False: 65]
  ------------------
 3144|     47|        FSEv06_buildDTable(DTable, defaultNorm, max, defaultLog);
 3145|     47|        return 0;
 3146|      0|    case FSEv06_ENCODING_STATIC:
  ------------------
  |  |  451|      0|#define FSEv06_ENCODING_STATIC  2
  ------------------
  |  Branch (3146:5): [True: 0, False: 112]
  ------------------
 3147|      0|        if (!flagRepeatTable) 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 (3147:13): [True: 0, False: 0]
  ------------------
 3148|      0|        return 0;
 3149|      0|    default :   /* impossible */
  ------------------
  |  Branch (3149:5): [True: 0, False: 112]
  ------------------
 3150|     26|    case FSEv06_ENCODING_DYNAMIC :
  ------------------
  |  |  452|     26|#define FSEv06_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3150:5): [True: 26, False: 86]
  ------------------
 3151|     26|        {   U32 tableLog;
 3152|     26|            S16 norm[MaxSeq+1];
 3153|     26|            size_t const headerSize = FSEv06_readNCount(norm, &max, &tableLog, src, srcSize);
 3154|     26|            if (FSEv06_isError(headerSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2732|     26|#define FSEv06_isError  ERR_isError
  ------------------
                          if (FSEv06_isError(headerSize)) 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 (3154:17): [True: 0, False: 26]
  ------------------
 3155|     26|            if (tableLog > maxLog) 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 (3155:17): [True: 1, False: 25]
  ------------------
 3156|     25|            FSEv06_buildDTable(DTable, norm, max, tableLog);
 3157|     25|            return headerSize;
 3158|     26|    }   }
 3159|    112|}
zstd_v06.c:ZSTDv06_decodeSequence:
 3230|    384|{
 3231|       |    /* Literal length */
 3232|    384|    U32 const llCode = FSEv06_peekSymbol(&(seqState->stateLL));
 3233|    384|    U32 const mlCode = FSEv06_peekSymbol(&(seqState->stateML));
 3234|    384|    U32 const ofCode = FSEv06_peekSymbol(&(seqState->stateOffb));   /* <= maxOff, by table construction */
 3235|       |
 3236|    384|    U32 const llBits = LL_bits[llCode];
 3237|    384|    U32 const mlBits = ML_bits[mlCode];
 3238|    384|    U32 const ofBits = ofCode;
 3239|    384|    U32 const totalBits = llBits+mlBits+ofBits;
 3240|       |
 3241|    384|    static const U32 LL_base[MaxLL+1] = {
 3242|    384|                             0,  1,  2,  3,  4,  5,  6,  7,  8,  9,   10,    11,    12,    13,    14,     15,
 3243|    384|                            16, 18, 20, 22, 24, 28, 32, 40, 48, 64, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000,
 3244|    384|                            0x2000, 0x4000, 0x8000, 0x10000 };
 3245|       |
 3246|    384|    static const U32 ML_base[MaxML+1] = {
 3247|    384|                             0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10,   11,    12,    13,    14,    15,
 3248|    384|                            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,   27,    28,    29,    30,    31,
 3249|    384|                            32, 34, 36, 38, 40, 44, 48, 56, 64, 80, 96, 0x80, 0x100, 0x200, 0x400, 0x800,
 3250|    384|                            0x1000, 0x2000, 0x4000, 0x8000, 0x10000 };
 3251|       |
 3252|    384|    static const U32 OF_base[MaxOff+1] = {
 3253|    384|                 0,        1,       3,       7,     0xF,     0x1F,     0x3F,     0x7F,
 3254|    384|                 0xFF,   0x1FF,   0x3FF,   0x7FF,   0xFFF,   0x1FFF,   0x3FFF,   0x7FFF,
 3255|    384|                 0xFFFF, 0x1FFFF, 0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF, 0x7FFFFF,
 3256|    384|                 0xFFFFFF, 0x1FFFFFF, 0x3FFFFFF, /*fake*/ 1, 1 };
 3257|       |
 3258|       |    /* sequence */
 3259|    384|    {   size_t offset;
 3260|    384|        if (!ofCode)
  ------------------
  |  Branch (3260:13): [True: 218, False: 166]
  ------------------
 3261|    218|            offset = 0;
 3262|    166|        else {
 3263|    166|            offset = OF_base[ofCode] + BITv06_readBits(&(seqState->DStream), ofBits);   /* <=  26 bits */
 3264|    166|            if (MEM_32bits()) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3264:17): [True: 0, False: 166]
  ------------------
 3265|    166|        }
 3266|       |
 3267|    384|        if (offset < ZSTDv06_REP_NUM) {
  ------------------
  |  |  401|    384|#define ZSTDv06_REP_NUM    3
  ------------------
  |  Branch (3267:13): [True: 329, False: 55]
  ------------------
 3268|    329|            if (llCode == 0 && offset <= 1) offset = 1-offset;
  ------------------
  |  Branch (3268:17): [True: 51, False: 278]
  |  Branch (3268:32): [True: 51, False: 0]
  ------------------
 3269|       |
 3270|    329|            if (offset != 0) {
  ------------------
  |  Branch (3270:17): [True: 158, False: 171]
  ------------------
 3271|    158|                size_t temp = seqState->prevOffset[offset];
 3272|    158|                if (offset != 1) {
  ------------------
  |  Branch (3272:21): [True: 54, False: 104]
  ------------------
 3273|     54|                    seqState->prevOffset[2] = seqState->prevOffset[1];
 3274|     54|                }
 3275|    158|                seqState->prevOffset[1] = seqState->prevOffset[0];
 3276|    158|                seqState->prevOffset[0] = offset = temp;
 3277|       |
 3278|    171|            } else {
 3279|    171|                offset = seqState->prevOffset[0];
 3280|    171|            }
 3281|    329|        } else {
 3282|     55|            offset -= ZSTDv06_REP_MOVE;
  ------------------
  |  |  403|     55|#define ZSTDv06_REP_MOVE   (ZSTDv06_REP_NUM-1)
  |  |  ------------------
  |  |  |  |  401|     55|#define ZSTDv06_REP_NUM    3
  |  |  ------------------
  ------------------
 3283|     55|            seqState->prevOffset[2] = seqState->prevOffset[1];
 3284|     55|            seqState->prevOffset[1] = seqState->prevOffset[0];
 3285|     55|            seqState->prevOffset[0] = offset;
 3286|     55|        }
 3287|    384|        seq->offset = offset;
 3288|    384|    }
 3289|       |
 3290|    384|    seq->matchLength = ML_base[mlCode] + MINMATCH + ((mlCode>31) ? BITv06_readBits(&(seqState->DStream), mlBits) : 0);   /* <=  16 bits */
  ------------------
  |  |  435|    384|#define MINMATCH 3
  ------------------
  |  Branch (3290:54): [True: 83, False: 301]
  ------------------
 3291|    384|    if (MEM_32bits() && (mlBits+llBits>24)) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3291:9): [True: 0, False: 384]
  |  Branch (3291:25): [True: 0, False: 0]
  ------------------
 3292|       |
 3293|    384|    seq->litLength = LL_base[llCode] + ((llCode>15) ? BITv06_readBits(&(seqState->DStream), llBits) : 0);   /* <=  16 bits */
  ------------------
  |  Branch (3293:41): [True: 125, False: 259]
  ------------------
 3294|    384|    if (MEM_32bits() ||
  ------------------
  |  Branch (3294:9): [True: 0, False: 384]
  ------------------
 3295|    384|       (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  |  446|    384|#define LLFSELog    9
  ------------------
                     (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  |  445|    384|#define MLFSELog    9
  ------------------
                     (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  |  447|    384|#define OffFSELog   8
  ------------------
  |  Branch (3295:8): [True: 1, False: 383]
  ------------------
 3296|       |
 3297|       |    /* ANS state update */
 3298|    384|    FSEv06_updateState(&(seqState->stateLL), &(seqState->DStream));   /* <=  9 bits */
 3299|    384|    FSEv06_updateState(&(seqState->stateML), &(seqState->DStream));   /* <=  9 bits */
 3300|    384|    if (MEM_32bits()) BITv06_reloadDStream(&(seqState->DStream));     /* <= 18 bits */
  ------------------
  |  Branch (3300:9): [True: 0, False: 384]
  ------------------
 3301|    384|    FSEv06_updateState(&(seqState->stateOffb), &(seqState->DStream)); /* <=  8 bits */
 3302|    384|}
zstd_v06.c:FSEv06_peekSymbol:
 1062|  1.15k|{
 1063|  1.15k|    FSEv06_decode_t const DInfo = ((const FSEv06_decode_t*)(DStatePtr->table))[DStatePtr->state];
 1064|  1.15k|    return DInfo.symbol;
 1065|  1.15k|}
zstd_v06.c:FSEv06_updateState:
 1068|  1.15k|{
 1069|  1.15k|    FSEv06_decode_t const DInfo = ((const FSEv06_decode_t*)(DStatePtr->table))[DStatePtr->state];
 1070|  1.15k|    U32 const nbBits = DInfo.nbBits;
 1071|  1.15k|    size_t const lowBits = BITv06_readBits(bitD, nbBits);
 1072|  1.15k|    DStatePtr->state = DInfo.newState + lowBits;
 1073|  1.15k|}
zstd_v06.c:ZSTDv06_execSequence:
 3309|    384|{
 3310|    384|    BYTE* const oLitEnd = op + sequence.litLength;
 3311|    384|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 3312|    384|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 3313|    384|    BYTE* const oend_8 = oend-8;
 3314|    384|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 3315|    384|    const BYTE* match = oLitEnd - sequence.offset;
 3316|       |
 3317|       |    /* checks */
 3318|    384|    size_t const seqLength = sequence.litLength + sequence.matchLength;
 3319|       |
 3320|    384|    if (seqLength > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|     22|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     22|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     22|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3320:9): [True: 22, False: 362]
  ------------------
 3321|    362|    if (sequence.litLength > (size_t)(litLimit - *litPtr)) 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 (3321:9): [True: 0, False: 362]
  ------------------
 3322|       |    /* Now we know there are no overflow in literal nor match lengths, can use pointer checks */
 3323|    362|    if (oLitEnd > oend_8) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3323:9): [True: 4, False: 358]
  ------------------
 3324|       |
 3325|    358|    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: 358]
  ------------------
 3326|    358|    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: 358]
  ------------------
 3327|       |
 3328|       |    /* copy Literals */
 3329|    358|    ZSTDv06_wildcopy(op, *litPtr, (ptrdiff_t)sequence.litLength);   /* note : oLitEnd <= oend-8 : no risk of overwrite beyond oend */
 3330|    358|    op = oLitEnd;
 3331|    358|    *litPtr = iLitEnd;   /* update for next sequence */
 3332|       |
 3333|       |    /* copy Match */
 3334|    358|    if (sequence.offset > (size_t)(oLitEnd - base)) {
  ------------------
  |  Branch (3334:9): [True: 17, False: 341]
  ------------------
 3335|       |        /* offset beyond prefix */
 3336|     17|        if (sequence.offset > (size_t)(oLitEnd - vBase)) 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 (3336:13): [True: 2, False: 15]
  ------------------
 3337|     15|        match = dictEnd - (base-match);
 3338|     15|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (3338:13): [True: 1, False: 14]
  ------------------
 3339|      1|            memmove(oLitEnd, match, sequence.matchLength);
 3340|      1|            return sequenceLength;
 3341|      1|        }
 3342|       |        /* span extDict & currentPrefixSegment */
 3343|     14|        {   size_t const length1 = dictEnd - match;
 3344|     14|            memmove(oLitEnd, match, length1);
 3345|     14|            op = oLitEnd + length1;
 3346|     14|            sequence.matchLength -= length1;
 3347|     14|            match = base;
 3348|     14|            if (op > oend_8 || sequence.matchLength < MINMATCH) {
  ------------------
  |  |  435|     14|#define MINMATCH 3
  ------------------
  |  Branch (3348:17): [True: 0, False: 14]
  |  Branch (3348:32): [True: 1, False: 13]
  ------------------
 3349|      3|              while (op < oMatchEnd) *op++ = *match++;
  ------------------
  |  Branch (3349:22): [True: 2, False: 1]
  ------------------
 3350|      1|              return sequenceLength;
 3351|      1|            }
 3352|     14|    }   }
 3353|       |    /* Requirement: op <= oend_8 */
 3354|       |
 3355|       |    /* match within prefix */
 3356|    354|    if (sequence.offset < 8) {
  ------------------
  |  Branch (3356:9): [True: 308, False: 46]
  ------------------
 3357|       |        /* close range match, overlap */
 3358|    308|        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
 3359|    308|        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
 3360|    308|        int const sub2 = dec64table[sequence.offset];
 3361|    308|        op[0] = match[0];
 3362|    308|        op[1] = match[1];
 3363|    308|        op[2] = match[2];
 3364|    308|        op[3] = match[3];
 3365|    308|        match += dec32table[sequence.offset];
 3366|    308|        ZSTDv06_copy4(op+4, match);
 3367|    308|        match -= sub2;
 3368|    308|    } else {
 3369|     46|        ZSTDv06_copy8(op, match);
 3370|     46|    }
 3371|    354|    op += 8; match += 8;
 3372|       |
 3373|    354|    if (oMatchEnd > oend-(16-MINMATCH)) {
  ------------------
  |  |  435|    354|#define MINMATCH 3
  ------------------
  |  Branch (3373:9): [True: 9, False: 345]
  ------------------
 3374|      9|        if (op < oend_8) {
  ------------------
  |  Branch (3374:13): [True: 7, False: 2]
  ------------------
 3375|      7|            ZSTDv06_wildcopy(op, match, oend_8 - op);
 3376|      7|            match += oend_8 - op;
 3377|      7|            op = oend_8;
 3378|      7|        }
 3379|     27|        while (op < oMatchEnd) *op++ = *match++;
  ------------------
  |  Branch (3379:16): [True: 18, False: 9]
  ------------------
 3380|    345|    } else {
 3381|    345|        ZSTDv06_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8);   /* works even if matchLength < 8 */
 3382|    345|    }
 3383|    354|    return sequenceLength;
 3384|    358|}
zstd_v06.c:ZSTDv06_wildcopy:
  489|    710|{
  490|    710|    const BYTE* ip = (const BYTE*)src;
  491|    710|    BYTE* op = (BYTE*)dst;
  492|    710|    BYTE* const oend = op + length;
  493|    710|    do
  494|  1.86k|        COPY8(op, ip)
  ------------------
  |  |  483|  1.86k|#define COPY8(d,s) { ZSTDv06_copy8(d,s); d+=8; s+=8; }
  ------------------
  495|  1.86k|    while (op < oend);
  ------------------
  |  Branch (495:12): [True: 1.15k, False: 710]
  ------------------
  496|    710|}
zstd_v06.c:ZSTDv06_copy4:
 2739|    308|static void ZSTDv06_copy4(void* dst, const void* src) { memcpy(dst, src, 4); }
zstd_v06.c:ZSTDv06_copy8:
  482|  1.91k|static void ZSTDv06_copy8(void* dst, const void* src) { memcpy(dst, src, 8); }
zstd_v06.c:ZSTDv06_decompressFrame:
 3507|     50|{
 3508|     50|    const BYTE* ip = (const BYTE*)src;
 3509|     50|    const BYTE* const iend = ip + srcSize;
 3510|     50|    BYTE* const ostart = (BYTE*)dst;
 3511|     50|    BYTE* op = ostart;
 3512|     50|    BYTE* const oend = ostart + dstCapacity;
 3513|     50|    size_t remainingSize = srcSize;
 3514|     50|    blockProperties_t blockProperties = { bt_compressed, 0 };
 3515|       |
 3516|       |    /* check */
 3517|     50|    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: 50]
  ------------------
 3518|       |
 3519|       |    /* Frame Header */
 3520|     50|    {   size_t const frameHeaderSize = ZSTDv06_frameHeaderSize(src, ZSTDv06_frameHeaderSize_min);
 3521|     50|        if (ZSTDv06_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  | 2731|     50|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3521:13): [True: 0, False: 50]
  ------------------
 3522|     50|        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: 50]
  ------------------
 3523|     50|        if (ZSTDv06_decodeFrameHeader(dctx, src, frameHeaderSize)) return ERROR(corruption_detected);
  ------------------
  |  |   49|      9|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      9|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      9|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3523:13): [True: 9, False: 41]
  ------------------
 3524|     41|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3525|     41|    }
 3526|       |
 3527|       |    /* Loop on each block */
 3528|     43|    while (1) {
  ------------------
  |  Branch (3528:12): [True: 43, Folded]
  ------------------
 3529|     43|        size_t decodedSize=0;
 3530|     43|        size_t const cBlockSize = ZSTDv06_getcBlockSize(ip, iend-ip, &blockProperties);
 3531|     43|        if (ZSTDv06_isError(cBlockSize)) return cBlockSize;
  ------------------
  |  | 2731|     43|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3531:13): [True: 0, False: 43]
  ------------------
 3532|       |
 3533|     43|        ip += ZSTDv06_blockHeaderSize;
 3534|     43|        remainingSize -= ZSTDv06_blockHeaderSize;
 3535|     43|        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: 43]
  ------------------
 3536|       |
 3537|     43|        switch(blockProperties.blockType)
 3538|     43|        {
 3539|     38|        case bt_compressed:
  ------------------
  |  Branch (3539:9): [True: 38, False: 5]
  ------------------
 3540|     38|            decodedSize = ZSTDv06_decompressBlock_internal(dctx, op, oend-op, ip, cBlockSize);
 3541|     38|            break;
 3542|      2|        case bt_raw :
  ------------------
  |  Branch (3542:9): [True: 2, False: 41]
  ------------------
 3543|      2|            decodedSize = ZSTDv06_copyRawBlock(op, oend-op, ip, cBlockSize);
 3544|      2|            break;
 3545|      2|        case bt_rle :
  ------------------
  |  Branch (3545:9): [True: 2, False: 41]
  ------------------
 3546|      2|            return ERROR(GENERIC);   /* not yet supported */
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3547|      0|            break;
 3548|      1|        case bt_end :
  ------------------
  |  Branch (3548:9): [True: 1, False: 42]
  ------------------
 3549|       |            /* end of frame */
 3550|      1|            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]
  ------------------
 3551|      1|            break;
 3552|      1|        default:
  ------------------
  |  Branch (3552:9): [True: 0, False: 43]
  ------------------
 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|     43|        }
 3555|     41|        if (cBlockSize == 0) break;   /* bt_end */
  ------------------
  |  Branch (3555:13): [True: 1, False: 40]
  ------------------
 3556|       |
 3557|     40|        if (ZSTDv06_isError(decodedSize)) return decodedSize;
  ------------------
  |  | 2731|     40|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3557:13): [True: 38, False: 2]
  ------------------
 3558|      2|        op += decodedSize;
 3559|      2|        ip += cBlockSize;
 3560|      2|        remainingSize -= cBlockSize;
 3561|      2|    }
 3562|       |
 3563|      1|    return op-ostart;
 3564|     41|}
zstd_v06.c:ZSTD_errorFrameSizeInfoLegacy:
 3612|      1|{
 3613|      1|    *cSize = ret;
 3614|      1|    *dBound = ZSTD_CONTENTSIZE_ERROR;
  ------------------
  |  |  454|      1|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
 3615|      1|}
zstd_v06.c:ZSTDv06_getcBlockSize:
 2971|    273|{
 2972|    273|    const BYTE* const in = (const BYTE*)src;
 2973|    273|    U32 cSize;
 2974|       |
 2975|    273|    if (srcSize < 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 (2975:9): [True: 0, False: 273]
  ------------------
 2976|       |
 2977|    273|    bpPtr->blockType = (blockType_t)((*in) >> 6);
 2978|    273|    cSize = in[2] + (in[1]<<8) + ((in[0] & 7)<<16);
 2979|    273|    bpPtr->origSize = (bpPtr->blockType == bt_rle) ? cSize : 0;
  ------------------
  |  Branch (2979:23): [True: 83, False: 190]
  ------------------
 2980|       |
 2981|    273|    if (bpPtr->blockType == bt_end) return 0;
  ------------------
  |  Branch (2981:9): [True: 41, False: 232]
  ------------------
 2982|    232|    if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (2982:9): [True: 83, False: 149]
  ------------------
 2983|    149|    return cSize;
 2984|    232|}
zstd_v06.c:ZSTDv06_decodeFrameHeader:
 2955|     50|{
 2956|     50|    size_t const result = ZSTDv06_getFrameParams(&(zc->fParams), src, srcSize);
 2957|     50|    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: 50]
  |  Branch (2957:27): [True: 0, False: 0]
  ------------------
 2958|     50|    return result;
 2959|     50|}
zstd_v06.c:ZSTDv06_copyRawBlock:
 2988|      2|{
 2989|      2|    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]
  ------------------
 2990|      2|    if (srcSize > dstCapacity) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      0|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      0|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      0|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2990:9): [True: 0, False: 2]
  ------------------
 2991|      2|    memcpy(dst, src, srcSize);
 2992|      2|    return srcSize;
 2993|      2|}
zstd_v06.c:ZSTDv06_decompress_insertDictionary:
 3803|     33|{
 3804|     33|    size_t eSize;
 3805|     33|    U32 const magic = MEM_readLE32(dict);
 3806|     33|    if (magic != ZSTDv06_DICT_MAGIC) {
  ------------------
  |  |  399|     33|#define ZSTDv06_DICT_MAGIC  0xEC30A436
  ------------------
  |  Branch (3806:9): [True: 31, False: 2]
  ------------------
 3807|       |        /* pure content mode */
 3808|     31|        ZSTDv06_refDictContent(dctx, dict, dictSize);
 3809|     31|        return 0;
 3810|     31|    }
 3811|       |    /* load entropy tables */
 3812|      2|    dict = (const char*)dict + 4;
 3813|      2|    dictSize -= 4;
 3814|      2|    eSize = ZSTDv06_loadEntropy(dctx, dict, dictSize);
 3815|      2|    if (ZSTDv06_isError(eSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2731|      2|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
                  if (ZSTDv06_isError(eSize)) 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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3815:9): [True: 2, False: 0]
  ------------------
 3816|       |
 3817|       |    /* reference dictionary content */
 3818|      0|    dict = (const char*)dict + eSize;
 3819|      0|    dictSize -= eSize;
 3820|      0|    ZSTDv06_refDictContent(dctx, dict, dictSize);
 3821|       |
 3822|      0|    return 0;
 3823|      2|}
zstd_v06.c:ZSTDv06_refDictContent:
 3751|     31|{
 3752|     31|    dctx->dictEnd = dctx->previousDstEnd;
 3753|     31|    dctx->vBase = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3754|     31|    dctx->base = dict;
 3755|     31|    dctx->previousDstEnd = (const char*)dict + dictSize;
 3756|     31|}
zstd_v06.c:ZSTDv06_loadEntropy:
 3759|      2|{
 3760|      2|    size_t hSize, offcodeHeaderSize, matchlengthHeaderSize, litlengthHeaderSize;
 3761|       |
 3762|      2|    hSize = HUFv06_readDTableX4(dctx->hufTableX4, dict, dictSize);
 3763|      2|    if (HUFv06_isError(hSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2733|      2|#define HUFv06_isError  ERR_isError
  ------------------
                  if (HUFv06_isError(hSize)) 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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3763:9): [True: 2, False: 0]
  ------------------
 3764|      0|    dict = (const char*)dict + hSize;
 3765|      0|    dictSize -= hSize;
 3766|       |
 3767|      0|    {   short offcodeNCount[MaxOff+1];
 3768|      0|        U32 offcodeMaxValue=MaxOff, offcodeLog;
  ------------------
  |  |  443|      0|#define MaxOff 28
  ------------------
 3769|      0|        offcodeHeaderSize = FSEv06_readNCount(offcodeNCount, &offcodeMaxValue, &offcodeLog, dict, dictSize);
 3770|      0|        if (FSEv06_isError(offcodeHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2732|      0|#define FSEv06_isError  ERR_isError
  ------------------
                      if (FSEv06_isError(offcodeHeaderSize)) 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 (3770:13): [True: 0, False: 0]
  ------------------
 3771|      0|        if (offcodeLog > OffFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  |  447|      0|#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 (3771:13): [True: 0, False: 0]
  ------------------
 3772|      0|        { size_t const errorCode = FSEv06_buildDTable(dctx->OffTable, offcodeNCount, offcodeMaxValue, offcodeLog);
 3773|      0|          if (FSEv06_isError(errorCode)) return ERROR(dictionary_corrupted); }
  ------------------
  |  | 2732|      0|#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: 0]
  ------------------
 3774|      0|        dict = (const char*)dict + offcodeHeaderSize;
 3775|      0|        dictSize -= offcodeHeaderSize;
 3776|      0|    }
 3777|       |
 3778|      0|    {   short matchlengthNCount[MaxML+1];
 3779|      0|        unsigned matchlengthMaxValue = MaxML, matchlengthLog;
  ------------------
  |  |  441|      0|#define MaxML  52
  ------------------
 3780|      0|        matchlengthHeaderSize = FSEv06_readNCount(matchlengthNCount, &matchlengthMaxValue, &matchlengthLog, dict, dictSize);
 3781|      0|        if (FSEv06_isError(matchlengthHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2732|      0|#define FSEv06_isError  ERR_isError
  ------------------
                      if (FSEv06_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 (3781:13): [True: 0, False: 0]
  ------------------
 3782|      0|        if (matchlengthLog > MLFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  |  445|      0|#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 (3782:13): [True: 0, False: 0]
  ------------------
 3783|      0|        { size_t const errorCode = FSEv06_buildDTable(dctx->MLTable, matchlengthNCount, matchlengthMaxValue, matchlengthLog);
 3784|      0|          if (FSEv06_isError(errorCode)) return ERROR(dictionary_corrupted); }
  ------------------
  |  | 2732|      0|#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: 0]
  ------------------
 3785|      0|        dict = (const char*)dict + matchlengthHeaderSize;
 3786|      0|        dictSize -= matchlengthHeaderSize;
 3787|      0|    }
 3788|       |
 3789|      0|    {   short litlengthNCount[MaxLL+1];
 3790|      0|        unsigned litlengthMaxValue = MaxLL, litlengthLog;
  ------------------
  |  |  442|      0|#define MaxLL  35
  ------------------
 3791|      0|        litlengthHeaderSize = FSEv06_readNCount(litlengthNCount, &litlengthMaxValue, &litlengthLog, dict, dictSize);
 3792|      0|        if (FSEv06_isError(litlengthHeaderSize)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2732|      0|#define FSEv06_isError  ERR_isError
  ------------------
                      if (FSEv06_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 (3792:13): [True: 0, False: 0]
  ------------------
 3793|      0|        if (litlengthLog > LLFSELog) return ERROR(dictionary_corrupted);
  ------------------
  |  |  446|      0|#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 (3793:13): [True: 0, False: 0]
  ------------------
 3794|      0|        { size_t const errorCode = FSEv06_buildDTable(dctx->LLTable, litlengthNCount, litlengthMaxValue, litlengthLog);
 3795|      0|          if (FSEv06_isError(errorCode)) return ERROR(dictionary_corrupted); }
  ------------------
  |  | 2732|      0|#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: 0]
  ------------------
 3796|      0|    }
 3797|       |
 3798|      0|    dctx->flagRepeatTable = 1;
 3799|      0|    return hSize + offcodeHeaderSize + matchlengthHeaderSize + litlengthHeaderSize;
 3800|      0|}

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

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

bshuf_shuffle_bit_eightelem_scal:
  200|  1.61k|        const size_t size, const size_t elem_size) {
  201|       |
  202|  1.61k|  const char *in_b;
  203|  1.61k|  char *out_b;
  204|  1.61k|  uint64_t x, t;
  205|  1.61k|  size_t ii, jj, kk;
  206|  1.61k|  size_t nbyte, out_index;
  207|       |
  208|  1.61k|  uint64_t e=1;
  209|  1.61k|  const int little_endian = *(uint8_t *) &e == 1;
  210|  1.61k|  const size_t elem_skip = little_endian ? elem_size : -elem_size;
  ------------------
  |  Branch (210:28): [True: 1.61k, False: 0]
  ------------------
  211|  1.61k|  const uint64_t elem_offset = little_endian ? 0 : 7 * elem_size;
  ------------------
  |  Branch (211:32): [True: 1.61k, False: 0]
  ------------------
  212|       |
  213|  1.61k|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|  1.61k|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 1.61k]
  |  |  ------------------
  ------------------
  214|       |
  215|  1.61k|  in_b = (const char*) in;
  216|  1.61k|  out_b = (char*) out;
  217|       |
  218|  1.61k|  nbyte = elem_size * size;
  219|       |
  220|  72.2k|  for (jj = 0; jj < 8 * elem_size; jj += 8) {
  ------------------
  |  Branch (220:16): [True: 70.6k, False: 1.61k]
  ------------------
  221|  1.24M|    for (ii = 0; ii + 8 * elem_size - 1 < nbyte; ii += 8 * elem_size) {
  ------------------
  |  Branch (221:18): [True: 1.17M, False: 70.6k]
  ------------------
  222|  1.17M|      x = *((uint64_t*) &in_b[ii + jj]);
  223|  1.17M|      if (little_endian) {
  ------------------
  |  Branch (223:11): [True: 1.17M, False: 0]
  ------------------
  224|  1.17M|        TRANS_BIT_8X8(x, t);
  ------------------
  |  |   56|  1.17M|#define TRANS_BIT_8X8(x, t) {                                               \
  |  |   57|  1.17M|        t = (x ^ (x >> 7)) & 0x00AA00AA00AA00AALL;                          \
  |  |   58|  1.17M|        x = x ^ t ^ (t << 7);                                               \
  |  |   59|  1.17M|        t = (x ^ (x >> 14)) & 0x0000CCCC0000CCCCLL;                         \
  |  |   60|  1.17M|        x = x ^ t ^ (t << 14);                                              \
  |  |   61|  1.17M|        t = (x ^ (x >> 28)) & 0x00000000F0F0F0F0LL;                         \
  |  |   62|  1.17M|        x = x ^ t ^ (t << 28);                                              \
  |  |   63|  1.17M|    }
  ------------------
  225|  1.17M|      } 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.5M|      for (kk = 0; kk < 8; kk++) {
  ------------------
  |  Branch (228:20): [True: 9.36M, False: 1.17M]
  ------------------
  229|  9.36M|        out_index = ii + jj / 8 + elem_offset + kk * elem_skip;
  230|  9.36M|        *((uint8_t*) &out_b[out_index]) = x;
  231|  9.36M|        x = x >> 8;
  232|  9.36M|      }
  233|  1.17M|    }
  234|  70.6k|  }
  235|  1.61k|  return size * elem_size;
  236|  1.61k|}

bshuf_trans_byte_bitrow_SSE:
  324|  2.21k|                                    const size_t elem_size) {
  325|       |
  326|  2.21k|  size_t ii, jj;
  327|  2.21k|  const char* in_b = (const char*) in;
  328|  2.21k|  char* out_b = (char*) out;
  329|       |
  330|  2.21k|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|  2.21k|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 2.21k]
  |  |  ------------------
  ------------------
  331|       |
  332|  2.21k|  size_t nrows = 8 * elem_size;
  333|  2.21k|  size_t nbyte_row = size / 8;
  334|       |
  335|  2.21k|  __m128i a0, b0, c0, d0, e0, f0, g0, h0;
  336|  2.21k|  __m128i a1, b1, c1, d1, e1, f1, g1, h1;
  337|  2.21k|  __m128 *as, *bs, *cs, *ds, *es, *fs, *gs, *hs;
  338|       |
  339|   118k|  for (ii = 0; ii + 7 < nrows; ii += 8) {
  ------------------
  |  Branch (339:16): [True: 116k, False: 2.21k]
  ------------------
  340|   249k|    for (jj = 0; jj + 15 < nbyte_row; jj += 16) {
  ------------------
  |  Branch (340:18): [True: 133k, False: 116k]
  ------------------
  341|   133k|      a0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 0)*nbyte_row + jj]);
  342|   133k|      b0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 1)*nbyte_row + jj]);
  343|   133k|      c0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 2)*nbyte_row + jj]);
  344|   133k|      d0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 3)*nbyte_row + jj]);
  345|   133k|      e0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 4)*nbyte_row + jj]);
  346|   133k|      f0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 5)*nbyte_row + jj]);
  347|   133k|      g0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 6)*nbyte_row + jj]);
  348|   133k|      h0 = _mm_loadu_si128((__m128i *) &in_b[(ii + 7)*nbyte_row + jj]);
  349|       |
  350|       |
  351|   133k|      a1 = _mm_unpacklo_epi8(a0, b0);
  352|   133k|      b1 = _mm_unpacklo_epi8(c0, d0);
  353|   133k|      c1 = _mm_unpacklo_epi8(e0, f0);
  354|   133k|      d1 = _mm_unpacklo_epi8(g0, h0);
  355|   133k|      e1 = _mm_unpackhi_epi8(a0, b0);
  356|   133k|      f1 = _mm_unpackhi_epi8(c0, d0);
  357|   133k|      g1 = _mm_unpackhi_epi8(e0, f0);
  358|   133k|      h1 = _mm_unpackhi_epi8(g0, h0);
  359|       |
  360|       |
  361|   133k|      a0 = _mm_unpacklo_epi16(a1, b1);
  362|   133k|      b0 = _mm_unpacklo_epi16(c1, d1);
  363|   133k|      c0 = _mm_unpackhi_epi16(a1, b1);
  364|   133k|      d0 = _mm_unpackhi_epi16(c1, d1);
  365|       |
  366|   133k|      e0 = _mm_unpacklo_epi16(e1, f1);
  367|   133k|      f0 = _mm_unpacklo_epi16(g1, h1);
  368|   133k|      g0 = _mm_unpackhi_epi16(e1, f1);
  369|   133k|      h0 = _mm_unpackhi_epi16(g1, h1);
  370|       |
  371|       |
  372|   133k|      a1 = _mm_unpacklo_epi32(a0, b0);
  373|   133k|      b1 = _mm_unpackhi_epi32(a0, b0);
  374|       |
  375|   133k|      c1 = _mm_unpacklo_epi32(c0, d0);
  376|   133k|      d1 = _mm_unpackhi_epi32(c0, d0);
  377|       |
  378|   133k|      e1 = _mm_unpacklo_epi32(e0, f0);
  379|   133k|      f1 = _mm_unpackhi_epi32(e0, f0);
  380|       |
  381|   133k|      g1 = _mm_unpacklo_epi32(g0, h0);
  382|   133k|      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|   133k|      as = (__m128 *) &a1;
  387|   133k|      bs = (__m128 *) &b1;
  388|   133k|      cs = (__m128 *) &c1;
  389|   133k|      ds = (__m128 *) &d1;
  390|   133k|      es = (__m128 *) &e1;
  391|   133k|      fs = (__m128 *) &f1;
  392|   133k|      gs = (__m128 *) &g1;
  393|   133k|      hs = (__m128 *) &h1;
  394|       |
  395|   133k|      _mm_storel_pi((__m64 *) &out_b[(jj + 0) * nrows + ii], *as);
  396|   133k|      _mm_storel_pi((__m64 *) &out_b[(jj + 2) * nrows + ii], *bs);
  397|   133k|      _mm_storel_pi((__m64 *) &out_b[(jj + 4) * nrows + ii], *cs);
  398|   133k|      _mm_storel_pi((__m64 *) &out_b[(jj + 6) * nrows + ii], *ds);
  399|   133k|      _mm_storel_pi((__m64 *) &out_b[(jj + 8) * nrows + ii], *es);
  400|   133k|      _mm_storel_pi((__m64 *) &out_b[(jj + 10) * nrows + ii], *fs);
  401|   133k|      _mm_storel_pi((__m64 *) &out_b[(jj + 12) * nrows + ii], *gs);
  402|   133k|      _mm_storel_pi((__m64 *) &out_b[(jj + 14) * nrows + ii], *hs);
  403|       |
  404|   133k|      _mm_storeh_pi((__m64 *) &out_b[(jj + 1) * nrows + ii], *as);
  405|   133k|      _mm_storeh_pi((__m64 *) &out_b[(jj + 3) * nrows + ii], *bs);
  406|   133k|      _mm_storeh_pi((__m64 *) &out_b[(jj + 5) * nrows + ii], *cs);
  407|   133k|      _mm_storeh_pi((__m64 *) &out_b[(jj + 7) * nrows + ii], *ds);
  408|   133k|      _mm_storeh_pi((__m64 *) &out_b[(jj + 9) * nrows + ii], *es);
  409|   133k|      _mm_storeh_pi((__m64 *) &out_b[(jj + 11) * nrows + ii], *fs);
  410|   133k|      _mm_storeh_pi((__m64 *) &out_b[(jj + 13) * nrows + ii], *gs);
  411|   133k|      _mm_storeh_pi((__m64 *) &out_b[(jj + 15) * nrows + ii], *hs);
  412|   133k|    }
  413|   127k|    for (jj = nbyte_row - nbyte_row % 16; jj < nbyte_row; jj ++) {
  ------------------
  |  Branch (413:43): [True: 11.6k, False: 116k]
  ------------------
  414|  11.6k|      out_b[jj * nrows + ii + 0] = in_b[(ii + 0)*nbyte_row + jj];
  415|  11.6k|      out_b[jj * nrows + ii + 1] = in_b[(ii + 1)*nbyte_row + jj];
  416|  11.6k|      out_b[jj * nrows + ii + 2] = in_b[(ii + 2)*nbyte_row + jj];
  417|  11.6k|      out_b[jj * nrows + ii + 3] = in_b[(ii + 3)*nbyte_row + jj];
  418|  11.6k|      out_b[jj * nrows + ii + 4] = in_b[(ii + 4)*nbyte_row + jj];
  419|  11.6k|      out_b[jj * nrows + ii + 5] = in_b[(ii + 5)*nbyte_row + jj];
  420|  11.6k|      out_b[jj * nrows + ii + 6] = in_b[(ii + 6)*nbyte_row + jj];
  421|  11.6k|      out_b[jj * nrows + ii + 7] = in_b[(ii + 7)*nbyte_row + jj];
  422|  11.6k|    }
  423|   116k|  }
  424|  2.21k|  return size * elem_size;
  425|  2.21k|}
bshuf_shuffle_bit_eightelem_SSE:
  430|  2.21k|                                        const size_t elem_size) {
  431|       |
  432|  2.21k|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|  2.21k|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 2.21k]
  |  |  ------------------
  ------------------
  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.21k|  const char* in_b = (const char*) in;
  437|  2.21k|  uint16_t* out_ui16 = (uint16_t*) out;
  438|       |
  439|  2.21k|  size_t ii, jj, kk;
  440|  2.21k|  size_t nbyte = elem_size * size;
  441|       |
  442|  2.21k|  __m128i xmm;
  443|  2.21k|  int32_t bt;
  444|       |
  445|  2.21k|  if (elem_size % 2) {
  ------------------
  |  Branch (445:7): [True: 1.61k, False: 597]
  ------------------
  446|  1.61k|    bshuf_shuffle_bit_eightelem_scal(in, out, size, elem_size);
  447|  1.61k|  } else {
  448|   489k|    for (ii = 0; ii + 8 * elem_size - 1 < nbyte;
  ------------------
  |  Branch (448:18): [True: 489k, False: 597]
  ------------------
  449|   489k|         ii += 8 * elem_size) {
  450|   978k|      for (jj = 0; jj + 15 < 8 * elem_size; jj += 16) {
  ------------------
  |  Branch (450:20): [True: 489k, False: 489k]
  ------------------
  451|   489k|        xmm = _mm_loadu_si128((__m128i *) &in_b[ii + jj]);
  452|  4.40M|        for (kk = 0; kk < 8; kk++) {
  ------------------
  |  Branch (452:22): [True: 3.91M, False: 489k]
  ------------------
  453|  3.91M|          bt = _mm_movemask_epi8(xmm);
  454|  3.91M|          xmm = _mm_slli_epi16(xmm, 1);
  455|  3.91M|          size_t ind = (ii + jj / 8 + (7 - kk) * elem_size);
  456|  3.91M|          out_ui16[ind / 2] = bt;
  457|  3.91M|        }
  458|   489k|      }
  459|   489k|    }
  460|    597|  }
  461|  2.21k|  return size * elem_size;
  462|  2.21k|}

blosc2.c:is_little_endian:
   36|   167k|static bool is_little_endian(void) {
   37|   167k|  static const int i = 1;
   38|   167k|  char* p = (char*)&i;
   39|       |
   40|   167k|  if (p[0] == 1) {
  ------------------
  |  Branch (40:7): [True: 167k, False: 0]
  ------------------
   41|   167k|    return true;
   42|   167k|  }
   43|      0|  else {
   44|       |    return false;
   45|      0|  }
   46|   167k|}
blosc2.c:sw32_:
  109|  18.2k|static inline int32_t sw32_(const void* pa) {
  110|  18.2k|  int32_t idest;
  111|       |
  112|  18.2k|  bool little_endian = is_little_endian();
  113|  18.2k|  if (little_endian) {
  ------------------
  |  Branch (113:7): [True: 18.2k, False: 0]
  ------------------
  114|  18.2k|    memcpy(&idest, pa, sizeof(idest));
  115|  18.2k|  }
  116|      0|  else {
  117|      0|#if defined (__GNUC__)
  118|      0|    return __builtin_bswap32(*(unsigned int *)pa);
  119|       |#elif defined (_MSC_VER) /* Visual Studio */
  120|       |    return _byteswap_ulong(*(unsigned int *)pa);
  121|       |#else
  122|       |    const uint8_t *pa_ = (const uint8_t *)pa;
  123|       |    uint8_t *dest = (uint8_t *)&idest;
  124|       |    dest[0] = pa_[3];
  125|       |    dest[1] = pa_[2];
  126|       |    dest[2] = pa_[1];
  127|       |    dest[3] = pa_[0];
  128|       |#endif
  129|      0|  }
  130|  18.2k|  return idest;
  131|  18.2k|}

do_nothing:
  578|  91.1k|int do_nothing(uint8_t filter, char cmode) {
  579|  91.1k|  if (cmode == 'c') {
  ------------------
  |  Branch (579:7): [True: 0, False: 91.1k]
  ------------------
  580|      0|    return (filter == BLOSC_NOFILTER);
  581|  91.1k|  } else {
  582|       |    // TRUNC_PREC do not have to be applied during decompression
  583|  91.1k|    return ((filter == BLOSC_NOFILTER) || (filter == BLOSC_TRUNC_PREC));
  ------------------
  |  Branch (583:13): [True: 36.3k, False: 54.7k]
  |  Branch (583:43): [True: 5.78k, False: 49.0k]
  ------------------
  584|  91.1k|  }
  585|  91.1k|}
next_filter:
  588|  23.7k|int next_filter(const uint8_t* filters, int current_filter, char cmode) {
  589|  40.9k|  for (int i = current_filter - 1; i >= 0; i--) {
  ------------------
  |  Branch (589:36): [True: 40.9k, False: 0]
  ------------------
  590|  40.9k|    if (!do_nothing(filters[i], cmode)) {
  ------------------
  |  Branch (590:9): [True: 23.7k, False: 17.2k]
  ------------------
  591|  23.7k|      return filters[i];
  592|  23.7k|    }
  593|  40.9k|  }
  594|      0|  return BLOSC_NOFILTER;
  595|  23.7k|}
last_filter:
  598|  8.36k|int last_filter(const uint8_t* filters, char cmode) {
  599|  8.36k|  int last_index = -1;
  600|  58.5k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (600:40): [True: 50.2k, False: 8.36k]
  ------------------
  601|  50.2k|    if (!do_nothing(filters[i], cmode))  {
  ------------------
  |  Branch (601:9): [True: 25.3k, False: 24.8k]
  ------------------
  602|  25.3k|      last_index = i;
  603|  25.3k|    }
  604|  50.2k|  }
  605|  8.36k|  return last_index;
  606|  8.36k|}
read_chunk_header:
  685|   149k|{
  686|   149k|  memset(header, 0, sizeof(blosc_header));
  687|       |
  688|   149k|  if (srcsize < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (688:7): [True: 0, False: 149k]
  ------------------
  689|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  690|      0|    return BLOSC2_ERROR_READ_BUFFER;
  691|      0|  }
  692|       |
  693|   149k|  memcpy(header, src, BLOSC_MIN_HEADER_LENGTH);
  694|       |
  695|   149k|  bool little_endian = is_little_endian();
  696|       |
  697|   149k|  if (!little_endian) {
  ------------------
  |  Branch (697:7): [True: 0, False: 149k]
  ------------------
  698|      0|    header->nbytes = bswap32_(header->nbytes);
  699|      0|    header->blocksize = bswap32_(header->blocksize);
  700|      0|    header->cbytes = bswap32_(header->cbytes);
  701|      0|  }
  702|       |
  703|   149k|  if (header->cbytes < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (703:7): [True: 1, False: 149k]
  ------------------
  704|      1|    BLOSC_TRACE_ERROR("`cbytes` is too small to read min header.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  705|      1|    return BLOSC2_ERROR_INVALID_HEADER;
  706|      1|  }
  707|   149k|  if (header->blocksize <= 0) {
  ------------------
  |  Branch (707:7): [True: 0, False: 149k]
  ------------------
  708|      0|    BLOSC_TRACE_ERROR("`blocksize` is zero");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  709|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  710|      0|  }
  711|   149k|  if (header->blocksize > BLOSC2_MAXBLOCKSIZE) {
  ------------------
  |  Branch (711:7): [True: 2, False: 149k]
  ------------------
  712|      2|    BLOSC_TRACE_ERROR("`blocksize` greater than maximum allowed");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  713|      2|    return BLOSC2_ERROR_INVALID_HEADER;
  714|      2|  }
  715|   149k|  if (header->typesize == 0) {
  ------------------
  |  Branch (715:7): [True: 1, False: 149k]
  ------------------
  716|      1|    BLOSC_TRACE_ERROR("`typesize` is zero.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  717|      1|    return BLOSC2_ERROR_INVALID_HEADER;
  718|      1|  }
  719|       |
  720|       |  /* Read extended header if it is wanted */
  721|   149k|  if ((extended_header) && (header->flags & BLOSC_DOSHUFFLE) && (header->flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (721:7): [True: 3.15k, False: 146k]
  |  Branch (721:28): [True: 2.05k, False: 1.09k]
  |  Branch (721:65): [True: 1.64k, False: 409]
  ------------------
  722|  1.64k|    if (header->cbytes < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (722:9): [True: 0, False: 1.64k]
  ------------------
  723|      0|      BLOSC_TRACE_ERROR("`cbytes` is too small to read extended header.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  724|      0|      return BLOSC2_ERROR_INVALID_HEADER;
  725|      0|    }
  726|  1.64k|    if (srcsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (726:9): [True: 0, False: 1.64k]
  ------------------
  727|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  728|      0|      return BLOSC2_ERROR_READ_BUFFER;
  729|      0|    }
  730|       |
  731|  1.64k|    memcpy((uint8_t *)header + BLOSC_MIN_HEADER_LENGTH, src + BLOSC_MIN_HEADER_LENGTH,
  732|  1.64k|      BLOSC_EXTENDED_HEADER_LENGTH - BLOSC_MIN_HEADER_LENGTH);
  733|       |
  734|  1.64k|    if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) && (header->blosc2_flags != 0)) {
  ------------------
  |  Branch (734:9): [True: 14, False: 1.63k]
  |  Branch (734:55): [True: 9, False: 5]
  ------------------
  735|      9|      int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  736|      9|      if (special_type != 0) {
  ------------------
  |  Branch (736:11): [True: 0, False: 9]
  ------------------
  737|      0|        BLOSC_TRACE_ERROR("VL-block chunks cannot use special chunk encodings.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  738|      0|        return BLOSC2_ERROR_INVALID_HEADER;
  739|      0|      }
  740|      9|    }
  741|       |
  742|  1.64k|    int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  743|  1.64k|    if (special_type != 0) {
  ------------------
  |  Branch (743:9): [True: 34, False: 1.61k]
  ------------------
  744|     34|      if (special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (744:11): [True: 11, False: 23]
  ------------------
  745|       |        // In this case, the actual type size must be derived from the cbytes
  746|     11|        int32_t typesize = header->cbytes - BLOSC_EXTENDED_HEADER_LENGTH;
  747|     11|        if (typesize <= 0) {
  ------------------
  |  Branch (747:13): [True: 0, False: 11]
  ------------------
  748|      0|          BLOSC_TRACE_ERROR("`typesize` is zero or negative");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  749|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  750|      0|        }
  751|     11|        if (typesize > BLOSC2_MAXTYPESIZE) {
  ------------------
  |  Branch (751:13): [True: 0, False: 11]
  ------------------
  752|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  753|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  754|      0|        }
  755|     11|        if (typesize > header->nbytes) {
  ------------------
  |  Branch (755:13): [True: 10, False: 1]
  ------------------
  756|     10|          BLOSC_TRACE_ERROR("`typesize` is greater than `nbytes`");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  757|     10|          return BLOSC2_ERROR_INVALID_HEADER;
  758|     10|        }
  759|      1|        if (header->nbytes % typesize != 0) {
  ------------------
  |  Branch (759:13): [True: 1, False: 0]
  ------------------
  760|      1|          BLOSC_TRACE_ERROR("`nbytes` is not a multiple of typesize");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  761|      1|          return BLOSC2_ERROR_INVALID_HEADER;
  762|      1|        }
  763|      1|      }
  764|     23|      else {
  765|     23|        if (header->nbytes % header->typesize != 0) {
  ------------------
  |  Branch (765:13): [True: 0, False: 23]
  ------------------
  766|      0|          BLOSC_TRACE_ERROR("`nbytes` is not a multiple of 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  767|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  768|      0|        }
  769|     23|      }
  770|     34|    }
  771|       |    // The number of filters depends on the version of the header. Blosc2 alpha series
  772|       |    // did not initialize filters to zero beyond the max supported.
  773|  1.63k|    if (header->version == BLOSC2_VERSION_FORMAT_ALPHA) {
  ------------------
  |  Branch (773:9): [True: 180, False: 1.45k]
  ------------------
  774|    180|      header->filters[5] = 0;
  775|    180|      header->filters_meta[5] = 0;
  776|    180|    }
  777|  1.63k|  }
  778|   148k|  else {
  779|   148k|    flags_to_filters(header->flags, header->filters);
  780|   148k|  }
  781|   149k|  if (header->version > BLOSC2_VERSION_FORMAT &&
  ------------------
  |  Branch (781:7): [True: 1.72k, False: 147k]
  ------------------
  782|  1.72k|      (header->blosc2_flags2 & (uint8_t)~BLOSC2_VL_BLOCKS) != 0) {
  ------------------
  |  Branch (782:7): [True: 0, False: 1.72k]
  ------------------
  783|       |    /* Version from future with unsupported chunk features. */
  784|      0|    return BLOSC2_ERROR_VERSION_SUPPORT;
  785|      0|  }
  786|   149k|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0 &&
  ------------------
  |  Branch (786:7): [True: 14, False: 149k]
  ------------------
  787|     14|      (header->flags & (uint8_t)BLOSC_MEMCPYED) != 0) {
  ------------------
  |  Branch (787:7): [True: 0, False: 14]
  ------------------
  788|      0|    BLOSC_TRACE_ERROR("VL-block chunks cannot be memcpyed.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  789|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  790|      0|  }
  791|   149k|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) == 0 &&
  ------------------
  |  Branch (791:7): [True: 149k, False: 14]
  ------------------
  792|   149k|      header->nbytes > 0 && header->blocksize > header->nbytes) {
  ------------------
  |  Branch (792:7): [True: 149k, False: 1]
  |  Branch (792:29): [True: 2.51k, False: 147k]
  ------------------
  793|  2.51k|    header->blocksize = header->nbytes;
  794|  2.51k|  }
  795|   149k|  return 0;
  796|   149k|}
_cycle_buffers:
  992|  16.8k|void _cycle_buffers(uint8_t **src, uint8_t **dest, uint8_t **tmp) {
  993|  16.8k|  uint8_t *tmp2 = *src;
  994|  16.8k|  *src = *dest;
  995|  16.8k|  *dest = *tmp;
  996|  16.8k|  *tmp = tmp2;
  997|  16.8k|}
pipeline_backward:
 1419|  4.80k|                      uint8_t* tmp2, int last_filter_index, int32_t nblock) {
 1420|  4.80k|  blosc2_context* context = thread_context->parent_context;
 1421|  4.80k|  int32_t typesize = context->typesize;
 1422|  4.80k|  uint8_t* filters = context->filters;
 1423|  4.80k|  uint8_t* filters_meta = context->filters_meta;
 1424|  4.80k|  uint8_t* _src = src;
 1425|  4.80k|  uint8_t* _dest = tmp;
 1426|  4.80k|  uint8_t* _tmp = tmp2;
 1427|  4.80k|  int errcode = 0;
 1428|       |
 1429|  26.0k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (1429:40): [True: 26.0k, False: 0]
  ------------------
 1430|       |    // Delta filter requires the whole chunk ready
 1431|  26.0k|    int last_copy_filter = (last_filter_index == i) || (filters[i] == BLOSC_DELTA) ||
  ------------------
  |  Branch (1431:28): [True: 4.79k, False: 21.2k]
  |  Branch (1431:56): [True: 4.72k, False: 16.5k]
  ------------------
 1432|  16.5k|                           (next_filter(filters, i, 'd') == BLOSC_DELTA);
  ------------------
  |  Branch (1432:28): [True: 6.13k, False: 10.4k]
  ------------------
 1433|  26.0k|    if (last_copy_filter && context->postfilter == NULL &&
  ------------------
  |  Branch (1433:9): [True: 15.6k, False: 10.4k]
  |  Branch (1433:29): [True: 15.6k, False: 0]
  ------------------
 1434|  15.6k|        (filters[i] == BLOSC_DELTA || _src != dest + offset)) {
  ------------------
  |  Branch (1434:10): [True: 6.29k, False: 9.36k]
  |  Branch (1434:39): [True: 5.50k, False: 3.86k]
  ------------------
 1435|  11.7k|      _dest = dest + offset;
 1436|  11.7k|    }
 1437|  26.0k|    int rc = BLOSC2_ERROR_SUCCESS;
 1438|  26.0k|    if (filters[i] <= BLOSC2_DEFINED_FILTERS_STOP) {
  ------------------
  |  Branch (1438:9): [True: 23.1k, False: 2.91k]
  ------------------
 1439|  23.1k|      switch (filters[i]) {
 1440|  4.62k|        case BLOSC_SHUFFLE:
  ------------------
  |  Branch (1440:9): [True: 4.62k, False: 18.5k]
  ------------------
 1441|       |        // if filters_meta is not 0, interpret as number of bytes to be grouped together for shuffle
 1442|  4.62k|          blosc2_unshuffle(filters_meta[i] == 0 ? typesize : filters_meta[i], bsize, _src, _dest);
  ------------------
  |  Branch (1442:28): [True: 2.18k, False: 2.43k]
  ------------------
 1443|  4.62k|          break;
 1444|  3.06k|        case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (1444:9): [True: 3.06k, False: 20.0k]
  ------------------
 1445|  3.06k|          if (bitunshuffle(typesize, bsize, _src, _dest, context->src[BLOSC2_CHUNK_VERSION]) < 0) {
  ------------------
  |  Branch (1445:15): [True: 0, False: 3.06k]
  ------------------
 1446|      0|            return BLOSC2_ERROR_FILTER_PIPELINE;
 1447|      0|          }
 1448|  3.06k|          break;
 1449|  6.29k|        case BLOSC_DELTA:
  ------------------
  |  Branch (1449:9): [True: 6.29k, False: 16.8k]
  ------------------
 1450|  6.29k|          if (context->nthreads == 1) {
  ------------------
  |  Branch (1450:15): [True: 6.29k, False: 0]
  ------------------
 1451|       |            /* Serial mode */
 1452|  6.29k|            delta_decoder(dest, offset, bsize, typesize, _dest);
 1453|  6.29k|          } else {
 1454|      0|            struct blosc_job_group *job = context->job;
 1455|      0|            blosc2_pthread_mutex_t *delta_mutex = job != NULL ? &job->delta_mutex : &context->delta_mutex;
  ------------------
  |  |   89|      0|#define blosc2_pthread_mutex_t pthread_mutex_t
  ------------------
  |  Branch (1455:51): [True: 0, False: 0]
  ------------------
 1456|      0|            blosc2_pthread_cond_t *delta_cv = job != NULL ? &job->delta_cv : &context->delta_cv;
  ------------------
  |  |   95|      0|#define blosc2_pthread_cond_t pthread_cond_t
  ------------------
  |  Branch (1456:47): [True: 0, False: 0]
  ------------------
 1457|      0|            int *dref_not_init = job != NULL ? &job->dref_not_init : &context->dref_not_init;
  ------------------
  |  Branch (1457:34): [True: 0, False: 0]
  ------------------
 1458|       |            /* Force the thread in charge of the block 0 to go first */
 1459|      0|            blosc2_pthread_mutex_lock(delta_mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 1460|      0|            if (*dref_not_init) {
  ------------------
  |  Branch (1460:17): [True: 0, False: 0]
  ------------------
 1461|      0|              if (offset != 0) {
  ------------------
  |  Branch (1461:19): [True: 0, False: 0]
  ------------------
 1462|      0|                blosc2_pthread_cond_wait(delta_cv, delta_mutex);
  ------------------
  |  |   98|      0|#define blosc2_pthread_cond_wait(a, b) pthread_cond_wait((a), (b))
  ------------------
 1463|      0|              } else {
 1464|      0|                delta_decoder(dest, offset, bsize, typesize, _dest);
 1465|      0|                *dref_not_init = 0;
 1466|      0|                blosc2_pthread_cond_broadcast(delta_cv);
  ------------------
  |  |  100|      0|#define blosc2_pthread_cond_broadcast(a) pthread_cond_broadcast((a))
  ------------------
 1467|      0|              }
 1468|      0|            }
 1469|      0|            blosc2_pthread_mutex_unlock(delta_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 1470|      0|            if (offset != 0) {
  ------------------
  |  Branch (1470:17): [True: 0, False: 0]
  ------------------
 1471|      0|              delta_decoder(dest, offset, bsize, typesize, _dest);
 1472|      0|            }
 1473|      0|          }
 1474|  6.29k|          break;
 1475|  1.43k|        case BLOSC_TRUNC_PREC:
  ------------------
  |  Branch (1475:9): [True: 1.43k, False: 21.7k]
  ------------------
 1476|       |          // TRUNC_PREC filter does not need to be undone
 1477|  1.43k|          break;
 1478|  7.75k|        default:
  ------------------
  |  Branch (1478:9): [True: 7.75k, False: 15.4k]
  ------------------
 1479|  7.75k|          if (filters[i] != BLOSC_NOFILTER) {
  ------------------
  |  Branch (1479:15): [True: 42, False: 7.70k]
  ------------------
 1480|     42|            BLOSC_TRACE_ERROR("Filter %d not handled during decompression.",
  ------------------
  |  |   93|     42|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     42|    do {                                            \
  |  |  |  |   98|     42|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     42|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 42, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     42|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1481|     42|                              filters[i]);
 1482|     42|            errcode = -1;
 1483|     42|          }
 1484|  23.1k|      }
 1485|  23.1k|    } else {
 1486|       |        // Look for the filters_meta in user filters and run it
 1487|  12.7k|        for (uint64_t j = 0; j < g_nfilters; ++j) {
  ------------------
  |  Branch (1487:30): [True: 12.7k, False: 30]
  ------------------
 1488|  12.7k|          if (g_filters[j].id == filters[i]) {
  ------------------
  |  Branch (1488:15): [True: 2.88k, False: 9.88k]
  ------------------
 1489|  2.88k|            if (g_filters[j].backward == NULL) {
  ------------------
  |  Branch (1489:17): [True: 0, False: 2.88k]
  ------------------
 1490|       |              // Dynamically load filter
 1491|      0|              if (fill_filter(&g_filters[j]) < 0) {
  ------------------
  |  Branch (1491:19): [True: 0, False: 0]
  ------------------
 1492|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1493|      0|                return BLOSC2_ERROR_FILTER_PIPELINE;
 1494|      0|              }
 1495|      0|            }
 1496|  2.88k|            if (g_filters[j].backward != NULL) {
  ------------------
  |  Branch (1496:17): [True: 2.88k, False: 0]
  ------------------
 1497|  2.88k|              blosc2_dparams dparams;
 1498|  2.88k|              blosc2_ctx_get_dparams(context, &dparams);
 1499|  2.88k|              rc = g_filters[j].backward(_src, _dest, bsize, filters_meta[i], &dparams, g_filters[j].id);
 1500|  2.88k|            } else {
 1501|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1502|      0|              return BLOSC2_ERROR_FILTER_PIPELINE;
 1503|      0|            }
 1504|  2.88k|            if (rc != BLOSC2_ERROR_SUCCESS) {
  ------------------
  |  Branch (1504:17): [True: 5, False: 2.87k]
  ------------------
 1505|      5|              BLOSC_TRACE_ERROR("User-defined filter %d failed during decompression.", filters[i]);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1506|      5|              return rc;
 1507|      5|            }
 1508|  2.87k|            goto urfiltersuccess;
 1509|  2.88k|          }
 1510|  12.7k|        }
 1511|     30|      BLOSC_TRACE_ERROR("User-defined filter %d not found during decompression.", filters[i]);
  ------------------
  |  |   93|     30|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     30|    do {                                            \
  |  |  |  |   98|     30|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     30|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 30, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     30|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1512|     30|      return BLOSC2_ERROR_FILTER_PIPELINE;
 1513|  2.87k|      urfiltersuccess:;
 1514|  2.87k|    }
 1515|       |
 1516|       |    // Cycle buffers when required
 1517|  26.0k|    if ((filters[i] != BLOSC_NOFILTER) && (filters[i] != BLOSC_TRUNC_PREC)) {
  ------------------
  |  Branch (1517:9): [True: 18.3k, False: 7.70k]
  |  Branch (1517:43): [True: 16.8k, False: 1.43k]
  ------------------
 1518|  16.8k|      _cycle_buffers(&_src, &_dest, &_tmp);
 1519|  16.8k|    }
 1520|  26.0k|    if (last_filter_index == i) {
  ------------------
  |  Branch (1520:9): [True: 4.76k, False: 21.2k]
  ------------------
 1521|  4.76k|      break;
 1522|  4.76k|    }
 1523|  26.0k|  }
 1524|       |
 1525|  4.76k|  if (context->postfilter == NULL && _src != dest + offset) {
  ------------------
  |  Branch (1525:7): [True: 4.76k, False: 0]
  |  Branch (1525:38): [True: 592, False: 4.17k]
  ------------------
 1526|    592|    memcpy(dest + offset, _src, (unsigned int)bsize);
 1527|    592|  }
 1528|       |
 1529|       |  /* Postfilter function */
 1530|  4.76k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (1530:7): [True: 0, False: 4.76k]
  ------------------
 1531|       |    // Create new postfilter parameters for this block (must be private for each thread)
 1532|      0|    blosc2_postfilter_params postparams;
 1533|      0|    memcpy(&postparams, context->postparams, sizeof(postparams));
 1534|      0|    postparams.input = _src;
 1535|      0|    postparams.output = dest + offset;
 1536|      0|    postparams.size = bsize;
 1537|      0|    postparams.typesize = typesize;
 1538|      0|    postparams.offset = nblock * context->blocksize;
 1539|      0|    postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (1539:25): [True: 0, False: 0]
  ------------------
 1540|      0|    postparams.nblock = nblock;
 1541|      0|    postparams.tid = thread_context->tid;
 1542|      0|    postparams.ttmp = thread_context->tmp;
 1543|      0|    postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 1544|      0|    postparams.ctx = context;
 1545|       |
 1546|      0|    if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (1546:9): [True: 0, False: 0]
  ------------------
 1547|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1548|      0|      return BLOSC2_ERROR_POSTFILTER;
 1549|      0|    }
 1550|      0|  }
 1551|       |
 1552|  4.76k|  return errcode;
 1553|  4.76k|}
free_thread_context:
 2245|  3.10k|void free_thread_context(struct thread_context* thread_context) {
 2246|  3.10k|  destroy_thread_context(thread_context);
 2247|  3.10k|  my_free(thread_context);
 2248|  3.10k|}
check_nthreads:
 2251|  3.10k|int check_nthreads(blosc2_context* context) {
 2252|  3.10k|  if (context->new_nthreads != context->nthreads && context->new_nthreads <= 0) {
  ------------------
  |  Branch (2252:7): [True: 0, False: 3.10k]
  |  Branch (2252:53): [True: 0, False: 0]
  ------------------
 2253|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2253|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2254|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2255|      0|  }
 2256|  3.10k|  if (context->nthreads <= 0) {
  ------------------
  |  Branch (2256:7): [True: 0, False: 3.10k]
  ------------------
 2257|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2257|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2258|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2259|      0|  }
 2260|       |
 2261|       |  /* Detect a pool that was torn down by blosc2_destroy() while this context
 2262|       |   * was still alive.  The epoch mismatch tells us the pool pointer is dangling;
 2263|       |   * clear it so the re-attach logic below creates a fresh one. */
 2264|  3.10k|  if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL &&
  ------------------
  |  |   33|  6.20k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (2264:7): [True: 0, False: 3.10k]
  ------------------
 2265|      0|      context->pool_epoch != g_destroy_count) {
  ------------------
  |  Branch (2265:7): [True: 0, False: 0]
  ------------------
 2266|      0|    context->thread_pool = NULL;
 2267|      0|    context->threads_started = 0;
 2268|      0|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2269|      0|  }
 2270|       |
 2271|  3.10k|  if (context->new_nthreads != context->nthreads) {
  ------------------
  |  Branch (2271:7): [True: 0, False: 3.10k]
  ------------------
 2272|      0|    release_thread_backend(context);
 2273|      0|    context->nthreads = context->new_nthreads;
 2274|      0|  }
 2275|  3.10k|  if (context->nthreads > 1 && context->threads_started == 0) {
  ------------------
  |  Branch (2275:7): [True: 0, False: 3.10k]
  |  Branch (2275:32): [True: 0, False: 0]
  ------------------
 2276|      0|    int rc;
 2277|      0|    if (threads_callback) {
  ------------------
  |  Branch (2277:9): [True: 0, False: 0]
  ------------------
 2278|      0|      rc = init_callback_threads(context);
 2279|      0|    }
 2280|      0|    else {
 2281|       |#if defined(_WIN32)
 2282|       |      rc = init_threadpool(context);
 2283|       |#else
 2284|      0|      rc = attach_shared_pool(context);
 2285|      0|#endif
 2286|      0|    }
 2287|      0|    if (rc < 0) {
  ------------------
  |  Branch (2287:9): [True: 0, False: 0]
  ------------------
 2288|      0|      return rc;
 2289|      0|    }
 2290|      0|  }
 2291|  3.10k|  if (context->nthreads <= 1) {
  ------------------
  |  Branch (2291:7): [True: 3.10k, False: 0]
  ------------------
 2292|  3.10k|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|  3.10k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2293|  3.10k|  }
 2294|       |
 2295|  3.10k|  return context->nthreads;
 2296|  3.10k|}
blosc2_decompress:
 4148|  3.15k|int blosc2_decompress(const void* src, int32_t srcsize, void* dest, int32_t destsize) {
 4149|  3.15k|  int result;
 4150|  3.15k|  char* envvar;
 4151|  3.15k|  long nthreads;
 4152|  3.15k|  blosc2_context *dctx;
 4153|  3.15k|  blosc2_dparams dparams = BLOSC2_DPARAMS_DEFAULTS;
 4154|       |
 4155|       |  /* Check whether the library should be initialized */
 4156|  3.15k|  if (!g_initlib) blosc2_init();
  ------------------
  |  Branch (4156:7): [True: 0, False: 3.15k]
  ------------------
 4157|       |
 4158|       |  /* Check for a BLOSC_NTHREADS environment variable */
 4159|  3.15k|  envvar = getenv("BLOSC_NTHREADS");
 4160|  3.15k|  if (envvar != NULL) {
  ------------------
  |  Branch (4160:7): [True: 0, False: 3.15k]
  ------------------
 4161|      0|    errno = 0; /* To distinguish success/failure after call */
 4162|      0|    nthreads = strtol(envvar, NULL, 10);
 4163|      0|    if ((errno != EINVAL)) {
  ------------------
  |  Branch (4163:9): [True: 0, False: 0]
  ------------------
 4164|      0|      if ((nthreads <= 0) || (nthreads > INT16_MAX)) {
  ------------------
  |  Branch (4164:11): [True: 0, False: 0]
  |  Branch (4164:30): [True: 0, False: 0]
  ------------------
 4165|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 4165|      0|        BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4166|      0|        return BLOSC2_ERROR_INVALID_PARAM;
 4167|      0|      }
 4168|      0|      result = blosc2_set_nthreads((int16_t) nthreads);
 4169|      0|      if (result < 0) {
  ------------------
  |  Branch (4169:11): [True: 0, False: 0]
  ------------------
 4170|      0|        return result;
 4171|      0|      }
 4172|      0|    }
 4173|      0|  }
 4174|       |
 4175|       |  /* Check for a BLOSC_NOLOCK environment variable.  It is important
 4176|       |     that this should be the last env var so that it can take the
 4177|       |     previous ones into account */
 4178|  3.15k|  envvar = getenv("BLOSC_NOLOCK");
 4179|  3.15k|  if (envvar != NULL) {
  ------------------
  |  Branch (4179:7): [True: 0, False: 3.15k]
  ------------------
 4180|      0|    dparams.nthreads = g_nthreads;
 4181|      0|    dctx = blosc2_create_dctx(dparams);
 4182|      0|    if (dctx == NULL) {
  ------------------
  |  Branch (4182:9): [True: 0, False: 0]
  ------------------
 4183|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4184|      0|      return BLOSC2_ERROR_NULL_POINTER;
 4185|      0|    }
 4186|      0|    result = blosc2_decompress_ctx(dctx, src, srcsize, dest, destsize);
 4187|      0|    blosc2_free_ctx(dctx);
 4188|      0|    return result;
 4189|      0|  }
 4190|       |
 4191|  3.15k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  3.15k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 4192|       |
 4193|  3.15k|  result = blosc_run_decompression_with_context(
 4194|  3.15k|          g_global_context, src, srcsize, dest, destsize);
 4195|       |
 4196|  3.15k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  3.15k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 4197|       |
 4198|  3.15k|  return result;
 4199|  3.15k|}
blosc2_set_nthreads:
 5355|  3.16k|int16_t blosc2_set_nthreads(int16_t nthreads) {
 5356|  3.16k|  int16_t ret;          /* the previous number of threads */
 5357|       |
 5358|       |  /* Check whether the library should be initialized */
 5359|  3.16k|  if (!g_initlib) blosc2_init();
  ------------------
  |  Branch (5359:7): [True: 0, False: 3.16k]
  ------------------
 5360|       |
 5361|  3.16k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  3.16k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5362|  3.16k|  ret = g_nthreads;
 5363|  3.16k|  if (nthreads != ret) {
  ------------------
  |  Branch (5363:7): [True: 0, False: 3.16k]
  ------------------
 5364|      0|    int16_t old_new_nthreads = g_global_context->new_nthreads;
 5365|      0|    int16_t old_nthreads = g_global_context->nthreads;
 5366|      0|    g_nthreads = nthreads;
 5367|      0|    g_global_context->new_nthreads = nthreads;
 5368|      0|    int16_t ret2 = check_nthreads(g_global_context);
 5369|      0|    if (ret2 < 0) {
  ------------------
  |  Branch (5369:9): [True: 0, False: 0]
  ------------------
 5370|      0|      g_nthreads = ret;
 5371|      0|      g_global_context->new_nthreads = old_new_nthreads;
 5372|      0|      g_global_context->nthreads = old_nthreads;
 5373|      0|      check_nthreads(g_global_context);
 5374|      0|      blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5375|      0|      return ret2;
 5376|      0|    }
 5377|      0|  }
 5378|  3.16k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  3.16k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5379|       |
 5380|  3.16k|  return ret;
 5381|  3.16k|}
blosc1_cbuffer_sizes:
 5525|  3.16k|void blosc1_cbuffer_sizes(const void* cbuffer, size_t* nbytes, size_t* cbytes, size_t* blocksize) {
 5526|  3.16k|  int32_t nbytes32, cbytes32, blocksize32;
 5527|  3.16k|  blosc2_cbuffer_sizes(cbuffer, &nbytes32, &cbytes32, &blocksize32);
 5528|  3.16k|  *nbytes = nbytes32;
 5529|  3.16k|  *cbytes = cbytes32;
 5530|  3.16k|  *blocksize = blocksize32;
 5531|  3.16k|}
blosc2_cbuffer_sizes:
 5533|   146k|int blosc2_cbuffer_sizes(const void* cbuffer, int32_t* nbytes, int32_t* cbytes, int32_t* blocksize) {
 5534|   146k|  blosc_header header;
 5535|   146k|  int rc = read_chunk_header((uint8_t *) cbuffer, BLOSC_MIN_HEADER_LENGTH, false, &header);
 5536|   146k|  if (rc < 0) {
  ------------------
  |  Branch (5536:7): [True: 4, False: 146k]
  ------------------
 5537|       |    /* Return zeros if error reading header */
 5538|      4|    memset(&header, 0, sizeof(header));
 5539|      4|  }
 5540|       |
 5541|       |  /* Read the interesting values */
 5542|   146k|  if (nbytes != NULL)
  ------------------
  |  Branch (5542:7): [True: 146k, False: 0]
  ------------------
 5543|   146k|    *nbytes = header.nbytes;
 5544|   146k|  if (cbytes != NULL)
  ------------------
  |  Branch (5544:7): [True: 146k, False: 0]
  ------------------
 5545|   146k|    *cbytes = header.cbytes;
 5546|   146k|  if (blocksize != NULL)
  ------------------
  |  Branch (5546:7): [True: 3.16k, False: 143k]
  ------------------
 5547|  3.16k|    *blocksize = header.blocksize;
 5548|   146k|  return rc;
 5549|   146k|}
blosc1_cbuffer_validate:
 5551|  3.15k|int blosc1_cbuffer_validate(const void* cbuffer, size_t cbytes, size_t* nbytes) {
 5552|  3.15k|  int32_t header_cbytes;
 5553|  3.15k|  int32_t header_nbytes;
 5554|  3.15k|  if (cbytes < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (5554:7): [True: 0, False: 3.15k]
  ------------------
 5555|       |    /* Compressed data should contain enough space for header */
 5556|      0|    *nbytes = 0;
 5557|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 5558|      0|  }
 5559|  3.15k|  int rc = blosc2_cbuffer_sizes(cbuffer, &header_nbytes, &header_cbytes, NULL);
 5560|  3.15k|  if (rc < 0) {
  ------------------
  |  Branch (5560:7): [True: 0, False: 3.15k]
  ------------------
 5561|      0|    *nbytes = 0;
 5562|      0|    return rc;
 5563|      0|  }
 5564|  3.15k|  *nbytes = header_nbytes;
 5565|  3.15k|  if (header_cbytes != (int32_t)cbytes) {
  ------------------
  |  Branch (5565:7): [True: 0, False: 3.15k]
  ------------------
 5566|       |    /* Compressed size from header does not match `cbytes` */
 5567|      0|    *nbytes = 0;
 5568|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 5569|      0|  }
 5570|  3.15k|  if (*nbytes > BLOSC2_MAX_BUFFERSIZE) {
  ------------------
  |  Branch (5570:7): [True: 0, False: 3.15k]
  ------------------
 5571|       |    /* Uncompressed size is larger than allowed */
 5572|      0|    *nbytes = 0;
 5573|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 5574|      0|  }
 5575|  3.15k|  return 0;
 5576|  3.15k|}
blosc2_init:
 5684|  3.16k|void blosc2_init(void) {
 5685|       |  /* Return if Blosc is already initialized */
 5686|  3.16k|  if (g_initlib) return;
  ------------------
  |  Branch (5686:7): [True: 0, False: 3.16k]
  ------------------
 5687|       |
 5688|  3.16k|  BLOSC2_IO_CB_DEFAULTS.id = BLOSC2_IO_FILESYSTEM;
 5689|  3.16k|  BLOSC2_IO_CB_DEFAULTS.name = "filesystem";
 5690|  3.16k|  BLOSC2_IO_CB_DEFAULTS.is_allocation_necessary = true;
 5691|  3.16k|  BLOSC2_IO_CB_DEFAULTS.open = (blosc2_open_cb) blosc2_stdio_open;
 5692|  3.16k|  BLOSC2_IO_CB_DEFAULTS.close = (blosc2_close_cb) blosc2_stdio_close;
 5693|  3.16k|  BLOSC2_IO_CB_DEFAULTS.size = (blosc2_size_cb) blosc2_stdio_size;
 5694|  3.16k|  BLOSC2_IO_CB_DEFAULTS.write = (blosc2_write_cb) blosc2_stdio_write;
 5695|  3.16k|  BLOSC2_IO_CB_DEFAULTS.read = (blosc2_read_cb) blosc2_stdio_read;
 5696|  3.16k|  BLOSC2_IO_CB_DEFAULTS.truncate = (blosc2_truncate_cb) blosc2_stdio_truncate;
 5697|  3.16k|  BLOSC2_IO_CB_DEFAULTS.destroy = (blosc2_destroy_cb) blosc2_stdio_destroy;
 5698|       |
 5699|  3.16k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_DEFAULTS);
 5700|       |
 5701|  3.16k|  BLOSC2_IO_CB_MMAP.id = BLOSC2_IO_FILESYSTEM_MMAP;
 5702|  3.16k|  BLOSC2_IO_CB_MMAP.name = "filesystem_mmap";
 5703|  3.16k|  BLOSC2_IO_CB_MMAP.is_allocation_necessary = false;
 5704|  3.16k|  BLOSC2_IO_CB_MMAP.open = (blosc2_open_cb) blosc2_stdio_mmap_open;
 5705|  3.16k|  BLOSC2_IO_CB_MMAP.close = (blosc2_close_cb) blosc2_stdio_mmap_close;
 5706|  3.16k|  BLOSC2_IO_CB_MMAP.read = (blosc2_read_cb) blosc2_stdio_mmap_read;
 5707|  3.16k|  BLOSC2_IO_CB_MMAP.size = (blosc2_size_cb) blosc2_stdio_mmap_size;
 5708|  3.16k|  BLOSC2_IO_CB_MMAP.write = (blosc2_write_cb) blosc2_stdio_mmap_write;
 5709|  3.16k|  BLOSC2_IO_CB_MMAP.truncate = (blosc2_truncate_cb) blosc2_stdio_mmap_truncate;
 5710|  3.16k|  BLOSC2_IO_CB_MMAP.destroy = (blosc2_destroy_cb) blosc2_stdio_mmap_destroy;
 5711|       |
 5712|  3.16k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_MMAP);
 5713|       |
 5714|  3.16k|  g_ncodecs = 0;
 5715|  3.16k|  g_nfilters = 0;
 5716|  3.16k|  g_ntuners = 0;
 5717|       |
 5718|  3.16k|#if defined(HAVE_PLUGINS)
 5719|  3.16k|  #include "blosc2/blosc2-common.h"
 5720|  3.16k|  #include "blosc2/blosc2-stdio.h"
 5721|  3.16k|  register_codecs();
 5722|  3.16k|  register_filters();
 5723|  3.16k|  register_tuners();
 5724|  3.16k|#endif
 5725|  3.16k|  blosc2_pthread_mutex_init(&global_comp_mutex, NULL);
  ------------------
  |  |   90|  3.16k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5726|  3.16k|  blosc2_pthread_mutex_init(&pool_registry_mutex, NULL);
  ------------------
  |  |   90|  3.16k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5727|       |  /* Create a global context */
 5728|  3.16k|  g_global_context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 5729|  3.16k|  memset(g_global_context, 0, sizeof(blosc2_context));
 5730|  3.16k|  g_global_context->nthreads = g_nthreads;
 5731|  3.16k|  g_global_context->new_nthreads = g_nthreads;
 5732|  3.16k|  blosc2_pthread_mutex_init(&g_global_context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  3.16k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5733|  3.16k|  g_initlib = 1;
 5734|  3.16k|}
blosc2_free_resources:
 5737|  3.16k|int blosc2_free_resources(void) {
 5738|       |  /* Return if Blosc is not initialized */
 5739|  3.16k|  if (!g_initlib) return BLOSC2_ERROR_FAILURE;
  ------------------
  |  Branch (5739:7): [True: 0, False: 3.16k]
  ------------------
 5740|       |
 5741|  3.16k|  return release_thread_backend(g_global_context);
 5742|  3.16k|}
blosc2_destroy:
 5745|  3.16k|void blosc2_destroy(void) {
 5746|       |  /* Return if Blosc is not initialized */
 5747|  3.16k|  if (!g_initlib) return;
  ------------------
  |  Branch (5747:7): [True: 0, False: 3.16k]
  ------------------
 5748|       |
 5749|  3.16k|  blosc2_free_resources();
 5750|  3.16k|  g_initlib = 0;
 5751|  3.16k|  blosc2_free_ctx(g_global_context);
 5752|       |
 5753|       |  /* Bump the epoch so any live context can detect its pool is now stale.
 5754|       |   * Do this before freeing the pools so that release_thread_backend callers
 5755|       |   * that race with us will take the "skip" path rather than locking the
 5756|       |   * soon-to-be-destroyed pool_registry_mutex. */
 5757|  3.16k|  g_destroy_count++;
 5758|       |
 5759|       |  /* Tear down any remaining shared pools */
 5760|  3.16k|  struct blosc_shared_pool *pool = shared_pools;
 5761|  3.16k|  while (pool != NULL) {
  ------------------
  |  Branch (5761:10): [True: 0, False: 3.16k]
  ------------------
 5762|      0|    struct blosc_shared_pool *next = pool->next;
 5763|      0|    destroy_shared_pool(pool);
 5764|      0|    pool = next;
 5765|      0|  }
 5766|  3.16k|  shared_pools = NULL;
 5767|  3.16k|  blosc2_pthread_mutex_destroy(&pool_registry_mutex);
  ------------------
  |  |   91|  3.16k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5768|       |
 5769|  3.16k|  blosc2_pthread_mutex_destroy(&global_comp_mutex);
  ------------------
  |  |   91|  3.16k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5770|  3.16k|}
blosc2_free_ctx:
 6026|  3.16k|void blosc2_free_ctx(blosc2_context* context) {
 6027|  3.16k|  if (g_initlib ||
  ------------------
  |  Branch (6027:7): [True: 0, False: 3.16k]
  ------------------
 6028|  3.16k|      context->thread_backend == BLOSC_BACKEND_PER_CONTEXT ||
  ------------------
  |  |   35|  6.32k|#define BLOSC_BACKEND_PER_CONTEXT 3   /* per-context threads; used on Windows */
  ------------------
  |  Branch (6028:7): [True: 0, False: 3.16k]
  ------------------
 6029|  3.16k|      context->thread_backend == BLOSC_BACKEND_CALLBACK) {
  ------------------
  |  |   34|  3.16k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (6029:7): [True: 0, False: 3.16k]
  ------------------
 6030|      0|    release_thread_backend(context);
 6031|      0|  }
 6032|  3.16k|  if (context->serial_context != NULL) {
  ------------------
  |  Branch (6032:7): [True: 3.10k, False: 59]
  ------------------
 6033|  3.10k|    free_thread_context(context->serial_context);
 6034|  3.10k|  }
 6035|  3.16k|  blosc2_pthread_mutex_destroy(&context->nchunk_mutex);
  ------------------
  |  |   91|  3.16k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6036|  3.16k|  release_context_dict_buffer(context);
 6037|  3.16k|  if (context->dict_cdict != NULL) {
  ------------------
  |  Branch (6037:7): [True: 0, False: 3.16k]
  ------------------
 6038|      0|    if (context->compcode == BLOSC_LZ4) {
  ------------------
  |  Branch (6038:9): [True: 0, False: 0]
  ------------------
 6039|      0|      LZ4_freeStream((LZ4_stream_t*)context->dict_cdict);
 6040|      0|    } else if (context->compcode == BLOSC_LZ4HC) {
  ------------------
  |  Branch (6040:16): [True: 0, False: 0]
  ------------------
 6041|      0|      LZ4_freeStreamHC((LZ4_streamHC_t*)context->dict_cdict);
 6042|      0|    }
 6043|      0|#ifdef HAVE_ZSTD
 6044|      0|    else if (context->compcode == BLOSC_ZSTD) {
  ------------------
  |  Branch (6044:14): [True: 0, False: 0]
  ------------------
 6045|      0|      ZSTD_freeCDict(context->dict_cdict);
 6046|      0|    }
 6047|      0|#endif
 6048|      0|  }
 6049|  3.16k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (6049:7): [True: 776, False: 2.38k]
  ------------------
 6050|    776|#ifdef HAVE_ZSTD
 6051|    776|    ZSTD_freeDDict(context->dict_ddict);
 6052|    776|#endif
 6053|    776|  }
 6054|  3.16k|  if (context->tuner_params != NULL) {
  ------------------
  |  Branch (6054:7): [True: 0, False: 3.16k]
  ------------------
 6055|      0|    int rc;
 6056|      0|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|      0|#define BLOSC_STUNE 0
  ------------------
  |  Branch (6056:9): [True: 0, False: 0]
  |  Branch (6056:49): [True: 0, False: 0]
  ------------------
 6057|      0|      rc = blosc_stune_free(context);
 6058|      0|    } else {
 6059|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (6059:23): [True: 0, False: 0]
  ------------------
 6060|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (6060:13): [True: 0, False: 0]
  ------------------
 6061|      0|          if (g_tuners[i].free == NULL) {
  ------------------
  |  Branch (6061:15): [True: 0, False: 0]
  ------------------
 6062|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (6062:17): [True: 0, False: 0]
  ------------------
 6063|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6064|      0|              return;
 6065|      0|            }
 6066|      0|          }
 6067|      0|          rc = g_tuners[i].free(context);
 6068|      0|          goto urtunersuccess;
 6069|      0|        }
 6070|      0|      }
 6071|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6072|      0|      return;
 6073|      0|      urtunersuccess:;
 6074|      0|    }
 6075|      0|    if (rc < 0) {
  ------------------
  |  Branch (6075:9): [True: 0, False: 0]
  ------------------
 6076|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6077|      0|      return;
 6078|      0|    }
 6079|      0|  }
 6080|       |  /* May be needed if codec_params ever contains nested objects
 6081|       |  if (context->codec_params != NULL) {
 6082|       |    int rc;
 6083|       |    for (int i = 0; i < g_ncodecs; ++i) {
 6084|       |      if (g_codecs[i].compcode == context->compcode) {
 6085|       |        if (g_codecs[i].free == NULL) {
 6086|       |          // Dynamically load codec plugin
 6087|       |          if (fill_codec(&g_codecs[i]) < 0) {
 6088|       |            BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
 6089|       |            return BLOSC2_ERROR_CODEC_SUPPORT;
 6090|       |          }
 6091|       |        }
 6092|       |        if (g_codecs[i].free == NULL){
 6093|       |          // no free func, codec_params is simple
 6094|       |          my_free(context->codec_params);
 6095|       |        }
 6096|       |        else{ // has free function for codec_params (e.g. openzl)
 6097|       |        rc = g_codecs[i].free(context->codec_params);
 6098|       |          goto urcodecsuccess;
 6099|       |        }
 6100|       |      }
 6101|       |    }
 6102|       |      BLOSC_TRACE_ERROR("User-defined compressor codec %d not found", context->compcode);
 6103|       |      return BLOSC2_ERROR_CODEC_SUPPORT;
 6104|       |    urcodecsuccess:;
 6105|       |    if (rc < 0) {
 6106|       |      BLOSC_TRACE_ERROR("Error in user-defined codec free function\n");
 6107|       |      return;
 6108|       |    }
 6109|       |  }
 6110|       |  */
 6111|  3.16k|  if (context->prefilter != NULL) {
  ------------------
  |  Branch (6111:7): [True: 0, False: 3.16k]
  ------------------
 6112|      0|    my_free(context->preparams);
 6113|      0|  }
 6114|  3.16k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (6114:7): [True: 0, False: 3.16k]
  ------------------
 6115|      0|    my_free(context->postparams);
 6116|      0|  }
 6117|       |
 6118|  3.16k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (6118:7): [True: 0, False: 3.16k]
  ------------------
 6119|      0|    free(context->block_maskout);
 6120|      0|  }
 6121|  3.16k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (6121:7): [True: 11, False: 3.15k]
  ------------------
 6122|     11|    free(context->blocknbytes);
 6123|     11|  }
 6124|  3.16k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (6124:7): [True: 11, False: 3.15k]
  ------------------
 6125|     11|    free(context->blockoffsets);
 6126|     11|  }
 6127|  3.16k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (6127:7): [True: 11, False: 3.15k]
  ------------------
 6128|     11|    free(context->blockcbytes);
 6129|     11|  }
 6130|  3.16k|  my_free(context);
 6131|  3.16k|}
blosc2_ctx_get_dparams:
 6158|  3.78k|int blosc2_ctx_get_dparams(blosc2_context *ctx, blosc2_dparams *dparams) {
 6159|  3.78k|  dparams->nthreads = ctx->nthreads;
 6160|  3.78k|  dparams->schunk = ctx->schunk;
 6161|  3.78k|  dparams->postfilter = ctx->postfilter;
 6162|  3.78k|  dparams->postparams = ctx->postparams;
 6163|  3.78k|  dparams->typesize = ctx->typesize;
 6164|       |
 6165|  3.78k|  return BLOSC2_ERROR_SUCCESS;
 6166|  3.78k|}
register_filter_private:
 6378|  15.8k|int register_filter_private(blosc2_filter *filter) {
 6379|  15.8k|    BLOSC_ERROR_NULL(filter, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  15.8k|    do {                                            \
  |  |  105|  15.8k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 15.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|  15.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 15.8k]
  |  |  ------------------
  ------------------
 6380|  15.8k|    if (g_nfilters == UINT8_MAX) {
  ------------------
  |  Branch (6380:9): [True: 0, False: 15.8k]
  ------------------
 6381|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6382|      0|        return BLOSC2_ERROR_CODEC_SUPPORT;
 6383|      0|    }
 6384|  15.8k|    if (filter->id < BLOSC2_GLOBAL_REGISTERED_FILTERS_START) {
  ------------------
  |  Branch (6384:9): [True: 0, False: 15.8k]
  ------------------
 6385|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6386|      0|        return BLOSC2_ERROR_FAILURE;
 6387|      0|    }
 6388|       |    /* This condition can never be fulfilled
 6389|       |    if (filter->id > BLOSC2_USER_REGISTERED_FILTERS_STOP) {
 6390|       |        BLOSC_TRACE_ERROR("The id must be less than or equal to %d", BLOSC2_USER_REGISTERED_FILTERS_STOP);
 6391|       |        return BLOSC2_ERROR_FAILURE;
 6392|       |    }
 6393|       |    */
 6394|       |
 6395|  47.4k|    for (uint64_t i = 0; i < g_nfilters; ++i) {
  ------------------
  |  Branch (6395:26): [True: 31.6k, False: 15.8k]
  ------------------
 6396|  31.6k|      if (g_filters[i].id == filter->id) {
  ------------------
  |  Branch (6396:11): [True: 0, False: 31.6k]
  ------------------
 6397|      0|        if (strcmp(g_filters[i].name, filter->name) != 0) {
  ------------------
  |  Branch (6397:13): [True: 0, False: 0]
  ------------------
 6398|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6399|      0|                            "  Choose another one !", filter->id, g_filters[i].name);
 6400|      0|          return BLOSC2_ERROR_FAILURE;
 6401|      0|        }
 6402|      0|        else {
 6403|       |          // Already registered, so no more actions needed
 6404|      0|          return BLOSC2_ERROR_SUCCESS;
 6405|      0|        }
 6406|      0|      }
 6407|  31.6k|    }
 6408|       |
 6409|  15.8k|    blosc2_filter *filter_new = &g_filters[g_nfilters++];
 6410|  15.8k|    memcpy(filter_new, filter, sizeof(blosc2_filter));
 6411|       |
 6412|  15.8k|    return BLOSC2_ERROR_SUCCESS;
 6413|  15.8k|}
register_codec_private:
 6428|  22.1k|int register_codec_private(blosc2_codec *codec) {
 6429|  22.1k|    BLOSC_ERROR_NULL(codec, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  22.1k|    do {                                            \
  |  |  105|  22.1k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 22.1k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  22.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 22.1k]
  |  |  ------------------
  ------------------
 6430|  22.1k|    if (g_ncodecs == UINT8_MAX) {
  ------------------
  |  Branch (6430:9): [True: 0, False: 22.1k]
  ------------------
 6431|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6432|      0|      return BLOSC2_ERROR_CODEC_SUPPORT;
 6433|      0|    }
 6434|  22.1k|    if (codec->compcode < BLOSC2_GLOBAL_REGISTERED_CODECS_START) {
  ------------------
  |  Branch (6434:9): [True: 0, False: 22.1k]
  ------------------
 6435|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6436|      0|      return BLOSC2_ERROR_FAILURE;
 6437|      0|    }
 6438|       |    /* This condition can never be fulfilled
 6439|       |    if (codec->compcode > BLOSC2_USER_REGISTERED_CODECS_STOP) {
 6440|       |      BLOSC_TRACE_ERROR("The id must be less or equal to %d", BLOSC2_USER_REGISTERED_CODECS_STOP);
 6441|       |      return BLOSC2_ERROR_FAILURE;
 6442|       |    }
 6443|       |     */
 6444|       |
 6445|  88.5k|    for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (6445:21): [True: 66.4k, False: 22.1k]
  ------------------
 6446|  66.4k|      if (g_codecs[i].compcode == codec->compcode) {
  ------------------
  |  Branch (6446:11): [True: 0, False: 66.4k]
  ------------------
 6447|      0|        if (strcmp(g_codecs[i].compname, codec->compname) != 0) {
  ------------------
  |  Branch (6447:13): [True: 0, False: 0]
  ------------------
 6448|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6449|      0|                            "  Choose another one !", codec->compcode, codec->compname);
 6450|      0|          return BLOSC2_ERROR_CODEC_PARAM;
 6451|      0|        }
 6452|      0|        else {
 6453|       |          // Already registered, so no more actions needed
 6454|      0|          return BLOSC2_ERROR_SUCCESS;
 6455|      0|        }
 6456|      0|      }
 6457|  66.4k|    }
 6458|       |
 6459|  22.1k|    blosc2_codec *codec_new = &g_codecs[g_ncodecs++];
 6460|  22.1k|    memcpy(codec_new, codec, sizeof(blosc2_codec));
 6461|       |
 6462|  22.1k|    return BLOSC2_ERROR_SUCCESS;
 6463|  22.1k|}
register_tuner_private:
 6478|  3.16k|int register_tuner_private(blosc2_tuner *tuner) {
 6479|  3.16k|  BLOSC_ERROR_NULL(tuner, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  3.16k|    do {                                            \
  |  |  105|  3.16k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 3.16k]
  |  |  ------------------
  |  |  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|  3.16k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 3.16k]
  |  |  ------------------
  ------------------
 6480|  3.16k|  if (g_ntuners == UINT8_MAX) {
  ------------------
  |  Branch (6480:7): [True: 0, False: 3.16k]
  ------------------
 6481|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6482|      0|    return BLOSC2_ERROR_CODEC_SUPPORT;
 6483|      0|  }
 6484|  3.16k|  if (tuner->id < BLOSC2_GLOBAL_REGISTERED_TUNER_START) {
  ------------------
  |  Branch (6484:7): [True: 0, False: 3.16k]
  ------------------
 6485|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6486|      0|    return BLOSC2_ERROR_FAILURE;
 6487|      0|  }
 6488|       |
 6489|  3.16k|  for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (6489:19): [True: 0, False: 3.16k]
  ------------------
 6490|      0|    if (g_tuners[i].id == tuner->id) {
  ------------------
  |  Branch (6490:9): [True: 0, False: 0]
  ------------------
 6491|      0|      if (strcmp(g_tuners[i].name, tuner->name) != 0) {
  ------------------
  |  Branch (6491:11): [True: 0, False: 0]
  ------------------
 6492|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6493|      0|                          "  Choose another one !", tuner->id, g_tuners[i].name);
 6494|      0|        return BLOSC2_ERROR_FAILURE;
 6495|      0|      }
 6496|      0|      else {
 6497|       |        // Already registered, so no more actions needed
 6498|      0|        return BLOSC2_ERROR_SUCCESS;
 6499|      0|      }
 6500|      0|    }
 6501|      0|  }
 6502|       |
 6503|  3.16k|  blosc2_tuner *tuner_new = &g_tuners[g_ntuners++];
 6504|  3.16k|  memcpy(tuner_new, tuner, sizeof(blosc2_tuner));
 6505|       |
 6506|  3.16k|  return BLOSC2_ERROR_SUCCESS;
 6507|  3.16k|}
_blosc2_register_io_cb:
 6520|  6.32k|int _blosc2_register_io_cb(const blosc2_io_cb *io) {
 6521|       |
 6522|  9.48k|  for (uint64_t i = 0; i < g_nio; ++i) {
  ------------------
  |  Branch (6522:24): [True: 9.48k, False: 2]
  ------------------
 6523|  9.48k|    if (g_ios[i].id == io->id) {
  ------------------
  |  Branch (6523:9): [True: 6.32k, False: 3.16k]
  ------------------
 6524|  6.32k|      if (strcmp(g_ios[i].name, io->name) != 0) {
  ------------------
  |  Branch (6524:11): [True: 0, False: 6.32k]
  ------------------
 6525|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6526|      0|                          "  Choose another one !", io->id, g_ios[i].name);
 6527|      0|        return BLOSC2_ERROR_PLUGIN_IO;
 6528|      0|      }
 6529|  6.32k|      else {
 6530|       |        // Already registered, so no more actions needed
 6531|  6.32k|        return BLOSC2_ERROR_SUCCESS;
 6532|  6.32k|      }
 6533|  6.32k|    }
 6534|  9.48k|  }
 6535|       |
 6536|      2|  blosc2_io_cb *io_new = &g_ios[g_nio++];
 6537|      2|  memcpy(io_new, io, sizeof(blosc2_io_cb));
 6538|       |
 6539|      2|  return BLOSC2_ERROR_SUCCESS;
 6540|  6.32k|}
blosc2_error_string:
 6652|      2|const char *blosc2_error_string(int error_code) {
 6653|      2|  switch (error_code) {
 6654|      2|    case BLOSC2_ERROR_FAILURE:
  ------------------
  |  Branch (6654:5): [True: 2, False: 0]
  ------------------
 6655|      2|      return "Generic failure";
 6656|      0|    case BLOSC2_ERROR_STREAM:
  ------------------
  |  Branch (6656:5): [True: 0, False: 2]
  ------------------
 6657|      0|      return "Bad stream";
 6658|      0|    case BLOSC2_ERROR_DATA:
  ------------------
  |  Branch (6658:5): [True: 0, False: 2]
  ------------------
 6659|      0|      return "Invalid data";
 6660|      0|    case BLOSC2_ERROR_MEMORY_ALLOC:
  ------------------
  |  Branch (6660:5): [True: 0, False: 2]
  ------------------
 6661|      0|      return "Memory alloc/realloc failure";
 6662|      0|    case BLOSC2_ERROR_READ_BUFFER:
  ------------------
  |  Branch (6662:5): [True: 0, False: 2]
  ------------------
 6663|      0|      return "Not enough space to read";
 6664|      0|    case BLOSC2_ERROR_WRITE_BUFFER:
  ------------------
  |  Branch (6664:5): [True: 0, False: 2]
  ------------------
 6665|      0|      return "Not enough space to write";
 6666|      0|    case BLOSC2_ERROR_CODEC_SUPPORT:
  ------------------
  |  Branch (6666:5): [True: 0, False: 2]
  ------------------
 6667|      0|      return "Codec not supported";
 6668|      0|    case BLOSC2_ERROR_CODEC_PARAM:
  ------------------
  |  Branch (6668:5): [True: 0, False: 2]
  ------------------
 6669|      0|      return "Invalid parameter supplied to codec";
 6670|      0|    case BLOSC2_ERROR_CODEC_DICT:
  ------------------
  |  Branch (6670:5): [True: 0, False: 2]
  ------------------
 6671|      0|      return "Codec dictionary error";
 6672|      0|    case BLOSC2_ERROR_VERSION_SUPPORT:
  ------------------
  |  Branch (6672:5): [True: 0, False: 2]
  ------------------
 6673|      0|      return "Version not supported";
 6674|      0|    case BLOSC2_ERROR_INVALID_HEADER:
  ------------------
  |  Branch (6674:5): [True: 0, False: 2]
  ------------------
 6675|      0|      return "Invalid value in header";
 6676|      0|    case BLOSC2_ERROR_INVALID_PARAM:
  ------------------
  |  Branch (6676:5): [True: 0, False: 2]
  ------------------
 6677|      0|      return "Invalid parameter supplied to function";
 6678|      0|    case BLOSC2_ERROR_FILE_READ:
  ------------------
  |  Branch (6678:5): [True: 0, False: 2]
  ------------------
 6679|      0|      return "File read failure";
 6680|      0|    case BLOSC2_ERROR_FILE_WRITE:
  ------------------
  |  Branch (6680:5): [True: 0, False: 2]
  ------------------
 6681|      0|      return "File write failure";
 6682|      0|    case BLOSC2_ERROR_FILE_OPEN:
  ------------------
  |  Branch (6682:5): [True: 0, False: 2]
  ------------------
 6683|      0|      return "File open failure";
 6684|      0|    case BLOSC2_ERROR_NOT_FOUND:
  ------------------
  |  Branch (6684:5): [True: 0, False: 2]
  ------------------
 6685|      0|      return "Not found";
 6686|      0|    case BLOSC2_ERROR_RUN_LENGTH:
  ------------------
  |  Branch (6686:5): [True: 0, False: 2]
  ------------------
 6687|      0|      return "Bad run length encoding";
 6688|      0|    case BLOSC2_ERROR_FILTER_PIPELINE:
  ------------------
  |  Branch (6688:5): [True: 0, False: 2]
  ------------------
 6689|      0|      return "Filter pipeline error";
 6690|      0|    case BLOSC2_ERROR_CHUNK_INSERT:
  ------------------
  |  Branch (6690:5): [True: 0, False: 2]
  ------------------
 6691|      0|      return "Chunk insert failure";
 6692|      0|    case BLOSC2_ERROR_CHUNK_APPEND:
  ------------------
  |  Branch (6692:5): [True: 0, False: 2]
  ------------------
 6693|      0|      return "Chunk append failure";
 6694|      0|    case BLOSC2_ERROR_CHUNK_UPDATE:
  ------------------
  |  Branch (6694:5): [True: 0, False: 2]
  ------------------
 6695|      0|      return "Chunk update failure";
 6696|      0|    case BLOSC2_ERROR_2GB_LIMIT:
  ------------------
  |  Branch (6696:5): [True: 0, False: 2]
  ------------------
 6697|      0|      return "Sizes larger than 2gb not supported";
 6698|      0|    case BLOSC2_ERROR_SCHUNK_COPY:
  ------------------
  |  Branch (6698:5): [True: 0, False: 2]
  ------------------
 6699|      0|      return "Super-chunk copy failure";
 6700|      0|    case BLOSC2_ERROR_FRAME_TYPE:
  ------------------
  |  Branch (6700:5): [True: 0, False: 2]
  ------------------
 6701|      0|      return "Wrong type for frame";
 6702|      0|    case BLOSC2_ERROR_FILE_TRUNCATE:
  ------------------
  |  Branch (6702:5): [True: 0, False: 2]
  ------------------
 6703|      0|      return "File truncate failure";
 6704|      0|    case BLOSC2_ERROR_THREAD_CREATE:
  ------------------
  |  Branch (6704:5): [True: 0, False: 2]
  ------------------
 6705|      0|      return "Thread or thread context creation failure";
 6706|      0|    case BLOSC2_ERROR_POSTFILTER:
  ------------------
  |  Branch (6706:5): [True: 0, False: 2]
  ------------------
 6707|      0|      return "Postfilter failure";
 6708|      0|    case BLOSC2_ERROR_FRAME_SPECIAL:
  ------------------
  |  Branch (6708:5): [True: 0, False: 2]
  ------------------
 6709|      0|      return "Special frame failure";
 6710|      0|    case BLOSC2_ERROR_SCHUNK_SPECIAL:
  ------------------
  |  Branch (6710:5): [True: 0, False: 2]
  ------------------
 6711|      0|      return "Special super-chunk failure";
 6712|      0|    case BLOSC2_ERROR_PLUGIN_IO:
  ------------------
  |  Branch (6712:5): [True: 0, False: 2]
  ------------------
 6713|      0|      return "IO plugin error";
 6714|      0|    case BLOSC2_ERROR_FILE_REMOVE:
  ------------------
  |  Branch (6714:5): [True: 0, False: 2]
  ------------------
 6715|      0|      return "Remove file failure";
 6716|      0|    case BLOSC2_ERROR_NULL_POINTER:
  ------------------
  |  Branch (6716:5): [True: 0, False: 2]
  ------------------
 6717|      0|      return "Pointer is null";
 6718|      0|    case BLOSC2_ERROR_INVALID_INDEX:
  ------------------
  |  Branch (6718:5): [True: 0, False: 2]
  ------------------
 6719|      0|      return "Invalid index";
 6720|      0|    case BLOSC2_ERROR_METALAYER_NOT_FOUND:
  ------------------
  |  Branch (6720:5): [True: 0, False: 2]
  ------------------
 6721|      0|      return "Metalayer has not been found";
 6722|      0|    case BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED:
  ------------------
  |  Branch (6722:5): [True: 0, False: 2]
  ------------------
 6723|      0|      return "Maximum buffersize exceeded";
 6724|      0|    case BLOSC2_ERROR_TUNER:
  ------------------
  |  Branch (6724:5): [True: 0, False: 2]
  ------------------
 6725|      0|      return "Tuner failure";
 6726|      0|    default:
  ------------------
  |  Branch (6726:5): [True: 0, False: 2]
  ------------------
 6727|      0|      return "Unknown error";
 6728|      2|  }
 6729|      2|}
blosc2.c:flags_to_filters:
  633|   149k|static void flags_to_filters(const uint8_t flags, uint8_t* filters) {
  634|       |  /* Initialize the filter pipeline */
  635|   149k|  memset(filters, 0, BLOSC2_MAX_FILTERS);
  636|       |  /* Fill the filter pipeline */
  637|   149k|  if (flags & BLOSC_DOSHUFFLE)
  ------------------
  |  Branch (637:7): [True: 143k, False: 5.58k]
  ------------------
  638|   143k|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_SHUFFLE;
  639|   149k|  if (flags & BLOSC_DOBITSHUFFLE)
  ------------------
  |  Branch (639:7): [True: 144k, False: 5.30k]
  ------------------
  640|   144k|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_BITSHUFFLE;
  641|   149k|  if (flags & BLOSC_DODELTA)
  ------------------
  |  Branch (641:7): [True: 9.75k, False: 139k]
  ------------------
  642|  9.75k|    filters[BLOSC2_MAX_FILTERS - 2] = BLOSC_DELTA;
  643|   149k|}
blosc2.c:destroy_thread_context:
 2227|  3.10k|static void destroy_thread_context(struct thread_context* thread_context) {
 2228|  3.10k|  my_free(thread_context->tmp);
 2229|  3.10k|#if defined(HAVE_ZSTD)
 2230|  3.10k|  if (thread_context->zstd_cctx != NULL) {
  ------------------
  |  Branch (2230:7): [True: 0, False: 3.10k]
  ------------------
 2231|      0|    ZSTD_freeCCtx(thread_context->zstd_cctx);
 2232|      0|  }
 2233|  3.10k|  if (thread_context->zstd_dctx != NULL) {
  ------------------
  |  Branch (2233:7): [True: 1.86k, False: 1.24k]
  ------------------
 2234|  1.86k|    ZSTD_freeDCtx(thread_context->zstd_dctx);
 2235|  1.86k|  }
 2236|  3.10k|#endif
 2237|  3.10k|  if (thread_context->lz4_cstream != NULL) {
  ------------------
  |  Branch (2237:7): [True: 0, False: 3.10k]
  ------------------
 2238|      0|    LZ4_freeStream((LZ4_stream_t*)thread_context->lz4_cstream);
 2239|      0|  }
 2240|  3.10k|  if (thread_context->lz4hc_cstream != NULL) {
  ------------------
  |  Branch (2240:7): [True: 0, False: 3.10k]
  ------------------
 2241|      0|    LZ4_freeStreamHC((LZ4_streamHC_t*)thread_context->lz4hc_cstream);
 2242|      0|  }
 2243|  3.10k|}
blosc2.c:my_free:
  218|  9.37k|static void my_free(void* block) {
  219|       |#if defined(_WIN32)
  220|       |  _aligned_free(block);
  221|       |#else
  222|  9.37k|  free(block);
  223|  9.37k|#endif  /* _WIN32 */
  224|  9.37k|}
blosc2.c:filters_to_flags:
  610|  1.63k|static uint8_t filters_to_flags(const uint8_t* filters) {
  611|  1.63k|  uint8_t flags = 0;
  612|       |
  613|  11.4k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (613:19): [True: 9.78k, False: 1.63k]
  ------------------
  614|  9.78k|    switch (filters[i]) {
  615|  1.16k|      case BLOSC_SHUFFLE:
  ------------------
  |  Branch (615:7): [True: 1.16k, False: 8.62k]
  ------------------
  616|  1.16k|        flags |= BLOSC_DOSHUFFLE;
  617|  1.16k|        break;
  618|    475|      case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (618:7): [True: 475, False: 9.31k]
  ------------------
  619|    475|        flags |= BLOSC_DOBITSHUFFLE;
  620|    475|        break;
  621|    791|      case BLOSC_DELTA:
  ------------------
  |  Branch (621:7): [True: 791, False: 8.99k]
  ------------------
  622|    791|        flags |= BLOSC_DODELTA;
  623|    791|        break;
  624|  7.35k|      default :
  ------------------
  |  Branch (624:7): [True: 7.35k, False: 2.43k]
  ------------------
  625|  7.35k|        break;
  626|  9.78k|    }
  627|  9.78k|  }
  628|  1.63k|  return flags;
  629|  1.63k|}
blosc2.c:blosc2_calculate_blocks:
  798|  3.12k|static inline void blosc2_calculate_blocks(blosc2_context* context) {
  799|       |  /* Compute number of blocks in buffer */
  800|  3.12k|  context->nblocks = context->sourcesize / context->blocksize;
  801|  3.12k|  context->leftover = context->sourcesize % context->blocksize;
  802|  3.12k|  context->nblocks = (context->leftover > 0) ?
  ------------------
  |  Branch (802:22): [True: 1.87k, False: 1.25k]
  ------------------
  803|  1.87k|                     (context->nblocks + 1) : context->nblocks;
  804|  3.12k|}
blosc2.c:clibcode_to_clibname:
  251|      1|static const char* clibcode_to_clibname(int clibcode) {
  252|      1|  if (clibcode == BLOSC_BLOSCLZ_LIB) return BLOSC_BLOSCLZ_LIBNAME;
  ------------------
  |  |  367|      0|#define BLOSC_BLOSCLZ_LIBNAME   "BloscLZ"
  ------------------
  |  Branch (252:7): [True: 0, False: 1]
  ------------------
  253|      1|  if (clibcode == BLOSC_LZ4_LIB) return BLOSC_LZ4_LIBNAME;
  ------------------
  |  |  368|      0|#define BLOSC_LZ4_LIBNAME       "LZ4"
  ------------------
  |  Branch (253:7): [True: 0, False: 1]
  ------------------
  254|      1|  if (clibcode == BLOSC_ZLIB_LIB) return BLOSC_ZLIB_LIBNAME;
  ------------------
  |  |  369|      0|#define BLOSC_ZLIB_LIBNAME      "Zlib"
  ------------------
  |  Branch (254:7): [True: 0, False: 1]
  ------------------
  255|      1|  if (clibcode == BLOSC_ZSTD_LIB) return BLOSC_ZSTD_LIBNAME;
  ------------------
  |  |  370|      0|#define BLOSC_ZSTD_LIBNAME      "Zstd"
  ------------------
  |  Branch (255:7): [True: 0, False: 1]
  ------------------
  256|      8|  for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (256:19): [True: 7, False: 1]
  ------------------
  257|      7|    if (clibcode == g_codecs[i].complib)
  ------------------
  |  Branch (257:9): [True: 0, False: 7]
  ------------------
  258|      0|      return g_codecs[i].compname;
  259|      7|  }
  260|      1|  return NULL;                  /* should never happen */
  261|      1|}
blosc2.c:blosc_run_decompression_with_context:
 3857|  3.15k|                                                void* dest, int32_t destsize) {
 3858|  3.15k|  blosc_header header;
 3859|  3.15k|  int32_t ntbytes;
 3860|  3.15k|  int rc;
 3861|       |
 3862|  3.15k|  rc = read_chunk_header(src, srcsize, true, &header);
 3863|  3.15k|  if (rc < 0) {
  ------------------
  |  Branch (3863:7): [True: 11, False: 3.14k]
  ------------------
 3864|     11|    return rc;
 3865|     11|  }
 3866|       |
 3867|  3.14k|  if (header.nbytes > destsize) {
  ------------------
  |  Branch (3867:7): [True: 2, False: 3.13k]
  ------------------
 3868|       |    // Not enough space for writing into the destination
 3869|      2|    return BLOSC2_ERROR_WRITE_BUFFER;
 3870|      2|  }
 3871|       |
 3872|  3.13k|  rc = initialize_context_decompression(context, &header, src, srcsize, dest, destsize);
 3873|  3.13k|  if (rc < 0) {
  ------------------
  |  Branch (3873:7): [True: 34, False: 3.10k]
  ------------------
 3874|     34|    return rc;
 3875|     34|  }
 3876|       |
 3877|       |  /* Do the actual decompression */
 3878|  3.10k|  ntbytes = do_job(context);
 3879|  3.10k|  if (ntbytes < 0) {
  ------------------
  |  Branch (3879:7): [True: 2.94k, False: 158]
  ------------------
 3880|  2.94k|    return ntbytes;
 3881|  2.94k|  }
 3882|       |
 3883|  3.10k|  assert(ntbytes <= (int32_t)destsize);
 3884|    158|  return ntbytes;
 3885|  3.10k|}
blosc2.c:initialize_context_decompression:
 2635|  3.13k|                                            int32_t srcsize, void* dest, int32_t destsize) {
 2636|  3.13k|  int32_t bstarts_end;
 2637|  3.13k|  bool vlblocks;
 2638|       |
 2639|  3.13k|  context->do_compress = 0;
 2640|  3.13k|  context->src = (const uint8_t*)src;
 2641|  3.13k|  context->srcsize = srcsize;
 2642|  3.13k|  context->dest = (uint8_t*)dest;
 2643|  3.13k|  context->destsize = destsize;
 2644|  3.13k|  context->output_bytes = 0;
 2645|  3.13k|  context->vlblock_sources = NULL;
 2646|  3.13k|  context->vlblock_dests = NULL;
 2647|  3.13k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (2647:7): [True: 0, False: 3.13k]
  ------------------
 2648|      0|    free(context->blocknbytes);
 2649|      0|    context->blocknbytes = NULL;
 2650|      0|  }
 2651|  3.13k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (2651:7): [True: 0, False: 3.13k]
  ------------------
 2652|      0|    free(context->blockoffsets);
 2653|      0|    context->blockoffsets = NULL;
 2654|      0|  }
 2655|  3.13k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (2655:7): [True: 0, False: 3.13k]
  ------------------
 2656|      0|    free(context->blockcbytes);
 2657|      0|    context->blockcbytes = NULL;
 2658|      0|  }
 2659|       |
 2660|  3.13k|  int rc = blosc2_initialize_context_from_header(context, header);
 2661|  3.13k|  if (rc < 0) {
  ------------------
  |  Branch (2661:7): [True: 0, False: 3.13k]
  ------------------
 2662|      0|    return rc;
 2663|      0|  }
 2664|  3.13k|  clear_context_decompression_dict(context);
 2665|  3.13k|  vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2666|  3.13k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (2666:19): [True: 1.63k, False: 1.50k]
  ------------------
 2667|  1.63k|                  (context->blosc2_flags & 0x08u));
  ------------------
  |  Branch (2667:19): [True: 9, False: 1.62k]
  ------------------
 2668|       |
 2669|       |  /* Check that we have enough space to decompress */
 2670|  3.13k|  if (context->sourcesize > (int32_t)context->destsize) {
  ------------------
  |  Branch (2670:7): [True: 0, False: 3.13k]
  ------------------
 2671|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 2672|      0|  }
 2673|       |
 2674|  3.13k|  if (context->block_maskout != NULL && context->block_maskout_nitems != context->nblocks) {
  ------------------
  |  Branch (2674:7): [True: 0, False: 3.13k]
  |  Branch (2674:41): [True: 0, False: 0]
  ------------------
 2675|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2676|      0|                      " of blocks in chunk (%d).",
 2677|      0|                      context->block_maskout_nitems, context->nblocks);
 2678|      0|    return BLOSC2_ERROR_DATA;
 2679|      0|  }
 2680|       |
 2681|  3.13k|  context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
 2682|  3.13k|  if (context->special_type > BLOSC2_SPECIAL_LASTID) {
  ------------------
  |  Branch (2682:7): [True: 0, False: 3.13k]
  ------------------
 2683|      0|    BLOSC_TRACE_ERROR("Unknown special values ID (%d) ",
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2684|      0|                      context->special_type);
 2685|      0|    return BLOSC2_ERROR_DATA;
 2686|      0|  }
 2687|       |
 2688|  3.13k|  int memcpyed = (context->header_flags & (uint8_t) BLOSC_MEMCPYED);
 2689|  3.13k|  if (memcpyed && (header->cbytes != header->nbytes + context->header_overhead)) {
  ------------------
  |  Branch (2689:7): [True: 13, False: 3.12k]
  |  Branch (2689:19): [True: 11, False: 2]
  ------------------
 2690|     11|    BLOSC_TRACE_ERROR("Wrong header info for this memcpyed chunk");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2691|     11|    return BLOSC2_ERROR_DATA;
 2692|     11|  }
 2693|       |
 2694|  3.12k|  if ((header->nbytes == 0) && (header->cbytes == context->header_overhead) &&
  ------------------
  |  Branch (2694:7): [True: 0, False: 3.12k]
  |  Branch (2694:32): [True: 0, False: 0]
  ------------------
 2695|      0|      !context->special_type) {
  ------------------
  |  Branch (2695:7): [True: 0, False: 0]
  ------------------
 2696|       |    // A compressed buffer with only a header can only contain a zero-length buffer
 2697|      0|    return 0;
 2698|      0|  }
 2699|       |
 2700|  3.12k|  context->bstarts = (int32_t *) (context->src + context->header_overhead);
 2701|  3.12k|  bstarts_end = context->header_overhead;
 2702|  3.12k|  if (!context->special_type && !memcpyed) {
  ------------------
  |  Branch (2702:7): [True: 3.10k, False: 23]
  |  Branch (2702:33): [True: 3.10k, False: 2]
  ------------------
 2703|  3.10k|    size_t bstarts_end_tmp;
 2704|  3.10k|    size_t bstarts_nbytes;
 2705|  3.10k|    if (context->nblocks < 0 ||
  ------------------
  |  Branch (2705:9): [True: 0, False: 3.10k]
  ------------------
 2706|  3.10k|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (2706:9): [True: 0, False: 3.10k]
  ------------------
 2707|  3.10k|        !checked_add_size((size_t)context->header_overhead, bstarts_nbytes, &bstarts_end_tmp) ||
  ------------------
  |  Branch (2707:9): [True: 0, False: 3.10k]
  ------------------
 2708|  3.10k|        bstarts_end_tmp > (size_t)INT32_MAX) {
  ------------------
  |  Branch (2708:9): [True: 0, False: 3.10k]
  ------------------
 2709|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2710|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2711|      0|    }
 2712|       |    /* If chunk is not special or a memcpyed, we do have a bstarts section */
 2713|  3.10k|    bstarts_end = (int32_t)bstarts_end_tmp;
 2714|  3.10k|  }
 2715|       |
 2716|  3.12k|  if (srcsize < bstarts_end) {
  ------------------
  |  Branch (2716:7): [True: 0, False: 3.12k]
  ------------------
 2717|      0|    BLOSC_TRACE_ERROR("`bstarts` exceeds length of 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2718|      0|    return BLOSC2_ERROR_READ_BUFFER;
 2719|      0|  }
 2720|       |
 2721|  3.12k|  if (vlblocks && is_lazy && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (2721:7): [True: 14, False: 3.11k]
  |  Branch (2721:19): [True: 5, False: 9]
  |  Branch (2721:30): [True: 5, False: 0]
  |  Branch (2721:56): [True: 5, False: 0]
  ------------------
 2722|      5|    size_t block_csizes_nbytes;
 2723|      5|    size_t trailer_meta_nbytes;
 2724|      5|    size_t lazy_trailer_end;
 2725|      5|    if (context->srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (2725:9): [True: 0, False: 5]
  |  Branch (2725:33): [True: 0, False: 5]
  ------------------
 2726|      5|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (2726:9): [True: 0, False: 5]
  ------------------
 2727|      5|        !checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (2727:9): [True: 0, False: 5]
  ------------------
 2728|      5|        !checked_add_size((size_t)bstarts_end, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (2728:9): [True: 0, False: 5]
  ------------------
 2729|      5|        (size_t)context->srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (2729:9): [True: 3, False: 2]
  ------------------
 2730|      3|      BLOSC_TRACE_ERROR("Lazy trailer exceeds source buffer.");
  ------------------
  |  |   93|      3|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      3|    do {                                            \
  |  |  |  |   98|      3|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      3|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      3|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2731|      3|      return BLOSC2_ERROR_READ_BUFFER;
 2732|      3|    }
 2733|      5|  }
 2734|  3.12k|  srcsize -= bstarts_end;
 2735|       |
 2736|       |  /* Read optional dictionary if flag set */
 2737|  3.12k|  if ((context->blosc2_flags & BLOSC2_USEDICT) && !is_lazy) {
  ------------------
  |  Branch (2737:7): [True: 929, False: 2.19k]
  |  Branch (2737:51): [True: 929, False: 0]
  ------------------
 2738|    929|    context->use_dict = 1;
 2739|       |    // The dictionary section is after the bstarts block: [int32 size | raw bytes]
 2740|    929|    if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2740:9): [True: 0, False: 929]
  ------------------
 2741|      0|      BLOSC_TRACE_ERROR("Not enough space to read size of dictionary.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2742|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2743|      0|    }
 2744|    929|    srcsize -= sizeof(int32_t);
 2745|       |    // Read dictionary size
 2746|    929|    context->dict_size = sw32_(context->src + bstarts_end);
 2747|    929|    if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (2747:9): [True: 0, False: 929]
  |  Branch (2747:36): [True: 2, False: 927]
  ------------------
 2748|      2|      BLOSC_TRACE_ERROR("Dictionary size is smaller than minimum or larger than maximum allowed.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2749|      2|      return BLOSC2_ERROR_CODEC_DICT;
 2750|      2|    }
 2751|    927|    if (srcsize < (int32_t)context->dict_size) {
  ------------------
  |  Branch (2751:9): [True: 0, False: 927]
  ------------------
 2752|      0|      BLOSC_TRACE_ERROR("Not enough space to read entire dictionary.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2753|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2754|      0|    }
 2755|    927|    srcsize -= context->dict_size;
 2756|       |    // dict_buffer points directly into the source chunk — no copy needed
 2757|    927|    context->dict_buffer = (void*)(context->src + bstarts_end + sizeof(int32_t));
 2758|    927|    context->dict_buffer_owned = false;
 2759|    927|#if defined(HAVE_ZSTD)
 2760|       |    // context->compcode during decompression holds the format code (flags >> 5),
 2761|       |    // so compare against BLOSC_ZSTD_FORMAT (not BLOSC_ZSTD).
 2762|    927|    if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2762:9): [True: 783, False: 144]
  ------------------
 2763|    783|      context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 2764|    783|      if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (2764:11): [True: 7, False: 776]
  ------------------
 2765|      7|        BLOSC_TRACE_ERROR("Cannot create ZSTD dictionary for 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2766|      7|        return BLOSC2_ERROR_CODEC_DICT;
 2767|      7|      }
 2768|    783|    }
 2769|    927|#endif   // HAVE_ZSTD
 2770|       |    // For LZ4/LZ4HC: dict_buffer and dict_size are sufficient; no digested object needed.
 2771|    927|  }
 2772|  2.19k|  else if ((context->blosc2_flags & BLOSC2_USEDICT) && is_lazy) {
  ------------------
  |  Branch (2772:12): [True: 0, False: 2.19k]
  |  Branch (2772:56): [True: 0, False: 0]
  ------------------
 2773|      0|    rc = load_lazy_chunk_dict(context, header, bstarts_end);
 2774|      0|    if (rc < 0) {
  ------------------
  |  Branch (2774:9): [True: 0, False: 0]
  ------------------
 2775|      0|      return rc;
 2776|      0|    }
 2777|      0|  }
 2778|       |
 2779|  3.11k|  if (vlblocks && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (2779:7): [True: 11, False: 3.10k]
  |  Branch (2779:19): [True: 11, False: 0]
  |  Branch (2779:45): [True: 11, False: 0]
  ------------------
 2780|     11|    context->blocknbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 2781|     11|    BLOSC_ERROR_NULL(context->blocknbytes, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|     11|    do {                                            \
  |  |  105|     11|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 11]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|     11|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 11]
  |  |  ------------------
  ------------------
 2782|     11|    context->blockoffsets = malloc((size_t)context->nblocks * sizeof(int32_t));
 2783|     11|    BLOSC_ERROR_NULL(context->blockoffsets, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|     11|    do {                                            \
  |  |  105|     11|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 11]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|     11|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 11]
  |  |  ------------------
  ------------------
 2784|     11|    context->blockcbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 2785|     11|    BLOSC_ERROR_NULL(context->blockcbytes, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|     11|    do {                                            \
  |  |  105|     11|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 11]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|     11|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 11]
  |  |  ------------------
  ------------------
 2786|       |
 2787|     11|    if (is_lazy) {
  ------------------
  |  Branch (2787:9): [True: 2, False: 9]
  ------------------
 2788|       |      // Lazy VL: block data is on disk, so blocknbytes is unknown at this point.
 2789|       |      // Populate blockcbytes from bstarts differences; blocksize gets max(blockcbytes)
 2790|       |      // as a safe upper bound so tmp buffers are large enough for the lazy block read.
 2791|      2|      int32_t max_csize = 0;
 2792|      8|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (2792:27): [True: 8, False: 0]
  ------------------
 2793|      8|        int32_t bstart = sw32_(context->bstarts + i);
 2794|      8|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (2794:31): [True: 8, False: 0]
  ------------------
 2795|      8|            sw32_(context->bstarts + i + 1) : header->cbytes;
 2796|      8|        if (bstart < bstarts_end || next_bstart <= bstart ||
  ------------------
  |  Branch (2796:13): [True: 0, False: 8]
  |  Branch (2796:37): [True: 1, False: 7]
  ------------------
 2797|      7|            next_bstart > header->cbytes) {
  ------------------
  |  Branch (2797:13): [True: 1, False: 6]
  ------------------
 2798|      2|          BLOSC_TRACE_ERROR("Invalid VL-block offsets in lazy chunk.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2799|      2|          return BLOSC2_ERROR_INVALID_HEADER;
 2800|      2|        }
 2801|      6|        context->blocknbytes[i] = 0;   // unknown until block is read from disk
 2802|      6|        context->blockoffsets[i] = 0;  // unknown
 2803|      6|        context->blockcbytes[i] = next_bstart - bstart;
 2804|      6|        if (context->blockcbytes[i] > max_csize) {
  ------------------
  |  Branch (2804:13): [True: 2, False: 4]
  ------------------
 2805|      2|          max_csize = context->blockcbytes[i];
 2806|      2|        }
 2807|      6|      }
 2808|      0|      context->blocksize = max_csize;
 2809|      0|      context->leftover = 0;
 2810|      0|    }
 2811|      9|    else {
 2812|      9|      int32_t max_blocksize = 0;
 2813|      9|      int64_t total_nbytes = 0;
 2814|      9|      int32_t prev_bstart = 0;
 2815|     18|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (2815:27): [True: 15, False: 3]
  ------------------
 2816|     15|        int32_t bstart = sw32_(context->bstarts + i);
 2817|     15|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (2817:31): [True: 11, False: 4]
  ------------------
 2818|     11|            sw32_(context->bstarts + i + 1) : header->cbytes;
 2819|     15|        if (bstart < bstarts_end || bstart <= prev_bstart || next_bstart <= bstart ||
  ------------------
  |  Branch (2819:13): [True: 1, False: 14]
  |  Branch (2819:37): [True: 0, False: 14]
  |  Branch (2819:62): [True: 3, False: 11]
  ------------------
 2820|     11|            next_bstart > header->cbytes || bstart > context->srcsize - (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (2820:13): [True: 1, False: 10]
  |  Branch (2820:45): [True: 0, False: 10]
  ------------------
 2821|      5|          BLOSC_TRACE_ERROR("Invalid VL-block offsets in chunk.");
  ------------------
  |  |   93|      5|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      5|    do {                                            \
  |  |  |  |   98|      5|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      5|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      5|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2822|      5|          return BLOSC2_ERROR_INVALID_HEADER;
 2823|      5|        }
 2824|     10|        context->blocknbytes[i] = sw32_(context->src + bstart);
 2825|     10|        context->blockcbytes[i] = next_bstart - bstart;
 2826|     10|        if (context->blocknbytes[i] <= 0) {
  ------------------
  |  Branch (2826:13): [True: 0, False: 10]
  ------------------
 2827|      0|          BLOSC_TRACE_ERROR("Invalid VL-block uncompressed 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2828|      0|          return BLOSC2_ERROR_INVALID_HEADER;
 2829|      0|        }
 2830|     10|        if (total_nbytes > INT32_MAX) {
  ------------------
  |  Branch (2830:13): [True: 0, False: 10]
  ------------------
 2831|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2832|      0|          return BLOSC2_ERROR_INVALID_HEADER;
 2833|      0|        }
 2834|     10|        context->blockoffsets[i] = (int32_t)total_nbytes;
 2835|     10|        total_nbytes += context->blocknbytes[i];
 2836|     10|        if (total_nbytes > context->sourcesize) {
  ------------------
  |  Branch (2836:13): [True: 1, False: 9]
  ------------------
 2837|      1|          BLOSC_TRACE_ERROR("VL-block sizes exceed chunk nbytes.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2838|      1|          return BLOSC2_ERROR_INVALID_HEADER;
 2839|      1|        }
 2840|      9|        if (context->blocknbytes[i] > max_blocksize) {
  ------------------
  |  Branch (2840:13): [True: 9, False: 0]
  ------------------
 2841|      9|          max_blocksize = context->blocknbytes[i];
 2842|      9|        }
 2843|      9|        prev_bstart = bstart;
 2844|      9|      }
 2845|      3|      if (total_nbytes != context->sourcesize) {
  ------------------
  |  Branch (2845:11): [True: 3, False: 0]
  ------------------
 2846|      3|        BLOSC_TRACE_ERROR("VL-block sizes do not add up to chunk nbytes.");
  ------------------
  |  |   93|      3|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      3|    do {                                            \
  |  |  |  |   98|      3|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      3|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      3|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2847|      3|        return BLOSC2_ERROR_INVALID_HEADER;
 2848|      3|      }
 2849|      0|      context->blocksize = max_blocksize;
 2850|      0|      context->leftover = 0;
 2851|      0|    }
 2852|     11|  }
 2853|       |
 2854|  3.10k|  return 0;
 2855|  3.11k|}
blosc2.c:clear_context_decompression_dict:
 2496|  3.13k|static void clear_context_decompression_dict(blosc2_context* context) {
 2497|  3.13k|  context->use_dict = 0;
 2498|  3.13k|  release_context_dict_buffer(context);
 2499|  3.13k|#if defined(HAVE_ZSTD)
 2500|  3.13k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (2500:7): [True: 0, False: 3.13k]
  ------------------
 2501|      0|    ZSTD_freeDDict(context->dict_ddict);
 2502|      0|    context->dict_ddict = NULL;
 2503|      0|  }
 2504|       |#else
 2505|       |  context->dict_ddict = NULL;
 2506|       |#endif
 2507|  3.13k|}
blosc2.c:checked_mul_size:
  152|  3.10k|static inline bool checked_mul_size(size_t a, size_t b, size_t* out) {
  153|  3.10k|  if (a != 0 && b > SIZE_MAX / a) {
  ------------------
  |  Branch (153:7): [True: 3.10k, False: 0]
  |  Branch (153:17): [True: 0, False: 3.10k]
  ------------------
  154|      0|    return false;
  155|      0|  }
  156|  3.10k|  *out = a * b;
  157|       |  return true;
  158|  3.10k|}
blosc2.c:checked_add_size:
  160|  3.11k|static inline bool checked_add_size(size_t a, size_t b, size_t* out) {
  161|  3.11k|  if (a > SIZE_MAX - b) {
  ------------------
  |  Branch (161:7): [True: 0, False: 3.11k]
  ------------------
  162|      0|    return false;
  163|      0|  }
  164|  3.11k|  *out = a + b;
  165|       |  return true;
  166|  3.11k|}
blosc2.c:do_job:
 2300|  3.10k|static int do_job(blosc2_context* context) {
 2301|  3.10k|  int32_t ntbytes;
 2302|       |
 2303|       |  /* Set sentinels */
 2304|  3.10k|  context->dref_not_init = 1;
 2305|       |
 2306|       |  /* Check whether we need to restart threads */
 2307|  3.10k|  check_nthreads(context);
 2308|       |
 2309|       |  /* Run the serial version when nthreads is 1 or when the buffers are
 2310|       |     not larger than blocksize */
 2311|  3.10k|  if (context->nthreads == 1 || (context->sourcesize / context->blocksize) <= 1) {
  ------------------
  |  Branch (2311:7): [True: 3.10k, False: 0]
  |  Branch (2311:33): [True: 0, False: 0]
  ------------------
 2312|       |    /* The context for this 'thread' has no been initialized yet */
 2313|  3.10k|    if (context->serial_context == NULL) {
  ------------------
  |  Branch (2313:9): [True: 3.10k, False: 0]
  ------------------
 2314|  3.10k|      context->serial_context = create_thread_context(context, 0);
 2315|  3.10k|    }
 2316|      0|    else if (context->blocksize != context->serial_context->tmp_blocksize) {
  ------------------
  |  Branch (2316:14): [True: 0, False: 0]
  ------------------
 2317|      0|      free_thread_context(context->serial_context);
 2318|      0|      context->serial_context = create_thread_context(context, 0);
 2319|      0|    }
 2320|  3.10k|    BLOSC_ERROR_NULL(context->serial_context, BLOSC2_ERROR_THREAD_CREATE);
  ------------------
  |  |  104|  3.10k|    do {                                            \
  |  |  105|  3.10k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 3.10k]
  |  |  ------------------
  |  |  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|  3.10k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 3.10k]
  |  |  ------------------
  ------------------
 2321|  3.10k|    ntbytes = serial_blosc(context->serial_context);
 2322|  3.10k|  }
 2323|      0|  else {
 2324|      0|    ntbytes = parallel_blosc(context);
 2325|      0|  }
 2326|       |
 2327|  3.10k|  return ntbytes;
 2328|  3.10k|}
blosc2.c:serial_blosc:
 2112|  3.10k|static int serial_blosc(struct thread_context* thread_context) {
 2113|  3.10k|  blosc2_context* context = thread_context->parent_context;
 2114|  3.10k|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2115|  3.10k|  int32_t j, bsize, leftoverblock;
 2116|  3.10k|  int32_t cbytes;
 2117|  3.10k|  int32_t ntbytes = context->output_bytes;
 2118|  3.10k|  int32_t* bstarts = context->bstarts;
 2119|  3.10k|  uint8_t* tmp = thread_context->tmp;
 2120|  3.10k|  uint8_t* tmp2 = thread_context->tmp2;
 2121|  3.10k|  int dict_training = context->use_dict && (context->dict_cdict == NULL);
  ------------------
  |  Branch (2121:23): [True: 920, False: 2.18k]
  |  Branch (2121:44): [True: 920, False: 0]
  ------------------
 2122|  3.10k|  bool memcpyed = context->header_flags & (uint8_t)BLOSC_MEMCPYED;
 2123|  3.10k|  if (!context->do_compress && context->special_type) {
  ------------------
  |  Branch (2123:7): [True: 3.10k, False: 0]
  |  Branch (2123:32): [True: 23, False: 3.08k]
  ------------------
 2124|       |    // Fake a runlen as if it was a memcpyed chunk
 2125|     23|    memcpyed = true;
 2126|     23|  }
 2127|       |
 2128|   140k|  for (j = 0; j < context->nblocks; j++) {
  ------------------
  |  Branch (2128:15): [True: 140k, False: 158]
  ------------------
 2129|   140k|    if (context->do_compress && !memcpyed && !dict_training) {
  ------------------
  |  Branch (2129:9): [True: 0, False: 140k]
  |  Branch (2129:33): [True: 0, False: 0]
  |  Branch (2129:46): [True: 0, False: 0]
  ------------------
 2130|      0|      _sw32(bstarts + j, ntbytes);
 2131|      0|    }
 2132|   140k|    bsize = vlblocks ? context->blocknbytes[j] : context->blocksize;
  ------------------
  |  Branch (2132:13): [True: 0, False: 140k]
  ------------------
 2133|   140k|    leftoverblock = 0;
 2134|   140k|    if (!vlblocks && (j == context->nblocks - 1) && (context->leftover > 0)) {
  ------------------
  |  Branch (2134:9): [True: 140k, False: 0]
  |  Branch (2134:22): [True: 1.40k, False: 138k]
  |  Branch (2134:53): [True: 180, False: 1.22k]
  ------------------
 2135|    180|      bsize = context->leftover;
 2136|    180|      leftoverblock = 1;
 2137|    180|    }
 2138|   140k|    if (context->do_compress) {
  ------------------
  |  Branch (2138:9): [True: 0, False: 140k]
  ------------------
 2139|      0|      if (memcpyed && !context->prefilter) {
  ------------------
  |  Branch (2139:11): [True: 0, False: 0]
  |  Branch (2139:23): [True: 0, False: 0]
  ------------------
 2140|       |        /* We want to memcpy only */
 2141|      0|        memcpy(context->dest + context->header_overhead + j * context->blocksize,
 2142|      0|               context->src + j * context->blocksize, (unsigned int)bsize);
 2143|      0|        cbytes = (int32_t)bsize;
 2144|      0|      }
 2145|      0|      else {
 2146|       |        /* Regular compression */
 2147|      0|        cbytes = blosc_c(thread_context, bsize, leftoverblock, ntbytes,
 2148|      0|                         context->destsize,
 2149|      0|                         vlblocks ? context->vlblock_sources[j] : context->src,
  ------------------
  |  Branch (2149:26): [True: 0, False: 0]
  ------------------
 2150|      0|                         vlblocks ? 0 : j * context->blocksize,
  ------------------
  |  Branch (2150:26): [True: 0, False: 0]
  ------------------
 2151|      0|                         context->dest + ntbytes, tmp, tmp2);
 2152|      0|        if (cbytes == 0) {
  ------------------
  |  Branch (2152:13): [True: 0, False: 0]
  ------------------
 2153|      0|          ntbytes = 0;              /* incompressible data */
 2154|      0|          break;
 2155|      0|        }
 2156|      0|      }
 2157|      0|    }
 2158|   140k|    else {
 2159|       |      /* Regular decompression */
 2160|       |      // If memcpyed we don't have a bstarts section (because it is not needed)
 2161|   140k|      int32_t src_offset = memcpyed ?
  ------------------
  |  Branch (2161:28): [True: 131k, False: 8.62k]
  ------------------
 2162|   131k|          context->header_overhead + j * context->blocksize : sw32_(bstarts + j);
 2163|   140k|      uint8_t *dest_block = (vlblocks && context->vlblock_dests != NULL) ? context->vlblock_dests[j] : context->dest;
  ------------------
  |  Branch (2163:30): [True: 0, False: 140k]
  |  Branch (2163:42): [True: 0, False: 0]
  ------------------
 2164|   140k|      int32_t dest_offset = (vlblocks && context->vlblock_dests != NULL) ? 0 :
  ------------------
  |  Branch (2164:30): [True: 0, False: 140k]
  |  Branch (2164:42): [True: 0, False: 0]
  ------------------
 2165|   140k|                            (vlblocks ? context->blockoffsets[j] : j * context->blocksize);
  ------------------
  |  Branch (2165:30): [True: 0, False: 140k]
  ------------------
 2166|   140k|      cbytes = blosc_d(thread_context, bsize, leftoverblock, memcpyed,
 2167|   140k|                       context->src, context->srcsize, src_offset, j,
 2168|   140k|                       dest_block, dest_offset, tmp, tmp2);
 2169|   140k|    }
 2170|       |
 2171|   140k|    if (cbytes < 0) {
  ------------------
  |  Branch (2171:9): [True: 2.94k, False: 137k]
  ------------------
 2172|  2.94k|      ntbytes = cbytes;         /* error in blosc_c or blosc_d */
 2173|  2.94k|      break;
 2174|  2.94k|    }
 2175|   137k|    ntbytes += cbytes;
 2176|   137k|  }
 2177|       |
 2178|  3.10k|  return ntbytes;
 2179|  3.10k|}
blosc2.c:set_nans:
 1556|    267|static int32_t set_nans(int32_t typesize, uint8_t* dest, int32_t destsize) {
 1557|    267|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (1557:7): [True: 1, False: 266]
  ------------------
 1558|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1559|      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]
  |  |  ------------------
  ------------------
 1560|      1|  }
 1561|    266|  int32_t nitems = destsize / typesize;
 1562|    266|  if (nitems == 0) {
  ------------------
  |  Branch (1562:7): [True: 0, False: 266]
  ------------------
 1563|      0|    return 0;
 1564|      0|  }
 1565|       |
 1566|    266|  if (typesize == 4) {
  ------------------
  |  Branch (1566:7): [True: 177, False: 89]
  ------------------
 1567|    177|    float* dest_ = (float*)dest;
 1568|    177|    float val = nanf("");
 1569|  2.32k|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1569:21): [True: 2.15k, False: 177]
  ------------------
 1570|  2.15k|      dest_[i] = val;
 1571|  2.15k|    }
 1572|    177|    return nitems;
 1573|    177|  }
 1574|     89|  else if (typesize == 8) {
  ------------------
  |  Branch (1574:12): [True: 85, False: 4]
  ------------------
 1575|     85|    double* dest_ = (double*)dest;
 1576|     85|    double val = nan("");
 1577|    446|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1577:21): [True: 361, False: 85]
  ------------------
 1578|    361|      dest_[i] = val;
 1579|    361|    }
 1580|     85|    return nitems;
 1581|     85|  }
 1582|       |
 1583|      4|  BLOSC_TRACE_ERROR("Unsupported typesize for NaN");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1584|      4|  return BLOSC2_ERROR_DATA;
 1585|    266|}
blosc2.c:my_malloc:
  189|  9.37k|static uint8_t* my_malloc(size_t size) {
  190|  9.37k|  void* block = NULL;
  191|  9.37k|  int res = 0;
  192|       |  /* Keep aligned allocations valid under Valgrind and POSIX wrappers. */
  193|  9.37k|  if (size == 0) {
  ------------------
  |  Branch (193:7): [True: 0, False: 9.37k]
  ------------------
  194|      0|    size = 1;
  195|      0|  }
  196|       |
  197|       |/* Do an alignment to 32 bytes because AVX2 is supported */
  198|       |#if defined(_WIN32)
  199|       |  /* A (void *) cast needed for avoiding a warning with MINGW :-/ */
  200|       |  block = (void *)_aligned_malloc(size, 32);
  201|       |#elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600
  202|       |  /* Platform does have an implementation of posix_memalign */
  203|  9.37k|  res = posix_memalign(&block, 32, size);
  204|       |#else
  205|       |  block = malloc(size);
  206|       |#endif  /* _WIN32 */
  207|       |
  208|  9.37k|  if (block == NULL || res != 0) {
  ------------------
  |  Branch (208:7): [True: 0, False: 9.37k]
  |  Branch (208:24): [True: 0, False: 9.37k]
  ------------------
  209|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|      0|    return NULL;
  211|      0|  }
  212|       |
  213|  9.37k|  return (uint8_t*)block;
  214|  9.37k|}
blosc2.c:blosc_d:
 1663|   140k|    int32_t nblock, uint8_t* dest, int32_t dest_offset, uint8_t* tmp, uint8_t* tmp2) {
 1664|   140k|  blosc2_context* context = thread_context->parent_context;
 1665|   140k|  uint8_t* filters = context->filters;
 1666|   140k|  uint8_t *tmp3 = thread_context->tmp4;
 1667|   140k|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 1668|   140k|  int32_t compformat = (context->header_flags & (uint8_t)0xe0) >> 5u;
 1669|   140k|  int dont_split = (context->header_flags & 0x10) >> 4;
 1670|   140k|  int32_t chunk_nbytes;
 1671|   140k|  int32_t chunk_cbytes;
 1672|   140k|  int nstreams;
 1673|   140k|  int32_t neblock;
 1674|   140k|  int32_t nbytes;                /* number of decompressed bytes in split */
 1675|   140k|  int32_t cbytes;                /* number of compressed bytes in split */
 1676|       |  // int32_t ctbytes = 0;           /* number of compressed bytes in block */
 1677|   140k|  int32_t ntbytes = 0;           /* number of uncompressed bytes in block */
 1678|   140k|  uint8_t* _dest;
 1679|   140k|  int32_t typesize = context->typesize;
 1680|   140k|  bool instr_codec = context->blosc2_flags & BLOSC2_INSTR_CODEC;
 1681|   140k|  const char* compname;
 1682|   140k|  int rc;
 1683|       |
 1684|   140k|  if (context->block_maskout != NULL && context->block_maskout[nblock]) {
  ------------------
  |  Branch (1684:7): [True: 0, False: 140k]
  |  Branch (1684:41): [True: 0, False: 0]
  ------------------
 1685|       |    // Do not decompress, but act as if we successfully decompressed everything
 1686|      0|    return bsize;
 1687|      0|  }
 1688|       |
 1689|   140k|  rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 1690|   140k|  if (rc < 0) {
  ------------------
  |  Branch (1690:7): [True: 0, False: 140k]
  ------------------
 1691|      0|    return rc;
 1692|      0|  }
 1693|   140k|  if (context->special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (1693:7): [True: 0, False: 140k]
  ------------------
 1694|       |    // We need the actual typesize in this case, but it cannot be encoded in the header, so derive it from cbytes
 1695|      0|    typesize = chunk_cbytes - context->header_overhead;
 1696|      0|  }
 1697|       |
 1698|       |  // In some situations (lazychunks) the context can arrive uninitialized
 1699|       |  // (but BITSHUFFLE needs it for accessing the format of the chunk)
 1700|   140k|  if (context->src == NULL) {
  ------------------
  |  Branch (1700:7): [True: 0, False: 140k]
  ------------------
 1701|      0|    context->src = src;
 1702|      0|  }
 1703|       |
 1704|       |  // Chunks with special values cannot be lazy
 1705|   140k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (1705:19): [True: 138k, False: 1.88k]
  ------------------
 1706|   138k|          (context->blosc2_flags & 0x08u) && !context->special_type);
  ------------------
  |  Branch (1706:11): [True: 27, False: 138k]
  |  Branch (1706:46): [True: 0, False: 27]
  ------------------
 1707|   140k|  if (is_lazy) {
  ------------------
  |  Branch (1707:7): [True: 0, False: 140k]
  ------------------
 1708|       |    // The chunk is on disk, so just lazily load the block
 1709|      0|    if (context->schunk == NULL) {
  ------------------
  |  Branch (1709:9): [True: 0, False: 0]
  ------------------
 1710|      0|      BLOSC_TRACE_ERROR("Lazy chunk needs an associated super-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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1711|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 1712|      0|    }
 1713|      0|    if (context->schunk->frame == NULL) {
  ------------------
  |  Branch (1713:9): [True: 0, False: 0]
  ------------------
 1714|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1715|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 1716|      0|    }
 1717|      0|    blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 1718|      0|    char* urlpath = frame->urlpath;
 1719|      0|    size_t bstarts_nbytes;
 1720|      0|    size_t trailer_offset;
 1721|      0|    size_t block_csizes_nbytes;
 1722|      0|    size_t trailer_meta_nbytes;
 1723|      0|    size_t lazy_trailer_end;
 1724|      0|    if (srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (1724:9): [True: 0, False: 0]
  |  Branch (1724:24): [True: 0, False: 0]
  ------------------
 1725|      0|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (1725:9): [True: 0, False: 0]
  ------------------
 1726|      0|        !checked_add_size((size_t)BLOSC_EXTENDED_HEADER_LENGTH, bstarts_nbytes, &trailer_offset) ||
  ------------------
  |  Branch (1726:9): [True: 0, False: 0]
  ------------------
 1727|      0|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (1727:9): [True: 0, False: 0]
  ------------------
 1728|      0|        !checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (1728:9): [True: 0, False: 0]
  ------------------
 1729|      0|        !checked_add_size(trailer_offset, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (1729:9): [True: 0, False: 0]
  ------------------
 1730|      0|        (size_t)srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (1730:9): [True: 0, False: 0]
  ------------------
 1731|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1732|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1733|      0|    }
 1734|      0|    int32_t nchunk;
 1735|      0|    int64_t chunk_offset;
 1736|       |    // The nchunk and the offset of the current chunk are in the trailer
 1737|      0|    memcpy(&nchunk, src + trailer_offset, sizeof(nchunk));
 1738|      0|    memcpy(&chunk_offset, src + trailer_offset + sizeof(int32_t), sizeof(chunk_offset));
 1739|       |    // Get the csize of the nblock
 1740|      0|    if (nblock < 0 || nblock >= context->nblocks) {
  ------------------
  |  Branch (1740:9): [True: 0, False: 0]
  |  Branch (1740:23): [True: 0, False: 0]
  ------------------
 1741|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1742|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1743|      0|    }
 1744|      0|    int32_t *block_csizes = (int32_t *)(src + trailer_offset + sizeof(int32_t) + sizeof(int64_t));
 1745|      0|    int32_t block_csize = block_csizes[nblock];
 1746|      0|    int32_t max_lazy_block_csize = context->blocksize + context->typesize * (signed)sizeof(int32_t);
 1747|      0|    if (block_csize <= 0 || block_csize > max_lazy_block_csize) {
  ------------------
  |  Branch (1747:9): [True: 0, False: 0]
  |  Branch (1747:29): [True: 0, False: 0]
  ------------------
 1748|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1749|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1750|      0|    }
 1751|      0|    if (vlblocks && block_csize <= (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (1751:9): [True: 0, False: 0]
  |  Branch (1751:21): [True: 0, False: 0]
  ------------------
 1752|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1753|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1754|      0|    }
 1755|       |    // Read the lazy block on disk
 1756|      0|    void* fp = NULL;
 1757|      0|    blosc2_io_cb *io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 1758|      0|    if (io_cb == NULL) {
  ------------------
  |  Branch (1758:9): [True: 0, False: 0]
  ------------------
 1759|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1760|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 1761|      0|    }
 1762|       |
 1763|      0|    int64_t io_pos = 0;
 1764|      0|    if (frame->sframe) {
  ------------------
  |  Branch (1764:9): [True: 0, False: 0]
  ------------------
 1765|       |      // The chunk is not in the frame
 1766|      0|      fp = sframe_open_chunk(frame->urlpath, nchunk, "rb", context->schunk->storage->io);
 1767|      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]
  |  |  ------------------
  ------------------
 1768|       |      // The offset of the block is src_offset
 1769|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (1769:11): [True: 0, False: 0]
  ------------------
 1770|      0|        io_cb->close(fp);
 1771|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1772|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1773|      0|      }
 1774|      0|      io_pos = src_offset;
 1775|      0|    }
 1776|      0|    else {
 1777|      0|      fp = io_cb->open(urlpath, "rb", context->schunk->storage->io->params);
 1778|      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]
  |  |  ------------------
  ------------------
 1779|       |      // The offset of the block is src_offset
 1780|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (1780:11): [True: 0, False: 0]
  ------------------
 1781|      0|        io_cb->close(fp);
 1782|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1783|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1784|      0|      }
 1785|      0|      if (chunk_offset < 0) {
  ------------------
  |  Branch (1785:11): [True: 0, False: 0]
  ------------------
 1786|      0|        io_cb->close(fp);
 1787|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1788|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1789|      0|      }
 1790|      0|      if (frame->file_offset > INT64_MAX - chunk_offset) {
  ------------------
  |  Branch (1790:11): [True: 0, False: 0]
  ------------------
 1791|      0|        io_cb->close(fp);
 1792|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1793|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1794|      0|      }
 1795|      0|      io_pos = frame->file_offset + chunk_offset;
 1796|      0|      if (io_pos > INT64_MAX - src_offset) {
  ------------------
  |  Branch (1796:11): [True: 0, False: 0]
  ------------------
 1797|      0|        io_cb->close(fp);
 1798|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1799|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1800|      0|      }
 1801|      0|      io_pos += src_offset;
 1802|      0|    }
 1803|       |    // We can make use of tmp3 because it will be used after src is not needed anymore
 1804|      0|    int64_t rbytes = io_cb->read((void**)&tmp3, 1, block_csize, io_pos, fp);
 1805|      0|    io_cb->close(fp);
 1806|      0|    if ((int32_t)rbytes != block_csize) {
  ------------------
  |  Branch (1806:9): [True: 0, False: 0]
  ------------------
 1807|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1808|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1809|      0|    }
 1810|      0|    src = tmp3;
 1811|      0|    src_offset = 0;
 1812|      0|    srcsize = block_csize;
 1813|      0|  }
 1814|       |
 1815|       |  // If the chunk is memcpyed, we just have to copy the block to dest and return
 1816|   140k|  if (memcpyed) {
  ------------------
  |  Branch (1816:7): [True: 131k, False: 8.62k]
  ------------------
 1817|   131k|    int bsize_ = leftoverblock ? chunk_nbytes % context->blocksize : bsize;
  ------------------
  |  Branch (1817:18): [True: 10, False: 131k]
  ------------------
 1818|   131k|    if (!context->special_type) {
  ------------------
  |  Branch (1818:9): [True: 290, False: 131k]
  ------------------
 1819|    290|      if (chunk_nbytes + context->header_overhead != chunk_cbytes) {
  ------------------
  |  Branch (1819:11): [True: 0, False: 290]
  ------------------
 1820|      0|        return BLOSC2_ERROR_WRITE_BUFFER;
 1821|      0|      }
 1822|    290|      if (chunk_cbytes < context->header_overhead + (nblock * context->blocksize) + bsize_) {
  ------------------
  |  Branch (1822:11): [True: 0, False: 290]
  ------------------
 1823|       |        /* Not enough input to copy block */
 1824|      0|        return BLOSC2_ERROR_READ_BUFFER;
 1825|      0|      }
 1826|    290|    }
 1827|   131k|    if (!is_lazy) {
  ------------------
  |  Branch (1827:9): [True: 131k, False: 0]
  ------------------
 1828|   131k|      src += context->header_overhead + nblock * context->blocksize;
 1829|   131k|    }
 1830|   131k|    _dest = dest + dest_offset;
 1831|   131k|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (1831:9): [True: 0, False: 131k]
  ------------------
 1832|       |      // We are making use of a postfilter, so use a temp for destination
 1833|      0|      _dest = tmp;
 1834|      0|    }
 1835|   131k|    rc = 0;
 1836|   131k|    switch (context->special_type) {
 1837|      0|      case BLOSC2_SPECIAL_VALUE:
  ------------------
  |  Branch (1837:7): [True: 0, False: 131k]
  ------------------
 1838|       |        // All repeated values
 1839|      0|        rc = set_values(typesize, context->src, _dest, bsize_);
 1840|      0|        if (rc < 0) {
  ------------------
  |  Branch (1840:13): [True: 0, False: 0]
  ------------------
 1841|      0|          BLOSC_TRACE_ERROR("set_values 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1842|      0|          return BLOSC2_ERROR_DATA;
 1843|      0|        }
 1844|      0|        break;
 1845|    267|      case BLOSC2_SPECIAL_NAN:
  ------------------
  |  Branch (1845:7): [True: 267, False: 131k]
  ------------------
 1846|    267|        rc = set_nans(context->typesize, _dest, bsize_);
 1847|    267|        if (rc < 0) {
  ------------------
  |  Branch (1847:13): [True: 5, False: 262]
  ------------------
 1848|      5|          BLOSC_TRACE_ERROR("set_nans failed");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1849|      5|          return BLOSC2_ERROR_DATA;
 1850|      5|        }
 1851|    262|        break;
 1852|    262|      case BLOSC2_SPECIAL_ZERO:
  ------------------
  |  Branch (1852:7): [True: 0, False: 131k]
  ------------------
 1853|      0|        memset(_dest, 0, bsize_);
 1854|      0|        break;
 1855|   131k|      case BLOSC2_SPECIAL_UNINIT:
  ------------------
  |  Branch (1855:7): [True: 131k, False: 557]
  ------------------
 1856|       |        // We do nothing here
 1857|   131k|        break;
 1858|    290|      default:
  ------------------
  |  Branch (1858:7): [True: 290, False: 131k]
  ------------------
 1859|    290|        memcpy(_dest, src, bsize_);
 1860|   131k|    }
 1861|   131k|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (1861:9): [True: 0, False: 131k]
  ------------------
 1862|       |      // Create new postfilter parameters for this block (must be private for each thread)
 1863|      0|      blosc2_postfilter_params postparams;
 1864|      0|      memcpy(&postparams, context->postparams, sizeof(postparams));
 1865|      0|      postparams.input = tmp;
 1866|      0|      postparams.output = dest + dest_offset;
 1867|      0|      postparams.size = bsize;
 1868|      0|      postparams.typesize = typesize;
 1869|      0|      postparams.offset = nblock * context->blocksize;
 1870|      0|      postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (1870:27): [True: 0, False: 0]
  ------------------
 1871|      0|      postparams.nblock = nblock;
 1872|      0|      postparams.tid = thread_context->tid;
 1873|      0|      postparams.ttmp = thread_context->tmp;
 1874|      0|      postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 1875|      0|      postparams.ctx = context;
 1876|       |
 1877|       |      // Execute the postfilter (the processed block will be copied to dest)
 1878|      0|      if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (1878:11): [True: 0, False: 0]
  ------------------
 1879|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1880|      0|        return BLOSC2_ERROR_POSTFILTER;
 1881|      0|      }
 1882|      0|    }
 1883|   131k|    thread_context->zfp_cell_nitems = 0;
 1884|       |
 1885|   131k|    return bsize_;
 1886|   131k|  }
 1887|       |
 1888|  8.62k|  if (!is_lazy && (src_offset <= 0 || src_offset >= srcsize)) {
  ------------------
  |  Branch (1888:7): [True: 8.62k, False: 0]
  |  Branch (1888:20): [True: 86, False: 8.53k]
  |  Branch (1888:39): [True: 170, False: 8.36k]
  ------------------
 1889|       |    /* Invalid block src offset encountered */
 1890|    256|    return BLOSC2_ERROR_DATA;
 1891|    256|  }
 1892|       |
 1893|  8.36k|  src += src_offset;
 1894|  8.36k|  if (vlblocks) {
  ------------------
  |  Branch (1894:7): [True: 0, False: 8.36k]
  ------------------
 1895|      0|    if (context->blockcbytes == NULL || nblock >= context->nblocks ||
  ------------------
  |  Branch (1895:9): [True: 0, False: 0]
  |  Branch (1895:41): [True: 0, False: 0]
  ------------------
 1896|      0|        context->blockcbytes[nblock] <= (int32_t)sizeof(int32_t) ||
  ------------------
  |  Branch (1896:9): [True: 0, False: 0]
  ------------------
 1897|      0|        src_offset > srcsize - context->blockcbytes[nblock]) {
  ------------------
  |  Branch (1897:9): [True: 0, False: 0]
  ------------------
 1898|      0|      return BLOSC2_ERROR_DATA;
 1899|      0|    }
 1900|      0|    srcsize = context->blockcbytes[nblock];
 1901|      0|  }
 1902|  8.36k|  else {
 1903|  8.36k|    srcsize -= src_offset;
 1904|  8.36k|  }
 1905|       |
 1906|  8.36k|  int last_filter_index = last_filter(filters, 'd');
 1907|  8.36k|  if (instr_codec) {
  ------------------
  |  Branch (1907:7): [True: 907, False: 7.46k]
  ------------------
 1908|       |    // If instrumented, we don't want to run the filters
 1909|    907|    _dest = dest + dest_offset;
 1910|    907|  }
 1911|  7.46k|  else if (((last_filter_index >= 0) &&
  ------------------
  |  Branch (1911:13): [True: 7.15k, False: 305]
  ------------------
 1912|  7.15k|       (next_filter(filters, BLOSC2_MAX_FILTERS, 'd') != BLOSC_DELTA)) ||
  ------------------
  |  Branch (1912:8): [True: 5.14k, False: 2.01k]
  ------------------
 1913|  5.14k|    context->postfilter != NULL) {
  ------------------
  |  Branch (1913:5): [True: 0, False: 2.31k]
  ------------------
 1914|       |    // We are making use of some filter, so use a temp for destination
 1915|  5.14k|    _dest = tmp;
 1916|  5.14k|  }
 1917|  2.31k|  else {
 1918|       |    // If no filters, or only DELTA in pipeline
 1919|  2.31k|    _dest = dest + dest_offset;
 1920|  2.31k|  }
 1921|       |
 1922|       |  /* The number of compressed data streams for this block */
 1923|  8.36k|  if (vlblocks) {
  ------------------
  |  Branch (1923:7): [True: 0, False: 8.36k]
  ------------------
 1924|      0|    nstreams = 1;
 1925|      0|  }
 1926|  8.36k|  else if (!dont_split && !leftoverblock) {
  ------------------
  |  Branch (1926:12): [True: 2.84k, False: 5.52k]
  |  Branch (1926:27): [True: 2.82k, False: 16]
  ------------------
 1927|  2.82k|    nstreams = context->typesize;
 1928|  2.82k|  }
 1929|  5.54k|  else {
 1930|  5.54k|    nstreams = 1;
 1931|  5.54k|  }
 1932|       |
 1933|  8.36k|  neblock = bsize / nstreams;
 1934|  8.36k|  if (neblock == 0) {
  ------------------
  |  Branch (1934:7): [True: 0, False: 8.36k]
  ------------------
 1935|       |    /* Not enough space to output bytes */
 1936|      0|    BLOSC_ERROR(BLOSC2_ERROR_WRITE_BUFFER);
  ------------------
  |  |  111|      0|    do {                                            \
  |  |  112|      0|        int rc_ = (rc);                             \
  |  |  113|      0|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  114|      0|            char *error_msg = print_error(rc_);     \
  |  |  115|      0|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      0|            return rc_;                             \
  |  |  117|      0|        }                                           \
  |  |  118|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1937|      0|  }
 1938|  14.3k|  for (int j = 0; j < nstreams; j++) {
  ------------------
  |  Branch (1938:19): [True: 8.65k, False: 5.74k]
  ------------------
 1939|  8.65k|    if (vlblocks) {
  ------------------
  |  Branch (1939:9): [True: 0, False: 8.65k]
  ------------------
 1940|      0|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (1940:11): [True: 0, False: 0]
  ------------------
 1941|       |        /* Not enough input to read compressed bytes */
 1942|      0|        return BLOSC2_ERROR_READ_BUFFER;
 1943|      0|      }
 1944|      0|      neblock = sw32_(src);
 1945|      0|      if (neblock != bsize) {
  ------------------
  |  Branch (1945:11): [True: 0, False: 0]
  ------------------
 1946|      0|        return BLOSC2_ERROR_DATA;
 1947|      0|      }
 1948|      0|      src += sizeof(int32_t);
 1949|      0|      cbytes = srcsize - (int32_t)sizeof(int32_t);
 1950|      0|      srcsize = 0;
 1951|      0|    }
 1952|  8.65k|    else {
 1953|  8.65k|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (1953:11): [True: 1, False: 8.65k]
  ------------------
 1954|       |        /* Not enough input to read compressed size */
 1955|      1|        return BLOSC2_ERROR_READ_BUFFER;
 1956|      1|      }
 1957|  8.65k|      srcsize -= sizeof(int32_t);
 1958|  8.65k|      cbytes = sw32_(src);      /* amount of compressed bytes */
 1959|  8.65k|      if (cbytes > 0) {
  ------------------
  |  Branch (1959:11): [True: 7.39k, False: 1.26k]
  ------------------
 1960|  7.39k|        if (srcsize < cbytes) {
  ------------------
  |  Branch (1960:13): [True: 40, False: 7.35k]
  ------------------
 1961|       |          /* Not enough input to read compressed bytes */
 1962|     40|          return BLOSC2_ERROR_READ_BUFFER;
 1963|     40|        }
 1964|  7.35k|        srcsize -= cbytes;
 1965|  7.35k|      }
 1966|  8.61k|      src += sizeof(int32_t);
 1967|  8.61k|    }
 1968|       |    // ctbytes += (signed)sizeof(int32_t);
 1969|       |
 1970|       |    /* Uncompress */
 1971|  8.61k|    if (!vlblocks && cbytes == 0) {
  ------------------
  |  Branch (1971:9): [True: 8.61k, False: 0]
  |  Branch (1971:22): [True: 974, False: 7.64k]
  ------------------
 1972|       |      // A run of 0's
 1973|    974|      memset(_dest, 0, (unsigned int)neblock);
 1974|    974|      nbytes = neblock;
 1975|    974|    }
 1976|  7.64k|    else if (!vlblocks && cbytes < 0) {
  ------------------
  |  Branch (1976:14): [True: 7.64k, False: 0]
  |  Branch (1976:27): [True: 292, False: 7.35k]
  ------------------
 1977|       |      // A negative number means some encoding depending on the token that comes next
 1978|    292|      uint8_t token;
 1979|       |
 1980|    292|      if (srcsize < (signed)sizeof(uint8_t)) {
  ------------------
  |  Branch (1980:11): [True: 0, False: 292]
  ------------------
 1981|       |        // Not enough input to read token */
 1982|      0|        return BLOSC2_ERROR_READ_BUFFER;
 1983|      0|      }
 1984|    292|      srcsize -= sizeof(uint8_t);
 1985|       |
 1986|    292|      token = src[0];
 1987|    292|      src += 1;
 1988|       |      // ctbytes += 1;
 1989|       |
 1990|    292|      if (token & 0x1) {
  ------------------
  |  Branch (1990:11): [True: 284, False: 8]
  ------------------
 1991|       |        // A run of bytes that are different than 0
 1992|    284|        if (cbytes < -255) {
  ------------------
  |  Branch (1992:13): [True: 8, False: 276]
  ------------------
 1993|       |          // Runs can only encode a byte
 1994|      8|          return BLOSC2_ERROR_RUN_LENGTH;
 1995|      8|        }
 1996|    276|        uint8_t value = -cbytes;
 1997|    276|        memset(_dest, value, (unsigned int)neblock);
 1998|    276|      } else {
 1999|      8|        BLOSC_TRACE_ERROR("Invalid or unsupported compressed stream token value - %d", token);
  ------------------
  |  |   93|      8|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      8|    do {                                            \
  |  |  |  |   98|      8|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      8|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      8|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2000|      8|        return BLOSC2_ERROR_RUN_LENGTH;
 2001|      8|      }
 2002|    276|      nbytes = neblock;
 2003|    276|      cbytes = 0;  // everything is encoded in the cbytes token
 2004|    276|    }
 2005|  7.35k|    else if (cbytes == neblock) {
  ------------------
  |  Branch (2005:14): [True: 2.45k, False: 4.89k]
  ------------------
 2006|  2.45k|      memcpy(_dest, src, (unsigned int)neblock);
 2007|  2.45k|      nbytes = (int32_t)neblock;
 2008|  2.45k|    }
 2009|  4.89k|    else {
 2010|  4.89k|      if (compformat == BLOSC_BLOSCLZ_FORMAT) {
  ------------------
  |  Branch (2010:11): [True: 395, False: 4.50k]
  ------------------
 2011|    395|        nbytes = blosclz_decompress(src, cbytes, _dest, (int)neblock);
 2012|    395|      }
 2013|  4.50k|      else if (compformat == BLOSC_LZ4_FORMAT) {
  ------------------
  |  Branch (2013:16): [True: 398, False: 4.10k]
  ------------------
 2014|    398|        nbytes = lz4_wrap_decompress((char*)src, (size_t)cbytes,
 2015|    398|                                     (char*)_dest, (size_t)neblock,
 2016|    398|                                     thread_context);
 2017|    398|      }
 2018|  4.10k|  #if defined(HAVE_ZLIB)
 2019|  4.10k|      else if (compformat == BLOSC_ZLIB_FORMAT) {
  ------------------
  |  Branch (2019:16): [True: 398, False: 3.70k]
  ------------------
 2020|    398|        nbytes = zlib_wrap_decompress((char*)src, (size_t)cbytes,
 2021|    398|                                      (char*)_dest, (size_t)neblock);
 2022|    398|      }
 2023|  3.70k|  #endif /*  HAVE_ZLIB */
 2024|  3.70k|  #if defined(HAVE_ZSTD)
 2025|  3.70k|      else if (compformat == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2025:16): [True: 2.79k, False: 910]
  ------------------
 2026|  2.79k|        nbytes = zstd_wrap_decompress(thread_context,
 2027|  2.79k|                                      (char*)src, (size_t)cbytes,
 2028|  2.79k|                                      (char*)_dest, (size_t)neblock);
 2029|  2.79k|      }
 2030|    910|  #endif /*  HAVE_ZSTD */
 2031|    910|      else if (compformat == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (2031:16): [True: 909, False: 1]
  ------------------
 2032|    909|        bool getcell = false;
 2033|       |
 2034|    909|#if defined(HAVE_ZFP)
 2035|    909|        if ((context->compcode == BLOSC_CODEC_ZFP_FIXED_RATE) &&
  ------------------
  |  Branch (2035:13): [True: 0, False: 909]
  ------------------
 2036|      0|            (thread_context->zfp_cell_nitems > 0)) {
  ------------------
  |  Branch (2036:13): [True: 0, False: 0]
  ------------------
 2037|      0|          nbytes = zfp_getcell(thread_context, src, cbytes, _dest, neblock);
 2038|      0|          if (nbytes < 0) {
  ------------------
  |  Branch (2038:15): [True: 0, False: 0]
  ------------------
 2039|      0|            return BLOSC2_ERROR_DATA;
 2040|      0|          }
 2041|      0|          if (nbytes == thread_context->zfp_cell_nitems * typesize) {
  ------------------
  |  Branch (2041:15): [True: 0, False: 0]
  ------------------
 2042|      0|            getcell = true;
 2043|      0|          }
 2044|      0|        }
 2045|    909|#endif /* HAVE_ZFP */
 2046|    909|        if (!getcell) {
  ------------------
  |  Branch (2046:13): [True: 909, False: 0]
  ------------------
 2047|    909|          thread_context->zfp_cell_nitems = 0;
 2048|    937|          for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (2048:27): [True: 933, False: 4]
  ------------------
 2049|    933|            if (g_codecs[i].compcode == context->compcode) {
  ------------------
  |  Branch (2049:17): [True: 905, False: 28]
  ------------------
 2050|    905|              if (g_codecs[i].decoder == NULL) {
  ------------------
  |  Branch (2050:19): [True: 0, False: 905]
  ------------------
 2051|       |                // Dynamically load codec plugin
 2052|      0|                if (fill_codec(&g_codecs[i]) < 0) {
  ------------------
  |  Branch (2052:21): [True: 0, False: 0]
  ------------------
 2053|      0|                  BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2054|      0|                  return BLOSC2_ERROR_CODEC_SUPPORT;
 2055|      0|                }
 2056|      0|              }
 2057|    905|              blosc2_dparams dparams;
 2058|    905|              blosc2_ctx_get_dparams(context, &dparams);
 2059|    905|              nbytes = g_codecs[i].decoder(src,
 2060|    905|                                           cbytes,
 2061|    905|                                           _dest,
 2062|    905|                                           neblock,
 2063|    905|                                           context->compcode_meta,
 2064|    905|                                           &dparams,
 2065|    905|                                           context->src);
 2066|    905|              goto urcodecsuccess;
 2067|    905|            }
 2068|    933|          }
 2069|      4|          BLOSC_TRACE_ERROR("User-defined compressor codec %d not found during decompression", context->compcode);
  ------------------
  |  |   93|      4|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      4|    do {                                            \
  |  |  |  |   98|      4|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      4|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      4|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2070|      4|          return BLOSC2_ERROR_CODEC_SUPPORT;
 2071|    909|        }
 2072|    905|      urcodecsuccess:
 2073|    905|        ;
 2074|    905|      }
 2075|      1|      else {
 2076|      1|        compname = clibcode_to_clibname(compformat);
 2077|      1|        BLOSC_TRACE_ERROR(
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2078|      1|                "Blosc has not been compiled with decompression "
 2079|      1|                "support for '%s' format.  "
 2080|      1|                "Please recompile for adding this support.", compname);
 2081|      1|        return BLOSC2_ERROR_CODEC_SUPPORT;
 2082|      1|      }
 2083|       |
 2084|       |      /* Check that decompressed bytes number is correct */
 2085|  4.89k|      if ((nbytes != neblock) && (thread_context->zfp_cell_nitems == 0)) {
  ------------------
  |  Branch (2085:11): [True: 2.56k, False: 2.33k]
  |  Branch (2085:34): [True: 2.56k, False: 0]
  ------------------
 2086|  2.56k|        return BLOSC2_ERROR_DATA;
 2087|  2.56k|      }
 2088|       |
 2089|  4.89k|    }
 2090|  6.03k|    src += cbytes;
 2091|       |    // ctbytes += cbytes;
 2092|  6.03k|    _dest += nbytes;
 2093|  6.03k|    ntbytes += nbytes;
 2094|  6.03k|  } /* Closes j < nstreams */
 2095|       |
 2096|  5.74k|  if (!instr_codec) {
  ------------------
  |  Branch (2096:7): [True: 4.95k, False: 784]
  ------------------
 2097|  4.95k|    if (last_filter_index >= 0 || context->postfilter != NULL) {
  ------------------
  |  Branch (2097:9): [True: 4.80k, False: 154]
  |  Branch (2097:35): [True: 0, False: 154]
  ------------------
 2098|       |      /* Apply regular filter pipeline */
 2099|  4.80k|      int errcode = pipeline_backward(thread_context, bsize, dest, dest_offset, tmp, tmp2, tmp3,
 2100|  4.80k|                                      last_filter_index, nblock);
 2101|  4.80k|      if (errcode < 0)
  ------------------
  |  Branch (2101:11): [True: 60, False: 4.74k]
  ------------------
 2102|     60|        return errcode;
 2103|  4.80k|    }
 2104|  4.95k|  }
 2105|       |
 2106|       |  /* Return the number of uncompressed bytes */
 2107|  5.68k|  return (int)ntbytes;
 2108|  5.74k|}
blosc2.c:lz4_wrap_decompress:
  447|    398|                               struct thread_context* thread_context) {
  448|    398|  int nbytes;
  449|    398|  blosc2_context* context = thread_context->parent_context;
  450|    398|  if (context->use_dict && context->dict_buffer != NULL && context->dict_size > 0) {
  ------------------
  |  Branch (450:7): [True: 107, False: 291]
  |  Branch (450:28): [True: 107, False: 0]
  |  Branch (450:60): [True: 107, False: 0]
  ------------------
  451|    107|    nbytes = LZ4_decompress_safe_usingDict(input, output,
  452|    107|                                           (int)compressed_length, (int)maxout,
  453|    107|                                           (const char*)context->dict_buffer,
  454|    107|                                           (int)context->dict_size);
  455|    291|  } else {
  456|    291|    nbytes = LZ4_decompress_safe(input, output, (int)compressed_length, (int)maxout);
  457|    291|  }
  458|    398|  if (nbytes != (int)maxout) {
  ------------------
  |  Branch (458:7): [True: 264, False: 134]
  ------------------
  459|    264|    return 0;
  460|    264|  }
  461|    134|  return (int)maxout;
  462|    398|}
blosc2.c:zlib_wrap_decompress:
  486|    398|                                char* output, size_t maxout) {
  487|    398|  int status;
  488|    398|#if defined(HAVE_ZLIB_NG) && ! defined(ZLIB_COMPAT)
  489|    398|  size_t ul = maxout;
  490|    398|  status = zng_uncompress(
  491|    398|      (uint8_t*)output, &ul, (uint8_t*)input, compressed_length);
  492|       |#else
  493|       |  uLongf ul = (uLongf)maxout;
  494|       |  status = uncompress(
  495|       |      (Bytef*)output, &ul, (Bytef*)input, (uLong)compressed_length);
  496|       |#endif
  497|    398|  if (status != Z_OK) {
  ------------------
  |  |  180|    398|#define Z_OK            0
  ------------------
  |  Branch (497:7): [True: 398, False: 0]
  ------------------
  498|    398|    return 0;
  499|    398|  }
  500|      0|  return (int)ul;
  501|    398|}
blosc2.c:zstd_wrap_decompress:
  538|  2.79k|                                char* output, size_t maxout) {
  539|  2.79k|  size_t code;
  540|  2.79k|  blosc2_context* context = thread_context->parent_context;
  541|       |
  542|  2.79k|  if (thread_context->zstd_dctx == NULL) {
  ------------------
  |  Branch (542:7): [True: 1.86k, False: 935]
  ------------------
  543|  1.86k|    thread_context->zstd_dctx = ZSTD_createDCtx();
  544|  1.86k|  }
  545|       |
  546|  2.79k|  if (context->use_dict) {
  ------------------
  |  Branch (546:7): [True: 1.04k, False: 1.75k]
  ------------------
  547|  1.04k|    assert(context->dict_ddict != NULL);
  548|  1.04k|    code = ZSTD_decompress_usingDDict(
  549|  1.04k|            thread_context->zstd_dctx, (void*)output, maxout, (void*)input,
  550|  1.04k|            compressed_length, context->dict_ddict);
  551|  1.75k|  } else {
  552|  1.75k|    code = ZSTD_decompressDCtx(thread_context->zstd_dctx,
  553|  1.75k|        (void*)output, maxout, (void*)input, compressed_length);
  554|  1.75k|  }
  555|  2.79k|  if (ZSTD_isError(code) != ZSTD_error_no_error) {
  ------------------
  |  Branch (555:7): [True: 1.76k, False: 1.03k]
  ------------------
  556|  1.76k|    BLOSC_TRACE_ERROR("Error in ZSTD decompression: '%s'.  Giving up.",
  ------------------
  |  |   93|  1.76k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  1.76k|    do {                                            \
  |  |  |  |   98|  1.76k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  1.76k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1.76k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  1.76k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  557|  1.76k|                      ZDICT_getErrorName(code));
  558|  1.76k|    return 0;
  559|  1.76k|  }
  560|  1.03k|  return (int)code;
  561|  2.79k|}
blosc2.c:blosc2_initialize_context_from_header:
  806|  3.13k|static int blosc2_initialize_context_from_header(blosc2_context* context, blosc_header* header) {
  807|  3.13k|  context->header_flags = header->flags;
  808|  3.13k|  context->typesize = header->typesize;
  809|  3.13k|  context->sourcesize = header->nbytes;
  810|  3.13k|  context->header_blocksize = header->blocksize;
  811|  3.13k|  context->blocksize = header->blocksize;
  812|  3.13k|  context->blosc2_flags2 = header->blosc2_flags2;
  813|  3.13k|  context->blosc2_flags = header->blosc2_flags;
  814|  3.13k|  context->compcode = header->flags >> 5;
  815|  3.13k|  if (context->compcode == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (815:7): [True: 104, False: 3.03k]
  ------------------
  816|    104|    context->compcode = header->udcompcode;
  817|    104|  }
  818|  3.13k|  if (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) {
  ------------------
  |  Branch (818:7): [True: 14, False: 3.12k]
  ------------------
  819|     14|    context->nblocks = header->blocksize;
  820|     14|    context->leftover = 0;
  821|     14|    context->blocksize = 0;
  822|     14|  }
  823|  3.12k|  else {
  824|  3.12k|    blosc2_calculate_blocks(context);
  825|  3.12k|  }
  826|       |
  827|  3.13k|  bool is_lazy = false;
  828|  3.13k|  if ((context->header_flags & BLOSC_DOSHUFFLE) &&
  ------------------
  |  Branch (828:7): [True: 2.04k, False: 1.09k]
  ------------------
  829|  2.04k|      (context->header_flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (829:7): [True: 1.63k, False: 409]
  ------------------
  830|       |    /* Extended header */
  831|  1.63k|    context->header_overhead = BLOSC_EXTENDED_HEADER_LENGTH;
  832|       |
  833|  1.63k|    memcpy(context->filters, header->filters, BLOSC2_MAX_FILTERS);
  834|  1.63k|    memcpy(context->filters_meta, header->filters_meta, BLOSC2_MAX_FILTERS);
  835|  1.63k|    context->compcode_meta = header->compcode_meta;
  836|       |
  837|  1.63k|    context->filter_flags = filters_to_flags(header->filters);
  838|  1.63k|    context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  839|       |
  840|  1.63k|    is_lazy = (context->blosc2_flags & 0x08u);
  841|  1.63k|  }
  842|  1.50k|  else {
  843|  1.50k|    context->header_overhead = BLOSC_MIN_HEADER_LENGTH;
  844|  1.50k|    context->filter_flags = get_filter_flags(context->header_flags, context->typesize);
  845|  1.50k|    flags_to_filters(context->header_flags, context->filters);
  846|  1.50k|  }
  847|       |
  848|       |  // Some checks for malformed headers
  849|  3.13k|  if (!is_lazy && header->cbytes > context->srcsize) {
  ------------------
  |  Branch (849:7): [True: 3.12k, False: 9]
  |  Branch (849:19): [True: 0, False: 3.12k]
  ------------------
  850|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  851|      0|  }
  852|       |
  853|  3.13k|  return 0;
  854|  3.13k|}
blosc2.c:get_filter_flags:
  648|  1.50k|                                const int32_t typesize) {
  649|  1.50k|  uint8_t flags = 0;
  650|       |
  651|  1.50k|  if ((header_flags & BLOSC_DOSHUFFLE) && (typesize > 1)) {
  ------------------
  |  Branch (651:7): [True: 409, False: 1.09k]
  |  Branch (651:43): [True: 76, False: 333]
  ------------------
  652|     76|    flags |= BLOSC_DOSHUFFLE;
  653|     76|  }
  654|  1.50k|  if (header_flags & BLOSC_DOBITSHUFFLE) {
  ------------------
  |  Branch (654:7): [True: 507, False: 1.00k]
  ------------------
  655|    507|    flags |= BLOSC_DOBITSHUFFLE;
  656|    507|  }
  657|  1.50k|  if (header_flags & BLOSC_DODELTA) {
  ------------------
  |  Branch (657:7): [True: 706, False: 801]
  ------------------
  658|    706|    flags |= BLOSC_DODELTA;
  659|    706|  }
  660|  1.50k|  if (header_flags & BLOSC_MEMCPYED) {
  ------------------
  |  Branch (660:7): [True: 10, False: 1.49k]
  ------------------
  661|     10|    flags |= BLOSC_MEMCPYED;
  662|     10|  }
  663|  1.50k|  return flags;
  664|  1.50k|}
blosc2.c:create_thread_context:
 2215|  3.10k|create_thread_context(blosc2_context* context, int32_t tid) {
 2216|  3.10k|  struct thread_context* thread_context;
 2217|  3.10k|  thread_context = (struct thread_context*)my_malloc(sizeof(struct thread_context));
 2218|  3.10k|  BLOSC_ERROR_NULL(thread_context, NULL);
  ------------------
  |  |  104|  3.10k|    do {                                            \
  |  |  105|  3.10k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 3.10k]
  |  |  ------------------
  |  |  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|  3.10k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 3.10k]
  |  |  ------------------
  ------------------
 2219|  3.10k|  int rc = init_thread_context(thread_context, context, tid);
 2220|  3.10k|  if (rc < 0) {
  ------------------
  |  Branch (2220:7): [True: 0, False: 3.10k]
  ------------------
 2221|      0|    return NULL;
 2222|      0|  }
 2223|  3.10k|  return thread_context;
 2224|  3.10k|}
blosc2.c:init_thread_context:
 2185|  3.10k|{
 2186|  3.10k|  int32_t ebsize;
 2187|       |
 2188|  3.10k|  thread_context->parent_context = context;
 2189|  3.10k|  thread_context->owner_pool = NULL;
 2190|  3.10k|  thread_context->tid = tid;
 2191|       |
 2192|  3.10k|  int32_t blocksize = context != NULL ? context->blocksize : 0;
  ------------------
  |  Branch (2192:23): [True: 3.10k, False: 0]
  ------------------
 2193|  3.10k|  int32_t typesize = context != NULL ? context->typesize : 0;
  ------------------
  |  Branch (2193:22): [True: 3.10k, False: 0]
  ------------------
 2194|  3.10k|  ebsize = blocksize + typesize * (signed)sizeof(int32_t);
 2195|  3.10k|  thread_context->tmp_nbytes = (size_t)4 * ebsize;
 2196|  3.10k|  thread_context->tmp = my_malloc(thread_context->tmp_nbytes);
 2197|  3.10k|  BLOSC_ERROR_NULL(thread_context->tmp, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|  3.10k|    do {                                            \
  |  |  105|  3.10k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 3.10k]
  |  |  ------------------
  |  |  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|  3.10k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 3.10k]
  |  |  ------------------
  ------------------
 2198|  3.10k|  thread_context->tmp2 = thread_context->tmp + ebsize;
 2199|  3.10k|  thread_context->tmp3 = thread_context->tmp2 + ebsize;
 2200|  3.10k|  thread_context->tmp4 = thread_context->tmp3 + ebsize;
 2201|  3.10k|  thread_context->tmp_blocksize = blocksize;
 2202|  3.10k|  thread_context->zfp_cell_nitems = 0;
 2203|  3.10k|  thread_context->zfp_cell_start = 0;
 2204|  3.10k|  #if defined(HAVE_ZSTD)
 2205|  3.10k|  thread_context->zstd_cctx = NULL;
 2206|  3.10k|  thread_context->zstd_dctx = NULL;
 2207|  3.10k|  #endif
 2208|  3.10k|  thread_context->lz4_cstream = NULL;
 2209|  3.10k|  thread_context->lz4hc_cstream = NULL;
 2210|       |
 2211|  3.10k|  return 0;
 2212|  3.10k|}
blosc2.c:release_thread_backend:
 5152|  3.16k|static int release_thread_backend(blosc2_context *context) {
 5153|  3.16k|  if (context->thread_backend == BLOSC_BACKEND_CALLBACK && context->threads_started > 0) {
  ------------------
  |  |   34|  6.32k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (5153:7): [True: 0, False: 3.16k]
  |  Branch (5153:60): [True: 0, False: 0]
  ------------------
 5154|      0|    for (int32_t t = 0; t < context->threads_started; t++) {
  ------------------
  |  Branch (5154:25): [True: 0, False: 0]
  ------------------
 5155|      0|      destroy_thread_context(context->thread_contexts + t);
 5156|      0|    }
 5157|      0|    my_free(context->thread_contexts);
 5158|      0|    context->thread_contexts = NULL;
 5159|      0|    blosc2_pthread_mutex_destroy(&context->count_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5160|      0|    blosc2_pthread_mutex_destroy(&context->delta_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5161|      0|    blosc2_pthread_cond_destroy(&context->delta_cv);
  ------------------
  |  |   97|      0|#define blosc2_pthread_cond_destroy(a) pthread_cond_destroy((a))
  ------------------
 5162|      0|  }
 5163|       |#if defined(_WIN32)
 5164|       |  else if (context->thread_backend == BLOSC_BACKEND_PER_CONTEXT && context->threads_started > 0) {
 5165|       |    /* Signal all workers to exit. */
 5166|       |    blosc2_pthread_mutex_lock(&context->jobs_mutex);
 5167|       |    context->end_threads = 1;
 5168|       |    blosc2_pthread_cond_broadcast(&context->jobs_ready);
 5169|       |    blosc2_pthread_mutex_unlock(&context->jobs_mutex);
 5170|       |
 5171|       |    for (int32_t t = 0; t < context->threads_started; t++) {
 5172|       |      blosc2_pthread_join(context->threads[t], NULL);
 5173|       |    }
 5174|       |    my_free(context->threads);
 5175|       |    context->threads = NULL;
 5176|       |    blosc2_pthread_cond_destroy(&context->jobs_done);
 5177|       |    blosc2_pthread_cond_destroy(&context->jobs_ready);
 5178|       |    blosc2_pthread_mutex_destroy(&context->jobs_mutex);
 5179|       |    blosc2_pthread_cond_destroy(&context->delta_cv);
 5180|       |    blosc2_pthread_mutex_destroy(&context->delta_mutex);
 5181|       |    blosc2_pthread_mutex_destroy(&context->count_mutex);
 5182|       |  }
 5183|       |#endif  /* _WIN32 */
 5184|  3.16k|  else if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL && context->thread_pool != NULL) {
  ------------------
  |  |   33|  6.32k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (5184:12): [True: 0, False: 3.16k]
  |  Branch (5184:68): [True: 0, False: 0]
  ------------------
 5185|      0|    struct blosc_shared_pool *pool = context->thread_pool;
 5186|      0|    struct blosc_shared_pool **prev;
 5187|      0|    bool destroy_pool = false;
 5188|       |
 5189|      0|    if (context->pool_epoch != g_destroy_count) {
  ------------------
  |  Branch (5189:9): [True: 0, False: 0]
  ------------------
 5190|       |      /* blosc2_destroy() already freed this pool and tore down pool_registry_mutex.
 5191|       |       * Just clear the dangling pointer; nothing else to do. */
 5192|      0|      context->thread_pool = NULL;
 5193|      0|      context->threads_started = 0;
 5194|      0|      context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 5195|      0|      return 0;
 5196|      0|    }
 5197|       |
 5198|      0|    blosc2_pthread_mutex_lock(&pool_registry_mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5199|      0|    pool->context_refs--;
 5200|      0|    if (pool->context_refs == 0) {
  ------------------
  |  Branch (5200:9): [True: 0, False: 0]
  ------------------
 5201|       |      /* Check pool-internal state under the pool's own mutex */
 5202|      0|      blosc2_pthread_mutex_lock(&pool->mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5203|      0|      bool idle = (pool->active_jobs == 0 && pool->job_queue_head == NULL);
  ------------------
  |  Branch (5203:20): [True: 0, False: 0]
  |  Branch (5203:46): [True: 0, False: 0]
  ------------------
 5204|      0|      blosc2_pthread_mutex_unlock(&pool->mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5205|      0|      if (idle) {
  ------------------
  |  Branch (5205:11): [True: 0, False: 0]
  ------------------
 5206|      0|        prev = &shared_pools;
 5207|      0|        while (*prev != NULL && *prev != pool) {
  ------------------
  |  Branch (5207:16): [True: 0, False: 0]
  |  Branch (5207:33): [True: 0, False: 0]
  ------------------
 5208|      0|          prev = &(*prev)->next;
 5209|      0|        }
 5210|      0|        if (*prev == pool) {
  ------------------
  |  Branch (5210:13): [True: 0, False: 0]
  ------------------
 5211|      0|          *prev = pool->next;
 5212|      0|        }
 5213|      0|        destroy_pool = true;
 5214|      0|      }
 5215|      0|    }
 5216|      0|    blosc2_pthread_mutex_unlock(&pool_registry_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5217|      0|    if (destroy_pool) {
  ------------------
  |  Branch (5217:9): [True: 0, False: 0]
  ------------------
 5218|      0|      destroy_shared_pool(pool);
 5219|      0|    }
 5220|      0|    context->thread_pool = NULL;
 5221|      0|  }
 5222|       |
 5223|  3.16k|  context->threads_started = 0;
 5224|  3.16k|  context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|  3.16k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 5225|  3.16k|  return 0;
 5226|  3.16k|}
blosc2.c:release_context_dict_buffer:
 2486|  6.30k|static void release_context_dict_buffer(blosc2_context* context) {
 2487|  6.30k|  if (context->dict_buffer_owned && context->dict_buffer != NULL) {
  ------------------
  |  Branch (2487:7): [True: 0, False: 6.30k]
  |  Branch (2487:37): [True: 0, False: 0]
  ------------------
 2488|      0|    free(context->dict_buffer);
 2489|      0|  }
 2490|  6.30k|  context->dict_buffer = NULL;
 2491|       |  context->dict_buffer_owned = false;
 2492|  6.30k|  context->dict_size = 0;
 2493|  6.30k|}

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

delta_decoder:
   97|  9.09k|                   int32_t typesize, uint8_t* dest) {
   98|  9.09k|  int32_t i;
   99|       |
  100|  9.09k|  if (offset == 0) {
  ------------------
  |  Branch (100:7): [True: 919, False: 8.17k]
  ------------------
  101|       |    /* Decode delta for the reference block */
  102|    919|    switch (typesize) {
  103|    289|      case 1:
  ------------------
  |  Branch (103:7): [True: 289, False: 630]
  ------------------
  104|  8.42M|        for (i = 1; i < nbytes; i++) {
  ------------------
  |  Branch (104:21): [True: 8.41M, False: 289]
  ------------------
  105|  8.41M|          dest[i] ^= dref[i-1];
  106|  8.41M|        }
  107|    289|        break;
  108|     77|      case 2:
  ------------------
  |  Branch (108:7): [True: 77, False: 842]
  ------------------
  109|  2.69M|        for (i = 1; i < nbytes / 2; i++) {
  ------------------
  |  Branch (109:21): [True: 2.69M, False: 77]
  ------------------
  110|  2.69M|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i-1];
  111|  2.69M|        }
  112|     77|        break;
  113|     68|      case 4:
  ------------------
  |  Branch (113:7): [True: 68, False: 851]
  ------------------
  114|   574k|        for (i = 1; i < nbytes / 4; i++) {
  ------------------
  |  Branch (114:21): [True: 574k, False: 68]
  ------------------
  115|   574k|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i-1];
  116|   574k|        }
  117|     68|        break;
  118|    186|      case 8:
  ------------------
  |  Branch (118:7): [True: 186, False: 733]
  ------------------
  119|   894k|        for (i = 1; i < nbytes / 8; i++) {
  ------------------
  |  Branch (119:21): [True: 894k, False: 186]
  ------------------
  120|   894k|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i-1];
  121|   894k|        }
  122|    186|        break;
  123|    299|      default:
  ------------------
  |  Branch (123:7): [True: 299, False: 620]
  ------------------
  124|    299|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (124:13): [True: 108, False: 191]
  ------------------
  125|    108|          delta_decoder(dref, offset, nbytes, 8, dest);
  126|    191|        } else {
  127|    191|          delta_decoder(dref, offset, nbytes, 1, dest);
  128|    191|        }
  129|    919|    }
  130|  8.17k|  } else {
  131|       |    /* Decode delta for the non-reference blocks */
  132|  8.17k|    switch (typesize) {
  133|  2.81k|      case 1:
  ------------------
  |  Branch (133:7): [True: 2.81k, False: 5.35k]
  ------------------
  134|  1.50M|        for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (134:21): [True: 1.50M, False: 2.81k]
  ------------------
  135|  1.50M|          dest[i] ^= dref[i];
  136|  1.50M|        }
  137|  2.81k|        break;
  138|    737|      case 2:
  ------------------
  |  Branch (138:7): [True: 737, False: 7.43k]
  ------------------
  139|  1.22M|        for (i = 0; i < nbytes / 2; i++) {
  ------------------
  |  Branch (139:21): [True: 1.22M, False: 737]
  ------------------
  140|  1.22M|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i];
  141|  1.22M|        }
  142|    737|        break;
  143|    766|      case 4:
  ------------------
  |  Branch (143:7): [True: 766, False: 7.40k]
  ------------------
  144|   360k|        for (i = 0; i < nbytes / 4; i++) {
  ------------------
  |  Branch (144:21): [True: 359k, False: 766]
  ------------------
  145|   359k|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i];
  146|   359k|        }
  147|    766|        break;
  148|  1.35k|      case 8:
  ------------------
  |  Branch (148:7): [True: 1.35k, False: 6.82k]
  ------------------
  149|   188k|        for (i = 0; i < nbytes / 8; i++) {
  ------------------
  |  Branch (149:21): [True: 187k, False: 1.35k]
  ------------------
  150|   187k|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i];
  151|   187k|        }
  152|  1.35k|        break;
  153|  2.49k|      default:
  ------------------
  |  Branch (153:7): [True: 2.49k, False: 5.67k]
  ------------------
  154|  2.49k|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (154:13): [True: 493, False: 2.00k]
  ------------------
  155|    493|          delta_decoder(dref, offset, nbytes, 8, dest);
  156|  2.00k|        } else {
  157|  2.00k|          delta_decoder(dref, offset, nbytes, 1, dest);
  158|  2.00k|        }
  159|  8.17k|    }
  160|  8.17k|  }
  161|  9.09k|}

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

unshuffle_avx2:
  784|  4.62k|               const uint8_t *_src, uint8_t *_dest) {
  785|  4.62k|  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|  4.62k|  if (blocksize < vectorized_chunk_size) {
  ------------------
  |  Branch (789:7): [True: 3.99k, False: 623]
  ------------------
  790|  3.99k|    unshuffle_generic(bytesoftype, blocksize, _src, _dest);
  791|  3.99k|    return;
  792|  3.99k|  }
  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|    623|  const int32_t vectorizable_bytes = blocksize - (blocksize % vectorized_chunk_size);
  800|       |
  801|    623|  const int32_t vectorizable_elements = vectorizable_bytes / bytesoftype;
  802|    623|  const int32_t total_elements = blocksize / bytesoftype;
  803|       |
  804|       |  /* Optimized unshuffle implementations */
  805|    623|  switch (bytesoftype) {
  806|    151|    case 2:
  ------------------
  |  Branch (806:5): [True: 151, False: 472]
  ------------------
  807|    151|      unshuffle2_avx2(_dest, _src, vectorizable_elements, total_elements);
  808|    151|      break;
  809|    107|    case 4:
  ------------------
  |  Branch (809:5): [True: 107, False: 516]
  ------------------
  810|    107|      unshuffle4_avx2(_dest, _src, vectorizable_elements, total_elements);
  811|    107|      break;
  812|    100|    case 8:
  ------------------
  |  Branch (812:5): [True: 100, False: 523]
  ------------------
  813|    100|      unshuffle8_avx2(_dest, _src, vectorizable_elements, total_elements);
  814|    100|      break;
  815|     40|    case 12:
  ------------------
  |  Branch (815:5): [True: 40, False: 583]
  ------------------
  816|     40|      unshuffle12_avx2(_dest, _src, vectorizable_elements, total_elements);
  817|     40|      break;
  818|     23|    case 16:
  ------------------
  |  Branch (818:5): [True: 23, False: 600]
  ------------------
  819|     23|      unshuffle16_avx2(_dest, _src, vectorizable_elements, total_elements);
  820|     23|      break;
  821|    202|    default:
  ------------------
  |  Branch (821:5): [True: 202, False: 421]
  ------------------
  822|       |      /* For types larger than 16 bytes, use the AVX2 tiled unshuffle. */
  823|    202|      if (bytesoftype > (int32_t)sizeof(__m128i)) {
  ------------------
  |  Branch (823:11): [True: 57, False: 145]
  ------------------
  824|     57|        unshuffle16_tiled_avx2(_dest, _src, vectorizable_elements, total_elements, bytesoftype);
  825|     57|      }
  826|    145|      else {
  827|       |        /* Non-optimized unshuffle */
  828|    145|        unshuffle_generic(bytesoftype, blocksize, _src, _dest);
  829|       |        /* The non-optimized function covers the whole buffer,
  830|       |           so we're done processing here. */
  831|    145|        return;
  832|    145|      }
  833|    623|  }
  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|    478|  if (vectorizable_bytes < blocksize) {
  ------------------
  |  Branch (838:7): [True: 340, False: 138]
  ------------------
  839|    340|    unshuffle_generic_inline(bytesoftype, vectorizable_bytes, blocksize, _src, _dest);
  840|    340|  }
  841|    478|}
shuffle-avx2.c:unshuffle2_avx2:
  338|    151|                const int32_t vectorizable_elements, const int32_t total_elements) {
  339|    151|  static const int32_t bytesoftype = 2;
  340|    151|  int32_t i;
  341|    151|  int j;
  342|    151|  __m256i ymm0[2], ymm1[2];
  343|       |
  344|  6.72k|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (344:15): [True: 6.57k, False: 151]
  ------------------
  345|       |    /* Load 32 elements (64 bytes) into 2 YMM registers. */
  346|  6.57k|    const uint8_t* const src_for_ith_element = src + i;
  347|  19.7k|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (347:17): [True: 13.1k, False: 6.57k]
  ------------------
  348|  13.1k|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  349|  13.1k|    }
  350|       |    /* Shuffle bytes */
  351|  19.7k|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (351:17): [True: 13.1k, False: 6.57k]
  ------------------
  352|  13.1k|      ymm0[j] = _mm256_permute4x64_epi64(ymm0[j], 0xd8);
  353|  13.1k|    }
  354|       |    /* Compute the low 64 bytes */
  355|  6.57k|    ymm1[0] = _mm256_unpacklo_epi8(ymm0[0], ymm0[1]);
  356|       |    /* Compute the hi 64 bytes */
  357|  6.57k|    ymm1[1] = _mm256_unpackhi_epi8(ymm0[0], ymm0[1]);
  358|       |    /* Store the result vectors in proper order */
  359|  6.57k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * sizeof(__m256i))), ymm1[0]);
  360|  6.57k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * sizeof(__m256i))), ymm1[1]);
  361|  6.57k|  }
  362|    151|}
shuffle-avx2.c:unshuffle4_avx2:
  367|    107|                const int32_t vectorizable_elements, const int32_t total_elements) {
  368|    107|  static const int32_t bytesoftype = 4;
  369|    107|  int32_t i;
  370|    107|  int j;
  371|    107|  __m256i ymm0[4], ymm1[4];
  372|       |
  373|  1.45k|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (373:15): [True: 1.35k, False: 107]
  ------------------
  374|       |    /* Load 32 elements (128 bytes) into 4 YMM registers. */
  375|  1.35k|    const uint8_t* const src_for_ith_element = src + i;
  376|  6.75k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (376:17): [True: 5.40k, False: 1.35k]
  ------------------
  377|  5.40k|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  378|  5.40k|    }
  379|       |    /* Shuffle bytes */
  380|  4.05k|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (380:17): [True: 2.70k, False: 1.35k]
  ------------------
  381|       |      /* Compute the low 64 bytes */
  382|  2.70k|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  383|       |      /* Compute the hi 64 bytes */
  384|  2.70k|      ymm1[2 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  385|  2.70k|    }
  386|       |    /* Shuffle 2-byte words */
  387|  4.05k|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (387:17): [True: 2.70k, False: 1.35k]
  ------------------
  388|       |      /* Compute the low 64 bytes */
  389|  2.70k|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  390|       |      /* Compute the hi 64 bytes */
  391|  2.70k|      ymm0[2 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  392|  2.70k|    }
  393|  1.35k|    ymm1[0] = _mm256_permute2x128_si256(ymm0[0], ymm0[2], 0x20);
  394|  1.35k|    ymm1[1] = _mm256_permute2x128_si256(ymm0[1], ymm0[3], 0x20);
  395|  1.35k|    ymm1[2] = _mm256_permute2x128_si256(ymm0[0], ymm0[2], 0x31);
  396|  1.35k|    ymm1[3] = _mm256_permute2x128_si256(ymm0[1], ymm0[3], 0x31);
  397|       |
  398|       |    /* Store the result vectors in proper order */
  399|  6.75k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (399:17): [True: 5.40k, False: 1.35k]
  ------------------
  400|  5.40k|      _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (j * sizeof(__m256i))), ymm1[j]);
  401|  5.40k|    }
  402|  1.35k|  }
  403|    107|}
shuffle-avx2.c:unshuffle8_avx2:
  408|    100|                const int32_t vectorizable_elements, const int32_t total_elements) {
  409|    100|  static const int32_t bytesoftype = 8;
  410|    100|  int32_t i;
  411|    100|  int j;
  412|    100|  __m256i ymm0[8], ymm1[8];
  413|       |
  414|  3.33k|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (414:15): [True: 3.23k, False: 100]
  ------------------
  415|       |    /* Fetch 32 elements (256 bytes) into 8 YMM registers. */
  416|  3.23k|    const uint8_t* const src_for_ith_element = src + i;
  417|  29.0k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (417:17): [True: 25.8k, False: 3.23k]
  ------------------
  418|  25.8k|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  419|  25.8k|    }
  420|       |    /* Shuffle bytes */
  421|  16.1k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (421:17): [True: 12.9k, False: 3.23k]
  ------------------
  422|       |      /* Compute the low 32 bytes */
  423|  12.9k|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  424|       |      /* Compute the hi 32 bytes */
  425|  12.9k|      ymm1[4 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  426|  12.9k|    }
  427|       |    /* Shuffle words */
  428|  16.1k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (428:17): [True: 12.9k, False: 3.23k]
  ------------------
  429|       |      /* Compute the low 32 bytes */
  430|  12.9k|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  431|       |      /* Compute the hi 32 bytes */
  432|  12.9k|      ymm0[4 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  433|  12.9k|    }
  434|  29.0k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (434:17): [True: 25.8k, False: 3.23k]
  ------------------
  435|  25.8k|      ymm0[j] = _mm256_permute4x64_epi64(ymm0[j], 0xd8);
  436|  25.8k|    }
  437|       |
  438|       |    /* Shuffle 4-byte dwords */
  439|  16.1k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (439:17): [True: 12.9k, False: 3.23k]
  ------------------
  440|       |      /* Compute the low 32 bytes */
  441|  12.9k|      ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  442|       |      /* Compute the hi 32 bytes */
  443|  12.9k|      ymm1[4 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  444|  12.9k|    }
  445|       |
  446|       |    /* Store the result vectors in proper order */
  447|  3.23k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * sizeof(__m256i))), ymm1[0]);
  448|  3.23k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * sizeof(__m256i))), ymm1[2]);
  449|  3.23k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (2 * sizeof(__m256i))), ymm1[1]);
  450|  3.23k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (3 * sizeof(__m256i))), ymm1[3]);
  451|  3.23k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (4 * sizeof(__m256i))), ymm1[4]);
  452|  3.23k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (5 * sizeof(__m256i))), ymm1[6]);
  453|  3.23k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (6 * sizeof(__m256i))), ymm1[5]);
  454|  3.23k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (7 * sizeof(__m256i))), ymm1[7]);
  455|  3.23k|  }
  456|    100|}
shuffle-avx2.c:unshuffle12_avx2:
  533|     40|    const int32_t vectorizable_elements, const int32_t total_elements) {
  534|     40|  static const int32_t bytesoftype = 12;
  535|     40|  int32_t i;
  536|     40|  int j;
  537|     40|  __m256i ymm0[16], ymm1[16];
  538|       |
  539|     40|  __m256i permute = _mm256_set_epi32(0,0,6,5,4,2,1,0);
  540|     40|  __m256i store_mask = _mm256_set_epi32(0x0, 0x0, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
  541|     40|  int32_t jump = 2*bytesoftype;
  542|    642|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (542:15): [True: 602, False: 40]
  ------------------
  543|       |    /* Fetch 24 elements (384 bytes) into 12 YMM registers. */
  544|    602|    const uint8_t* const src_for_ith_element = src + i;
  545|  7.82k|    for (j = 0; j < bytesoftype; j++) {
  ------------------
  |  Branch (545:17): [True: 7.22k, False: 602]
  ------------------
  546|  7.22k|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  547|  7.22k|    }
  548|       |    /* Initialize the last 4 registers (128 bytes) to null */
  549|  3.01k|    for (j = bytesoftype; j < 16; j++) {
  ------------------
  |  Branch (549:27): [True: 2.40k, False: 602]
  ------------------
  550|  2.40k|      ymm0[j] = _mm256_setzero_si256();
  551|  2.40k|    }
  552|       |
  553|       |    /* Shuffle bytes */
  554|  5.41k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (554:17): [True: 4.81k, False: 602]
  ------------------
  555|       |      /* Compute the low 32 bytes */
  556|  4.81k|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  557|       |      /* Compute the hi 32 bytes */
  558|  4.81k|      ymm1[8 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  559|  4.81k|    }
  560|       |    /* Shuffle 2-byte words */
  561|  5.41k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (561:17): [True: 4.81k, False: 602]
  ------------------
  562|       |      /* Compute the low 32 bytes */
  563|  4.81k|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  564|       |      /* Compute the hi 32 bytes */
  565|  4.81k|      ymm0[8 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  566|  4.81k|    }
  567|       |    /* Shuffle 4-byte dwords */
  568|  5.41k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (568:17): [True: 4.81k, False: 602]
  ------------------
  569|       |      /* Compute the low 32 bytes */
  570|  4.81k|      ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  571|       |      /* Compute the hi 32 bytes */
  572|  4.81k|      ymm1[8 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  573|  4.81k|    }
  574|       |
  575|       |    /* Shuffle 8-byte qwords */
  576|  5.41k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (576:17): [True: 4.81k, False: 602]
  ------------------
  577|       |      /* Compute the low 32 bytes */
  578|  4.81k|      ymm0[j] = _mm256_unpacklo_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  579|       |      /* Compute the hi 32 bytes */
  580|  4.81k|      ymm0[8 + j] = _mm256_unpackhi_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  581|  4.81k|    }
  582|       |
  583|       |
  584|  5.41k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (584:17): [True: 4.81k, False: 602]
  ------------------
  585|  4.81k|      ymm1[j] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x20);
  586|  4.81k|      ymm1[j + 8] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x31);
  587|  4.81k|      ymm1[j] = _mm256_permutevar8x32_epi32(ymm1[j], permute);
  588|  4.81k|      ymm1[j+8] = _mm256_permutevar8x32_epi32(ymm1[j+8], permute);
  589|       |
  590|       |
  591|  4.81k|    }
  592|    602|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * jump)), ymm1[0]);
  593|    602|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * jump)), ymm1[4]);
  594|    602|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (2 * jump)), ymm1[2]);
  595|    602|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (3 * jump)), ymm1[6]);
  596|    602|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (4 * jump)), ymm1[1]);
  597|    602|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (5 * jump)), ymm1[5]);
  598|    602|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (6 * jump)), ymm1[3]);
  599|    602|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (7 * jump)), ymm1[7]);
  600|    602|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (8 * jump)), ymm1[8]);
  601|    602|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (9 * jump)), ymm1[12]);
  602|    602|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (10 * jump)), ymm1[10]);
  603|    602|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (11 * jump)), ymm1[14]);
  604|    602|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (12 * jump)), ymm1[9]);
  605|    602|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (13 * jump)), ymm1[13]);
  606|    602|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (14 * jump)), ymm1[11]);
  607|    602|    _mm256_maskstore_epi32((int *)(dest + (i * bytesoftype) + (15 * jump)), store_mask, ymm1[15]);
  608|    602|  }
  609|     40|}
shuffle-avx2.c:unshuffle16_avx2:
  461|     23|                 const int32_t vectorizable_elements, const int32_t total_elements) {
  462|     23|  static const int32_t bytesoftype = 16;
  463|     23|  int32_t i;
  464|     23|  int j;
  465|     23|  __m256i ymm0[16], ymm1[16];
  466|       |
  467|  1.21k|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (467:15): [True: 1.19k, False: 23]
  ------------------
  468|       |    /* Fetch 32 elements (512 bytes) into 16 YMM registers. */
  469|  1.19k|    const uint8_t* const src_for_ith_element = src + i;
  470|  20.2k|    for (j = 0; j < 16; j++) {
  ------------------
  |  Branch (470:17): [True: 19.0k, False: 1.19k]
  ------------------
  471|  19.0k|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  472|  19.0k|    }
  473|       |
  474|       |    /* Shuffle bytes */
  475|  10.7k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (475:17): [True: 9.53k, False: 1.19k]
  ------------------
  476|       |      /* Compute the low 32 bytes */
  477|  9.53k|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  478|       |      /* Compute the hi 32 bytes */
  479|  9.53k|      ymm1[8 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  480|  9.53k|    }
  481|       |    /* Shuffle 2-byte words */
  482|  10.7k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (482:17): [True: 9.53k, False: 1.19k]
  ------------------
  483|       |      /* Compute the low 32 bytes */
  484|  9.53k|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  485|       |      /* Compute the hi 32 bytes */
  486|  9.53k|      ymm0[8 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  487|  9.53k|    }
  488|       |    /* Shuffle 4-byte dwords */
  489|  10.7k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (489:17): [True: 9.53k, False: 1.19k]
  ------------------
  490|       |      /* Compute the low 32 bytes */
  491|  9.53k|      ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  492|       |      /* Compute the hi 32 bytes */
  493|  9.53k|      ymm1[8 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  494|  9.53k|    }
  495|       |
  496|       |    /* Shuffle 8-byte qwords */
  497|  10.7k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (497:17): [True: 9.53k, False: 1.19k]
  ------------------
  498|       |      /* Compute the low 32 bytes */
  499|  9.53k|      ymm0[j] = _mm256_unpacklo_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  500|       |      /* Compute the hi 32 bytes */
  501|  9.53k|      ymm0[8 + j] = _mm256_unpackhi_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  502|  9.53k|    }
  503|       |
  504|  10.7k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (504:17): [True: 9.53k, False: 1.19k]
  ------------------
  505|  9.53k|      ymm1[j] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x20);
  506|  9.53k|      ymm1[j + 8] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x31);
  507|  9.53k|    }
  508|       |
  509|       |    /* Store the result vectors in proper order */
  510|  1.19k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * sizeof(__m256i))), ymm1[0]);
  511|  1.19k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * sizeof(__m256i))), ymm1[4]);
  512|  1.19k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (2 * sizeof(__m256i))), ymm1[2]);
  513|  1.19k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (3 * sizeof(__m256i))), ymm1[6]);
  514|  1.19k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (4 * sizeof(__m256i))), ymm1[1]);
  515|  1.19k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (5 * sizeof(__m256i))), ymm1[5]);
  516|  1.19k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (6 * sizeof(__m256i))), ymm1[3]);
  517|  1.19k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (7 * sizeof(__m256i))), ymm1[7]);
  518|  1.19k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (8 * sizeof(__m256i))), ymm1[8]);
  519|  1.19k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (9 * sizeof(__m256i))), ymm1[12]);
  520|  1.19k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (10 * sizeof(__m256i))), ymm1[10]);
  521|  1.19k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (11 * sizeof(__m256i))), ymm1[14]);
  522|  1.19k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (12 * sizeof(__m256i))), ymm1[9]);
  523|  1.19k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (13 * sizeof(__m256i))), ymm1[13]);
  524|  1.19k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (14 * sizeof(__m256i))), ymm1[11]);
  525|  1.19k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (15 * sizeof(__m256i))), ymm1[15]);
  526|  1.19k|  }
  527|     23|}
shuffle-avx2.c:unshuffle16_tiled_avx2:
  613|     57|                       const int32_t vectorizable_elements, const int32_t total_elements, const int32_t bytesoftype) {
  614|     57|  int32_t i;
  615|     57|  int j;
  616|     57|  __m256i ymm0[16], ymm1[16];
  617|       |
  618|     57|  const lldiv_t vecs_per_el = lldiv(bytesoftype, sizeof(__m128i));
  619|     57|  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|     57|  int32_t offset_into_type;
  624|    304|  for (offset_into_type = 0; offset_into_type < bytesoftype;
  ------------------
  |  Branch (624:30): [True: 247, False: 57]
  ------------------
  625|    247|       offset_into_type += (offset_into_type == 0 && vecs_rem > 0 ? vecs_rem : (int32_t)sizeof(__m128i))) {
  ------------------
  |  Branch (625:29): [True: 57, False: 190]
  |  Branch (625:54): [True: 44, False: 13]
  ------------------
  626|  4.75k|    for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (626:17): [True: 4.50k, False: 247]
  ------------------
  627|       |      /* Load the first 16 bytes of 32 adjacent elements (512 bytes) into 16 YMM registers */
  628|  4.50k|      const uint8_t* const src_for_ith_element = src + i;
  629|  76.6k|      for (j = 0; j < 16; j++) {
  ------------------
  |  Branch (629:19): [True: 72.1k, False: 4.50k]
  ------------------
  630|  72.1k|        ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (total_elements * (offset_into_type + j))));
  631|  72.1k|      }
  632|       |
  633|       |      /* Shuffle bytes */
  634|  40.5k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (634:19): [True: 36.0k, False: 4.50k]
  ------------------
  635|       |        /* Compute the low 32 bytes */
  636|  36.0k|        ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  637|       |        /* Compute the hi 32 bytes */
  638|  36.0k|        ymm1[8 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  639|  36.0k|      }
  640|       |      /* Shuffle 2-byte words */
  641|  40.5k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (641:19): [True: 36.0k, False: 4.50k]
  ------------------
  642|       |        /* Compute the low 32 bytes */
  643|  36.0k|        ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  644|       |        /* Compute the hi 32 bytes */
  645|  36.0k|        ymm0[8 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  646|  36.0k|      }
  647|       |      /* Shuffle 4-byte dwords */
  648|  40.5k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (648:19): [True: 36.0k, False: 4.50k]
  ------------------
  649|       |        /* Compute the low 32 bytes */
  650|  36.0k|        ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  651|       |        /* Compute the hi 32 bytes */
  652|  36.0k|        ymm1[8 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  653|  36.0k|      }
  654|       |
  655|       |      /* Shuffle 8-byte qwords */
  656|  40.5k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (656:19): [True: 36.0k, False: 4.50k]
  ------------------
  657|       |        /* Compute the low 32 bytes */
  658|  36.0k|        ymm0[j] = _mm256_unpacklo_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  659|       |        /* Compute the hi 32 bytes */
  660|  36.0k|        ymm0[8 + j] = _mm256_unpackhi_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  661|  36.0k|      }
  662|       |
  663|  40.5k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (663:19): [True: 36.0k, False: 4.50k]
  ------------------
  664|  36.0k|        ymm1[j] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x20);
  665|  36.0k|        ymm1[j + 8] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x31);
  666|  36.0k|      }
  667|       |
  668|       |      /* Store the result vectors in proper order */
  669|  4.50k|      const uint8_t* const dest_with_offset = dest + offset_into_type;
  670|  4.50k|      _mm256_storeu2_m128i(
  671|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x01) * bytesoftype),
  672|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x00) * bytesoftype), ymm1[0]);
  673|  4.50k|      _mm256_storeu2_m128i(
  674|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x03) * bytesoftype),
  675|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x02) * bytesoftype), ymm1[4]);
  676|  4.50k|      _mm256_storeu2_m128i(
  677|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x05) * bytesoftype),
  678|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x04) * bytesoftype), ymm1[2]);
  679|  4.50k|      _mm256_storeu2_m128i(
  680|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x07) * bytesoftype),
  681|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x06) * bytesoftype), ymm1[6]);
  682|  4.50k|      _mm256_storeu2_m128i(
  683|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x09) * bytesoftype),
  684|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x08) * bytesoftype), ymm1[1]);
  685|  4.50k|      _mm256_storeu2_m128i(
  686|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x0b) * bytesoftype),
  687|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x0a) * bytesoftype), ymm1[5]);
  688|  4.50k|      _mm256_storeu2_m128i(
  689|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x0d) * bytesoftype),
  690|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x0c) * bytesoftype), ymm1[3]);
  691|  4.50k|      _mm256_storeu2_m128i(
  692|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x0f) * bytesoftype),
  693|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x0e) * bytesoftype), ymm1[7]);
  694|  4.50k|      _mm256_storeu2_m128i(
  695|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x11) * bytesoftype),
  696|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x10) * bytesoftype), ymm1[8]);
  697|  4.50k|      _mm256_storeu2_m128i(
  698|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x13) * bytesoftype),
  699|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x12) * bytesoftype), ymm1[12]);
  700|  4.50k|      _mm256_storeu2_m128i(
  701|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x15) * bytesoftype),
  702|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x14) * bytesoftype), ymm1[10]);
  703|  4.50k|      _mm256_storeu2_m128i(
  704|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x17) * bytesoftype),
  705|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x16) * bytesoftype), ymm1[14]);
  706|  4.50k|      _mm256_storeu2_m128i(
  707|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x19) * bytesoftype),
  708|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x18) * bytesoftype), ymm1[9]);
  709|  4.50k|      _mm256_storeu2_m128i(
  710|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x1b) * bytesoftype),
  711|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x1a) * bytesoftype), ymm1[13]);
  712|  4.50k|      _mm256_storeu2_m128i(
  713|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x1d) * bytesoftype),
  714|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x1c) * bytesoftype), ymm1[11]);
  715|  4.50k|      _mm256_storeu2_m128i(
  716|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x1f) * bytesoftype),
  717|  4.50k|          (__m128i*)(dest_with_offset + (i + 0x1e) * bytesoftype), ymm1[15]);
  718|  4.50k|    }
  719|    247|  }
  720|     57|}

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

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

blosc2_unshuffle:
  436|  4.62k|                 const void* src, void* dest) {
  437|       |  /* Initialize the shuffle implementation if necessary. */
  438|  4.62k|  init_shuffle_implementation();
  439|       |
  440|  4.62k|  if (typesize < 1 || typesize > 256 || blocksize < 0) {
  ------------------
  |  Branch (440:7): [True: 0, False: 4.62k]
  |  Branch (440:23): [True: 0, False: 4.62k]
  |  Branch (440:41): [True: 0, False: 4.62k]
  ------------------
  441|      0|    return BLOSC2_ERROR_INVALID_PARAM;
  442|      0|  }
  443|       |
  444|       |  /* The implementation is initialized.
  445|       |     Dispatch to it's unshuffle routine. */
  446|  4.62k|  (host_implementation.unshuffle)(typesize, blocksize, src, dest);
  447|       |
  448|  4.62k|  return blocksize;
  449|  4.62k|}
bitunshuffle:
  484|  3.06k|                     const uint8_t format_version) {
  485|       |  /* Initialize the shuffle implementation if necessary. */
  486|  3.06k|  init_shuffle_implementation();
  487|  3.06k|  size_t size = blocksize / typesize;
  488|       |
  489|  3.06k|  if (format_version == 2) {
  ------------------
  |  Branch (489:7): [True: 815, False: 2.24k]
  ------------------
  490|       |    /* Starting from version 3, bitshuffle() works differently */
  491|    815|    if ((size % 8) == 0) {
  ------------------
  |  Branch (491:9): [True: 479, False: 336]
  ------------------
  492|       |      /* The number of elems is a multiple of 8 which is supported by
  493|       |         bitshuffle. */
  494|    479|      int ret = (int) (host_implementation.bitunshuffle)
  495|    479|          ((const void *) src, (void *) dest, blocksize / typesize, typesize);
  496|    479|      if (ret < 0) {
  ------------------
  |  Branch (496:11): [True: 0, False: 479]
  ------------------
  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|    479|    }
  502|    336|    else {
  503|    336|      memcpy(dest, src, blocksize);
  504|    336|    }
  505|    815|  }
  506|  2.24k|  else {
  507|       |    /* bitshuffle only supports a number of bytes that is a multiple of 8. */
  508|  2.24k|    size -= size % 8;
  509|  2.24k|    int ret = (int) (host_implementation.bitunshuffle)(src, dest, size, typesize);
  510|  2.24k|    if (ret < 0) {
  ------------------
  |  Branch (510:9): [True: 0, False: 2.24k]
  ------------------
  511|      0|      BLOSC_TRACE_ERROR("the impossible happened: the bitunshuffle filter failed!");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  512|      0|      return ret;
  513|      0|    }
  514|       |
  515|       |    /* Copy the leftovers */
  516|  2.24k|    size_t offset = size * typesize;
  517|  2.24k|    memcpy((uint8_t *) dest + offset, (const uint8_t *) src + offset, blocksize - offset);
  518|  2.24k|  }
  519|       |
  520|  3.06k|  return blocksize;
  521|  3.06k|}
shuffle.c:init_shuffle_implementation:
  391|  7.68k|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|  7.68k|#if defined(__GNUC__) || defined(__clang__)
  401|  7.68k|  if (__builtin_expect(!implementation_initialized, 0)) {
  ------------------
  |  Branch (401:7): [True: 1, False: 7.68k]
  ------------------
  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|  7.68k|}
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:
  524|      1|static char *print_error(int rc) {
  525|       |  // TODO: remove this function, use blosc2_error_string only
  526|      1|  return (char *) blosc2_error_string(rc);
  527|      1|}
ndmean.c:blosc2_meta_get:
 2310|      4|                                  int32_t *content_len) {
 2311|      4|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2311:7): [True: 4, False: 0]
  |  Branch (2311:25): [True: 0, False: 0]
  |  Branch (2311:41): [True: 0, False: 0]
  |  Branch (2311:60): [True: 0, False: 0]
  ------------------
 2312|      4|    BLOSC_TRACE_ERROR("Invalid parameters.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2313|      4|    return BLOSC2_ERROR_INVALID_PARAM;
 2314|      4|  }
 2315|       |
 2316|      0|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2317|      0|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2317:7): [True: 0, False: 0]
  ------------------
 2318|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2319|      0|    return nmetalayer;
 2320|      0|  }
 2321|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2322|      0|  if (len < 0) {
  ------------------
  |  Branch (2322:7): [True: 0, False: 0]
  ------------------
 2323|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2324|      0|    return BLOSC2_ERROR_DATA;
 2325|      0|  }
 2326|      0|  *content_len = len;
 2327|      0|  if (len == 0) {
  ------------------
  |  Branch (2327:7): [True: 0, False: 0]
  ------------------
 2328|      0|    *content = NULL;
 2329|      0|    return nmetalayer;
 2330|      0|  }
 2331|      0|  *content = (uint8_t*)malloc((size_t)len);
 2332|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2332:7): [True: 0, False: 0]
  ------------------
 2333|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2334|      0|    *content_len = 0;
 2335|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2336|      0|  }
 2337|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2337:7): [True: 0, False: 0]
  |  Branch (2337:18): [True: 0, False: 0]
  ------------------
 2338|      0|    free(*content);
 2339|      0|    *content = NULL;
 2340|      0|    *content_len = 0;
 2341|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2342|      0|    return BLOSC2_ERROR_DATA;
 2343|      0|  }
 2344|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2345|      0|  return nmetalayer;
 2346|      0|}
bytedelta.c:print_error:
  524|      1|static char *print_error(int rc) {
  525|       |  // TODO: remove this function, use blosc2_error_string only
  526|      1|  return (char *) blosc2_error_string(rc);
  527|      1|}

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

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

ndlz4_decompress:
  514|    674|                     uint8_t meta, blosc2_dparams *dparams) {
  515|    674|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|    674|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  516|    674|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|    674|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  517|    674|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    674|    do {                                            \
  |  |  105|    674|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 674]
  |  |  ------------------
  |  |  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|    674|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 674]
  |  |  ------------------
  ------------------
  518|    674|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    674|    do {                                            \
  |  |  105|    674|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 674]
  |  |  ------------------
  |  |  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|    674|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 674]
  |  |  ------------------
  ------------------
  519|       |
  520|    674|  uint8_t *ip = (uint8_t *) input;
  521|    674|  uint8_t *ip_limit = ip + input_len;
  522|    674|  uint8_t *op = (uint8_t *) output;
  523|    674|  uint8_t ndim;
  524|    674|  int32_t blockshape[2];
  525|    674|  int32_t eshape[2];
  526|    674|  uint8_t *buffercpy;
  527|    674|  uint8_t local_buffer[16];
  528|    674|  uint8_t token;
  529|    674|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < 8)) {
  ------------------
  |  |   30|    674|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 1, False: 673]
  |  |  ------------------
  ------------------
  530|      1|    return 0;
  531|      1|  }
  532|       |
  533|       |  /* we start with literal copy */
  534|    673|  ndim = *ip;
  535|    673|  ip++;
  536|    673|  if (ndim != 2) {
  ------------------
  |  Branch (536:7): [True: 0, False: 673]
  ------------------
  537|      0|    BLOSC_TRACE_ERROR("This codec only works for ndim = 2");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  538|      0|    return BLOSC2_ERROR_FAILURE;
  539|      0|  }
  540|    673|  memcpy(&blockshape[0], ip, 4);
  541|    673|  ip += 4;
  542|    673|  memcpy(&blockshape[1], ip, 4);
  543|    673|  ip += 4;
  544|       |
  545|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3204
  546|    673|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (546:7): [True: 0, False: 673]
  |  Branch (546:25): [True: 1, False: 672]
  |  Branch (546:46): [True: 0, False: 672]
  ------------------
  547|      1|    BLOSC_TRACE_ERROR("Output length or blockshape is 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  548|      1|    return BLOSC2_ERROR_FAILURE;
  549|      1|  }
  550|       |
  551|    672|  eshape[0] = ((blockshape[0] + 3) / 4) * 4;
  552|    672|  eshape[1] = ((blockshape[1] + 3) / 4) * 4;
  553|       |
  554|    672|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|    672|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 8, False: 664]
  |  |  ------------------
  ------------------
  555|      8|    BLOSC_TRACE_ERROR("The blockshape is bigger than the output buffer");
  ------------------
  |  |   93|      8|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      8|    do {                                            \
  |  |  |  |   98|      8|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      8|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      8|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  556|      8|    return 0;
  557|      8|  }
  558|    664|  memset(op, 0, blockshape[0] * blockshape[1]);
  559|       |
  560|    664|  uint32_t i_stop[2];
  561|  1.99k|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (561:19): [True: 1.32k, False: 664]
  ------------------
  562|  1.32k|    i_stop[i] = eshape[i] / 4;
  563|  1.32k|  }
  564|       |
  565|       |  /* main loop */
  566|    664|  uint32_t ii[2];
  567|    664|  uint32_t padding[2] = {0};
  568|    664|  uint32_t ind = 0;
  569|    664|  uint8_t cell_aux[16];
  570|  33.5M|  for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
  ------------------
  |  Branch (570:19): [True: 33.5M, False: 664]
  ------------------
  571|  33.5M|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (571:21): [True: 1.32k, False: 33.5M]
  ------------------
  572|  1.32k|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|  1.32k|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 1.32k]
  |  |  ------------------
  ------------------
  573|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  574|      0|        return BLOSC2_ERROR_FAILURE;
  575|      0|      }
  576|  1.32k|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (576:11): [True: 1.11k, False: 216]
  ------------------
  577|  1.11k|        padding[0] = (blockshape[0] % 4 == 0) ? 4 : blockshape[0] % 4;
  ------------------
  |  Branch (577:22): [True: 42, False: 1.06k]
  ------------------
  578|  1.11k|      } else {
  579|    216|        padding[0] = 4;
  580|    216|      }
  581|  1.32k|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (581:11): [True: 879, False: 447]
  ------------------
  582|    879|        padding[1] = (blockshape[1] % 4 == 0) ? 4 : blockshape[1] % 4;
  ------------------
  |  Branch (582:22): [True: 66, False: 813]
  ------------------
  583|    879|      } else {
  584|    447|        padding[1] = 4;
  585|    447|      }
  586|  1.32k|      token = *ip++;
  587|  1.32k|      if (token == 0) {    // no match
  ------------------
  |  Branch (587:11): [True: 83, False: 1.24k]
  ------------------
  588|     83|        buffercpy = ip;
  589|     83|        ip += padding[0] * padding[1];
  590|  1.24k|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (590:18): [True: 137, False: 1.10k]
  ------------------
  591|    137|        uint16_t offset = *((uint16_t *) ip);
  592|    137|        buffercpy = ip - offset - 1;
  593|    137|        ip += 2;
  594|  1.10k|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (594:18): [True: 51, False: 1.05k]
  ------------------
  595|     51|        buffercpy = cell_aux;
  596|     51|        memset(buffercpy, *ip, 16);
  597|     51|        ip++;
  598|  1.05k|      } else if (token >= 224) { // three rows match
  ------------------
  |  Branch (598:18): [True: 298, False: 757]
  ------------------
  599|    298|        buffercpy = local_buffer;
  600|    298|        uint16_t offset = *((uint16_t *) ip);
  601|    298|        offset += 3;
  602|    298|        ip += 2;
  603|    298|        int i, j, k;
  604|    298|        if ((token >> 3U) == 28) {
  ------------------
  |  Branch (604:13): [True: 76, False: 222]
  ------------------
  605|     76|          i = 1;
  606|     76|          j = 2;
  607|     76|          k = 3;
  608|    222|        } else {
  609|    222|          i = 0;
  610|    222|          if ((token >> 3U) < 30) {
  ------------------
  |  Branch (610:15): [True: 75, False: 147]
  ------------------
  611|     75|            j = 1;
  612|     75|            k = 2;
  613|    147|          } else {
  614|    147|            k = 3;
  615|    147|            if ((token >> 3U) == 30) {
  ------------------
  |  Branch (615:17): [True: 69, False: 78]
  ------------------
  616|     69|              j = 1;
  617|     78|            } else {
  618|     78|              j = 2;
  619|     78|            }
  620|    147|          }
  621|    222|        }
  622|    298|        memcpy(&buffercpy[i * 4], ip - offset, 4);
  623|    298|        memcpy(&buffercpy[j * 4], ip - offset + 4, 4);
  624|    298|        memcpy(&buffercpy[k * 4], ip - offset + 8, 4);
  625|    739|        for (int l = 0; l < 4; l++) {
  ------------------
  |  Branch (625:25): [True: 739, False: 0]
  ------------------
  626|    739|          if ((l != i) && (l != j) && (l != k)) {
  ------------------
  |  Branch (626:15): [True: 517, False: 222]
  |  Branch (626:27): [True: 373, False: 144]
  |  Branch (626:39): [True: 298, False: 75]
  ------------------
  627|    298|            memcpy(&buffercpy[l * 4], ip, 4);
  628|    298|            ip += 4;
  629|    298|            break;
  630|    298|          }
  631|    739|        }
  632|       |
  633|    757|      } else if ((token >= 128) && (token <= 191)) { // rows pair match
  ------------------
  |  Branch (633:18): [True: 501, False: 256]
  |  Branch (633:36): [True: 501, False: 0]
  ------------------
  634|    501|        buffercpy = local_buffer;
  635|    501|        uint16_t offset = *((uint16_t *) ip);
  636|    501|        offset += 3;
  637|    501|        ip += 2;
  638|    501|        int i, j;
  639|    501|        if (token == 128) {
  ------------------
  |  Branch (639:13): [True: 72, False: 429]
  ------------------
  640|     72|          i = 2;
  641|     72|          j = 3;
  642|    429|        } else {
  643|    429|          i = (token - 128) >> 5U;
  644|    429|          j = ((token - 128) >> 3U) - (i << 2U);
  645|    429|        }
  646|    501|        memcpy(&buffercpy[i * 4], ip - offset, 4);
  647|    501|        memcpy(&buffercpy[j * 4], ip - offset + 4, 4);
  648|  2.50k|        for (int k = 0; k < 4; k++) {
  ------------------
  |  Branch (648:25): [True: 2.00k, False: 501]
  ------------------
  649|  2.00k|          if ((k != i) && (k != j)) {
  ------------------
  |  Branch (649:15): [True: 1.50k, False: 501]
  |  Branch (649:27): [True: 1.00k, False: 501]
  ------------------
  650|  1.00k|            memcpy(&buffercpy[k * 4], ip, 4);
  651|  1.00k|            ip += 4;
  652|  1.00k|          }
  653|  2.00k|        }
  654|    501|      } else if ((token >= 40) && (token <= 63)) {  // 2 rows pair matches
  ------------------
  |  Branch (654:18): [True: 256, False: 0]
  |  Branch (654:35): [True: 256, False: 0]
  ------------------
  655|    256|        buffercpy = local_buffer;
  656|    256|        uint16_t offset_1 = *((uint16_t *) ip);
  657|    256|        offset_1 += 5;
  658|    256|        ip += 2;
  659|    256|        uint16_t offset_2 = *((uint16_t *) ip);
  660|    256|        offset_2 += 5;
  661|    256|        ip += 2;
  662|    256|        int i, j, k, l, m;
  663|    256|        i = 0;
  664|    256|        j = ((token - 32) >> 3U);
  665|    256|        l = -1;
  666|  1.02k|        for (k = 1; k < 4; k++) {
  ------------------
  |  Branch (666:21): [True: 768, False: 256]
  ------------------
  667|    768|          if ((k != i) && (k != j)) {
  ------------------
  |  Branch (667:15): [True: 768, False: 0]
  |  Branch (667:27): [True: 512, False: 256]
  ------------------
  668|    512|            if (l == -1) {
  ------------------
  |  Branch (668:17): [True: 256, False: 256]
  ------------------
  669|    256|              l = k;
  670|    256|            } else {
  671|    256|              m = k;
  672|    256|            }
  673|    512|          }
  674|    768|        }
  675|    256|        memcpy(&buffercpy[i * 4], ip - offset_1, 4);
  676|    256|        memcpy(&buffercpy[j * 4], ip - offset_1 + 4, 4);
  677|    256|        memcpy(&buffercpy[l * 4], ip - offset_2, 4);
  678|    256|        memcpy(&buffercpy[m * 4], ip - offset_2 + 4, 4);
  679|       |
  680|    256|      } else {
  681|      0|        BLOSC_TRACE_ERROR("Invalid token: %u at cell [%d, %d]\n", token, ii[0], ii[1]);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  682|      0|        return BLOSC2_ERROR_FAILURE;
  683|      0|      }
  684|       |      // fill op with buffercpy
  685|  1.32k|      uint32_t orig = ii[0] * 4 * blockshape[1] + ii[1] * 4;
  686|  6.63k|      for (uint32_t i = 0; i < 4; i++) {
  ------------------
  |  Branch (686:28): [True: 5.30k, False: 1.32k]
  ------------------
  687|  5.30k|        if (i < padding[0]) {
  ------------------
  |  Branch (687:13): [True: 2.46k, False: 2.83k]
  ------------------
  688|  2.46k|          ind = orig + i * blockshape[1];
  689|  2.46k|          memcpy(&op[ind], buffercpy, padding[1]);
  690|  2.46k|        }
  691|  5.30k|        buffercpy += padding[1];
  692|  5.30k|      }
  693|  1.32k|      if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (693:11): [True: 0, False: 1.32k]
  ------------------
  694|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  695|      0|        return BLOSC2_ERROR_FAILURE;
  696|      0|      }
  697|  1.32k|    }
  698|  33.5M|  }
  699|    664|  ind += padding[1];
  700|       |
  701|    664|  if ((int32_t)ind != (blockshape[0] * blockshape[1])) {
  ------------------
  |  Branch (701:7): [True: 0, False: 664]
  ------------------
  702|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  703|      0|    return BLOSC2_ERROR_FAILURE;
  704|      0|  }
  705|    664|  if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (705:7): [True: 0, False: 664]
  ------------------
  706|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  707|      0|    return BLOSC2_ERROR_FAILURE;
  708|      0|  }
  709|       |
  710|    664|  return (int) ind;
  711|    664|}

ndlz8_decompress:
  431|    228|                     uint8_t meta, blosc2_dparams *dparams) {
  432|    228|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|    228|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  433|    228|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|    228|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  434|    228|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    228|    do {                                            \
  |  |  105|    228|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 228]
  |  |  ------------------
  |  |  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|    228|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 228]
  |  |  ------------------
  ------------------
  435|    228|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    228|    do {                                            \
  |  |  105|    228|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 228]
  |  |  ------------------
  |  |  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|    228|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 228]
  |  |  ------------------
  ------------------
  436|       |
  437|    228|  const int cell_shape = 8;
  438|    228|  const int cell_size = 64;
  439|    228|  uint8_t *ip = (uint8_t *) input;
  440|    228|  uint8_t *ip_limit = ip + input_len;
  441|    228|  uint8_t *op = (uint8_t *) output;
  442|    228|  uint8_t ndim;
  443|    228|  int32_t blockshape[2];
  444|    228|  int32_t eshape[2];
  445|    228|  uint8_t *buffercpy;
  446|    228|  uint8_t token;
  447|    228|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < 8)) {
  ------------------
  |  |   30|    228|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 1, False: 227]
  |  |  ------------------
  ------------------
  448|      1|    return 0;
  449|      1|  }
  450|       |
  451|       |  /* we start with literal copy */
  452|    227|  ndim = *ip;
  453|    227|  ip++;
  454|    227|  if (ndim != 2) {
  ------------------
  |  Branch (454:7): [True: 0, False: 227]
  ------------------
  455|      0|    BLOSC_TRACE_ERROR("This codec only works for ndim = 2");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  456|      0|    return BLOSC2_ERROR_FAILURE;
  457|      0|  }
  458|    227|  memcpy(&blockshape[0], ip, 4);
  459|    227|  ip += 4;
  460|    227|  memcpy(&blockshape[1], ip, 4);
  461|    227|  ip += 4;
  462|       |
  463|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3203
  464|    227|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (464:7): [True: 0, False: 227]
  |  Branch (464:25): [True: 0, False: 227]
  |  Branch (464:46): [True: 0, False: 227]
  ------------------
  465|      0|    BLOSC_TRACE_ERROR("Output length or blockshape is 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  466|      0|    return BLOSC2_ERROR_FAILURE;
  467|      0|  }
  468|       |
  469|    227|  eshape[0] = ((blockshape[0] + 7) / cell_shape) * cell_shape;
  470|    227|  eshape[1] = ((blockshape[1] + 7) / cell_shape) * cell_shape;
  471|       |
  472|    227|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|    227|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 3, False: 224]
  |  |  ------------------
  ------------------
  473|      3|    BLOSC_TRACE_ERROR("The blockshape is bigger than the output buffer");
  ------------------
  |  |   93|      3|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      3|    do {                                            \
  |  |  |  |   98|      3|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      3|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      3|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  474|      3|    return 0;
  475|      3|  }
  476|    224|  memset(op, 0, blockshape[0] * blockshape[1]);
  477|       |
  478|    224|  int32_t i_stop[2];
  479|    672|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (479:19): [True: 448, False: 224]
  ------------------
  480|    448|    i_stop[i] = eshape[i] / cell_shape;
  481|    448|  }
  482|       |
  483|       |  /* main loop */
  484|    224|  int32_t ii[2];
  485|    224|  int32_t padding[2] = {0};
  486|    224|  int32_t ind = 0;
  487|    224|  uint8_t *local_buffer = malloc(cell_size);
  488|    224|  uint8_t *cell_aux = malloc(cell_size);
  489|    448|  for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
  ------------------
  |  Branch (489:19): [True: 224, False: 224]
  ------------------
  490|    448|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (490:21): [True: 224, False: 224]
  ------------------
  491|    224|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|    224|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 224]
  |  |  ------------------
  ------------------
  492|      0|        free(local_buffer);
  493|      0|        free(cell_aux);
  494|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  495|      0|        return BLOSC2_ERROR_FAILURE;
  496|      0|      }
  497|    224|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (497:11): [True: 224, False: 0]
  ------------------
  498|    224|        padding[0] = (blockshape[0] % cell_shape == 0) ? cell_shape : blockshape[0] % cell_shape;
  ------------------
  |  Branch (498:22): [True: 10, False: 214]
  ------------------
  499|    224|      } else {
  500|      0|        padding[0] = cell_shape;
  501|      0|      }
  502|    224|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (502:11): [True: 224, False: 0]
  ------------------
  503|    224|        padding[1] = (blockshape[1] % cell_shape == 0) ? cell_shape : blockshape[1] % cell_shape;
  ------------------
  |  Branch (503:22): [True: 9, False: 215]
  ------------------
  504|    224|      } else {
  505|      0|        padding[1] = cell_shape;
  506|      0|      }
  507|    224|      token = *ip++;
  508|    224|      uint8_t match_type = (token >> 3U);
  509|    224|      if (token == 0) {    // no match
  ------------------
  |  Branch (509:11): [True: 60, False: 164]
  ------------------
  510|     60|        buffercpy = ip;
  511|     60|        ip += padding[0] * padding[1];
  512|    164|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (512:18): [True: 73, False: 91]
  ------------------
  513|     73|        uint16_t offset = *((uint16_t *) ip);
  514|     73|        buffercpy = ip - offset - 1;
  515|     73|        ip += 2;
  516|     91|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (516:18): [True: 91, False: 0]
  ------------------
  517|     91|        buffercpy = cell_aux;
  518|     91|        memset(buffercpy, *ip, cell_size);
  519|     91|        ip++;
  520|     91|      } else if (match_type == 21) {    // triple match
  ------------------
  |  Branch (520:18): [True: 0, False: 0]
  ------------------
  521|      0|        buffercpy = local_buffer;
  522|      0|        int row = (int) (token & 7);
  523|      0|        if (row + 2 >= cell_shape) {
  ------------------
  |  Branch (523:13): [True: 0, False: 0]
  ------------------
  524|      0|          free(local_buffer);
  525|      0|          free(cell_aux);
  526|      0|          BLOSC_TRACE_ERROR("Triple match row out of bounds");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  527|      0|          return BLOSC2_ERROR_FAILURE;
  528|      0|        }
  529|      0|        uint16_t offset = *((uint16_t *) ip);
  530|      0|        ip += 2;
  531|      0|        for (int l = 0; l < 3; l++) {
  ------------------
  |  Branch (531:25): [True: 0, False: 0]
  ------------------
  532|      0|          memcpy(&buffercpy[(row + l) * cell_shape],
  533|      0|                 ip - sizeof(token) - sizeof(offset) - offset + l * cell_shape, cell_shape);
  534|      0|        }
  535|      0|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (535:25): [True: 0, False: 0]
  ------------------
  536|      0|          if ((l < row) || (l > row + 2)) {
  ------------------
  |  Branch (536:15): [True: 0, False: 0]
  |  Branch (536:28): [True: 0, False: 0]
  ------------------
  537|      0|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  538|      0|            ip += cell_shape;
  539|      0|          }
  540|      0|        }
  541|      0|      } else if (match_type == 17) {    // pair match
  ------------------
  |  Branch (541:18): [True: 0, False: 0]
  ------------------
  542|      0|        buffercpy = local_buffer;
  543|      0|        int row = (int) (token & 7);
  544|      0|        if (row + 1 >= cell_shape) {
  ------------------
  |  Branch (544:13): [True: 0, False: 0]
  ------------------
  545|      0|          free(local_buffer);
  546|      0|          free(cell_aux);
  547|      0|          BLOSC_TRACE_ERROR("Pair match row out of bounds");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  548|      0|          return BLOSC2_ERROR_FAILURE;
  549|      0|        }
  550|      0|        uint16_t offset = *((uint16_t *) ip);
  551|      0|        ip += 2;
  552|      0|        for (int l = 0; l < 2; l++) {
  ------------------
  |  Branch (552:25): [True: 0, False: 0]
  ------------------
  553|      0|          memcpy(&buffercpy[(row + l) * cell_shape],
  554|      0|                 ip - sizeof(token) - sizeof(offset) - offset + l * cell_shape, cell_shape);
  555|      0|        }
  556|      0|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (556:25): [True: 0, False: 0]
  ------------------
  557|      0|          if ((l < row) || (l > row + 1)) {
  ------------------
  |  Branch (557:15): [True: 0, False: 0]
  |  Branch (557:28): [True: 0, False: 0]
  ------------------
  558|      0|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  559|      0|            ip += cell_shape;
  560|      0|          }
  561|      0|        }
  562|      0|      } else {
  563|      0|        free(local_buffer);
  564|      0|        free(cell_aux);
  565|      0|        BLOSC_TRACE_ERROR("Invalid token: %u at cell [%d, %d]\n", token, ii[0], ii[1]);
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  566|      0|        return BLOSC2_ERROR_FAILURE;
  567|      0|      }
  568|       |
  569|    224|      int32_t orig = ii[0] * cell_shape * blockshape[1] + ii[1] * cell_shape;
  570|  2.01k|      for (int32_t i = 0; i < (int32_t) cell_shape; i++) {
  ------------------
  |  Branch (570:27): [True: 1.79k, False: 224]
  ------------------
  571|  1.79k|        if (i < padding[0]) {
  ------------------
  |  Branch (571:13): [True: 1.04k, False: 743]
  ------------------
  572|  1.04k|          ind = orig + i * blockshape[1];
  573|  1.04k|          memcpy(&op[ind], buffercpy, padding[1]);
  574|  1.04k|        }
  575|  1.79k|        buffercpy += padding[1];
  576|  1.79k|      }
  577|    224|      if (ind > output_len) {
  ------------------
  |  Branch (577:11): [True: 0, False: 224]
  ------------------
  578|      0|        free(local_buffer);
  579|      0|        free(cell_aux);
  580|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  581|      0|        return BLOSC2_ERROR_FAILURE;
  582|      0|      }
  583|    224|    }
  584|    224|  }
  585|    224|  ind += padding[1];
  586|       |
  587|    224|  free(cell_aux);
  588|    224|  free(local_buffer);
  589|       |
  590|    224|  if (ind != (blockshape[0] * blockshape[1])) {
  ------------------
  |  Branch (590:7): [True: 0, False: 224]
  ------------------
  591|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  592|      0|    return BLOSC2_ERROR_FAILURE;
  593|      0|  }
  594|    224|  if (ind > output_len) {
  ------------------
  |  Branch (594:7): [True: 0, False: 224]
  ------------------
  595|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  596|      0|    return BLOSC2_ERROR_FAILURE;
  597|      0|  }
  598|       |
  599|    224|  return (int) ind;
  600|    224|}

simd_load:
   33|  11.8k|bytes16 simd_load(const void* ptr) { return _mm_loadu_si128((const __m128i*)ptr); }
simd_store:
   34|  11.8k|void simd_store(void* ptr, bytes16 x) { _mm_storeu_si128((__m128i*)ptr, x); }
simd_add:
   37|  11.8k|bytes16 simd_add(bytes16 a, bytes16 b) { return _mm_add_epi8(a, b); }
simd_duplane15:
   39|  11.8k|bytes16 simd_duplane15(bytes16 x) { return _mm_shuffle_epi8(x, _mm_set1_epi8(15)); }
simd_prefix_sum:
   42|  11.8k|{
   43|       |  // Sklansky-style sum from https://gist.github.com/rygorous/4212be0cd009584e4184e641ca210528
   44|  11.8k|  x = _mm_add_epi8(x, _mm_slli_epi64(x, 8));
   45|  11.8k|  x = _mm_add_epi8(x, _mm_slli_epi64(x, 16));
   46|  11.8k|  x = _mm_add_epi8(x, _mm_slli_epi64(x, 32));
   47|  11.8k|  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)));
   48|  11.8k|  return x;
   49|  11.8k|}
simd_get_last:
   51|  1.51k|uint8_t simd_get_last(bytes16 x) { return (_mm_extract_epi16(x, 7) >> 8) & 0xFF; }
bytedelta_backward:
  133|    956|                       blosc2_dparams *dparams, uint8_t id) {
  134|    956|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|    956|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  135|       |
  136|    956|  int typesize = meta;
  137|    956|  if (typesize == 0) {
  ------------------
  |  Branch (137:7): [True: 1, False: 955]
  ------------------
  138|      1|    if (dparams->schunk == NULL) {
  ------------------
  |  Branch (138:9): [True: 1, False: 0]
  ------------------
  139|      1|      BLOSC_TRACE_ERROR("When meta is 0, you need to be on a schunk!");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  140|      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]
  |  |  ------------------
  ------------------
  141|      1|    }
  142|      0|    blosc2_schunk* schunk = (blosc2_schunk*)(dparams->schunk);
  143|      0|    typesize = schunk->typesize;
  144|      0|  }
  145|       |
  146|    955|  const int stream_len = length / typesize;
  147|  91.4k|  for (int ich = 0; ich < typesize; ++ich) {
  ------------------
  |  Branch (147:21): [True: 90.5k, False: 955]
  ------------------
  148|  90.5k|    int ip = 0;
  149|  90.5k|    uint8_t _v2 = 0;
  150|       |    // SIMD fetch 16 bytes from each channel, prefix-sum un-delta
  151|  90.5k|#if defined(CPU_HAS_SIMD)
  152|  90.5k|    bytes16 v2 = {0};
  153|  93.3k|    for (; ip < stream_len - 15; ip += 16) {
  ------------------
  |  Branch (153:12): [True: 2.80k, False: 90.5k]
  ------------------
  154|  2.80k|      bytes16 v = simd_load(input);
  155|  2.80k|      input += 16;
  156|       |      // un-delta via prefix sum
  157|  2.80k|      v2 = simd_add(simd_prefix_sum(v), simd_duplane15(v2));
  158|  2.80k|      simd_store(output, v2);
  159|  2.80k|      output += 16;
  160|  2.80k|    }
  161|  90.5k|    if (stream_len > 15) {
  ------------------
  |  Branch (161:9): [True: 1.51k, False: 88.9k]
  ------------------
  162|  1.51k|      _v2 = simd_get_last(v2);
  163|  1.51k|    }
  164|  90.5k|#endif // #if defined(CPU_HAS_SIMD)
  165|       |    // scalar leftover
  166|   104k|    for (; ip < stream_len; ip++) {
  ------------------
  |  Branch (166:12): [True: 14.3k, False: 90.5k]
  ------------------
  167|  14.3k|      uint8_t v = *input + _v2;
  168|  14.3k|      input++;
  169|  14.3k|      *output = v;
  170|  14.3k|      output++;
  171|  14.3k|      _v2 = v;
  172|  14.3k|    }
  173|  90.5k|  }
  174|       |
  175|    955|  return BLOSC2_ERROR_SUCCESS;
  176|    956|}
bytedelta_backward_buggy:
  226|    407|                             uint8_t meta, blosc2_dparams *dparams, uint8_t id) {
  227|    407|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|    407|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  228|       |
  229|    407|  int typesize = meta;
  230|    407|  if (typesize == 0) {
  ------------------
  |  Branch (230:7): [True: 0, False: 407]
  ------------------
  231|      0|    if (dparams->schunk == NULL) {
  ------------------
  |  Branch (231:9): [True: 0, False: 0]
  ------------------
  232|      0|      BLOSC_TRACE_ERROR("When meta is 0, you need to be on a schunk!");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  233|      0|      BLOSC_ERROR(BLOSC2_ERROR_FAILURE);
  ------------------
  |  |  111|      0|    do {                                            \
  |  |  112|      0|        int rc_ = (rc);                             \
  |  |  113|      0|        if (rc_ < BLOSC2_ERROR_SUCCESS) {           \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  114|      0|            char *error_msg = print_error(rc_);     \
  |  |  115|      0|            BLOSC_TRACE_ERROR("%s", error_msg);     \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  116|      0|            return rc_;                             \
  |  |  117|      0|        }                                           \
  |  |  118|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (118:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  234|      0|    }
  235|      0|    blosc2_schunk* schunk = (blosc2_schunk*)(dparams->schunk);
  236|      0|    typesize = schunk->typesize;
  237|      0|  }
  238|       |
  239|    407|  const int stream_len = length / typesize;
  240|  29.8k|  for (int ich = 0; ich < typesize; ++ich) {
  ------------------
  |  Branch (240:21): [True: 29.4k, False: 407]
  ------------------
  241|  29.4k|    int ip = 0;
  242|       |    // SIMD fetch 16 bytes from each channel, prefix-sum un-delta
  243|  29.4k|#if defined(CPU_HAS_SIMD)
  244|  29.4k|    bytes16 v2 = {0};
  245|  38.5k|    for (; ip < stream_len - 15; ip += 16) {
  ------------------
  |  Branch (245:12): [True: 9.03k, False: 29.4k]
  ------------------
  246|  9.03k|      bytes16 v = simd_load(input);
  247|  9.03k|      input += 16;
  248|       |      // un-delta via prefix sum
  249|  9.03k|      v2 = simd_add(simd_prefix_sum(v), simd_duplane15(v2));
  250|  9.03k|      simd_store(output, v2);
  251|  9.03k|      output += 16;
  252|  9.03k|    }
  253|  29.4k|#endif // #if defined(CPU_HAS_SIMD)
  254|       |    // scalar leftover
  255|  29.4k|    uint8_t _v2 = 0;
  256|  40.5k|    for (; ip < stream_len; ip++) {
  ------------------
  |  Branch (256:12): [True: 11.0k, False: 29.4k]
  ------------------
  257|  11.0k|      uint8_t v = *input + _v2;
  258|  11.0k|      input++;
  259|  11.0k|      *output = v;
  260|  11.0k|      output++;
  261|  11.0k|      _v2 = v;
  262|  11.0k|    }
  263|  29.4k|  }
  264|       |
  265|    407|  return BLOSC2_ERROR_SUCCESS;
  266|    407|}

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

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

ndmean_backward:
  194|      4|                   uint8_t id) {
  195|      4|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|      4|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  196|      4|  blosc2_schunk *schunk = dparams->schunk;
  197|      4|  int8_t ndim;
  198|      4|  int64_t *shape = malloc(8 * sizeof(int64_t));
  199|      4|  int32_t *chunkshape = malloc(8 * sizeof(int32_t));
  200|      4|  int32_t *blockshape = malloc(8 * sizeof(int32_t));
  201|      4|  uint8_t *smeta;
  202|      4|  int32_t smeta_len;
  203|      4|  if (blosc2_meta_get(schunk, "b2nd", &smeta, &smeta_len) < 0) {
  ------------------
  |  Branch (203:7): [True: 4, False: 0]
  ------------------
  204|      4|    free(shape);
  205|      4|    free(chunkshape);
  206|      4|    free(blockshape);
  207|      4|    BLOSC_TRACE_ERROR("b2nd layer not found!");
  ------------------
  |  |   93|      4|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      4|    do {                                            \
  |  |  |  |   98|      4|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      4|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      4|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  208|      4|    return BLOSC2_ERROR_FAILURE;
  209|      4|  }
  210|      0|  b2nd_deserialize_meta(smeta, smeta_len, &ndim, shape, chunkshape, blockshape, NULL, NULL);
  211|      0|  free(smeta);
  212|       |
  213|      0|  int8_t cellshape[8];
  214|      0|  int cell_size = 1;
  215|      0|  for (int i = 0; i < 8; ++i) {
  ------------------
  |  Branch (215:19): [True: 0, False: 0]
  ------------------
  216|      0|    if (i < ndim) {
  ------------------
  |  Branch (216:9): [True: 0, False: 0]
  ------------------
  217|      0|      cellshape[i] = (int8_t) meta;
  218|      0|      if (cellshape[i] > blockshape[i]) {
  ------------------
  |  Branch (218:11): [True: 0, False: 0]
  ------------------
  219|      0|        cellshape[i] = (int8_t) blockshape[i];
  220|      0|      }
  221|      0|      cell_size *= cellshape[i];
  222|      0|    } else {
  223|      0|      cellshape[i] = 1;
  224|      0|    }
  225|      0|  }
  226|       |
  227|      0|  int8_t typesize = (int8_t) schunk->typesize;
  228|      0|  uint8_t *ip = (uint8_t *) input;
  229|      0|  uint8_t *ip_limit = ip + length;
  230|      0|  uint8_t *op = (uint8_t *) output;
  231|      0|  int32_t blocksize = (int32_t) typesize;
  232|      0|  for (int i = 0; i < ndim; i++) {
  ------------------
  |  Branch (232:19): [True: 0, False: 0]
  ------------------
  233|      0|    blocksize *= blockshape[i];
  234|      0|  }
  235|       |
  236|      0|  if (length != blocksize) {
  ------------------
  |  Branch (236:7): [True: 0, False: 0]
  ------------------
  237|      0|    free(shape);
  238|      0|    free(chunkshape);
  239|      0|    free(blockshape);
  240|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|      0|    return BLOSC2_ERROR_FAILURE;
  242|      0|  }
  243|       |
  244|      0|  if (length < cell_size * typesize) {
  ------------------
  |  Branch (244:7): [True: 0, False: 0]
  ------------------
  245|      0|    free(shape);
  246|      0|    free(chunkshape);
  247|      0|    free(blockshape);
  248|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  249|      0|    return BLOSC2_ERROR_FAILURE;
  250|      0|  }
  251|       |
  252|      0|  int64_t i_shape[NDMEAN_MAX_DIM];
  253|      0|  for (int i = 0; i < ndim; ++i) {
  ------------------
  |  Branch (253:19): [True: 0, False: 0]
  ------------------
  254|      0|    i_shape[i] = (blockshape[i] + cellshape[i] - 1) / cellshape[i];
  255|      0|  }
  256|       |
  257|      0|  int64_t ncells = 1;
  258|      0|  for (int i = 0; i < ndim; ++i) {
  ------------------
  |  Branch (258:19): [True: 0, False: 0]
  ------------------
  259|      0|    ncells *= i_shape[i];
  260|      0|  }
  261|       |
  262|       |  /* main loop */
  263|      0|  int64_t pad_shape[NDMEAN_MAX_DIM] = {0};
  264|      0|  int64_t ii[NDMEAN_MAX_DIM];
  265|      0|  int32_t ind = 0;
  266|      0|  for (int cell_ind = 0; cell_ind < ncells; cell_ind++) {      // for each cell
  ------------------
  |  Branch (266:26): [True: 0, False: 0]
  ------------------
  267|       |
  268|      0|    if (ip > ip_limit) {
  ------------------
  |  Branch (268:9): [True: 0, False: 0]
  ------------------
  269|      0|      free(shape);
  270|      0|      free(chunkshape);
  271|      0|      free(blockshape);
  272|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  273|      0|      return BLOSC2_ERROR_FAILURE;
  274|      0|    }
  275|      0|    blosc2_unidim_to_multidim(ndim, i_shape, cell_ind, ii);
  276|      0|    uint32_t orig = 0;
  277|      0|    int64_t nd_aux = (int64_t) (cellshape[0]);
  278|      0|    for (int i = ndim - 1; i >= 0; i--) {
  ------------------
  |  Branch (278:28): [True: 0, False: 0]
  ------------------
  279|      0|      orig += ii[i] * nd_aux;
  280|      0|      nd_aux *= blockshape[i];
  281|      0|    }
  282|       |
  283|      0|    for (int dim_ind = 0; dim_ind < ndim; dim_ind++) {
  ------------------
  |  Branch (283:27): [True: 0, False: 0]
  ------------------
  284|      0|      if ((blockshape[dim_ind] % cellshape[dim_ind] != 0) && (ii[dim_ind] == i_shape[dim_ind] - 1)) {
  ------------------
  |  Branch (284:11): [True: 0, False: 0]
  |  Branch (284:62): [True: 0, False: 0]
  ------------------
  285|      0|        pad_shape[dim_ind] = blockshape[dim_ind] % cellshape[dim_ind];
  286|      0|      } else {
  287|      0|        pad_shape[dim_ind] = (int64_t) cellshape[dim_ind];
  288|      0|      }
  289|      0|    }
  290|       |
  291|      0|    int64_t ncopies = 1;
  292|      0|    for (int i = 0; i < ndim - 1; ++i) {
  ------------------
  |  Branch (292:21): [True: 0, False: 0]
  ------------------
  293|      0|      ncopies *= pad_shape[i];
  294|      0|    }
  295|      0|    int64_t kk[NDMEAN_MAX_DIM];
  296|      0|    for (int copy_ind = 0; copy_ind < ncopies; ++copy_ind) {
  ------------------
  |  Branch (296:28): [True: 0, False: 0]
  ------------------
  297|      0|      blosc2_unidim_to_multidim((int8_t) (ndim - 1), pad_shape, copy_ind, kk);
  298|      0|      nd_aux = blockshape[ndim - 1];
  299|      0|      ind = (int32_t) orig;
  300|      0|      for (int i = ndim - 2; i >= 0; i--) {
  ------------------
  |  Branch (300:30): [True: 0, False: 0]
  ------------------
  301|      0|        ind += (int32_t) (kk[i] * nd_aux);
  302|      0|        nd_aux *= blockshape[i];
  303|      0|      }
  304|      0|      memcpy(&op[ind * typesize], ip, pad_shape[ndim - 1] * typesize);
  305|      0|      ip += pad_shape[ndim - 1] * typesize;
  306|      0|    }
  307|      0|  }
  308|      0|  ind += (int32_t) pad_shape[ndim - 1];
  309|       |
  310|      0|  free(shape);
  311|      0|  free(chunkshape);
  312|      0|  free(blockshape);
  313|       |
  314|      0|  if (ind != (int32_t) (blocksize / typesize)) {
  ------------------
  |  Branch (314:7): [True: 0, False: 0]
  ------------------
  315|      0|    BLOSC_TRACE_ERROR("Output size is not compatible with embedded blockshape ind %d %d \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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  316|      0|                      ind, (blocksize / typesize));
  317|      0|    return BLOSC2_ERROR_FAILURE;
  318|      0|  }
  319|       |
  320|      0|  return BLOSC2_ERROR_SUCCESS;
  321|      0|}

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

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

