LZ4_decompress_safe:
 2452|    283|{
 2453|    283|    return LZ4_decompress_generic(source, dest, compressedSize, maxDecompressedSize,
 2454|    283|                                  decode_full_block, noDict,
 2455|       |                                  (BYTE*)dest, NULL, 0);
 2456|    283|}
LZ4_decompress_safe_forceExtDict:
 2526|    111|{
 2527|    111|    DEBUGLOG(5, "LZ4_decompress_safe_forceExtDict");
  ------------------
  |  |  289|    111|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2528|    111|    return LZ4_decompress_generic(source, dest, compressedSize, maxOutputSize,
 2529|    111|                                  decode_full_block, usingExtDict,
 2530|    111|                                  (BYTE*)dest, (const BYTE*)dictStart, dictSize);
 2531|    111|}
LZ4_decompress_safe_usingDict:
 2720|    111|{
 2721|    111|    if (dictSize==0)
  ------------------
  |  Branch (2721:9): [True: 0, False: 111]
  ------------------
 2722|      0|        return LZ4_decompress_safe(source, dest, compressedSize, maxOutputSize);
 2723|    111|    if (dictStart+dictSize == dest) {
  ------------------
  |  Branch (2723:9): [True: 0, False: 111]
  ------------------
 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|    111|    assert(dictSize >= 0);
  ------------------
  |  |  273|    111|#    define assert(condition) ((void)0)
  ------------------
 2731|    111|    return LZ4_decompress_safe_forceExtDict(source, dest, compressedSize, maxOutputSize, dictStart, (size_t)dictSize);
 2732|    111|}
lz4.c:LZ4_wildCopy8:
  466|  67.6k|{
  467|  67.6k|    BYTE* d = (BYTE*)dstPtr;
  468|  67.6k|    const BYTE* s = (const BYTE*)srcPtr;
  469|  67.6k|    BYTE* const e = (BYTE*)dstEnd;
  470|       |
  471|   123k|    do { LZ4_memcpy(d,s,8); d+=8; s+=8; } while (d<e);
  ------------------
  |  |  349|   123k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (471:50): [True: 55.7k, False: 67.6k]
  ------------------
  472|  67.6k|}
lz4.c:LZ4_isLittleEndian:
  364|   138k|{
  365|   138k|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental */
  366|   138k|    return one.c[0];
  367|   138k|}
lz4.c:LZ4_read16:
  393|   138k|static U16 LZ4_read16(const void* ptr) { return ((const LZ4_unalign16*)ptr)->u16; }
lz4.c:LZ4_write32:
  398|  66.5k|static void LZ4_write32(void* memPtr, U32 value) { ((LZ4_unalign32*)memPtr)->u32 = value; }
lz4.c:LZ4_decompress_generic:
 2035|    394|{
 2036|    394|    if ((src == NULL) || (outputSize < 0)) { return -1; }
  ------------------
  |  Branch (2036:9): [True: 0, False: 394]
  |  Branch (2036:26): [True: 0, False: 394]
  ------------------
 2037|       |
 2038|    394|    {   const BYTE* ip = (const BYTE*) src;
 2039|    394|        const BYTE* const iend = ip + srcSize;
 2040|       |
 2041|    394|        BYTE* op = (BYTE*) dst;
 2042|    394|        BYTE* const oend = op + outputSize;
 2043|    394|        BYTE* cpy;
 2044|       |
 2045|    394|        const BYTE* const dictEnd = (dictStart == NULL) ? NULL : dictStart + dictSize;
  ------------------
  |  Branch (2045:37): [True: 283, False: 111]
  ------------------
 2046|       |
 2047|    394|        const int checkOffset = (dictSize < (int)(64 KB));
  ------------------
  |  |  251|    394|#define KB *(1 <<10)
  ------------------
 2048|       |
 2049|       |
 2050|       |        /* Set up the "end" pointers for the shortcut. */
 2051|    394|        const BYTE* const shortiend = iend - 14 /*maxLL*/ - 2 /*offset*/;
 2052|    394|        const BYTE* const shortoend = oend - 14 /*maxLL*/ - 18 /*maxML*/;
 2053|       |
 2054|    394|        const BYTE* match;
 2055|    394|        size_t offset;
 2056|    394|        unsigned token;
 2057|    394|        size_t length;
 2058|       |
 2059|       |
 2060|    394|        DEBUGLOG(5, "LZ4_decompress_generic (srcSize:%i, dstSize:%i)", srcSize, outputSize);
  ------------------
  |  |  289|    394|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2061|       |
 2062|       |        /* Special cases */
 2063|    394|        assert(lowPrefix <= op);
  ------------------
  |  |  273|    394|#    define assert(condition) ((void)0)
  ------------------
 2064|    394|        if (unlikely(outputSize==0)) {
  ------------------
  |  |  180|    394|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    394|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 394]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|    394|        if (unlikely(srcSize==0)) { return -1; }
  ------------------
  |  |  180|    394|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    394|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 394]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|    394|#if LZ4_FAST_DEC_LOOP
 2076|    394|        if ((oend - op) < FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|    394|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2076:13): [True: 12, False: 382]
  ------------------
 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|    382|        DEBUGLOG(6, "using fast decode loop");
  ------------------
  |  |  289|    382|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2083|   137k|        while (1) {
  ------------------
  |  Branch (2083:16): [True: 137k, Folded]
  ------------------
 2084|       |            /* Main fastloop assertion: We can always wildcopy FASTLOOP_SAFE_DISTANCE */
 2085|   137k|            assert(oend - op >= FASTLOOP_SAFE_DISTANCE);
  ------------------
  |  |  273|   137k|#    define assert(condition) ((void)0)
  ------------------
 2086|   137k|            assert(ip < iend);
  ------------------
  |  |  273|   137k|#    define assert(condition) ((void)0)
  ------------------
 2087|   137k|            token = *ip++;
 2088|   137k|            length = token >> ML_BITS;  /* literal length */
  ------------------
  |  |  260|   137k|#define ML_BITS  4
  ------------------
 2089|   137k|            DEBUGLOG(7, "blockPos%6u: litLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)length);
  ------------------
  |  |  289|   137k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2090|       |
 2091|       |            /* decode literal length */
 2092|   137k|            if (length == RUN_MASK) {
  ------------------
  |  |  263|   137k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|   137k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|   137k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2092:17): [True: 13.3k, False: 124k]
  ------------------
 2093|  13.3k|                size_t const addl = read_variable_length(&ip, iend-RUN_MASK, 1);
  ------------------
  |  |  263|  13.3k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|  13.3k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|  13.3k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2094|  13.3k|                if (addl == rvl_error) {
  ------------------
  |  Branch (2094:21): [True: 1, False: 13.3k]
  ------------------
 2095|      1|                    DEBUGLOG(6, "error reading long literal length");
  ------------------
  |  |  289|      1|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2096|      1|                    goto _output_error;
 2097|      1|                }
 2098|  13.3k|                length += addl;
 2099|  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2100|  13.3k|                if (unlikely((uptrval)(ip)+length<(uptrval)(ip))) { 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2101|       |
 2102|       |                /* copy literals */
 2103|  13.3k|                LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH);
  ------------------
  |  |  277|  13.3k|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
 2104|  13.3k|                if ((op+length>oend-32) || (ip+length>iend-32)) { goto safe_literal_copy; }
  ------------------
  |  Branch (2104:21): [True: 33, False: 13.3k]
  |  Branch (2104:44): [True: 37, False: 13.3k]
  ------------------
 2105|  13.3k|                LZ4_wildCopy32(op, ip, op+length);
 2106|  13.3k|                ip += length; op += length;
 2107|   124k|            } else if (ip <= iend-(16 + 1/*max lit + offset + nextToken*/)) {
  ------------------
  |  Branch (2107:24): [True: 124k, False: 9]
  ------------------
 2108|       |                /* We don't need to check oend, since we check it once for each loop below */
 2109|   124k|                DEBUGLOG(7, "copy %u bytes in a 16-bytes stripe", (unsigned)length);
  ------------------
  |  |  289|   124k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2110|       |                /* Literals can only be <= 14, but hope compilers optimize better when copy by a register size */
 2111|   124k|                LZ4_memcpy(op, ip, 16);
  ------------------
  |  |  349|   124k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2112|   124k|                ip += length; op += length;
 2113|   124k|            } else {
 2114|      9|                goto safe_literal_copy;
 2115|      9|            }
 2116|       |
 2117|       |            /* get offset */
 2118|   137k|            offset = LZ4_readLE16(ip); ip+=2;
 2119|   137k|            DEBUGLOG(6, "blockPos%6u: offset = %u", (unsigned)(op-(BYTE*)dst), (unsigned)offset);
  ------------------
  |  |  289|   137k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2120|   137k|            match = op - offset;
 2121|   137k|            assert(match <= op);  /* overflow check */
  ------------------
  |  |  273|   137k|#    define assert(condition) ((void)0)
  ------------------
 2122|       |
 2123|       |            /* get matchlength */
 2124|   137k|            length = token & ML_MASK;
  ------------------
  |  |  261|   137k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|   137k|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2125|   137k|            DEBUGLOG(7, "  match length token = %u (len==%u)", (unsigned)length, (unsigned)length+MINMATCH);
  ------------------
  |  |  289|   137k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2126|       |
 2127|   137k|            if (length == ML_MASK) {
  ------------------
  |  |  261|   137k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|   137k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2127:17): [True: 16.1k, False: 121k]
  ------------------
 2128|  16.1k|                size_t const addl = read_variable_length(&ip, iend - LASTLITERALS + 1, 0);
  ------------------
  |  |  245|  16.1k|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2129|  16.1k|                if (addl == rvl_error) {
  ------------------
  |  Branch (2129:21): [True: 0, False: 16.1k]
  ------------------
 2130|      0|                    DEBUGLOG(5, "error reading long match length");
  ------------------
  |  |  289|      0|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2131|      0|                    goto _output_error;
 2132|      0|                }
 2133|  16.1k|                length += addl;
 2134|  16.1k|                length += MINMATCH;
  ------------------
  |  |  242|  16.1k|#define MINMATCH 4
  ------------------
 2135|  16.1k|                DEBUGLOG(7, "  long match length == %u", (unsigned)length);
  ------------------
  |  |  289|  16.1k|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2136|  16.1k|                if (unlikely((uptrval)(op)+length<(uptrval)op)) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|  16.1k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  16.1k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 16.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2137|  16.1k|                if (op + length >= oend - FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|  16.1k|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2137:21): [True: 74, False: 16.0k]
  ------------------
 2138|     74|                    goto safe_match_copy;
 2139|     74|                }
 2140|   121k|            } else {
 2141|   121k|                length += MINMATCH;
  ------------------
  |  |  242|   121k|#define MINMATCH 4
  ------------------
 2142|   121k|                if (op + length >= oend - FASTLOOP_SAFE_DISTANCE) {
  ------------------
  |  |  248|   121k|#define FASTLOOP_SAFE_DISTANCE 64
  ------------------
  |  Branch (2142:21): [True: 171, False: 121k]
  ------------------
 2143|    171|                    DEBUGLOG(7, "moving to safe_match_copy (ml==%u)", (unsigned)length);
  ------------------
  |  |  289|    171|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2144|    171|                    goto safe_match_copy;
 2145|    171|                }
 2146|       |
 2147|       |                /* Fastpath check: skip LZ4_wildCopy32 when true */
 2148|   121k|                if ((dict == withPrefix64k) || (match >= lowPrefix)) {
  ------------------
  |  Branch (2148:21): [True: 0, False: 121k]
  |  Branch (2148:48): [True: 121k, False: 153]
  ------------------
 2149|   121k|                    if (offset >= 8) {
  ------------------
  |  Branch (2149:25): [True: 52.8k, False: 68.4k]
  ------------------
 2150|  52.8k|                        assert(match >= lowPrefix);
  ------------------
  |  |  273|  52.8k|#    define assert(condition) ((void)0)
  ------------------
 2151|  52.8k|                        assert(match <= op);
  ------------------
  |  |  273|  52.8k|#    define assert(condition) ((void)0)
  ------------------
 2152|  52.8k|                        assert(op + 18 <= oend);
  ------------------
  |  |  273|  52.8k|#    define assert(condition) ((void)0)
  ------------------
 2153|       |
 2154|  52.8k|                        LZ4_memcpy(op, match, 8);
  ------------------
  |  |  349|  52.8k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2155|  52.8k|                        LZ4_memcpy(op+8, match+8, 8);
  ------------------
  |  |  349|  52.8k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2156|  52.8k|                        LZ4_memcpy(op+16, match+16, 2);
  ------------------
  |  |  349|  52.8k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2157|  52.8k|                        op += length;
 2158|  52.8k|                        continue;
 2159|  52.8k|            }   }   }
 2160|       |
 2161|  84.5k|            if ( checkOffset && (unlikely(match + dictSize < lowPrefix)) ) {
  ------------------
  |  |  180|  84.5k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  84.5k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  ------------------
  ------------------
  |  Branch (2161:18): [True: 84.5k, False: 0]
  |  Branch (2161:33): [True: 57, False: 84.5k]
  ------------------
 2162|     57|                DEBUGLOG(5, "Error : pos=%zi, offset=%zi => outside buffers", op-lowPrefix, op-match);
  ------------------
  |  |  289|     57|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2163|     57|                goto _output_error;
 2164|     57|            }
 2165|       |            /* match starting within external dictionary */
 2166|  84.5k|            if ((dict==usingExtDict) && (match < lowPrefix)) {
  ------------------
  |  Branch (2166:17): [True: 1.52k, False: 83.0k]
  |  Branch (2166:41): [True: 121, False: 1.40k]
  ------------------
 2167|    121|                assert(dictEnd != NULL);
  ------------------
  |  |  273|    121|#    define assert(condition) ((void)0)
  ------------------
 2168|    121|                if (unlikely(op+length > oend-LASTLITERALS)) {
  ------------------
  |  |  180|    121|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    121|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 121]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|    121|                if (length <= (size_t)(lowPrefix-match)) {
  ------------------
  |  Branch (2177:21): [True: 86, False: 35]
  ------------------
 2178|       |                    /* match fits entirely within external dictionary : just copy */
 2179|     86|                    LZ4_memmove(op, dictEnd - (lowPrefix-match), length);
  ------------------
  |  |  357|     86|#    define LZ4_memmove __builtin_memmove
  ------------------
 2180|     86|                    op += length;
 2181|     86|                } else {
 2182|       |                    /* match stretches into both external dictionary and current block */
 2183|     35|                    size_t const copySize = (size_t)(lowPrefix - match);
 2184|     35|                    size_t const restSize = length - copySize;
 2185|     35|                    LZ4_memcpy(op, dictEnd - copySize, copySize);
  ------------------
  |  |  349|     35|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2186|     35|                    op += copySize;
 2187|     35|                    if (restSize > (size_t)(op - lowPrefix)) {  /* overlap copy */
  ------------------
  |  Branch (2187:25): [True: 14, False: 21]
  ------------------
 2188|     14|                        BYTE* const endOfMatch = op + restSize;
 2189|     14|                        const BYTE* copyFrom = lowPrefix;
 2190|  1.80k|                        while (op < endOfMatch) { *op++ = *copyFrom++; }
  ------------------
  |  Branch (2190:32): [True: 1.79k, False: 14]
  ------------------
 2191|     21|                    } else {
 2192|     21|                        LZ4_memcpy(op, lowPrefix, restSize);
  ------------------
  |  |  349|     21|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2193|     21|                        op += restSize;
 2194|     21|                }   }
 2195|    121|                continue;
 2196|    121|            }
 2197|       |
 2198|       |            /* copy match within block */
 2199|  84.4k|            cpy = op + length;
 2200|       |
 2201|  84.4k|            assert((op <= oend) && (oend-op >= 32));
  ------------------
  |  |  273|  84.4k|#    define assert(condition) ((void)0)
  ------------------
 2202|  84.4k|            if (unlikely(offset<16)) {
  ------------------
  |  |  180|  84.4k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  84.4k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 80.8k, False: 3.59k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2203|  80.8k|                LZ4_memcpy_using_offset(op, match, cpy, offset);
 2204|  80.8k|            } else {
 2205|  3.59k|                LZ4_wildCopy32(op, match, cpy);
 2206|  3.59k|            }
 2207|       |
 2208|  84.4k|            op = cpy;   /* wildcopy correction */
 2209|  84.4k|        }
 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.39k|        while (1) {
  ------------------
  |  Branch (2215:16): [True: 1.39k, Folded]
  ------------------
 2216|  1.39k|            assert(ip < iend);
  ------------------
  |  |  273|  1.39k|#    define assert(condition) ((void)0)
  ------------------
 2217|  1.39k|            token = *ip++;
 2218|  1.39k|            length = token >> ML_BITS;  /* literal length */
  ------------------
  |  |  260|  1.39k|#define ML_BITS  4
  ------------------
 2219|  1.39k|            DEBUGLOG(7, "blockPos%6u: litLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)length);
  ------------------
  |  |  289|  1.39k|#  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.39k|            if ( (length != RUN_MASK)
  ------------------
  |  |  263|  1.39k|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|  1.39k|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|  1.39k|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2230:18): [True: 1.21k, False: 177]
  ------------------
 2231|       |                /* strictly "less than" on input, to re-enter the loop with at least one byte */
 2232|  1.21k|              && likely((ip < shortiend) & (op <= shortoend)) ) {
  ------------------
  |  |  177|  1.21k|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|  1.21k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 556, False: 658]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2233|       |                /* Copy the literals */
 2234|    556|                LZ4_memcpy(op, ip, 16);
  ------------------
  |  |  349|    556|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2235|    556|                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|    556|                length = token & ML_MASK; /* match length */
  ------------------
  |  |  261|    556|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    556|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2240|    556|                DEBUGLOG(7, "blockPos%6u: matchLength token = %u (len=%u)", (unsigned)(op-(BYTE*)dst), (unsigned)length, (unsigned)length + 4);
  ------------------
  |  |  289|    556|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2241|    556|                offset = LZ4_readLE16(ip); ip += 2;
 2242|    556|                match = op - offset;
 2243|    556|                assert(match <= op); /* check overflow */
  ------------------
  |  |  273|    556|#    define assert(condition) ((void)0)
  ------------------
 2244|       |
 2245|       |                /* Do not deal with overlapping matches. */
 2246|    556|                if ( (length != ML_MASK)
  ------------------
  |  |  261|    556|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    556|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2246:22): [True: 411, False: 145]
  ------------------
 2247|    411|                  && (offset >= 8)
  ------------------
  |  Branch (2247:22): [True: 180, False: 231]
  ------------------
 2248|    180|                  && (dict==withPrefix64k || match >= lowPrefix) ) {
  ------------------
  |  Branch (2248:23): [True: 0, False: 180]
  |  Branch (2248:46): [True: 164, False: 16]
  ------------------
 2249|       |                    /* Copy the match. */
 2250|    164|                    LZ4_memcpy(op + 0, match + 0, 8);
  ------------------
  |  |  349|    164|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2251|    164|                    LZ4_memcpy(op + 8, match + 8, 8);
  ------------------
  |  |  349|    164|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2252|    164|                    LZ4_memcpy(op +16, match +16, 2);
  ------------------
  |  |  349|    164|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2253|    164|                    op += length + MINMATCH;
  ------------------
  |  |  242|    164|#define MINMATCH 4
  ------------------
 2254|       |                    /* Both stages worked, load the next token. */
 2255|    164|                    continue;
 2256|    164|                }
 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|    392|                goto _copy_match;
 2261|    556|            }
 2262|       |
 2263|       |            /* decode literal length */
 2264|    835|            if (length == RUN_MASK) {
  ------------------
  |  |  263|    835|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|    835|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|    835|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2264:17): [True: 177, False: 658]
  ------------------
 2265|    177|                size_t const addl = read_variable_length(&ip, iend-RUN_MASK, 1);
  ------------------
  |  |  263|    177|#define RUN_MASK ((1U<<RUN_BITS)-1)
  |  |  ------------------
  |  |  |  |  262|    177|#define RUN_BITS (8-ML_BITS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  260|    177|#define ML_BITS  4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2266|    177|                if (addl == rvl_error) { goto _output_error; }
  ------------------
  |  Branch (2266:21): [True: 1, False: 176]
  ------------------
 2267|    176|                length += addl;
 2268|    176|                if (unlikely((uptrval)(op)+length<(uptrval)(op))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|    176|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    176|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 176]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2269|    176|                if (unlikely((uptrval)(ip)+length<(uptrval)(ip))) { goto _output_error; } /* overflow detection */
  ------------------
  |  |  180|    176|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    176|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 176]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2270|    176|            }
 2271|       |
 2272|    834|#if LZ4_FAST_DEC_LOOP
 2273|    913|        safe_literal_copy:
 2274|    913|#endif
 2275|       |            /* copy literals */
 2276|    913|            cpy = op+length;
 2277|       |
 2278|    913|            LZ4_STATIC_ASSERT(MFLIMIT >= WILDCOPYLENGTH);
  ------------------
  |  |  277|    913|#define LZ4_STATIC_ASSERT(c)   { enum { LZ4_static_assert = 1/(int)(!!(c)) }; }   /* use after variable declarations */
  ------------------
 2279|    913|            if ((cpy>oend-MFLIMIT) || (ip+length>iend-(2+1+LASTLITERALS))) {
  ------------------
  |  |  246|    913|#define MFLIMIT       12   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
                          if ((cpy>oend-MFLIMIT) || (ip+length>iend-(2+1+LASTLITERALS))) {
  ------------------
  |  |  245|    703|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (2279:17): [True: 210, False: 703]
  |  Branch (2279:39): [True: 33, False: 670]
  ------------------
 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|    243|                if (partialDecoding) {
  ------------------
  |  Branch (2285:21): [True: 0, False: 243]
  ------------------
 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|    243|                } 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|    243|                    if ((ip+length != iend) || (cpy > oend)) {
  ------------------
  |  Branch (2312:25): [True: 118, False: 125]
  |  Branch (2312:48): [True: 0, False: 125]
  ------------------
 2313|    118|                        DEBUGLOG(5, "should have been last run of literals")
  ------------------
  |  |  289|    118|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2314|    118|                        DEBUGLOG(5, "ip(%p) + length(%i) = %p != iend (%p)", ip, (int)length, ip+length, iend);
  ------------------
  |  |  289|    118|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2315|    118|                        DEBUGLOG(5, "or cpy(%p) > (oend-MFLIMIT)(%p)", cpy, oend-MFLIMIT);
  ------------------
  |  |  289|    118|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2316|    118|                        DEBUGLOG(5, "after writing %u bytes / %i bytes available", (unsigned)(op-(BYTE*)dst), outputSize);
  ------------------
  |  |  289|    118|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2317|    118|                        goto _output_error;
 2318|    118|                    }
 2319|    243|                }
 2320|    125|                LZ4_memmove(op, ip, length);  /* supports overlapping memory regions, for in-place decompression scenarios */
  ------------------
  |  |  357|    125|#    define LZ4_memmove __builtin_memmove
  ------------------
 2321|    125|                ip += length;
 2322|    125|                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|    125|                if (!partialDecoding || (cpy == oend) || (ip >= (iend-2))) {
  ------------------
  |  Branch (2328:21): [True: 125, False: 0]
  |  Branch (2328:41): [True: 0, False: 0]
  |  Branch (2328:58): [True: 0, False: 0]
  ------------------
 2329|    125|                    break;
 2330|    125|                }
 2331|    670|            } else {
 2332|    670|                LZ4_wildCopy8(op, ip, cpy);   /* can overwrite up to 8 bytes beyond cpy */
 2333|    670|                ip += length; op = cpy;
 2334|    670|            }
 2335|       |
 2336|       |            /* get offset */
 2337|    670|            offset = LZ4_readLE16(ip); ip+=2;
 2338|    670|            match = op - offset;
 2339|       |
 2340|       |            /* get matchlength */
 2341|    670|            length = token & ML_MASK;
  ------------------
  |  |  261|    670|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|    670|#define ML_BITS  4
  |  |  ------------------
  ------------------
 2342|    670|            DEBUGLOG(7, "blockPos%6u: matchLength token = %u", (unsigned)(op-(BYTE*)dst), (unsigned)length);
  ------------------
  |  |  289|    670|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2343|       |
 2344|  1.06k|    _copy_match:
 2345|  1.06k|            if (length == ML_MASK) {
  ------------------
  |  |  261|  1.06k|#define ML_MASK  ((1U<<ML_BITS)-1)
  |  |  ------------------
  |  |  |  |  260|  1.06k|#define ML_BITS  4
  |  |  ------------------
  ------------------
  |  Branch (2345:17): [True: 210, False: 852]
  ------------------
 2346|    210|                size_t const addl = read_variable_length(&ip, iend - LASTLITERALS + 1, 0);
  ------------------
  |  |  245|    210|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
 2347|    210|                if (addl == rvl_error) { goto _output_error; }
  ------------------
  |  Branch (2347:21): [True: 1, False: 209]
  ------------------
 2348|    209|                length += addl;
 2349|    209|                if (unlikely((uptrval)(op)+length<(uptrval)op)) goto _output_error;   /* overflow detection */
  ------------------
  |  |  180|    209|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|    209|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 209]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2350|    209|            }
 2351|  1.06k|            length += MINMATCH;
  ------------------
  |  |  242|  1.06k|#define MINMATCH 4
  ------------------
 2352|       |
 2353|  1.06k|#if LZ4_FAST_DEC_LOOP
 2354|  1.30k|        safe_match_copy:
 2355|  1.30k|#endif
 2356|  1.30k|            if ((checkOffset) && (unlikely(match + dictSize < lowPrefix))) goto _output_error;   /* Error : offset outside buffers */
  ------------------
  |  |  180|  1.30k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.30k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  ------------------
  ------------------
  |  Branch (2356:17): [True: 1.30k, False: 0]
  |  Branch (2356:34): [True: 68, False: 1.23k]
  ------------------
 2357|       |            /* match starting within external dictionary */
 2358|  1.23k|            if ((dict==usingExtDict) && (match < lowPrefix)) {
  ------------------
  |  Branch (2358:17): [True: 147, False: 1.09k]
  |  Branch (2358:41): [True: 8, False: 139]
  ------------------
 2359|      8|                assert(dictEnd != NULL);
  ------------------
  |  |  273|      8|#    define assert(condition) ((void)0)
  ------------------
 2360|      8|                if (unlikely(op+length > oend-LASTLITERALS)) {
  ------------------
  |  |  180|      8|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|      8|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|      8|                if (length <= (size_t)(lowPrefix-match)) {
  ------------------
  |  Branch (2365:21): [True: 3, False: 5]
  ------------------
 2366|       |                    /* match fits entirely within external dictionary : just copy */
 2367|      3|                    LZ4_memmove(op, dictEnd - (lowPrefix-match), length);
  ------------------
  |  |  357|      3|#    define LZ4_memmove __builtin_memmove
  ------------------
 2368|      3|                    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|      8|                continue;
 2384|      8|            }
 2385|  1.23k|            assert(match >= lowPrefix);
  ------------------
  |  |  273|  1.23k|#    define assert(condition) ((void)0)
  ------------------
 2386|       |
 2387|       |            /* copy match within block */
 2388|  1.23k|            cpy = op + length;
 2389|       |
 2390|       |            /* partialDecoding : may end anywhere within the block */
 2391|  1.23k|            assert(op<=oend);
  ------------------
  |  |  273|  1.23k|#    define assert(condition) ((void)0)
  ------------------
 2392|  1.23k|            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.23k]
  |  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.23k|            if (unlikely(offset<8)) {
  ------------------
  |  |  180|  1.23k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.23k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 735, False: 495]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2407|    735|                LZ4_write32(op, 0);   /* silence msan warning when offset==0 */
 2408|    735|                op[0] = match[0];
 2409|    735|                op[1] = match[1];
 2410|    735|                op[2] = match[2];
 2411|    735|                op[3] = match[3];
 2412|    735|                match += inc32table[offset];
 2413|    735|                LZ4_memcpy(op+4, match, 4);
  ------------------
  |  |  349|    735|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2414|    735|                match -= dec64table[offset];
 2415|    735|            } else {
 2416|    495|                LZ4_memcpy(op, match, 8);
  ------------------
  |  |  349|    495|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2417|    495|                match += 8;
 2418|    495|            }
 2419|  1.23k|            op += 8;
 2420|       |
 2421|  1.23k|            if (unlikely(cpy > oend-MATCH_SAFEGUARD_DISTANCE)) {
  ------------------
  |  |  180|  1.23k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  1.23k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 64, False: 1.16k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2422|     64|                BYTE* const oCopyLimit = oend - (WILDCOPYLENGTH-1);
  ------------------
  |  |  244|     64|#define WILDCOPYLENGTH 8
  ------------------
 2423|     64|                if (cpy > oend-LASTLITERALS) { goto _output_error; } /* Error : last LASTLITERALS bytes must be literals (uncompressed) */
  ------------------
  |  |  245|     64|#define LASTLITERALS   5   /* see ../doc/lz4_Block_format.md#parsing-restrictions */
  ------------------
  |  Branch (2423:21): [True: 23, False: 41]
  ------------------
 2424|     41|                if (op < oCopyLimit) {
  ------------------
  |  Branch (2424:21): [True: 25, False: 16]
  ------------------
 2425|     25|                    LZ4_wildCopy8(op, match, oCopyLimit);
 2426|     25|                    match += oCopyLimit - op;
 2427|     25|                    op = oCopyLimit;
 2428|     25|                }
 2429|     53|                while (op < cpy) { *op++ = *match++; }
  ------------------
  |  Branch (2429:24): [True: 12, False: 41]
  ------------------
 2430|  1.16k|            } else {
 2431|  1.16k|                LZ4_memcpy(op, match, 8);
  ------------------
  |  |  349|  1.16k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
 2432|  1.16k|                if (length > 16) { LZ4_wildCopy8(op+8, match+8, cpy); }
  ------------------
  |  Branch (2432:21): [True: 217, False: 949]
  ------------------
 2433|  1.16k|            }
 2434|  1.20k|            op = cpy;   /* wildcopy correction */
 2435|  1.20k|        }
 2436|       |
 2437|       |        /* end of decoding */
 2438|    125|        DEBUGLOG(5, "decoded %i bytes", (int) (((char*)op)-dst));
  ------------------
  |  |  289|    125|#  define DEBUGLOG(l, ...) {}    /* disabled */
  ------------------
 2439|    125|        return (int) (((char*)op)-dst);     /* Nb of output bytes decoded */
 2440|       |
 2441|       |        /* Overflow error detected */
 2442|    269|    _output_error:
 2443|    269|        return (int) (-(((const char*)ip)-src))-1;
 2444|     12|    }
 2445|     12|}
lz4.c:read_variable_length:
 1981|  29.8k|{
 1982|  29.8k|    Rvl_t s, length = 0;
 1983|  29.8k|    assert(ip != NULL);
  ------------------
  |  |  273|  29.8k|#    define assert(condition) ((void)0)
  ------------------
 1984|  29.8k|    assert(*ip !=  NULL);
  ------------------
  |  |  273|  29.8k|#    define assert(condition) ((void)0)
  ------------------
 1985|  29.8k|    assert(ilimit != NULL);
  ------------------
  |  |  273|  29.8k|#    define assert(condition) ((void)0)
  ------------------
 1986|  29.8k|    if (initial_check && unlikely((*ip) >= ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  13.5k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  13.5k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 13.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1986:9): [True: 13.5k, False: 16.3k]
  ------------------
 1987|      0|        return rvl_error;
 1988|      0|    }
 1989|  29.8k|    s = **ip;
 1990|  29.8k|    (*ip)++;
 1991|  29.8k|    length += s;
 1992|  29.8k|    if (unlikely((*ip) > ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  29.8k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  29.8k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 29.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1993|      0|        return rvl_error;
 1994|      0|    }
 1995|       |    /* accumulator overflow detection (32-bit mode only) */
 1996|  29.8k|    if ((sizeof(length) < 8) && unlikely(length > ((Rvl_t)(-1)/2)) ) {
  ------------------
  |  |  180|      0|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|      0|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1996:9): [Folded, False: 29.8k]
  ------------------
 1997|      0|        return rvl_error;
 1998|      0|    }
 1999|  29.8k|    if (likely(s != 255)) return length;
  ------------------
  |  |  177|  29.8k|#define likely(expr)     expect((expr) != 0, 1)
  |  |  ------------------
  |  |  |  |  171|  29.8k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 28.6k, False: 1.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2000|  6.58k|    do {
 2001|  6.58k|        s = **ip;
 2002|  6.58k|        (*ip)++;
 2003|  6.58k|        length += s;
 2004|  6.58k|        if (unlikely((*ip) > ilimit)) {    /* read limit reached */
  ------------------
  |  |  180|  6.58k|#define unlikely(expr)   expect((expr) != 0, 0)
  |  |  ------------------
  |  |  |  |  171|  6.58k|#  define expect(expr,value)    (__builtin_expect ((expr),(value)) )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:33): [True: 3, False: 6.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2005|      3|            return rvl_error;
 2006|      3|        }
 2007|       |        /* accumulator overflow detection (32-bit mode only) */
 2008|  6.58k|        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.58k]
  ------------------
 2009|      0|            return rvl_error;
 2010|      0|        }
 2011|  6.58k|    } while (s == 255);
  ------------------
  |  Branch (2011:14): [True: 5.31k, False: 1.26k]
  ------------------
 2012|       |
 2013|  1.26k|    return length;
 2014|  1.27k|}
lz4.c:LZ4_wildCopy32:
  523|  16.8k|{
  524|  16.8k|    BYTE* d = (BYTE*)dstPtr;
  525|  16.8k|    const BYTE* s = (const BYTE*)srcPtr;
  526|  16.8k|    BYTE* const e = (BYTE*)dstEnd;
  527|       |
  528|  46.8k|    do { LZ4_memcpy(d,s,16); LZ4_memcpy(d+16,s+16,16); d+=32; s+=32; } while (d<e);
  ------------------
  |  |  349|  46.8k|#    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|  46.8k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  |  Branch (528:79): [True: 29.9k, False: 16.8k]
  ------------------
  529|  16.8k|}
lz4.c:LZ4_readLE16:
  431|   138k|{
  432|   138k|    if (LZ4_isLittleEndian()) {
  ------------------
  |  Branch (432:9): [True: 138k, False: 0]
  ------------------
  433|   138k|        return LZ4_read16(memPtr);
  434|   138k|    } else {
  435|      0|        const BYTE* p = (const BYTE*)memPtr;
  436|      0|        return (U16)((U16)p[0] | (p[1]<<8));
  437|      0|    }
  438|   138k|}
lz4.c:LZ4_memcpy_using_offset:
  536|  80.8k|{
  537|  80.8k|    BYTE v[8];
  538|       |
  539|  80.8k|    assert(dstEnd >= dstPtr + MINMATCH);
  ------------------
  |  |  273|  80.8k|#    define assert(condition) ((void)0)
  ------------------
  540|       |
  541|  80.8k|    switch(offset) {
  542|  8.60k|    case 1:
  ------------------
  |  Branch (542:5): [True: 8.60k, False: 72.2k]
  ------------------
  543|  8.60k|        MEM_INIT(v, *srcPtr, 8);
  ------------------
  |  |  236|  8.60k|#define MEM_INIT(p,v,s)   LZ4_memset((p),(v),(s))
  |  |  ------------------
  |  |  |  |  234|  8.60k|#  define LZ4_memset(p,v,s) memset((p),(v),(s))
  |  |  ------------------
  ------------------
  544|  8.60k|        break;
  545|  2.32k|    case 2:
  ------------------
  |  Branch (545:5): [True: 2.32k, False: 78.5k]
  ------------------
  546|  2.32k|        LZ4_memcpy(v, srcPtr, 2);
  ------------------
  |  |  349|  2.32k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  547|  2.32k|        LZ4_memcpy(&v[2], srcPtr, 2);
  ------------------
  |  |  349|  2.32k|#    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.32k|        LZ4_memcpy(&v[4], v, 4);
  ------------------
  |  |  349|  2.32k|#    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.32k|        break;
  557|  3.13k|    case 4:
  ------------------
  |  Branch (557:5): [True: 3.13k, False: 77.6k]
  ------------------
  558|  3.13k|        LZ4_memcpy(v, srcPtr, 4);
  ------------------
  |  |  349|  3.13k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  559|  3.13k|        LZ4_memcpy(&v[4], srcPtr, 4);
  ------------------
  |  |  349|  3.13k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  560|  3.13k|        break;
  561|  66.7k|    default:
  ------------------
  |  Branch (561:5): [True: 66.7k, False: 14.0k]
  ------------------
  562|  66.7k|        LZ4_memcpy_using_offset_base(dstPtr, srcPtr, dstEnd, offset);
  563|  66.7k|        return;
  564|  80.8k|    }
  565|       |
  566|  14.0k|    LZ4_memcpy(dstPtr, v, 8);
  ------------------
  |  |  349|  14.0k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  567|  14.0k|    dstPtr += 8;
  568|  45.6k|    while (dstPtr < dstEnd) {
  ------------------
  |  Branch (568:12): [True: 31.5k, False: 14.0k]
  ------------------
  569|  31.5k|        LZ4_memcpy(dstPtr, v, 8);
  ------------------
  |  |  349|  31.5k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  570|  31.5k|        dstPtr += 8;
  571|  31.5k|    }
  572|  14.0k|}
lz4.c:LZ4_memcpy_using_offset_base:
  497|  66.7k|{
  498|  66.7k|    assert(srcPtr + offset == dstPtr);
  ------------------
  |  |  273|  66.7k|#    define assert(condition) ((void)0)
  ------------------
  499|  66.7k|    if (offset < 8) {
  ------------------
  |  Branch (499:9): [True: 65.8k, False: 940]
  ------------------
  500|  65.8k|        LZ4_write32(dstPtr, 0);   /* silence an msan warning when offset==0 */
  501|  65.8k|        dstPtr[0] = srcPtr[0];
  502|  65.8k|        dstPtr[1] = srcPtr[1];
  503|  65.8k|        dstPtr[2] = srcPtr[2];
  504|  65.8k|        dstPtr[3] = srcPtr[3];
  505|  65.8k|        srcPtr += inc32table[offset];
  506|  65.8k|        LZ4_memcpy(dstPtr+4, srcPtr, 4);
  ------------------
  |  |  349|  65.8k|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  507|  65.8k|        srcPtr -= dec64table[offset];
  508|  65.8k|        dstPtr += 8;
  509|  65.8k|    } else {
  510|    940|        LZ4_memcpy(dstPtr, srcPtr, 8);
  ------------------
  |  |  349|    940|#    define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size)
  ------------------
  511|    940|        dstPtr += 8;
  512|    940|        srcPtr += 8;
  513|    940|    }
  514|       |
  515|  66.7k|    LZ4_wildCopy8(dstPtr, srcPtr, dstEnd);
  516|  66.7k|}

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

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

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

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

adler32_ssse3.c:partial_hsum:
   14|     37|static inline uint32_t partial_hsum(__m128i x) {
   15|       |    __m128i second_int = _mm_srli_si128(x, 8);
   16|     37|    __m128i sum = _mm_add_epi32(x, second_int);
   17|     37|    return _mm_cvtsi128_si32(sum);
   18|     37|}
adler32_ssse3.c:hsum:
   20|     37|static inline uint32_t hsum(__m128i x) {
   21|     37|    __m128i sum1 = _mm_unpackhi_epi64(x, x);
   22|     37|    __m128i sum2 = _mm_add_epi32(x, sum1);
   23|       |    __m128i sum3 = _mm_shuffle_epi32(sum2, 0x01);
   24|     37|    __m128i sum4 = _mm_add_epi32(sum2, sum3);
   25|     37|    return _mm_cvtsi128_si32(sum4);
   26|     37|}
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|    103|static inline void loadhalfchunk(uint8_t const *s, halfchunk_t *chunk) {
   92|    103|    *chunk = _mm_loadu_si128((__m128i *)s);
   93|    103|}
chunkset_avx2.c:GET_HALFCHUNK_MAG:
  105|  10.4k|static inline halfchunk_t GET_HALFCHUNK_MAG(uint8_t *buf, uint32_t *chunk_rem, uint32_t dist) {
  106|  10.4k|    lut_rem_pair lut_rem = perm_idx_lut[dist - 3];
  107|  10.4k|    __m128i perm_vec, ret_vec;
  108|  10.4k|    __msan_unpoison(buf + dist, 16 - dist);
  ------------------
  |  |  338|  10.4k|#  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  10.4k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |               #  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  10.4k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |  |  Branch (338:79): [Folded, False: 10.4k]
  |  |  ------------------
  ------------------
  109|  10.4k|    ret_vec = _mm_loadu_si128((__m128i*)buf);
  110|  10.4k|    *chunk_rem = half_rem_vals[dist - 3];
  111|       |
  112|  10.4k|    perm_vec = _mm_load_si128((__m128i*)(permute_table + lut_rem.idx));
  113|  10.4k|    ret_vec = _mm_shuffle_epi8(ret_vec, perm_vec);
  114|       |
  115|  10.4k|    return ret_vec;
  116|  10.4k|}
chunkset_avx2.c:storehalfchunk:
   95|    684|static inline void storehalfchunk(uint8_t *out, halfchunk_t *chunk) {
   96|    684|    _mm_storeu_si128((__m128i *)out, *chunk);
   97|    684|}
chunkset_avx2.c:halfchunk2whole:
   99|  10.4k|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|  10.4k|    return _mm256_zextsi128_si256(*chunk);
  103|  10.4k|}
chunkset_avx2.c:chunkmemset_2:
   22|  8.06k|static inline void chunkmemset_2(uint8_t *from, chunk_t *chunk) {
   23|  8.06k|    *chunk = _mm256_set1_epi16(zng_memread_2(from));
   24|  8.06k|}
chunkset_avx2.c:chunkmemset_4:
   26|  20.4k|static inline void chunkmemset_4(uint8_t *from, chunk_t *chunk) {
   27|  20.4k|    *chunk = _mm256_set1_epi32(zng_memread_4(from));
   28|  20.4k|}
chunkset_avx2.c:chunkmemset_8:
   30|  2.14k|static inline void chunkmemset_8(uint8_t *from, chunk_t *chunk) {
   31|  2.14k|    *chunk = _mm256_set1_epi64x(zng_memread_8(from));
   32|  2.14k|}
chunkset_avx2.c:chunkmemset_16:
   34|  1.05k|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.05k|    *chunk = _mm256_broadcastsi128_si256(_mm_loadu_si128((__m128i*)from));
   41|  1.05k|#endif
   42|  1.05k|}
chunkset_avx2.c:GET_CHUNK_MAG:
   52|  2.90k|static inline chunk_t GET_CHUNK_MAG(uint8_t *buf, uint32_t *chunk_rem, uint32_t dist) {
   53|  2.90k|    lut_rem_pair lut_rem = perm_idx_lut[dist - 3];
   54|  2.90k|    __m256i ret_vec;
   55|       |    /* While technically we only need to read 4 or 8 bytes into this vector register for a lot of cases, GCC is
   56|       |     * compiling this to a shared load for all branches, preferring the simpler code.  Given that the buf value isn't in
   57|       |     * GPRs to begin with the 256 bit load is _probably_ just as inexpensive */
   58|  2.90k|    *chunk_rem = lut_rem.remval;
   59|       |
   60|       |    /* See note in chunkset_ssse3.c for why this is ok */
   61|  2.90k|    __msan_unpoison(buf + dist, 32 - dist);
  ------------------
  |  |  338|  2.90k|#  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  2.90k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |               #  define __msan_unpoison(a, size) do { Z_UNUSED(a); Z_UNUSED(size); } while (0)
  |  |  ------------------
  |  |  |  |  128|  2.90k|#define Z_UNUSED(var) (void)(var)
  |  |  ------------------
  |  |  |  Branch (338:79): [Folded, False: 2.90k]
  |  |  ------------------
  ------------------
   62|       |
   63|  2.90k|    if (dist < 16) {
  ------------------
  |  Branch (63:9): [True: 2.37k, False: 524]
  ------------------
   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.37k|        const __m256i permute_xform =
   68|  2.37k|            _mm256_setr_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   69|  2.37k|                             16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16);
   70|  2.37k|        __m256i perm_vec = _mm256_load_si256((__m256i*)(permute_table+lut_rem.idx));
   71|  2.37k|        __m128i ret_vec0 = _mm_loadu_si128((__m128i*)buf);
   72|  2.37k|        perm_vec = _mm256_add_epi8(perm_vec, permute_xform);
   73|  2.37k|        ret_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ret_vec0), ret_vec0, 1);
   74|  2.37k|        ret_vec = _mm256_shuffle_epi8(ret_vec, perm_vec);
   75|  2.37k|    }  else {
   76|    524|        __m128i ret_vec0 = _mm_loadu_si128((__m128i*)buf);
   77|    524|        __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|    524|        __m128i perm_vec1 = _mm_load_si128((__m128i*)(permute_table + lut_rem.idx));
   80|    524|        __m128i xlane_permutes = _mm_cmpgt_epi8(_mm_set1_epi8(16), perm_vec1);
   81|    524|        __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|    524|        __m128i latter_half = _mm_blendv_epi8(ret_vec1, xlane_res, xlane_permutes);
   85|    524|        ret_vec = _mm256_inserti128_si256(_mm256_castsi128_si256(ret_vec0), latter_half, 1);
   86|    524|    }
   87|       |
   88|  2.90k|    return ret_vec;
   89|  2.90k|}
chunkset_avx2.c:storechunk:
   48|   133k|static inline void storechunk(uint8_t *out, chunk_t *chunk) {
   49|   133k|    _mm256_storeu_si256((__m256i *)out, *chunk);
   50|   133k|}
chunkset_avx2.c:loadchunk:
   44|   121k|static inline void loadchunk(uint8_t const *s, chunk_t *chunk) {
   45|   121k|    *chunk = _mm256_loadu_si256((__m256i *)s);
   46|   121k|}

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

chunkmemset_safe_avx2:
  229|  3.01k|Z_INTERNAL uint8_t* CHUNKMEMSET_SAFE(uint8_t *out, uint8_t *from, unsigned len, unsigned left) {
  230|       |#if OPTIMAL_CMP < 32
  231|       |    static const uint32_t align_mask = 7;
  232|       |#elif OPTIMAL_CMP == 32
  233|       |    static const uint32_t align_mask = 3;
  234|       |#endif
  235|       |
  236|  3.01k|    len = MIN(len, left);
  ------------------
  |  |  124|  3.01k|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 0, False: 3.01k]
  |  |  ------------------
  ------------------
  237|       |
  238|       |#if OPTIMAL_CMP < 64
  239|       |    while (((uintptr_t)out & align_mask) && (len > 0)) {
  240|       |        *out++ = *from++;
  241|       |        --len;
  242|       |        --left;
  243|       |    }
  244|       |#endif
  245|       |
  246|  3.01k|#ifndef HAVE_MASKED_READWRITE
  247|  3.01k|    if (UNLIKELY(left < sizeof(chunk_t))) {
  ------------------
  |  |  214|  3.01k|#  define UNLIKELY(x)           __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (214:33): [True: 269, False: 2.74k]
  |  |  ------------------
  ------------------
  248|  2.00k|        while (len > 0) {
  ------------------
  |  Branch (248:16): [True: 1.73k, False: 269]
  ------------------
  249|  1.73k|            *out++ = *from++;
  250|  1.73k|            --len;
  251|  1.73k|        }
  252|       |
  253|    269|        return out;
  254|    269|    }
  255|  2.74k|#endif
  256|       |
  257|  2.74k|    if (len)
  ------------------
  |  Branch (257:9): [True: 2.74k, False: 0]
  ------------------
  258|  2.74k|        out = CHUNKMEMSET(out, from, len);
  ------------------
  |  |  121|  2.74k|#define CHUNKMEMSET      chunkmemset_avx2
  ------------------
  259|       |
  260|  2.74k|    return out;
  261|  3.01k|}
chunkset_avx2.c:chunkmemset_avx2:
  112|  58.5k|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|  58.5k|    Assert(from != out, "chunkmemset cannot have a distance 0");
  116|       |
  117|  58.5k|    chunk_t chunk_load;
  118|  58.5k|    uint32_t chunk_mod = 0;
  119|  58.5k|    uint32_t adv_amount;
  120|  58.5k|    int64_t sdist = out - from;
  121|  58.5k|    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|  58.5k|    if (sdist < 0 && dist < len) {
  ------------------
  |  Branch (127:9): [True: 0, False: 58.5k]
  |  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|  58.5k|    if (dist == 1) {
  ------------------
  |  Branch (143:9): [True: 12.9k, False: 45.5k]
  ------------------
  144|  12.9k|        memset(out, *from, len);
  145|  12.9k|        return out + len;
  146|  45.5k|    } else if (dist >= sizeof(chunk_t)) {
  ------------------
  |  Branch (146:16): [True: 423, False: 45.1k]
  ------------------
  147|    423|        return CHUNKCOPY(out, from, len);
  ------------------
  |  |  119|    423|#define CHUNKCOPY        chunkcopy_avx2
  ------------------
  148|    423|    }
  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|  45.1k|#ifdef HAVE_HALF_CHUNK
  158|  45.1k|    if (len <= sizeof(halfchunk_t)) {
  ------------------
  |  Branch (158:9): [True: 36.6k, False: 8.54k]
  ------------------
  159|  36.6k|        if (dist >= sizeof(halfchunk_t))
  ------------------
  |  Branch (159:13): [True: 103, False: 36.5k]
  ------------------
  160|    103|            return HALFCHUNKCOPY(out, from, len);
  161|       |
  162|  36.5k|        if ((dist % 2) != 0 || dist == 6) {
  ------------------
  |  Branch (162:13): [True: 9.79k, False: 26.7k]
  |  Branch (162:32): [True: 651, False: 26.0k]
  ------------------
  163|  10.4k|            halfchunk_t halfchunk_load = GET_HALFCHUNK_MAG(from, &chunk_mod, (unsigned)dist);
  164|       |
  165|  10.4k|            if (len == sizeof(halfchunk_t)) {
  ------------------
  |  Branch (165:17): [True: 581, False: 9.86k]
  ------------------
  166|    581|                storehalfchunk(out, &halfchunk_load);
  167|    581|                len -= sizeof(halfchunk_t);
  168|    581|                out += sizeof(halfchunk_t);
  169|    581|            }
  170|       |
  171|  10.4k|            chunk_load = halfchunk2whole(&halfchunk_load);
  172|  10.4k|            goto rem_bytes;
  173|  10.4k|        }
  174|  36.5k|    }
  175|  34.6k|#endif
  176|       |
  177|  34.6k|#ifdef HAVE_CHUNKMEMSET_2
  178|  34.6k|    if (dist == 2) {
  ------------------
  |  Branch (178:9): [True: 8.06k, False: 26.5k]
  ------------------
  179|  8.06k|        chunkmemset_2(from, &chunk_load);
  180|  8.06k|    } else
  181|  26.5k|#endif
  182|  26.5k|#ifdef HAVE_CHUNKMEMSET_4
  183|  26.5k|    if (dist == 4) {
  ------------------
  |  Branch (183:9): [True: 20.4k, False: 6.09k]
  ------------------
  184|  20.4k|        chunkmemset_4(from, &chunk_load);
  185|  20.4k|    } else
  186|  6.09k|#endif
  187|  6.09k|#ifdef HAVE_CHUNKMEMSET_8
  188|  6.09k|    if (dist == 8) {
  ------------------
  |  Branch (188:9): [True: 2.14k, False: 3.95k]
  ------------------
  189|  2.14k|        chunkmemset_8(from, &chunk_load);
  190|  2.14k|    } else
  191|  3.95k|#endif
  192|  3.95k|#ifdef HAVE_CHUNKMEMSET_16
  193|  3.95k|    if (dist == 16) {
  ------------------
  |  Branch (193:9): [True: 1.05k, False: 2.90k]
  ------------------
  194|  1.05k|        chunkmemset_16(from, &chunk_load);
  195|  1.05k|    } else
  196|  2.90k|#endif
  197|  2.90k|    chunk_load = GET_CHUNK_MAG(from, &chunk_mod, (unsigned)dist);
  198|       |
  199|  34.6k|    adv_amount = sizeof(chunk_t) - chunk_mod;
  200|       |
  201|  38.2k|    while (len >= (2 * sizeof(chunk_t))) {
  ------------------
  |  Branch (201:12): [True: 3.59k, False: 34.6k]
  ------------------
  202|  3.59k|        storechunk(out, &chunk_load);
  203|  3.59k|        storechunk(out + adv_amount, &chunk_load);
  204|  3.59k|        out += 2 * adv_amount;
  205|  3.59k|        len -= 2 * adv_amount;
  206|  3.59k|    }
  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|  40.1k|    while (len >= sizeof(chunk_t)) {
  ------------------
  |  Branch (212:12): [True: 5.53k, False: 34.6k]
  ------------------
  213|  5.53k|        storechunk(out, &chunk_load);
  214|  5.53k|        len -= adv_amount;
  215|  5.53k|        out += adv_amount;
  216|  5.53k|    }
  217|       |
  218|  34.6k|#ifdef HAVE_HALF_CHUNK
  219|  45.0k|rem_bytes:
  220|  45.0k|#endif
  221|  45.0k|    if (len) {
  ------------------
  |  Branch (221:9): [True: 44.4k, False: 603]
  ------------------
  222|  44.4k|        memcpy(out, &chunk_load, len);
  223|  44.4k|        out += len;
  224|  44.4k|    }
  225|       |
  226|  45.0k|    return out;
  227|  34.6k|}
chunkset_avx2.c:HALFCHUNKCOPY:
   91|    103|static inline uint8_t* HALFCHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
   92|    103|    halfchunk_t chunk;
   93|    103|    int32_t align = ((len - 1) % sizeof(halfchunk_t)) + 1;
   94|    103|    loadhalfchunk(from, &chunk);
   95|    103|    storehalfchunk(out, &chunk);
   96|    103|    out += align;
   97|    103|    from += align;
   98|    103|    len -= align;
   99|    103|    while (len > 0) {
  ------------------
  |  Branch (99:12): [True: 0, False: 103]
  ------------------
  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|    103|    return out;
  107|    103|}
chunkset_avx2.c:chunksize_avx2:
    9|  63.0k|static inline size_t CHUNKSIZE(void) {
   10|  63.0k|    return sizeof(chunk_t);
   11|  63.0k|}
chunkset_avx2.c:chunkcopy_avx2:
   24|   101k|static inline uint8_t* CHUNKCOPY(uint8_t *out, uint8_t const *from, unsigned len) {
   25|   101k|    Assert(len > 0, "chunkcopy should never have a length 0");
   26|   101k|    chunk_t chunk;
   27|   101k|    int32_t align = ((len - 1) % sizeof(chunk_t)) + 1;
   28|   101k|    loadchunk(from, &chunk);
   29|   101k|    storechunk(out, &chunk);
   30|   101k|    out += align;
   31|   101k|    from += align;
   32|   101k|    len -= align;
   33|   121k|    while (len > 0) {
  ------------------
  |  Branch (33:12): [True: 19.5k, False: 101k]
  ------------------
   34|  19.5k|        loadchunk(from, &chunk);
   35|  19.5k|        storechunk(out, &chunk);
   36|  19.5k|        out += sizeof(chunk_t);
   37|  19.5k|        from += sizeof(chunk_t);
   38|  19.5k|        len -= sizeof(chunk_t);
   39|  19.5k|    }
   40|   101k|    return out;
   41|   101k|}

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

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

zng_inflateResetKeep:
   61|    395|int32_t Z_EXPORT PREFIX(inflateResetKeep)(PREFIX3(stream) *strm) {
   62|    395|    struct inflate_state *state;
   63|       |
   64|    395|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (64:9): [True: 0, False: 395]
  ------------------
   65|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
   66|    395|    state = (struct inflate_state *)strm->state;
   67|    395|    strm->total_in = strm->total_out = state->total = 0;
   68|    395|    strm->msg = NULL;
   69|    395|    if (state->wrap)        /* to support ill-conceived Java test suite */
  ------------------
  |  Branch (69:9): [True: 395, False: 0]
  ------------------
   70|    395|        strm->adler = state->wrap & 1;
   71|    395|    state->mode = HEAD;
   72|    395|    state->check = ADLER32_INITIAL_VALUE;
  ------------------
  |  |   65|    395|#define ADLER32_INITIAL_VALUE 1 /* initial adler-32 hash value */
  ------------------
   73|    395|    state->last = 0;
   74|    395|    state->havedict = 0;
   75|    395|    state->flags = -1;
   76|    395|    state->head = NULL;
   77|    395|    state->hold = 0;
   78|    395|    state->bits = 0;
   79|    395|    state->lencode = state->distcode = state->next = state->codes;
   80|    395|    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|    395|    INFLATE_RESET_KEEP_HOOK(strm);  /* hook for IBM Z DFLTCC */
  ------------------
  |  |   25|    395|#  define INFLATE_RESET_KEEP_HOOK(strm) do {} while (0)
  |  |  ------------------
  |  |  |  Branch (25:54): [Folded, False: 395]
  |  |  ------------------
  ------------------
   88|    395|    Tracev((stderr, "inflate: reset\n"));
   89|    395|    return Z_OK;
  ------------------
  |  |  180|    395|#define Z_OK            0
  ------------------
   90|    395|}
zng_inflateReset:
   92|    395|int32_t Z_EXPORT PREFIX(inflateReset)(PREFIX3(stream) *strm) {
   93|    395|    struct inflate_state *state;
   94|       |
   95|    395|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (95:9): [True: 0, False: 395]
  ------------------
   96|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
   97|    395|    state = (struct inflate_state *)strm->state;
   98|    395|    state->wsize = 0;
   99|    395|    state->whave = 0;
  100|    395|    state->wnext = 0;
  101|    395|    return PREFIX(inflateResetKeep)(strm);
  ------------------
  |  |   97|    395|#  define PREFIX(x) zng_ ## x
  ------------------
  102|    395|}
zng_inflateReset2:
  104|    395|int32_t Z_EXPORT PREFIX(inflateReset2)(PREFIX3(stream) *strm, int32_t windowBits) {
  105|    395|    int wrap;
  106|    395|    struct inflate_state *state;
  107|       |
  108|       |    /* get the state */
  109|    395|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (109:9): [True: 0, False: 395]
  ------------------
  110|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  111|    395|    state = (struct inflate_state *)strm->state;
  112|       |
  113|       |    /* extract wrap request from windowBits parameter */
  114|    395|    if (windowBits < 0) {
  ------------------
  |  Branch (114:9): [True: 0, False: 395]
  ------------------
  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|    395|    } else {
  120|    395|        wrap = (windowBits >> 4) + 5;
  121|    395|#ifdef GUNZIP
  122|    395|        if (windowBits < 48)
  ------------------
  |  Branch (122:13): [True: 395, False: 0]
  ------------------
  123|    395|            windowBits &= MAX_WBITS;
  ------------------
  |  |   39|    395|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
  124|    395|#endif
  125|    395|    }
  126|       |
  127|       |    /* set number of window bits */
  128|    395|    if (windowBits && (windowBits < MIN_WBITS || windowBits > MAX_WBITS))
  ------------------
  |  |   36|    790|#  define MIN_WBITS   8  /* 256 LZ77 window */
  ------------------
                  if (windowBits && (windowBits < MIN_WBITS || windowBits > MAX_WBITS))
  ------------------
  |  |   39|    395|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
  |  Branch (128:9): [True: 395, False: 0]
  |  Branch (128:24): [True: 0, False: 395]
  |  Branch (128:50): [True: 0, False: 395]
  ------------------
  129|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  130|       |
  131|       |    /* update state and reset the rest of it */
  132|    395|    state->wrap = wrap;
  133|    395|    state->wbits = (unsigned)windowBits;
  134|    395|    return PREFIX(inflateReset)(strm);
  ------------------
  |  |   97|    395|#  define PREFIX(x) zng_ ## x
  ------------------
  135|    395|}
alloc_inflate:
  152|    395|Z_INTERNAL inflate_allocs* alloc_inflate(PREFIX3(stream) *strm) {
  153|    395|    int curr_size = 0;
  154|       |
  155|       |    /* Define sizes */
  156|    395|    int window_size = INFLATE_ADJUST_WINDOW_SIZE((1 << MAX_WBITS) + 64); /* 64B padding for chunksize */
  ------------------
  |  |   23|    395|#  define INFLATE_ADJUST_WINDOW_SIZE(n) (n)
  ------------------
  157|    395|    int state_size = sizeof(inflate_state);
  158|    395|    int alloc_size = sizeof(inflate_allocs);
  159|       |
  160|       |    /* Calculate relative buffer positions and paddings */
  161|    395|    LOGSZP("window", window_size, PAD_WINDOW(curr_size), PADSZ(curr_size,WINDOW_PAD_SIZE));
  162|    395|    int window_pos = PAD_WINDOW(curr_size);
  ------------------
  |  |  465|    395|#  define PAD_WINDOW            PAD_64
  |  |  ------------------
  |  |  |  |  245|    395|#define PAD_64(bpos) ((bpos) + PADSZ((bpos),64))
  |  |  |  |  ------------------
  |  |  |  |  |  |  243|    395|#define PADSZ(bpos, pad) (((pad) - ((uintptr_t)(bpos) % (pad))) % (pad))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|    395|    curr_size = window_pos + window_size;
  164|       |
  165|    395|    LOGSZP("state", state_size, PAD_64(curr_size), PADSZ(curr_size,64));
  166|    395|    int state_pos = PAD_64(curr_size);
  ------------------
  |  |  245|    395|#define PAD_64(bpos) ((bpos) + PADSZ((bpos),64))
  |  |  ------------------
  |  |  |  |  243|    395|#define PADSZ(bpos, pad) (((pad) - ((uintptr_t)(bpos) % (pad))) % (pad))
  |  |  ------------------
  ------------------
  167|    395|    curr_size = state_pos + state_size;
  168|       |
  169|    395|    LOGSZP("alloc", alloc_size, PAD_16(curr_size), PADSZ(curr_size,16));
  170|    395|    int alloc_pos = PAD_16(curr_size);
  ------------------
  |  |  244|    395|#define PAD_16(bpos) ((bpos) + PADSZ((bpos),16))
  |  |  ------------------
  |  |  |  |  243|    395|#define PADSZ(bpos, pad) (((pad) - ((uintptr_t)(bpos) % (pad))) % (pad))
  |  |  ------------------
  ------------------
  171|    395|    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|    395|    int total_size = PAD_64(curr_size + (WINDOW_PAD_SIZE - 1));
  ------------------
  |  |  245|    395|#define PAD_64(bpos) ((bpos) + PADSZ((bpos),64))
  |  |  ------------------
  |  |  |  |  243|    395|#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|    395|    char *original_buf = (char *)strm->zalloc(strm->opaque, 1, total_size);
  178|    395|    if (original_buf == NULL)
  ------------------
  |  Branch (178:9): [True: 0, False: 395]
  ------------------
  179|      0|        return NULL;
  180|       |
  181|    395|    char *buff = (char *)HINT_ALIGNED_WINDOW((char *)PAD_WINDOW(original_buf));
  ------------------
  |  |  467|    395|#  define HINT_ALIGNED_WINDOW   HINT_ALIGNED_64
  |  |  ------------------
  |  |  |  |  236|    395|#define HINT_ALIGNED_64(p) HINT_ALIGNED((p),64)
  |  |  |  |  ------------------
  |  |  |  |  |  |  231|    395|#  define HINT_ALIGNED(p,n) __builtin_assume_aligned((void *)(p),(n))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|    395|    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|    395|    inflate_allocs *alloc_bufs  = (struct inflate_allocs_s *)(buff + alloc_pos);
  186|    395|    alloc_bufs->buf_start = original_buf;
  187|    395|    alloc_bufs->zfree = strm->zfree;
  188|       |
  189|    395|    alloc_bufs->window =  (unsigned char *)HINT_ALIGNED_WINDOW((buff + window_pos));
  ------------------
  |  |  467|    395|#  define HINT_ALIGNED_WINDOW   HINT_ALIGNED_64
  |  |  ------------------
  |  |  |  |  236|    395|#define HINT_ALIGNED_64(p) HINT_ALIGNED((p),64)
  |  |  |  |  ------------------
  |  |  |  |  |  |  231|    395|#  define HINT_ALIGNED(p,n) __builtin_assume_aligned((void *)(p),(n))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  190|    395|    alloc_bufs->state = (inflate_state *)HINT_ALIGNED_64((buff + state_pos));
  ------------------
  |  |  236|    395|#define HINT_ALIGNED_64(p) HINT_ALIGNED((p),64)
  |  |  ------------------
  |  |  |  |  231|    395|#  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|    395|    return alloc_bufs;
  200|    395|}
free_inflate:
  205|    395|Z_INTERNAL void free_inflate(PREFIX3(stream) *strm) {
  206|    395|    struct inflate_state *state = (struct inflate_state *)strm->state;
  207|       |
  208|    395|    if (state->alloc_bufs != NULL) {
  ------------------
  |  Branch (208:9): [True: 395, False: 0]
  ------------------
  209|    395|        inflate_allocs *alloc_bufs = state->alloc_bufs;
  210|    395|        alloc_bufs->zfree(strm->opaque, alloc_bufs->buf_start);
  211|       |        strm->state = NULL;
  212|    395|    }
  213|    395|}
zng_inflateInit2:
  219|    395|int32_t ZNG_CONDEXPORT PREFIX(inflateInit2)(PREFIX3(stream) *strm, int32_t windowBits) {
  220|    395|    struct inflate_state *state;
  221|    395|    int32_t ret;
  222|       |
  223|       |    /* Initialize functable */
  224|    395|    FUNCTABLE_INIT;
  ------------------
  |  |   48|    395|#  define FUNCTABLE_INIT if (functable.force_init()) {return Z_VERSION_ERROR;}
  |  |  ------------------
  |  |  |  |  188|      0|#define Z_VERSION_ERROR (-6)
  |  |  ------------------
  |  |  |  Branch (48:30): [True: 0, False: 395]
  |  |  ------------------
  ------------------
  225|       |
  226|    395|    if (strm == NULL)
  ------------------
  |  Branch (226:9): [True: 0, False: 395]
  ------------------
  227|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  228|    395|    strm->msg = NULL;                   /* in case we return an error */
  229|    395|    if (strm->zalloc == NULL) {
  ------------------
  |  Branch (229:9): [True: 395, False: 0]
  ------------------
  230|    395|        strm->zalloc = PREFIX(zcalloc);
  ------------------
  |  |   97|    395|#  define PREFIX(x) zng_ ## x
  ------------------
  231|    395|        strm->opaque = NULL;
  232|    395|    }
  233|    395|    if (strm->zfree == NULL)
  ------------------
  |  Branch (233:9): [True: 395, False: 0]
  ------------------
  234|    395|        strm->zfree = PREFIX(zcfree);
  ------------------
  |  |   97|    395|#  define PREFIX(x) zng_ ## x
  ------------------
  235|       |
  236|    395|    inflate_allocs *alloc_bufs = alloc_inflate(strm);
  237|    395|    if (alloc_bufs == NULL)
  ------------------
  |  Branch (237:9): [True: 0, False: 395]
  ------------------
  238|      0|        return Z_MEM_ERROR;
  ------------------
  |  |  186|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  239|       |
  240|    395|    state = alloc_bufs->state;
  241|    395|    state->window = alloc_bufs->window;
  242|    395|    state->alloc_bufs = alloc_bufs;
  243|    395|    state->wbufsize = INFLATE_ADJUST_WINDOW_SIZE((1 << MAX_WBITS) + 64);
  ------------------
  |  |   23|    395|#  define INFLATE_ADJUST_WINDOW_SIZE(n) (n)
  ------------------
  244|    395|    Tracev((stderr, "inflate: allocated\n"));
  245|       |
  246|    395|    strm->state = (struct internal_state *)state;
  247|    395|    state->strm = strm;
  248|    395|    state->mode = HEAD;     /* to pass state test in inflateReset2() */
  249|    395|    ret = PREFIX(inflateReset2)(strm, windowBits);
  ------------------
  |  |   97|    395|#  define PREFIX(x) zng_ ## x
  ------------------
  250|    395|    if (ret != Z_OK) {
  ------------------
  |  |  180|    395|#define Z_OK            0
  ------------------
  |  Branch (250:9): [True: 0, False: 395]
  ------------------
  251|      0|        free_inflate(strm);
  252|      0|    }
  253|    395|    return ret;
  254|    395|}
zng_inflateInit:
  257|    395|int32_t Z_EXPORT PREFIX(inflateInit)(PREFIX3(stream) *strm) {
  258|    395|    return PREFIX(inflateInit2)(strm, DEF_WBITS);
  ------------------
  |  |   97|    395|#  define PREFIX(x) zng_ ## x
  ------------------
                  return PREFIX(inflateInit2)(strm, DEF_WBITS);
  ------------------
  |  |   35|    395|#  define DEF_WBITS MAX_WBITS
  |  |  ------------------
  |  |  |  |   39|    395|#  define MAX_WBITS   15 /* 32K LZ77 window */
  |  |  ------------------
  ------------------
  259|    395|}
zng_fixedtables:
  303|  9.03k|void Z_INTERNAL PREFIX(fixedtables)(struct inflate_state *state) {
  304|  9.03k|    state->lencode = lenfix;
  305|  9.03k|    state->lenbits = 9;
  306|  9.03k|    state->distcode = distfix;
  307|  9.03k|    state->distbits = 5;
  308|  9.03k|}
zng_inflate:
  475|    607|int32_t Z_EXPORT PREFIX(inflate)(PREFIX3(stream) *strm, int32_t flush) {
  476|    607|    struct inflate_state *state;
  477|    607|    const unsigned char *next;  /* next input */
  478|    607|    unsigned char *put;         /* next output */
  479|    607|    unsigned char *from;        /* where to copy match bytes from */
  480|    607|    unsigned have, left;        /* available input and output */
  481|    607|    uint64_t hold;              /* bit buffer */
  482|    607|    unsigned bits;              /* bits in bit buffer */
  483|    607|    uint32_t in, out;           /* save starting available input and output */
  484|    607|    unsigned copy;              /* number of stored or match bytes to copy */
  485|    607|    code here;                  /* current decoding table entry */
  486|    607|    code last;                  /* parent table entry */
  487|    607|    unsigned len;               /* length to copy for repeats, bits to drop */
  488|    607|    int32_t ret;                /* return code */
  489|    607|#ifdef GUNZIP
  490|    607|    unsigned char hbuf[4];      /* buffer for gzip header crc calculation */
  491|    607|#endif
  492|    607|    static const uint16_t order[19] = /* permutation of code lengths */
  493|    607|        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
  494|       |
  495|    607|    if (inflateStateCheck(strm) || strm->next_out == NULL ||
  ------------------
  |  Branch (495:9): [True: 0, False: 607]
  |  Branch (495:36): [True: 0, False: 607]
  ------------------
  496|    607|        (strm->next_in == NULL && strm->avail_in != 0))
  ------------------
  |  Branch (496:10): [True: 0, False: 607]
  |  Branch (496:35): [True: 0, False: 0]
  ------------------
  497|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  498|       |
  499|    607|    state = (struct inflate_state *)strm->state;
  500|    607|    if (state->mode == TYPE)      /* skip check */
  ------------------
  |  Branch (500:9): [True: 0, False: 607]
  ------------------
  501|      0|        state->mode = TYPEDO;
  502|    607|    LOAD();
  ------------------
  |  |   77|    607|    do { \
  |  |   78|    607|        put = strm->next_out; \
  |  |   79|    607|        left = strm->avail_out; \
  |  |   80|    607|        next = strm->next_in; \
  |  |   81|    607|        have = strm->avail_in; \
  |  |   82|    607|        hold = state->hold; \
  |  |   83|    607|        bits = state->bits; \
  |  |   84|    607|    } while (0)
  |  |  ------------------
  |  |  |  Branch (84:14): [Folded, False: 607]
  |  |  ------------------
  ------------------
  503|    607|    in = have;
  504|    607|    out = left;
  505|    607|    ret = Z_OK;
  ------------------
  |  |  180|    607|#define Z_OK            0
  ------------------
  506|    607|    for (;;)
  507|  84.4k|        switch (state->mode) {
  508|    395|        case HEAD:
  ------------------
  |  Branch (508:9): [True: 395, False: 84.0k]
  ------------------
  509|    395|            if (state->wrap == 0) {
  ------------------
  |  Branch (509:17): [True: 0, False: 395]
  ------------------
  510|      0|                state->mode = TYPEDO;
  511|      0|                break;
  512|      0|            }
  513|    395|            NEEDBITS(16);
  ------------------
  |  |  107|    395|    do { \
  |  |  108|  1.18k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 790, False: 395]
  |  |  ------------------
  |  |  109|    790|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|    790|    do { \
  |  |  |  |  387|    790|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 0, False: 790]
  |  |  |  |  ------------------
  |  |  |  |  388|    790|        have--; \
  |  |  |  |  389|    790|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|    790|        bits += 8; \
  |  |  |  |  391|    790|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 790]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    395|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 395]
  |  |  ------------------
  ------------------
  514|    395|#ifdef GUNZIP
  515|    395|            if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */
  ------------------
  |  Branch (515:17): [True: 0, False: 395]
  |  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|    395|            if (state->head != NULL)
  ------------------
  |  Branch (524:17): [True: 0, False: 395]
  ------------------
  525|      0|                state->head->done = -1;
  526|    395|            if (!(state->wrap & 1) ||   /* check if zlib header allowed */
  ------------------
  |  Branch (526:17): [True: 0, False: 395]
  ------------------
  527|       |#else
  528|       |            if (
  529|       |#endif
  530|    395|                ((BITS(8) << 8) + (hold >> 8)) % 31) {
  ------------------
  |  |  114|    395|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  |  Branch (530:17): [True: 13, False: 382]
  ------------------
  531|     13|                SET_BAD("incorrect header check");
  ------------------
  |  |  132|     13|    do { \
  |  |  133|     13|        state->mode = BAD; \
  |  |  134|     13|        strm->msg = (char *)errmsg; \
  |  |  135|     13|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 13]
  |  |  ------------------
  ------------------
  532|     13|                break;
  533|     13|            }
  534|    382|            if (BITS(4) != Z_DEFLATED) {
  ------------------
  |  |  114|    382|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
                          if (BITS(4) != Z_DEFLATED) {
  ------------------
  |  |  212|    382|#define Z_DEFLATED   8
  ------------------
  |  Branch (534:17): [True: 3, False: 379]
  ------------------
  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|    379|            DROPBITS(4);
  ------------------
  |  |  118|    379|    do { \
  |  |  119|    379|        hold >>= (n); \
  |  |  120|    379|        bits -= (unsigned)(n); \
  |  |  121|    379|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 379]
  |  |  ------------------
  ------------------
  539|    379|            len = BITS(4) + 8;
  ------------------
  |  |  114|    379|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  540|    379|            if (state->wbits == 0)
  ------------------
  |  Branch (540:17): [True: 0, False: 379]
  ------------------
  541|      0|                state->wbits = len;
  542|    379|            if (len > MAX_WBITS || len > state->wbits) {
  ------------------
  |  |   39|    758|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
  |  Branch (542:17): [True: 0, False: 379]
  |  Branch (542:36): [True: 0, False: 379]
  ------------------
  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|    379|            state->flags = 0;               /* indicate zlib header */
  550|    379|            Tracev((stderr, "inflate:   zlib header ok\n"));
  551|    379|            strm->adler = state->check = ADLER32_INITIAL_VALUE;
  ------------------
  |  |   65|    379|#define ADLER32_INITIAL_VALUE 1 /* initial adler-32 hash value */
  ------------------
  552|    379|            state->mode = hold & 0x200 ? DICTID : TYPE;
  ------------------
  |  Branch (552:27): [True: 0, False: 379]
  ------------------
  553|    379|            INITBITS();
  ------------------
  |  |   99|    379|    do { \
  |  |  100|    379|        hold = 0; \
  |  |  101|    379|        bits = 0; \
  |  |  102|    379|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 379]
  |  |  ------------------
  ------------------
  554|    379|            break;
  555|      0|#ifdef GUNZIP
  556|       |
  557|      0|        case FLAGS:
  ------------------
  |  Branch (557:9): [True: 0, False: 84.4k]
  ------------------
  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: 84.4k]
  ------------------
  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: 84.4k]
  ------------------
  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: 84.4k]
  ------------------
  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: 84.4k]
  ------------------
  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: 84.4k]
  ------------------
  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: 84.4k]
  ------------------
  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: 84.4k]
  ------------------
  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: 84.4k]
  ------------------
  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: 84.4k]
  ------------------
  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|  21.7k|        case TYPE:
  ------------------
  |  Branch (720:9): [True: 21.7k, False: 62.6k]
  ------------------
  721|  21.7k|            if (flush == Z_BLOCK || flush == Z_TREES)
  ------------------
  |  |  176|  43.5k|#define Z_BLOCK         5
  ------------------
                          if (flush == Z_BLOCK || flush == Z_TREES)
  ------------------
  |  |  177|  21.7k|#define Z_TREES         6
  ------------------
  |  Branch (721:17): [True: 0, False: 21.7k]
  |  Branch (721:37): [True: 0, False: 21.7k]
  ------------------
  722|      0|                goto inf_leave;
  723|  21.7k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  21.7k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  724|       |
  725|  21.7k|        case TYPEDO:
  ------------------
  |  Branch (725:9): [True: 0, False: 84.4k]
  ------------------
  726|       |            /* determine and dispatch block type */
  727|  21.7k|            INFLATE_TYPEDO_HOOK(strm, flush);  /* hook for IBM Z DFLTCC */
  ------------------
  |  |   29|  21.7k|#  define INFLATE_TYPEDO_HOOK(strm, flush) do {} while (0)
  |  |  ------------------
  |  |  |  Branch (29:57): [Folded, False: 21.7k]
  |  |  ------------------
  ------------------
  728|  21.7k|            if (state->last) {
  ------------------
  |  Branch (728:17): [True: 50, False: 21.7k]
  ------------------
  729|     50|                BYTEBITS();
  ------------------
  |  |  125|     50|    do { \
  |  |  126|     50|        hold >>= bits & 7; \
  |  |  127|     50|        bits -= bits & 7; \
  |  |  128|     50|    } while (0)
  |  |  ------------------
  |  |  |  Branch (128:14): [Folded, False: 50]
  |  |  ------------------
  ------------------
  730|     50|                state->mode = CHECK;
  731|     50|                break;
  732|     50|            }
  733|  21.7k|            NEEDBITS(3);
  ------------------
  |  |  107|  21.7k|    do { \
  |  |  108|  35.8k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 14.1k, False: 21.7k]
  |  |  ------------------
  |  |  109|  21.7k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  14.1k|    do { \
  |  |  |  |  387|  14.1k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 0, False: 14.1k]
  |  |  |  |  ------------------
  |  |  |  |  388|  14.1k|        have--; \
  |  |  |  |  389|  14.1k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  14.1k|        bits += 8; \
  |  |  |  |  391|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 14.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  21.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 21.7k]
  |  |  ------------------
  ------------------
  734|  21.7k|            state->last = BITS(1);
  ------------------
  |  |  114|  21.7k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  735|  21.7k|            DROPBITS(1);
  ------------------
  |  |  118|  21.7k|    do { \
  |  |  119|  21.7k|        hold >>= (n); \
  |  |  120|  21.7k|        bits -= (unsigned)(n); \
  |  |  121|  21.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 21.7k]
  |  |  ------------------
  ------------------
  736|  21.7k|            switch (BITS(2)) {
  ------------------
  |  |  114|  21.7k|    (hold & ((1U << (unsigned)(n)) - 1))
  |  |  ------------------
  |  |  |  Branch (114:5): [True: 21.7k, False: 0]
  |  |  ------------------
  ------------------
  737|  5.48k|            case 0:                             /* stored block */
  ------------------
  |  Branch (737:13): [True: 5.48k, False: 16.2k]
  ------------------
  738|  5.48k|                Tracev((stderr, "inflate:     stored block%s\n", state->last ? " (last)" : ""));
  739|  5.48k|                state->mode = STORED;
  740|  5.48k|                break;
  741|  9.03k|            case 1:                             /* fixed block */
  ------------------
  |  Branch (741:13): [True: 9.03k, False: 12.6k]
  ------------------
  742|  9.03k|                PREFIX(fixedtables)(state);
  ------------------
  |  |   97|  9.03k|#  define PREFIX(x) zng_ ## x
  ------------------
  743|  9.03k|                Tracev((stderr, "inflate:     fixed codes block%s\n", state->last ? " (last)" : ""));
  744|  9.03k|                state->mode = LEN_;             /* decode codes */
  745|  9.03k|                if (flush == Z_TREES) {
  ------------------
  |  |  177|  9.03k|#define Z_TREES         6
  ------------------
  |  Branch (745:21): [True: 0, False: 9.03k]
  ------------------
  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.03k|                break;
  750|  9.03k|            case 2:                             /* dynamic block */
  ------------------
  |  Branch (750:13): [True: 7.21k, False: 14.5k]
  ------------------
  751|  7.21k|                Tracev((stderr, "inflate:     dynamic codes block%s\n", state->last ? " (last)" : ""));
  752|  7.21k|                state->mode = TABLE;
  753|  7.21k|                break;
  754|      5|            case 3:
  ------------------
  |  Branch (754:13): [True: 5, False: 21.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|  21.7k|            }
  757|  21.7k|            DROPBITS(2);
  ------------------
  |  |  118|  21.7k|    do { \
  |  |  119|  21.7k|        hold >>= (n); \
  |  |  120|  21.7k|        bits -= (unsigned)(n); \
  |  |  121|  21.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 21.7k]
  |  |  ------------------
  ------------------
  758|  21.7k|            break;
  759|       |
  760|  5.48k|        case STORED:
  ------------------
  |  Branch (760:9): [True: 5.48k, False: 78.9k]
  ------------------
  761|       |            /* get and verify stored block length */
  762|  5.48k|            BYTEBITS();                         /* go to byte boundary */
  ------------------
  |  |  125|  5.48k|    do { \
  |  |  126|  5.48k|        hold >>= bits & 7; \
  |  |  127|  5.48k|        bits -= bits & 7; \
  |  |  128|  5.48k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (128:14): [Folded, False: 5.48k]
  |  |  ------------------
  ------------------
  763|  5.48k|            NEEDBITS(32);
  ------------------
  |  |  107|  5.48k|    do { \
  |  |  108|  27.4k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 21.9k, False: 5.48k]
  |  |  ------------------
  |  |  109|  21.9k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  21.9k|    do { \
  |  |  |  |  387|  21.9k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 6, False: 21.9k]
  |  |  |  |  ------------------
  |  |  |  |  388|  21.9k|        have--; \
  |  |  |  |  389|  21.9k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  21.9k|        bits += 8; \
  |  |  |  |  391|  21.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 21.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  5.48k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 5.48k]
  |  |  ------------------
  ------------------
  764|  5.48k|            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
  ------------------
  |  Branch (764:17): [True: 19, False: 5.46k]
  ------------------
  765|     19|                SET_BAD("invalid stored block lengths");
  ------------------
  |  |  132|     19|    do { \
  |  |  133|     19|        state->mode = BAD; \
  |  |  134|     19|        strm->msg = (char *)errmsg; \
  |  |  135|     19|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 19]
  |  |  ------------------
  ------------------
  766|     19|                break;
  767|     19|            }
  768|  5.46k|            state->length = (uint16_t)hold;
  769|  5.46k|            Tracev((stderr, "inflate:       stored length %u\n", state->length));
  770|  5.46k|            INITBITS();
  ------------------
  |  |   99|  5.46k|    do { \
  |  |  100|  5.46k|        hold = 0; \
  |  |  101|  5.46k|        bits = 0; \
  |  |  102|  5.46k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 5.46k]
  |  |  ------------------
  ------------------
  771|  5.46k|            state->mode = COPY_;
  772|  5.46k|            if (flush == Z_TREES)
  ------------------
  |  |  177|  5.46k|#define Z_TREES         6
  ------------------
  |  Branch (772:17): [True: 0, False: 5.46k]
  ------------------
  773|      0|                goto inf_leave;
  774|  5.46k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  5.46k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  775|       |
  776|  5.46k|        case COPY_:
  ------------------
  |  Branch (776:9): [True: 0, False: 84.4k]
  ------------------
  777|  5.46k|            state->mode = COPY;
  778|  5.46k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  5.46k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  779|       |
  780|  5.64k|        case COPY:
  ------------------
  |  Branch (780:9): [True: 187, False: 84.2k]
  ------------------
  781|       |            /* copy stored block from input to output */
  782|  5.64k|            copy = state->length;
  783|  5.64k|            if (copy) {
  ------------------
  |  Branch (783:17): [True: 206, False: 5.44k]
  ------------------
  784|    206|                copy = MIN(copy, have);
  ------------------
  |  |  124|    206|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 51, False: 155]
  |  |  ------------------
  ------------------
  785|    206|                copy = MIN(copy, left);
  ------------------
  |  |  124|    206|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 27, False: 179]
  |  |  ------------------
  ------------------
  786|    206|                if (copy == 0)
  ------------------
  |  Branch (786:21): [True: 38, False: 168]
  ------------------
  787|     38|                    goto inf_leave;
  788|    168|                memcpy(put, next, copy);
  789|    168|                have -= copy;
  790|    168|                next += copy;
  791|    168|                left -= copy;
  792|    168|                put += copy;
  793|    168|                state->length -= copy;
  794|    168|                break;
  795|    206|            }
  796|  5.44k|            Tracev((stderr, "inflate:       stored end\n"));
  797|  5.44k|            state->mode = TYPE;
  798|  5.44k|            break;
  799|       |
  800|  7.21k|        case TABLE:
  ------------------
  |  Branch (800:9): [True: 7.21k, False: 77.2k]
  ------------------
  801|       |            /* get dynamic table entries descriptor */
  802|  7.21k|            NEEDBITS(14);
  ------------------
  |  |  107|  7.21k|    do { \
  |  |  108|  21.6k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 14.4k, False: 7.21k]
  |  |  ------------------
  |  |  109|  14.4k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  14.4k|    do { \
  |  |  |  |  387|  14.4k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 0, False: 14.4k]
  |  |  |  |  ------------------
  |  |  |  |  388|  14.4k|        have--; \
  |  |  |  |  389|  14.4k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  14.4k|        bits += 8; \
  |  |  |  |  391|  14.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 14.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  7.21k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 7.21k]
  |  |  ------------------
  ------------------
  803|  7.21k|            state->nlen = BITS(5) + 257;
  ------------------
  |  |  114|  7.21k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  804|  7.21k|            DROPBITS(5);
  ------------------
  |  |  118|  7.21k|    do { \
  |  |  119|  7.21k|        hold >>= (n); \
  |  |  120|  7.21k|        bits -= (unsigned)(n); \
  |  |  121|  7.21k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 7.21k]
  |  |  ------------------
  ------------------
  805|  7.21k|            state->ndist = BITS(5) + 1;
  ------------------
  |  |  114|  7.21k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  806|  7.21k|            DROPBITS(5);
  ------------------
  |  |  118|  7.21k|    do { \
  |  |  119|  7.21k|        hold >>= (n); \
  |  |  120|  7.21k|        bits -= (unsigned)(n); \
  |  |  121|  7.21k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 7.21k]
  |  |  ------------------
  ------------------
  807|  7.21k|            state->ncode = BITS(4) + 4;
  ------------------
  |  |  114|  7.21k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  808|  7.21k|            DROPBITS(4);
  ------------------
  |  |  118|  7.21k|    do { \
  |  |  119|  7.21k|        hold >>= (n); \
  |  |  120|  7.21k|        bits -= (unsigned)(n); \
  |  |  121|  7.21k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 7.21k]
  |  |  ------------------
  ------------------
  809|  7.21k|#ifndef PKZIP_BUG_WORKAROUND
  810|  7.21k|            if (state->nlen > 286 || state->ndist > 30) {
  ------------------
  |  Branch (810:17): [True: 2, False: 7.20k]
  |  Branch (810:38): [True: 0, False: 7.20k]
  ------------------
  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.20k|#endif
  815|  7.20k|            Tracev((stderr, "inflate:       table sizes ok\n"));
  816|  7.20k|            state->have = 0;
  817|  7.20k|            state->mode = LENLENS;
  818|  7.20k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  7.20k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  819|       |
  820|  7.21k|        case LENLENS:
  ------------------
  |  Branch (820:9): [True: 1, False: 84.4k]
  ------------------
  821|       |            /* get code length code lengths (not a typo) */
  822|   126k|            while (state->have < state->ncode) {
  ------------------
  |  Branch (822:20): [True: 118k, False: 7.20k]
  ------------------
  823|   118k|                NEEDBITS(3);
  ------------------
  |  |  107|   118k|    do { \
  |  |  108|   158k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 39.2k, False: 118k]
  |  |  ------------------
  |  |  109|   118k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  39.2k|    do { \
  |  |  |  |  387|  39.2k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 2, False: 39.2k]
  |  |  |  |  ------------------
  |  |  |  |  388|  39.2k|        have--; \
  |  |  |  |  389|  39.2k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  39.2k|        bits += 8; \
  |  |  |  |  391|  39.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 39.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   118k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  824|   118k|                state->lens[order[state->have++]] = (uint16_t)BITS(3);
  ------------------
  |  |  114|   118k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  825|   118k|                DROPBITS(3);
  ------------------
  |  |  118|   118k|    do { \
  |  |  119|   118k|        hold >>= (n); \
  |  |  120|   118k|        bits -= (unsigned)(n); \
  |  |  121|   118k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  826|   118k|            }
  827|  25.3k|            while (state->have < 19)
  ------------------
  |  Branch (827:20): [True: 18.1k, False: 7.20k]
  ------------------
  828|  18.1k|                state->lens[order[state->have++]] = 0;
  829|  7.20k|            state->next = state->codes;
  830|  7.20k|            state->lencode = (const code *)(state->next);
  831|  7.20k|            state->lenbits = 7;
  832|  7.20k|            ret = zng_inflate_table(CODES, state->lens, 19, &(state->next), &(state->lenbits), state->work);
  833|  7.20k|            if (ret) {
  ------------------
  |  Branch (833:17): [True: 5, False: 7.20k]
  ------------------
  834|      5|                SET_BAD("invalid code lengths set");
  ------------------
  |  |  132|      5|    do { \
  |  |  133|      5|        state->mode = BAD; \
  |  |  134|      5|        strm->msg = (char *)errmsg; \
  |  |  135|      5|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 5]
  |  |  ------------------
  ------------------
  835|      5|                break;
  836|      5|            }
  837|  7.20k|            Tracev((stderr, "inflate:       code lengths ok\n"));
  838|  7.20k|            state->have = 0;
  839|  7.20k|            state->mode = CODELENS;
  840|  7.20k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  7.20k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  841|       |
  842|  7.20k|        case CODELENS:
  ------------------
  |  Branch (842:9): [True: 1, False: 84.4k]
  ------------------
  843|       |            /* get length and distance code code lengths */
  844|   998k|            while (state->have < state->nlen + state->ndist) {
  ------------------
  |  Branch (844:20): [True: 990k, False: 7.19k]
  ------------------
  845|  1.21M|                for (;;) {
  846|  1.21M|                    here = state->lencode[BITS(state->lenbits)];
  ------------------
  |  |  114|  1.21M|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  847|  1.21M|                    if (here.bits <= bits) break;
  ------------------
  |  Branch (847:25): [True: 990k, False: 228k]
  ------------------
  848|   228k|                    PULLBYTE();
  ------------------
  |  |  386|   228k|    do { \
  |  |  387|   228k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 2, False: 228k]
  |  |  ------------------
  |  |  388|   228k|        have--; \
  |  |  389|   228k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|   228k|        bits += 8; \
  |  |  391|   228k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 228k]
  |  |  ------------------
  ------------------
  849|   228k|                }
  850|   990k|                if (here.val < 16) {
  ------------------
  |  Branch (850:21): [True: 902k, False: 88.8k]
  ------------------
  851|   902k|                    DROPBITS(here.bits);
  ------------------
  |  |  118|   902k|    do { \
  |  |  119|   902k|        hold >>= (n); \
  |  |  120|   902k|        bits -= (unsigned)(n); \
  |  |  121|   902k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 902k]
  |  |  ------------------
  ------------------
  852|   902k|                    state->lens[state->have++] = here.val;
  853|   902k|                } else {
  854|  88.8k|                    if (here.val == 16) {
  ------------------
  |  Branch (854:25): [True: 25.5k, False: 63.3k]
  ------------------
  855|  25.5k|                        NEEDBITS(here.bits + 2);
  ------------------
  |  |  107|  25.5k|    do { \
  |  |  108|  31.0k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 5.47k, False: 25.5k]
  |  |  ------------------
  |  |  109|  25.5k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  5.47k|    do { \
  |  |  |  |  387|  5.47k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 0, False: 5.47k]
  |  |  |  |  ------------------
  |  |  |  |  388|  5.47k|        have--; \
  |  |  |  |  389|  5.47k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  5.47k|        bits += 8; \
  |  |  |  |  391|  5.47k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 5.47k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  25.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 25.5k]
  |  |  ------------------
  ------------------
  856|  25.5k|                        DROPBITS(here.bits);
  ------------------
  |  |  118|  25.5k|    do { \
  |  |  119|  25.5k|        hold >>= (n); \
  |  |  120|  25.5k|        bits -= (unsigned)(n); \
  |  |  121|  25.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 25.5k]
  |  |  ------------------
  ------------------
  857|  25.5k|                        if (state->have == 0) {
  ------------------
  |  Branch (857:29): [True: 0, False: 25.5k]
  ------------------
  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|  25.5k|                        len = state->lens[state->have - 1];
  862|  25.5k|                        copy = 3 + BITS(2);
  ------------------
  |  |  114|  25.5k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  863|  25.5k|                        DROPBITS(2);
  ------------------
  |  |  118|  25.5k|    do { \
  |  |  119|  25.5k|        hold >>= (n); \
  |  |  120|  25.5k|        bits -= (unsigned)(n); \
  |  |  121|  25.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 25.5k]
  |  |  ------------------
  ------------------
  864|  63.3k|                    } else if (here.val == 17) {
  ------------------
  |  Branch (864:32): [True: 41.0k, False: 22.2k]
  ------------------
  865|  41.0k|                        NEEDBITS(here.bits + 3);
  ------------------
  |  |  107|  41.0k|    do { \
  |  |  108|  61.5k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 20.4k, False: 41.0k]
  |  |  ------------------
  |  |  109|  41.0k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  20.4k|    do { \
  |  |  |  |  387|  20.4k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 0, False: 20.4k]
  |  |  |  |  ------------------
  |  |  |  |  388|  20.4k|        have--; \
  |  |  |  |  389|  20.4k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  20.4k|        bits += 8; \
  |  |  |  |  391|  20.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 20.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  41.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 41.0k]
  |  |  ------------------
  ------------------
  866|  41.0k|                        DROPBITS(here.bits);
  ------------------
  |  |  118|  41.0k|    do { \
  |  |  119|  41.0k|        hold >>= (n); \
  |  |  120|  41.0k|        bits -= (unsigned)(n); \
  |  |  121|  41.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 41.0k]
  |  |  ------------------
  ------------------
  867|  41.0k|                        len = 0;
  868|  41.0k|                        copy = 3 + BITS(3);
  ------------------
  |  |  114|  41.0k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  869|  41.0k|                        DROPBITS(3);
  ------------------
  |  |  118|  41.0k|    do { \
  |  |  119|  41.0k|        hold >>= (n); \
  |  |  120|  41.0k|        bits -= (unsigned)(n); \
  |  |  121|  41.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 41.0k]
  |  |  ------------------
  ------------------
  870|  41.0k|                    } else {
  871|  22.2k|                        NEEDBITS(here.bits + 7);
  ------------------
  |  |  107|  22.2k|    do { \
  |  |  108|  44.4k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 22.2k, False: 22.2k]
  |  |  ------------------
  |  |  109|  22.2k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|  22.2k|    do { \
  |  |  |  |  387|  22.2k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 0, False: 22.2k]
  |  |  |  |  ------------------
  |  |  |  |  388|  22.2k|        have--; \
  |  |  |  |  389|  22.2k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|  22.2k|        bits += 8; \
  |  |  |  |  391|  22.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 22.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  22.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 22.2k]
  |  |  ------------------
  ------------------
  872|  22.2k|                        DROPBITS(here.bits);
  ------------------
  |  |  118|  22.2k|    do { \
  |  |  119|  22.2k|        hold >>= (n); \
  |  |  120|  22.2k|        bits -= (unsigned)(n); \
  |  |  121|  22.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 22.2k]
  |  |  ------------------
  ------------------
  873|  22.2k|                        len = 0;
  874|  22.2k|                        copy = 11 + BITS(7);
  ------------------
  |  |  114|  22.2k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  875|  22.2k|                        DROPBITS(7);
  ------------------
  |  |  118|  22.2k|    do { \
  |  |  119|  22.2k|        hold >>= (n); \
  |  |  120|  22.2k|        bits -= (unsigned)(n); \
  |  |  121|  22.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 22.2k]
  |  |  ------------------
  ------------------
  876|  22.2k|                    }
  877|  88.8k|                    if (state->have + copy > state->nlen + state->ndist) {
  ------------------
  |  Branch (877:25): [True: 7, False: 88.8k]
  ------------------
  878|      7|                        SET_BAD("invalid bit length repeat");
  ------------------
  |  |  132|      7|    do { \
  |  |  133|      7|        state->mode = BAD; \
  |  |  134|      7|        strm->msg = (char *)errmsg; \
  |  |  135|      7|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 7]
  |  |  ------------------
  ------------------
  879|      7|                        break;
  880|      7|                    }
  881|  1.29M|                    while (copy) {
  ------------------
  |  Branch (881:28): [True: 1.20M, False: 88.8k]
  ------------------
  882|  1.20M|                        --copy;
  883|  1.20M|                        state->lens[state->have++] = (uint16_t)len;
  884|  1.20M|                    }
  885|  88.8k|                }
  886|   990k|            }
  887|       |
  888|       |            /* handle error breaks in while */
  889|  7.20k|            if (state->mode == BAD)
  ------------------
  |  Branch (889:17): [True: 7, False: 7.19k]
  ------------------
  890|      7|                break;
  891|       |
  892|       |            /* check for end-of-block code (better have one) */
  893|  7.19k|            if (state->lens[256] == 0) {
  ------------------
  |  Branch (893:17): [True: 2, False: 7.19k]
  ------------------
  894|      2|                SET_BAD("invalid code -- missing end-of-block");
  ------------------
  |  |  132|      2|    do { \
  |  |  133|      2|        state->mode = BAD; \
  |  |  134|      2|        strm->msg = (char *)errmsg; \
  |  |  135|      2|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
  895|      2|                break;
  896|      2|            }
  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.19k|            state->next = state->codes;
  902|  7.19k|            state->lencode = (const code *)(state->next);
  903|  7.19k|            state->lenbits = 10;
  904|  7.19k|            ret = zng_inflate_table(LENS, state->lens, state->nlen, &(state->next), &(state->lenbits), state->work);
  905|  7.19k|            if (ret) {
  ------------------
  |  Branch (905:17): [True: 15, False: 7.17k]
  ------------------
  906|     15|                SET_BAD("invalid literal/lengths set");
  ------------------
  |  |  132|     15|    do { \
  |  |  133|     15|        state->mode = BAD; \
  |  |  134|     15|        strm->msg = (char *)errmsg; \
  |  |  135|     15|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 15]
  |  |  ------------------
  ------------------
  907|     15|                break;
  908|     15|            }
  909|  7.17k|            state->distcode = (const code *)(state->next);
  910|  7.17k|            state->distbits = 9;
  911|  7.17k|            ret = zng_inflate_table(DISTS, state->lens + state->nlen, state->ndist,
  912|  7.17k|                            &(state->next), &(state->distbits), state->work);
  913|  7.17k|            if (ret) {
  ------------------
  |  Branch (913:17): [True: 11, False: 7.16k]
  ------------------
  914|     11|                SET_BAD("invalid distances set");
  ------------------
  |  |  132|     11|    do { \
  |  |  133|     11|        state->mode = BAD; \
  |  |  134|     11|        strm->msg = (char *)errmsg; \
  |  |  135|     11|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 11]
  |  |  ------------------
  ------------------
  915|     11|                break;
  916|     11|            }
  917|  7.16k|            Tracev((stderr, "inflate:       codes ok\n"));
  918|  7.16k|            state->mode = LEN_;
  919|  7.16k|            if (flush == Z_TREES)
  ------------------
  |  |  177|  7.16k|#define Z_TREES         6
  ------------------
  |  Branch (919:17): [True: 0, False: 7.16k]
  ------------------
  920|      0|                goto inf_leave;
  921|  7.16k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  7.16k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  922|       |
  923|  16.1k|        case LEN_:
  ------------------
  |  Branch (923:9): [True: 9.03k, False: 75.4k]
  ------------------
  924|  16.1k|            state->mode = LEN;
  925|  16.1k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  16.1k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  926|       |
  927|  37.7k|        case LEN:
  ------------------
  |  Branch (927:9): [True: 21.5k, False: 62.9k]
  ------------------
  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.3k|#define INFLATE_FAST_MIN_LEFT 260
  ------------------
  |  Branch (929:17): [True: 36.3k, False: 1.43k]
  |  Branch (929:50): [True: 15.9k, False: 20.3k]
  ------------------
  930|  15.9k|                RESTORE();
  ------------------
  |  |   88|  15.9k|    do { \
  |  |   89|  15.9k|        strm->next_out = put; \
  |  |   90|  15.9k|        strm->avail_out = left; \
  |  |   91|  15.9k|        strm->next_in = (z_const unsigned char *)next; \
  |  |   92|  15.9k|        strm->avail_in = have; \
  |  |   93|  15.9k|        state->hold = hold; \
  |  |   94|  15.9k|        state->bits = bits; \
  |  |   95|  15.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (95:14): [Folded, False: 15.9k]
  |  |  ------------------
  ------------------
  931|  15.9k|                FUNCTABLE_CALL(inflate_fast)(strm, out);
  ------------------
  |  |   49|  15.9k|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
  932|  15.9k|                LOAD();
  ------------------
  |  |   77|  15.9k|    do { \
  |  |   78|  15.9k|        put = strm->next_out; \
  |  |   79|  15.9k|        left = strm->avail_out; \
  |  |   80|  15.9k|        next = strm->next_in; \
  |  |   81|  15.9k|        have = strm->avail_in; \
  |  |   82|  15.9k|        hold = state->hold; \
  |  |   83|  15.9k|        bits = state->bits; \
  |  |   84|  15.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (84:14): [Folded, False: 15.9k]
  |  |  ------------------
  ------------------
  933|  15.9k|                if (state->mode == TYPE)
  ------------------
  |  Branch (933:21): [True: 15.6k, False: 318]
  ------------------
  934|  15.6k|                    state->back = -1;
  935|  15.9k|                break;
  936|  15.9k|            }
  937|  21.7k|            state->back = 0;
  938|       |
  939|       |            /* get a literal, length, or end-of-block code */
  940|  34.5k|            for (;;) {
  941|  34.5k|                here = state->lencode[BITS(state->lenbits)];
  ------------------
  |  |  114|  34.5k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  942|  34.5k|                if (here.bits <= bits)
  ------------------
  |  Branch (942:21): [True: 21.7k, False: 12.8k]
  ------------------
  943|  21.7k|                    break;
  944|  12.8k|                PULLBYTE();
  ------------------
  |  |  386|  12.8k|    do { \
  |  |  387|  12.8k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 70, False: 12.8k]
  |  |  ------------------
  |  |  388|  12.8k|        have--; \
  |  |  389|  12.8k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|  12.8k|        bits += 8; \
  |  |  391|  12.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 12.8k]
  |  |  ------------------
  ------------------
  945|  12.8k|            }
  946|  21.7k|            if (here.op && (here.op & 0xf0) == 0) {
  ------------------
  |  Branch (946:17): [True: 4.74k, False: 16.9k]
  |  Branch (946:28): [True: 2.61k, False: 2.13k]
  ------------------
  947|  2.61k|                last = here;
  948|  3.43k|                for (;;) {
  949|  3.43k|                    here = state->lencode[last.val + (BITS(last.bits + last.op) >> last.bits)];
  ------------------
  |  |  114|  3.43k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  950|  3.43k|                    if ((unsigned)last.bits + (unsigned)here.bits <= bits)
  ------------------
  |  Branch (950:25): [True: 2.60k, False: 824]
  ------------------
  951|  2.60k|                        break;
  952|    824|                    PULLBYTE();
  ------------------
  |  |  386|    824|    do { \
  |  |  387|    824|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 6, False: 818]
  |  |  ------------------
  |  |  388|    824|        have--; \
  |  |  389|    818|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|    818|        bits += 8; \
  |  |  391|    818|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 818]
  |  |  ------------------
  ------------------
  953|    824|                }
  954|  2.60k|                DROPBITS(last.bits);
  ------------------
  |  |  118|  2.60k|    do { \
  |  |  119|  2.60k|        hold >>= (n); \
  |  |  120|  2.60k|        bits -= (unsigned)(n); \
  |  |  121|  2.60k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 2.60k]
  |  |  ------------------
  ------------------
  955|  2.60k|                state->back += last.bits;
  956|  2.60k|            }
  957|  21.7k|            DROPBITS(here.bits);
  ------------------
  |  |  118|  21.7k|    do { \
  |  |  119|  21.7k|        hold >>= (n); \
  |  |  120|  21.7k|        bits -= (unsigned)(n); \
  |  |  121|  21.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 21.7k]
  |  |  ------------------
  ------------------
  958|  21.7k|            state->back += here.bits;
  959|  21.7k|            state->length = here.val;
  960|       |
  961|       |            /* process literal */
  962|  21.7k|            if ((int)(here.op) == 0) {
  ------------------
  |  Branch (962:17): [True: 18.3k, False: 3.37k]
  ------------------
  963|  18.3k|                Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
  964|  18.3k|                        "inflate:         literal '%c'\n" :
  965|  18.3k|                        "inflate:         literal 0x%02x\n", here.val));
  966|  18.3k|                state->mode = LIT;
  967|  18.3k|                break;
  968|  18.3k|            }
  969|       |
  970|       |            /* process end of block */
  971|  3.37k|            if (here.op & 32) {
  ------------------
  |  Branch (971:17): [True: 312, False: 3.05k]
  ------------------
  972|    312|                Tracevv((stderr, "inflate:         end of block\n"));
  973|    312|                state->back = -1;
  974|    312|                state->mode = TYPE;
  975|    312|                break;
  976|    312|            }
  977|       |
  978|       |            /* invalid code */
  979|  3.05k|            if (here.op & 64) {
  ------------------
  |  Branch (979:17): [True: 0, False: 3.05k]
  ------------------
  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|  3.05k|            state->extra = (here.op & MAX_BITS);
  ------------------
  |  |   39|  3.05k|#define MAX_BITS 15
  ------------------
  986|  3.05k|            state->mode = LENEXT;
  987|  3.05k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  3.05k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
  988|       |
  989|  3.05k|        case LENEXT:
  ------------------
  |  Branch (989:9): [True: 0, False: 84.4k]
  ------------------
  990|       |            /* get extra bits, if any */
  991|  3.05k|            if (state->extra) {
  ------------------
  |  Branch (991:17): [True: 728, False: 2.33k]
  ------------------
  992|    728|                NEEDBITS(state->extra);
  ------------------
  |  |  107|    728|    do { \
  |  |  108|    926|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 198, False: 728]
  |  |  ------------------
  |  |  109|    728|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|    198|    do { \
  |  |  |  |  387|    198|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 0, False: 198]
  |  |  |  |  ------------------
  |  |  |  |  388|    198|        have--; \
  |  |  |  |  389|    198|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|    198|        bits += 8; \
  |  |  |  |  391|    198|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 198]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    728|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 728]
  |  |  ------------------
  ------------------
  993|    728|                state->length += BITS(state->extra);
  ------------------
  |  |  114|    728|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
  994|    728|                DROPBITS(state->extra);
  ------------------
  |  |  118|    728|    do { \
  |  |  119|    728|        hold >>= (n); \
  |  |  120|    728|        bits -= (unsigned)(n); \
  |  |  121|    728|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 728]
  |  |  ------------------
  ------------------
  995|    728|                state->back += state->extra;
  996|    728|            }
  997|  3.05k|            Tracevv((stderr, "inflate:         length %u\n", state->length));
  998|  3.05k|            state->was = state->length;
  999|  3.05k|            state->mode = DIST;
 1000|  3.05k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  3.05k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1001|       |
 1002|  3.06k|        case DIST:
  ------------------
  |  Branch (1002:9): [True: 6, False: 84.4k]
  ------------------
 1003|       |            /* get distance code */
 1004|  4.64k|            for (;;) {
 1005|  4.64k|                here = state->distcode[BITS(state->distbits)];
  ------------------
  |  |  114|  4.64k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
 1006|  4.64k|                if (here.bits <= bits)
  ------------------
  |  Branch (1006:21): [True: 3.05k, False: 1.58k]
  ------------------
 1007|  3.05k|                    break;
 1008|  1.58k|                PULLBYTE();
  ------------------
  |  |  386|  1.58k|    do { \
  |  |  387|  1.58k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 8, False: 1.57k]
  |  |  ------------------
  |  |  388|  1.58k|        have--; \
  |  |  389|  1.57k|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|  1.57k|        bits += 8; \
  |  |  391|  1.57k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 1.57k]
  |  |  ------------------
  ------------------
 1009|  1.58k|            }
 1010|  3.05k|            if ((here.op & 0xf0) == 0) {
  ------------------
  |  Branch (1010:17): [True: 664, False: 2.39k]
  ------------------
 1011|    664|                last = here;
 1012|    946|                for (;;) {
 1013|    946|                    here = state->distcode[last.val + (BITS(last.bits + last.op) >> last.bits)];
  ------------------
  |  |  114|    946|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
 1014|    946|                    if ((unsigned)last.bits + (unsigned)here.bits <= bits)
  ------------------
  |  Branch (1014:25): [True: 660, False: 286]
  ------------------
 1015|    660|                        break;
 1016|    286|                    PULLBYTE();
  ------------------
  |  |  386|    286|    do { \
  |  |  387|    286|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (387:13): [True: 4, False: 282]
  |  |  ------------------
  |  |  388|    286|        have--; \
  |  |  389|    282|        hold += ((uint64_t)(*next++) << bits); \
  |  |  390|    282|        bits += 8; \
  |  |  391|    282|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 282]
  |  |  ------------------
  ------------------
 1017|    286|                }
 1018|    660|                DROPBITS(last.bits);
  ------------------
  |  |  118|    660|    do { \
  |  |  119|    660|        hold >>= (n); \
  |  |  120|    660|        bits -= (unsigned)(n); \
  |  |  121|    660|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 660]
  |  |  ------------------
  ------------------
 1019|    660|                state->back += last.bits;
 1020|    660|            }
 1021|  3.05k|            DROPBITS(here.bits);
  ------------------
  |  |  118|  3.05k|    do { \
  |  |  119|  3.05k|        hold >>= (n); \
  |  |  120|  3.05k|        bits -= (unsigned)(n); \
  |  |  121|  3.05k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 3.05k]
  |  |  ------------------
  ------------------
 1022|  3.05k|            state->back += here.bits;
 1023|  3.05k|            if (here.op & 64) {
  ------------------
  |  Branch (1023:17): [True: 5, False: 3.04k]
  ------------------
 1024|      5|                SET_BAD("invalid distance code");
  ------------------
  |  |  132|      5|    do { \
  |  |  133|      5|        state->mode = BAD; \
  |  |  134|      5|        strm->msg = (char *)errmsg; \
  |  |  135|      5|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 5]
  |  |  ------------------
  ------------------
 1025|      5|                break;
 1026|      5|            }
 1027|  3.04k|            state->offset = here.val;
 1028|  3.04k|            state->extra = (here.op & MAX_BITS);
  ------------------
  |  |   39|  3.04k|#define MAX_BITS 15
  ------------------
 1029|  3.04k|            state->mode = DISTEXT;
 1030|  3.04k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  3.04k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1031|       |
 1032|  3.05k|        case DISTEXT:
  ------------------
  |  Branch (1032:9): [True: 4, False: 84.4k]
  ------------------
 1033|       |            /* get distance extra bits, if any */
 1034|  3.05k|            if (state->extra) {
  ------------------
  |  Branch (1034:17): [True: 1.53k, False: 1.51k]
  ------------------
 1035|  1.53k|                NEEDBITS(state->extra);
  ------------------
  |  |  107|  1.53k|    do { \
  |  |  108|  2.16k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 634, False: 1.53k]
  |  |  ------------------
  |  |  109|  1.53k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|    634|    do { \
  |  |  |  |  387|    634|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 8, False: 626]
  |  |  |  |  ------------------
  |  |  |  |  388|    634|        have--; \
  |  |  |  |  389|    626|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|    626|        bits += 8; \
  |  |  |  |  391|    626|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 626]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  1.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 1.53k]
  |  |  ------------------
  ------------------
 1036|  1.53k|                state->offset += BITS(state->extra);
  ------------------
  |  |  114|  1.53k|    (hold & ((1U << (unsigned)(n)) - 1))
  ------------------
 1037|  1.53k|                DROPBITS(state->extra);
  ------------------
  |  |  118|  1.53k|    do { \
  |  |  119|  1.53k|        hold >>= (n); \
  |  |  120|  1.53k|        bits -= (unsigned)(n); \
  |  |  121|  1.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (121:14): [Folded, False: 1.53k]
  |  |  ------------------
  ------------------
 1038|  1.53k|                state->back += state->extra;
 1039|  1.53k|            }
 1040|       |#ifdef INFLATE_STRICT
 1041|       |            if (state->offset > state->dmax) {
 1042|       |                SET_BAD("invalid distance too far back");
 1043|       |                break;
 1044|       |            }
 1045|       |#endif
 1046|  3.04k|            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
 1047|  3.04k|            state->mode = MATCH;
 1048|  3.04k|            Z_FALLTHROUGH;
  ------------------
  |  |   45|  3.04k|#    define Z_FALLTHROUGH __attribute__((__fallthrough__))
  ------------------
 1049|       |
 1050|  3.23k|        case MATCH:
  ------------------
  |  Branch (1050:9): [True: 188, False: 84.2k]
  ------------------
 1051|       |            /* copy match from window to output */
 1052|  3.23k|            if (left == 0)
  ------------------
  |  Branch (1052:17): [True: 198, False: 3.03k]
  ------------------
 1053|    198|                goto inf_leave;
 1054|  3.03k|            copy = out - left;
 1055|  3.03k|            if (state->offset > copy) {         /* copy from window */
  ------------------
  |  Branch (1055:17): [True: 23, False: 3.01k]
  ------------------
 1056|     23|                copy = state->offset - copy;
 1057|     23|                if (copy > state->whave) {
  ------------------
  |  Branch (1057:21): [True: 23, 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|     23|                    SET_BAD("invalid distance too far back");
  ------------------
  |  |  132|     23|    do { \
  |  |  133|     23|        state->mode = BAD; \
  |  |  134|     23|        strm->msg = (char *)errmsg; \
  |  |  135|     23|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 23]
  |  |  ------------------
  ------------------
 1076|     23|#endif
 1077|     23|                    break;
 1078|     23|                }
 1079|      0|                if (copy > state->wnext) {
  ------------------
  |  Branch (1079:21): [True: 0, False: 0]
  ------------------
 1080|      0|                    copy -= state->wnext;
 1081|      0|                    from = state->window + (state->wsize - copy);
 1082|      0|                } else {
 1083|      0|                    from = state->window + (state->wnext - copy);
 1084|      0|                }
 1085|      0|                copy = MIN(copy, state->length);
  ------------------
  |  |  124|      0|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1086|      0|                copy = MIN(copy, left);
  ------------------
  |  |  124|      0|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1087|       |
 1088|      0|                put = chunkcopy_safe(put, from, copy, put + left);
 1089|  3.01k|            } else {
 1090|  3.01k|                copy = MIN(state->length, left);
  ------------------
  |  |  124|  3.01k|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 89, False: 2.92k]
  |  |  ------------------
  ------------------
 1091|       |
 1092|  3.01k|                put = FUNCTABLE_CALL(chunkmemset_safe)(put, put - state->offset, copy, left);
  ------------------
  |  |   49|  3.01k|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
 1093|  3.01k|            }
 1094|  3.01k|            left -= copy;
 1095|  3.01k|            state->length -= copy;
 1096|  3.01k|            if (state->length == 0)
  ------------------
  |  Branch (1096:17): [True: 2.92k, False: 89]
  ------------------
 1097|  2.92k|                state->mode = LEN;
 1098|  3.01k|            break;
 1099|       |
 1100|  18.3k|        case LIT:
  ------------------
  |  Branch (1100:9): [True: 18.3k, False: 66.0k]
  ------------------
 1101|  18.3k|            if (left == 0)
  ------------------
  |  Branch (1101:17): [True: 82, False: 18.3k]
  ------------------
 1102|     82|                goto inf_leave;
 1103|  18.3k|            *put++ = (unsigned char)(state->length);
 1104|  18.3k|            left--;
 1105|  18.3k|            state->mode = LEN;
 1106|  18.3k|            break;
 1107|       |
 1108|     50|        case CHECK:
  ------------------
  |  Branch (1108:9): [True: 50, False: 84.4k]
  ------------------
 1109|     50|            if (state->wrap) {
  ------------------
  |  Branch (1109:17): [True: 50, False: 0]
  ------------------
 1110|     50|                NEEDBITS(32);
  ------------------
  |  |  107|     50|    do { \
  |  |  108|    250|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (108:16): [True: 200, False: 50]
  |  |  ------------------
  |  |  109|    200|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  386|    200|    do { \
  |  |  |  |  387|    200|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (387:13): [True: 0, False: 200]
  |  |  |  |  ------------------
  |  |  |  |  388|    200|        have--; \
  |  |  |  |  389|    200|        hold += ((uint64_t)(*next++) << bits); \
  |  |  |  |  390|    200|        bits += 8; \
  |  |  |  |  391|    200|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (391:14): [Folded, False: 200]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     50|    } while (0)
  |  |  ------------------
  |  |  |  Branch (110:14): [Folded, False: 50]
  |  |  ------------------
  ------------------
 1111|     50|                out -= left;
 1112|     50|                strm->total_out += out;
 1113|     50|                state->total += out;
 1114|       |
 1115|       |                /* compute crc32 checksum if not in raw mode */
 1116|     50|                if (INFLATE_NEED_CHECKSUM(strm) && state->wrap & 4) {
  ------------------
  |  |   31|    100|#  define INFLATE_NEED_CHECKSUM(strm) 1
  |  |  ------------------
  |  |  |  Branch (31:39): [True: 50, Folded]
  |  |  ------------------
  ------------------
  |  Branch (1116:52): [True: 50, False: 0]
  ------------------
 1117|     50|                    if (out) {
  ------------------
  |  Branch (1117:25): [True: 50, False: 0]
  ------------------
 1118|     50|                        inf_chksum(strm, put - out, out);
 1119|     50|                    }
 1120|     50|#ifdef GUNZIP
 1121|     50|                    if (state->flags)
  ------------------
  |  Branch (1121:25): [True: 0, False: 50]
  ------------------
 1122|      0|                        strm->adler = state->check = FUNCTABLE_CALL(crc32_fold_final)(&state->crc_fold);
  ------------------
  |  |   49|      0|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
 1123|     50|#endif
 1124|     50|                }
 1125|     50|                out = left;
 1126|     50|                if ((state->wrap & 4) && (
  ------------------
  |  Branch (1126:21): [True: 50, False: 0]
  |  Branch (1126:42): [True: 50, False: 0]
  ------------------
 1127|     50|#ifdef GUNZIP
 1128|     50|                     state->flags ? hold :
  ------------------
  |  Branch (1128:22): [True: 0, False: 50]
  ------------------
 1129|     50|#endif
 1130|     50|                     ZSWAP32((unsigned)hold)) != state->check) {
  ------------------
  |  |  170|     50|#  define ZSWAP32(q) __builtin_bswap32(q)
  ------------------
 1131|     50|                    SET_BAD("incorrect data check");
  ------------------
  |  |  132|     50|    do { \
  |  |  133|     50|        state->mode = BAD; \
  |  |  134|     50|        strm->msg = (char *)errmsg; \
  |  |  135|     50|    } while (0)
  |  |  ------------------
  |  |  |  Branch (135:14): [Folded, False: 50]
  |  |  ------------------
  ------------------
 1132|     50|                    break;
 1133|     50|                }
 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: 84.4k]
  ------------------
 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: 84.4k]
  ------------------
 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|    183|        case BAD:
  ------------------
  |  Branch (1160:9): [True: 183, False: 84.2k]
  ------------------
 1161|    183|            ret = Z_DATA_ERROR;
  ------------------
  |  |  185|    183|#define Z_DATA_ERROR   (-3)
  ------------------
 1162|    183|            goto inf_leave;
 1163|       |
 1164|      0|        case SYNC:
  ------------------
  |  Branch (1164:9): [True: 0, False: 84.4k]
  ------------------
 1165|       |
 1166|      0|        default:                 /* can't happen, but makes compilers happy */
  ------------------
  |  Branch (1166:9): [True: 0, False: 84.4k]
  ------------------
 1167|      0|            return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1168|  84.4k|        }
 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|    607|  inf_leave:
 1176|    607|    RESTORE();
  ------------------
  |  |   88|    607|    do { \
  |  |   89|    607|        strm->next_out = put; \
  |  |   90|    607|        strm->avail_out = left; \
  |  |   91|    607|        strm->next_in = (z_const unsigned char *)next; \
  |  |   92|    607|        strm->avail_in = have; \
  |  |   93|    607|        state->hold = hold; \
  |  |   94|    607|        state->bits = bits; \
  |  |   95|    607|    } while (0)
  |  |  ------------------
  |  |  |  Branch (95:14): [Folded, False: 607]
  |  |  ------------------
  ------------------
 1177|    607|    uint32_t check_bytes = out - strm->avail_out;
 1178|    607|    if (INFLATE_NEED_UPDATEWINDOW(strm) &&
  ------------------
  |  |   33|  1.21k|#  define INFLATE_NEED_UPDATEWINDOW(strm) 1
  |  |  ------------------
  |  |  |  Branch (33:43): [True: 607, Folded]
  |  |  ------------------
  ------------------
 1179|    607|            (state->wsize || (out != strm->avail_out && state->mode < BAD &&
  ------------------
  |  Branch (1179:14): [True: 212, False: 395]
  |  Branch (1179:31): [True: 313, False: 82]
  |  Branch (1179:57): [True: 212, False: 101]
  ------------------
 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|    607|    in -= strm->avail_in;
 1185|    607|    out -= strm->avail_out;
 1186|    607|    strm->total_in += in;
 1187|    607|    strm->total_out += out;
 1188|    607|    state->total += out;
 1189|       |
 1190|    607|    strm->data_type = (int)state->bits + (state->last ? 64 : 0) +
  ------------------
  |  Branch (1190:43): [True: 91, False: 516]
  ------------------
 1191|    607|                      (state->mode == TYPE ? 128 : 0) + (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
  ------------------
  |  Branch (1191:24): [True: 0, False: 607]
  |  Branch (1191:58): [True: 0, False: 607]
  |  Branch (1191:81): [True: 0, False: 607]
  ------------------
 1192|    607|    if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) {
  ------------------
  |  |  175|    395|#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: 395]
  |  Branch (1192:22): [True: 212, False: 0]
  |  Branch (1192:35): [True: 0, False: 395]
  |  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|    607|    return ret;
 1200|    607|}
zng_inflateEnd:
 1202|    395|int32_t Z_EXPORT PREFIX(inflateEnd)(PREFIX3(stream) *strm) {
 1203|    395|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (1203:9): [True: 0, False: 395]
  ------------------
 1204|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  184|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1205|       |
 1206|       |    /* Free allocated buffers */
 1207|    395|    free_inflate(strm);
 1208|       |
 1209|    395|    Tracev((stderr, "inflate: end\n"));
 1210|    395|    return Z_OK;
  ------------------
  |  |  180|    395|#define Z_OK            0
  ------------------
 1211|    395|}
inflate.c:inflateStateCheck:
   51|  2.18k|static int inflateStateCheck(PREFIX3(stream) *strm) {
   52|  2.18k|    struct inflate_state *state;
   53|  2.18k|    if (strm == NULL || strm->zalloc == NULL || strm->zfree == NULL)
  ------------------
  |  Branch (53:9): [True: 0, False: 2.18k]
  |  Branch (53:25): [True: 0, False: 2.18k]
  |  Branch (53:49): [True: 0, False: 2.18k]
  ------------------
   54|      0|        return 1;
   55|  2.18k|    state = (struct inflate_state *)strm->state;
   56|  2.18k|    if (state == NULL || state->alloc_bufs == NULL || state->strm != strm || state->mode < HEAD || state->mode > SYNC)
  ------------------
  |  Branch (56:9): [True: 0, False: 2.18k]
  |  Branch (56:26): [True: 0, False: 2.18k]
  |  Branch (56:55): [True: 0, False: 2.18k]
  |  Branch (56:78): [True: 0, False: 2.18k]
  |  Branch (56:100): [True: 0, False: 2.18k]
  ------------------
   57|      0|        return 1;
   58|  2.18k|    return 0;
   59|  2.18k|}
inflate.c:inf_chksum:
   39|     90|static inline void inf_chksum(PREFIX3(stream) *strm, const uint8_t *src, uint32_t len) {
   40|     90|    struct inflate_state *state = (struct inflate_state*)strm->state;
   41|     90|#ifdef GUNZIP
   42|     90|    if (state->flags) {
  ------------------
  |  Branch (42:9): [True: 0, False: 90]
  ------------------
   43|      0|        FUNCTABLE_CALL(crc32_fold)(&state->crc_fold, src, len, 0);
  ------------------
  |  |   49|      0|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
   44|      0|    } else
   45|     90|#endif
   46|     90|    {
   47|     90|        strm->adler = state->check = FUNCTABLE_CALL(adler32)(state->check, src, len);
  ------------------
  |  |   49|     90|#  define FUNCTABLE_CALL(name) functable.name
  ------------------
   48|     90|    }
   49|     90|}
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: 41, False: 383]
  ------------------
  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|     41|        if (INFLATE_NEED_CHECKSUM(strm) && cksum) {
  ------------------
  |  |   31|     82|#  define INFLATE_NEED_CHECKSUM(strm) 1
  |  |  ------------------
  |  |  |  Branch (31:39): [True: 41, Folded]
  |  |  ------------------
  ------------------
  |  Branch (338:44): [True: 41, False: 0]
  ------------------
  339|       |            /* We have to split the checksum over non-copied and copied bytes */
  340|     41|            if (len > state->wsize)
  ------------------
  |  Branch (340:17): [True: 40, False: 1]
  ------------------
  341|     40|                inf_chksum(strm, end - len, len - state->wsize);
  342|     41|            inf_chksum_cpy(strm, state->window, end - state->wsize, state->wsize);
  343|     41|        } else {
  344|      0|            memcpy(state->window, end - state->wsize, state->wsize);
  345|      0|        }
  346|       |
  347|     41|        state->wnext = 0;
  348|     41|        state->whave = state->wsize;
  349|    383|    } else {
  350|    383|        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|    383|        dist = MIN(dist, len);
  ------------------
  |  |  124|    383|#define MIN(a, b) ((a) > (b) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (124:20): [True: 383, False: 0]
  |  |  ------------------
  ------------------
  354|    383|        if (INFLATE_NEED_CHECKSUM(strm) && cksum) {
  ------------------
  |  |   31|    766|#  define INFLATE_NEED_CHECKSUM(strm) 1
  |  |  ------------------
  |  |  |  Branch (31:39): [True: 383, Folded]
  |  |  ------------------
  ------------------
  |  Branch (354:44): [True: 383, False: 0]
  ------------------
  355|    383|            inf_chksum_cpy(strm, state->window + state->wnext, end - len, dist);
  356|    383|        } else {
  357|      0|            memcpy(state->window + state->wnext, end - len, dist);
  358|      0|        }
  359|    383|        len -= dist;
  360|    383|        if (len) {
  ------------------
  |  Branch (360:13): [True: 0, False: 383]
  ------------------
  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|    383|        } else {
  370|    383|            state->wnext += dist;
  371|    383|            if (state->wnext == state->wsize)
  ------------------
  |  Branch (371:17): [True: 0, False: 383]
  ------------------
  372|      0|                state->wnext = 0;
  373|    383|            if (state->whave < state->wsize)
  ------------------
  |  Branch (373:17): [True: 342, False: 41]
  ------------------
  374|    342|                state->whave += dist;
  375|    383|        }
  376|    383|    }
  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.38M|static inline uint64_t load_64_bits(const unsigned char *in, unsigned bits) {
  142|  2.38M|    uint64_t chunk = zng_memread_8(in);
  143|       |
  144|  2.38M|#if BYTE_ORDER == LITTLE_ENDIAN
  145|  2.38M|    return chunk << bits;
  146|       |#else
  147|       |    return ZSWAP64(chunk) << bits;
  148|       |#endif
  149|  2.38M|}

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

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

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

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

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

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

zstd_decompress_block.c:ZSTD_highbit32:
  175|   581k|{
  176|   581k|    assert(val != 0);
  ------------------
  |  |   70|   581k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|   581k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|   581k|}
zstd_decompress_block.c:ZSTD_countLeadingZeros32:
   70|   581k|{
   71|   581k|    assert(val != 0);
  ------------------
  |  |   70|   581k|#    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|   581k|}
entropy_common.c:ZSTD_countTrailingZeros32:
   29|  5.44k|{
   30|  5.44k|    assert(val != 0);
  ------------------
  |  |   70|  5.44k|#    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.44k|}
entropy_common.c:ZSTD_highbit32:
  175|  36.2k|{
  176|  36.2k|    assert(val != 0);
  ------------------
  |  |   70|  36.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  36.2k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  36.2k|}
entropy_common.c:ZSTD_countLeadingZeros32:
   70|  36.2k|{
   71|  36.2k|    assert(val != 0);
  ------------------
  |  |   70|  36.2k|#    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.2k|}
fse_decompress.c:ZSTD_highbit32:
  175|   162k|{
  176|   162k|    assert(val != 0);
  ------------------
  |  |   70|   162k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|   162k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|   162k|}
fse_decompress.c:ZSTD_countLeadingZeros32:
   70|   162k|{
   71|   162k|    assert(val != 0);
  ------------------
  |  |   70|   162k|#    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|   162k|}
huf_decompress.c:ZSTD_highbit32:
  175|  7.37k|{
  176|  7.37k|    assert(val != 0);
  ------------------
  |  |   70|  7.37k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  177|  7.37k|    return 31 - ZSTD_countLeadingZeros32(val);
  178|  7.37k|}
huf_decompress.c:ZSTD_countLeadingZeros32:
   70|  7.37k|{
   71|  7.37k|    assert(val != 0);
  ------------------
  |  |   70|  7.37k|#    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.37k|}
huf_decompress.c:ZSTD_countTrailingZeros64:
   94|  11.2k|{
   95|  11.2k|    assert(val != 0);
  ------------------
  |  |   70|  11.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
   96|       |#if defined(_MSC_VER) && defined(_WIN64)
   97|       |#  if STATIC_BMI2
   98|       |    return (unsigned)_tzcnt_u64(val);
   99|       |#  else
  100|       |    if (val != 0) {
  101|       |        unsigned long r;
  102|       |        _BitScanForward64(&r, val);
  103|       |        return (unsigned)r;
  104|       |    } else {
  105|       |        __assume(0); /* Should not reach this code path */
  106|       |    }
  107|       |#  endif
  108|       |#elif defined(__GNUC__) && (__GNUC__ >= 4) && defined(__LP64__)
  109|       |    return (unsigned)__builtin_ctzll(val);
  110|       |#elif defined(__ICCARM__)
  111|       |    return (unsigned)__builtin_ctzll(val);
  112|       |#else
  113|       |    {
  114|       |        U32 mostSignificantWord = (U32)(val >> 32);
  115|       |        U32 leastSignificantWord = (U32)val;
  116|       |        if (leastSignificantWord == 0) {
  117|       |            return 32 + ZSTD_countTrailingZeros32(mostSignificantWord);
  118|       |        } else {
  119|       |            return ZSTD_countTrailingZeros32(leastSignificantWord);
  120|       |        }
  121|       |    }
  122|       |#endif
  123|  11.2k|}

zstd_decompress_block.c:BIT_initDStream:
  255|  3.24k|{
  256|  3.24k|    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.24k]
  ------------------
  257|       |
  258|  3.24k|    bitD->start = (const char*)srcBuffer;
  259|  3.24k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  3.24k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 1.18k, False: 2.05k]
  ------------------
  262|  1.18k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|  1.18k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|  1.18k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|  1.18k|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 1.12k, False: 58]
  ------------------
  266|  1.18k|          if (lastByte == 0) return ERROR(GENERIC); /* endMark not present */ }
  ------------------
  |  |   49|     58|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     58|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     58|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:15): [True: 58, False: 1.12k]
  ------------------
  267|  2.05k|    } else {
  268|  2.05k|        bitD->ptr   = bitD->start;
  269|  2.05k|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|  2.05k|        switch(srcSize)
  271|  2.05k|        {
  272|    183|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 183, False: 1.87k]
  ------------------
  273|    183|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    183|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|    355|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 172, False: 1.88k]
  ------------------
  276|    355|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    355|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|    548|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 193, False: 1.86k]
  ------------------
  279|    548|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    548|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|  1.18k|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 639, False: 1.41k]
  ------------------
  282|  1.18k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.18k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|  1.35k|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 171, False: 1.88k]
  ------------------
  285|  1.35k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.35k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|  1.75k|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 394, False: 1.66k]
  ------------------
  288|  1.75k|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|  1.75k|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|  2.05k|        default: break;
  ------------------
  |  Branch (290:9): [True: 306, False: 1.75k]
  ------------------
  291|  2.05k|        }
  292|  2.05k|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|  2.05k|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 2.05k, False: 6]
  ------------------
  294|  2.05k|            if (lastByte == 0) return ERROR(corruption_detected);  /* endMark not present */
  ------------------
  |  |   49|      6|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      6|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      6|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (294:17): [True: 6, False: 2.05k]
  ------------------
  295|  2.05k|        }
  296|  2.05k|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|  2.05k|    }
  298|       |
  299|  3.17k|    return srcSize;
  300|  3.24k|}
zstd_decompress_block.c:BIT_readBits:
  363|  14.0M|{
  364|  14.0M|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|  14.0M|    BIT_skipBits(bitD, nbBits);
  366|  14.0M|    return value;
  367|  14.0M|}
zstd_decompress_block.c:BIT_lookBits:
  331|  14.0M|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|  14.0M|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|  14.0M|    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.0M|}
zstd_decompress_block.c:BIT_getMiddleBits:
  308|  14.0M|{
  309|  14.0M|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|  14.0M|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|  14.0M|#    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.0M|#if defined(__x86_64__) || defined(_M_X64)
  318|  14.0M|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|  14.0M|}
zstd_decompress_block.c:BIT_skipBits:
  354|  18.3M|{
  355|  18.3M|    bitD->bitsConsumed += nbBits;
  356|  18.3M|}
zstd_decompress_block.c:BIT_reloadDStream:
  413|  4.69M|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|  4.69M|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|  4.69M|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 162k, False: 4.52M]
  |  |  ------------------
  ------------------
  416|   162k|        static const BitContainerType zeroFilled = 0;
  417|   162k|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|   162k|        return BIT_DStream_overflow;
  420|   162k|    }
  421|       |
  422|  4.52M|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  4.52M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|  4.52M|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 4.51M, False: 12.0k]
  ------------------
  425|  4.51M|        return BIT_reloadDStream_internal(bitD);
  426|  4.51M|    }
  427|  12.0k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 11.1k, False: 919]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  11.1k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 10.4k, False: 675]
  ------------------
  430|    675|        return BIT_DStream_completed;
  431|  11.1k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|    919|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|    919|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|    919|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 43, False: 876]
  ------------------
  436|     43|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|     43|            result = BIT_DStream_endOfBuffer;
  438|     43|        }
  439|    919|        bitD->ptr -= nbBytes;
  440|    919|        bitD->bitsConsumed -= nbBytes*8;
  441|    919|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|    919|        return result;
  443|  12.0k|    }
  444|  12.0k|}
zstd_decompress_block.c:BIT_reloadDStream_internal:
  385|  4.51M|{
  386|  4.51M|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  4.51M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  4.51M|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  4.51M|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  4.51M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  4.51M|    bitD->bitsConsumed &= 7;
  390|  4.51M|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  4.51M|    return BIT_DStream_unfinished;
  392|  4.51M|}
zstd_decompress_block.c:BIT_readBitsFast:
  372|  4.31M|{
  373|  4.31M|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  4.31M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  4.31M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  4.31M|    BIT_skipBits(bitD, nbBits);
  376|  4.31M|    return value;
  377|  4.31M|}
zstd_decompress_block.c:BIT_lookBitsFast:
  347|  4.31M|{
  348|  4.31M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  4.31M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  4.31M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  4.31M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  4.31M|}
zstd_decompress_block.c:BIT_endOfDStream:
  450|  2.15k|{
  451|  2.15k|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 2.13k, False: 17]
  |  Branch (451:49): [True: 2.11k, False: 14]
  ------------------
  452|  2.15k|}
fse_decompress.c:BIT_initDStream:
  255|  3.96k|{
  256|  3.96k|    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: 3.96k]
  ------------------
  257|       |
  258|  3.96k|    bitD->start = (const char*)srcBuffer;
  259|  3.96k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  3.96k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 3.59k, False: 373]
  ------------------
  262|  3.59k|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  263|  3.59k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  264|  3.59k|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  265|  3.59k|          bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;  /* ensures bitsConsumed is always set */
  ------------------
  |  Branch (265:32): [True: 3.58k, False: 5]
  ------------------
  266|  3.59k|          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: 3.58k]
  ------------------
  267|  3.59k|    } else {
  268|    373|        bitD->ptr   = bitD->start;
  269|    373|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|    373|        switch(srcSize)
  271|    373|        {
  272|    104|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 104, False: 269]
  ------------------
  273|    104|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    104|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|    147|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 43, False: 330]
  ------------------
  276|    147|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    147|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|    210|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 63, False: 310]
  ------------------
  279|    210|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    210|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|    262|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 52, False: 321]
  ------------------
  282|    262|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    262|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|    306|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 44, False: 329]
  ------------------
  285|    306|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    306|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|    373|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 67, False: 306]
  ------------------
  288|    373|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    373|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|    373|        default: break;
  ------------------
  |  Branch (290:9): [True: 0, False: 373]
  ------------------
  291|    373|        }
  292|    373|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|    373|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 373, False: 0]
  ------------------
  294|    373|            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: 373]
  ------------------
  295|    373|        }
  296|    373|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|    373|    }
  298|       |
  299|  3.96k|    return srcSize;
  300|  3.96k|}
fse_decompress.c:BIT_readBits:
  363|   350k|{
  364|   350k|    BitContainerType const value = BIT_lookBits(bitD, nbBits);
  365|   350k|    BIT_skipBits(bitD, nbBits);
  366|   350k|    return value;
  367|   350k|}
fse_decompress.c:BIT_lookBits:
  331|   350k|{
  332|       |    /* arbitrate between double-shift and shift+mask */
  333|   350k|#if 1
  334|       |    /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
  335|       |     * bitstream is likely corrupted, and result is undefined */
  336|   350k|    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|   350k|}
fse_decompress.c:BIT_getMiddleBits:
  308|   350k|{
  309|   350k|    U32 const regMask = sizeof(bitContainer)*8 - 1;
  310|       |    /* if start > regMask, bitstream is corrupted, and result is undefined */
  311|   350k|    assert(nbBits < BIT_MASK_SIZE);
  ------------------
  |  |   70|   350k|#    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|   350k|#if defined(__x86_64__) || defined(_M_X64)
  318|   350k|    return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1);
  319|       |#else
  320|       |    return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
  321|       |#endif
  322|   350k|}
fse_decompress.c:BIT_skipBits:
  354|   397k|{
  355|   397k|    bitD->bitsConsumed += nbBits;
  356|   397k|}
fse_decompress.c:BIT_reloadDStream:
  413|   264k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|   264k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|   264k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 3.95k, False: 260k]
  |  |  ------------------
  ------------------
  416|  3.95k|        static const BitContainerType zeroFilled = 0;
  417|  3.95k|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|  3.95k|        return BIT_DStream_overflow;
  420|  3.95k|    }
  421|       |
  422|   260k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   260k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|   260k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 12.5k, False: 247k]
  ------------------
  425|  12.5k|        return BIT_reloadDStream_internal(bitD);
  426|  12.5k|    }
  427|   247k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 203k, False: 43.9k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|   203k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 198k, False: 5.17k]
  ------------------
  430|  5.17k|        return BIT_DStream_completed;
  431|   203k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  43.9k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  43.9k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  43.9k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 317, False: 43.6k]
  ------------------
  436|    317|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|    317|            result = BIT_DStream_endOfBuffer;
  438|    317|        }
  439|  43.9k|        bitD->ptr -= nbBytes;
  440|  43.9k|        bitD->bitsConsumed -= nbBytes*8;
  441|  43.9k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  43.9k|        return result;
  443|   247k|    }
  444|   247k|}
fse_decompress.c:BIT_reloadDStream_internal:
  385|  12.5k|{
  386|  12.5k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|  12.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|  12.5k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|  12.5k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|  12.5k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|  12.5k|    bitD->bitsConsumed &= 7;
  390|  12.5k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|  12.5k|    return BIT_DStream_unfinished;
  392|  12.5k|}
fse_decompress.c:BIT_readBitsFast:
  372|  47.3k|{
  373|  47.3k|    BitContainerType const value = BIT_lookBitsFast(bitD, nbBits);
  374|  47.3k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  47.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  375|  47.3k|    BIT_skipBits(bitD, nbBits);
  376|  47.3k|    return value;
  377|  47.3k|}
fse_decompress.c:BIT_lookBitsFast:
  347|  47.3k|{
  348|  47.3k|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  47.3k|    assert(nbBits >= 1);
  ------------------
  |  |   70|  47.3k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  47.3k|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  47.3k|}
huf_decompress.c:BIT_initDStream:
  255|  1.64k|{
  256|  1.64k|    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.64k]
  ------------------
  257|       |
  258|  1.64k|    bitD->start = (const char*)srcBuffer;
  259|  1.64k|    bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer);
  260|       |
  261|  1.64k|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (261:9): [True: 525, False: 1.11k]
  ------------------
  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.11k|    } else {
  268|  1.11k|        bitD->ptr   = bitD->start;
  269|  1.11k|        bitD->bitContainer = *(const BYTE*)(bitD->start);
  270|  1.11k|        switch(srcSize)
  271|  1.11k|        {
  272|     51|        case 7: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContainer)*8 - 16);
  ------------------
  |  Branch (272:9): [True: 51, False: 1.06k]
  ------------------
  273|     51|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     51|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  274|       |
  275|     85|        case 6: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
  ------------------
  |  Branch (275:9): [True: 34, False: 1.08k]
  ------------------
  276|     85|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     85|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  277|       |
  278|     96|        case 5: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
  ------------------
  |  Branch (278:9): [True: 11, False: 1.10k]
  ------------------
  279|     96|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|     96|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  280|       |
  281|    101|        case 4: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[3]) << 24;
  ------------------
  |  Branch (281:9): [True: 5, False: 1.11k]
  ------------------
  282|    101|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    101|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  283|       |
  284|    635|        case 3: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[2]) << 16;
  ------------------
  |  Branch (284:9): [True: 534, False: 584]
  ------------------
  285|    635|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    635|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  286|       |
  287|    639|        case 2: bitD->bitContainer += (BitContainerType)(((const BYTE*)(srcBuffer))[1]) <<  8;
  ------------------
  |  Branch (287:9): [True: 4, False: 1.11k]
  ------------------
  288|    639|                ZSTD_FALLTHROUGH;
  ------------------
  |  |  262|    639|#  define ZSTD_FALLTHROUGH ; __attribute__((__fallthrough__))
  ------------------
  289|       |
  290|  1.11k|        default: break;
  ------------------
  |  Branch (290:9): [True: 479, False: 639]
  ------------------
  291|  1.11k|        }
  292|  1.11k|        {   BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  293|  1.11k|            bitD->bitsConsumed = lastByte ? 8 - ZSTD_highbit32(lastByte) : 0;
  ------------------
  |  Branch (293:34): [True: 1.11k, False: 1]
  ------------------
  294|  1.11k|            if (lastByte == 0) return ERROR(corruption_detected);  /* 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 (294:17): [True: 1, False: 1.11k]
  ------------------
  295|  1.11k|        }
  296|  1.11k|        bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8;
  297|  1.11k|    }
  298|       |
  299|  1.63k|    return srcSize;
  300|  1.64k|}
huf_decompress.c:BIT_reloadDStream:
  413|   311k|{
  414|       |    /* note : once in overflow mode, a bitstream remains in this mode until it's reset */
  415|   311k|    if (UNLIKELY(bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))) {
  ------------------
  |  |  188|   311k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 53, False: 311k]
  |  |  ------------------
  ------------------
  416|     53|        static const BitContainerType zeroFilled = 0;
  417|     53|        bitD->ptr = (const char*)&zeroFilled; /* aliasing is allowed for char */
  418|       |        /* overflow detected, erroneous scenario or end of stream: no update */
  419|     53|        return BIT_DStream_overflow;
  420|     53|    }
  421|       |
  422|   311k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   311k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  423|       |
  424|   311k|    if (bitD->ptr >= bitD->limitPtr) {
  ------------------
  |  Branch (424:9): [True: 296k, False: 14.9k]
  ------------------
  425|   296k|        return BIT_reloadDStream_internal(bitD);
  426|   296k|    }
  427|  14.9k|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (427:9): [True: 2.49k, False: 12.4k]
  ------------------
  428|       |        /* reached end of bitStream => no update */
  429|  2.49k|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
  ------------------
  |  Branch (429:13): [True: 2.04k, False: 456]
  ------------------
  430|    456|        return BIT_DStream_completed;
  431|  2.49k|    }
  432|       |    /* start < ptr < limitPtr => cautious update */
  433|  12.4k|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  434|  12.4k|        BIT_DStream_status result = BIT_DStream_unfinished;
  435|  12.4k|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (435:13): [True: 1.52k, False: 10.9k]
  ------------------
  436|  1.52k|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  437|  1.52k|            result = BIT_DStream_endOfBuffer;
  438|  1.52k|        }
  439|  12.4k|        bitD->ptr -= nbBytes;
  440|  12.4k|        bitD->bitsConsumed -= nbBytes*8;
  441|  12.4k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD->bitContainer), otherwise bitD->ptr == bitD->start */
  442|  12.4k|        return result;
  443|  14.9k|    }
  444|  14.9k|}
huf_decompress.c:BIT_reloadDStream_internal:
  385|   352k|{
  386|   352k|    assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8);
  ------------------
  |  |   70|   352k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  387|   352k|    bitD->ptr -= bitD->bitsConsumed >> 3;
  388|   352k|    assert(bitD->ptr >= bitD->start);
  ------------------
  |  |   70|   352k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  389|   352k|    bitD->bitsConsumed &= 7;
  390|   352k|    bitD->bitContainer = MEM_readLEST(bitD->ptr);
  391|   352k|    return BIT_DStream_unfinished;
  392|   352k|}
huf_decompress.c:BIT_lookBitsFast:
  347|  3.21M|{
  348|  3.21M|    U32 const regMask = sizeof(bitD->bitContainer)*8 - 1;
  349|  3.21M|    assert(nbBits >= 1);
  ------------------
  |  |   70|  3.21M|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  350|  3.21M|    return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
  351|  3.21M|}
huf_decompress.c:BIT_skipBits:
  354|  3.21M|{
  355|  3.21M|    bitD->bitsConsumed += nbBits;
  356|  3.21M|}
huf_decompress.c:BIT_endOfDStream:
  450|  1.62k|{
  451|  1.62k|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (451:13): [True: 1.48k, False: 131]
  |  Branch (451:49): [True: 1.19k, False: 293]
  ------------------
  452|  1.62k|}
huf_decompress.c:BIT_reloadDStreamFast:
  401|  56.3k|{
  402|  56.3k|    if (UNLIKELY(bitD->ptr < bitD->limitPtr))
  ------------------
  |  |  188|  56.3k|#define UNLIKELY(x) (__builtin_expect((x), 0))
  |  |  ------------------
  |  |  |  Branch (188:21): [True: 148, False: 56.2k]
  |  |  ------------------
  ------------------
  403|    148|        return BIT_DStream_overflow;
  404|  56.2k|    return BIT_reloadDStream_internal(bitD);
  405|  56.3k|}

zstd_decompress_block.c:ZSTD_maybeNullPtrAdd:
  386|  11.3k|{
  387|  11.3k|    return add > 0 ? ptr + add : ptr;
  ------------------
  |  Branch (387:12): [True: 11.1k, False: 198]
  ------------------
  388|  11.3k|}
zstd_decompress_block.c:ZSTD_wrappedPtrSub:
  374|  1.87M|{
  375|  1.87M|    return ptr - sub;
  376|  1.87M|}
zstd_decompress_block.c:ZSTD_wrappedPtrAdd:
  361|  1.87M|{
  362|  1.87M|    return ptr + add;
  363|  1.87M|}
huf_decompress.c:ZSTD_maybeNullPtrAdd:
  386|  7.06k|{
  387|  7.06k|    return add > 0 ? ptr + add : ptr;
  ------------------
  |  Branch (387:12): [True: 6.60k, False: 455]
  ------------------
  388|  7.06k|}

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

FSE_isError:
   31|  4.71k|unsigned FSE_isError(size_t code) { return ERR_isError(code); }
FSE_readNCount_bmi2:
  209|  9.03k|{
  210|  9.03k|#if DYNAMIC_BMI2
  211|  9.03k|    if (bmi2) {
  ------------------
  |  Branch (211:9): [True: 3.91k, False: 5.12k]
  ------------------
  212|  3.91k|        return FSE_readNCount_body_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  213|  3.91k|    }
  214|  5.12k|#endif
  215|  5.12k|    (void)bmi2;
  216|  5.12k|    return FSE_readNCount_body_default(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  217|  9.03k|}
FSE_readNCount:
  222|  5.05k|{
  223|  5.05k|    return FSE_readNCount_bmi2(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize, /* bmi2 */ 0);
  224|  5.05k|}
HUF_readStats_wksp:
  332|  4.02k|{
  333|  4.02k|#if DYNAMIC_BMI2
  334|  4.02k|    if (flags & HUF_flags_bmi2) {
  ------------------
  |  Branch (334:9): [True: 3.92k, False: 100]
  ------------------
  335|  3.92k|        return HUF_readStats_body_bmi2(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize);
  336|  3.92k|    }
  337|    100|#endif
  338|    100|    (void)flags;
  339|    100|    return HUF_readStats_body_default(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize);
  340|  4.02k|}
entropy_common.c:FSE_readNCount_body_bmi2:
  201|  3.91k|{
  202|  3.91k|    return FSE_readNCount_body(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  203|  3.91k|}
entropy_common.c:FSE_readNCount_body:
   44|  9.03k|{
   45|  9.03k|    const BYTE* const istart = (const BYTE*) headerBuffer;
   46|  9.03k|    const BYTE* const iend = istart + hbSize;
   47|  9.03k|    const BYTE* ip = istart;
   48|  9.03k|    int nbBits;
   49|  9.03k|    int remaining;
   50|  9.03k|    int threshold;
   51|  9.03k|    U32 bitStream;
   52|  9.03k|    int bitCount;
   53|  9.03k|    unsigned charnum = 0;
   54|  9.03k|    unsigned const maxSV1 = *maxSVPtr + 1;
   55|  9.03k|    int previous0 = 0;
   56|       |
   57|  9.03k|    if (hbSize < 8) {
  ------------------
  |  Branch (57:9): [True: 732, False: 8.30k]
  ------------------
   58|       |        /* This function only works when hbSize >= 8 */
   59|    732|        char buffer[8] = {0};
   60|    732|        ZSTD_memcpy(buffer, headerBuffer, hbSize);
  ------------------
  |  |   44|    732|# define ZSTD_memcpy(d,s,l) __builtin_memcpy((d),(s),(l))
  ------------------
   61|    732|        {   size_t const countSize = FSE_readNCount(normalizedCounter, maxSVPtr, tableLogPtr,
   62|    732|                                                    buffer, sizeof(buffer));
   63|    732|            if (FSE_isError(countSize)) return countSize;
  ------------------
  |  Branch (63:17): [True: 0, False: 732]
  ------------------
   64|    732|            if (countSize > hbSize) return ERROR(corruption_detected);
  ------------------
  |  |   49|      7|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      7|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      7|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (64:17): [True: 7, False: 725]
  ------------------
   65|    725|            return countSize;
   66|    732|    }   }
   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.29k]
  ------------------
   74|  8.29k|    bitStream >>= 4;
   75|  8.29k|    bitCount = 4;
   76|  8.29k|    *tableLogPtr = nbBits;
   77|  8.29k|    remaining = (1<<nbBits)+1;
   78|  8.29k|    threshold = 1<<nbBits;
   79|  8.29k|    nbBits++;
   80|       |
   81|  71.2k|    for (;;) {
   82|  71.2k|        if (previous0) {
  ------------------
  |  Branch (82:13): [True: 5.25k, False: 65.9k]
  ------------------
   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.25k|            int repeats = ZSTD_countTrailingZeros32(~bitStream | 0x80000000) >> 1;
   89|  5.44k|            while (repeats >= 12) {
  ------------------
  |  Branch (89:20): [True: 193, False: 5.25k]
  ------------------
   90|    193|                charnum += 3 * 12;
   91|    193|                if (LIKELY(ip <= iend-7)) {
  ------------------
  |  |  187|    193|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 167, False: 26]
  |  |  ------------------
  ------------------
   92|    167|                    ip += 3;
   93|    167|                } else {
   94|     26|                    bitCount -= (int)(8 * (iend - 7 - ip));
   95|     26|                    bitCount &= 31;
   96|     26|                    ip = iend - 4;
   97|     26|                }
   98|    193|                bitStream = MEM_readLE32(ip) >> bitCount;
   99|    193|                repeats = ZSTD_countTrailingZeros32(~bitStream | 0x80000000) >> 1;
  100|    193|            }
  101|  5.25k|            charnum += 3 * repeats;
  102|  5.25k|            bitStream >>= 2 * repeats;
  103|  5.25k|            bitCount += 2 * repeats;
  104|       |
  105|       |            /* Add the final repeat which isn't 0b11. */
  106|  5.25k|            assert((bitStream & 3) < 3);
  ------------------
  |  |   70|  5.25k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  107|  5.25k|            charnum += bitStream & 3;
  108|  5.25k|            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.25k|            if (charnum >= maxSV1) break;
  ------------------
  |  Branch (114:17): [True: 1, False: 5.25k]
  ------------------
  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.25k|            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.85k, False: 393]
  |  |  ------------------
  ------------------
  |  Branch (120:41): [True: 239, False: 154]
  ------------------
  121|  5.09k|                assert((bitCount >> 3) <= 3); /* For first condition to work */
  ------------------
  |  |   70|  5.09k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  122|  5.09k|                ip += bitCount>>3;
  123|  5.09k|                bitCount &= 7;
  124|  5.09k|            } else {
  125|    154|                bitCount -= (int)(8 * (iend - 4 - ip));
  126|    154|                bitCount &= 31;
  127|    154|                ip = iend - 4;
  128|    154|            }
  129|  5.25k|            bitStream = MEM_readLE32(ip) >> bitCount;
  130|  5.25k|        }
  131|  71.2k|        {
  132|  71.2k|            int const max = (2*threshold-1) - remaining;
  133|  71.2k|            int count;
  134|       |
  135|  71.2k|            if ((bitStream & (threshold-1)) < (U32)max) {
  ------------------
  |  Branch (135:17): [True: 46.4k, False: 24.7k]
  ------------------
  136|  46.4k|                count = bitStream & (threshold-1);
  137|  46.4k|                bitCount += nbBits-1;
  138|  46.4k|            } else {
  139|  24.7k|                count = bitStream & (2*threshold-1);
  140|  24.7k|                if (count >= threshold) count -= max;
  ------------------
  |  Branch (140:21): [True: 11.7k, False: 12.9k]
  ------------------
  141|  24.7k|                bitCount += nbBits;
  142|  24.7k|            }
  143|       |
  144|  71.2k|            count--;   /* extra accuracy */
  145|       |            /* When it matters (small blocks), this is a
  146|       |             * predictable branch, because we don't use -1.
  147|       |             */
  148|  71.2k|            if (count >= 0) {
  ------------------
  |  Branch (148:17): [True: 42.2k, False: 29.0k]
  ------------------
  149|  42.2k|                remaining -= count;
  150|  42.2k|            } else {
  151|  29.0k|                assert(count == -1);
  ------------------
  |  |   70|  29.0k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  152|  29.0k|                remaining += count;
  153|  29.0k|            }
  154|  71.2k|            normalizedCounter[charnum++] = (short)count;
  155|  71.2k|            previous0 = !count;
  156|       |
  157|  71.2k|            assert(threshold > 1);
  ------------------
  |  |   70|  71.2k|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  158|  71.2k|            if (remaining < threshold) {
  ------------------
  |  Branch (158:17): [True: 32.5k, False: 38.6k]
  ------------------
  159|       |                /* This branch can be folded into the
  160|       |                 * threshold update condition because we
  161|       |                 * know that threshold > 1.
  162|       |                 */
  163|  32.5k|                if (remaining <= 1) break;
  ------------------
  |  Branch (163:21): [True: 8.29k, False: 24.2k]
  ------------------
  164|  24.2k|                nbBits = ZSTD_highbit32(remaining) + 1;
  165|  24.2k|                threshold = 1 << (nbBits - 1);
  166|  24.2k|            }
  167|  62.9k|            if (charnum >= maxSV1) break;
  ------------------
  |  Branch (167:17): [True: 0, False: 62.9k]
  ------------------
  168|       |
  169|  62.9k|            if (LIKELY(ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  |  187|   125k|#define LIKELY(x) (__builtin_expect((x), 1))
  |  |  ------------------
  |  |  |  Branch (187:19): [True: 60.1k, False: 2.77k]
  |  |  ------------------
  ------------------
  |  Branch (169:41): [True: 1.66k, False: 1.11k]
  ------------------
  170|  61.8k|                ip += bitCount>>3;
  171|  61.8k|                bitCount &= 7;
  172|  61.8k|            } else {
  173|  1.11k|                bitCount -= (int)(8 * (iend - 4 - ip));
  174|  1.11k|                bitCount &= 31;
  175|  1.11k|                ip = iend - 4;
  176|  1.11k|            }
  177|  62.9k|            bitStream = MEM_readLE32(ip) >> bitCount;
  178|  62.9k|    }   }
  179|  8.29k|    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.29k]
  ------------------
  180|       |    /* Only possible when there are too many zeros. */
  181|  8.29k|    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.29k]
  ------------------
  182|  8.29k|    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.29k]
  ------------------
  183|  8.29k|    *maxSVPtr = charnum-1;
  184|       |
  185|  8.29k|    ip += (bitCount+7)>>3;
  186|  8.29k|    return ip-istart;
  187|  8.29k|}
entropy_common.c:FSE_readNCount_body_default:
  193|  5.12k|{
  194|  5.12k|    return FSE_readNCount_body(normalizedCounter, maxSVPtr, tableLogPtr, headerBuffer, hbSize);
  195|  5.12k|}
entropy_common.c:HUF_readStats_body_bmi2:
  322|  3.92k|{
  323|  3.92k|    return HUF_readStats_body(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize, 1);
  324|  3.92k|}
entropy_common.c:HUF_readStats_body:
  248|  4.02k|{
  249|  4.02k|    U32 weightTotal;
  250|  4.02k|    const BYTE* ip = (const BYTE*) src;
  251|  4.02k|    size_t iSize;
  252|  4.02k|    size_t oSize;
  253|       |
  254|  4.02k|    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.02k]
  ------------------
  255|  4.02k|    iSize = ip[0];
  256|       |    /* ZSTD_memset(huffWeight, 0, hwSize);   *//* is not necessary, even though some analyzer complain ... */
  257|       |
  258|  4.02k|    if (iSize >= 128) {  /* special header */
  ------------------
  |  Branch (258:9): [True: 45, False: 3.98k]
  ------------------
  259|     45|        oSize = iSize - 127;
  260|     45|        iSize = ((oSize+1)/2);
  261|     45|        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 (261:13): [True: 1, False: 44]
  ------------------
  262|     44|        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: 44]
  ------------------
  263|     44|        ip += 1;
  264|     44|        {   U32 n;
  265|    806|            for (n=0; n<oSize; n+=2) {
  ------------------
  |  Branch (265:23): [True: 762, False: 44]
  ------------------
  266|    762|                huffWeight[n]   = ip[n/2] >> 4;
  267|    762|                huffWeight[n+1] = ip[n/2] & 15;
  268|    762|    }   }   }
  269|  3.98k|    else  {   /* header compressed with FSE (normal case) */
  270|  3.98k|        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: 3.97k]
  ------------------
  271|       |        /* max (hwSize-1) values decoded, as last one is implied */
  272|  3.97k|        oSize = FSE_decompress_wksp_bmi2(huffWeight, hwSize-1, ip+1, iSize, 6, workSpace, wkspSize, bmi2);
  273|  3.97k|        if (FSE_isError(oSize)) return oSize;
  ------------------
  |  Branch (273:13): [True: 19, False: 3.95k]
  ------------------
  274|  3.97k|    }
  275|       |
  276|       |    /* collect weight stats */
  277|  4.00k|    ZSTD_memset(rankStats, 0, (HUF_TABLELOG_MAX + 1) * sizeof(U32));
  ------------------
  |  |   46|  4.00k|# define ZSTD_memset(p,v,l) __builtin_memset((p),(v),(l))
  ------------------
  278|  4.00k|    weightTotal = 0;
  279|   393k|    {   U32 n; for (n=0; n<oSize; n++) {
  ------------------
  |  Branch (279:26): [True: 389k, False: 3.99k]
  ------------------
  280|   389k|            if (huffWeight[n] > HUF_TABLELOG_MAX) return ERROR(corruption_detected);
  ------------------
  |  |   37|   389k|#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|      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 (280:17): [True: 9, False: 389k]
  ------------------
  281|   389k|            rankStats[huffWeight[n]]++;
  282|   389k|            weightTotal += (1 << huffWeight[n]) >> 1;
  283|   389k|    }   }
  284|  3.99k|    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: 3.99k]
  ------------------
  285|       |
  286|       |    /* get last non-null symbol weight (implied, total must be 2^n) */
  287|  3.99k|    {   U32 const tableLog = ZSTD_highbit32(weightTotal) + 1;
  288|  3.99k|        if (tableLog > HUF_TABLELOG_MAX) return ERROR(corruption_detected);
  ------------------
  |  |   37|  3.99k|#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: 3.99k]
  ------------------
  289|  3.99k|        *tableLogPtr = tableLog;
  290|       |        /* determine last weight */
  291|  3.99k|        {   U32 const total = 1 << tableLog;
  292|  3.99k|            U32 const rest = total - weightTotal;
  293|  3.99k|            U32 const verif = 1 << ZSTD_highbit32(rest);
  294|  3.99k|            U32 const lastWeight = ZSTD_highbit32(rest) + 1;
  295|  3.99k|            if (verif != rest) return ERROR(corruption_detected);    /* last value must be a clean power of 2 */
  ------------------
  |  |   49|     16|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     16|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     16|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (295:17): [True: 16, False: 3.97k]
  ------------------
  296|  3.97k|            huffWeight[oSize] = (BYTE)lastWeight;
  297|  3.97k|            rankStats[lastWeight]++;
  298|  3.97k|    }   }
  299|       |
  300|       |    /* check tree construction validity */
  301|  3.97k|    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: 3.97k]
  |  Branch (301:31): [True: 0, False: 3.97k]
  ------------------
  302|       |
  303|       |    /* results */
  304|  3.97k|    *nbSymbolsPtr = (U32)(oSize+1);
  305|  3.97k|    return iSize+1;
  306|  3.97k|}
entropy_common.c:HUF_readStats_body_default:
  313|    100|{
  314|    100|    return HUF_readStats_body(huffWeight, hwSize, rankStats, nbSymbolsPtr, tableLogPtr, src, srcSize, workSpace, wkspSize, 0);
  315|    100|}

zstd_common.c:ERR_isError:
   52|  20.5k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  20.5k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  20.5k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  20.5k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_common.c:ERR_getErrorCode:
   54|  17.7k|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: 16.1k, False: 1.57k]
  ------------------
zstd_ddict.c:ERR_isError:
   52|  1.67k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  1.67k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  1.67k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.67k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress.c:ERR_isError:
   52|   229k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|   229k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|   229k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|   229k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_decompress_block.c:ERR_isError:
   52|  4.71M|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  4.71M|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  4.71M|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  4.71M|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v05.c:ERR_isError:
   52|  2.97k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  2.97k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  2.97k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  2.97k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v06.c:ERR_isError:
   52|  1.11k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  1.11k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  1.11k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.11k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
zstd_v07.c:ERR_isError:
   52|  1.07k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  1.07k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  1.07k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  1.07k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
entropy_common.c:ERR_isError:
   52|  4.71k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  4.71k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  4.71k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  4.71k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
fse_decompress.c:ERR_isError:
   52|  11.9k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  11.9k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  11.9k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  11.9k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
huf_decompress.c:ERR_isError:
   52|  23.7k|ERR_STATIC unsigned ERR_isError(size_t code) { return (code > ERROR(maxCode)); }
  ------------------
  |  |   49|  23.7k|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|  23.7k|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|  23.7k|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------

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

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

zstd_ddict.c:MEM_readLE32:
  322|    884|{
  323|    884|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 884, False: 0]
  ------------------
  324|    884|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|    884|}
zstd_ddict.c:MEM_isLittleEndian:
  141|    884|{
  142|    884|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|    884|    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|    884|}
zstd_ddict.c:MEM_read32:
  183|    884|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE32:
  322|  58.1k|{
  323|  58.1k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 58.1k, False: 0]
  ------------------
  324|  58.1k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  58.1k|}
zstd_decompress.c:MEM_isLittleEndian:
  141|  61.5k|{
  142|  61.5k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  61.5k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|  61.5k|}
zstd_decompress.c:MEM_read32:
  183|  58.1k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress.c:MEM_readLE16:
  290|  1.05k|{
  291|  1.05k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 1.05k, False: 0]
  ------------------
  292|  1.05k|        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.05k|}
zstd_decompress.c:MEM_read16:
  182|  1.05k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress.c:MEM_readLE64:
  338|  2.32k|{
  339|  2.32k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 2.32k, False: 0]
  ------------------
  340|  2.32k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  2.32k|}
zstd_decompress.c:MEM_read64:
  184|  2.32k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_decompress_block.c:MEM_readLE24:
  311|  62.2k|{
  312|  62.2k|    return (U32)MEM_readLE16(memPtr) + ((U32)(((const BYTE*)memPtr)[2]) << 16);
  313|  62.2k|}
zstd_decompress_block.c:MEM_readLE32:
  322|  4.18k|{
  323|  4.18k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 4.18k, False: 0]
  ------------------
  324|  4.18k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  4.18k|}
zstd_decompress_block.c:MEM_isLittleEndian:
  141|  4.58M|{
  142|  4.58M|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  4.58M|    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.58M|}
zstd_decompress_block.c:MEM_read32:
  183|  4.18k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_decompress_block.c:MEM_write64:
  189|  20.8k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
zstd_decompress_block.c:MEM_readLE16:
  290|  63.2k|{
  291|  63.2k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 63.2k, False: 0]
  ------------------
  292|  63.2k|        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|  63.2k|}
zstd_decompress_block.c:MEM_read16:
  182|  63.2k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }
zstd_decompress_block.c:MEM_32bits:
  137|  31.4M|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_decompress_block.c:MEM_64bits:
  138|  4.69M|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
zstd_decompress_block.c:MEM_readLEST:
  354|  4.51M|{
  355|  4.51M|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 4.51M]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  4.51M|    else
  358|  4.51M|        return (size_t)MEM_readLE64(memPtr);
  359|  4.51M|}
zstd_decompress_block.c:MEM_readLE64:
  338|  4.51M|{
  339|  4.51M|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 4.51M, False: 0]
  ------------------
  340|  4.51M|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  4.51M|}
zstd_decompress_block.c:MEM_read64:
  184|  4.51M|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_v05.c:MEM_readLE32:
  322|  1.53k|{
  323|  1.53k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 1.53k, False: 0]
  ------------------
  324|  1.53k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  1.53k|}
zstd_v05.c:MEM_isLittleEndian:
  141|  2.97k|{
  142|  2.97k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  2.97k|    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.97k|}
zstd_v05.c:MEM_read32:
  183|  1.53k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
zstd_v05.c:MEM_readLEST:
  354|  1.43k|{
  355|  1.43k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 1.43k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  1.43k|    else
  358|  1.43k|        return (size_t)MEM_readLE64(memPtr);
  359|  1.43k|}
zstd_v05.c:MEM_32bits:
  137|  3.77k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_v05.c:MEM_readLE64:
  338|  1.43k|{
  339|  1.43k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 1.43k, False: 0]
  ------------------
  340|  1.43k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  1.43k|}
zstd_v05.c:MEM_read64:
  184|  1.43k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
zstd_v05.c:MEM_readLE16:
  290|     11|{
  291|     11|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 11, False: 0]
  ------------------
  292|     11|        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|     11|}
zstd_v05.c:MEM_read16:
  182|     11|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|  76.6k|{
  323|  76.6k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (323:9): [True: 76.6k, False: 0]
  ------------------
  324|  76.6k|        return MEM_read32(memPtr);
  325|      0|    else
  326|      0|        return MEM_swap32(MEM_read32(memPtr));
  327|  76.6k|}
entropy_common.c:MEM_isLittleEndian:
  141|  76.6k|{
  142|  76.6k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  76.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|  76.6k|}
entropy_common.c:MEM_read32:
  183|  76.6k|MEM_STATIC U32 MEM_read32(const void* ptr) { return *(const unalign32*)ptr; }
fse_decompress.c:MEM_write64:
  189|  13.5k|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
fse_decompress.c:MEM_readLEST:
  354|  60.0k|{
  355|  60.0k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 60.0k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|  60.0k|    else
  358|  60.0k|        return (size_t)MEM_readLE64(memPtr);
  359|  60.0k|}
fse_decompress.c:MEM_32bits:
  137|  60.0k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
fse_decompress.c:MEM_isLittleEndian:
  141|  60.0k|{
  142|  60.0k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|  60.0k|    return 1;
  144|       |#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
  145|       |    return 0;
  146|       |#elif defined(__clang__) && __LITTLE_ENDIAN__
  147|       |    return 1;
  148|       |#elif defined(__clang__) && __BIG_ENDIAN__
  149|       |    return 0;
  150|       |#elif defined(_MSC_VER) && (_M_X64 || _M_IX86)
  151|       |    return 1;
  152|       |#elif defined(__DMC__) && defined(_M_IX86)
  153|       |    return 1;
  154|       |#elif defined(__IAR_SYSTEMS_ICC__) && __LITTLE_ENDIAN__
  155|       |    return 1;
  156|       |#else
  157|       |    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  158|       |    return one.c[0];
  159|       |#endif
  160|  60.0k|}
fse_decompress.c:MEM_readLE64:
  338|  60.0k|{
  339|  60.0k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 60.0k, False: 0]
  ------------------
  340|  60.0k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|  60.0k|}
fse_decompress.c:MEM_read64:
  184|  60.0k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_isLittleEndian:
  141|   682k|{
  142|   682k|#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
  143|   682k|    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|   682k|}
huf_decompress.c:MEM_write64:
  189|  1.94M|MEM_STATIC void MEM_write64(void* memPtr, U64 value) { *(unalign64*)memPtr = value; }
huf_decompress.c:MEM_readLEST:
  354|   388k|{
  355|   388k|    if (MEM_32bits())
  ------------------
  |  Branch (355:9): [True: 0, False: 388k]
  ------------------
  356|      0|        return (size_t)MEM_readLE32(memPtr);
  357|   388k|    else
  358|   388k|        return (size_t)MEM_readLE64(memPtr);
  359|   388k|}
huf_decompress.c:MEM_32bits:
  137|   403k|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
huf_decompress.c:MEM_readLE64:
  338|   388k|{
  339|   388k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (339:9): [True: 388k, False: 0]
  ------------------
  340|   388k|        return MEM_read64(memPtr);
  341|      0|    else
  342|      0|        return MEM_swap64(MEM_read64(memPtr));
  343|   388k|}
huf_decompress.c:MEM_read64:
  184|   388k|MEM_STATIC U64 MEM_read64(const void* ptr) { return *(const unalign64*)ptr; }
huf_decompress.c:MEM_64bits:
  138|   556k|MEM_STATIC unsigned MEM_64bits(void) { return sizeof(size_t)==8; }
huf_decompress.c:MEM_readLE16:
  290|  8.93k|{
  291|  8.93k|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (291:9): [True: 8.93k, False: 0]
  ------------------
  292|  8.93k|        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|  8.93k|}
huf_decompress.c:MEM_read16:
  182|  8.93k|MEM_STATIC U16 MEM_read16(const void* ptr) { return *(const unalign16*)ptr; }

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

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

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

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

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

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

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

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|  18.7k|{
   58|  18.7k|    U32 magicNumberLE;
   59|  18.7k|    if (srcSize<4) return 0;
  ------------------
  |  Branch (59:9): [True: 0, False: 18.7k]
  ------------------
   60|  18.7k|    magicNumberLE = MEM_readLE32(src);
   61|  18.7k|    switch(magicNumberLE)
   62|  18.7k|    {
   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|    416|        case ZSTDv05_MAGICNUMBER : return 5;
  ------------------
  |  |  153|    416|#define ZSTDv05_MAGICNUMBER 0xFD2FB525   /* v0.5 */
  ------------------
  |  Branch (76:9): [True: 416, False: 18.3k]
  ------------------
   77|      0|#endif
   78|      0|#if (ZSTD_LEGACY_SUPPORT <= 6)
   79|    148|        case ZSTDv06_MAGICNUMBER : return 6;
  ------------------
  |  |  164|    148|#define ZSTDv06_MAGICNUMBER 0xFD2FB526   /* v0.6 */
  ------------------
  |  Branch (79:9): [True: 148, False: 18.6k]
  ------------------
   80|      0|#endif
   81|      0|#if (ZSTD_LEGACY_SUPPORT <= 7)
   82|    154|        case ZSTDv07_MAGICNUMBER : return 7;
  ------------------
  |  |  180|    154|#define ZSTDv07_MAGICNUMBER            0xFD2FB527   /* v0.7 */
  ------------------
  |  Branch (82:9): [True: 154, False: 18.6k]
  ------------------
   83|      0|#endif
   84|  18.0k|        default : return 0;
  ------------------
  |  Branch (84:9): [True: 18.0k, False: 718]
  ------------------
   85|  18.7k|    }
   86|  18.7k|}
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|    225|{
  197|    225|    ZSTD_frameSizeInfo frameSizeInfo;
  198|    225|    U32 const version = ZSTD_isLegacy(src, srcSize);
  199|    225|    switch(version)
  200|    225|    {
  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|    127|        case 5 :
  ------------------
  |  Branch (230:9): [True: 127, False: 98]
  ------------------
  231|    127|            ZSTDv05_findFrameSizeInfoLegacy(src, srcSize,
  232|    127|                &frameSizeInfo.compressedSize,
  233|    127|                &frameSizeInfo.decompressedBound);
  234|    127|            break;
  235|      0|#endif
  236|      0|#if (ZSTD_LEGACY_SUPPORT <= 6)
  237|     49|        case 6 :
  ------------------
  |  Branch (237:9): [True: 49, False: 176]
  ------------------
  238|     49|            ZSTDv06_findFrameSizeInfoLegacy(src, srcSize,
  239|     49|                &frameSizeInfo.compressedSize,
  240|     49|                &frameSizeInfo.decompressedBound);
  241|     49|            break;
  242|      0|#endif
  243|      0|#if (ZSTD_LEGACY_SUPPORT <= 7)
  244|     49|        case 7 :
  ------------------
  |  Branch (244:9): [True: 49, False: 176]
  ------------------
  245|     49|            ZSTDv07_findFrameSizeInfoLegacy(src, srcSize,
  246|     49|                &frameSizeInfo.compressedSize,
  247|     49|                &frameSizeInfo.decompressedBound);
  248|     49|            break;
  249|      0|#endif
  250|      0|        default :
  ------------------
  |  Branch (250:9): [True: 0, False: 225]
  ------------------
  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|    225|    }
  255|    225|    if (!ZSTD_isError(frameSizeInfo.compressedSize) && frameSizeInfo.compressedSize > srcSize) {
  ------------------
  |  |   44|    225|#define ZSTD_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (255:9): [True: 214, False: 11]
  |  Branch (255:56): [True: 0, False: 214]
  ------------------
  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|    225|    if (frameSizeInfo.decompressedBound != ZSTD_CONTENTSIZE_ERROR) {
  ------------------
  |  |  204|    225|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
  |  Branch (262:9): [True: 214, False: 11]
  ------------------
  263|    214|        assert((frameSizeInfo.decompressedBound & (ZSTD_BLOCKSIZE_MAX - 1)) == 0);
  ------------------
  |  |   70|    214|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  264|    214|        frameSizeInfo.nbBlocks = (size_t)(frameSizeInfo.decompressedBound / ZSTD_BLOCKSIZE_MAX);
  ------------------
  |  |  148|    214|#define ZSTD_BLOCKSIZE_MAX     (1<<ZSTD_BLOCKSIZELOG_MAX)
  |  |  ------------------
  |  |  |  |  147|    214|#define ZSTD_BLOCKSIZELOG_MAX  17
  |  |  ------------------
  ------------------
  265|    214|    }
  266|    225|    return frameSizeInfo;
  267|    225|}
zstd_decompress.c:ZSTD_findFrameCompressedSizeLegacy:
  270|    225|{
  271|    225|    ZSTD_frameSizeInfo frameSizeInfo = ZSTD_findFrameSizeInfoLegacy(src, srcSize);
  272|    225|    return frameSizeInfo.compressedSize;
  273|    225|}
zstd_decompress.c:ZSTD_decompressLegacy:
  125|    214|{
  126|    214|    U32 const version = ZSTD_isLegacy(src, compressedSize);
  127|    214|    char x;
  128|       |    /* Avoid passing NULL to legacy decoding. */
  129|    214|    if (dst == NULL) {
  ------------------
  |  Branch (129:9): [True: 0, False: 214]
  ------------------
  130|      0|        assert(dstCapacity == 0);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  131|      0|        dst = &x;
  132|      0|    }
  133|    214|    if (src == NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 214]
  ------------------
  134|      0|        assert(compressedSize == 0);
  ------------------
  |  |   70|      0|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  135|      0|        src = &x;
  136|      0|    }
  137|    214|    if (dict == NULL) {
  ------------------
  |  Branch (137:9): [True: 130, False: 84]
  ------------------
  138|    130|        assert(dictSize == 0);
  ------------------
  |  |   70|    130|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
  139|    130|        dict = &x;
  140|    130|    }
  141|    214|    (void)dst; (void)dstCapacity; (void)dict; (void)dictSize;  /* unused when ZSTD_LEGACY_SUPPORT >= 8 */
  142|    214|    switch(version)
  143|    214|    {
  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|    122|        case 5 :
  ------------------
  |  Branch (161:9): [True: 122, False: 92]
  ------------------
  162|    122|            {   size_t result;
  163|    122|                ZSTDv05_DCtx* const zd = ZSTDv05_createDCtx();
  164|    122|                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: 122]
  ------------------
  165|    122|                result = ZSTDv05_decompress_usingDict(zd, dst, dstCapacity, src, compressedSize, dict, dictSize);
  166|    122|                ZSTDv05_freeDCtx(zd);
  167|    122|                return result;
  168|    122|            }
  169|      0|#endif
  170|      0|#if (ZSTD_LEGACY_SUPPORT <= 6)
  171|     48|        case 6 :
  ------------------
  |  Branch (171:9): [True: 48, False: 166]
  ------------------
  172|     48|            {   size_t result;
  173|     48|                ZSTDv06_DCtx* const zd = ZSTDv06_createDCtx();
  174|     48|                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: 48]
  ------------------
  175|     48|                result = ZSTDv06_decompress_usingDict(zd, dst, dstCapacity, src, compressedSize, dict, dictSize);
  176|     48|                ZSTDv06_freeDCtx(zd);
  177|     48|                return result;
  178|     48|            }
  179|      0|#endif
  180|      0|#if (ZSTD_LEGACY_SUPPORT <= 7)
  181|     44|        case 7 :
  ------------------
  |  Branch (181:9): [True: 44, False: 170]
  ------------------
  182|     44|            {   size_t result;
  183|     44|                ZSTDv07_DCtx* const zd = ZSTDv07_createDCtx();
  184|     44|                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: 44]
  ------------------
  185|     44|                result = ZSTDv07_decompress_usingDict(zd, dst, dstCapacity, src, compressedSize, dict, dictSize);
  186|     44|                ZSTDv07_freeDCtx(zd);
  187|     44|                return result;
  188|     44|            }
  189|      0|#endif
  190|      0|        default :
  ------------------
  |  Branch (190:9): [True: 0, False: 214]
  ------------------
  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|    214|    }
  193|    214|}

FSEv05_buildDTable:
 1158|     71|{
 1159|     71|    FSEv05_DTableHeader DTableH;
 1160|     71|    void* const tdPtr = dt+1;   /* because dt is unsigned, 32-bits aligned on 32-bits */
 1161|     71|    FSEv05_DECODE_TYPE* const tableDecode = (FSEv05_DECODE_TYPE*) (tdPtr);
  ------------------
  |  | 1056|     71|#define FSEv05_DECODE_TYPE FSEv05_decode_t
  ------------------
 1162|     71|    const U32 tableSize = 1 << tableLog;
 1163|     71|    const U32 tableMask = tableSize-1;
 1164|     71|    const U32 step = FSEv05_tableStep(tableSize);
 1165|     71|    U16 symbolNext[FSEv05_MAX_SYMBOL_VALUE+1];
 1166|     71|    U32 position = 0;
 1167|     71|    U32 highThreshold = tableSize-1;
 1168|     71|    const S16 largeLimit= (S16)(1 << (tableLog-1));
 1169|     71|    U32 noLarge = 1;
 1170|     71|    U32 s;
 1171|       |
 1172|       |    /* Sanity Checks */
 1173|     71|    if (maxSymbolValue > FSEv05_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  | 1048|     71|#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: 71]
  ------------------
 1174|     71|    if (tableLog > FSEv05_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1094|     71|#define FSEv05_MAX_TABLELOG  (FSEv05_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1042|     71|#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: 70]
  ------------------
 1175|       |
 1176|       |    /* Init, lay down lowprob symbols */
 1177|     70|    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|     70|    DTableH.tableLog = (U16)tableLog;
 1179|  1.05k|    for (s=0; s<=maxSymbolValue; s++) {
  ------------------
  |  Branch (1179:15): [True: 986, False: 70]
  ------------------
 1180|    986|        if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (1180:13): [True: 679, False: 307]
  ------------------
 1181|    679|            tableDecode[highThreshold--].symbol = (FSEv05_FUNCTION_TYPE)s;
 1182|    679|            symbolNext[s] = 1;
 1183|    679|        } else {
 1184|    307|            if (normalizedCounter[s] >= largeLimit) noLarge=0;
  ------------------
  |  Branch (1184:17): [True: 25, False: 282]
  ------------------
 1185|    307|            symbolNext[s] = normalizedCounter[s];
 1186|    307|    }   }
 1187|       |
 1188|       |    /* Spread symbols */
 1189|  1.05k|    for (s=0; s<=maxSymbolValue; s++) {
  ------------------
  |  Branch (1189:15): [True: 986, False: 70]
  ------------------
 1190|    986|        int i;
 1191|  4.59k|        for (i=0; i<normalizedCounter[s]; i++) {
  ------------------
  |  Branch (1191:19): [True: 3.60k, False: 986]
  ------------------
 1192|  3.60k|            tableDecode[position].symbol = (FSEv05_FUNCTION_TYPE)s;
 1193|  3.60k|            position = (position + step) & tableMask;
 1194|  4.12k|            while (position > highThreshold) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  Branch (1194:20): [True: 519, False: 3.60k]
  ------------------
 1195|  3.60k|    }   }
 1196|       |
 1197|     70|    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: 70]
  ------------------
 1198|       |
 1199|       |    /* Build Decoding table */
 1200|     70|    {
 1201|     70|        U32 i;
 1202|  4.35k|        for (i=0; i<tableSize; i++) {
  ------------------
  |  Branch (1202:19): [True: 4.28k, False: 70]
  ------------------
 1203|  4.28k|            FSEv05_FUNCTION_TYPE symbol = (FSEv05_FUNCTION_TYPE)(tableDecode[i].symbol);
  ------------------
  |  | 1054|  4.28k|#define FSEv05_FUNCTION_TYPE BYTE
  ------------------
 1204|  4.28k|            U16 nextState = symbolNext[symbol]++;
 1205|  4.28k|            tableDecode[i].nbBits = (BYTE) (tableLog - BITv05_highbit32 ((U32)nextState) );
 1206|  4.28k|            tableDecode[i].newState = (U16) ( (nextState << tableDecode[i].nbBits) - tableSize);
 1207|  4.28k|    }   }
 1208|       |
 1209|     70|    DTableH.fastMode = (U16)noLarge;
 1210|     70|    memcpy(dt, &DTableH, sizeof(DTableH));
 1211|     70|    return 0;
 1212|     70|}
FSEv05_isError:
 1219|     89|unsigned FSEv05_isError(size_t code) { return ERR_isError(code); }
FSEv05_readNCount:
 1232|     73|{
 1233|     73|    const BYTE* const istart = (const BYTE*) headerBuffer;
 1234|     73|    const BYTE* const iend = istart + hbSize;
 1235|     73|    const BYTE* ip = istart;
 1236|     73|    int nbBits;
 1237|     73|    int remaining;
 1238|     73|    int threshold;
 1239|     73|    U32 bitStream;
 1240|     73|    int bitCount;
 1241|     73|    unsigned charnum = 0;
 1242|     73|    int previous0 = 0;
 1243|       |
 1244|     73|    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: 73]
  ------------------
 1245|     73|    bitStream = MEM_readLE32(ip);
 1246|     73|    nbBits = (bitStream & 0xF) + FSEv05_MIN_TABLELOG;   /* extract tableLog */
  ------------------
  |  | 1098|     73|#define FSEv05_MIN_TABLELOG 5
  ------------------
 1247|     73|    if (nbBits > FSEv05_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1100|     73|#define FSEv05_TABLELOG_ABSOLUTE_MAX 15
  ------------------
                  if (nbBits > FSEv05_TABLELOG_ABSOLUTE_MAX) 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 (1247:9): [True: 1, False: 72]
  ------------------
 1248|     72|    bitStream >>= 4;
 1249|     72|    bitCount = 4;
 1250|     72|    *tableLogPtr = nbBits;
 1251|     72|    remaining = (1<<nbBits)+1;
 1252|     72|    threshold = 1<<nbBits;
 1253|     72|    nbBits++;
 1254|       |
 1255|  1.06k|    while ((remaining>1) && (charnum<=*maxSVPtr)) {
  ------------------
  |  Branch (1255:12): [True: 992, False: 72]
  |  Branch (1255:29): [True: 992, False: 0]
  ------------------
 1256|    992|        if (previous0) {
  ------------------
  |  Branch (1256:13): [True: 49, False: 943]
  ------------------
 1257|     49|            unsigned n0 = charnum;
 1258|     49|            while ((bitStream & 0xFFFF) == 0xFFFF) {
  ------------------
  |  Branch (1258:20): [True: 0, False: 49]
  ------------------
 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|     56|            while ((bitStream & 3) == 3) {
  ------------------
  |  Branch (1267:20): [True: 7, False: 49]
  ------------------
 1268|      7|                n0+=3;
 1269|      7|                bitStream>>=2;
 1270|      7|                bitCount+=2;
 1271|      7|            }
 1272|     49|            n0 += bitStream & 3;
 1273|     49|            bitCount += 2;
 1274|     49|            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: 49]
  ------------------
 1275|     96|            while (charnum < n0) normalizedCounter[charnum++] = 0;
  ------------------
  |  Branch (1275:20): [True: 47, False: 49]
  ------------------
 1276|     49|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1276:17): [True: 47, False: 2]
  |  Branch (1276:35): [True: 2, False: 0]
  ------------------
 1277|     49|                ip += bitCount>>3;
 1278|     49|                bitCount &= 7;
 1279|     49|                bitStream = MEM_readLE32(ip) >> bitCount;
 1280|     49|            }
 1281|      0|            else
 1282|      0|                bitStream >>= 2;
 1283|     49|        }
 1284|    992|        {
 1285|    992|            const short max = (short)((2*threshold-1)-remaining);
 1286|    992|            short count;
 1287|       |
 1288|    992|            if ((bitStream & (threshold-1)) < (U32)max) {
  ------------------
  |  Branch (1288:17): [True: 754, False: 238]
  ------------------
 1289|    754|                count = (short)(bitStream & (threshold-1));
 1290|    754|                bitCount   += nbBits-1;
 1291|    754|            } else {
 1292|    238|                count = (short)(bitStream & (2*threshold-1));
 1293|    238|                if (count >= threshold) count -= max;
  ------------------
  |  Branch (1293:21): [True: 81, False: 157]
  ------------------
 1294|    238|                bitCount   += nbBits;
 1295|    238|            }
 1296|       |
 1297|    992|            count--;   /* extra accuracy */
 1298|    992|            remaining -= FSEv05_abs(count);
 1299|    992|            normalizedCounter[charnum++] = count;
 1300|    992|            previous0 = !count;
 1301|  1.39k|            while (remaining < threshold) {
  ------------------
  |  Branch (1301:20): [True: 401, False: 992]
  ------------------
 1302|    401|                nbBits--;
 1303|    401|                threshold >>= 1;
 1304|    401|            }
 1305|       |
 1306|    992|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1306:17): [True: 945, False: 47]
  |  Branch (1306:35): [True: 23, False: 24]
  ------------------
 1307|    968|                ip += bitCount>>3;
 1308|    968|                bitCount &= 7;
 1309|    968|            } else {
 1310|     24|                bitCount -= (int)(8 * (iend - 4 - ip));
 1311|     24|                ip = iend - 4;
 1312|     24|            }
 1313|    992|            bitStream = MEM_readLE32(ip) >> (bitCount & 31);
 1314|    992|    }   }
 1315|     72|    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: 72]
  ------------------
 1316|     72|    *maxSVPtr = charnum-1;
 1317|       |
 1318|     72|    ip += (bitCount+7)>>3;
 1319|     72|    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 (1319:9): [True: 1, False: 71]
  ------------------
 1320|     71|    return ip-istart;
 1321|     72|}
FSEv05_buildDTable_rle:
 1329|     59|{
 1330|     59|    void* ptr = dt;
 1331|     59|    FSEv05_DTableHeader* const DTableH = (FSEv05_DTableHeader*)ptr;
 1332|     59|    void* dPtr = dt + 1;
 1333|     59|    FSEv05_decode_t* const cell = (FSEv05_decode_t*)dPtr;
 1334|       |
 1335|     59|    DTableH->tableLog = 0;
 1336|     59|    DTableH->fastMode = 0;
 1337|       |
 1338|     59|    cell->newState = 0;
 1339|     59|    cell->symbol = symbolValue;
 1340|     59|    cell->nbBits = 0;
 1341|       |
 1342|     59|    return 0;
 1343|     59|}
FSEv05_buildDTable_raw:
 1347|     80|{
 1348|     80|    void* ptr = dt;
 1349|     80|    FSEv05_DTableHeader* const DTableH = (FSEv05_DTableHeader*)ptr;
 1350|     80|    void* dPtr = dt + 1;
 1351|     80|    FSEv05_decode_t* const dinfo = (FSEv05_decode_t*)dPtr;
 1352|     80|    const unsigned tableSize = 1 << nbBits;
 1353|     80|    const unsigned tableMask = tableSize - 1;
 1354|     80|    const unsigned maxSymbolValue = tableMask;
 1355|     80|    unsigned s;
 1356|       |
 1357|       |    /* Sanity checks */
 1358|     80|    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: 80]
  ------------------
 1359|       |
 1360|       |    /* Build Decoding Table */
 1361|     80|    DTableH->tableLog = (U16)nbBits;
 1362|     80|    DTableH->fastMode = 1;
 1363|  6.67k|    for (s=0; s<=maxSymbolValue; s++) {
  ------------------
  |  Branch (1363:15): [True: 6.59k, False: 80]
  ------------------
 1364|  6.59k|        dinfo[s].newState = 0;
 1365|  6.59k|        dinfo[s].symbol = (BYTE)s;
 1366|  6.59k|        dinfo[s].nbBits = (BYTE)nbBits;
 1367|  6.59k|    }
 1368|       |
 1369|     80|    return 0;
 1370|     80|}
FSEv05_decompress_usingDTable:
 1443|      3|{
 1444|      3|    const void* ptr = dt;
 1445|      3|    const FSEv05_DTableHeader* DTableH = (const FSEv05_DTableHeader*)ptr;
 1446|      3|    const U32 fastMode = DTableH->fastMode;
 1447|       |
 1448|       |    /* select fast mode (static) */
 1449|      3|    if (fastMode) return FSEv05_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 1);
  ------------------
  |  Branch (1449:9): [True: 1, False: 2]
  ------------------
 1450|      2|    return FSEv05_decompress_usingDTable_generic(dst, originalSize, cSrc, cSrcSize, dt, 0);
 1451|      3|}
FSEv05_decompress:
 1455|      9|{
 1456|      9|    const BYTE* const istart = (const BYTE*)cSrc;
 1457|      9|    const BYTE* ip = istart;
 1458|      9|    short counting[FSEv05_MAX_SYMBOL_VALUE+1];
 1459|      9|    DTable_max_t dt;   /* Static analyzer seems unable to understand this table will be properly initialized later */
 1460|      9|    unsigned tableLog;
 1461|      9|    unsigned maxSymbolValue = FSEv05_MAX_SYMBOL_VALUE;
  ------------------
  |  | 1048|      9|#define FSEv05_MAX_SYMBOL_VALUE 255
  ------------------
 1462|      9|    size_t errorCode;
 1463|       |
 1464|      9|    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: 6]
  ------------------
 1465|       |
 1466|       |    /* normal FSEv05 decoding mode */
 1467|      6|    errorCode = FSEv05_readNCount (counting, &maxSymbolValue, &tableLog, istart, cSrcSize);
 1468|      6|    if (FSEv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1468:9): [True: 2, False: 4]
  ------------------
 1469|      4|    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: 4]
  ------------------
 1470|      4|    ip += errorCode;
 1471|      4|    cSrcSize -= errorCode;
 1472|       |
 1473|      4|    errorCode = FSEv05_buildDTable (dt, counting, maxSymbolValue, tableLog);
 1474|      4|    if (FSEv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1474:9): [True: 1, False: 3]
  ------------------
 1475|       |
 1476|       |    /* always return, even if it is an error code */
 1477|      3|    return FSEv05_decompress_usingDTable (dst, maxDstSize, ip, cSrcSize, dt);
 1478|      4|}
HUFv05_isError:
 1723|     59|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: 9, False: 3]
  ------------------
 1834|       |
 1835|       |    /* check result */
 1836|      3|    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: 3]
  ------------------
 1837|      3|    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|      3|    nextRankStart = 0;
 1841|     18|    for (n=1; n<=tableLog; n++) {
  ------------------
  |  Branch (1841:15): [True: 15, False: 3]
  ------------------
 1842|     15|        U32 current = nextRankStart;
 1843|     15|        nextRankStart += (rankVal[n] << (n-1));
 1844|     15|        rankVal[n] = current;
 1845|     15|    }
 1846|       |
 1847|       |    /* fill DTable */
 1848|    149|    for (n=0; n<nbSymbols; n++) {
  ------------------
  |  Branch (1848:15): [True: 146, False: 3]
  ------------------
 1849|    146|        const U32 w = huffWeight[n];
 1850|    146|        const U32 length = (1 << w) >> 1;
 1851|    146|        U32 i;
 1852|    146|        HUFv05_DEltX2 D;
 1853|    146|        D.byte = (BYTE)n; D.nbBits = (BYTE)(tableLog + 1 - w);
 1854|    306|        for (i = rankVal[w]; i < rankVal[w] + length; i++)
  ------------------
  |  Branch (1854:30): [True: 160, False: 146]
  ------------------
 1855|    160|            dt[i] = D;
 1856|    146|        rankVal[w] += length;
 1857|    146|    }
 1858|       |
 1859|      3|    return iSize;
 1860|      3|}
HUFv05_decompress1X2_usingDTable:
 1908|      1|{
 1909|      1|    BYTE* op = (BYTE*)dst;
 1910|      1|    BYTE* const oend = op + dstSize;
 1911|      1|    const U32 dtLog = DTable[0];
 1912|      1|    const void* dtPtr = DTable;
 1913|      1|    const HUFv05_DEltX2* const dt = ((const HUFv05_DEltX2*)dtPtr)+1;
 1914|      1|    BITv05_DStream_t bitD;
 1915|       |
 1916|      1|    if (dstSize <= cSrcSize) 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 (1916:9): [True: 0, 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: 2, False: 1]
  ------------------
 1936|      1|    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: 1]
  ------------------
 1937|      1|    ip += errorCode;
 1938|      1|    cSrcSize -= errorCode;
 1939|       |
 1940|      1|    return HUFv05_decompress1X2_usingDTable (dst, dstSize, ip, cSrcSize, DTable);
 1941|      1|}
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|     27|{
 2466|     27|    static const decompressionAlgo decompress[3] = { HUFv05_decompress4X2, HUFv05_decompress4X4, NULL };
 2467|       |    /* estimate decompression time */
 2468|     27|    U32 Q;
 2469|     27|    const U32 D256 = (U32)(dstSize >> 8);
 2470|     27|    U32 Dtime[3];
 2471|     27|    U32 algoNb = 0;
 2472|     27|    int n;
 2473|       |
 2474|       |    /* validation checks */
 2475|     27|    if (dstSize == 0) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      5|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      5|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      5|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2475:9): [True: 5, 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.75k|unsigned ZSTDv05_isError(size_t code) { return ERR_isError(code); }
ZSTDv05_decompressBegin:
 2617|    244|{
 2618|    244|    dctx->expected = ZSTDv05_frameHeaderSize_min;
 2619|    244|    dctx->stage = ZSTDv05ds_getFrameHeaderSize;
 2620|    244|    dctx->previousDstEnd = NULL;
 2621|    244|    dctx->base = NULL;
 2622|    244|    dctx->vBase = NULL;
 2623|    244|    dctx->dictEnd = NULL;
 2624|    244|    dctx->hufTableX4[0] = ZSTD_HUFFDTABLE_CAPACITY_LOG;
  ------------------
  |  |  436|    244|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
 2625|    244|    dctx->flagStaticTables = 0;
 2626|    244|    return 0;
 2627|    244|}
ZSTDv05_createDCtx:
 2630|    122|{
 2631|    122|    ZSTDv05_DCtx* dctx = (ZSTDv05_DCtx*)malloc(sizeof(ZSTDv05_DCtx));
 2632|    122|    if (dctx==NULL) return NULL;
  ------------------
  |  Branch (2632:9): [True: 0, False: 122]
  ------------------
 2633|    122|    ZSTDv05_decompressBegin(dctx);
 2634|    122|    return dctx;
 2635|    122|}
ZSTDv05_freeDCtx:
 2638|    122|{
 2639|    122|    free(dctx);
 2640|    122|    return 0;   /* reserved as a potential error code in the future */
 2641|    122|}
ZSTDv05_getFrameParams:
 2752|    142|{
 2753|    142|    U32 magicNumber;
 2754|    142|    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: 142]
  ------------------
 2755|    142|    magicNumber = MEM_readLE32(src);
 2756|    142|    if (magicNumber != ZSTDv05_MAGICNUMBER) return ERROR(prefix_unknown);
  ------------------
  |  |  153|    142|#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: 142]
  ------------------
 2757|    142|    memset(params, 0, sizeof(*params));
 2758|    142|    params->windowLog = (((const BYTE*)src)[4] & 15) + ZSTDv05_WINDOWLOG_ABSOLUTEMIN;
  ------------------
  |  |  256|    142|#define ZSTDv05_WINDOWLOG_ABSOLUTEMIN 11
  ------------------
 2759|    142|    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: 140]
  ------------------
 2760|    140|    return 0;
 2761|    142|}
ZSTDv05_decompress_usingDict:
 3449|    122|{
 3450|    122|    ZSTDv05_decompressBegin_usingDict(dctx, dict, dictSize);
 3451|    122|    ZSTDv05_checkContinuity(dctx, dst);
 3452|    122|    return ZSTDv05_decompress_continueDCtx(dctx, dst, maxDstSize, src, srcSize);
 3453|    122|}
ZSTDv05_findFrameSizeInfoLegacy:
 3485|    127|{
 3486|    127|    const BYTE* ip = (const BYTE*)src;
 3487|    127|    size_t remainingSize = srcSize;
 3488|    127|    size_t nbBlocks = 0;
 3489|    127|    blockProperties_t blockProperties;
 3490|       |
 3491|       |    /* Frame Header */
 3492|    127|    if (srcSize < ZSTDv05_frameHeaderSize_min) {
  ------------------
  |  Branch (3492:9): [True: 0, False: 127]
  ------------------
 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|    127|    if (MEM_readLE32(src) != ZSTDv05_MAGICNUMBER) {
  ------------------
  |  |  153|    127|#define ZSTDv05_MAGICNUMBER 0xFD2FB525   /* v0.5 */
  ------------------
  |  Branch (3496:9): [True: 0, False: 127]
  ------------------
 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|    127|    ip += ZSTDv05_frameHeaderSize_min; remainingSize -= ZSTDv05_frameHeaderSize_min;
 3501|       |
 3502|       |    /* Loop on each block */
 3503|    525|    while (1)
  ------------------
  |  Branch (3503:12): [True: 525, Folded]
  ------------------
 3504|    525|    {
 3505|    525|        size_t cBlockSize = ZSTDv05_getcBlockSize(ip, remainingSize, &blockProperties);
 3506|    525|        if (ZSTDv05_isError(cBlockSize)) {
  ------------------
  |  Branch (3506:13): [True: 0, False: 525]
  ------------------
 3507|      0|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, cBlockSize);
 3508|      0|            return;
 3509|      0|        }
 3510|       |
 3511|    525|        ip += ZSTDv05_blockHeaderSize;
 3512|    525|        remainingSize -= ZSTDv05_blockHeaderSize;
 3513|    525|        if (cBlockSize > remainingSize) {
  ------------------
  |  Branch (3513:13): [True: 5, False: 520]
  ------------------
 3514|      5|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, ERROR(srcSize_wrong));
  ------------------
  |  |   49|      5|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      5|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      5|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3515|      5|            return;
 3516|      5|        }
 3517|       |
 3518|    520|        if (cBlockSize == 0) break;   /* bt_end */
  ------------------
  |  Branch (3518:13): [True: 122, False: 398]
  ------------------
 3519|       |
 3520|    398|        ip += cBlockSize;
 3521|    398|        remainingSize -= cBlockSize;
 3522|    398|        nbBlocks++;
 3523|    398|    }
 3524|       |
 3525|    122|    *cSize = ip - (const BYTE*)src;
 3526|    122|    *dBound = nbBlocks * BLOCKSIZE;
  ------------------
  |  |  396|    122|#define BLOCKSIZE (128 KB)                 /* define, for static allocation */
  |  |  ------------------
  |  |  |  |  392|    122|#define KB *(1 <<10)
  |  |  ------------------
  ------------------
 3527|    122|}
ZSTDv05_decompressBegin_usingDict:
 3687|    122|{
 3688|    122|    size_t errorCode;
 3689|    122|    errorCode = ZSTDv05_decompressBegin(dctx);
 3690|    122|    if (ZSTDv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (3690:9): [True: 0, False: 122]
  ------------------
 3691|       |
 3692|    122|    if (dict && dictSize) {
  ------------------
  |  Branch (3692:9): [True: 122, False: 0]
  |  Branch (3692:17): [True: 30, False: 92]
  ------------------
 3693|     30|        errorCode = ZSTDv05_decompress_insertDictionary(dctx, dict, dictSize);
 3694|     30|        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: 30]
  ------------------
 3695|     30|    }
 3696|       |
 3697|    122|    return 0;
 3698|    122|}
zstd_v05.c:FSEv05_tableStep:
 1142|     71|static U32 FSEv05_tableStep(U32 tableSize) { return (tableSize>>1) + (tableSize>>3) + 3; }
zstd_v05.c:BITv05_highbit32:
  702|  4.36k|{
  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.36k|}
zstd_v05.c:FSEv05_abs:
 1227|    992|static short FSEv05_abs(short a) { return a<0 ? -a : a; }
  ------------------
  |  Branch (1227:43): [True: 714, False: 278]
  ------------------
zstd_v05.c:FSEv05_decompress_usingDTable_generic:
 1376|      3|{
 1377|      3|    BYTE* const ostart = (BYTE*) dst;
 1378|      3|    BYTE* op = ostart;
 1379|      3|    BYTE* const omax = op + maxDstSize;
 1380|      3|    BYTE* const olimit = omax-3;
 1381|       |
 1382|      3|    BITv05_DStream_t bitD;
 1383|      3|    FSEv05_DState_t state1;
 1384|      3|    FSEv05_DState_t state2;
 1385|      3|    size_t errorCode;
 1386|       |
 1387|       |    /* Init */
 1388|      3|    errorCode = BITv05_initDStream(&bitD, cSrc, cSrcSize);   /* replaced last arg by maxCompressed Size */
 1389|      3|    if (FSEv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (1389:9): [True: 0, False: 3]
  ------------------
 1390|       |
 1391|      3|    FSEv05_initDState(&state1, &bitD, dt);
 1392|      3|    FSEv05_initDState(&state2, &bitD, dt);
 1393|       |
 1394|      3|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
 1395|       |
 1396|       |    /* 4 symbols per loop */
 1397|    129|    for ( ; (BITv05_reloadDStream(&bitD)==BITv05_DStream_unfinished) && (op<olimit) ; op+=4) {
  ------------------
  |  Branch (1397:13): [True: 128, False: 1]
  |  Branch (1397:73): [True: 126, False: 2]
  ------------------
 1398|    126|        op[0] = FSEv05_GETSYMBOL(&state1);
  ------------------
  |  | 1394|    126|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 63, False: 63]
  |  |  ------------------
  ------------------
 1399|       |
 1400|    126|        if (FSEv05_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1094|    126|#define FSEv05_MAX_TABLELOG  (FSEv05_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1042|    126|#define FSEv05_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1400:13): [Folded, False: 126]
  ------------------
 1401|      0|            BITv05_reloadDStream(&bitD);
 1402|       |
 1403|    126|        op[1] = FSEv05_GETSYMBOL(&state2);
  ------------------
  |  | 1394|    126|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 63, False: 63]
  |  |  ------------------
  ------------------
 1404|       |
 1405|    126|        if (FSEv05_MAX_TABLELOG*4+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1094|    126|#define FSEv05_MAX_TABLELOG  (FSEv05_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1042|    126|#define FSEv05_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1405:13): [Folded, False: 126]
  ------------------
 1406|      0|            { if (BITv05_reloadDStream(&bitD) > BITv05_DStream_unfinished) { op+=2; break; } }
  ------------------
  |  Branch (1406:19): [True: 0, False: 0]
  ------------------
 1407|       |
 1408|    126|        op[2] = FSEv05_GETSYMBOL(&state1);
  ------------------
  |  | 1394|    126|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 63, False: 63]
  |  |  ------------------
  ------------------
 1409|       |
 1410|    126|        if (FSEv05_MAX_TABLELOG*2+7 > sizeof(bitD.bitContainer)*8)    /* This test must be static */
  ------------------
  |  | 1094|    126|#define FSEv05_MAX_TABLELOG  (FSEv05_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  | 1042|    126|#define FSEv05_MAX_MEMORY_USAGE 14
  |  |  ------------------
  ------------------
  |  Branch (1410:13): [Folded, False: 126]
  ------------------
 1411|      0|            BITv05_reloadDStream(&bitD);
 1412|       |
 1413|    126|        op[3] = FSEv05_GETSYMBOL(&state2);
  ------------------
  |  | 1394|    126|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 63, False: 63]
  |  |  ------------------
  ------------------
 1414|    126|    }
 1415|       |
 1416|       |    /* tail */
 1417|       |    /* note : BITv05_reloadDStream(&bitD) >= FSEv05_DStream_partiallyFilled; Ends at exactly BITv05_DStream_completed */
 1418|     17|    while (1) {
  ------------------
  |  Branch (1418:12): [True: 17, Folded]
  ------------------
 1419|     17|        if ( (BITv05_reloadDStream(&bitD)>BITv05_DStream_completed) || (op==omax) || (BITv05_endOfDStream(&bitD) && (fast || FSEv05_endOfDState(&state1))) )
  ------------------
  |  Branch (1419:14): [True: 0, False: 17]
  |  Branch (1419:72): [True: 0, False: 17]
  |  Branch (1419:87): [True: 1, False: 16]
  |  Branch (1419:118): [True: 0, False: 1]
  |  Branch (1419:126): [True: 0, False: 1]
  ------------------
 1420|      0|            break;
 1421|       |
 1422|     17|        *op++ = FSEv05_GETSYMBOL(&state1);
  ------------------
  |  | 1394|     17|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 2, False: 15]
  |  |  ------------------
  ------------------
 1423|       |
 1424|     17|        if ( (BITv05_reloadDStream(&bitD)>BITv05_DStream_completed) || (op==omax) || (BITv05_endOfDStream(&bitD) && (fast || FSEv05_endOfDState(&state2))) )
  ------------------
  |  Branch (1424:14): [True: 1, False: 16]
  |  Branch (1424:72): [True: 2, False: 14]
  |  Branch (1424:87): [True: 0, False: 14]
  |  Branch (1424:118): [True: 0, False: 0]
  |  Branch (1424:126): [True: 0, False: 0]
  ------------------
 1425|      3|            break;
 1426|       |
 1427|     14|        *op++ = FSEv05_GETSYMBOL(&state2);
  ------------------
  |  | 1394|     14|#define FSEv05_GETSYMBOL(statePtr) fast ? FSEv05_decodeSymbolFast(statePtr, &bitD) : FSEv05_decodeSymbol(statePtr, &bitD)
  |  |  ------------------
  |  |  |  Branch (1394:36): [True: 1, False: 13]
  |  |  ------------------
  ------------------
 1428|     14|    }
 1429|       |
 1430|       |    /* end ? */
 1431|      3|    if (BITv05_endOfDStream(&bitD) && FSEv05_endOfDState(&state1) && FSEv05_endOfDState(&state2))
  ------------------
  |  Branch (1431:9): [True: 0, False: 3]
  |  Branch (1431:39): [True: 0, False: 0]
  |  Branch (1431:70): [True: 0, False: 0]
  ------------------
 1432|      0|        return op-ostart;
 1433|       |
 1434|      3|    if (op==omax) return ERROR(dstSize_tooSmall);   /* dst buffer is full, but cSrc unfinished */
  ------------------
  |  |   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 (1434:9): [True: 2, 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|      3|}
zstd_v05.c:FSEv05_initDState:
  951|    204|{
  952|    204|    const void* ptr = dt;
  953|    204|    const FSEv05_DTableHeader* const DTableH = (const FSEv05_DTableHeader*)ptr;
  954|    204|    DStatePtr->state = BITv05_readBits(bitD, DTableH->tableLog);
  955|    204|    BITv05_reloadDStream(bitD);
  956|    204|    DStatePtr->table = dt + 1;
  957|    204|}
zstd_v05.c:BITv05_readBits:
  790|  4.93k|{
  791|  4.93k|    size_t value = BITv05_lookBits(bitD, nbBits);
  792|  4.93k|    BITv05_skipBits(bitD, nbBits);
  793|  4.93k|    return value;
  794|  4.93k|}
zstd_v05.c:BITv05_lookBits:
  771|  4.93k|{
  772|  4.93k|    const U32 bitMask = sizeof(bitD->bitContainer)*8 - 1;
  773|  4.93k|    return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask);
  774|  4.93k|}
zstd_v05.c:BITv05_skipBits:
  785|  6.21k|{
  786|  6.21k|    bitD->bitsConsumed += nbBits;
  787|  6.21k|}
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|  3.61k|{
  967|  3.61k|    const FSEv05_decode_t DInfo = ((const FSEv05_decode_t*)(DStatePtr->table))[DStatePtr->state];
  968|  3.61k|    const U32  nbBits = DInfo.nbBits;
  969|  3.61k|    BYTE symbol = DInfo.symbol;
  970|  3.61k|    size_t lowBits = BITv05_readBits(bitD, nbBits);
  971|       |
  972|  3.61k|    DStatePtr->state = DInfo.newState + lowBits;
  973|  3.61k|    return symbol;
  974|  3.61k|}
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: 3, False: 10]
  ------------------
 1758|      3|        if (iSize >= (242)) {  /* RLE */
  ------------------
  |  Branch (1758:13): [True: 3, False: 0]
  ------------------
 1759|      3|            static int l[14] = { 1, 2, 3, 4, 7, 8, 15, 16, 31, 32, 63, 64, 127, 128 };
 1760|      3|            oSize = l[iSize-242];
 1761|      3|            memset(huffWeight, 1, hwSize);
 1762|      3|            iSize = 0;
 1763|      3|        }
 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|     10|    else  {   /* header compressed with FSEv05 (normal case) */
 1775|     10|        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: 9]
  ------------------
 1776|      9|        oSize = FSEv05_decompress(huffWeight, hwSize-1, ip+1, iSize);   /* max (hwSize-1) values decoded, as last one is implied */
 1777|      9|        if (FSEv05_isError(oSize)) return oSize;
  ------------------
  |  Branch (1777:13): [True: 9, False: 0]
  ------------------
 1778|      9|    }
 1779|       |
 1780|       |    /* collect weight stats */
 1781|      3|    memset(rankStats, 0, (HUFv05_ABSOLUTEMAX_TABLELOG + 1) * sizeof(U32));
  ------------------
  |  | 1711|      3|#define HUFv05_ABSOLUTEMAX_TABLELOG  16   /* absolute limit of HUFv05_MAX_TABLELOG. Beyond that value, code does not work */
  ------------------
 1782|      3|    weightTotal = 0;
 1783|    146|    for (n=0; n<oSize; n++) {
  ------------------
  |  Branch (1783:15): [True: 143, False: 3]
  ------------------
 1784|    143|        if (huffWeight[n] >= HUFv05_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  | 1711|    143|#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: 143]
  ------------------
 1785|    143|        rankStats[huffWeight[n]]++;
 1786|    143|        weightTotal += (1 << huffWeight[n]) >> 1;
 1787|    143|    }
 1788|      3|    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: 3]
  ------------------
 1789|       |
 1790|       |    /* get last non-null symbol weight (implied, total must be 2^n) */
 1791|      3|    tableLog = BITv05_highbit32(weightTotal) + 1;
 1792|      3|    if (tableLog > HUFv05_ABSOLUTEMAX_TABLELOG) return ERROR(corruption_detected);
  ------------------
  |  | 1711|      3|#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: 3]
  ------------------
 1793|      3|    {   /* determine last weight */
 1794|      3|        U32 total = 1 << tableLog;
 1795|      3|        U32 rest = total - weightTotal;
 1796|      3|        U32 verif = 1 << BITv05_highbit32(rest);
 1797|      3|        U32 lastWeight = BITv05_highbit32(rest) + 1;
 1798|      3|        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: 3]
  ------------------
 1799|      3|        huffWeight[oSize] = (BYTE)lastWeight;
 1800|      3|        rankStats[lastWeight]++;
 1801|      3|    }
 1802|       |
 1803|       |    /* check tree construction validity */
 1804|      3|    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: 3]
  |  Branch (1804:31): [True: 0, False: 3]
  ------------------
 1805|       |
 1806|       |    /* results */
 1807|      3|    *nbSymbolsPtr = (U32)(oSize+1);
 1808|      3|    *tableLogPtr = tableLog;
 1809|      3|    return iSize+1;
 1810|      3|}
zstd_v05.c:BITv05_initDStream:
  735|     72|{
  736|     72|    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: 72]
  ------------------
  737|       |
  738|     72|    if (srcSize >=  sizeof(size_t)) {  /* normal case */
  ------------------
  |  Branch (738:9): [True: 62, False: 10]
  ------------------
  739|     62|        U32 contain32;
  740|     62|        bitD->start = (const char*)srcBuffer;
  741|     62|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(size_t);
  742|     62|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  743|     62|        contain32 = ((const BYTE*)srcBuffer)[srcSize-1];
  744|     62|        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: 60]
  ------------------
  745|     60|        bitD->bitsConsumed = 8 - BITv05_highbit32(contain32);
  746|     60|    } 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|     70|    return srcSize;
  768|     72|}
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|     35|{
  839|     35|    return ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8));
  ------------------
  |  Branch (839:13): [True: 26, False: 9]
  |  Branch (839:49): [True: 1, False: 25]
  ------------------
  840|     35|}
zstd_v05.c:BITv05_reloadDStream:
  806|  1.76k|{
  807|  1.76k|    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))  /* should never happen */
  ------------------
  |  Branch (807:9): [True: 9, False: 1.75k]
  ------------------
  808|      9|        return BITv05_DStream_overflow;
  809|       |
  810|  1.75k|    if (bitD->ptr >= bitD->start + sizeof(bitD->bitContainer)) {
  ------------------
  |  Branch (810:9): [True: 1.18k, False: 567]
  ------------------
  811|  1.18k|        bitD->ptr -= bitD->bitsConsumed >> 3;
  812|  1.18k|        bitD->bitsConsumed &= 7;
  813|  1.18k|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  814|  1.18k|        return BITv05_DStream_unfinished;
  815|  1.18k|    }
  816|    567|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (816:9): [True: 382, False: 185]
  ------------------
  817|    382|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BITv05_DStream_endOfBuffer;
  ------------------
  |  Branch (817:13): [True: 369, False: 13]
  ------------------
  818|     13|        return BITv05_DStream_completed;
  819|    382|    }
  820|    185|    {
  821|    185|        U32 nbBytes = bitD->bitsConsumed >> 3;
  822|    185|        BITv05_DStream_status result = BITv05_DStream_unfinished;
  823|    185|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (823:13): [True: 3, False: 182]
  ------------------
  824|      3|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  825|      3|            result = BITv05_DStream_endOfBuffer;
  826|      3|        }
  827|    185|        bitD->ptr -= nbBytes;
  828|    185|        bitD->bitsConsumed -= nbBytes*8;
  829|    185|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD) */
  830|    185|        return result;
  831|    567|    }
  832|    567|}
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|    122|{
 3331|    122|    if (dst != dctx->previousDstEnd) {   /* not contiguous */
  ------------------
  |  Branch (3331:9): [True: 122, False: 0]
  ------------------
 3332|    122|        dctx->dictEnd = dctx->previousDstEnd;
 3333|    122|        dctx->vBase = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3334|    122|        dctx->base = dst;
 3335|    122|        dctx->previousDstEnd = dst;
 3336|    122|    }
 3337|    122|}
zstd_v05.c:ZSTDv05_decompressBlock_internal:
 3343|    149|{   /* blockType == blockCompressed */
 3344|    149|    const BYTE* ip = (const BYTE*)src;
 3345|    149|    size_t litCSize;
 3346|       |
 3347|    149|    if (srcSize >= BLOCKSIZE) return ERROR(srcSize_wrong);
  ------------------
  |  |  396|    149|#define BLOCKSIZE (128 KB)                 /* define, for static allocation */
  |  |  ------------------
  |  |  |  |  392|    149|#define KB *(1 <<10)
  |  |  ------------------
  ------------------
                  if (srcSize >= BLOCKSIZE) return ERROR(srcSize_wrong);
  ------------------
  |  |   49|      7|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      7|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      7|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3347:9): [True: 7, False: 142]
  ------------------
 3348|       |
 3349|       |    /* Decode literals sub-block */
 3350|    142|    litCSize = ZSTDv05_decodeLiteralsBlock(dctx, src, srcSize);
 3351|    142|    if (ZSTDv05_isError(litCSize)) return litCSize;
  ------------------
  |  Branch (3351:9): [True: 45, False: 97]
  ------------------
 3352|     97|    ip += litCSize;
 3353|     97|    srcSize -= litCSize;
 3354|       |
 3355|     97|    return ZSTDv05_decompressSequences(dctx, dst, dstCapacity, ip, srcSize);
 3356|    142|}
zstd_v05.c:ZSTDv05_decodeLiteralsBlock:
 2812|    142|{
 2813|    142|    const BYTE* const istart = (const BYTE*) src;
 2814|       |
 2815|       |    /* any compressed block with literals segment must be at least this size */
 2816|    142|    if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  |  439|    142|#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */ + MIN_SEQUENCES_SIZE /* nbSeq==0 */)   /* for a non-null block */
  |  |  ------------------
  |  |  |  |  438|    142|#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: 130]
  ------------------
 2817|       |
 2818|    130|    switch(istart[0]>> 6)
 2819|    130|    {
 2820|     30|    case IS_HUFv05:
  ------------------
  |  |  409|     30|#define IS_HUFv05 0
  ------------------
  |  Branch (2820:5): [True: 30, False: 100]
  ------------------
 2821|     30|        {
 2822|     30|            size_t litSize, litCSize, singleStream=0;
 2823|     30|            U32 lhSize = ((istart[0]) >> 4) & 3;
 2824|     30|            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: 30]
  ------------------
 2825|     30|            switch(lhSize)
 2826|     30|            {
 2827|     25|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (2827:13): [True: 22, False: 8]
  |  Branch (2827:21): [True: 3, False: 27]
  |  Branch (2827:29): [True: 0, False: 30]
  ------------------
 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|      5|            case 2:
  ------------------
  |  Branch (2834:13): [True: 5, False: 25]
  ------------------
 2835|       |                /* 2 - 2 - 14 - 14 */
 2836|      5|                lhSize=4;
 2837|      5|                litSize  = ((istart[0] & 15) << 10) + (istart[1] << 2) + (istart[2] >> 6);
 2838|      5|                litCSize = ((istart[2] & 63) <<  8) + istart[3];
 2839|      5|                break;
 2840|      0|            case 3:
  ------------------
  |  Branch (2840:13): [True: 0, False: 30]
  ------------------
 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|     30|            }
 2847|     30|            if (litSize > BLOCKSIZE) return ERROR(corruption_detected);
  ------------------
  |  |  396|     30|#define BLOCKSIZE (128 KB)                 /* define, for static allocation */
  |  |  ------------------
  |  |  |  |  392|     30|#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: 30]
  ------------------
 2848|     30|            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: 30]
  ------------------
 2849|       |
 2850|     30|            if (HUFv05_isError(singleStream ?
  ------------------
  |  Branch (2850:17): [True: 26, False: 4]
  |  Branch (2850:32): [True: 3, False: 27]
  ------------------
 2851|      3|                            HUFv05_decompress1X2(dctx->litBuffer, litSize, istart+lhSize, litCSize) :
 2852|     30|                            HUFv05_decompress   (dctx->litBuffer, litSize, istart+lhSize, litCSize) ))
 2853|     26|                return ERROR(corruption_detected);
  ------------------
  |  |   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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|     30|        }
 2860|      2|    case IS_PCH:
  ------------------
  |  |  410|      2|#define IS_PCH 1
  ------------------
  |  Branch (2860:5): [True: 2, False: 128]
  ------------------
 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|     20|    case IS_RAW:
  ------------------
  |  |  411|     20|#define IS_RAW 2
  ------------------
  |  Branch (2884:5): [True: 20, False: 110]
  ------------------
 2885|     20|        {
 2886|     20|            size_t litSize;
 2887|     20|            U32 lhSize = ((istart[0]) >> 4) & 3;
 2888|     20|            switch(lhSize)
 2889|     20|            {
 2890|     11|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (2890:13): [True: 4, False: 16]
  |  Branch (2890:21): [True: 7, False: 13]
  |  Branch (2890:29): [True: 0, False: 20]
  ------------------
 2891|     11|                lhSize=1;
 2892|     11|                litSize = istart[0] & 31;
 2893|     11|                break;
 2894|      9|            case 2:
  ------------------
  |  Branch (2894:13): [True: 9, False: 11]
  ------------------
 2895|      9|                litSize = ((istart[0] & 15) << 8) + istart[1];
 2896|      9|                break;
 2897|      0|            case 3:
  ------------------
  |  Branch (2897:13): [True: 0, False: 20]
  ------------------
 2898|      0|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 2899|      0|                break;
 2900|     20|            }
 2901|       |
 2902|     20|            if (lhSize+litSize+WILDCOPY_OVERLENGTH > srcSize) {  /* risk reading beyond src buffer with wildcopy */
  ------------------
  |  |  441|     20|#define WILDCOPY_OVERLENGTH 8
  ------------------
  |  Branch (2902:17): [True: 0, False: 20]
  ------------------
 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|     20|            dctx->litPtr = istart+lhSize;
 2912|     20|            dctx->litSize = litSize;
 2913|     20|            return lhSize+litSize;
 2914|     20|        }
 2915|     78|    case IS_RLE:
  ------------------
  |  |  412|     78|#define IS_RLE 3
  ------------------
  |  Branch (2915:5): [True: 78, False: 52]
  ------------------
 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: 130]
  ------------------
 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|    130|    }
 2942|    130|}
zstd_v05.c:ZSTDv05_decompressSequences:
 3260|     97|{
 3261|     97|    const BYTE* ip = (const BYTE*)seqStart;
 3262|     97|    const BYTE* const iend = ip + seqSize;
 3263|     97|    BYTE* const ostart = (BYTE*)dst;
 3264|     97|    BYTE* op = ostart;
 3265|     97|    BYTE* const oend = ostart + maxDstSize;
 3266|     97|    size_t errorCode, dumpsLength=0;
 3267|     97|    const BYTE* litPtr = dctx->litPtr;
 3268|     97|    const BYTE* const litEnd = litPtr + dctx->litSize;
 3269|     97|    int nbSeq=0;
 3270|     97|    const BYTE* dumps = NULL;
 3271|     97|    unsigned* DTableLL = dctx->LLTable;
 3272|     97|    unsigned* DTableML = dctx->MLTable;
 3273|     97|    unsigned* DTableOffb = dctx->OffTable;
 3274|     97|    const BYTE* const base = (const BYTE*) (dctx->base);
 3275|     97|    const BYTE* const vBase = (const BYTE*) (dctx->vBase);
 3276|     97|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 3277|       |
 3278|       |    /* Build Decoding Tables */
 3279|     97|    errorCode = ZSTDv05_decodeSeqHeaders(&nbSeq, &dumps, &dumpsLength,
 3280|     97|                                      DTableLL, DTableML, DTableOffb,
 3281|     97|                                      ip, seqSize, dctx->flagStaticTables);
 3282|     97|    if (ZSTDv05_isError(errorCode)) return errorCode;
  ------------------
  |  Branch (3282:9): [True: 2, False: 95]
  ------------------
 3283|     95|    ip += errorCode;
 3284|       |
 3285|       |    /* Regen sequences */
 3286|     95|    if (nbSeq) {
  ------------------
  |  Branch (3286:9): [True: 68, False: 27]
  ------------------
 3287|     68|        seq_t sequence;
 3288|     68|        seqState_t seqState;
 3289|       |
 3290|     68|        memset(&sequence, 0, sizeof(sequence));
 3291|     68|        sequence.offset = REPCODE_STARTVALUE;
  ------------------
  |  |  415|     68|#define REPCODE_STARTVALUE 1
  ------------------
 3292|     68|        seqState.dumps = dumps;
 3293|     68|        seqState.dumpsEnd = dumps + dumpsLength;
 3294|     68|        seqState.prevOffset = REPCODE_STARTVALUE;
  ------------------
  |  |  415|     68|#define REPCODE_STARTVALUE 1
  ------------------
 3295|     68|        errorCode = BITv05_initDStream(&(seqState.DStream), ip, iend-ip);
 3296|     68|        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: 66]
  ------------------
 3297|     66|        FSEv05_initDState(&(seqState.stateLL), &(seqState.DStream), DTableLL);
 3298|     66|        FSEv05_initDState(&(seqState.stateOffb), &(seqState.DStream), DTableOffb);
 3299|     66|        FSEv05_initDState(&(seqState.stateML), &(seqState.DStream), DTableML);
 3300|       |
 3301|  1.13k|        for ( ; (BITv05_reloadDStream(&(seqState.DStream)) <= BITv05_DStream_completed) && nbSeq ; ) {
  ------------------
  |  Branch (3301:17): [True: 1.12k, False: 8]
  |  Branch (3301:92): [True: 1.11k, False: 15]
  ------------------
 3302|  1.11k|            size_t oneSeqSize;
 3303|  1.11k|            nbSeq--;
 3304|  1.11k|            ZSTDv05_decodeSequence(&sequence, &seqState);
 3305|  1.11k|            oneSeqSize = ZSTDv05_execSequence(op, oend, sequence, &litPtr, litEnd, base, vBase, dictEnd);
 3306|  1.11k|            if (ZSTDv05_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  Branch (3306:17): [True: 43, False: 1.06k]
  ------------------
 3307|  1.06k|            op += oneSeqSize;
 3308|  1.06k|        }
 3309|       |
 3310|       |        /* check if reached exact end */
 3311|     23|        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: 15]
  ------------------
 3312|     23|    }
 3313|       |
 3314|       |    /* last literal segment */
 3315|     42|    {
 3316|     42|        size_t lastLLSize = litEnd - litPtr;
 3317|     42|        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: 42]
  ------------------
 3318|     42|        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: 42]
  ------------------
 3319|     42|        if (lastLLSize > 0) {
  ------------------
  |  Branch (3319:13): [True: 41, False: 1]
  ------------------
 3320|     41|            memcpy(op, litPtr, lastLLSize);
 3321|     41|            op += lastLLSize;
 3322|     41|        }
 3323|     42|    }
 3324|       |
 3325|      0|    return op-ostart;
 3326|     42|}
zstd_v05.c:ZSTDv05_decodeSeqHeaders:
 2948|     97|{
 2949|     97|    const BYTE* const istart = (const BYTE*)src;
 2950|     97|    const BYTE* ip = istart;
 2951|     97|    const BYTE* const iend = istart + srcSize;
 2952|     97|    U32 LLtype, Offtype, MLtype;
 2953|     97|    unsigned LLlog, Offlog, MLlog;
 2954|     97|    size_t dumpsLength;
 2955|       |
 2956|       |    /* check */
 2957|     97|    if (srcSize < MIN_SEQUENCES_SIZE)
  ------------------
  |  |  438|     97|#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */
  ------------------
  |  Branch (2957:9): [True: 0, False: 97]
  ------------------
 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|     97|    *nbSeq = *ip++;
 2962|     97|    if (*nbSeq==0) return 1;
  ------------------
  |  Branch (2962:9): [True: 27, False: 70]
  ------------------
 2963|     70|    if (*nbSeq >= 128) {
  ------------------
  |  Branch (2963:9): [True: 20, False: 50]
  ------------------
 2964|     20|        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: 20]
  ------------------
 2965|     20|        *nbSeq = ((nbSeq[0]-128)<<8) + *ip++;
 2966|     20|    }
 2967|       |
 2968|     70|    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: 70]
  ------------------
 2969|     70|    LLtype  = *ip >> 6;
 2970|     70|    Offtype = (*ip >> 4) & 3;
 2971|     70|    MLtype  = (*ip >> 2) & 3;
 2972|     70|    if (*ip & 2) {
  ------------------
  |  Branch (2972:9): [True: 34, False: 36]
  ------------------
 2973|     34|        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: 34]
  ------------------
 2974|     34|        dumpsLength  = ip[2];
 2975|     34|        dumpsLength += ip[1] << 8;
 2976|     34|        ip += 3;
 2977|     36|    } else {
 2978|     36|        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: 36]
  ------------------
 2979|     36|        dumpsLength  = ip[1];
 2980|     36|        dumpsLength += (ip[0] & 1) << 8;
 2981|     36|        ip += 2;
 2982|     36|    }
 2983|     70|    *dumpsPtr = ip;
 2984|     70|    ip += dumpsLength;
 2985|     70|    *dumpsLengthPtr = dumpsLength;
 2986|       |
 2987|       |    /* check */
 2988|     70|    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: 70]
  ------------------
 2989|       |
 2990|       |    /* sequences */
 2991|     70|    {
 2992|     70|        S16 norm[MaxML+1];    /* assumption : MaxML >= MaxLL >= MaxOff */
 2993|     70|        size_t headerSize;
 2994|       |
 2995|       |        /* Build DTables */
 2996|     70|        switch(LLtype)
 2997|     70|        {
 2998|     21|        case FSEv05_ENCODING_RLE :
  ------------------
  |  |  431|     21|#define FSEv05_ENCODING_RLE     1
  ------------------
  |  Branch (2998:9): [True: 21, False: 49]
  ------------------
 2999|     21|            LLlog = 0;
 3000|     21|            FSEv05_buildDTable_rle(DTableLL, *ip++);
 3001|     21|            break;
 3002|     33|        case FSEv05_ENCODING_RAW :
  ------------------
  |  |  430|     33|#define FSEv05_ENCODING_RAW     0
  ------------------
  |  Branch (3002:9): [True: 33, False: 37]
  ------------------
 3003|     33|            LLlog = LLbits;
  ------------------
  |  |  419|     33|#define LLbits   6
  ------------------
 3004|     33|            FSEv05_buildDTable_raw(DTableLL, LLbits);
  ------------------
  |  |  419|     33|#define LLbits   6
  ------------------
 3005|     33|            break;
 3006|      0|        case FSEv05_ENCODING_STATIC:
  ------------------
  |  |  432|      0|#define FSEv05_ENCODING_STATIC  2
  ------------------
  |  Branch (3006:9): [True: 0, False: 70]
  ------------------
 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|     16|        case FSEv05_ENCODING_DYNAMIC :
  ------------------
  |  |  433|     16|#define FSEv05_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3009:9): [True: 16, False: 54]
  ------------------
 3010|     16|        default :   /* impossible */
  ------------------
  |  Branch (3010:9): [True: 0, False: 70]
  ------------------
 3011|     16|            {   unsigned max = MaxLL;
  ------------------
  |  |  423|     16|#define MaxLL  ((1<<LLbits) - 1)
  |  |  ------------------
  |  |  |  |  419|     16|#define LLbits   6
  |  |  ------------------
  ------------------
 3012|     16|                headerSize = FSEv05_readNCount(norm, &max, &LLlog, ip, iend-ip);
 3013|     16|                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: 16]
  ------------------
 3014|     16|                if (LLlog > LLFSEv05Log) return ERROR(corruption_detected);
  ------------------
  |  |  426|     16|#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: 16]
  ------------------
 3015|     16|                ip += headerSize;
 3016|     16|                FSEv05_buildDTable(DTableLL, norm, max, LLlog);
 3017|     16|        }   }
 3018|       |
 3019|     70|        switch(Offtype)
 3020|     70|        {
 3021|     14|        case FSEv05_ENCODING_RLE :
  ------------------
  |  |  431|     14|#define FSEv05_ENCODING_RLE     1
  ------------------
  |  Branch (3021:9): [True: 14, False: 56]
  ------------------
 3022|     14|            Offlog = 0;
 3023|     14|            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: 14]
  ------------------
 3024|     14|            FSEv05_buildDTable_rle(DTableOffb, *ip++ & MaxOff); /* if *ip > MaxOff, data is corrupted */
  ------------------
  |  |  424|     14|#define MaxOff ((1<<Offbits)- 1)
  |  |  ------------------
  |  |  |  |  420|     14|#define Offbits  5
  |  |  ------------------
  ------------------
 3025|     14|            break;
 3026|     16|        case FSEv05_ENCODING_RAW :
  ------------------
  |  |  430|     16|#define FSEv05_ENCODING_RAW     0
  ------------------
  |  Branch (3026:9): [True: 16, False: 54]
  ------------------
 3027|     16|            Offlog = Offbits;
  ------------------
  |  |  420|     16|#define Offbits  5
  ------------------
 3028|     16|            FSEv05_buildDTable_raw(DTableOffb, Offbits);
  ------------------
  |  |  420|     16|#define Offbits  5
  ------------------
 3029|     16|            break;
 3030|      2|        case FSEv05_ENCODING_STATIC:
  ------------------
  |  |  432|      2|#define FSEv05_ENCODING_STATIC  2
  ------------------
  |  Branch (3030:9): [True: 2, False: 68]
  ------------------
 3031|      2|            if (!flagStaticTable) return ERROR(corruption_detected);
  ------------------
  |  |   49|      2|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      2|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      2|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3031:17): [True: 2, False: 0]
  ------------------
 3032|      0|            break;
 3033|     38|        case FSEv05_ENCODING_DYNAMIC :
  ------------------
  |  |  433|     38|#define FSEv05_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3033:9): [True: 38, False: 32]
  ------------------
 3034|     38|        default :   /* impossible */
  ------------------
  |  Branch (3034:9): [True: 0, False: 70]
  ------------------
 3035|     38|            {   unsigned max = MaxOff;
  ------------------
  |  |  424|     38|#define MaxOff ((1<<Offbits)- 1)
  |  |  ------------------
  |  |  |  |  420|     38|#define Offbits  5
  |  |  ------------------
  ------------------
 3036|     38|                headerSize = FSEv05_readNCount(norm, &max, &Offlog, ip, iend-ip);
 3037|     38|                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: 38]
  ------------------
 3038|     38|                if (Offlog > OffFSEv05Log) return ERROR(corruption_detected);
  ------------------
  |  |  427|     38|#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: 38]
  ------------------
 3039|     38|                ip += headerSize;
 3040|     38|                FSEv05_buildDTable(DTableOffb, norm, max, Offlog);
 3041|     38|        }   }
 3042|       |
 3043|     68|        switch(MLtype)
 3044|     68|        {
 3045|     24|        case FSEv05_ENCODING_RLE :
  ------------------
  |  |  431|     24|#define FSEv05_ENCODING_RLE     1
  ------------------
  |  Branch (3045:9): [True: 24, False: 44]
  ------------------
 3046|     24|            MLlog = 0;
 3047|     24|            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: 24]
  ------------------
 3048|     24|            FSEv05_buildDTable_rle(DTableML, *ip++);
 3049|     24|            break;
 3050|     31|        case FSEv05_ENCODING_RAW :
  ------------------
  |  |  430|     31|#define FSEv05_ENCODING_RAW     0
  ------------------
  |  Branch (3050:9): [True: 31, False: 37]
  ------------------
 3051|     31|            MLlog = MLbits;
  ------------------
  |  |  418|     31|#define MLbits   7
  ------------------
 3052|     31|            FSEv05_buildDTable_raw(DTableML, MLbits);
  ------------------
  |  |  418|     31|#define MLbits   7
  ------------------
 3053|     31|            break;
 3054|      0|        case FSEv05_ENCODING_STATIC:
  ------------------
  |  |  432|      0|#define FSEv05_ENCODING_STATIC  2
  ------------------
  |  Branch (3054:9): [True: 0, False: 68]
  ------------------
 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: 55]
  ------------------
 3058|     13|        default :   /* impossible */
  ------------------
  |  Branch (3058:9): [True: 0, False: 68]
  ------------------
 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|     68|    return ip-istart;
 3068|     68|}
zstd_v05.c:ZSTDv05_decodeSequence:
 3090|  1.11k|{
 3091|  1.11k|    size_t litLength;
 3092|  1.11k|    size_t prevOffset;
 3093|  1.11k|    size_t offset;
 3094|  1.11k|    size_t matchLength;
 3095|  1.11k|    const BYTE* dumps = seqState->dumps;
 3096|  1.11k|    const BYTE* const de = seqState->dumpsEnd;
 3097|       |
 3098|       |    /* Literal length */
 3099|  1.11k|    litLength = FSEv05_peakSymbol(&(seqState->stateLL));
 3100|  1.11k|    prevOffset = litLength ? seq->offset : seqState->prevOffset;
  ------------------
  |  Branch (3100:18): [True: 800, False: 312]
  ------------------
 3101|  1.11k|    if (litLength == MaxLL) {
  ------------------
  |  |  423|  1.11k|#define MaxLL  ((1<<LLbits) - 1)
  |  |  ------------------
  |  |  |  |  419|  1.11k|#define LLbits   6
  |  |  ------------------
  ------------------
  |  Branch (3101:9): [True: 28, False: 1.08k]
  ------------------
 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|  1.11k|    {
 3118|  1.11k|        static const U32 offsetPrefix[MaxOff+1] = {
 3119|  1.11k|                1 /*fake*/, 1, 2, 4, 8, 16, 32, 64, 128, 256,
 3120|  1.11k|                512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144,
 3121|  1.11k|                524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, /*fake*/ 1, 1, 1, 1, 1 };
 3122|  1.11k|        U32 offsetCode = FSEv05_peakSymbol(&(seqState->stateOffb));   /* <= maxOff, by table construction */
 3123|  1.11k|        U32 nbBits = offsetCode - 1;
 3124|  1.11k|        if (offsetCode==0) nbBits = 0;   /* cmove */
  ------------------
  |  Branch (3124:13): [True: 304, False: 808]
  ------------------
 3125|  1.11k|        offset = offsetPrefix[offsetCode] + BITv05_readBits(&(seqState->DStream), nbBits);
 3126|  1.11k|        if (MEM_32bits()) BITv05_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3126:13): [True: 0, False: 1.11k]
  ------------------
 3127|  1.11k|        if (offsetCode==0) offset = prevOffset;   /* repcode, cmove */
  ------------------
  |  Branch (3127:13): [True: 304, False: 808]
  ------------------
 3128|  1.11k|        if (offsetCode | !litLength) seqState->prevOffset = seq->offset;   /* cmove */
  ------------------
  |  Branch (3128:13): [True: 914, False: 198]
  ------------------
 3129|  1.11k|        FSEv05_decodeSymbol(&(seqState->stateOffb), &(seqState->DStream));    /* update */
 3130|  1.11k|    }
 3131|       |
 3132|       |    /* Literal length update */
 3133|  1.11k|    FSEv05_decodeSymbol(&(seqState->stateLL), &(seqState->DStream));   /* update */
 3134|  1.11k|    if (MEM_32bits()) BITv05_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3134:9): [True: 0, False: 1.11k]
  ------------------
 3135|       |
 3136|       |    /* MatchLength */
 3137|  1.11k|    matchLength = FSEv05_decodeSymbol(&(seqState->stateML), &(seqState->DStream));
 3138|  1.11k|    if (matchLength == MaxML) {
  ------------------
  |  |  422|  1.11k|#define MaxML  ((1<<MLbits) - 1)
  |  |  ------------------
  |  |  |  |  418|  1.11k|#define MLbits   7
  |  |  ------------------
  ------------------
  |  Branch (3138:9): [True: 99, False: 1.01k]
  ------------------
 3139|     99|        const U32 add = dumps<de ? *dumps++ : 0;
  ------------------
  |  Branch (3139:25): [True: 94, False: 5]
  ------------------
 3140|     99|        if (add < 255) matchLength += add;
  ------------------
  |  Branch (3140:13): [True: 95, False: 4]
  ------------------
 3141|      4|        else if (dumps + 2 <= de) {
  ------------------
  |  Branch (3141:18): [True: 4, False: 0]
  ------------------
 3142|      4|            matchLength = MEM_readLE16(dumps);
 3143|      4|            dumps += 2;
 3144|      4|            if ((matchLength & 1) && dumps < de) {
  ------------------
  |  Branch (3144:17): [True: 0, False: 4]
  |  Branch (3144:38): [True: 0, False: 0]
  ------------------
 3145|      0|                matchLength += *dumps << 16;
 3146|      0|                dumps += 1;
 3147|      0|            }
 3148|      4|            matchLength >>= 1;
 3149|      4|        }
 3150|     99|        if (dumps >= de) { dumps = de-1; }  /* late correction, to avoid read overflow (data is now corrupted anyway) */
  ------------------
  |  Branch (3150:13): [True: 28, False: 71]
  ------------------
 3151|     99|    }
 3152|  1.11k|    matchLength += MINMATCH;
  ------------------
  |  |  414|  1.11k|#define MINMATCH 4
  ------------------
 3153|       |
 3154|       |    /* save result */
 3155|  1.11k|    seq->litLength = litLength;
 3156|  1.11k|    seq->offset = offset;
 3157|  1.11k|    seq->matchLength = matchLength;
 3158|  1.11k|    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|  1.11k|}
zstd_v05.c:FSEv05_peakSymbol:
  960|  2.22k|{
  961|  2.22k|    const FSEv05_decode_t DInfo = ((const FSEv05_decode_t*)(DStatePtr->table))[DStatePtr->state];
  962|  2.22k|    return DInfo.symbol;
  963|  2.22k|}
zstd_v05.c:ZSTDv05_execSequence:
 3175|  1.11k|{
 3176|  1.11k|    static const int dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
 3177|  1.11k|    static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
 3178|  1.11k|    BYTE* const oLitEnd = op + sequence.litLength;
 3179|  1.11k|    const size_t sequenceLength = sequence.litLength + sequence.matchLength;
 3180|  1.11k|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 3181|  1.11k|    BYTE* const oend_8 = oend-8;
 3182|  1.11k|    const BYTE* const litEnd = *litPtr + sequence.litLength;
 3183|  1.11k|    const BYTE* match = oLitEnd - sequence.offset;
 3184|       |
 3185|       |    /* checks */
 3186|  1.11k|    size_t const seqLength = sequence.litLength + sequence.matchLength;
 3187|       |
 3188|  1.11k|    if (seqLength > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|     27|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     27|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     27|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3188:9): [True: 27, False: 1.08k]
  ------------------
 3189|  1.08k|    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: 1.08k]
  ------------------
 3190|       |    /* Now we know there are no overflow in literal nor match lengths, can use pointer checks */
 3191|  1.08k|    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: 1.07k]
  ------------------
 3192|       |
 3193|  1.07k|    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: 1.07k]
  ------------------
 3194|  1.07k|    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: 1.07k]
  ------------------
 3195|       |
 3196|       |    /* copy Literals */
 3197|  1.07k|    ZSTDv05_wildcopy(op, *litPtr, (ptrdiff_t)sequence.litLength);   /* note : oLitEnd <= oend-8 : no risk of overwrite beyond oend */
 3198|  1.07k|    op = oLitEnd;
 3199|  1.07k|    *litPtr = litEnd;   /* update for next sequence */
 3200|       |
 3201|       |    /* copy Match */
 3202|  1.07k|    if (sequence.offset > (size_t)(oLitEnd - base)) {
  ------------------
  |  Branch (3202:9): [True: 29, False: 1.04k]
  ------------------
 3203|       |        /* offset beyond prefix */
 3204|     29|        if (sequence.offset > (size_t)(oLitEnd - vBase))
  ------------------
  |  Branch (3204:13): [True: 9, False: 20]
  ------------------
 3205|      9|            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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|  1.06k|    if (sequence.offset < 8) {
  ------------------
  |  Branch (3226:9): [True: 526, False: 534]
  ------------------
 3227|       |        /* close range match, overlap */
 3228|    526|        const int sub2 = dec64table[sequence.offset];
 3229|    526|        op[0] = match[0];
 3230|    526|        op[1] = match[1];
 3231|    526|        op[2] = match[2];
 3232|    526|        op[3] = match[3];
 3233|    526|        match += dec32table[sequence.offset];
 3234|    526|        ZSTDv05_copy4(op+4, match);
 3235|    526|        match -= sub2;
 3236|    534|    } else {
 3237|    534|        ZSTDv05_copy8(op, match);
 3238|    534|    }
 3239|  1.06k|    op += 8; match += 8;
 3240|       |
 3241|  1.06k|    if (oMatchEnd > oend-(16-MINMATCH)) {
  ------------------
  |  |  414|  1.06k|#define MINMATCH 4
  ------------------
  |  Branch (3241:9): [True: 9, False: 1.05k]
  ------------------
 3242|      9|        if (op < oend_8) {
  ------------------
  |  Branch (3242:13): [True: 5, False: 4]
  ------------------
 3243|      5|            ZSTDv05_wildcopy(op, match, oend_8 - op);
 3244|      5|            match += oend_8 - op;
 3245|      5|            op = oend_8;
 3246|      5|        }
 3247|     26|        while (op < oMatchEnd)
  ------------------
  |  Branch (3247:16): [True: 17, False: 9]
  ------------------
 3248|     17|            *op++ = *match++;
 3249|  1.05k|    } else {
 3250|  1.05k|        ZSTDv05_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8);   /* works even if matchLength < 8 */
 3251|  1.05k|    }
 3252|  1.06k|    return sequenceLength;
 3253|  1.07k|}
zstd_v05.c:ZSTDv05_wildcopy:
  458|  2.13k|{
  459|  2.13k|    const BYTE* ip = (const BYTE*)src;
  460|  2.13k|    BYTE* op = (BYTE*)dst;
  461|  2.13k|    BYTE* const oend = op + length;
  462|  2.13k|    do
  463|  19.0k|        COPY8(op, ip)
  ------------------
  |  |  453|  19.0k|#define COPY8(d,s) { ZSTDv05_copy8(d,s); d+=8; s+=8; }
  ------------------
  464|  19.0k|    while (op < oend);
  ------------------
  |  Branch (464:12): [True: 16.9k, False: 2.13k]
  ------------------
  465|  2.13k|}
zstd_v05.c:ZSTDv05_copy4:
 2569|    526|static void ZSTDv05_copy4(void* dst, const void* src) { memcpy(dst, src, 4); }
zstd_v05.c:ZSTDv05_copy8:
  451|  19.5k|static void ZSTDv05_copy8(void* dst, const void* src) { memcpy(dst, src, 8); }
zstd_v05.c:ZSTDv05_decompress_continueDCtx:
 3373|    122|{
 3374|    122|    const BYTE* ip = (const BYTE*)src;
 3375|    122|    const BYTE* iend = ip + srcSize;
 3376|    122|    BYTE* const ostart = (BYTE*)dst;
 3377|    122|    BYTE* op = ostart;
 3378|    122|    BYTE* const oend = ostart + maxDstSize;
 3379|    122|    size_t remainingSize = srcSize;
 3380|    122|    blockProperties_t blockProperties;
 3381|    122|    memset(&blockProperties, 0, sizeof(blockProperties));
 3382|       |
 3383|       |    /* Frame Header */
 3384|    122|    {   size_t frameHeaderSize;
 3385|    122|        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: 122]
  ------------------
 3386|    122|        frameHeaderSize = ZSTDv05_decodeFrameHeader_Part1(dctx, src, ZSTDv05_frameHeaderSize_min);
 3387|    122|        if (ZSTDv05_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  Branch (3387:13): [True: 0, False: 122]
  ------------------
 3388|    122|        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: 122]
  ------------------
 3389|    122|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3390|    122|        frameHeaderSize = ZSTDv05_decodeFrameHeader_Part2(dctx, src, frameHeaderSize);
 3391|    122|        if (ZSTDv05_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  Branch (3391:13): [True: 2, False: 120]
  ------------------
 3392|    122|    }
 3393|       |
 3394|       |    /* Loop on each block */
 3395|    254|    while (1)
  ------------------
  |  Branch (3395:12): [True: 254, Folded]
  ------------------
 3396|    254|    {
 3397|    254|        size_t decodedSize=0;
 3398|    254|        size_t cBlockSize = ZSTDv05_getcBlockSize(ip, iend-ip, &blockProperties);
 3399|    254|        if (ZSTDv05_isError(cBlockSize)) return cBlockSize;
  ------------------
  |  Branch (3399:13): [True: 0, False: 254]
  ------------------
 3400|       |
 3401|    254|        ip += ZSTDv05_blockHeaderSize;
 3402|    254|        remainingSize -= ZSTDv05_blockHeaderSize;
 3403|    254|        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: 254]
  ------------------
 3404|       |
 3405|    254|        switch(blockProperties.blockType)
 3406|    254|        {
 3407|    149|        case bt_compressed:
  ------------------
  |  Branch (3407:9): [True: 149, False: 105]
  ------------------
 3408|    149|            decodedSize = ZSTDv05_decompressBlock_internal(dctx, op, oend-op, ip, cBlockSize);
 3409|    149|            break;
 3410|     97|        case bt_raw :
  ------------------
  |  Branch (3410:9): [True: 97, False: 157]
  ------------------
 3411|     97|            decodedSize = ZSTDv05_copyRawBlock(op, oend-op, ip, cBlockSize);
 3412|     97|            break;
 3413|      1|        case bt_rle :
  ------------------
  |  Branch (3413:9): [True: 1, False: 253]
  ------------------
 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: 247]
  ------------------
 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: 254]
  ------------------
 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|    254|        }
 3423|    253|        if (cBlockSize == 0) break;   /* bt_end */
  ------------------
  |  Branch (3423:13): [True: 20, False: 233]
  ------------------
 3424|       |
 3425|    233|        if (ZSTDv05_isError(decodedSize)) return decodedSize;
  ------------------
  |  Branch (3425:13): [True: 99, False: 134]
  ------------------
 3426|    134|        op += decodedSize;
 3427|    134|        ip += cBlockSize;
 3428|    134|        remainingSize -= cBlockSize;
 3429|    134|    }
 3430|       |
 3431|     20|    return op-ostart;
 3432|    120|}
zstd_v05.c:ZSTD_errorFrameSizeInfoLegacy:
 3479|      5|{
 3480|      5|    *cSize = ret;
 3481|      5|    *dBound = ZSTD_CONTENTSIZE_ERROR;
  ------------------
  |  |  443|      5|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
 3482|      5|}
zstd_v05.c:ZSTDv05_getcBlockSize:
 2779|    779|{
 2780|    779|    const BYTE* const in = (const BYTE*)src;
 2781|    779|    BYTE headerFlags;
 2782|    779|    U32 cSize;
 2783|       |
 2784|    779|    if (srcSize < 3)
  ------------------
  |  Branch (2784:9): [True: 0, False: 779]
  ------------------
 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|    779|    headerFlags = *in;
 2788|    779|    cSize = in[2] + (in[1]<<8) + ((in[0] & 7)<<16);
 2789|       |
 2790|    779|    bpPtr->blockType = (blockType_t)(headerFlags >> 6);
 2791|    779|    bpPtr->origSize = (bpPtr->blockType == bt_rle) ? cSize : 0;
  ------------------
  |  Branch (2791:23): [True: 19, False: 760]
  ------------------
 2792|       |
 2793|    779|    if (bpPtr->blockType == bt_end) return 0;
  ------------------
  |  Branch (2793:9): [True: 75, False: 704]
  ------------------
 2794|    704|    if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (2794:9): [True: 19, False: 685]
  ------------------
 2795|    685|    return cSize;
 2796|    704|}
zstd_v05.c:ZSTDv05_decodeFrameHeader_Part1:
 2740|    122|{
 2741|    122|    U32 magicNumber;
 2742|    122|    if (srcSize != ZSTDv05_frameHeaderSize_min)
  ------------------
  |  Branch (2742:9): [True: 0, False: 122]
  ------------------
 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|    122|    magicNumber = MEM_readLE32(src);
 2745|    122|    if (magicNumber != ZSTDv05_MAGICNUMBER) return ERROR(prefix_unknown);
  ------------------
  |  |  153|    122|#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: 122]
  ------------------
 2746|    122|    zc->headerSize = ZSTDv05_frameHeaderSize_min;
 2747|    122|    return zc->headerSize;
 2748|    122|}
zstd_v05.c:ZSTDv05_decodeFrameHeader_Part2:
 2768|    122|{
 2769|    122|    size_t result;
 2770|    122|    if (srcSize != zc->headerSize)
  ------------------
  |  Branch (2770:9): [True: 0, False: 122]
  ------------------
 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|    122|    result = ZSTDv05_getFrameParams(&(zc->params), src, srcSize);
 2773|    122|    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: 122]
  |  Branch (2773:27): [True: 0, False: 0]
  ------------------
 2774|    122|    return result;
 2775|    122|}
zstd_v05.c:ZSTDv05_copyRawBlock:
 2800|     97|{
 2801|     97|    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: 97]
  ------------------
 2802|     97|    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: 93]
  ------------------
 2803|     93|    memcpy(dst, src, srcSize);
 2804|     93|    return srcSize;
 2805|     97|}
zstd_v05.c:ZSTDv05_decompress_insertDictionary:
 3663|     30|{
 3664|     30|    size_t eSize;
 3665|     30|    U32 magic = MEM_readLE32(dict);
 3666|     30|    if (magic != ZSTDv05_DICT_MAGIC) {
  ------------------
  |  |  390|     30|#define ZSTDv05_DICT_MAGIC  0xEC30A435
  ------------------
  |  Branch (3666:9): [True: 30, False: 0]
  ------------------
 3667|       |        /* pure content mode */
 3668|     30|        ZSTDv05_refDictContent(dctx, dict, dictSize);
 3669|     30|        return 0;
 3670|     30|    }
 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|     30|{
 3615|     30|    dctx->dictEnd = dctx->previousDstEnd;
 3616|     30|    dctx->vBase = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3617|     30|    dctx->base = dict;
 3618|     30|    dctx->previousDstEnd = (const char*)dict + dictSize;
 3619|     30|}

FSEv06_readNCount:
 1209|     29|{
 1210|     29|    const BYTE* const istart = (const BYTE*) headerBuffer;
 1211|     29|    const BYTE* const iend = istart + hbSize;
 1212|     29|    const BYTE* ip = istart;
 1213|     29|    int nbBits;
 1214|     29|    int remaining;
 1215|     29|    int threshold;
 1216|     29|    U32 bitStream;
 1217|     29|    int bitCount;
 1218|     29|    unsigned charnum = 0;
 1219|     29|    int previous0 = 0;
 1220|       |
 1221|     29|    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: 29]
  ------------------
 1222|     29|    bitStream = MEM_readLE32(ip);
 1223|     29|    nbBits = (bitStream & 0xF) + FSEv06_MIN_TABLELOG;   /* extract tableLog */
  ------------------
  |  | 1138|     29|#define FSEv06_MIN_TABLELOG 5
  ------------------
 1224|     29|    if (nbBits > FSEv06_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
  ------------------
  |  | 1140|     29|#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: 29]
  ------------------
 1225|     29|    bitStream >>= 4;
 1226|     29|    bitCount = 4;
 1227|     29|    *tableLogPtr = nbBits;
 1228|     29|    remaining = (1<<nbBits)+1;
 1229|     29|    threshold = 1<<nbBits;
 1230|     29|    nbBits++;
 1231|       |
 1232|    249|    while ((remaining>1) && (charnum<=*maxSVPtr)) {
  ------------------
  |  Branch (1232:12): [True: 220, False: 29]
  |  Branch (1232:29): [True: 220, False: 0]
  ------------------
 1233|    220|        if (previous0) {
  ------------------
  |  Branch (1233:13): [True: 14, False: 206]
  ------------------
 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|    220|        {   short const max = (short)((2*threshold-1)-remaining);
 1262|    220|            short count;
 1263|       |
 1264|    220|            if ((bitStream & (threshold-1)) < (U32)max) {
  ------------------
  |  Branch (1264:17): [True: 126, False: 94]
  ------------------
 1265|    126|                count = (short)(bitStream & (threshold-1));
 1266|    126|                bitCount   += nbBits-1;
 1267|    126|            } else {
 1268|     94|                count = (short)(bitStream & (2*threshold-1));
 1269|     94|                if (count >= threshold) count -= max;
  ------------------
  |  Branch (1269:21): [True: 40, False: 54]
  ------------------
 1270|     94|                bitCount   += nbBits;
 1271|     94|            }
 1272|       |
 1273|    220|            count--;   /* extra accuracy */
 1274|    220|            remaining -= FSEv06_abs(count);
 1275|    220|            normalizedCounter[charnum++] = count;
 1276|    220|            previous0 = !count;
 1277|    395|            while (remaining < threshold) {
  ------------------
  |  Branch (1277:20): [True: 175, False: 220]
  ------------------
 1278|    175|                nbBits--;
 1279|    175|                threshold >>= 1;
 1280|    175|            }
 1281|       |
 1282|    220|            if ((ip <= iend-7) || (ip + (bitCount>>3) <= iend-4)) {
  ------------------
  |  Branch (1282:17): [True: 192, False: 28]
  |  Branch (1282:35): [True: 2, False: 26]
  ------------------
 1283|    194|                ip += bitCount>>3;
 1284|    194|                bitCount &= 7;
 1285|    194|            } else {
 1286|     26|                bitCount -= (int)(8 * (iend - 4 - ip));
 1287|     26|                ip = iend - 4;
 1288|     26|            }
 1289|    220|            bitStream = MEM_readLE32(ip) >> (bitCount & 31);
 1290|    220|    }   }   /* while ((remaining>1) && (charnum<=*maxSVPtr)) */
 1291|     29|    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: 29]
  ------------------
 1292|     29|    *maxSVPtr = charnum-1;
 1293|       |
 1294|     29|    ip += (bitCount+7)>>3;
 1295|     29|    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: 28]
  ------------------
 1296|     28|    return ip-istart;
 1297|     29|}
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.08k|            for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (1422:23): [True: 2.01k, False: 72]
  ------------------
 1423|  2.01k|                if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (1423:21): [True: 294, False: 1.72k]
  ------------------
 1424|    294|                    tableDecode[highThreshold--].symbol = (FSEv06_FUNCTION_TYPE)s;
 1425|    294|                    symbolNext[s] = 1;
 1426|  1.72k|                } else {
 1427|  1.72k|                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
  ------------------
  |  Branch (1427:25): [True: 20, False: 1.70k]
  ------------------
 1428|  1.72k|                    symbolNext[s] = normalizedCounter[s];
 1429|  1.72k|        }   }   }
 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.08k|        for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (1437:19): [True: 2.01k, False: 72]
  ------------------
 1438|  2.01k|            int i;
 1439|  5.94k|            for (i=0; i<normalizedCounter[s]; i++) {
  ------------------
  |  Branch (1439:23): [True: 3.93k, False: 2.01k]
  ------------------
 1440|  3.93k|                tableDecode[position].symbol = (FSEv06_FUNCTION_TYPE)s;
 1441|  3.93k|                position = (position + step) & tableMask;
 1442|  4.22k|                while (position > highThreshold) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  Branch (1442:24): [True: 294, False: 3.93k]
  ------------------
 1443|  3.93k|        }   }
 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.29k|        for (u=0; u<tableSize; u++) {
  ------------------
  |  Branch (1450:19): [True: 4.22k, False: 72]
  ------------------
 1451|  4.22k|            FSEv06_FUNCTION_TYPE const symbol = (FSEv06_FUNCTION_TYPE)(tableDecode[u].symbol);
  ------------------
  |  | 1123|  4.22k|#define FSEv06_FUNCTION_TYPE BYTE
  ------------------
 1452|  4.22k|            U16 nextState = symbolNext[symbol]++;
 1453|  4.22k|            tableDecode[u].nbBits = (BYTE) (tableLog - BITv06_highbit32 ((U32)nextState) );
 1454|  4.22k|            tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
 1455|  4.22k|    }   }
 1456|       |
 1457|     72|    return 0;
 1458|     72|}
FSEv06_buildDTable_rle:
 1468|     36|{
 1469|     36|    void* ptr = dt;
 1470|     36|    FSEv06_DTableHeader* const DTableH = (FSEv06_DTableHeader*)ptr;
 1471|     36|    void* dPtr = dt + 1;
 1472|     36|    FSEv06_decode_t* const cell = (FSEv06_decode_t*)dPtr;
 1473|       |
 1474|     36|    DTableH->tableLog = 0;
 1475|     36|    DTableH->fastMode = 0;
 1476|       |
 1477|     36|    cell->newState = 0;
 1478|     36|    cell->symbol = symbolValue;
 1479|     36|    cell->nbBits = 0;
 1480|       |
 1481|     36|    return 0;
 1482|     36|}
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|      2|{
 2591|      2|    static const decompressionAlgo decompress[3] = { HUFv06_decompress4X2, HUFv06_decompress4X4, NULL };
 2592|      2|    U32 Dtime[3];   /* decompression time estimation */
 2593|       |
 2594|       |    /* validation checks */
 2595|      2|    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: 2]
  ------------------
 2596|      2|    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: 2]
  ------------------
 2597|      2|    if (cSrcSize == dstSize) { memcpy(dst, cSrc, dstSize); return dstSize; }   /* not compressed */
  ------------------
  |  Branch (2597:9): [True: 0, False: 2]
  ------------------
 2598|      2|    if (cSrcSize == 1) { memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; }   /* RLE */
  ------------------
  |  Branch (2598:9): [True: 2, 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|      2|    }
 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|      2|}
ZSTDv06_decompressBegin:
 2774|     96|{
 2775|     96|    dctx->expected = ZSTDv06_frameHeaderSize_min;
 2776|     96|    dctx->stage = ZSTDds_getFrameHeaderSize;
 2777|     96|    dctx->previousDstEnd = NULL;
 2778|     96|    dctx->base = NULL;
 2779|     96|    dctx->vBase = NULL;
 2780|     96|    dctx->dictEnd = NULL;
 2781|     96|    dctx->hufTableX4[0] = ZSTD_HUFFDTABLE_CAPACITY_LOG;
  ------------------
  |  |  426|     96|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
 2782|     96|    dctx->flagRepeatTable = 0;
 2783|     96|    return 0;
 2784|     96|}
ZSTDv06_createDCtx:
 2787|     48|{
 2788|     48|    ZSTDv06_DCtx* dctx = (ZSTDv06_DCtx*)malloc(sizeof(ZSTDv06_DCtx));
 2789|     48|    if (dctx==NULL) return NULL;
  ------------------
  |  Branch (2789:9): [True: 0, False: 48]
  ------------------
 2790|     48|    ZSTDv06_decompressBegin(dctx);
 2791|     48|    return dctx;
 2792|     48|}
ZSTDv06_freeDCtx:
 2795|     48|{
 2796|     48|    free(dctx);
 2797|     48|    return 0;   /* reserved as a potential error code in the future */
 2798|     48|}
ZSTDv06_getFrameParams:
 2925|     49|{
 2926|     49|    const BYTE* ip = (const BYTE*)src;
 2927|       |
 2928|     49|    if (srcSize < ZSTDv06_frameHeaderSize_min) return ZSTDv06_frameHeaderSize_min;
  ------------------
  |  Branch (2928:9): [True: 0, False: 49]
  ------------------
 2929|     49|    if (MEM_readLE32(src) != ZSTDv06_MAGICNUMBER) return ERROR(prefix_unknown);
  ------------------
  |  |  164|     49|#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: 49]
  ------------------
 2930|       |
 2931|       |    /* ensure there is enough `srcSize` to fully read/decode frame header */
 2932|     49|    { size_t const fhsize = ZSTDv06_frameHeaderSize(src, srcSize);
 2933|     49|      if (srcSize < fhsize) return fhsize; }
  ------------------
  |  Branch (2933:11): [True: 0, False: 49]
  ------------------
 2934|       |
 2935|     49|    memset(fparamsPtr, 0, sizeof(*fparamsPtr));
 2936|     49|    {   BYTE const frameDesc = ip[4];
 2937|     49|        fparamsPtr->windowLog = (frameDesc & 0xF) + ZSTDv06_WINDOWLOG_ABSOLUTEMIN;
  ------------------
  |  |  416|     49|#define ZSTDv06_WINDOWLOG_ABSOLUTEMIN 12
  ------------------
 2938|     49|        if ((frameDesc & 0x20) != 0) return ERROR(frameParameter_unsupported);   /* reserved 1 bit */
  ------------------
  |  |   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 (2938:13): [True: 8, False: 41]
  ------------------
 2939|     41|        switch(frameDesc >> 6)  /* fcsId */
 2940|     41|        {
 2941|      0|            default:   /* impossible */
  ------------------
  |  Branch (2941:13): [True: 0, False: 41]
  ------------------
 2942|     41|            case 0 : fparamsPtr->frameContentSize = 0; break;
  ------------------
  |  Branch (2942:13): [True: 41, False: 0]
  ------------------
 2943|      0|            case 1 : fparamsPtr->frameContentSize = ip[5]; break;
  ------------------
  |  Branch (2943:13): [True: 0, False: 41]
  ------------------
 2944|      0|            case 2 : fparamsPtr->frameContentSize = MEM_readLE16(ip+5)+256; break;
  ------------------
  |  Branch (2944:13): [True: 0, False: 41]
  ------------------
 2945|      0|            case 3 : fparamsPtr->frameContentSize = MEM_readLE64(ip+5); break;
  ------------------
  |  Branch (2945:13): [True: 0, False: 41]
  ------------------
 2946|     41|    }   }
 2947|     41|    return 0;
 2948|     41|}
ZSTDv06_decompress_usingDict:
 3581|     48|{
 3582|     48|    ZSTDv06_decompressBegin_usingDict(dctx, dict, dictSize);
 3583|     48|    ZSTDv06_checkContinuity(dctx, dst);
 3584|     48|    return ZSTDv06_decompressFrame(dctx, dst, dstCapacity, src, srcSize);
 3585|     48|}
ZSTDv06_findFrameSizeInfoLegacy:
 3618|     49|{
 3619|     49|    const BYTE* ip = (const BYTE*)src;
 3620|     49|    size_t remainingSize = srcSize;
 3621|     49|    size_t nbBlocks = 0;
 3622|     49|    blockProperties_t blockProperties = { bt_compressed, 0 };
 3623|       |
 3624|       |    /* Frame Header */
 3625|     49|    {   size_t const frameHeaderSize = ZSTDv06_frameHeaderSize(src, srcSize);
 3626|     49|        if (ZSTDv06_isError(frameHeaderSize)) {
  ------------------
  |  | 2731|     49|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3626:13): [True: 0, False: 49]
  ------------------
 3627|      0|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, frameHeaderSize);
 3628|      0|            return;
 3629|      0|        }
 3630|     49|        if (MEM_readLE32(src) != ZSTDv06_MAGICNUMBER) {
  ------------------
  |  |  164|     49|#define ZSTDv06_MAGICNUMBER 0xFD2FB526   /* v0.6 */
  ------------------
  |  Branch (3630:13): [True: 0, False: 49]
  ------------------
 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|     49|        if (srcSize < frameHeaderSize+ZSTDv06_blockHeaderSize) {
  ------------------
  |  Branch (3634:13): [True: 0, False: 49]
  ------------------
 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|     49|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3639|     49|    }
 3640|       |
 3641|       |    /* Loop on each block */
 3642|    223|    while (1) {
  ------------------
  |  Branch (3642:12): [True: 223, Folded]
  ------------------
 3643|    223|        size_t const cBlockSize = ZSTDv06_getcBlockSize(ip, remainingSize, &blockProperties);
 3644|    223|        if (ZSTDv06_isError(cBlockSize)) {
  ------------------
  |  | 2731|    223|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3644:13): [True: 0, False: 223]
  ------------------
 3645|      0|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, cBlockSize);
 3646|      0|            return;
 3647|      0|        }
 3648|       |
 3649|    223|        ip += ZSTDv06_blockHeaderSize;
 3650|    223|        remainingSize -= ZSTDv06_blockHeaderSize;
 3651|    223|        if (cBlockSize > remainingSize) {
  ------------------
  |  Branch (3651:13): [True: 1, False: 222]
  ------------------
 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|    222|        if (cBlockSize == 0) break;   /* bt_end */
  ------------------
  |  Branch (3656:13): [True: 48, False: 174]
  ------------------
 3657|       |
 3658|    174|        ip += cBlockSize;
 3659|    174|        remainingSize -= cBlockSize;
 3660|    174|        nbBlocks++;
 3661|    174|    }
 3662|       |
 3663|     48|    *cSize = ip - (const BYTE*)src;
 3664|     48|    *dBound = nbBlocks * ZSTDv06_BLOCKSIZE_MAX;
  ------------------
  |  |  344|     48|#define ZSTDv06_BLOCKSIZE_MAX (128 * 1024)   /* define, for static allocation */
  ------------------
 3665|     48|}
ZSTDv06_decompressBegin_usingDict:
 3827|     48|{
 3828|     48|    { size_t const errorCode = ZSTDv06_decompressBegin(dctx);
 3829|     48|      if (ZSTDv06_isError(errorCode)) return errorCode; }
  ------------------
  |  | 2731|     48|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3829:11): [True: 0, False: 48]
  ------------------
 3830|       |
 3831|     48|    if (dict && dictSize) {
  ------------------
  |  Branch (3831:9): [True: 48, False: 0]
  |  Branch (3831:17): [True: 33, False: 15]
  ------------------
 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|     46|    return 0;
 3837|     48|}
zstd_v06.c:MEM_readLE32:
  190|    393|{
  191|    393|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (191:9): [True: 393, False: 0]
  ------------------
  192|    393|        return MEM_read32(memPtr);
  193|      0|    else
  194|      0|        return MEM_swap32(MEM_read32(memPtr));
  195|    393|}
zstd_v06.c:MEM_isLittleEndian:
  108|    724|{
  109|    724|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  110|    724|    return one.c[0];
  111|    724|}
zstd_v06.c:MEM_read32:
  119|    393|{
  120|    393|    U32 val; memcpy(&val, memPtr, sizeof(val)); return val;
  121|    393|}
zstd_v06.c:FSEv06_abs:
 1205|    220|static short FSEv06_abs(short a) { return a<0 ? -a : a; }
  ------------------
  |  Branch (1205:43): [True: 79, False: 141]
  ------------------
zstd_v06.c:BITv06_highbit32:
  802|  4.26k|{
  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.26k|}
zstd_v06.c:FSEv06_initDState:
 1053|    108|{
 1054|    108|    const void* ptr = dt;
 1055|    108|    const FSEv06_DTableHeader* const DTableH = (const FSEv06_DTableHeader*)ptr;
 1056|    108|    DStatePtr->state = BITv06_readBits(bitD, DTableH->tableLog);
 1057|    108|    BITv06_reloadDStream(bitD);
 1058|    108|    DStatePtr->table = dt + 1;
 1059|    108|}
zstd_v06.c:BITv06_readBits:
  888|  1.61k|{
  889|  1.61k|    size_t const value = BITv06_lookBits(bitD, nbBits);
  890|  1.61k|    BITv06_skipBits(bitD, nbBits);
  891|  1.61k|    return value;
  892|  1.61k|}
zstd_v06.c:BITv06_lookBits:
  869|  1.61k|{
  870|  1.61k|    U32 const bitMask = sizeof(bitD->bitContainer)*8 - 1;
  871|  1.61k|    return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask);
  872|  1.61k|}
zstd_v06.c:BITv06_skipBits:
  883|  1.61k|{
  884|  1.61k|    bitD->bitsConsumed += nbBits;
  885|  1.61k|}
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|     36|{
  835|     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 (835:9): [True: 0, False: 36]
  ------------------
  836|       |
  837|     36|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (837:9): [True: 36, False: 0]
  ------------------
  838|     36|        bitD->start = (const char*)srcBuffer;
  839|     36|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  840|     36|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  841|     36|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  842|     36|          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: 36]
  ------------------
  843|     36|          bitD->bitsConsumed = 8 - BITv06_highbit32(lastByte); }
  844|     36|    } 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|     36|    return srcSize;
  865|     36|}
zstd_v06.c:MEM_readLEST:
  208|    330|{
  209|    330|    if (MEM_32bits())
  ------------------
  |  Branch (209:9): [True: 0, False: 330]
  ------------------
  210|      0|        return (size_t)MEM_readLE32(memPtr);
  211|    330|    else
  212|    330|        return (size_t)MEM_readLE64(memPtr);
  213|    330|}
zstd_v06.c:MEM_32bits:
  104|  1.68k|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|    495|{
  905|    495|    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))  /* should never happen */
  ------------------
  |  Branch (905:9): [True: 7, False: 488]
  ------------------
  906|      7|        return BITv06_DStream_overflow;
  907|       |
  908|    488|    if (bitD->ptr >= bitD->start + sizeof(bitD->bitContainer)) {
  ------------------
  |  Branch (908:9): [True: 48, False: 440]
  ------------------
  909|     48|        bitD->ptr -= bitD->bitsConsumed >> 3;
  910|     48|        bitD->bitsConsumed &= 7;
  911|     48|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  912|     48|        return BITv06_DStream_unfinished;
  913|     48|    }
  914|    440|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (914:9): [True: 194, False: 246]
  ------------------
  915|    194|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BITv06_DStream_endOfBuffer;
  ------------------
  |  Branch (915:13): [True: 193, False: 1]
  ------------------
  916|      1|        return BITv06_DStream_completed;
  917|    194|    }
  918|    246|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  919|    246|        BITv06_DStream_status result = BITv06_DStream_unfinished;
  920|    246|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (920:13): [True: 8, False: 238]
  ------------------
  921|      8|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  922|      8|            result = BITv06_DStream_endOfBuffer;
  923|      8|        }
  924|    246|        bitD->ptr -= nbBytes;
  925|    246|        bitD->bitsConsumed -= nbBytes*8;
  926|    246|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD) */
  927|    246|        return result;
  928|    440|    }
  929|    440|}
zstd_v06.c:ZSTDv06_frameHeaderSize:
 2912|    146|{
 2913|    146|    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: 146]
  ------------------
 2914|    146|    { U32 const fcsId = (((const BYTE*)src)[4]) >> 6;
 2915|    146|      return ZSTDv06_frameHeaderSize_min + ZSTDv06_fcs_fieldSize[fcsId]; }
 2916|    146|}
zstd_v06.c:MEM_readLE64:
  199|    330|{
  200|    330|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (200:9): [True: 330, False: 0]
  ------------------
  201|    330|        return MEM_read64(memPtr);
  202|      0|    else
  203|      0|        return MEM_swap64(MEM_read64(memPtr));
  204|    330|}
zstd_v06.c:MEM_read64:
  124|    330|{
  125|    330|    U64 val; memcpy(&val, memPtr, sizeof(val)); return val;
  126|    330|}
zstd_v06.c:ZSTDv06_checkContinuity:
 3465|     48|{
 3466|     48|    if (dst != dctx->previousDstEnd) {   /* not contiguous */
  ------------------
  |  Branch (3466:9): [True: 48, False: 0]
  ------------------
 3467|     48|        dctx->dictEnd = dctx->previousDstEnd;
 3468|     48|        dctx->vBase = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3469|     48|        dctx->base = dst;
 3470|     48|        dctx->previousDstEnd = dst;
 3471|     48|    }
 3472|     48|}
zstd_v06.c:ZSTDv06_decompressBlock_internal:
 3478|     37|{   /* blockType == blockCompressed */
 3479|     37|    const BYTE* ip = (const BYTE*)src;
 3480|       |
 3481|     37|    if (srcSize >= ZSTDv06_BLOCKSIZE_MAX) return ERROR(srcSize_wrong);
  ------------------
  |  |  344|     37|#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: 37]
  ------------------
 3482|       |
 3483|       |    /* Decode literals sub-block */
 3484|     37|    {   size_t const litCSize = ZSTDv06_decodeLiteralsBlock(dctx, src, srcSize);
 3485|     37|        if (ZSTDv06_isError(litCSize)) return litCSize;
  ------------------
  |  | 2731|     37|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3485:13): [True: 0, False: 37]
  ------------------
 3486|     37|        ip += litCSize;
 3487|     37|        srcSize -= litCSize;
 3488|     37|    }
 3489|      0|    return ZSTDv06_decompressSequences(dctx, dst, dstCapacity, ip, srcSize);
 3490|     37|}
zstd_v06.c:ZSTDv06_decodeLiteralsBlock:
 3000|     37|{
 3001|     37|    const BYTE* const istart = (const BYTE*) src;
 3002|       |
 3003|       |    /* any compressed block with literals segment must be at least this size */
 3004|     37|    if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  |  424|     37|#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */ + MIN_SEQUENCES_SIZE /* nbSeq==0 */)   /* for a non-null block */
  |  |  ------------------
  |  |  |  |  423|     37|#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: 37]
  ------------------
 3005|       |
 3006|     37|    switch(istart[0]>> 6)
 3007|     37|    {
 3008|      2|    case IS_HUF:
  ------------------
  |  |  428|      2|#define IS_HUF 0
  ------------------
  |  Branch (3008:5): [True: 2, False: 35]
  ------------------
 3009|      2|        {   size_t litSize, litCSize, singleStream=0;
 3010|      2|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3011|      2|            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: 2]
  ------------------
 3012|      2|            switch(lhSize)
 3013|      2|            {
 3014|      2|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3014:13): [True: 2, False: 0]
  |  Branch (3014:21): [True: 0, False: 2]
  |  Branch (3014:29): [True: 0, False: 2]
  ------------------
 3015|       |                /* 2 - 2 - 10 - 10 */
 3016|      2|                lhSize=3;
 3017|      2|                singleStream = istart[0] & 16;
 3018|      2|                litSize  = ((istart[0] & 15) << 6) + (istart[1] >> 2);
 3019|      2|                litCSize = ((istart[1] &  3) << 8) + istart[2];
 3020|      2|                break;
 3021|      0|            case 2:
  ------------------
  |  Branch (3021:13): [True: 0, False: 2]
  ------------------
 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: 2]
  ------------------
 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|      2|            }
 3034|      2|            if (litSize > ZSTDv06_BLOCKSIZE_MAX) return ERROR(corruption_detected);
  ------------------
  |  |  344|      2|#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: 2]
  ------------------
 3035|      2|            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: 2]
  ------------------
 3036|       |
 3037|      2|            if (HUFv06_isError(singleStream ?
  ------------------
  |  | 2733|      2|#define HUFv06_isError  ERR_isError
  ------------------
  |  Branch (3037:17): [True: 0, False: 2]
  |  Branch (3037:32): [True: 0, False: 2]
  ------------------
 3038|      0|                            HUFv06_decompress1X2(dctx->litBuffer, litSize, istart+lhSize, litCSize) :
 3039|      2|                            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|      2|            dctx->litPtr = dctx->litBuffer;
 3043|      2|            dctx->litSize = litSize;
 3044|      2|            memset(dctx->litBuffer + dctx->litSize, 0, WILDCOPY_OVERLENGTH);
  ------------------
  |  |  487|      2|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3045|      2|            return litCSize + lhSize;
 3046|      2|        }
 3047|      0|    case IS_PCH:
  ------------------
  |  |  429|      0|#define IS_PCH 1
  ------------------
  |  Branch (3047:5): [True: 0, False: 37]
  ------------------
 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: 37]
  ------------------
 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: 2]
  ------------------
 3100|     35|        {   size_t litSize;
 3101|     35|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3102|     35|            switch(lhSize)
 3103|     35|            {
 3104|      5|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3104:13): [True: 4, False: 31]
  |  Branch (3104:21): [True: 1, False: 34]
  |  Branch (3104:29): [True: 0, False: 35]
  ------------------
 3105|      5|                lhSize = 1;
 3106|      5|                litSize = istart[0] & 31;
 3107|      5|                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|     10|            case 3:
  ------------------
  |  Branch (3111:13): [True: 10, False: 25]
  ------------------
 3112|     10|                litSize = ((istart[0] & 15) << 16) + (istart[1] << 8) + istart[2];
 3113|     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 (3113:21): [True: 0, False: 10]
  ------------------
 3114|     10|                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: 37]
  ------------------
 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|     37|    }
 3125|     37|}
zstd_v06.c:ZSTDv06_decompressSequences:
 3391|     37|{
 3392|     37|    const BYTE* ip = (const BYTE*)seqStart;
 3393|     37|    const BYTE* const iend = ip + seqSize;
 3394|     37|    BYTE* const ostart = (BYTE*)dst;
 3395|     37|    BYTE* const oend = ostart + maxDstSize;
 3396|     37|    BYTE* op = ostart;
 3397|     37|    const BYTE* litPtr = dctx->litPtr;
 3398|     37|    const BYTE* const litEnd = litPtr + dctx->litSize;
 3399|     37|    FSEv06_DTable* DTableLL = dctx->LLTable;
 3400|     37|    FSEv06_DTable* DTableML = dctx->MLTable;
 3401|     37|    FSEv06_DTable* DTableOffb = dctx->OffTable;
 3402|     37|    const BYTE* const base = (const BYTE*) (dctx->base);
 3403|     37|    const BYTE* const vBase = (const BYTE*) (dctx->vBase);
 3404|     37|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 3405|     37|    int nbSeq;
 3406|       |
 3407|       |    /* Build Decoding Tables */
 3408|     37|    {   size_t const seqHSize = ZSTDv06_decodeSeqHeaders(&nbSeq, DTableLL, DTableML, DTableOffb, dctx->flagRepeatTable, ip, seqSize);
 3409|     37|        if (ZSTDv06_isError(seqHSize)) return seqHSize;
  ------------------
  |  | 2731|     37|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3409:13): [True: 1, False: 36]
  ------------------
 3410|     36|        ip += seqHSize;
 3411|     36|        dctx->flagRepeatTable = 0;
 3412|     36|    }
 3413|       |
 3414|       |    /* Regen sequences */
 3415|     36|    if (nbSeq) {
  ------------------
  |  Branch (3415:9): [True: 36, False: 0]
  ------------------
 3416|     36|        seq_t sequence;
 3417|     36|        seqState_t seqState;
 3418|       |
 3419|     36|        memset(&sequence, 0, sizeof(sequence));
 3420|     36|        sequence.offset = REPCODE_STARTVALUE;
  ------------------
  |  |  437|     36|#define REPCODE_STARTVALUE 1
  ------------------
 3421|    144|        { U32 i; for (i=0; i<ZSTDv06_REP_INIT; i++) seqState.prevOffset[i] = REPCODE_STARTVALUE; }
  ------------------
  |  |  402|    144|#define ZSTDv06_REP_INIT   ZSTDv06_REP_NUM
  |  |  ------------------
  |  |  |  |  401|    144|#define ZSTDv06_REP_NUM    3
  |  |  ------------------
  ------------------
                      { U32 i; for (i=0; i<ZSTDv06_REP_INIT; i++) seqState.prevOffset[i] = REPCODE_STARTVALUE; }
  ------------------
  |  |  437|    108|#define REPCODE_STARTVALUE 1
  ------------------
  |  Branch (3421:28): [True: 108, False: 36]
  ------------------
 3422|     36|        { size_t const errorCode = BITv06_initDStream(&(seqState.DStream), ip, iend-ip);
 3423|     36|          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: 36]
  ------------------
 3424|     36|        FSEv06_initDState(&(seqState.stateLL), &(seqState.DStream), DTableLL);
 3425|     36|        FSEv06_initDState(&(seqState.stateOffb), &(seqState.DStream), DTableOffb);
 3426|     36|        FSEv06_initDState(&(seqState.stateML), &(seqState.DStream), DTableML);
 3427|       |
 3428|    386|        for ( ; (BITv06_reloadDStream(&(seqState.DStream)) <= BITv06_DStream_completed) && nbSeq ; ) {
  ------------------
  |  Branch (3428:17): [True: 379, False: 7]
  |  Branch (3428:92): [True: 378, False: 1]
  ------------------
 3429|    378|            nbSeq--;
 3430|    378|            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|    378|            {   size_t const oneSeqSize = ZSTDv06_execSequence(op, oend, sequence, &litPtr, litEnd, base, vBase, dictEnd);
 3442|    378|                if (ZSTDv06_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  | 2731|    378|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3442:21): [True: 28, False: 350]
  ------------------
 3443|    350|                op += oneSeqSize;
 3444|    350|        }   }
 3445|       |
 3446|       |        /* check if reached exact end */
 3447|      8|        if (nbSeq) return ERROR(corruption_detected);
  ------------------
  |  |   49|      7|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      7|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      7|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3447:13): [True: 7, False: 1]
  ------------------
 3448|      8|    }
 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|     37|{
 3166|     37|    const BYTE* const istart = (const BYTE*)src;
 3167|     37|    const BYTE* const iend = istart + srcSize;
 3168|     37|    const BYTE* ip = istart;
 3169|       |
 3170|       |    /* check */
 3171|     37|    if (srcSize < MIN_SEQUENCES_SIZE) return ERROR(srcSize_wrong);
  ------------------
  |  |  423|     37|#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: 37]
  ------------------
 3172|       |
 3173|       |    /* SeqHead */
 3174|     37|    {   int nbSeq = *ip++;
 3175|     37|        if (!nbSeq) { *nbSeqPtr=0; return 1; }
  ------------------
  |  Branch (3175:13): [True: 0, False: 37]
  ------------------
 3176|     37|        if (nbSeq > 0x7F) {
  ------------------
  |  Branch (3176:13): [True: 24, False: 13]
  ------------------
 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|     37|        *nbSeqPtr = nbSeq;
 3186|     37|    }
 3187|       |
 3188|       |    /* FSE table descriptors */
 3189|     37|    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: 37]
  ------------------
 3190|     37|    {   U32 const LLtype  = *ip >> 6;
 3191|     37|        U32 const Offtype = (*ip >> 4) & 3;
 3192|     37|        U32 const MLtype  = (*ip >> 2) & 3;
 3193|     37|        ip++;
 3194|       |
 3195|       |        /* Build DTables */
 3196|     37|        {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableLL, LLtype, MaxLL, LLFSELog, ip, iend-ip, LL_defaultNorm, LL_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  442|     37|#define MaxLL  35
  ------------------
                      {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableLL, LLtype, MaxLL, LLFSELog, ip, iend-ip, LL_defaultNorm, LL_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  446|     37|#define LLFSELog    9
  ------------------
 3197|     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|      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: 36]
  ------------------
 3198|     36|            ip += bhSize;
 3199|     36|        }
 3200|     36|        {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableOffb, Offtype, MaxOff, OffFSELog, ip, iend-ip, OF_defaultNorm, OF_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  443|     36|#define MaxOff 28
  ------------------
                      {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableOffb, Offtype, MaxOff, OffFSELog, ip, iend-ip, OF_defaultNorm, OF_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  447|     36|#define OffFSELog   8
  ------------------
 3201|     36|            if (ZSTDv06_isError(bhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2731|     36|#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: 36]
  ------------------
 3202|     36|            ip += bhSize;
 3203|     36|        }
 3204|     36|        {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableML, MLtype, MaxML, MLFSELog, ip, iend-ip, ML_defaultNorm, ML_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  441|     36|#define MaxML  52
  ------------------
                      {   size_t const bhSize = ZSTDv06_buildSeqTable(DTableML, MLtype, MaxML, MLFSELog, ip, iend-ip, ML_defaultNorm, ML_defaultNormLog, flagRepeatTable);
  ------------------
  |  |  445|     36|#define MLFSELog    9
  ------------------
 3205|     36|            if (ZSTDv06_isError(bhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2731|     36|#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: 36]
  ------------------
 3206|     36|            ip += bhSize;
 3207|     36|    }   }
 3208|       |
 3209|      0|    return ip-istart;
 3210|     36|}
zstd_v06.c:ZSTDv06_buildSeqTable:
 3135|    109|{
 3136|    109|    switch(type)
 3137|    109|    {
 3138|     36|    case FSEv06_ENCODING_RLE :
  ------------------
  |  |  450|     36|#define FSEv06_ENCODING_RLE     1
  ------------------
  |  Branch (3138:5): [True: 36, False: 73]
  ------------------
 3139|     36|        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: 36]
  ------------------
 3140|     36|        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: 36]
  ------------------
 3141|     36|        FSEv06_buildDTable_rle(DTable, *(const BYTE*)src);   /* if *src > max, data is corrupted */
 3142|     36|        return 1;
 3143|     45|    case FSEv06_ENCODING_RAW :
  ------------------
  |  |  449|     45|#define FSEv06_ENCODING_RAW     0
  ------------------
  |  Branch (3143:5): [True: 45, False: 64]
  ------------------
 3144|     45|        FSEv06_buildDTable(DTable, defaultNorm, max, defaultLog);
 3145|     45|        return 0;
 3146|      0|    case FSEv06_ENCODING_STATIC:
  ------------------
  |  |  451|      0|#define FSEv06_ENCODING_STATIC  2
  ------------------
  |  Branch (3146:5): [True: 0, False: 109]
  ------------------
 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: 109]
  ------------------
 3150|     28|    case FSEv06_ENCODING_DYNAMIC :
  ------------------
  |  |  452|     28|#define FSEv06_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3150:5): [True: 28, False: 81]
  ------------------
 3151|     28|        {   U32 tableLog;
 3152|     28|            S16 norm[MaxSeq+1];
 3153|     28|            size_t const headerSize = FSEv06_readNCount(norm, &max, &tableLog, src, srcSize);
 3154|     28|            if (FSEv06_isError(headerSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2732|     28|#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: 28]
  ------------------
 3155|     28|            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: 27]
  ------------------
 3156|     27|            FSEv06_buildDTable(DTable, norm, max, tableLog);
 3157|     27|            return headerSize;
 3158|     28|    }   }
 3159|    109|}
zstd_v06.c:ZSTDv06_decodeSequence:
 3230|    378|{
 3231|       |    /* Literal length */
 3232|    378|    U32 const llCode = FSEv06_peekSymbol(&(seqState->stateLL));
 3233|    378|    U32 const mlCode = FSEv06_peekSymbol(&(seqState->stateML));
 3234|    378|    U32 const ofCode = FSEv06_peekSymbol(&(seqState->stateOffb));   /* <= maxOff, by table construction */
 3235|       |
 3236|    378|    U32 const llBits = LL_bits[llCode];
 3237|    378|    U32 const mlBits = ML_bits[mlCode];
 3238|    378|    U32 const ofBits = ofCode;
 3239|    378|    U32 const totalBits = llBits+mlBits+ofBits;
 3240|       |
 3241|    378|    static const U32 LL_base[MaxLL+1] = {
 3242|    378|                             0,  1,  2,  3,  4,  5,  6,  7,  8,  9,   10,    11,    12,    13,    14,     15,
 3243|    378|                            16, 18, 20, 22, 24, 28, 32, 40, 48, 64, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000,
 3244|    378|                            0x2000, 0x4000, 0x8000, 0x10000 };
 3245|       |
 3246|    378|    static const U32 ML_base[MaxML+1] = {
 3247|    378|                             0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10,   11,    12,    13,    14,    15,
 3248|    378|                            16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,   27,    28,    29,    30,    31,
 3249|    378|                            32, 34, 36, 38, 40, 44, 48, 56, 64, 80, 96, 0x80, 0x100, 0x200, 0x400, 0x800,
 3250|    378|                            0x1000, 0x2000, 0x4000, 0x8000, 0x10000 };
 3251|       |
 3252|    378|    static const U32 OF_base[MaxOff+1] = {
 3253|    378|                 0,        1,       3,       7,     0xF,     0x1F,     0x3F,     0x7F,
 3254|    378|                 0xFF,   0x1FF,   0x3FF,   0x7FF,   0xFFF,   0x1FFF,   0x3FFF,   0x7FFF,
 3255|    378|                 0xFFFF, 0x1FFFF, 0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF, 0x7FFFFF,
 3256|    378|                 0xFFFFFF, 0x1FFFFFF, 0x3FFFFFF, /*fake*/ 1, 1 };
 3257|       |
 3258|       |    /* sequence */
 3259|    378|    {   size_t offset;
 3260|    378|        if (!ofCode)
  ------------------
  |  Branch (3260:13): [True: 210, False: 168]
  ------------------
 3261|    210|            offset = 0;
 3262|    168|        else {
 3263|    168|            offset = OF_base[ofCode] + BITv06_readBits(&(seqState->DStream), ofBits);   /* <=  26 bits */
 3264|    168|            if (MEM_32bits()) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3264:17): [True: 0, False: 168]
  ------------------
 3265|    168|        }
 3266|       |
 3267|    378|        if (offset < ZSTDv06_REP_NUM) {
  ------------------
  |  |  401|    378|#define ZSTDv06_REP_NUM    3
  ------------------
  |  Branch (3267:13): [True: 322, False: 56]
  ------------------
 3268|    322|            if (llCode == 0 && offset <= 1) offset = 1-offset;
  ------------------
  |  Branch (3268:17): [True: 51, False: 271]
  |  Branch (3268:32): [True: 51, False: 0]
  ------------------
 3269|       |
 3270|    322|            if (offset != 0) {
  ------------------
  |  Branch (3270:17): [True: 159, False: 163]
  ------------------
 3271|    159|                size_t temp = seqState->prevOffset[offset];
 3272|    159|                if (offset != 1) {
  ------------------
  |  Branch (3272:21): [True: 51, False: 108]
  ------------------
 3273|     51|                    seqState->prevOffset[2] = seqState->prevOffset[1];
 3274|     51|                }
 3275|    159|                seqState->prevOffset[1] = seqState->prevOffset[0];
 3276|    159|                seqState->prevOffset[0] = offset = temp;
 3277|       |
 3278|    163|            } else {
 3279|    163|                offset = seqState->prevOffset[0];
 3280|    163|            }
 3281|    322|        } else {
 3282|     56|            offset -= ZSTDv06_REP_MOVE;
  ------------------
  |  |  403|     56|#define ZSTDv06_REP_MOVE   (ZSTDv06_REP_NUM-1)
  |  |  ------------------
  |  |  |  |  401|     56|#define ZSTDv06_REP_NUM    3
  |  |  ------------------
  ------------------
 3283|     56|            seqState->prevOffset[2] = seqState->prevOffset[1];
 3284|     56|            seqState->prevOffset[1] = seqState->prevOffset[0];
 3285|     56|            seqState->prevOffset[0] = offset;
 3286|     56|        }
 3287|    378|        seq->offset = offset;
 3288|    378|    }
 3289|       |
 3290|    378|    seq->matchLength = ML_base[mlCode] + MINMATCH + ((mlCode>31) ? BITv06_readBits(&(seqState->DStream), mlBits) : 0);   /* <=  16 bits */
  ------------------
  |  |  435|    378|#define MINMATCH 3
  ------------------
  |  Branch (3290:54): [True: 80, False: 298]
  ------------------
 3291|    378|    if (MEM_32bits() && (mlBits+llBits>24)) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3291:9): [True: 0, False: 378]
  |  Branch (3291:25): [True: 0, False: 0]
  ------------------
 3292|       |
 3293|    378|    seq->litLength = LL_base[llCode] + ((llCode>15) ? BITv06_readBits(&(seqState->DStream), llBits) : 0);   /* <=  16 bits */
  ------------------
  |  Branch (3293:41): [True: 120, False: 258]
  ------------------
 3294|    378|    if (MEM_32bits() ||
  ------------------
  |  Branch (3294:9): [True: 0, False: 378]
  ------------------
 3295|    378|       (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  |  446|    378|#define LLFSELog    9
  ------------------
                     (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  |  445|    378|#define MLFSELog    9
  ------------------
                     (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv06_reloadDStream(&(seqState->DStream));
  ------------------
  |  |  447|    378|#define OffFSELog   8
  ------------------
  |  Branch (3295:8): [True: 1, False: 377]
  ------------------
 3296|       |
 3297|       |    /* ANS state update */
 3298|    378|    FSEv06_updateState(&(seqState->stateLL), &(seqState->DStream));   /* <=  9 bits */
 3299|    378|    FSEv06_updateState(&(seqState->stateML), &(seqState->DStream));   /* <=  9 bits */
 3300|    378|    if (MEM_32bits()) BITv06_reloadDStream(&(seqState->DStream));     /* <= 18 bits */
  ------------------
  |  Branch (3300:9): [True: 0, False: 378]
  ------------------
 3301|    378|    FSEv06_updateState(&(seqState->stateOffb), &(seqState->DStream)); /* <=  8 bits */
 3302|    378|}
zstd_v06.c:FSEv06_peekSymbol:
 1062|  1.13k|{
 1063|  1.13k|    FSEv06_decode_t const DInfo = ((const FSEv06_decode_t*)(DStatePtr->table))[DStatePtr->state];
 1064|  1.13k|    return DInfo.symbol;
 1065|  1.13k|}
zstd_v06.c:FSEv06_updateState:
 1068|  1.13k|{
 1069|  1.13k|    FSEv06_decode_t const DInfo = ((const FSEv06_decode_t*)(DStatePtr->table))[DStatePtr->state];
 1070|  1.13k|    U32 const nbBits = DInfo.nbBits;
 1071|  1.13k|    size_t const lowBits = BITv06_readBits(bitD, nbBits);
 1072|  1.13k|    DStatePtr->state = DInfo.newState + lowBits;
 1073|  1.13k|}
zstd_v06.c:ZSTDv06_execSequence:
 3309|    378|{
 3310|    378|    BYTE* const oLitEnd = op + sequence.litLength;
 3311|    378|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 3312|    378|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 3313|    378|    BYTE* const oend_8 = oend-8;
 3314|    378|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 3315|    378|    const BYTE* match = oLitEnd - sequence.offset;
 3316|       |
 3317|       |    /* checks */
 3318|    378|    size_t const seqLength = sequence.litLength + sequence.matchLength;
 3319|       |
 3320|    378|    if (seqLength > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|     23|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|     23|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|     23|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3320:9): [True: 23, False: 355]
  ------------------
 3321|    355|    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: 355]
  ------------------
 3322|       |    /* Now we know there are no overflow in literal nor match lengths, can use pointer checks */
 3323|    355|    if (oLitEnd > oend_8) return ERROR(dstSize_tooSmall);
  ------------------
  |  |   49|      3|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      3|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      3|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3323:9): [True: 3, False: 352]
  ------------------
 3324|       |
 3325|    352|    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: 352]
  ------------------
 3326|    352|    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: 352]
  ------------------
 3327|       |
 3328|       |    /* copy Literals */
 3329|    352|    ZSTDv06_wildcopy(op, *litPtr, (ptrdiff_t)sequence.litLength);   /* note : oLitEnd <= oend-8 : no risk of overwrite beyond oend */
 3330|    352|    op = oLitEnd;
 3331|    352|    *litPtr = iLitEnd;   /* update for next sequence */
 3332|       |
 3333|       |    /* copy Match */
 3334|    352|    if (sequence.offset > (size_t)(oLitEnd - base)) {
  ------------------
  |  Branch (3334:9): [True: 19, False: 333]
  ------------------
 3335|       |        /* offset beyond prefix */
 3336|     19|        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: 17]
  ------------------
 3337|     17|        match = dictEnd - (base-match);
 3338|     17|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (3338:13): [True: 1, False: 16]
  ------------------
 3339|      1|            memmove(oLitEnd, match, sequence.matchLength);
 3340|      1|            return sequenceLength;
 3341|      1|        }
 3342|       |        /* span extDict & currentPrefixSegment */
 3343|     16|        {   size_t const length1 = dictEnd - match;
 3344|     16|            memmove(oLitEnd, match, length1);
 3345|     16|            op = oLitEnd + length1;
 3346|     16|            sequence.matchLength -= length1;
 3347|     16|            match = base;
 3348|     16|            if (op > oend_8 || sequence.matchLength < MINMATCH) {
  ------------------
  |  |  435|     16|#define MINMATCH 3
  ------------------
  |  Branch (3348:17): [True: 0, False: 16]
  |  Branch (3348:32): [True: 1, False: 15]
  ------------------
 3349|      3|              while (op < oMatchEnd) *op++ = *match++;
  ------------------
  |  Branch (3349:22): [True: 2, False: 1]
  ------------------
 3350|      1|              return sequenceLength;
 3351|      1|            }
 3352|     16|    }   }
 3353|       |    /* Requirement: op <= oend_8 */
 3354|       |
 3355|       |    /* match within prefix */
 3356|    348|    if (sequence.offset < 8) {
  ------------------
  |  Branch (3356:9): [True: 307, False: 41]
  ------------------
 3357|       |        /* close range match, overlap */
 3358|    307|        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
 3359|    307|        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
 3360|    307|        int const sub2 = dec64table[sequence.offset];
 3361|    307|        op[0] = match[0];
 3362|    307|        op[1] = match[1];
 3363|    307|        op[2] = match[2];
 3364|    307|        op[3] = match[3];
 3365|    307|        match += dec32table[sequence.offset];
 3366|    307|        ZSTDv06_copy4(op+4, match);
 3367|    307|        match -= sub2;
 3368|    307|    } else {
 3369|     41|        ZSTDv06_copy8(op, match);
 3370|     41|    }
 3371|    348|    op += 8; match += 8;
 3372|       |
 3373|    348|    if (oMatchEnd > oend-(16-MINMATCH)) {
  ------------------
  |  |  435|    348|#define MINMATCH 3
  ------------------
  |  Branch (3373:9): [True: 8, False: 340]
  ------------------
 3374|      8|        if (op < oend_8) {
  ------------------
  |  Branch (3374:13): [True: 6, False: 2]
  ------------------
 3375|      6|            ZSTDv06_wildcopy(op, match, oend_8 - op);
 3376|      6|            match += oend_8 - op;
 3377|      6|            op = oend_8;
 3378|      6|        }
 3379|     25|        while (op < oMatchEnd) *op++ = *match++;
  ------------------
  |  Branch (3379:16): [True: 17, False: 8]
  ------------------
 3380|    340|    } else {
 3381|    340|        ZSTDv06_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8);   /* works even if matchLength < 8 */
 3382|    340|    }
 3383|    348|    return sequenceLength;
 3384|    352|}
zstd_v06.c:ZSTDv06_wildcopy:
  489|    698|{
  490|    698|    const BYTE* ip = (const BYTE*)src;
  491|    698|    BYTE* op = (BYTE*)dst;
  492|    698|    BYTE* const oend = op + length;
  493|    698|    do
  494|  1.77k|        COPY8(op, ip)
  ------------------
  |  |  483|  1.77k|#define COPY8(d,s) { ZSTDv06_copy8(d,s); d+=8; s+=8; }
  ------------------
  495|  1.77k|    while (op < oend);
  ------------------
  |  Branch (495:12): [True: 1.07k, False: 698]
  ------------------
  496|    698|}
zstd_v06.c:ZSTDv06_copy4:
 2739|    307|static void ZSTDv06_copy4(void* dst, const void* src) { memcpy(dst, src, 4); }
zstd_v06.c:ZSTDv06_copy8:
  482|  1.81k|static void ZSTDv06_copy8(void* dst, const void* src) { memcpy(dst, src, 8); }
zstd_v06.c:ZSTDv06_decompressFrame:
 3507|     48|{
 3508|     48|    const BYTE* ip = (const BYTE*)src;
 3509|     48|    const BYTE* const iend = ip + srcSize;
 3510|     48|    BYTE* const ostart = (BYTE*)dst;
 3511|     48|    BYTE* op = ostart;
 3512|     48|    BYTE* const oend = ostart + dstCapacity;
 3513|     48|    size_t remainingSize = srcSize;
 3514|     48|    blockProperties_t blockProperties = { bt_compressed, 0 };
 3515|       |
 3516|       |    /* check */
 3517|     48|    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: 48]
  ------------------
 3518|       |
 3519|       |    /* Frame Header */
 3520|     48|    {   size_t const frameHeaderSize = ZSTDv06_frameHeaderSize(src, ZSTDv06_frameHeaderSize_min);
 3521|     48|        if (ZSTDv06_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  | 2731|     48|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3521:13): [True: 0, False: 48]
  ------------------
 3522|     48|        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: 48]
  ------------------
 3523|     48|        if (ZSTDv06_decodeFrameHeader(dctx, src, frameHeaderSize)) 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 (3523:13): [True: 8, False: 40]
  ------------------
 3524|     40|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3525|     40|    }
 3526|       |
 3527|       |    /* Loop on each block */
 3528|     42|    while (1) {
  ------------------
  |  Branch (3528:12): [True: 42, Folded]
  ------------------
 3529|     42|        size_t decodedSize=0;
 3530|     42|        size_t const cBlockSize = ZSTDv06_getcBlockSize(ip, iend-ip, &blockProperties);
 3531|     42|        if (ZSTDv06_isError(cBlockSize)) return cBlockSize;
  ------------------
  |  | 2731|     42|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3531:13): [True: 0, False: 42]
  ------------------
 3532|       |
 3533|     42|        ip += ZSTDv06_blockHeaderSize;
 3534|     42|        remainingSize -= ZSTDv06_blockHeaderSize;
 3535|     42|        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: 42]
  ------------------
 3536|       |
 3537|     42|        switch(blockProperties.blockType)
 3538|     42|        {
 3539|     37|        case bt_compressed:
  ------------------
  |  Branch (3539:9): [True: 37, False: 5]
  ------------------
 3540|     37|            decodedSize = ZSTDv06_decompressBlock_internal(dctx, op, oend-op, ip, cBlockSize);
 3541|     37|            break;
 3542|      2|        case bt_raw :
  ------------------
  |  Branch (3542:9): [True: 2, False: 40]
  ------------------
 3543|      2|            decodedSize = ZSTDv06_copyRawBlock(op, oend-op, ip, cBlockSize);
 3544|      2|            break;
 3545|      2|        case bt_rle :
  ------------------
  |  Branch (3545:9): [True: 2, False: 40]
  ------------------
 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: 41]
  ------------------
 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: 42]
  ------------------
 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|     42|        }
 3555|     40|        if (cBlockSize == 0) break;   /* bt_end */
  ------------------
  |  Branch (3555:13): [True: 1, False: 39]
  ------------------
 3556|       |
 3557|     39|        if (ZSTDv06_isError(decodedSize)) return decodedSize;
  ------------------
  |  | 2731|     39|#define ZSTDv06_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3557:13): [True: 37, False: 2]
  ------------------
 3558|      2|        op += decodedSize;
 3559|      2|        ip += cBlockSize;
 3560|      2|        remainingSize -= cBlockSize;
 3561|      2|    }
 3562|       |
 3563|      1|    return op-ostart;
 3564|     40|}
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|    265|{
 2972|    265|    const BYTE* const in = (const BYTE*)src;
 2973|    265|    U32 cSize;
 2974|       |
 2975|    265|    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: 265]
  ------------------
 2976|       |
 2977|    265|    bpPtr->blockType = (blockType_t)((*in) >> 6);
 2978|    265|    cSize = in[2] + (in[1]<<8) + ((in[0] & 7)<<16);
 2979|    265|    bpPtr->origSize = (bpPtr->blockType == bt_rle) ? cSize : 0;
  ------------------
  |  Branch (2979:23): [True: 83, False: 182]
  ------------------
 2980|       |
 2981|    265|    if (bpPtr->blockType == bt_end) return 0;
  ------------------
  |  Branch (2981:9): [True: 40, False: 225]
  ------------------
 2982|    225|    if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (2982:9): [True: 83, False: 142]
  ------------------
 2983|    142|    return cSize;
 2984|    225|}
zstd_v06.c:ZSTDv06_decodeFrameHeader:
 2955|     48|{
 2956|     48|    size_t const result = ZSTDv06_getFrameParams(&(zc->fParams), src, srcSize);
 2957|     48|    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: 48]
  |  Branch (2957:27): [True: 0, False: 0]
  ------------------
 2958|     48|    return result;
 2959|     48|}
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|     76|{
 1425|     76|    void* const tdPtr = dt+1;   /* because *dt is unsigned, 32-bits aligned on 32-bits */
 1426|     76|    FSEv07_DECODE_TYPE* const tableDecode = (FSEv07_DECODE_TYPE*) (tdPtr);
  ------------------
  |  |  890|     76|#define FSEv07_DECODE_TYPE FSEv07_decode_t
  ------------------
 1427|     76|    U16 symbolNext[FSEv07_MAX_SYMBOL_VALUE+1];
 1428|       |
 1429|     76|    U32 const maxSV1 = maxSymbolValue + 1;
 1430|     76|    U32 const tableSize = 1 << tableLog;
 1431|     76|    U32 highThreshold = tableSize-1;
 1432|       |
 1433|       |    /* Sanity Checks */
 1434|     76|    if (maxSymbolValue > FSEv07_MAX_SYMBOL_VALUE) return ERROR(maxSymbolValue_tooLarge);
  ------------------
  |  |  882|     76|#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: 76]
  ------------------
 1435|     76|    if (tableLog > FSEv07_MAX_TABLELOG) return ERROR(tableLog_tooLarge);
  ------------------
  |  |  899|     76|#define FSEv07_MAX_TABLELOG  (FSEv07_MAX_MEMORY_USAGE-2)
  |  |  ------------------
  |  |  |  |  876|     76|#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: 76]
  ------------------
 1436|       |
 1437|       |    /* Init, lay down lowprob symbols */
 1438|     76|    {   FSEv07_DTableHeader DTableH;
 1439|     76|        DTableH.tableLog = (U16)tableLog;
 1440|     76|        DTableH.fastMode = 1;
 1441|     76|        {   S16 const largeLimit= (S16)(1 << (tableLog-1));
 1442|     76|            U32 s;
 1443|  1.71k|            for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (1443:23): [True: 1.64k, False: 76]
  ------------------
 1444|  1.64k|                if (normalizedCounter[s]==-1) {
  ------------------
  |  Branch (1444:21): [True: 284, False: 1.35k]
  ------------------
 1445|    284|                    tableDecode[highThreshold--].symbol = (FSEv07_FUNCTION_TYPE)s;
 1446|    284|                    symbolNext[s] = 1;
 1447|  1.35k|                } else {
 1448|  1.35k|                    if (normalizedCounter[s] >= largeLimit) DTableH.fastMode=0;
  ------------------
  |  Branch (1448:25): [True: 19, False: 1.33k]
  ------------------
 1449|  1.35k|                    symbolNext[s] = normalizedCounter[s];
 1450|  1.35k|        }   }   }
 1451|     76|        memcpy(dt, &DTableH, sizeof(DTableH));
 1452|     76|    }
 1453|       |
 1454|       |    /* Spread symbols */
 1455|     76|    {   U32 const tableMask = tableSize-1;
 1456|     76|        U32 const step = FSEv07_TABLESTEP(tableSize);
  ------------------
  |  |  910|     76|#define FSEv07_TABLESTEP(tableSize) ((tableSize>>1) + (tableSize>>3) + 3)
  ------------------
 1457|     76|        U32 s, position = 0;
 1458|  1.71k|        for (s=0; s<maxSV1; s++) {
  ------------------
  |  Branch (1458:19): [True: 1.64k, False: 76]
  ------------------
 1459|  1.64k|            int i;
 1460|  5.51k|            for (i=0; i<normalizedCounter[s]; i++) {
  ------------------
  |  Branch (1460:23): [True: 3.87k, False: 1.64k]
  ------------------
 1461|  3.87k|                tableDecode[position].symbol = (FSEv07_FUNCTION_TYPE)s;
 1462|  3.87k|                position = (position + step) & tableMask;
 1463|  4.16k|                while (position > highThreshold) position = (position + step) & tableMask;   /* lowprob area */
  ------------------
  |  Branch (1463:24): [True: 284, False: 3.87k]
  ------------------
 1464|  3.87k|        }   }
 1465|       |
 1466|     76|        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: 76]
  ------------------
 1467|     76|    }
 1468|       |
 1469|       |    /* Build Decoding table */
 1470|     76|    {   U32 u;
 1471|  4.23k|        for (u=0; u<tableSize; u++) {
  ------------------
  |  Branch (1471:19): [True: 4.16k, False: 76]
  ------------------
 1472|  4.16k|            FSEv07_FUNCTION_TYPE const symbol = (FSEv07_FUNCTION_TYPE)(tableDecode[u].symbol);
  ------------------
  |  |  888|  4.16k|#define FSEv07_FUNCTION_TYPE BYTE
  ------------------
 1473|  4.16k|            U16 nextState = symbolNext[symbol]++;
 1474|  4.16k|            tableDecode[u].nbBits = (BYTE) (tableLog - BITv07_highbit32 ((U32)nextState) );
 1475|  4.16k|            tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
 1476|  4.16k|    }   }
 1477|       |
 1478|     76|    return 0;
 1479|     76|}
FSEv07_buildDTable_rle:
 1489|     19|{
 1490|     19|    void* ptr = dt;
 1491|     19|    FSEv07_DTableHeader* const DTableH = (FSEv07_DTableHeader*)ptr;
 1492|     19|    void* dPtr = dt + 1;
 1493|     19|    FSEv07_decode_t* const cell = (FSEv07_decode_t*)dPtr;
 1494|       |
 1495|     19|    DTableH->tableLog = 0;
 1496|     19|    DTableH->fastMode = 0;
 1497|       |
 1498|     19|    cell->newState = 0;
 1499|     19|    cell->symbol = symbolValue;
 1500|     19|    cell->nbBits = 0;
 1501|       |
 1502|     19|    return 0;
 1503|     19|}
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|     88|{
 2909|     88|    dctx->expected = ZSTDv07_frameHeaderSize_min;
 2910|     88|    dctx->stage = ZSTDds_getFrameHeaderSize;
 2911|     88|    dctx->previousDstEnd = NULL;
 2912|     88|    dctx->base = NULL;
 2913|     88|    dctx->vBase = NULL;
 2914|     88|    dctx->dictEnd = NULL;
 2915|     88|    dctx->hufTable[0] = (HUFv07_DTable)((ZSTD_HUFFDTABLE_CAPACITY_LOG)*0x1000001);
  ------------------
  |  | 2665|     88|#define ZSTD_HUFFDTABLE_CAPACITY_LOG 12
  ------------------
 2916|     88|    dctx->litEntropy = dctx->fseEntropy = 0;
 2917|     88|    dctx->dictID = 0;
 2918|    352|    { int i; for (i=0; i<ZSTDv07_REP_NUM; i++) dctx->rep[i] = repStartValue[i]; }
  ------------------
  |  | 2638|    352|#define ZSTDv07_REP_NUM    3
  ------------------
  |  Branch (2918:24): [True: 264, False: 88]
  ------------------
 2919|     88|    return 0;
 2920|     88|}
ZSTDv07_createDCtx_advanced:
 2923|     44|{
 2924|     44|    ZSTDv07_DCtx* dctx;
 2925|       |
 2926|     44|    if (!customMem.customAlloc && !customMem.customFree)
  ------------------
  |  Branch (2926:9): [True: 0, False: 44]
  |  Branch (2926:35): [True: 0, False: 0]
  ------------------
 2927|      0|        customMem = defaultCustomMem;
 2928|       |
 2929|     44|    if (!customMem.customAlloc || !customMem.customFree)
  ------------------
  |  Branch (2929:9): [True: 0, False: 44]
  |  Branch (2929:35): [True: 0, False: 44]
  ------------------
 2930|      0|        return NULL;
 2931|       |
 2932|     44|    dctx = (ZSTDv07_DCtx*) customMem.customAlloc(customMem.opaque, sizeof(ZSTDv07_DCtx));
 2933|     44|    if (!dctx) return NULL;
  ------------------
  |  Branch (2933:9): [True: 0, False: 44]
  ------------------
 2934|     44|    memcpy(&dctx->customMem, &customMem, sizeof(ZSTDv07_customMem));
 2935|     44|    ZSTDv07_decompressBegin(dctx);
 2936|     44|    return dctx;
 2937|     44|}
ZSTDv07_createDCtx:
 2940|     44|{
 2941|     44|    return ZSTDv07_createDCtx_advanced(defaultCustomMem);
 2942|     44|}
ZSTDv07_freeDCtx:
 2945|     44|{
 2946|     44|    if (dctx==NULL) return 0;   /* support free on NULL */
  ------------------
  |  Branch (2946:9): [True: 0, False: 44]
  ------------------
 2947|     44|    dctx->customMem.customFree(dctx->customMem.opaque, dctx);
 2948|     44|    return 0;   /* reserved as a potential error code in the future */
 2949|     44|}
ZSTDv07_getFrameParams:
 3096|     50|{
 3097|     50|    const BYTE* ip = (const BYTE*)src;
 3098|       |
 3099|     50|    if (srcSize < ZSTDv07_frameHeaderSize_min) return ZSTDv07_frameHeaderSize_min;
  ------------------
  |  Branch (3099:9): [True: 0, False: 50]
  ------------------
 3100|     50|    memset(fparamsPtr, 0, sizeof(*fparamsPtr));
 3101|     50|    if (MEM_readLE32(src) != ZSTDv07_MAGICNUMBER) {
  ------------------
  |  |  180|     50|#define ZSTDv07_MAGICNUMBER            0xFD2FB527   /* v0.7 */
  ------------------
  |  Branch (3101:9): [True: 0, False: 50]
  ------------------
 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|     50|    { size_t const fhsize = ZSTDv07_frameHeaderSize(src, srcSize);
 3113|     50|      if (srcSize < fhsize) return fhsize; }
  ------------------
  |  Branch (3113:11): [True: 0, False: 50]
  ------------------
 3114|       |
 3115|     50|    {   BYTE const fhdByte = ip[4];
 3116|     50|        size_t pos = 5;
 3117|     50|        U32 const dictIDSizeCode = fhdByte&3;
 3118|     50|        U32 const checksumFlag = (fhdByte>>2)&1;
 3119|     50|        U32 const directMode = (fhdByte>>5)&1;
 3120|     50|        U32 const fcsID = fhdByte>>6;
 3121|     50|        U32 const windowSizeMax = 1U << ZSTDv07_WINDOWLOG_MAX;
  ------------------
  |  |   45|     50|#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|     50|#define ZSTDv07_WINDOWLOG_MAX_64  27
  |  |  ------------------
  |  |  |  Branch (45:41): [True: 0, False: 50]
  |  |  ------------------
  ------------------
 3122|     50|        U32 windowSize = 0;
 3123|     50|        U32 dictID = 0;
 3124|     50|        U64 frameContentSize = 0;
 3125|     50|        if ((fhdByte & 0x08) != 0)   /* reserved bits, which must be zero */
  ------------------
  |  Branch (3125:13): [True: 0, False: 50]
  ------------------
 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|     50|        if (!directMode) {
  ------------------
  |  Branch (3127:13): [True: 42, False: 8]
  ------------------
 3128|     42|            BYTE const wlByte = ip[pos++];
 3129|     42|            U32 const windowLog = (wlByte >> 3) + ZSTDv07_WINDOWLOG_ABSOLUTEMIN;
  ------------------
  |  | 2654|     42|#define ZSTDv07_WINDOWLOG_ABSOLUTEMIN 10
  ------------------
 3130|     42|            if (windowLog > ZSTDv07_WINDOWLOG_MAX)
  ------------------
  |  |   45|     42|#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|     42|#define ZSTDv07_WINDOWLOG_MAX_64  27
  |  |  ------------------
  |  |  |  Branch (45:41): [True: 0, False: 42]
  |  |  ------------------
  ------------------
  |  Branch (3130:17): [True: 0, False: 42]
  ------------------
 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|     42|            windowSize = (1U << windowLog);
 3133|     42|            windowSize += (windowSize >> 3) * (wlByte&7);
 3134|     42|        }
 3135|       |
 3136|     50|        switch(dictIDSizeCode)
 3137|     50|        {
 3138|      0|            default:   /* impossible */
  ------------------
  |  Branch (3138:13): [True: 0, False: 50]
  ------------------
 3139|     45|            case 0 : break;
  ------------------
  |  Branch (3139:13): [True: 45, False: 5]
  ------------------
 3140|      3|            case 1 : dictID = ip[pos]; pos++; break;
  ------------------
  |  Branch (3140:13): [True: 3, False: 47]
  ------------------
 3141|      2|            case 2 : dictID = MEM_readLE16(ip+pos); pos+=2; break;
  ------------------
  |  Branch (3141:13): [True: 2, False: 48]
  ------------------
 3142|      0|            case 3 : dictID = MEM_readLE32(ip+pos); pos+=4; break;
  ------------------
  |  Branch (3142:13): [True: 0, False: 50]
  ------------------
 3143|     50|        }
 3144|     50|        switch(fcsID)
 3145|     50|        {
 3146|      0|            default:   /* impossible */
  ------------------
  |  Branch (3146:13): [True: 0, False: 50]
  ------------------
 3147|     45|            case 0 : if (directMode) frameContentSize = ip[pos]; break;
  ------------------
  |  Branch (3147:13): [True: 45, False: 5]
  |  Branch (3147:26): [True: 3, False: 42]
  ------------------
 3148|      0|            case 1 : frameContentSize = MEM_readLE16(ip+pos)+256; break;
  ------------------
  |  Branch (3148:13): [True: 0, False: 50]
  ------------------
 3149|      0|            case 2 : frameContentSize = MEM_readLE32(ip+pos); break;
  ------------------
  |  Branch (3149:13): [True: 0, False: 50]
  ------------------
 3150|      5|            case 3 : frameContentSize = MEM_readLE64(ip+pos); break;
  ------------------
  |  Branch (3150:13): [True: 5, False: 45]
  ------------------
 3151|     50|        }
 3152|     50|        if (!windowSize) windowSize = (U32)frameContentSize;
  ------------------
  |  Branch (3152:13): [True: 8, False: 42]
  ------------------
 3153|     50|        if (windowSize > windowSizeMax)
  ------------------
  |  Branch (3153:13): [True: 4, False: 46]
  ------------------
 3154|      4|            return ERROR(frameParameter_unsupported);
  ------------------
  |  |   49|      4|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      4|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      4|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3155|     46|        fparamsPtr->frameContentSize = frameContentSize;
 3156|     46|        fparamsPtr->windowSize = windowSize;
 3157|     46|        fparamsPtr->dictID = dictID;
 3158|     46|        fparamsPtr->checksumFlag = checksumFlag;
 3159|     46|    }
 3160|      0|    return 0;
 3161|     50|}
ZSTDv07_decompress_usingDict:
 3824|     44|{
 3825|     44|    ZSTDv07_decompressBegin_usingDict(dctx, dict, dictSize);
 3826|     44|    ZSTDv07_checkContinuity(dctx, dst);
 3827|     44|    return ZSTDv07_decompressFrame(dctx, dst, dstCapacity, src, srcSize);
 3828|     44|}
ZSTDv07_findFrameSizeInfoLegacy:
 3861|     49|{
 3862|     49|    const BYTE* ip = (const BYTE*)src;
 3863|     49|    size_t remainingSize = srcSize;
 3864|     49|    size_t nbBlocks = 0;
 3865|       |
 3866|       |    /* check */
 3867|     49|    if (srcSize < ZSTDv07_frameHeaderSize_min+ZSTDv07_blockHeaderSize) {
  ------------------
  |  Branch (3867:9): [True: 0, False: 49]
  ------------------
 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|     49|    {   size_t const frameHeaderSize = ZSTDv07_frameHeaderSize(src, srcSize);
 3874|     49|        if (ZSTDv07_isError(frameHeaderSize)) {
  ------------------
  |  | 2856|     49|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3874:13): [True: 0, False: 49]
  ------------------
 3875|      0|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, frameHeaderSize);
 3876|      0|            return;
 3877|      0|        }
 3878|     49|        if (MEM_readLE32(src) != ZSTDv07_MAGICNUMBER) {
  ------------------
  |  |  180|     49|#define ZSTDv07_MAGICNUMBER            0xFD2FB527   /* v0.7 */
  ------------------
  |  Branch (3878:13): [True: 0, False: 49]
  ------------------
 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|     49|        if (srcSize < frameHeaderSize+ZSTDv07_blockHeaderSize) {
  ------------------
  |  Branch (3882:13): [True: 0, False: 49]
  ------------------
 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|     49|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3887|     49|    }
 3888|       |
 3889|       |    /* Loop on each block */
 3890|    449|    while (1) {
  ------------------
  |  Branch (3890:12): [True: 449, Folded]
  ------------------
 3891|    449|        blockProperties_t blockProperties;
 3892|    449|        size_t const cBlockSize = ZSTDv07_getcBlockSize(ip, remainingSize, &blockProperties);
 3893|    449|        if (ZSTDv07_isError(cBlockSize)) {
  ------------------
  |  | 2856|    449|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3893:13): [True: 1, False: 448]
  ------------------
 3894|      1|            ZSTD_errorFrameSizeInfoLegacy(cSize, dBound, cBlockSize);
 3895|      1|            return;
 3896|      1|        }
 3897|       |
 3898|    448|        ip += ZSTDv07_blockHeaderSize;
 3899|    448|        remainingSize -= ZSTDv07_blockHeaderSize;
 3900|       |
 3901|    448|        if (blockProperties.blockType == bt_end) break;
  ------------------
  |  Branch (3901:13): [True: 44, False: 404]
  ------------------
 3902|       |
 3903|    404|        if (cBlockSize > remainingSize) {
  ------------------
  |  Branch (3903:13): [True: 4, False: 400]
  ------------------
 3904|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3905|      4|            return;
 3906|      4|        }
 3907|       |
 3908|    400|        ip += cBlockSize;
 3909|    400|        remainingSize -= cBlockSize;
 3910|    400|        nbBlocks++;
 3911|    400|    }
 3912|       |
 3913|     44|    *cSize = ip - (const BYTE*)src;
 3914|     44|    *dBound = nbBlocks * ZSTDv07_BLOCKSIZE_ABSOLUTEMAX;
  ------------------
  |  |  175|     44|#define ZSTDv07_BLOCKSIZE_ABSOLUTEMAX (128 * 1024)   /* define, for static allocation */
  ------------------
 3915|     44|}
ZSTDv07_decompressBegin_usingDict:
 4115|     44|{
 4116|     44|    { size_t const errorCode = ZSTDv07_decompressBegin(dctx);
 4117|     44|      if (ZSTDv07_isError(errorCode)) return errorCode; }
  ------------------
  |  | 2856|     44|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (4117:11): [True: 0, False: 44]
  ------------------
 4118|       |
 4119|     44|    if (dict && dictSize) {
  ------------------
  |  Branch (4119:9): [True: 44, False: 0]
  |  Branch (4119:17): [True: 21, False: 23]
  ------------------
 4120|     21|        size_t const errorCode = ZSTDv07_decompress_insertDictionary(dctx, dict, dictSize);
 4121|     21|        if (ZSTDv07_isError(errorCode)) return ERROR(dictionary_corrupted);
  ------------------
  |  | 2856|     21|#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: 21]
  ------------------
 4122|     21|    }
 4123|       |
 4124|     44|    return 0;
 4125|     44|}
zstd_v07.c:MEM_readLE32:
  350|    530|{
  351|    530|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (351:9): [True: 530, False: 0]
  ------------------
  352|    530|        return MEM_read32(memPtr);
  353|      0|    else
  354|      0|        return MEM_swap32(MEM_read32(memPtr));
  355|    530|}
zstd_v07.c:MEM_isLittleEndian:
  268|  9.42k|{
  269|  9.42k|    const union { U32 u; BYTE c[4]; } one = { 1 };   /* don't use static : performance detrimental  */
  270|  9.42k|    return one.c[0];
  271|  9.42k|}
zstd_v07.c:MEM_read32:
  279|    530|{
  280|    530|    U32 val; memcpy(&val, memPtr, sizeof(val)); return val;
  281|    530|}
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.21k|{
  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.21k|}
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|     32|{
  504|     32|    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: 32]
  ------------------
  505|       |
  506|     32|    if (srcSize >=  sizeof(bitD->bitContainer)) {  /* normal case */
  ------------------
  |  Branch (506:9): [True: 31, False: 1]
  ------------------
  507|     31|        bitD->start = (const char*)srcBuffer;
  508|     31|        bitD->ptr   = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer);
  509|     31|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  510|     31|        { BYTE const lastByte = ((const BYTE*)srcBuffer)[srcSize-1];
  511|     31|          bitD->bitsConsumed = lastByte ? 8 - BITv07_highbit32(lastByte) : 0;
  ------------------
  |  Branch (511:32): [True: 30, False: 1]
  ------------------
  512|     31|          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: 30]
  ------------------
  513|     31|    } 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|     31|    return srcSize;
  534|     32|}
zstd_v07.c:MEM_readLEST:
  367|    255|{
  368|    255|    if (MEM_32bits())
  ------------------
  |  Branch (368:9): [True: 0, False: 255]
  ------------------
  369|      0|        return (size_t)MEM_readLE32(memPtr);
  370|    255|    else
  371|    255|        return (size_t)MEM_readLE64(memPtr);
  372|    255|}
zstd_v07.c:FSEv07_initDState:
  818|     76|{
  819|     76|    const void* ptr = dt;
  820|     76|    const FSEv07_DTableHeader* const DTableH = (const FSEv07_DTableHeader*)ptr;
  821|     76|    DStatePtr->state = BITv07_readBits(bitD, DTableH->tableLog);
  822|     76|    BITv07_reloadDStream(bitD);
  823|     76|    DStatePtr->table = dt + 1;
  824|     76|}
zstd_v07.c:BITv07_readBits:
  557|    972|{
  558|    972|    size_t const value = BITv07_lookBits(bitD, nbBits);
  559|    972|    BITv07_skipBits(bitD, nbBits);
  560|    972|    return value;
  561|    972|}
zstd_v07.c:BITv07_lookBits:
  538|    972|{
  539|    972|    U32 const bitMask = sizeof(bitD->bitContainer)*8 - 1;
  540|    972|    return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask);
  541|    972|}
zstd_v07.c:BITv07_skipBits:
  552|  1.13k|{
  553|  1.13k|    bitD->bitsConsumed += nbBits;
  554|  1.13k|}
zstd_v07.c:BITv07_reloadDStream:
  573|    562|{
  574|    562|    if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8))  /* should not happen => corruption detected */
  ------------------
  |  Branch (574:9): [True: 11, False: 551]
  ------------------
  575|     11|        return BITv07_DStream_overflow;
  576|       |
  577|    551|    if (bitD->ptr >= bitD->start + sizeof(bitD->bitContainer)) {
  ------------------
  |  Branch (577:9): [True: 16, False: 535]
  ------------------
  578|     16|        bitD->ptr -= bitD->bitsConsumed >> 3;
  579|     16|        bitD->bitsConsumed &= 7;
  580|     16|        bitD->bitContainer = MEM_readLEST(bitD->ptr);
  581|     16|        return BITv07_DStream_unfinished;
  582|     16|    }
  583|    535|    if (bitD->ptr == bitD->start) {
  ------------------
  |  Branch (583:9): [True: 327, False: 208]
  ------------------
  584|    327|        if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BITv07_DStream_endOfBuffer;
  ------------------
  |  Branch (584:13): [True: 323, False: 4]
  ------------------
  585|      4|        return BITv07_DStream_completed;
  586|    327|    }
  587|    208|    {   U32 nbBytes = bitD->bitsConsumed >> 3;
  588|    208|        BITv07_DStream_status result = BITv07_DStream_unfinished;
  589|    208|        if (bitD->ptr - nbBytes < bitD->start) {
  ------------------
  |  Branch (589:13): [True: 11, False: 197]
  ------------------
  590|     11|            nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */
  591|     11|            result = BITv07_DStream_endOfBuffer;
  592|     11|        }
  593|    208|        bitD->ptr -= nbBytes;
  594|    208|        bitD->bitsConsumed -= nbBytes*8;
  595|    208|        bitD->bitContainer = MEM_readLEST(bitD->ptr);   /* reminder : srcSize > sizeof(bitD) */
  596|    208|        return result;
  597|    535|    }
  598|    535|}
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|     44|{
 2578|     44|    void* address = malloc(size);
 2579|     44|    (void)opaque;
 2580|       |    /* printf("alloc %p, %d opaque=%p \n", address, (int)size, opaque); */
 2581|     44|    return address;
 2582|     44|}
zstd_v07.c:ZSTDv07_defaultFreeFunction:
 2585|     44|{
 2586|     44|    (void)opaque;
 2587|       |    /* if (address) printf("free %p opaque=%p \n", address, opaque); */
 2588|     44|    free(address);
 2589|     44|}
zstd_v07.c:ZSTDv07_frameHeaderSize:
 3078|    143|{
 3079|    143|    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: 143]
  ------------------
 3080|    143|    {   BYTE const fhd = ((const BYTE*)src)[4];
 3081|    143|        U32 const dictID= fhd & 3;
 3082|    143|        U32 const directMode = (fhd >> 5) & 1;
 3083|    143|        U32 const fcsId = fhd >> 6;
 3084|    143|        return ZSTDv07_frameHeaderSize_min + !directMode + ZSTDv07_did_fieldSize[dictID] + ZSTDv07_fcs_fieldSize[fcsId]
 3085|    143|                + (directMode && !ZSTDv07_fcs_fieldSize[fcsId]);
  ------------------
  |  Branch (3085:20): [True: 25, False: 118]
  |  Branch (3085:34): [True: 8, False: 17]
  ------------------
 3086|    143|    }
 3087|    143|}
zstd_v07.c:MEM_32bits:
  264|    775|MEM_STATIC unsigned MEM_32bits(void) { return sizeof(size_t)==4; }
zstd_v07.c:MEM_readLE16:
  329|     10|{
  330|     10|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (330:9): [True: 10, False: 0]
  ------------------
  331|     10|        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|     10|}
zstd_v07.c:MEM_read16:
  274|     10|{
  275|     10|    U16 val; memcpy(&val, memPtr, sizeof(val)); return val;
  276|     10|}
zstd_v07.c:MEM_readLE64:
  359|    260|{
  360|    260|    if (MEM_isLittleEndian())
  ------------------
  |  Branch (360:9): [True: 260, False: 0]
  ------------------
  361|    260|        return MEM_read64(memPtr);
  362|      0|    else
  363|      0|        return MEM_swap64(MEM_read64(memPtr));
  364|    260|}
zstd_v07.c:MEM_read64:
  284|    260|{
  285|    260|    U64 val; memcpy(&val, memPtr, sizeof(val)); return val;
  286|    260|}
zstd_v07.c:ZSTDv07_checkContinuity:
 3678|     44|{
 3679|     44|    if (dst != dctx->previousDstEnd) {   /* not contiguous */
  ------------------
  |  Branch (3679:9): [True: 44, False: 0]
  ------------------
 3680|     44|        dctx->dictEnd = dctx->previousDstEnd;
 3681|     44|        dctx->vBase = (const char*)dst - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 3682|     44|        dctx->base = dst;
 3683|     44|        dctx->previousDstEnd = dst;
 3684|     44|    }
 3685|     44|}
zstd_v07.c:ZSTDv07_decompressBlock_internal:
 3691|     34|{   /* blockType == blockCompressed */
 3692|     34|    const BYTE* ip = (const BYTE*)src;
 3693|       |
 3694|     34|    if (srcSize >= ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) return ERROR(srcSize_wrong);
  ------------------
  |  |  175|     34|#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: 34]
  ------------------
 3695|       |
 3696|       |    /* Decode literals sub-block */
 3697|     34|    {   size_t const litCSize = ZSTDv07_decodeLiteralsBlock(dctx, src, srcSize);
 3698|     34|        if (ZSTDv07_isError(litCSize)) return litCSize;
  ------------------
  |  | 2856|     34|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3698:13): [True: 11, False: 23]
  ------------------
 3699|     23|        ip += litCSize;
 3700|     23|        srcSize -= litCSize;
 3701|     23|    }
 3702|      0|    return ZSTDv07_decompressSequences(dctx, dst, dstCapacity, ip, srcSize);
 3703|     34|}
zstd_v07.c:ZSTDv07_decodeLiteralsBlock:
 3231|     34|{
 3232|     34|    const BYTE* const istart = (const BYTE*) src;
 3233|       |
 3234|     34|    if (srcSize < MIN_CBLOCK_SIZE) return ERROR(corruption_detected);
  ------------------
  |  | 2663|     34|#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */ + MIN_SEQUENCES_SIZE /* nbSeq==0 */)   /* for a non-null block */
  |  |  ------------------
  |  |  |  | 2662|     34|#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: 29]
  ------------------
 3235|       |
 3236|     29|    switch((litBlockType_t)(istart[0]>> 6))
 3237|     29|    {
 3238|      3|    case lbt_huffman:
  ------------------
  |  Branch (3238:5): [True: 3, False: 26]
  ------------------
 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: 26]
  ------------------
 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: 29]
  ------------------
 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|     23|    case lbt_rle:
  ------------------
  |  Branch (3330:5): [True: 23, False: 6]
  ------------------
 3331|     23|        {   size_t litSize;
 3332|     23|            U32 lhSize = ((istart[0]) >> 4) & 3;
 3333|     23|            switch(lhSize)
 3334|     23|            {
 3335|      1|            case 0: case 1: default:   /* note : default is impossible, since lhSize into [0..3] */
  ------------------
  |  Branch (3335:13): [True: 1, False: 22]
  |  Branch (3335:21): [True: 0, False: 23]
  |  Branch (3335:29): [True: 0, False: 23]
  ------------------
 3336|      1|                lhSize = 1;
 3337|      1|                litSize = istart[0] & 31;
 3338|      1|                break;
 3339|     22|            case 2:
  ------------------
  |  Branch (3339:13): [True: 22, False: 1]
  ------------------
 3340|     22|                litSize = ((istart[0] & 15) << 8) + istart[1];
 3341|     22|                break;
 3342|      0|            case 3:
  ------------------
  |  Branch (3342:13): [True: 0, False: 23]
  ------------------
 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|     23|            }
 3347|     23|            if (litSize > ZSTDv07_BLOCKSIZE_ABSOLUTEMAX) return ERROR(corruption_detected);
  ------------------
  |  |  175|     23|#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: 23]
  ------------------
 3348|     23|            memset(dctx->litBuffer, istart[lhSize], litSize + WILDCOPY_OVERLENGTH);
  ------------------
  |  | 2721|     23|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3349|     23|            dctx->litPtr = dctx->litBuffer;
 3350|     23|            dctx->litSize = litSize;
 3351|     23|            return lhSize+1;
 3352|     23|        }
 3353|      0|    default:
  ------------------
  |  Branch (3353:5): [True: 0, False: 29]
  ------------------
 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|     29|    }
 3356|     29|}
zstd_v07.c:ZSTDv07_decompressSequences:
 3616|     23|{
 3617|     23|    const BYTE* ip = (const BYTE*)seqStart;
 3618|     23|    const BYTE* const iend = ip + seqSize;
 3619|     23|    BYTE* const ostart = (BYTE*)dst;
 3620|     23|    BYTE* const oend = ostart + maxDstSize;
 3621|     23|    BYTE* op = ostart;
 3622|     23|    const BYTE* litPtr = dctx->litPtr;
 3623|     23|    const BYTE* const litEnd = litPtr + dctx->litSize;
 3624|     23|    FSEv07_DTable* DTableLL = dctx->LLTable;
 3625|     23|    FSEv07_DTable* DTableML = dctx->MLTable;
 3626|     23|    FSEv07_DTable* DTableOffb = dctx->OffTable;
 3627|     23|    const BYTE* const base = (const BYTE*) (dctx->base);
 3628|     23|    const BYTE* const vBase = (const BYTE*) (dctx->vBase);
 3629|     23|    const BYTE* const dictEnd = (const BYTE*) (dctx->dictEnd);
 3630|     23|    int nbSeq;
 3631|       |
 3632|       |    /* Build Decoding Tables */
 3633|     23|    {   size_t const seqHSize = ZSTDv07_decodeSeqHeaders(&nbSeq, DTableLL, DTableML, DTableOffb, dctx->fseEntropy, ip, seqSize);
 3634|     23|        if (ZSTDv07_isError(seqHSize)) return seqHSize;
  ------------------
  |  | 2856|     23|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3634:13): [True: 0, False: 23]
  ------------------
 3635|     23|        ip += seqHSize;
 3636|     23|    }
 3637|       |
 3638|       |    /* Regen sequences */
 3639|     23|    if (nbSeq) {
  ------------------
  |  Branch (3639:9): [True: 22, False: 1]
  ------------------
 3640|     22|        seqState_t seqState;
 3641|     22|        dctx->fseEntropy = 1;
 3642|     88|        { U32 i; for (i=0; i<ZSTDv07_REP_INIT; i++) seqState.prevOffset[i] = dctx->rep[i]; }
  ------------------
  |  | 2639|     88|#define ZSTDv07_REP_INIT   ZSTDv07_REP_NUM
  |  |  ------------------
  |  |  |  | 2638|     88|#define ZSTDv07_REP_NUM    3
  |  |  ------------------
  ------------------
  |  Branch (3642:28): [True: 66, False: 22]
  ------------------
 3643|     22|        { size_t const errorCode = BITv07_initDStream(&(seqState.DStream), ip, iend-ip);
 3644|     22|          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: 22]
  ------------------
 3645|     22|        FSEv07_initDState(&(seqState.stateLL), &(seqState.DStream), DTableLL);
 3646|     22|        FSEv07_initDState(&(seqState.stateOffb), &(seqState.DStream), DTableOffb);
 3647|     22|        FSEv07_initDState(&(seqState.stateML), &(seqState.DStream), DTableML);
 3648|       |
 3649|    132|        for ( ; (BITv07_reloadDStream(&(seqState.DStream)) <= BITv07_DStream_completed) && nbSeq ; ) {
  ------------------
  |  Branch (3649:17): [True: 129, False: 3]
  |  Branch (3649:92): [True: 128, False: 1]
  ------------------
 3650|    128|            nbSeq--;
 3651|    128|            {   seq_t const sequence = ZSTDv07_decodeSequence(&seqState);
 3652|    128|                size_t const oneSeqSize = ZSTDv07_execSequence(op, oend, sequence, &litPtr, litEnd, base, vBase, dictEnd);
 3653|    128|                if (ZSTDv07_isError(oneSeqSize)) return oneSeqSize;
  ------------------
  |  | 2856|    128|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3653:21): [True: 18, False: 110]
  ------------------
 3654|    110|                op += oneSeqSize;
 3655|    110|        }   }
 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|     23|{
 3397|     23|    const BYTE* const istart = (const BYTE*)src;
 3398|     23|    const BYTE* const iend = istart + srcSize;
 3399|     23|    const BYTE* ip = istart;
 3400|       |
 3401|       |    /* check */
 3402|     23|    if (srcSize < MIN_SEQUENCES_SIZE) return ERROR(srcSize_wrong);
  ------------------
  |  | 2662|     23|#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: 23]
  ------------------
 3403|       |
 3404|       |    /* SeqHead */
 3405|     23|    {   int nbSeq = *ip++;
 3406|     23|        if (!nbSeq) { *nbSeqPtr=0; return 1; }
  ------------------
  |  Branch (3406:13): [True: 1, False: 22]
  ------------------
 3407|     22|        if (nbSeq > 0x7F) {
  ------------------
  |  Branch (3407:13): [True: 18, False: 4]
  ------------------
 3408|     18|            if (nbSeq == 0xFF) {
  ------------------
  |  Branch (3408:17): [True: 5, False: 13]
  ------------------
 3409|      5|                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: 5]
  ------------------
 3410|      5|                nbSeq = MEM_readLE16(ip) + LONGNBSEQ, ip+=2;
  ------------------
  |  | 2668|      5|#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|     18|        }
 3416|     22|        *nbSeqPtr = nbSeq;
 3417|     22|    }
 3418|       |
 3419|       |    /* FSE table descriptors */
 3420|     22|    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: 22]
  ------------------
 3421|     22|    {   U32 const LLtype  = *ip >> 6;
 3422|     22|        U32 const OFtype = (*ip >> 4) & 3;
 3423|     22|        U32 const MLtype  = (*ip >> 2) & 3;
 3424|     22|        ip++;
 3425|       |
 3426|       |        /* Build DTables */
 3427|     22|        {   size_t const llhSize = ZSTDv07_buildSeqTable(DTableLL, LLtype, MaxLL, LLFSELog, ip, iend-ip, LL_defaultNorm, LL_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2676|     22|#define MaxLL  35
  ------------------
                      {   size_t const llhSize = ZSTDv07_buildSeqTable(DTableLL, LLtype, MaxLL, LLFSELog, ip, iend-ip, LL_defaultNorm, LL_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2680|     22|#define LLFSELog    9
  ------------------
 3428|     22|            if (ZSTDv07_isError(llhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2856|     22|#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: 22]
  ------------------
 3429|     22|            ip += llhSize;
 3430|     22|        }
 3431|     22|        {   size_t const ofhSize = ZSTDv07_buildSeqTable(DTableOffb, OFtype, MaxOff, OffFSELog, ip, iend-ip, OF_defaultNorm, OF_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2677|     22|#define MaxOff 28
  ------------------
                      {   size_t const ofhSize = ZSTDv07_buildSeqTable(DTableOffb, OFtype, MaxOff, OffFSELog, ip, iend-ip, OF_defaultNorm, OF_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2681|     22|#define OffFSELog   8
  ------------------
 3432|     22|            if (ZSTDv07_isError(ofhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2856|     22|#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: 22]
  ------------------
 3433|     22|            ip += ofhSize;
 3434|     22|        }
 3435|     22|        {   size_t const mlhSize = ZSTDv07_buildSeqTable(DTableML, MLtype, MaxML, MLFSELog, ip, iend-ip, ML_defaultNorm, ML_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2675|     22|#define MaxML  52
  ------------------
                      {   size_t const mlhSize = ZSTDv07_buildSeqTable(DTableML, MLtype, MaxML, MLFSELog, ip, iend-ip, ML_defaultNorm, ML_defaultNormLog, flagRepeatTable);
  ------------------
  |  | 2679|     22|#define MLFSELog    9
  ------------------
 3436|     22|            if (ZSTDv07_isError(mlhSize)) return ERROR(corruption_detected);
  ------------------
  |  | 2856|     22|#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: 22]
  ------------------
 3437|     22|            ip += mlhSize;
 3438|     22|    }   }
 3439|       |
 3440|      0|    return ip-istart;
 3441|     22|}
zstd_v07.c:ZSTDv07_buildSeqTable:
 3366|     66|{
 3367|     66|    switch(type)
 3368|     66|    {
 3369|     19|    case FSEv07_ENCODING_RLE :
  ------------------
  |  | 2684|     19|#define FSEv07_ENCODING_RLE     1
  ------------------
  |  Branch (3369:5): [True: 19, False: 47]
  ------------------
 3370|     19|        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: 19]
  ------------------
 3371|     19|        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: 19]
  ------------------
 3372|     19|        FSEv07_buildDTable_rle(DTable, *(const BYTE*)src);   /* if *src > max, data is corrupted */
 3373|     19|        return 1;
 3374|     33|    case FSEv07_ENCODING_RAW :
  ------------------
  |  | 2683|     33|#define FSEv07_ENCODING_RAW     0
  ------------------
  |  Branch (3374:5): [True: 33, False: 33]
  ------------------
 3375|     33|        FSEv07_buildDTable(DTable, defaultNorm, max, defaultLog);
 3376|     33|        return 0;
 3377|      0|    case FSEv07_ENCODING_STATIC:
  ------------------
  |  | 2685|      0|#define FSEv07_ENCODING_STATIC  2
  ------------------
  |  Branch (3377:5): [True: 0, False: 66]
  ------------------
 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: 66]
  ------------------
 3381|     14|    case FSEv07_ENCODING_DYNAMIC :
  ------------------
  |  | 2686|     14|#define FSEv07_ENCODING_DYNAMIC 3
  ------------------
  |  Branch (3381:5): [True: 14, False: 52]
  ------------------
 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|     66|}
zstd_v07.c:ZSTDv07_decodeSequence:
 3460|    128|{
 3461|    128|    seq_t seq;
 3462|       |
 3463|    128|    U32 const llCode = FSEv07_peekSymbol(&(seqState->stateLL));
 3464|    128|    U32 const mlCode = FSEv07_peekSymbol(&(seqState->stateML));
 3465|    128|    U32 const ofCode = FSEv07_peekSymbol(&(seqState->stateOffb));   /* <= maxOff, by table construction */
 3466|       |
 3467|    128|    U32 const llBits = LL_bits[llCode];
 3468|    128|    U32 const mlBits = ML_bits[mlCode];
 3469|    128|    U32 const ofBits = ofCode;
 3470|    128|    U32 const totalBits = llBits+mlBits+ofBits;
 3471|       |
 3472|    128|    static const U32 LL_base[MaxLL+1] = {
 3473|    128|                             0,  1,  2,  3,  4,  5,  6,  7,  8,  9,   10,    11,    12,    13,    14,     15,
 3474|    128|                            16, 18, 20, 22, 24, 28, 32, 40, 48, 64, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000,
 3475|    128|                            0x2000, 0x4000, 0x8000, 0x10000 };
 3476|       |
 3477|    128|    static const U32 ML_base[MaxML+1] = {
 3478|    128|                             3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13,   14,    15,    16,    17,    18,
 3479|    128|                            19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,   30,    31,    32,    33,    34,
 3480|    128|                            35, 37, 39, 41, 43, 47, 51, 59, 67, 83, 99, 0x83, 0x103, 0x203, 0x403, 0x803,
 3481|    128|                            0x1003, 0x2003, 0x4003, 0x8003, 0x10003 };
 3482|       |
 3483|    128|    static const U32 OF_base[MaxOff+1] = {
 3484|    128|                 0,        1,       1,       5,     0xD,     0x1D,     0x3D,     0x7D,
 3485|    128|                 0xFD,   0x1FD,   0x3FD,   0x7FD,   0xFFD,   0x1FFD,   0x3FFD,   0x7FFD,
 3486|    128|                 0xFFFD, 0x1FFFD, 0x3FFFD, 0x7FFFD, 0xFFFFD, 0x1FFFFD, 0x3FFFFD, 0x7FFFFD,
 3487|    128|                 0xFFFFFD, 0x1FFFFFD, 0x3FFFFFD, 0x7FFFFFD, 0xFFFFFFD };
 3488|       |
 3489|       |    /* sequence */
 3490|    128|    {   size_t offset;
 3491|    128|        if (!ofCode)
  ------------------
  |  Branch (3491:13): [True: 84, False: 44]
  ------------------
 3492|     84|            offset = 0;
 3493|     44|        else {
 3494|     44|            offset = OF_base[ofCode] + BITv07_readBits(&(seqState->DStream), ofBits);   /* <=  (ZSTDv07_WINDOWLOG_MAX-1) bits */
 3495|     44|            if (MEM_32bits()) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3495:17): [True: 0, False: 44]
  ------------------
 3496|     44|        }
 3497|       |
 3498|    128|        if (ofCode <= 1) {
  ------------------
  |  Branch (3498:13): [True: 89, False: 39]
  ------------------
 3499|     89|            if ((llCode == 0) & (offset <= 1)) offset = 1-offset;
  ------------------
  |  Branch (3499:17): [True: 53, False: 36]
  ------------------
 3500|     89|            if (offset) {
  ------------------
  |  Branch (3500:17): [True: 56, False: 33]
  ------------------
 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|     33|                offset = seqState->prevOffset[0];
 3507|     33|            }
 3508|     89|        } else {
 3509|     39|            seqState->prevOffset[2] = seqState->prevOffset[1];
 3510|     39|            seqState->prevOffset[1] = seqState->prevOffset[0];
 3511|     39|            seqState->prevOffset[0] = offset;
 3512|     39|        }
 3513|    128|        seq.offset = offset;
 3514|    128|    }
 3515|       |
 3516|    128|    seq.matchLength = ML_base[mlCode] + ((mlCode>31) ? BITv07_readBits(&(seqState->DStream), mlBits) : 0);   /* <=  16 bits */
  ------------------
  |  Branch (3516:42): [True: 79, False: 49]
  ------------------
 3517|    128|    if (MEM_32bits() && (mlBits+llBits>24)) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  Branch (3517:9): [True: 0, False: 128]
  |  Branch (3517:25): [True: 0, False: 0]
  ------------------
 3518|       |
 3519|    128|    seq.litLength = LL_base[llCode] + ((llCode>15) ? BITv07_readBits(&(seqState->DStream), llBits) : 0);   /* <=  16 bits */
  ------------------
  |  Branch (3519:40): [True: 38, False: 90]
  ------------------
 3520|    128|    if (MEM_32bits() ||
  ------------------
  |  Branch (3520:9): [True: 0, False: 128]
  ------------------
 3521|    128|       (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  | 2680|    128|#define LLFSELog    9
  ------------------
                     (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  | 2679|    128|#define MLFSELog    9
  ------------------
                     (totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BITv07_reloadDStream(&(seqState->DStream));
  ------------------
  |  | 2681|    128|#define OffFSELog   8
  ------------------
  |  Branch (3521:8): [True: 3, False: 125]
  ------------------
 3522|       |
 3523|       |    /* ANS state update */
 3524|    128|    FSEv07_updateState(&(seqState->stateLL), &(seqState->DStream));   /* <=  9 bits */
 3525|    128|    FSEv07_updateState(&(seqState->stateML), &(seqState->DStream));   /* <=  9 bits */
 3526|    128|    if (MEM_32bits()) BITv07_reloadDStream(&(seqState->DStream));     /* <= 18 bits */
  ------------------
  |  Branch (3526:9): [True: 0, False: 128]
  ------------------
 3527|    128|    FSEv07_updateState(&(seqState->stateOffb), &(seqState->DStream)); /* <=  8 bits */
 3528|       |
 3529|    128|    return seq;
 3530|    128|}
zstd_v07.c:FSEv07_peekSymbol:
  827|    384|{
  828|    384|    FSEv07_decode_t const DInfo = ((const FSEv07_decode_t*)(DStatePtr->table))[DStatePtr->state];
  829|    384|    return DInfo.symbol;
  830|    384|}
zstd_v07.c:FSEv07_updateState:
  833|    384|{
  834|    384|    FSEv07_decode_t const DInfo = ((const FSEv07_decode_t*)(DStatePtr->table))[DStatePtr->state];
  835|    384|    U32 const nbBits = DInfo.nbBits;
  836|    384|    size_t const lowBits = BITv07_readBits(bitD, nbBits);
  837|    384|    DStatePtr->state = DInfo.newState + lowBits;
  838|    384|}
zstd_v07.c:ZSTDv07_execSequence:
 3538|    128|{
 3539|    128|    BYTE* const oLitEnd = op + sequence.litLength;
 3540|    128|    size_t const sequenceLength = sequence.litLength + sequence.matchLength;
 3541|    128|    BYTE* const oMatchEnd = op + sequenceLength;   /* risk : address space overflow (32-bits) */
 3542|    128|    BYTE* const oend_w = oend-WILDCOPY_OVERLENGTH;
  ------------------
  |  | 2721|    128|#define WILDCOPY_OVERLENGTH 8
  ------------------
 3543|    128|    const BYTE* const iLitEnd = *litPtr + sequence.litLength;
 3544|    128|    const BYTE* match = oLitEnd - sequence.offset;
 3545|       |
 3546|       |    /* check */
 3547|    128|    assert(oend >= op);
  ------------------
  |  |   70|    128|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 3548|    128|    if (sequence.litLength + WILDCOPY_OVERLENGTH > (size_t)(oend - op)) return ERROR(dstSize_tooSmall);
  ------------------
  |  | 2721|    128|#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: 120]
  ------------------
 3549|    120|    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: 113]
  ------------------
 3550|    113|    assert(litLimit >= *litPtr);
  ------------------
  |  |   70|    113|#    define assert(condition) ((void)0)   /* disable assert (default) */
  ------------------
 3551|    113|    if (sequence.litLength > (size_t)(litLimit - *litPtr)) 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 (3551:9): [True: 3, False: 110]
  ------------------
 3552|       |
 3553|       |    /* copy Literals */
 3554|    110|    ZSTDv07_wildcopy(op, *litPtr, (ptrdiff_t)sequence.litLength);   /* note : since oLitEnd <= oend-WILDCOPY_OVERLENGTH, no risk of overwrite beyond oend */
 3555|    110|    op = oLitEnd;
 3556|    110|    *litPtr = iLitEnd;   /* update for next sequence */
 3557|       |
 3558|       |    /* copy Match */
 3559|    110|    if (sequence.offset > (size_t)(oLitEnd - base)) {
  ------------------
  |  Branch (3559:9): [True: 16, False: 94]
  ------------------
 3560|       |        /* offset beyond prefix */
 3561|     16|        if (sequence.offset > (size_t)(oLitEnd - vBase)) 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 (3561:13): [True: 0, False: 16]
  ------------------
 3562|     16|        match = dictEnd - (base-match);
 3563|     16|        if (match + sequence.matchLength <= dictEnd) {
  ------------------
  |  Branch (3563:13): [True: 11, False: 5]
  ------------------
 3564|     11|            memmove(oLitEnd, match, sequence.matchLength);
 3565|     11|            return sequenceLength;
 3566|     11|        }
 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|     99|    if (sequence.offset < 8) {
  ------------------
  |  Branch (3581:9): [True: 83, False: 16]
  ------------------
 3582|       |        /* close range match, overlap */
 3583|     83|        static const U32 dec32table[] = { 0, 1, 2, 1, 4, 4, 4, 4 };   /* added */
 3584|     83|        static const int dec64table[] = { 8, 8, 8, 7, 8, 9,10,11 };   /* subtracted */
 3585|     83|        int const sub2 = dec64table[sequence.offset];
 3586|     83|        op[0] = match[0];
 3587|     83|        op[1] = match[1];
 3588|     83|        op[2] = match[2];
 3589|     83|        op[3] = match[3];
 3590|     83|        match += dec32table[sequence.offset];
 3591|     83|        ZSTDv07_copy4(op+4, match);
 3592|     83|        match -= sub2;
 3593|     83|    } else {
 3594|     16|        ZSTDv07_copy8(op, match);
 3595|     16|    }
 3596|     99|    op += 8; match += 8;
 3597|       |
 3598|     99|    if (oMatchEnd > oend-(16-MINMATCH)) {
  ------------------
  |  | 2670|     99|#define MINMATCH 3
  ------------------
  |  Branch (3598:9): [True: 8, False: 91]
  ------------------
 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|     91|    } else {
 3606|     91|        ZSTDv07_wildcopy(op, match, (ptrdiff_t)sequence.matchLength-8);   /* works even if matchLength < 8 */
 3607|     91|    }
 3608|     99|    return sequenceLength;
 3609|    110|}
zstd_v07.c:ZSTDv07_wildcopy:
 2723|    205|{
 2724|    205|    const BYTE* ip = (const BYTE*)src;
 2725|    205|    BYTE* op = (BYTE*)dst;
 2726|    205|    BYTE* const oend = op + length;
 2727|    205|    do
 2728|  7.68k|        COPY8(op, ip)
  ------------------
  |  | 2717|  7.68k|#define COPY8(d,s) { ZSTDv07_copy8(d,s); d+=8; s+=8; }
  ------------------
 2729|  7.68k|    while (op < oend);
  ------------------
  |  Branch (2729:12): [True: 7.48k, False: 205]
  ------------------
 2730|    205|}
zstd_v07.c:ZSTDv07_copy4:
 2864|     83|static void ZSTDv07_copy4(void* dst, const void* src) { memcpy(dst, src, 4); }
zstd_v07.c:ZSTDv07_copy8:
 2716|  7.70k|static void ZSTDv07_copy8(void* dst, const void* src) { memcpy(dst, src, 8); }
zstd_v07.c:ZSTDv07_decompressFrame:
 3743|     44|{
 3744|     44|    const BYTE* ip = (const BYTE*)src;
 3745|     44|    const BYTE* const iend = ip + srcSize;
 3746|     44|    BYTE* const ostart = (BYTE*)dst;
 3747|     44|    BYTE* const oend = ostart + dstCapacity;
 3748|     44|    BYTE* op = ostart;
 3749|     44|    size_t remainingSize = srcSize;
 3750|       |
 3751|       |    /* check */
 3752|     44|    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: 44]
  ------------------
 3753|       |
 3754|       |    /* Frame Header */
 3755|     44|    {   size_t const frameHeaderSize = ZSTDv07_frameHeaderSize(src, ZSTDv07_frameHeaderSize_min);
 3756|     44|        if (ZSTDv07_isError(frameHeaderSize)) return frameHeaderSize;
  ------------------
  |  | 2856|     44|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3756:13): [True: 0, False: 44]
  ------------------
 3757|     44|        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: 44]
  ------------------
 3758|     44|        if (ZSTDv07_decodeFrameHeader(dctx, src, frameHeaderSize)) return ERROR(corruption_detected);
  ------------------
  |  |   49|      6|#define ERROR(name) ZSTD_ERROR(name)
  |  |  ------------------
  |  |  |  |   50|      6|#define ZSTD_ERROR(name) ((size_t)-PREFIX(name))
  |  |  |  |  ------------------
  |  |  |  |  |  |   42|      6|#define PREFIX(name) ZSTD_error_##name
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3758:13): [True: 6, False: 38]
  ------------------
 3759|     38|        ip += frameHeaderSize; remainingSize -= frameHeaderSize;
 3760|     38|    }
 3761|       |
 3762|       |    /* Loop on each block */
 3763|     40|    while (1) {
  ------------------
  |  Branch (3763:12): [True: 40, Folded]
  ------------------
 3764|     40|        size_t decodedSize;
 3765|     40|        blockProperties_t blockProperties;
 3766|     40|        size_t const cBlockSize = ZSTDv07_getcBlockSize(ip, iend-ip, &blockProperties);
 3767|     40|        if (ZSTDv07_isError(cBlockSize)) return cBlockSize;
  ------------------
  |  | 2856|     40|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3767:13): [True: 0, False: 40]
  ------------------
 3768|       |
 3769|     40|        ip += ZSTDv07_blockHeaderSize;
 3770|     40|        remainingSize -= ZSTDv07_blockHeaderSize;
 3771|     40|        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: 40]
  ------------------
 3772|       |
 3773|     40|        switch(blockProperties.blockType)
 3774|     40|        {
 3775|     34|        case bt_compressed:
  ------------------
  |  Branch (3775:9): [True: 34, False: 6]
  ------------------
 3776|     34|            decodedSize = ZSTDv07_decompressBlock_internal(dctx, op, oend-op, ip, cBlockSize);
 3777|     34|            break;
 3778|      0|        case bt_raw :
  ------------------
  |  Branch (3778:9): [True: 0, False: 40]
  ------------------
 3779|      0|            decodedSize = ZSTDv07_copyRawBlock(op, oend-op, ip, cBlockSize);
 3780|      0|            break;
 3781|      0|        case bt_rle :
  ------------------
  |  Branch (3781:9): [True: 0, False: 40]
  ------------------
 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: 34]
  ------------------
 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: 40]
  ------------------
 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|     40|        }
 3792|     40|        if (blockProperties.blockType == bt_end) break;   /* bt_end */
  ------------------
  |  Branch (3792:13): [True: 6, False: 34]
  ------------------
 3793|       |
 3794|     34|        if (ZSTDv07_isError(decodedSize)) return decodedSize;
  ------------------
  |  | 2856|     34|#define ZSTDv07_isError ERR_isError   /* for inlining */
  ------------------
  |  Branch (3794:13): [True: 32, 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|     38|}
zstd_v07.c:ZSTD_errorFrameSizeInfoLegacy:
 3855|      5|{
 3856|      5|    *cSize = ret;
 3857|      5|    *dBound = ZSTD_CONTENTSIZE_ERROR;
  ------------------
  |  | 2688|      5|#define ZSTD_CONTENTSIZE_ERROR   (0ULL - 2)
  ------------------
 3858|      5|}
zstd_v07.c:ZSTDv07_getcBlockSize:
 3201|    489|{
 3202|    489|    const BYTE* const in = (const BYTE*)src;
 3203|    489|    U32 cSize;
 3204|       |
 3205|    489|    if (srcSize < ZSTDv07_blockHeaderSize) 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 (3205:9): [True: 1, False: 488]
  ------------------
 3206|       |
 3207|    488|    bpPtr->blockType = (blockType_t)((*in) >> 6);
 3208|    488|    cSize = in[2] + (in[1]<<8) + ((in[0] & 7)<<16);
 3209|    488|    bpPtr->origSize = (bpPtr->blockType == bt_rle) ? cSize : 0;
  ------------------
  |  Branch (3209:23): [True: 100, False: 388]
  ------------------
 3210|       |
 3211|    488|    if (bpPtr->blockType == bt_end) return 0;
  ------------------
  |  Branch (3211:9): [True: 50, False: 438]
  ------------------
 3212|    438|    if (bpPtr->blockType == bt_rle) return 1;
  ------------------
  |  Branch (3212:9): [True: 100, False: 338]
  ------------------
 3213|    338|    return cSize;
 3214|    438|}
zstd_v07.c:ZSTDv07_decodeFrameHeader:
 3184|     44|{
 3185|     44|    size_t const result = ZSTDv07_getFrameParams(&(dctx->fParams), src, srcSize);
 3186|     44|    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: 42]
  |  Branch (3186:33): [True: 2, False: 0]
  ------------------
 3187|     42|    if (dctx->fParams.checksumFlag) XXH64_reset(&dctx->xxhState, 0);
  ------------------
  |  |  459|     27|#  define XXH64_reset XXH_NAME2(XXH_NAMESPACE, XXH64_reset)
  |  |  ------------------
  |  |  |  |  443|     27|#  define XXH_NAME2(A,B) XXH_CAT(A,B)
  |  |  |  |  ------------------
  |  |  |  |  |  |  442|     27|#  define XXH_CAT(A,B) A##B
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3187:9): [True: 27, False: 15]
  ------------------
 3188|     42|    return result;
 3189|     44|}
zstd_v07.c:ZSTDv07_decompress_insertDictionary:
 4092|     21|{
 4093|     21|    if (dictSize < 8) return ZSTDv07_refDictContent(dctx, dict, dictSize);
  ------------------
  |  Branch (4093:9): [True: 0, False: 21]
  ------------------
 4094|     21|    {   U32 const magic = MEM_readLE32(dict);
 4095|     21|        if (magic != ZSTDv07_DICT_MAGIC) {
  ------------------
  |  | 2636|     21|#define ZSTDv07_DICT_MAGIC  0xEC30A437   /* v0.7 */
  ------------------
  |  Branch (4095:13): [True: 13, False: 8]
  ------------------
 4096|     13|            return ZSTDv07_refDictContent(dctx, dict, dictSize);   /* pure content mode */
 4097|     13|    }   }
 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|     21|{
 4034|     21|    dctx->dictEnd = dctx->previousDstEnd;
 4035|     21|    dctx->vBase = (const char*)dict - ((const char*)(dctx->previousDstEnd) - (const char*)(dctx->base));
 4036|     21|    dctx->base = dict;
 4037|     21|    dctx->previousDstEnd = (const char*)dict + dictSize;
 4038|     21|    return 0;
 4039|     21|}
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.71k|                                    const size_t elem_size) {
  118|       |
  119|  2.71k|  size_t hh, ii, jj, kk, mm;
  120|  2.71k|  const char* in_b = (const char*) in;
  121|  2.71k|  char* out_b = (char*) out;
  122|       |
  123|  2.71k|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|  2.71k|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 2.71k]
  |  |  ------------------
  ------------------
  124|       |
  125|  2.71k|  size_t nrows = 8 * elem_size;
  126|  2.71k|  size_t nbyte_row = size / 8;
  127|       |
  128|  2.71k|  if (elem_size % 4) return bshuf_trans_byte_bitrow_SSE(in, out, size,
  ------------------
  |  Branch (128:7): [True: 2.16k, False: 546]
  ------------------
  129|  2.16k|                                                        elem_size);
  130|       |
  131|    546|  __m256i ymm_0[8];
  132|    546|  __m256i ymm_1[8];
  133|    546|  __m256i ymm_storeage[8][4];
  134|       |
  135|  7.77k|  for (jj = 0; jj + 31 < nbyte_row; jj += 32) {
  ------------------
  |  Branch (135:16): [True: 7.23k, False: 546]
  ------------------
  136|  19.7k|    for (ii = 0; ii + 3 < elem_size; ii += 4) {
  ------------------
  |  Branch (136:18): [True: 12.5k, False: 7.23k]
  ------------------
  137|  62.6k|      for (hh = 0; hh < 4; hh ++) {
  ------------------
  |  Branch (137:20): [True: 50.1k, False: 12.5k]
  ------------------
  138|       |
  139|   451k|        for (kk = 0; kk < 8; kk ++){
  ------------------
  |  Branch (139:22): [True: 401k, False: 50.1k]
  ------------------
  140|   401k|          ymm_0[kk] = _mm256_loadu_si256((__m256i *) &in_b[
  141|   401k|              (ii * 8 + hh * 8 + kk) * nbyte_row + jj]);
  142|   401k|        }
  143|       |
  144|   250k|        for (kk = 0; kk < 4; kk ++){
  ------------------
  |  Branch (144:22): [True: 200k, False: 50.1k]
  ------------------
  145|   200k|          ymm_1[kk] = _mm256_unpacklo_epi8(ymm_0[kk * 2],
  146|   200k|                                           ymm_0[kk * 2 + 1]);
  147|   200k|          ymm_1[kk + 4] = _mm256_unpackhi_epi8(ymm_0[kk * 2],
  148|   200k|                                               ymm_0[kk * 2 + 1]);
  149|   200k|        }
  150|       |
  151|   150k|        for (kk = 0; kk < 2; kk ++){
  ------------------
  |  Branch (151:22): [True: 100k, False: 50.1k]
  ------------------
  152|   300k|          for (mm = 0; mm < 2; mm ++){
  ------------------
  |  Branch (152:24): [True: 200k, False: 100k]
  ------------------
  153|   200k|            ymm_0[kk * 4 + mm] = _mm256_unpacklo_epi16(
  154|   200k|                ymm_1[kk * 4 + mm * 2],
  155|   200k|                ymm_1[kk * 4 + mm * 2 + 1]);
  156|   200k|            ymm_0[kk * 4 + mm + 2] = _mm256_unpackhi_epi16(
  157|   200k|                ymm_1[kk * 4 + mm * 2],
  158|   200k|                ymm_1[kk * 4 + mm * 2 + 1]);
  159|   200k|          }
  160|   100k|        }
  161|       |
  162|   250k|        for (kk = 0; kk < 4; kk ++){
  ------------------
  |  Branch (162:22): [True: 200k, False: 50.1k]
  ------------------
  163|   200k|          ymm_1[kk * 2] = _mm256_unpacklo_epi32(ymm_0[kk * 2],
  164|   200k|                                                ymm_0[kk * 2 + 1]);
  165|   200k|          ymm_1[kk * 2 + 1] = _mm256_unpackhi_epi32(ymm_0[kk * 2],
  166|   200k|                                                    ymm_0[kk * 2 + 1]);
  167|   200k|        }
  168|       |
  169|   451k|        for (kk = 0; kk < 8; kk ++){
  ------------------
  |  Branch (169:22): [True: 401k, False: 50.1k]
  ------------------
  170|   401k|          ymm_storeage[kk][hh] = ymm_1[kk];
  171|   401k|        }
  172|  50.1k|      }
  173|       |
  174|   112k|      for (mm = 0; mm < 8; mm ++) {
  ------------------
  |  Branch (174:20): [True: 100k, False: 12.5k]
  ------------------
  175|       |
  176|   501k|        for (kk = 0; kk < 4; kk ++){
  ------------------
  |  Branch (176:22): [True: 401k, False: 100k]
  ------------------
  177|   401k|          ymm_0[kk] = ymm_storeage[mm][kk];
  178|   401k|        }
  179|       |
  180|   100k|        ymm_1[0] = _mm256_unpacklo_epi64(ymm_0[0], ymm_0[1]);
  181|   100k|        ymm_1[1] = _mm256_unpacklo_epi64(ymm_0[2], ymm_0[3]);
  182|   100k|        ymm_1[2] = _mm256_unpackhi_epi64(ymm_0[0], ymm_0[1]);
  183|   100k|        ymm_1[3] = _mm256_unpackhi_epi64(ymm_0[2], ymm_0[3]);
  184|       |
  185|   100k|        ymm_0[0] = _mm256_permute2x128_si256(ymm_1[0], ymm_1[1], 32);
  186|   100k|        ymm_0[1] = _mm256_permute2x128_si256(ymm_1[2], ymm_1[3], 32);
  187|   100k|        ymm_0[2] = _mm256_permute2x128_si256(ymm_1[0], ymm_1[1], 49);
  188|   100k|        ymm_0[3] = _mm256_permute2x128_si256(ymm_1[2], ymm_1[3], 49);
  189|       |
  190|   100k|        _mm256_storeu_si256((__m256i *) &out_b[
  191|   100k|            (jj + mm * 2 + 0 * 16) * nrows + ii * 8], ymm_0[0]);
  192|   100k|        _mm256_storeu_si256((__m256i *) &out_b[
  193|   100k|            (jj + mm * 2 + 0 * 16 + 1) * nrows + ii * 8], ymm_0[1]);
  194|   100k|        _mm256_storeu_si256((__m256i *) &out_b[
  195|   100k|            (jj + mm * 2 + 1 * 16) * nrows + ii * 8], ymm_0[2]);
  196|   100k|        _mm256_storeu_si256((__m256i *) &out_b[
  197|   100k|            (jj + mm * 2 + 1 * 16 + 1) * nrows + ii * 8], ymm_0[3]);
  198|   100k|      }
  199|  12.5k|    }
  200|  7.23k|  }
  201|   266k|  for (ii = 0; ii < nrows; ii ++ ) {
  ------------------
  |  Branch (201:16): [True: 265k, False: 546]
  ------------------
  202|   448k|    for (jj = nbyte_row - nbyte_row % 32; jj < nbyte_row; jj ++) {
  ------------------
  |  Branch (202:43): [True: 183k, False: 265k]
  ------------------
  203|   183k|      out_b[jj * nrows + ii] = in_b[ii * nbyte_row + jj];
  204|   183k|    }
  205|   265k|  }
  206|    546|  return size * elem_size;
  207|  2.71k|}
bshuf_shuffle_bit_eightelem_AVX:
  212|  2.71k|                                        const size_t elem_size) {
  213|       |
  214|  2.71k|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|  2.71k|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 2.71k]
  |  |  ------------------
  ------------------
  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.71k|  const char* in_b = (const char*) in;
  219|  2.71k|  char* out_b = (char*) out;
  220|       |
  221|  2.71k|  size_t ii, jj, kk;
  222|  2.71k|  size_t nbyte = elem_size * size;
  223|       |
  224|  2.71k|  __m256i ymm;
  225|  2.71k|  int32_t bt;
  226|       |
  227|  2.71k|  if (elem_size % 4) {
  ------------------
  |  Branch (227:7): [True: 2.16k, False: 546]
  ------------------
  228|  2.16k|    return bshuf_shuffle_bit_eightelem_SSE(in, out, size, elem_size);
  229|  2.16k|  } else {
  230|  8.84k|    for (jj = 0; jj + 31 < 8 * elem_size; jj += 32) {
  ------------------
  |  Branch (230:18): [True: 8.30k, False: 546]
  ------------------
  231|   415k|      for (ii = 0; ii + 8 * elem_size - 1 < nbyte;
  ------------------
  |  Branch (231:20): [True: 406k, False: 8.30k]
  ------------------
  232|   406k|           ii += 8 * elem_size) {
  233|   406k|        ymm = _mm256_loadu_si256((__m256i *) &in_b[ii + jj]);
  234|  3.66M|        for (kk = 0; kk < 8; kk++) {
  ------------------
  |  Branch (234:22): [True: 3.25M, False: 406k]
  ------------------
  235|  3.25M|          bt = _mm256_movemask_epi8(ymm);
  236|  3.25M|          ymm = _mm256_slli_epi16(ymm, 1);
  237|  3.25M|          size_t ind = (ii + jj / 8 + (7 - kk) * elem_size);
  238|  3.25M|          * (int32_t *) &out_b[ind] = bt;
  239|  3.25M|        }
  240|   406k|      }
  241|  8.30k|    }
  242|    546|  }
  243|    546|  return size * elem_size;
  244|  2.71k|}
bshuf_untrans_bit_elem_AVX:
  249|  2.71k|                                   const size_t elem_size) {
  250|       |
  251|  2.71k|  int64_t count;
  252|       |
  253|  2.71k|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|  2.71k|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 2.71k]
  |  |  ------------------
  ------------------
  254|       |
  255|  2.71k|  void* tmp_buf = malloc(size * elem_size);
  256|  2.71k|  if (tmp_buf == NULL) return -1;
  ------------------
  |  Branch (256:7): [True: 0, False: 2.71k]
  ------------------
  257|       |
  258|  2.71k|  count = bshuf_trans_byte_bitrow_AVX(in, tmp_buf, size, elem_size);
  259|  2.71k|  CHECK_ERR_FREE(count, tmp_buf);
  ------------------
  |  |   45|  2.71k|#define CHECK_ERR_FREE(count, buf) if (count < 0) { free(buf); return count; }
  |  |  ------------------
  |  |  |  Branch (45:40): [True: 0, False: 2.71k]
  |  |  ------------------
  ------------------
  260|  2.71k|  count =  bshuf_shuffle_bit_eightelem_AVX(tmp_buf, out, size, elem_size);
  261|       |
  262|  2.71k|  free(tmp_buf);
  263|  2.71k|  return count;
  264|  2.71k|}

bshuf_shuffle_bit_eightelem_scal:
  200|  1.49k|        const size_t size, const size_t elem_size) {
  201|       |
  202|  1.49k|  const char *in_b;
  203|  1.49k|  char *out_b;
  204|  1.49k|  uint64_t x, t;
  205|  1.49k|  size_t ii, jj, kk;
  206|  1.49k|  size_t nbyte, out_index;
  207|       |
  208|  1.49k|  uint64_t e=1;
  209|  1.49k|  const int little_endian = *(uint8_t *) &e == 1;
  210|  1.49k|  const size_t elem_skip = little_endian ? elem_size : -elem_size;
  ------------------
  |  Branch (210:28): [True: 1.49k, False: 0]
  ------------------
  211|  1.49k|  const uint64_t elem_offset = little_endian ? 0 : 7 * elem_size;
  ------------------
  |  Branch (211:32): [True: 1.49k, False: 0]
  ------------------
  212|       |
  213|  1.49k|  CHECK_MULT_EIGHT(size);
  ------------------
  |  |   35|  1.49k|#define CHECK_MULT_EIGHT(n) if (n % 8) return -80;
  |  |  ------------------
  |  |  |  Branch (35:33): [True: 0, False: 1.49k]
  |  |  ------------------
  ------------------
  214|       |
  215|  1.49k|  in_b = (const char*) in;
  216|  1.49k|  out_b = (char*) out;
  217|       |
  218|  1.49k|  nbyte = elem_size * size;
  219|       |
  220|  69.9k|  for (jj = 0; jj < 8 * elem_size; jj += 8) {
  ------------------
  |  Branch (220:16): [True: 68.4k, False: 1.49k]
  ------------------
  221|  1.23M|    for (ii = 0; ii + 8 * elem_size - 1 < nbyte; ii += 8 * elem_size) {
  ------------------
  |  Branch (221:18): [True: 1.17M, False: 68.4k]
  ------------------
  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|  68.4k|  }
  235|  1.49k|  return size * elem_size;
  236|  1.49k|}

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

blosc2.c:is_little_endian:
   42|   168k|static bool is_little_endian(void) {
   43|   168k|  static const int i = 1;
   44|   168k|  char* p = (char*)&i;
   45|       |
   46|   168k|  if (p[0] == 1) {
  ------------------
  |  Branch (46:7): [True: 168k, False: 0]
  ------------------
   47|   168k|    return true;
   48|   168k|  }
   49|      0|  else {
   50|       |    return false;
   51|      0|  }
   52|   168k|}
blosc2.c:sw32_:
  115|  18.4k|static inline int32_t sw32_(const void* pa) {
  116|  18.4k|  int32_t idest;
  117|       |
  118|  18.4k|  bool little_endian = is_little_endian();
  119|  18.4k|  if (little_endian) {
  ------------------
  |  Branch (119:7): [True: 18.4k, False: 0]
  ------------------
  120|  18.4k|    memcpy(&idest, pa, sizeof(idest));
  121|  18.4k|  }
  122|      0|  else {
  123|      0|#if defined (__GNUC__)
  124|      0|    return __builtin_bswap32(*(unsigned int *)pa);
  125|       |#elif defined (_MSC_VER) /* Visual Studio */
  126|       |    return _byteswap_ulong(*(unsigned int *)pa);
  127|       |#else
  128|       |    const uint8_t *pa_ = (const uint8_t *)pa;
  129|       |    uint8_t *dest = (uint8_t *)&idest;
  130|       |    dest[0] = pa_[3];
  131|       |    dest[1] = pa_[2];
  132|       |    dest[2] = pa_[1];
  133|       |    dest[3] = pa_[0];
  134|       |#endif
  135|      0|  }
  136|  18.4k|  return idest;
  137|  18.4k|}

do_nothing:
  632|  91.3k|int do_nothing(uint8_t filter, char cmode) {
  633|  91.3k|  if (cmode == 'c') {
  ------------------
  |  Branch (633:7): [True: 0, False: 91.3k]
  ------------------
  634|      0|    return (filter == BLOSC_NOFILTER);
  635|  91.3k|  } else {
  636|       |    // TRUNC_PREC do not have to be applied during decompression
  637|  91.3k|    return ((filter == BLOSC_NOFILTER) || (filter == BLOSC_TRUNC_PREC));
  ------------------
  |  Branch (637:13): [True: 36.4k, False: 54.8k]
  |  Branch (637:43): [True: 5.80k, False: 49.0k]
  ------------------
  638|  91.3k|  }
  639|  91.3k|}
next_filter:
  642|  23.5k|int next_filter(const uint8_t* filters, int current_filter, char cmode) {
  643|  40.5k|  for (int i = current_filter - 1; i >= 0; i--) {
  ------------------
  |  Branch (643:36): [True: 40.5k, False: 0]
  ------------------
  644|  40.5k|    if (!do_nothing(filters[i], cmode)) {
  ------------------
  |  Branch (644:9): [True: 23.5k, False: 16.9k]
  ------------------
  645|  23.5k|      return filters[i];
  646|  23.5k|    }
  647|  40.5k|  }
  648|      0|  return BLOSC_NOFILTER;
  649|  23.5k|}
last_filter:
  652|  8.46k|int last_filter(const uint8_t* filters, char cmode) {
  653|  8.46k|  int last_index = -1;
  654|  59.2k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (654:40): [True: 50.7k, False: 8.46k]
  ------------------
  655|  50.7k|    if (!do_nothing(filters[i], cmode))  {
  ------------------
  |  Branch (655:9): [True: 25.4k, False: 25.3k]
  ------------------
  656|  25.4k|      last_index = i;
  657|  25.4k|    }
  658|  50.7k|  }
  659|  8.46k|  return last_index;
  660|  8.46k|}
read_chunk_header:
  739|   150k|{
  740|   150k|  memset(header, 0, sizeof(blosc_header));
  741|       |
  742|   150k|  if (srcsize < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (742:7): [True: 0, False: 150k]
  ------------------
  743|      0|    BLOSC_TRACE_ERROR("Not enough space to read Blosc header.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  744|      0|    return BLOSC2_ERROR_READ_BUFFER;
  745|      0|  }
  746|       |
  747|   150k|  memcpy(header, src, BLOSC_MIN_HEADER_LENGTH);
  748|       |
  749|   150k|  bool little_endian = is_little_endian();
  750|       |
  751|   150k|  if (!little_endian) {
  ------------------
  |  Branch (751:7): [True: 0, False: 150k]
  ------------------
  752|      0|    header->nbytes = bswap32_(header->nbytes);
  753|      0|    header->blocksize = bswap32_(header->blocksize);
  754|      0|    header->cbytes = bswap32_(header->cbytes);
  755|      0|  }
  756|       |
  757|   150k|  if (header->cbytes < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (757:7): [True: 1, False: 150k]
  ------------------
  758|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  759|      1|    return BLOSC2_ERROR_INVALID_HEADER;
  760|      1|  }
  761|   150k|  if (header->blocksize <= 0) {
  ------------------
  |  Branch (761:7): [True: 0, False: 150k]
  ------------------
  762|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  763|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  764|      0|  }
  765|   150k|  if (header->blocksize > BLOSC2_MAXBLOCKSIZE) {
  ------------------
  |  Branch (765:7): [True: 2, False: 150k]
  ------------------
  766|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  767|      2|    return BLOSC2_ERROR_INVALID_HEADER;
  768|      2|  }
  769|   150k|  if (header->typesize == 0) {
  ------------------
  |  Branch (769:7): [True: 0, False: 150k]
  ------------------
  770|      0|    BLOSC_TRACE_ERROR("`typesize` 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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  771|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  772|      0|  }
  773|       |
  774|       |  /* Read extended header if it is wanted */
  775|   150k|  if ((extended_header) && (header->flags & BLOSC_DOSHUFFLE) && (header->flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (775:7): [True: 3.18k, False: 146k]
  |  Branch (775:28): [True: 2.05k, False: 1.12k]
  |  Branch (775:65): [True: 1.66k, False: 391]
  ------------------
  776|  1.66k|    if (header->cbytes < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (776:9): [True: 0, False: 1.66k]
  ------------------
  777|      0|      BLOSC_TRACE_ERROR("`cbytes` is too small to read extended header.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  778|      0|      return BLOSC2_ERROR_INVALID_HEADER;
  779|      0|    }
  780|  1.66k|    if (srcsize < BLOSC_EXTENDED_HEADER_LENGTH) {
  ------------------
  |  Branch (780:9): [True: 0, False: 1.66k]
  ------------------
  781|      0|      BLOSC_TRACE_ERROR("Not enough space to read Blosc extended header.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  782|      0|      return BLOSC2_ERROR_READ_BUFFER;
  783|      0|    }
  784|       |
  785|  1.66k|    memcpy((uint8_t *)header + BLOSC_MIN_HEADER_LENGTH, src + BLOSC_MIN_HEADER_LENGTH,
  786|  1.66k|      BLOSC_EXTENDED_HEADER_LENGTH - BLOSC_MIN_HEADER_LENGTH);
  787|       |
  788|  1.66k|    if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) && (header->blosc2_flags != 0)) {
  ------------------
  |  Branch (788:9): [True: 14, False: 1.65k]
  |  Branch (788:55): [True: 9, False: 5]
  ------------------
  789|      9|      int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  790|      9|      if (special_type != 0) {
  ------------------
  |  Branch (790:11): [True: 0, False: 9]
  ------------------
  791|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  792|      0|        return BLOSC2_ERROR_INVALID_HEADER;
  793|      0|      }
  794|      9|    }
  795|       |
  796|  1.66k|    int32_t special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  797|  1.66k|    if (special_type != 0) {
  ------------------
  |  Branch (797:9): [True: 35, False: 1.63k]
  ------------------
  798|     35|      if (special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (798:11): [True: 11, False: 24]
  ------------------
  799|       |        // In this case, the actual type size must be derived from the cbytes
  800|     11|        int32_t typesize = header->cbytes - BLOSC_EXTENDED_HEADER_LENGTH;
  801|     11|        if (typesize <= 0) {
  ------------------
  |  Branch (801:13): [True: 0, False: 11]
  ------------------
  802|      0|          BLOSC_TRACE_ERROR("`typesize` is zero or negative");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  803|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  804|      0|        }
  805|     11|        if (typesize > BLOSC2_MAXTYPESIZE) {
  ------------------
  |  Branch (805:13): [True: 0, False: 11]
  ------------------
  806|      0|          BLOSC_TRACE_ERROR("`typesize` is greater than maximum allowed");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  807|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  808|      0|        }
  809|     11|        if (typesize > header->nbytes) {
  ------------------
  |  Branch (809:13): [True: 10, False: 1]
  ------------------
  810|     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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  811|     10|          return BLOSC2_ERROR_INVALID_HEADER;
  812|     10|        }
  813|      1|        if (header->nbytes % typesize != 0) {
  ------------------
  |  Branch (813:13): [True: 1, False: 0]
  ------------------
  814|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  815|      1|          return BLOSC2_ERROR_INVALID_HEADER;
  816|      1|        }
  817|      1|      }
  818|     24|      else {
  819|     24|        if (header->nbytes % header->typesize != 0) {
  ------------------
  |  Branch (819:13): [True: 0, False: 24]
  ------------------
  820|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  821|      0|          return BLOSC2_ERROR_INVALID_HEADER;
  822|      0|        }
  823|     24|      }
  824|     35|    }
  825|       |    // The number of filters depends on the version of the header. Blosc2 alpha series
  826|       |    // did not initialize filters to zero beyond the max supported.
  827|  1.65k|    if (header->version == BLOSC2_VERSION_FORMAT_ALPHA) {
  ------------------
  |  Branch (827:9): [True: 190, False: 1.46k]
  ------------------
  828|    190|      header->filters[5] = 0;
  829|    190|      header->filters_meta[5] = 0;
  830|    190|    }
  831|  1.65k|  }
  832|   148k|  else {
  833|   148k|    flags_to_filters(header->flags, header->filters);
  834|   148k|  }
  835|   150k|  if (header->version > BLOSC2_VERSION_FORMAT &&
  ------------------
  |  Branch (835:7): [True: 1.68k, False: 148k]
  ------------------
  836|  1.68k|      (header->blosc2_flags2 & (uint8_t)~BLOSC2_VL_BLOCKS) != 0) {
  ------------------
  |  Branch (836:7): [True: 0, False: 1.68k]
  ------------------
  837|       |    /* Version from future with unsupported chunk features. */
  838|      0|    return BLOSC2_ERROR_VERSION_SUPPORT;
  839|      0|  }
  840|   150k|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0 &&
  ------------------
  |  Branch (840:7): [True: 14, False: 150k]
  ------------------
  841|     14|      (header->flags & (uint8_t)BLOSC_MEMCPYED) != 0) {
  ------------------
  |  Branch (841:7): [True: 0, False: 14]
  ------------------
  842|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  843|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  844|      0|  }
  845|   150k|  if ((header->blosc2_flags2 & BLOSC2_VL_BLOCKS) == 0 &&
  ------------------
  |  Branch (845:7): [True: 150k, False: 14]
  ------------------
  846|   150k|      header->nbytes > 0 && header->blocksize > header->nbytes) {
  ------------------
  |  Branch (846:7): [True: 150k, False: 1]
  |  Branch (846:29): [True: 2.61k, False: 147k]
  ------------------
  847|  2.61k|    header->blocksize = header->nbytes;
  848|  2.61k|  }
  849|   150k|  return 0;
  850|   150k|}
_cycle_buffers:
 1046|  17.0k|void _cycle_buffers(uint8_t **src, uint8_t **dest, uint8_t **tmp) {
 1047|  17.0k|  uint8_t *tmp2 = *src;
 1048|  17.0k|  *src = *dest;
 1049|  17.0k|  *dest = *tmp;
 1050|  17.0k|  *tmp = tmp2;
 1051|  17.0k|}
pipeline_backward:
 1473|  4.78k|                      uint8_t* tmp2, int last_filter_index, int32_t nblock) {
 1474|  4.78k|  blosc2_context* context = thread_context->parent_context;
 1475|  4.78k|  int32_t typesize = context->typesize;
 1476|  4.78k|  uint8_t* filters = context->filters;
 1477|  4.78k|  uint8_t* filters_meta = context->filters_meta;
 1478|  4.78k|  uint8_t* _src = src;
 1479|  4.78k|  uint8_t* _dest = tmp;
 1480|  4.78k|  uint8_t* _tmp = tmp2;
 1481|  4.78k|  int errcode = 0;
 1482|       |
 1483|  26.0k|  for (int i = BLOSC2_MAX_FILTERS - 1; i >= 0; i--) {
  ------------------
  |  Branch (1483:40): [True: 26.0k, False: 0]
  ------------------
 1484|       |    // Delta filter requires the whole chunk ready
 1485|  26.0k|    int last_copy_filter = (last_filter_index == i) || (filters[i] == BLOSC_DELTA) ||
  ------------------
  |  Branch (1485:28): [True: 4.78k, False: 21.2k]
  |  Branch (1485:56): [True: 4.82k, False: 16.3k]
  ------------------
 1486|  16.3k|                           (next_filter(filters, i, 'd') == BLOSC_DELTA);
  ------------------
  |  Branch (1486:28): [True: 6.14k, False: 10.2k]
  ------------------
 1487|  26.0k|    if (last_copy_filter && context->postfilter == NULL &&
  ------------------
  |  Branch (1487:9): [True: 15.7k, False: 10.2k]
  |  Branch (1487:29): [True: 15.7k, False: 0]
  ------------------
 1488|  15.7k|        (filters[i] == BLOSC_DELTA || _src != dest + offset)) {
  ------------------
  |  Branch (1488:10): [True: 6.39k, False: 9.34k]
  |  Branch (1488:39): [True: 5.49k, False: 3.85k]
  ------------------
 1489|  11.8k|      _dest = dest + offset;
 1490|  11.8k|    }
 1491|  26.0k|    int rc = BLOSC2_ERROR_SUCCESS;
 1492|  26.0k|    if (filters[i] <= BLOSC2_DEFINED_FILTERS_STOP) {
  ------------------
  |  Branch (1492:9): [True: 23.1k, False: 2.89k]
  ------------------
 1493|  23.1k|      switch (filters[i]) {
 1494|  4.65k|        case BLOSC_SHUFFLE:
  ------------------
  |  Branch (1494:9): [True: 4.65k, False: 18.4k]
  ------------------
 1495|       |        // if filters_meta is not 0, interpret as number of bytes to be grouped together for shuffle
 1496|  4.65k|          blosc2_unshuffle(filters_meta[i] == 0 ? typesize : filters_meta[i], bsize, _src, _dest);
  ------------------
  |  Branch (1496:28): [True: 2.22k, False: 2.43k]
  ------------------
 1497|  4.65k|          break;
 1498|  3.05k|        case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (1498:9): [True: 3.05k, False: 20.0k]
  ------------------
 1499|  3.05k|          if (bitunshuffle(typesize, bsize, _src, _dest, context->src[BLOSC2_CHUNK_VERSION]) < 0) {
  ------------------
  |  Branch (1499:15): [True: 0, False: 3.05k]
  ------------------
 1500|      0|            return BLOSC2_ERROR_FILTER_PIPELINE;
 1501|      0|          }
 1502|  3.05k|          break;
 1503|  6.39k|        case BLOSC_DELTA:
  ------------------
  |  Branch (1503:9): [True: 6.39k, False: 16.7k]
  ------------------
 1504|  6.39k|          if (context->nthreads == 1) {
  ------------------
  |  Branch (1504:15): [True: 6.39k, False: 0]
  ------------------
 1505|       |            /* Serial mode */
 1506|  6.39k|            delta_decoder(dest, offset, bsize, typesize, _dest);
 1507|  6.39k|          } else {
 1508|      0|            struct blosc_job_group *job = context->job;
 1509|      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 (1509:51): [True: 0, False: 0]
  ------------------
 1510|      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 (1510:47): [True: 0, False: 0]
  ------------------
 1511|      0|            int *dref_not_init = job != NULL ? &job->dref_not_init : &context->dref_not_init;
  ------------------
  |  Branch (1511:34): [True: 0, False: 0]
  ------------------
 1512|       |            /* Force the thread in charge of the block 0 to go first */
 1513|      0|            blosc2_pthread_mutex_lock(delta_mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 1514|      0|            if (*dref_not_init) {
  ------------------
  |  Branch (1514:17): [True: 0, False: 0]
  ------------------
 1515|      0|              if (offset != 0) {
  ------------------
  |  Branch (1515:19): [True: 0, False: 0]
  ------------------
 1516|      0|                blosc2_pthread_cond_wait(delta_cv, delta_mutex);
  ------------------
  |  |   98|      0|#define blosc2_pthread_cond_wait(a, b) pthread_cond_wait((a), (b))
  ------------------
 1517|      0|              } else {
 1518|      0|                delta_decoder(dest, offset, bsize, typesize, _dest);
 1519|      0|                *dref_not_init = 0;
 1520|      0|                blosc2_pthread_cond_broadcast(delta_cv);
  ------------------
  |  |  100|      0|#define blosc2_pthread_cond_broadcast(a) pthread_cond_broadcast((a))
  ------------------
 1521|      0|              }
 1522|      0|            }
 1523|      0|            blosc2_pthread_mutex_unlock(delta_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 1524|      0|            if (offset != 0) {
  ------------------
  |  Branch (1524:17): [True: 0, False: 0]
  ------------------
 1525|      0|              delta_decoder(dest, offset, bsize, typesize, _dest);
 1526|      0|            }
 1527|      0|          }
 1528|  6.39k|          break;
 1529|  1.44k|        case BLOSC_TRUNC_PREC:
  ------------------
  |  Branch (1529:9): [True: 1.44k, False: 21.6k]
  ------------------
 1530|       |          // TRUNC_PREC filter does not need to be undone
 1531|  1.44k|          break;
 1532|  7.56k|        default:
  ------------------
  |  Branch (1532:9): [True: 7.56k, False: 15.5k]
  ------------------
 1533|  7.56k|          if (filters[i] != BLOSC_NOFILTER) {
  ------------------
  |  Branch (1533:15): [True: 40, False: 7.52k]
  ------------------
 1534|     40|            BLOSC_TRACE_ERROR("Filter %d not handled during decompression.",
  ------------------
  |  |   93|     40|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     40|    do {                                            \
  |  |  |  |   98|     40|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     40|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 40, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     40|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1535|     40|                              filters[i]);
 1536|     40|            errcode = -1;
 1537|     40|          }
 1538|  23.1k|      }
 1539|  23.1k|    } else {
 1540|       |        // Look for the filters_meta in user filters and run it
 1541|  12.7k|        for (uint64_t j = 0; j < g_nfilters; ++j) {
  ------------------
  |  Branch (1541:30): [True: 12.7k, False: 27]
  ------------------
 1542|  12.7k|          if (g_filters[j].id == filters[i]) {
  ------------------
  |  Branch (1542:15): [True: 2.86k, False: 9.84k]
  ------------------
 1543|  2.86k|            if (g_filters[j].backward == NULL) {
  ------------------
  |  Branch (1543:17): [True: 0, False: 2.86k]
  ------------------
 1544|       |              // Dynamically load filter
 1545|      0|              if (fill_filter(&g_filters[j]) < 0) {
  ------------------
  |  Branch (1545:19): [True: 0, False: 0]
  ------------------
 1546|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1547|      0|                return BLOSC2_ERROR_FILTER_PIPELINE;
 1548|      0|              }
 1549|      0|            }
 1550|  2.86k|            if (g_filters[j].backward != NULL) {
  ------------------
  |  Branch (1550:17): [True: 2.86k, False: 0]
  ------------------
 1551|  2.86k|              blosc2_dparams dparams;
 1552|  2.86k|              blosc2_ctx_get_dparams(context, &dparams);
 1553|  2.86k|              rc = g_filters[j].backward(_src, _dest, bsize, filters_meta[i], &dparams, g_filters[j].id);
 1554|  2.86k|            } else {
 1555|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1556|      0|              return BLOSC2_ERROR_FILTER_PIPELINE;
 1557|      0|            }
 1558|  2.86k|            if (rc != BLOSC2_ERROR_SUCCESS) {
  ------------------
  |  Branch (1558:17): [True: 5, False: 2.86k]
  ------------------
 1559|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1560|      5|              return rc;
 1561|      5|            }
 1562|  2.86k|            goto urfiltersuccess;
 1563|  2.86k|          }
 1564|  12.7k|        }
 1565|     27|      BLOSC_TRACE_ERROR("User-defined filter %d not found during decompression.", filters[i]);
  ------------------
  |  |   93|     27|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     27|    do {                                            \
  |  |  |  |   98|     27|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     27|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 27, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     27|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1566|     27|      return BLOSC2_ERROR_FILTER_PIPELINE;
 1567|  2.86k|      urfiltersuccess:;
 1568|  2.86k|    }
 1569|       |
 1570|       |    // Cycle buffers when required
 1571|  25.9k|    if ((filters[i] != BLOSC_NOFILTER) && (filters[i] != BLOSC_TRUNC_PREC)) {
  ------------------
  |  Branch (1571:9): [True: 18.4k, False: 7.52k]
  |  Branch (1571:43): [True: 17.0k, False: 1.44k]
  ------------------
 1572|  17.0k|      _cycle_buffers(&_src, &_dest, &_tmp);
 1573|  17.0k|    }
 1574|  25.9k|    if (last_filter_index == i) {
  ------------------
  |  Branch (1574:9): [True: 4.75k, False: 21.2k]
  ------------------
 1575|  4.75k|      break;
 1576|  4.75k|    }
 1577|  25.9k|  }
 1578|       |
 1579|  4.75k|  if (context->postfilter == NULL && _src != dest + offset) {
  ------------------
  |  Branch (1579:7): [True: 4.75k, False: 0]
  |  Branch (1579:38): [True: 594, False: 4.16k]
  ------------------
 1580|    594|    memcpy(dest + offset, _src, (unsigned int)bsize);
 1581|    594|  }
 1582|       |
 1583|       |  /* Postfilter function */
 1584|  4.75k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (1584:7): [True: 0, False: 4.75k]
  ------------------
 1585|       |    // Create new postfilter parameters for this block (must be private for each thread)
 1586|      0|    blosc2_postfilter_params postparams;
 1587|      0|    memcpy(&postparams, context->postparams, sizeof(postparams));
 1588|      0|    postparams.input = _src;
 1589|      0|    postparams.output = dest + offset;
 1590|      0|    postparams.size = bsize;
 1591|      0|    postparams.typesize = typesize;
 1592|      0|    postparams.offset = nblock * context->blocksize;
 1593|      0|    postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (1593:25): [True: 0, False: 0]
  ------------------
 1594|      0|    postparams.nblock = nblock;
 1595|      0|    postparams.tid = thread_context->tid;
 1596|      0|    postparams.ttmp = thread_context->tmp;
 1597|      0|    postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 1598|      0|    postparams.ctx = context;
 1599|       |
 1600|      0|    if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (1600:9): [True: 0, False: 0]
  ------------------
 1601|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1602|      0|      return BLOSC2_ERROR_POSTFILTER;
 1603|      0|    }
 1604|      0|  }
 1605|       |
 1606|  4.75k|  return errcode;
 1607|  4.75k|}
free_thread_context:
 2299|  3.13k|void free_thread_context(struct thread_context* thread_context) {
 2300|  3.13k|  destroy_thread_context(thread_context);
 2301|  3.13k|  my_free(thread_context);
 2302|  3.13k|}
check_nthreads:
 2305|  3.13k|int check_nthreads(blosc2_context* context) {
 2306|  3.13k|  if (context->new_nthreads != context->nthreads && context->new_nthreads <= 0) {
  ------------------
  |  Branch (2306:7): [True: 0, False: 3.13k]
  |  Branch (2306:53): [True: 0, False: 0]
  ------------------
 2307|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2307|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2308|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2309|      0|  }
 2310|  3.13k|  if (context->nthreads <= 0) {
  ------------------
  |  Branch (2310:7): [True: 0, False: 3.13k]
  ------------------
 2311|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2311|      0|    BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2312|      0|    return BLOSC2_ERROR_INVALID_PARAM;
 2313|      0|  }
 2314|       |
 2315|       |  /* Detect a pool that was torn down by blosc2_destroy() while this context
 2316|       |   * was still alive.  The epoch mismatch tells us the pool pointer is dangling;
 2317|       |   * clear it so the re-attach logic below creates a fresh one. */
 2318|  3.13k|  if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL &&
  ------------------
  |  |   33|  6.27k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (2318:7): [True: 0, False: 3.13k]
  ------------------
 2319|      0|      context->pool_epoch != g_destroy_count) {
  ------------------
  |  Branch (2319:7): [True: 0, False: 0]
  ------------------
 2320|      0|    context->thread_pool = NULL;
 2321|      0|    context->threads_started = 0;
 2322|      0|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2323|      0|  }
 2324|       |
 2325|  3.13k|  if (context->new_nthreads != context->nthreads) {
  ------------------
  |  Branch (2325:7): [True: 0, False: 3.13k]
  ------------------
 2326|      0|    release_thread_backend(context);
 2327|      0|    context->nthreads = context->new_nthreads;
 2328|      0|  }
 2329|  3.13k|  if (context->nthreads > 1 && context->threads_started == 0) {
  ------------------
  |  Branch (2329:7): [True: 0, False: 3.13k]
  |  Branch (2329:32): [True: 0, False: 0]
  ------------------
 2330|      0|    int rc;
 2331|      0|    if (threads_callback) {
  ------------------
  |  Branch (2331:9): [True: 0, False: 0]
  ------------------
 2332|      0|      rc = init_callback_threads(context);
 2333|      0|    }
 2334|      0|    else {
 2335|       |#if defined(_WIN32)
 2336|       |      rc = init_threadpool(context);
 2337|       |#else
 2338|      0|      rc = attach_shared_pool(context);
 2339|      0|#endif
 2340|      0|    }
 2341|      0|    if (rc < 0) {
  ------------------
  |  Branch (2341:9): [True: 0, False: 0]
  ------------------
 2342|      0|      return rc;
 2343|      0|    }
 2344|      0|  }
 2345|  3.13k|  if (context->nthreads <= 1) {
  ------------------
  |  Branch (2345:7): [True: 3.13k, False: 0]
  ------------------
 2346|  3.13k|    context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|  3.13k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 2347|  3.13k|  }
 2348|       |
 2349|  3.13k|  return context->nthreads;
 2350|  3.13k|}
blosc2_decompress:
 4202|  3.18k|int blosc2_decompress(const void* src, int32_t srcsize, void* dest, int32_t destsize) {
 4203|  3.18k|  int result;
 4204|  3.18k|  char* envvar;
 4205|  3.18k|  long nthreads;
 4206|  3.18k|  blosc2_context *dctx;
 4207|  3.18k|  blosc2_dparams dparams = BLOSC2_DPARAMS_DEFAULTS;
 4208|       |
 4209|       |  /* Check whether the library should be initialized */
 4210|  3.18k|  if (!g_initlib) blosc2_init();
  ------------------
  |  Branch (4210:7): [True: 0, False: 3.18k]
  ------------------
 4211|       |
 4212|       |  /* Check for a BLOSC_NTHREADS environment variable */
 4213|  3.18k|  envvar = getenv("BLOSC_NTHREADS");
 4214|  3.18k|  if (envvar != NULL) {
  ------------------
  |  Branch (4214:7): [True: 0, False: 3.18k]
  ------------------
 4215|      0|    errno = 0; /* To distinguish success/failure after call */
 4216|      0|    nthreads = strtol(envvar, NULL, 10);
 4217|      0|    if ((errno != EINVAL)) {
  ------------------
  |  Branch (4217:9): [True: 0, False: 0]
  ------------------
 4218|      0|      if ((nthreads <= 0) || (nthreads > INT16_MAX)) {
  ------------------
  |  Branch (4218:11): [True: 0, False: 0]
  |  Branch (4218:30): [True: 0, False: 0]
  ------------------
 4219|      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__); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 4219|      0|        BLOSC_TRACE_ERROR("nthreads must be >= 1 and <= %d", INT16_MAX);
  |  |  |  |  ------------------
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4220|      0|        return BLOSC2_ERROR_INVALID_PARAM;
 4221|      0|      }
 4222|      0|      result = blosc2_set_nthreads((int16_t) nthreads);
 4223|      0|      if (result < 0) {
  ------------------
  |  Branch (4223:11): [True: 0, False: 0]
  ------------------
 4224|      0|        return result;
 4225|      0|      }
 4226|      0|    }
 4227|      0|  }
 4228|       |
 4229|       |  /* Check for a BLOSC_NOLOCK environment variable.  It is important
 4230|       |     that this should be the last env var so that it can take the
 4231|       |     previous ones into account */
 4232|  3.18k|  envvar = getenv("BLOSC_NOLOCK");
 4233|  3.18k|  if (envvar != NULL) {
  ------------------
  |  Branch (4233:7): [True: 0, False: 3.18k]
  ------------------
 4234|      0|    dparams.nthreads = g_nthreads;
 4235|      0|    dctx = blosc2_create_dctx(dparams);
 4236|      0|    if (dctx == NULL) {
  ------------------
  |  Branch (4236:9): [True: 0, False: 0]
  ------------------
 4237|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4238|      0|      return BLOSC2_ERROR_NULL_POINTER;
 4239|      0|    }
 4240|      0|    result = blosc2_decompress_ctx(dctx, src, srcsize, dest, destsize);
 4241|      0|    blosc2_free_ctx(dctx);
 4242|      0|    return result;
 4243|      0|  }
 4244|       |
 4245|  3.18k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  3.18k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 4246|       |
 4247|  3.18k|  result = blosc_run_decompression_with_context(
 4248|  3.18k|          g_global_context, src, srcsize, dest, destsize);
 4249|       |
 4250|  3.18k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  3.18k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 4251|       |
 4252|  3.18k|  return result;
 4253|  3.18k|}
blosc2_set_nthreads:
 5518|  3.19k|int16_t blosc2_set_nthreads(int16_t nthreads) {
 5519|  3.19k|  int16_t ret;          /* the previous number of threads */
 5520|       |
 5521|       |  /* Check whether the library should be initialized */
 5522|  3.19k|  if (!g_initlib) blosc2_init();
  ------------------
  |  Branch (5522:7): [True: 0, False: 3.19k]
  ------------------
 5523|       |
 5524|  3.19k|  blosc2_pthread_mutex_lock(&global_comp_mutex);
  ------------------
  |  |   92|  3.19k|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5525|  3.19k|  ret = g_nthreads;
 5526|  3.19k|  if (nthreads != ret) {
  ------------------
  |  Branch (5526:7): [True: 0, False: 3.19k]
  ------------------
 5527|      0|    int16_t old_new_nthreads = g_global_context->new_nthreads;
 5528|      0|    int16_t old_nthreads = g_global_context->nthreads;
 5529|      0|    g_nthreads = nthreads;
 5530|      0|    g_global_context->new_nthreads = nthreads;
 5531|      0|    int16_t ret2 = check_nthreads(g_global_context);
 5532|      0|    if (ret2 < 0) {
  ------------------
  |  Branch (5532:9): [True: 0, False: 0]
  ------------------
 5533|      0|      g_nthreads = ret;
 5534|      0|      g_global_context->new_nthreads = old_new_nthreads;
 5535|      0|      g_global_context->nthreads = old_nthreads;
 5536|      0|      check_nthreads(g_global_context);
 5537|      0|      blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5538|      0|      return ret2;
 5539|      0|    }
 5540|      0|  }
 5541|  3.19k|  blosc2_pthread_mutex_unlock(&global_comp_mutex);
  ------------------
  |  |   93|  3.19k|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5542|       |
 5543|  3.19k|  return ret;
 5544|  3.19k|}
blosc1_cbuffer_sizes:
 5688|  3.19k|void blosc1_cbuffer_sizes(const void* cbuffer, size_t* nbytes, size_t* cbytes, size_t* blocksize) {
 5689|  3.19k|  int32_t nbytes32, cbytes32, blocksize32;
 5690|  3.19k|  blosc2_cbuffer_sizes(cbuffer, &nbytes32, &cbytes32, &blocksize32);
 5691|  3.19k|  *nbytes = nbytes32;
 5692|  3.19k|  *cbytes = cbytes32;
 5693|  3.19k|  *blocksize = blocksize32;
 5694|  3.19k|}
blosc2_cbuffer_sizes:
 5696|   146k|int blosc2_cbuffer_sizes(const void* cbuffer, int32_t* nbytes, int32_t* cbytes, int32_t* blocksize) {
 5697|   146k|  blosc_header header;
 5698|   146k|  int rc = read_chunk_header((uint8_t *) cbuffer, BLOSC_MIN_HEADER_LENGTH, false, &header);
 5699|   146k|  if (rc < 0) {
  ------------------
  |  Branch (5699:7): [True: 3, False: 146k]
  ------------------
 5700|       |    /* Return zeros if error reading header */
 5701|      3|    memset(&header, 0, sizeof(header));
 5702|      3|  }
 5703|       |
 5704|       |  /* Read the interesting values */
 5705|   146k|  if (nbytes != NULL)
  ------------------
  |  Branch (5705:7): [True: 146k, False: 0]
  ------------------
 5706|   146k|    *nbytes = header.nbytes;
 5707|   146k|  if (cbytes != NULL)
  ------------------
  |  Branch (5707:7): [True: 146k, False: 0]
  ------------------
 5708|   146k|    *cbytes = header.cbytes;
 5709|   146k|  if (blocksize != NULL)
  ------------------
  |  Branch (5709:7): [True: 3.19k, False: 143k]
  ------------------
 5710|  3.19k|    *blocksize = header.blocksize;
 5711|   146k|  return rc;
 5712|   146k|}
blosc1_cbuffer_validate:
 5714|  3.18k|int blosc1_cbuffer_validate(const void* cbuffer, size_t cbytes, size_t* nbytes) {
 5715|  3.18k|  int32_t header_cbytes;
 5716|  3.18k|  int32_t header_nbytes;
 5717|  3.18k|  if (cbytes < BLOSC_MIN_HEADER_LENGTH) {
  ------------------
  |  Branch (5717:7): [True: 0, False: 3.18k]
  ------------------
 5718|       |    /* Compressed data should contain enough space for header */
 5719|      0|    *nbytes = 0;
 5720|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 5721|      0|  }
 5722|  3.18k|  int rc = blosc2_cbuffer_sizes(cbuffer, &header_nbytes, &header_cbytes, NULL);
 5723|  3.18k|  if (rc < 0) {
  ------------------
  |  Branch (5723:7): [True: 0, False: 3.18k]
  ------------------
 5724|      0|    *nbytes = 0;
 5725|      0|    return rc;
 5726|      0|  }
 5727|  3.18k|  *nbytes = header_nbytes;
 5728|  3.18k|  if (header_cbytes != (int32_t)cbytes) {
  ------------------
  |  Branch (5728:7): [True: 0, False: 3.18k]
  ------------------
 5729|       |    /* Compressed size from header does not match `cbytes` */
 5730|      0|    *nbytes = 0;
 5731|      0|    return BLOSC2_ERROR_INVALID_HEADER;
 5732|      0|  }
 5733|  3.18k|  if (*nbytes > BLOSC2_MAX_BUFFERSIZE) {
  ------------------
  |  Branch (5733:7): [True: 0, False: 3.18k]
  ------------------
 5734|       |    /* Uncompressed size is larger than allowed */
 5735|      0|    *nbytes = 0;
 5736|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 5737|      0|  }
 5738|  3.18k|  return 0;
 5739|  3.18k|}
blosc2_init:
 5847|  3.19k|void blosc2_init(void) {
 5848|       |  /* Return if Blosc is already initialized */
 5849|  3.19k|  if (g_initlib) return;
  ------------------
  |  Branch (5849:7): [True: 0, False: 3.19k]
  ------------------
 5850|       |
 5851|  3.19k|  BLOSC2_IO_CB_DEFAULTS.id = BLOSC2_IO_FILESYSTEM;
 5852|  3.19k|  BLOSC2_IO_CB_DEFAULTS.name = "filesystem";
 5853|  3.19k|  BLOSC2_IO_CB_DEFAULTS.is_allocation_necessary = true;
 5854|  3.19k|  BLOSC2_IO_CB_DEFAULTS.open = (blosc2_open_cb) blosc2_stdio_open;
 5855|  3.19k|  BLOSC2_IO_CB_DEFAULTS.close = (blosc2_close_cb) blosc2_stdio_close;
 5856|  3.19k|  BLOSC2_IO_CB_DEFAULTS.size = (blosc2_size_cb) blosc2_stdio_size;
 5857|  3.19k|  BLOSC2_IO_CB_DEFAULTS.write = (blosc2_write_cb) blosc2_stdio_write;
 5858|  3.19k|  BLOSC2_IO_CB_DEFAULTS.read = (blosc2_read_cb) blosc2_stdio_read;
 5859|  3.19k|  BLOSC2_IO_CB_DEFAULTS.truncate = (blosc2_truncate_cb) blosc2_stdio_truncate;
 5860|  3.19k|  BLOSC2_IO_CB_DEFAULTS.destroy = (blosc2_destroy_cb) blosc2_stdio_destroy;
 5861|       |
 5862|  3.19k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_DEFAULTS);
 5863|       |
 5864|  3.19k|  BLOSC2_IO_CB_MMAP.id = BLOSC2_IO_FILESYSTEM_MMAP;
 5865|  3.19k|  BLOSC2_IO_CB_MMAP.name = "filesystem_mmap";
 5866|  3.19k|  BLOSC2_IO_CB_MMAP.is_allocation_necessary = false;
 5867|  3.19k|  BLOSC2_IO_CB_MMAP.open = (blosc2_open_cb) blosc2_stdio_mmap_open;
 5868|  3.19k|  BLOSC2_IO_CB_MMAP.close = (blosc2_close_cb) blosc2_stdio_mmap_close;
 5869|  3.19k|  BLOSC2_IO_CB_MMAP.read = (blosc2_read_cb) blosc2_stdio_mmap_read;
 5870|  3.19k|  BLOSC2_IO_CB_MMAP.size = (blosc2_size_cb) blosc2_stdio_mmap_size;
 5871|  3.19k|  BLOSC2_IO_CB_MMAP.write = (blosc2_write_cb) blosc2_stdio_mmap_write;
 5872|  3.19k|  BLOSC2_IO_CB_MMAP.truncate = (blosc2_truncate_cb) blosc2_stdio_mmap_truncate;
 5873|  3.19k|  BLOSC2_IO_CB_MMAP.destroy = (blosc2_destroy_cb) blosc2_stdio_mmap_destroy;
 5874|       |
 5875|  3.19k|  _blosc2_register_io_cb(&BLOSC2_IO_CB_MMAP);
 5876|       |
 5877|  3.19k|  g_ncodecs = 0;
 5878|  3.19k|  g_nfilters = 0;
 5879|  3.19k|  g_ntuners = 0;
 5880|       |
 5881|  3.19k|#if defined(HAVE_PLUGINS)
 5882|  3.19k|  #include "blosc2/blosc2-common.h"
 5883|  3.19k|  #include "blosc2/blosc2-stdio.h"
 5884|  3.19k|  register_codecs();
 5885|  3.19k|  register_filters();
 5886|  3.19k|  register_tuners();
 5887|  3.19k|#endif
 5888|  3.19k|  blosc2_pthread_mutex_init(&global_comp_mutex, NULL);
  ------------------
  |  |   90|  3.19k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5889|  3.19k|  blosc2_pthread_mutex_init(&pool_registry_mutex, NULL);
  ------------------
  |  |   90|  3.19k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5890|       |  /* Create a global context */
 5891|  3.19k|  g_global_context = (blosc2_context*)my_malloc(sizeof(blosc2_context));
 5892|  3.19k|  memset(g_global_context, 0, sizeof(blosc2_context));
 5893|  3.19k|  g_global_context->nthreads = g_nthreads;
 5894|  3.19k|  g_global_context->new_nthreads = g_nthreads;
 5895|  3.19k|  blosc2_pthread_mutex_init(&g_global_context->nchunk_mutex, NULL);
  ------------------
  |  |   90|  3.19k|#define blosc2_pthread_mutex_init(a, b) pthread_mutex_init((a), (b))
  ------------------
 5896|  3.19k|  g_initlib = 1;
 5897|  3.19k|}
blosc2_free_resources:
 5900|  3.19k|int blosc2_free_resources(void) {
 5901|       |  /* Return if Blosc is not initialized */
 5902|  3.19k|  if (!g_initlib) return BLOSC2_ERROR_FAILURE;
  ------------------
  |  Branch (5902:7): [True: 0, False: 3.19k]
  ------------------
 5903|       |
 5904|  3.19k|  return release_thread_backend(g_global_context);
 5905|  3.19k|}
blosc2_destroy:
 5908|  3.19k|void blosc2_destroy(void) {
 5909|       |  /* Return if Blosc is not initialized */
 5910|  3.19k|  if (!g_initlib) return;
  ------------------
  |  Branch (5910:7): [True: 0, False: 3.19k]
  ------------------
 5911|       |
 5912|  3.19k|  blosc2_free_resources();
 5913|  3.19k|  g_initlib = 0;
 5914|  3.19k|  blosc2_free_ctx(g_global_context);
 5915|       |
 5916|       |  /* Bump the epoch so any live context can detect its pool is now stale.
 5917|       |   * Do this before freeing the pools so that release_thread_backend callers
 5918|       |   * that race with us will take the "skip" path rather than locking the
 5919|       |   * soon-to-be-destroyed pool_registry_mutex. */
 5920|  3.19k|  g_destroy_count++;
 5921|       |
 5922|       |  /* Tear down any remaining shared pools */
 5923|  3.19k|  struct blosc_shared_pool *pool = shared_pools;
 5924|  3.19k|  while (pool != NULL) {
  ------------------
  |  Branch (5924:10): [True: 0, False: 3.19k]
  ------------------
 5925|      0|    struct blosc_shared_pool *next = pool->next;
 5926|      0|    destroy_shared_pool(pool);
 5927|      0|    pool = next;
 5928|      0|  }
 5929|  3.19k|  shared_pools = NULL;
 5930|  3.19k|  blosc2_pthread_mutex_destroy(&pool_registry_mutex);
  ------------------
  |  |   91|  3.19k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5931|       |
 5932|  3.19k|  blosc2_pthread_mutex_destroy(&global_comp_mutex);
  ------------------
  |  |   91|  3.19k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5933|  3.19k|}
blosc2_free_ctx:
 6189|  3.19k|void blosc2_free_ctx(blosc2_context* context) {
 6190|  3.19k|  if (g_initlib ||
  ------------------
  |  Branch (6190:7): [True: 0, False: 3.19k]
  ------------------
 6191|  3.19k|      context->thread_backend == BLOSC_BACKEND_PER_CONTEXT ||
  ------------------
  |  |   35|  6.39k|#define BLOSC_BACKEND_PER_CONTEXT 3   /* per-context threads; used on Windows */
  ------------------
  |  Branch (6191:7): [True: 0, False: 3.19k]
  ------------------
 6192|  3.19k|      context->thread_backend == BLOSC_BACKEND_CALLBACK) {
  ------------------
  |  |   34|  3.19k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (6192:7): [True: 0, False: 3.19k]
  ------------------
 6193|      0|    release_thread_backend(context);
 6194|      0|  }
 6195|  3.19k|  if (context->serial_context != NULL) {
  ------------------
  |  Branch (6195:7): [True: 3.13k, False: 61]
  ------------------
 6196|  3.13k|    free_thread_context(context->serial_context);
 6197|  3.13k|  }
 6198|  3.19k|  blosc2_pthread_mutex_destroy(&context->nchunk_mutex);
  ------------------
  |  |   91|  3.19k|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 6199|  3.19k|  release_context_dict_buffer(context);
 6200|  3.19k|  if (context->dict_cdict != NULL) {
  ------------------
  |  Branch (6200:7): [True: 0, False: 3.19k]
  ------------------
 6201|      0|    if (context->compcode == BLOSC_LZ4) {
  ------------------
  |  Branch (6201:9): [True: 0, False: 0]
  ------------------
 6202|      0|      LZ4_freeStream((LZ4_stream_t*)context->dict_cdict);
 6203|      0|    } else if (context->compcode == BLOSC_LZ4HC) {
  ------------------
  |  Branch (6203:16): [True: 0, False: 0]
  ------------------
 6204|      0|      LZ4_freeStreamHC((LZ4_streamHC_t*)context->dict_cdict);
 6205|      0|    }
 6206|      0|#ifdef HAVE_ZSTD
 6207|      0|    else if (context->compcode == BLOSC_ZSTD) {
  ------------------
  |  Branch (6207:14): [True: 0, False: 0]
  ------------------
 6208|      0|      ZSTD_freeCDict(context->dict_cdict);
 6209|      0|    }
 6210|      0|#endif
 6211|      0|  }
 6212|  3.19k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (6212:7): [True: 779, False: 2.41k]
  ------------------
 6213|    779|#ifdef HAVE_ZSTD
 6214|    779|    ZSTD_freeDDict(context->dict_ddict);
 6215|    779|#endif
 6216|    779|  }
 6217|  3.19k|  if (context->tuner_params != NULL) {
  ------------------
  |  Branch (6217:7): [True: 0, False: 3.19k]
  ------------------
 6218|      0|    int rc;
 6219|      0|    if (context->tuner_id < BLOSC_LAST_TUNER && context->tuner_id == BLOSC_STUNE) {
  ------------------
  |  |   26|      0|#define BLOSC_STUNE 0
  ------------------
  |  Branch (6219:9): [True: 0, False: 0]
  |  Branch (6219:49): [True: 0, False: 0]
  ------------------
 6220|      0|      rc = blosc_stune_free(context);
 6221|      0|    } else {
 6222|      0|      for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (6222:23): [True: 0, False: 0]
  ------------------
 6223|      0|        if (g_tuners[i].id == context->tuner_id) {
  ------------------
  |  Branch (6223:13): [True: 0, False: 0]
  ------------------
 6224|      0|          if (g_tuners[i].free == NULL) {
  ------------------
  |  Branch (6224:15): [True: 0, False: 0]
  ------------------
 6225|      0|            if (fill_tuner(&g_tuners[i]) < 0) {
  ------------------
  |  Branch (6225:17): [True: 0, False: 0]
  ------------------
 6226|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6227|      0|              return;
 6228|      0|            }
 6229|      0|          }
 6230|      0|          rc = g_tuners[i].free(context);
 6231|      0|          goto urtunersuccess;
 6232|      0|        }
 6233|      0|      }
 6234|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6235|      0|      return;
 6236|      0|      urtunersuccess:;
 6237|      0|    }
 6238|      0|    if (rc < 0) {
  ------------------
  |  Branch (6238:9): [True: 0, False: 0]
  ------------------
 6239|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6240|      0|      return;
 6241|      0|    }
 6242|      0|  }
 6243|       |  /* May be needed if codec_params ever contains nested objects
 6244|       |  if (context->codec_params != NULL) {
 6245|       |    int rc;
 6246|       |    for (int i = 0; i < g_ncodecs; ++i) {
 6247|       |      if (g_codecs[i].compcode == context->compcode) {
 6248|       |        if (g_codecs[i].free == NULL) {
 6249|       |          // Dynamically load codec plugin
 6250|       |          if (fill_codec(&g_codecs[i]) < 0) {
 6251|       |            BLOSC_TRACE_ERROR("Could not load codec %d.", g_codecs[i].compcode);
 6252|       |            return BLOSC2_ERROR_CODEC_SUPPORT;
 6253|       |          }
 6254|       |        }
 6255|       |        if (g_codecs[i].free == NULL){
 6256|       |          // no free func, codec_params is simple
 6257|       |          my_free(context->codec_params);
 6258|       |        }
 6259|       |        else{ // has free function for codec_params (e.g. openzl)
 6260|       |        rc = g_codecs[i].free(context->codec_params);
 6261|       |          goto urcodecsuccess;
 6262|       |        }
 6263|       |      }
 6264|       |    }
 6265|       |      BLOSC_TRACE_ERROR("User-defined compressor codec %d not found", context->compcode);
 6266|       |      return BLOSC2_ERROR_CODEC_SUPPORT;
 6267|       |    urcodecsuccess:;
 6268|       |    if (rc < 0) {
 6269|       |      BLOSC_TRACE_ERROR("Error in user-defined codec free function\n");
 6270|       |      return;
 6271|       |    }
 6272|       |  }
 6273|       |  */
 6274|  3.19k|  if (context->prefilter != NULL) {
  ------------------
  |  Branch (6274:7): [True: 0, False: 3.19k]
  ------------------
 6275|      0|    my_free(context->preparams);
 6276|      0|  }
 6277|  3.19k|  if (context->postfilter != NULL) {
  ------------------
  |  Branch (6277:7): [True: 0, False: 3.19k]
  ------------------
 6278|      0|    my_free(context->postparams);
 6279|      0|  }
 6280|       |
 6281|  3.19k|  if (context->block_maskout != NULL) {
  ------------------
  |  Branch (6281:7): [True: 0, False: 3.19k]
  ------------------
 6282|      0|    free(context->block_maskout);
 6283|      0|  }
 6284|  3.19k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (6284:7): [True: 11, False: 3.18k]
  ------------------
 6285|     11|    free(context->blocknbytes);
 6286|     11|  }
 6287|  3.19k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (6287:7): [True: 11, False: 3.18k]
  ------------------
 6288|     11|    free(context->blockoffsets);
 6289|     11|  }
 6290|  3.19k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (6290:7): [True: 11, False: 3.18k]
  ------------------
 6291|     11|    free(context->blockcbytes);
 6292|     11|  }
 6293|  3.19k|  my_free(context);
 6294|  3.19k|}
blosc2_ctx_get_dparams:
 6321|  3.78k|int blosc2_ctx_get_dparams(blosc2_context *ctx, blosc2_dparams *dparams) {
 6322|  3.78k|  dparams->nthreads = ctx->nthreads;
 6323|  3.78k|  dparams->schunk = ctx->schunk;
 6324|  3.78k|  dparams->postfilter = ctx->postfilter;
 6325|  3.78k|  dparams->postparams = ctx->postparams;
 6326|  3.78k|  dparams->typesize = ctx->typesize;
 6327|       |
 6328|  3.78k|  return BLOSC2_ERROR_SUCCESS;
 6329|  3.78k|}
register_filter_private:
 6541|  15.9k|int register_filter_private(blosc2_filter *filter) {
 6542|  15.9k|    BLOSC_ERROR_NULL(filter, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  15.9k|    do {                                            \
  |  |  105|  15.9k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 15.9k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  15.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 15.9k]
  |  |  ------------------
  ------------------
 6543|  15.9k|    if (g_nfilters == UINT8_MAX) {
  ------------------
  |  Branch (6543:9): [True: 0, False: 15.9k]
  ------------------
 6544|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6545|      0|        return BLOSC2_ERROR_CODEC_SUPPORT;
 6546|      0|    }
 6547|  15.9k|    if (filter->id < BLOSC2_GLOBAL_REGISTERED_FILTERS_START) {
  ------------------
  |  Branch (6547:9): [True: 0, False: 15.9k]
  ------------------
 6548|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6549|      0|        return BLOSC2_ERROR_FAILURE;
 6550|      0|    }
 6551|       |    /* This condition can never be fulfilled
 6552|       |    if (filter->id > BLOSC2_USER_REGISTERED_FILTERS_STOP) {
 6553|       |        BLOSC_TRACE_ERROR("The id must be less than or equal to %d", BLOSC2_USER_REGISTERED_FILTERS_STOP);
 6554|       |        return BLOSC2_ERROR_FAILURE;
 6555|       |    }
 6556|       |    */
 6557|       |
 6558|  47.9k|    for (uint64_t i = 0; i < g_nfilters; ++i) {
  ------------------
  |  Branch (6558:26): [True: 31.9k, False: 15.9k]
  ------------------
 6559|  31.9k|      if (g_filters[i].id == filter->id) {
  ------------------
  |  Branch (6559:11): [True: 0, False: 31.9k]
  ------------------
 6560|      0|        if (strcmp(g_filters[i].name, filter->name) != 0) {
  ------------------
  |  Branch (6560:13): [True: 0, False: 0]
  ------------------
 6561|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6562|      0|                            "  Choose another one !", filter->id, g_filters[i].name);
 6563|      0|          return BLOSC2_ERROR_FAILURE;
 6564|      0|        }
 6565|      0|        else {
 6566|       |          // Already registered, so no more actions needed
 6567|      0|          return BLOSC2_ERROR_SUCCESS;
 6568|      0|        }
 6569|      0|      }
 6570|  31.9k|    }
 6571|       |
 6572|  15.9k|    blosc2_filter *filter_new = &g_filters[g_nfilters++];
 6573|  15.9k|    memcpy(filter_new, filter, sizeof(blosc2_filter));
 6574|       |
 6575|  15.9k|    return BLOSC2_ERROR_SUCCESS;
 6576|  15.9k|}
register_codec_private:
 6591|  28.7k|int register_codec_private(blosc2_codec *codec) {
 6592|  28.7k|    BLOSC_ERROR_NULL(codec, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  28.7k|    do {                                            \
  |  |  105|  28.7k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 28.7k]
  |  |  ------------------
  |  |  106|      0|            BLOSC_TRACE_ERROR("Pointer is null");   \
  |  |  ------------------
  |  |  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  107|      0|            return (rc);                            \
  |  |  108|      0|        }                                           \
  |  |  109|  28.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 28.7k]
  |  |  ------------------
  ------------------
 6593|  28.7k|    if (g_ncodecs == UINT8_MAX) {
  ------------------
  |  Branch (6593:9): [True: 0, False: 28.7k]
  ------------------
 6594|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6595|      0|      return BLOSC2_ERROR_CODEC_SUPPORT;
 6596|      0|    }
 6597|  28.7k|    if (codec->compcode < BLOSC2_GLOBAL_REGISTERED_CODECS_START) {
  ------------------
  |  Branch (6597:9): [True: 0, False: 28.7k]
  ------------------
 6598|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6599|      0|      return BLOSC2_ERROR_FAILURE;
 6600|      0|    }
 6601|       |    /* This condition can never be fulfilled
 6602|       |    if (codec->compcode > BLOSC2_USER_REGISTERED_CODECS_STOP) {
 6603|       |      BLOSC_TRACE_ERROR("The id must be less or equal to %d", BLOSC2_USER_REGISTERED_CODECS_STOP);
 6604|       |      return BLOSC2_ERROR_FAILURE;
 6605|       |    }
 6606|       |     */
 6607|       |
 6608|   143k|    for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (6608:21): [True: 115k, False: 28.7k]
  ------------------
 6609|   115k|      if (g_codecs[i].compcode == codec->compcode) {
  ------------------
  |  Branch (6609:11): [True: 0, False: 115k]
  ------------------
 6610|      0|        if (strcmp(g_codecs[i].compname, codec->compname) != 0) {
  ------------------
  |  Branch (6610:13): [True: 0, False: 0]
  ------------------
 6611|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6612|      0|                            "  Choose another one !", codec->compcode, codec->compname);
 6613|      0|          return BLOSC2_ERROR_CODEC_PARAM;
 6614|      0|        }
 6615|      0|        else {
 6616|       |          // Already registered, so no more actions needed
 6617|      0|          return BLOSC2_ERROR_SUCCESS;
 6618|      0|        }
 6619|      0|      }
 6620|   115k|    }
 6621|       |
 6622|  28.7k|    blosc2_codec *codec_new = &g_codecs[g_ncodecs++];
 6623|  28.7k|    memcpy(codec_new, codec, sizeof(blosc2_codec));
 6624|       |
 6625|  28.7k|    return BLOSC2_ERROR_SUCCESS;
 6626|  28.7k|}
register_tuner_private:
 6641|  3.19k|int register_tuner_private(blosc2_tuner *tuner) {
 6642|  3.19k|  BLOSC_ERROR_NULL(tuner, BLOSC2_ERROR_INVALID_PARAM);
  ------------------
  |  |  104|  3.19k|    do {                                            \
  |  |  105|  3.19k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 3.19k]
  |  |  ------------------
  |  |  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.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 3.19k]
  |  |  ------------------
  ------------------
 6643|  3.19k|  if (g_ntuners == UINT8_MAX) {
  ------------------
  |  Branch (6643:7): [True: 0, False: 3.19k]
  ------------------
 6644|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6645|      0|    return BLOSC2_ERROR_CODEC_SUPPORT;
 6646|      0|  }
 6647|  3.19k|  if (tuner->id < BLOSC2_GLOBAL_REGISTERED_TUNER_START) {
  ------------------
  |  Branch (6647:7): [True: 0, False: 3.19k]
  ------------------
 6648|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6649|      0|    return BLOSC2_ERROR_FAILURE;
 6650|      0|  }
 6651|       |
 6652|  3.19k|  for (int i = 0; i < g_ntuners; ++i) {
  ------------------
  |  Branch (6652:19): [True: 0, False: 3.19k]
  ------------------
 6653|      0|    if (g_tuners[i].id == tuner->id) {
  ------------------
  |  Branch (6653:9): [True: 0, False: 0]
  ------------------
 6654|      0|      if (strcmp(g_tuners[i].name, tuner->name) != 0) {
  ------------------
  |  Branch (6654:11): [True: 0, False: 0]
  ------------------
 6655|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6656|      0|                          "  Choose another one !", tuner->id, g_tuners[i].name);
 6657|      0|        return BLOSC2_ERROR_FAILURE;
 6658|      0|      }
 6659|      0|      else {
 6660|       |        // Already registered, so no more actions needed
 6661|      0|        return BLOSC2_ERROR_SUCCESS;
 6662|      0|      }
 6663|      0|    }
 6664|      0|  }
 6665|       |
 6666|  3.19k|  blosc2_tuner *tuner_new = &g_tuners[g_ntuners++];
 6667|  3.19k|  memcpy(tuner_new, tuner, sizeof(blosc2_tuner));
 6668|       |
 6669|  3.19k|  return BLOSC2_ERROR_SUCCESS;
 6670|  3.19k|}
_blosc2_register_io_cb:
 6683|  6.39k|int _blosc2_register_io_cb(const blosc2_io_cb *io) {
 6684|       |
 6685|  9.59k|  for (uint64_t i = 0; i < g_nio; ++i) {
  ------------------
  |  Branch (6685:24): [True: 9.58k, False: 2]
  ------------------
 6686|  9.58k|    if (g_ios[i].id == io->id) {
  ------------------
  |  Branch (6686:9): [True: 6.39k, False: 3.19k]
  ------------------
 6687|  6.39k|      if (strcmp(g_ios[i].name, io->name) != 0) {
  ------------------
  |  Branch (6687:11): [True: 0, False: 6.39k]
  ------------------
 6688|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6689|      0|                          "  Choose another one !", io->id, g_ios[i].name);
 6690|      0|        return BLOSC2_ERROR_PLUGIN_IO;
 6691|      0|      }
 6692|  6.39k|      else {
 6693|       |        // Already registered, so no more actions needed
 6694|  6.39k|        return BLOSC2_ERROR_SUCCESS;
 6695|  6.39k|      }
 6696|  6.39k|    }
 6697|  9.58k|  }
 6698|       |
 6699|      2|  blosc2_io_cb *io_new = &g_ios[g_nio++];
 6700|      2|  memcpy(io_new, io, sizeof(blosc2_io_cb));
 6701|       |
 6702|      2|  return BLOSC2_ERROR_SUCCESS;
 6703|  6.39k|}
blosc2_error_string:
 6815|      2|const char *blosc2_error_string(int error_code) {
 6816|      2|  switch (error_code) {
 6817|      2|    case BLOSC2_ERROR_FAILURE:
  ------------------
  |  Branch (6817:5): [True: 2, False: 0]
  ------------------
 6818|      2|      return "Generic failure";
 6819|      0|    case BLOSC2_ERROR_STREAM:
  ------------------
  |  Branch (6819:5): [True: 0, False: 2]
  ------------------
 6820|      0|      return "Bad stream";
 6821|      0|    case BLOSC2_ERROR_DATA:
  ------------------
  |  Branch (6821:5): [True: 0, False: 2]
  ------------------
 6822|      0|      return "Invalid data";
 6823|      0|    case BLOSC2_ERROR_MEMORY_ALLOC:
  ------------------
  |  Branch (6823:5): [True: 0, False: 2]
  ------------------
 6824|      0|      return "Memory alloc/realloc failure";
 6825|      0|    case BLOSC2_ERROR_READ_BUFFER:
  ------------------
  |  Branch (6825:5): [True: 0, False: 2]
  ------------------
 6826|      0|      return "Not enough space to read";
 6827|      0|    case BLOSC2_ERROR_WRITE_BUFFER:
  ------------------
  |  Branch (6827:5): [True: 0, False: 2]
  ------------------
 6828|      0|      return "Not enough space to write";
 6829|      0|    case BLOSC2_ERROR_CODEC_SUPPORT:
  ------------------
  |  Branch (6829:5): [True: 0, False: 2]
  ------------------
 6830|      0|      return "Codec not supported";
 6831|      0|    case BLOSC2_ERROR_CODEC_PARAM:
  ------------------
  |  Branch (6831:5): [True: 0, False: 2]
  ------------------
 6832|      0|      return "Invalid parameter supplied to codec";
 6833|      0|    case BLOSC2_ERROR_CODEC_DICT:
  ------------------
  |  Branch (6833:5): [True: 0, False: 2]
  ------------------
 6834|      0|      return "Codec dictionary error";
 6835|      0|    case BLOSC2_ERROR_VERSION_SUPPORT:
  ------------------
  |  Branch (6835:5): [True: 0, False: 2]
  ------------------
 6836|      0|      return "Version not supported";
 6837|      0|    case BLOSC2_ERROR_INVALID_HEADER:
  ------------------
  |  Branch (6837:5): [True: 0, False: 2]
  ------------------
 6838|      0|      return "Invalid value in header";
 6839|      0|    case BLOSC2_ERROR_INVALID_PARAM:
  ------------------
  |  Branch (6839:5): [True: 0, False: 2]
  ------------------
 6840|      0|      return "Invalid parameter supplied to function";
 6841|      0|    case BLOSC2_ERROR_FILE_READ:
  ------------------
  |  Branch (6841:5): [True: 0, False: 2]
  ------------------
 6842|      0|      return "File read failure";
 6843|      0|    case BLOSC2_ERROR_FILE_WRITE:
  ------------------
  |  Branch (6843:5): [True: 0, False: 2]
  ------------------
 6844|      0|      return "File write failure";
 6845|      0|    case BLOSC2_ERROR_FILE_OPEN:
  ------------------
  |  Branch (6845:5): [True: 0, False: 2]
  ------------------
 6846|      0|      return "File open failure";
 6847|      0|    case BLOSC2_ERROR_NOT_FOUND:
  ------------------
  |  Branch (6847:5): [True: 0, False: 2]
  ------------------
 6848|      0|      return "Not found";
 6849|      0|    case BLOSC2_ERROR_RUN_LENGTH:
  ------------------
  |  Branch (6849:5): [True: 0, False: 2]
  ------------------
 6850|      0|      return "Bad run length encoding";
 6851|      0|    case BLOSC2_ERROR_FILTER_PIPELINE:
  ------------------
  |  Branch (6851:5): [True: 0, False: 2]
  ------------------
 6852|      0|      return "Filter pipeline error";
 6853|      0|    case BLOSC2_ERROR_CHUNK_INSERT:
  ------------------
  |  Branch (6853:5): [True: 0, False: 2]
  ------------------
 6854|      0|      return "Chunk insert failure";
 6855|      0|    case BLOSC2_ERROR_CHUNK_APPEND:
  ------------------
  |  Branch (6855:5): [True: 0, False: 2]
  ------------------
 6856|      0|      return "Chunk append failure";
 6857|      0|    case BLOSC2_ERROR_CHUNK_UPDATE:
  ------------------
  |  Branch (6857:5): [True: 0, False: 2]
  ------------------
 6858|      0|      return "Chunk update failure";
 6859|      0|    case BLOSC2_ERROR_2GB_LIMIT:
  ------------------
  |  Branch (6859:5): [True: 0, False: 2]
  ------------------
 6860|      0|      return "Sizes larger than 2gb not supported";
 6861|      0|    case BLOSC2_ERROR_SCHUNK_COPY:
  ------------------
  |  Branch (6861:5): [True: 0, False: 2]
  ------------------
 6862|      0|      return "Super-chunk copy failure";
 6863|      0|    case BLOSC2_ERROR_FRAME_TYPE:
  ------------------
  |  Branch (6863:5): [True: 0, False: 2]
  ------------------
 6864|      0|      return "Wrong type for frame";
 6865|      0|    case BLOSC2_ERROR_FILE_TRUNCATE:
  ------------------
  |  Branch (6865:5): [True: 0, False: 2]
  ------------------
 6866|      0|      return "File truncate failure";
 6867|      0|    case BLOSC2_ERROR_THREAD_CREATE:
  ------------------
  |  Branch (6867:5): [True: 0, False: 2]
  ------------------
 6868|      0|      return "Thread or thread context creation failure";
 6869|      0|    case BLOSC2_ERROR_POSTFILTER:
  ------------------
  |  Branch (6869:5): [True: 0, False: 2]
  ------------------
 6870|      0|      return "Postfilter failure";
 6871|      0|    case BLOSC2_ERROR_FRAME_SPECIAL:
  ------------------
  |  Branch (6871:5): [True: 0, False: 2]
  ------------------
 6872|      0|      return "Special frame failure";
 6873|      0|    case BLOSC2_ERROR_SCHUNK_SPECIAL:
  ------------------
  |  Branch (6873:5): [True: 0, False: 2]
  ------------------
 6874|      0|      return "Special super-chunk failure";
 6875|      0|    case BLOSC2_ERROR_PLUGIN_IO:
  ------------------
  |  Branch (6875:5): [True: 0, False: 2]
  ------------------
 6876|      0|      return "IO plugin error";
 6877|      0|    case BLOSC2_ERROR_FILE_REMOVE:
  ------------------
  |  Branch (6877:5): [True: 0, False: 2]
  ------------------
 6878|      0|      return "Remove file failure";
 6879|      0|    case BLOSC2_ERROR_NULL_POINTER:
  ------------------
  |  Branch (6879:5): [True: 0, False: 2]
  ------------------
 6880|      0|      return "Pointer is null";
 6881|      0|    case BLOSC2_ERROR_INVALID_INDEX:
  ------------------
  |  Branch (6881:5): [True: 0, False: 2]
  ------------------
 6882|      0|      return "Invalid index";
 6883|      0|    case BLOSC2_ERROR_METALAYER_NOT_FOUND:
  ------------------
  |  Branch (6883:5): [True: 0, False: 2]
  ------------------
 6884|      0|      return "Metalayer has not been found";
 6885|      0|    case BLOSC2_ERROR_MAX_BUFSIZE_EXCEEDED:
  ------------------
  |  Branch (6885:5): [True: 0, False: 2]
  ------------------
 6886|      0|      return "Maximum buffersize exceeded";
 6887|      0|    case BLOSC2_ERROR_TUNER:
  ------------------
  |  Branch (6887:5): [True: 0, False: 2]
  ------------------
 6888|      0|      return "Tuner failure";
 6889|      0|    default:
  ------------------
  |  Branch (6889:5): [True: 0, False: 2]
  ------------------
 6890|      0|      return "Unknown error";
 6891|      2|  }
 6892|      2|}
blosc2.c:flags_to_filters:
  687|   149k|static void flags_to_filters(const uint8_t flags, uint8_t* filters) {
  688|       |  /* Initialize the filter pipeline */
  689|   149k|  memset(filters, 0, BLOSC2_MAX_FILTERS);
  690|       |  /* Fill the filter pipeline */
  691|   149k|  if (flags & BLOSC_DOSHUFFLE)
  ------------------
  |  Branch (691:7): [True: 144k, False: 5.72k]
  ------------------
  692|   144k|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_SHUFFLE;
  693|   149k|  if (flags & BLOSC_DOBITSHUFFLE)
  ------------------
  |  Branch (693:7): [True: 144k, False: 5.24k]
  ------------------
  694|   144k|    filters[BLOSC2_MAX_FILTERS - 1] = BLOSC_BITSHUFFLE;
  695|   149k|  if (flags & BLOSC_DODELTA)
  ------------------
  |  Branch (695:7): [True: 10.0k, False: 139k]
  ------------------
  696|  10.0k|    filters[BLOSC2_MAX_FILTERS - 2] = BLOSC_DELTA;
  697|   149k|}
blosc2.c:destroy_thread_context:
 2281|  3.13k|static void destroy_thread_context(struct thread_context* thread_context) {
 2282|  3.13k|  my_free(thread_context->tmp);
 2283|  3.13k|#if defined(HAVE_ZSTD)
 2284|  3.13k|  if (thread_context->zstd_cctx != NULL) {
  ------------------
  |  Branch (2284:7): [True: 0, False: 3.13k]
  ------------------
 2285|      0|    ZSTD_freeCCtx(thread_context->zstd_cctx);
 2286|      0|  }
 2287|  3.13k|  if (thread_context->zstd_dctx != NULL) {
  ------------------
  |  Branch (2287:7): [True: 1.87k, False: 1.26k]
  ------------------
 2288|  1.87k|    ZSTD_freeDCtx(thread_context->zstd_dctx);
 2289|  1.87k|  }
 2290|  3.13k|#endif
 2291|  3.13k|  if (thread_context->lz4_cstream != NULL) {
  ------------------
  |  Branch (2291:7): [True: 0, False: 3.13k]
  ------------------
 2292|      0|    LZ4_freeStream((LZ4_stream_t*)thread_context->lz4_cstream);
 2293|      0|  }
 2294|  3.13k|  if (thread_context->lz4hc_cstream != NULL) {
  ------------------
  |  Branch (2294:7): [True: 0, False: 3.13k]
  ------------------
 2295|      0|    LZ4_freeStreamHC((LZ4_streamHC_t*)thread_context->lz4hc_cstream);
 2296|      0|  }
 2297|  3.13k|}
blosc2.c:my_free:
  272|  9.46k|static void my_free(void* block) {
  273|       |#if defined(_WIN32)
  274|       |  _aligned_free(block);
  275|       |#else
  276|  9.46k|  free(block);
  277|  9.46k|#endif  /* _WIN32 */
  278|  9.46k|}
blosc2.c:filters_to_flags:
  664|  1.65k|static uint8_t filters_to_flags(const uint8_t* filters) {
  665|  1.65k|  uint8_t flags = 0;
  666|       |
  667|  11.5k|  for (int i = 0; i < BLOSC2_MAX_FILTERS; i++) {
  ------------------
  |  Branch (667:19): [True: 9.92k, False: 1.65k]
  ------------------
  668|  9.92k|    switch (filters[i]) {
  669|  1.13k|      case BLOSC_SHUFFLE:
  ------------------
  |  Branch (669:7): [True: 1.13k, False: 8.79k]
  ------------------
  670|  1.13k|        flags |= BLOSC_DOSHUFFLE;
  671|  1.13k|        break;
  672|    472|      case BLOSC_BITSHUFFLE:
  ------------------
  |  Branch (672:7): [True: 472, False: 9.45k]
  ------------------
  673|    472|        flags |= BLOSC_DOBITSHUFFLE;
  674|    472|        break;
  675|    766|      case BLOSC_DELTA:
  ------------------
  |  Branch (675:7): [True: 766, False: 9.15k]
  ------------------
  676|    766|        flags |= BLOSC_DODELTA;
  677|    766|        break;
  678|  7.55k|      default :
  ------------------
  |  Branch (678:7): [True: 7.55k, False: 2.37k]
  ------------------
  679|  7.55k|        break;
  680|  9.92k|    }
  681|  9.92k|  }
  682|  1.65k|  return flags;
  683|  1.65k|}
blosc2.c:blosc2_calculate_blocks:
  852|  3.15k|static inline void blosc2_calculate_blocks(blosc2_context* context) {
  853|       |  /* Compute number of blocks in buffer */
  854|  3.15k|  context->nblocks = context->sourcesize / context->blocksize;
  855|  3.15k|  context->leftover = context->sourcesize % context->blocksize;
  856|  3.15k|  context->nblocks = (context->leftover > 0) ?
  ------------------
  |  Branch (856:22): [True: 1.87k, False: 1.28k]
  ------------------
  857|  1.87k|                     (context->nblocks + 1) : context->nblocks;
  858|  3.15k|}
blosc2.c:clibcode_to_clibname:
  305|      3|static const char* clibcode_to_clibname(int clibcode) {
  306|      3|  if (clibcode == BLOSC_BLOSCLZ_LIB) return BLOSC_BLOSCLZ_LIBNAME;
  ------------------
  |  |  367|      0|#define BLOSC_BLOSCLZ_LIBNAME   "BloscLZ"
  ------------------
  |  Branch (306:7): [True: 0, False: 3]
  ------------------
  307|      3|  if (clibcode == BLOSC_LZ4_LIB) return BLOSC_LZ4_LIBNAME;
  ------------------
  |  |  368|      0|#define BLOSC_LZ4_LIBNAME       "LZ4"
  ------------------
  |  Branch (307:7): [True: 0, False: 3]
  ------------------
  308|      3|  if (clibcode == BLOSC_ZLIB_LIB) return BLOSC_ZLIB_LIBNAME;
  ------------------
  |  |  369|      0|#define BLOSC_ZLIB_LIBNAME      "Zlib"
  ------------------
  |  Branch (308:7): [True: 0, False: 3]
  ------------------
  309|      3|  if (clibcode == BLOSC_ZSTD_LIB) return BLOSC_ZSTD_LIBNAME;
  ------------------
  |  |  370|      0|#define BLOSC_ZSTD_LIBNAME      "Zstd"
  ------------------
  |  Branch (309:7): [True: 0, False: 3]
  ------------------
  310|     30|  for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (310:19): [True: 27, False: 3]
  ------------------
  311|     27|    if (clibcode == g_codecs[i].complib)
  ------------------
  |  Branch (311:9): [True: 0, False: 27]
  ------------------
  312|      0|      return g_codecs[i].compname;
  313|     27|  }
  314|      3|  return NULL;                  /* should never happen */
  315|      3|}
blosc2.c:blosc_run_decompression_with_context:
 3911|  3.18k|                                                void* dest, int32_t destsize) {
 3912|  3.18k|  blosc_header header;
 3913|  3.18k|  int32_t ntbytes;
 3914|  3.18k|  int rc;
 3915|       |
 3916|  3.18k|  rc = read_chunk_header(src, srcsize, true, &header);
 3917|  3.18k|  if (rc < 0) {
  ------------------
  |  Branch (3917:7): [True: 11, False: 3.17k]
  ------------------
 3918|     11|    return rc;
 3919|     11|  }
 3920|       |
 3921|  3.17k|  if (header.nbytes > destsize) {
  ------------------
  |  Branch (3921:7): [True: 2, False: 3.17k]
  ------------------
 3922|       |    // Not enough space for writing into the destination
 3923|      2|    return BLOSC2_ERROR_WRITE_BUFFER;
 3924|      2|  }
 3925|       |
 3926|  3.17k|  rc = initialize_context_decompression(context, &header, src, srcsize, dest, destsize);
 3927|  3.17k|  if (rc < 0) {
  ------------------
  |  Branch (3927:7): [True: 36, False: 3.13k]
  ------------------
 3928|     36|    return rc;
 3929|     36|  }
 3930|       |
 3931|       |  /* Do the actual decompression */
 3932|  3.13k|  ntbytes = do_job(context);
 3933|  3.13k|  if (ntbytes < 0) {
  ------------------
  |  Branch (3933:7): [True: 2.97k, False: 159]
  ------------------
 3934|  2.97k|    return ntbytes;
 3935|  2.97k|  }
 3936|       |
 3937|  3.13k|  assert(ntbytes <= (int32_t)destsize);
 3938|    159|  return ntbytes;
 3939|  3.13k|}
blosc2.c:initialize_context_decompression:
 2689|  3.17k|                                            int32_t srcsize, void* dest, int32_t destsize) {
 2690|  3.17k|  int32_t bstarts_end;
 2691|  3.17k|  bool vlblocks;
 2692|       |
 2693|  3.17k|  context->do_compress = 0;
 2694|  3.17k|  context->src = (const uint8_t*)src;
 2695|  3.17k|  context->srcsize = srcsize;
 2696|  3.17k|  context->dest = (uint8_t*)dest;
 2697|  3.17k|  context->destsize = destsize;
 2698|  3.17k|  context->output_bytes = 0;
 2699|  3.17k|  context->vlblock_sources = NULL;
 2700|  3.17k|  context->vlblock_dests = NULL;
 2701|  3.17k|  if (context->blocknbytes != NULL) {
  ------------------
  |  Branch (2701:7): [True: 0, False: 3.17k]
  ------------------
 2702|      0|    free(context->blocknbytes);
 2703|      0|    context->blocknbytes = NULL;
 2704|      0|  }
 2705|  3.17k|  if (context->blockoffsets != NULL) {
  ------------------
  |  Branch (2705:7): [True: 0, False: 3.17k]
  ------------------
 2706|      0|    free(context->blockoffsets);
 2707|      0|    context->blockoffsets = NULL;
 2708|      0|  }
 2709|  3.17k|  if (context->blockcbytes != NULL) {
  ------------------
  |  Branch (2709:7): [True: 0, False: 3.17k]
  ------------------
 2710|      0|    free(context->blockcbytes);
 2711|      0|    context->blockcbytes = NULL;
 2712|      0|  }
 2713|       |
 2714|  3.17k|  int rc = blosc2_initialize_context_from_header(context, header);
 2715|  3.17k|  if (rc < 0) {
  ------------------
  |  Branch (2715:7): [True: 0, False: 3.17k]
  ------------------
 2716|      0|    return rc;
 2717|      0|  }
 2718|  3.17k|  clear_context_decompression_dict(context);
 2719|  3.17k|  vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2720|  3.17k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (2720:19): [True: 1.65k, False: 1.51k]
  ------------------
 2721|  1.65k|                  (context->blosc2_flags & 0x08u));
  ------------------
  |  Branch (2721:19): [True: 9, False: 1.64k]
  ------------------
 2722|       |
 2723|       |  /* Check that we have enough space to decompress */
 2724|  3.17k|  if (context->sourcesize > (int32_t)context->destsize) {
  ------------------
  |  Branch (2724:7): [True: 0, False: 3.17k]
  ------------------
 2725|      0|    return BLOSC2_ERROR_WRITE_BUFFER;
 2726|      0|  }
 2727|       |
 2728|  3.17k|  if (context->block_maskout != NULL && context->block_maskout_nitems != context->nblocks) {
  ------------------
  |  Branch (2728:7): [True: 0, False: 3.17k]
  |  Branch (2728:41): [True: 0, False: 0]
  ------------------
 2729|      0|    BLOSC_TRACE_ERROR("The number of items in block_maskout (%d) must match the number"
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2730|      0|                      " of blocks in chunk (%d).",
 2731|      0|                      context->block_maskout_nitems, context->nblocks);
 2732|      0|    return BLOSC2_ERROR_DATA;
 2733|      0|  }
 2734|       |
 2735|  3.17k|  context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
 2736|  3.17k|  if (context->special_type > BLOSC2_SPECIAL_LASTID) {
  ------------------
  |  Branch (2736:7): [True: 0, False: 3.17k]
  ------------------
 2737|      0|    BLOSC_TRACE_ERROR("Unknown special values ID (%d) ",
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2738|      0|                      context->special_type);
 2739|      0|    return BLOSC2_ERROR_DATA;
 2740|      0|  }
 2741|       |
 2742|  3.17k|  int memcpyed = (context->header_flags & (uint8_t) BLOSC_MEMCPYED);
 2743|  3.17k|  if (memcpyed && (header->cbytes != header->nbytes + context->header_overhead)) {
  ------------------
  |  Branch (2743:7): [True: 14, False: 3.15k]
  |  Branch (2743:19): [True: 12, False: 2]
  ------------------
 2744|     12|    BLOSC_TRACE_ERROR("Wrong header info for this memcpyed chunk");
  ------------------
  |  |   93|     12|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     12|    do {                                            \
  |  |  |  |   98|     12|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     12|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     12|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2745|     12|    return BLOSC2_ERROR_DATA;
 2746|     12|  }
 2747|       |
 2748|  3.16k|  if ((header->nbytes == 0) && (header->cbytes == context->header_overhead) &&
  ------------------
  |  Branch (2748:7): [True: 0, False: 3.16k]
  |  Branch (2748:32): [True: 0, False: 0]
  ------------------
 2749|      0|      !context->special_type) {
  ------------------
  |  Branch (2749:7): [True: 0, False: 0]
  ------------------
 2750|       |    // A compressed buffer with only a header can only contain a zero-length buffer
 2751|      0|    return 0;
 2752|      0|  }
 2753|       |
 2754|  3.16k|  context->bstarts = (int32_t *) (context->src + context->header_overhead);
 2755|  3.16k|  bstarts_end = context->header_overhead;
 2756|  3.16k|  if (!context->special_type && !memcpyed) {
  ------------------
  |  Branch (2756:7): [True: 3.13k, False: 24]
  |  Branch (2756:33): [True: 3.13k, False: 2]
  ------------------
 2757|  3.13k|    size_t bstarts_end_tmp;
 2758|  3.13k|    size_t bstarts_nbytes;
 2759|  3.13k|    if (context->nblocks < 0 ||
  ------------------
  |  Branch (2759:9): [True: 0, False: 3.13k]
  ------------------
 2760|  3.13k|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (2760:9): [True: 0, False: 3.13k]
  ------------------
 2761|  3.13k|        !checked_add_size((size_t)context->header_overhead, bstarts_nbytes, &bstarts_end_tmp) ||
  ------------------
  |  Branch (2761:9): [True: 0, False: 3.13k]
  ------------------
 2762|  3.13k|        bstarts_end_tmp > (size_t)INT32_MAX) {
  ------------------
  |  Branch (2762:9): [True: 0, False: 3.13k]
  ------------------
 2763|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2764|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 2765|      0|    }
 2766|       |    /* If chunk is not special or a memcpyed, we do have a bstarts section */
 2767|  3.13k|    bstarts_end = (int32_t)bstarts_end_tmp;
 2768|  3.13k|  }
 2769|       |
 2770|  3.16k|  if (srcsize < bstarts_end) {
  ------------------
  |  Branch (2770:7): [True: 0, False: 3.16k]
  ------------------
 2771|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2772|      0|    return BLOSC2_ERROR_READ_BUFFER;
 2773|      0|  }
 2774|       |
 2775|  3.16k|  if (vlblocks && is_lazy && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (2775:7): [True: 14, False: 3.14k]
  |  Branch (2775:19): [True: 5, False: 9]
  |  Branch (2775:30): [True: 5, False: 0]
  |  Branch (2775:56): [True: 5, False: 0]
  ------------------
 2776|      5|    size_t block_csizes_nbytes;
 2777|      5|    size_t trailer_meta_nbytes;
 2778|      5|    size_t lazy_trailer_end;
 2779|      5|    if (context->srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (2779:9): [True: 0, False: 5]
  |  Branch (2779:33): [True: 0, False: 5]
  ------------------
 2780|      5|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (2780:9): [True: 0, False: 5]
  ------------------
 2781|      5|        !checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (2781:9): [True: 0, False: 5]
  ------------------
 2782|      5|        !checked_add_size((size_t)bstarts_end, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (2782:9): [True: 0, False: 5]
  ------------------
 2783|      5|        (size_t)context->srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (2783:9): [True: 3, False: 2]
  ------------------
 2784|      3|      BLOSC_TRACE_ERROR("Lazy trailer exceeds source buffer.");
  ------------------
  |  |   93|      3|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      3|    do {                                            \
  |  |  |  |   98|      3|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      3|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      3|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2785|      3|      return BLOSC2_ERROR_READ_BUFFER;
 2786|      3|    }
 2787|      5|  }
 2788|  3.15k|  srcsize -= bstarts_end;
 2789|       |
 2790|       |  /* Read optional dictionary if flag set */
 2791|  3.15k|  if ((context->blosc2_flags & BLOSC2_USEDICT) && !is_lazy) {
  ------------------
  |  Branch (2791:7): [True: 942, False: 2.21k]
  |  Branch (2791:51): [True: 942, False: 0]
  ------------------
 2792|    942|    context->use_dict = 1;
 2793|       |    // The dictionary section is after the bstarts block: [int32 size | raw bytes]
 2794|    942|    if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2794:9): [True: 0, False: 942]
  ------------------
 2795|      0|      BLOSC_TRACE_ERROR("Not enough space to read size of dictionary.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2796|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2797|      0|    }
 2798|    942|    srcsize -= sizeof(int32_t);
 2799|       |    // Read dictionary size
 2800|    942|    context->dict_size = sw32_(context->src + bstarts_end);
 2801|    942|    if (context->dict_size <= 0 || context->dict_size > BLOSC2_MAXDICTSIZE) {
  ------------------
  |  Branch (2801:9): [True: 0, False: 942]
  |  Branch (2801:36): [True: 2, False: 940]
  ------------------
 2802|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2803|      2|      return BLOSC2_ERROR_CODEC_DICT;
 2804|      2|    }
 2805|    940|    if (srcsize < (int32_t)context->dict_size) {
  ------------------
  |  Branch (2805:9): [True: 0, False: 940]
  ------------------
 2806|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2807|      0|      return BLOSC2_ERROR_READ_BUFFER;
 2808|      0|    }
 2809|    940|    srcsize -= context->dict_size;
 2810|       |    // dict_buffer points directly into the source chunk — no copy needed
 2811|    940|    context->dict_buffer = (void*)(context->src + bstarts_end + sizeof(int32_t));
 2812|    940|    context->dict_buffer_owned = false;
 2813|    940|#if defined(HAVE_ZSTD)
 2814|       |    // context->compcode during decompression holds the format code (flags >> 5),
 2815|       |    // so compare against BLOSC_ZSTD_FORMAT (not BLOSC_ZSTD).
 2816|    940|    if (context->compcode == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2816:9): [True: 787, False: 153]
  ------------------
 2817|    787|      context->dict_ddict = ZSTD_createDDict(context->dict_buffer, context->dict_size);
 2818|    787|      if (context->dict_ddict == NULL) {
  ------------------
  |  Branch (2818:11): [True: 8, False: 779]
  ------------------
 2819|      8|        BLOSC_TRACE_ERROR("Cannot create ZSTD dictionary for chunk.");
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2820|      8|        return BLOSC2_ERROR_CODEC_DICT;
 2821|      8|      }
 2822|    787|    }
 2823|    940|#endif   // HAVE_ZSTD
 2824|       |    // For LZ4/LZ4HC: dict_buffer and dict_size are sufficient; no digested object needed.
 2825|    940|  }
 2826|  2.21k|  else if ((context->blosc2_flags & BLOSC2_USEDICT) && is_lazy) {
  ------------------
  |  Branch (2826:12): [True: 0, False: 2.21k]
  |  Branch (2826:56): [True: 0, False: 0]
  ------------------
 2827|      0|    rc = load_lazy_chunk_dict(context, header, bstarts_end);
 2828|      0|    if (rc < 0) {
  ------------------
  |  Branch (2828:9): [True: 0, False: 0]
  ------------------
 2829|      0|      return rc;
 2830|      0|    }
 2831|      0|  }
 2832|       |
 2833|  3.14k|  if (vlblocks && !context->special_type && !memcpyed) {
  ------------------
  |  Branch (2833:7): [True: 11, False: 3.13k]
  |  Branch (2833:19): [True: 11, False: 0]
  |  Branch (2833:45): [True: 11, False: 0]
  ------------------
 2834|     11|    context->blocknbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 2835|     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]
  |  |  ------------------
  ------------------
 2836|     11|    context->blockoffsets = malloc((size_t)context->nblocks * sizeof(int32_t));
 2837|     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]
  |  |  ------------------
  ------------------
 2838|     11|    context->blockcbytes = malloc((size_t)context->nblocks * sizeof(int32_t));
 2839|     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]
  |  |  ------------------
  ------------------
 2840|       |
 2841|     11|    if (is_lazy) {
  ------------------
  |  Branch (2841:9): [True: 2, False: 9]
  ------------------
 2842|       |      // Lazy VL: block data is on disk, so blocknbytes is unknown at this point.
 2843|       |      // Populate blockcbytes from bstarts differences; blocksize gets max(blockcbytes)
 2844|       |      // as a safe upper bound so tmp buffers are large enough for the lazy block read.
 2845|      2|      int32_t max_csize = 0;
 2846|      8|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (2846:27): [True: 8, False: 0]
  ------------------
 2847|      8|        int32_t bstart = sw32_(context->bstarts + i);
 2848|      8|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (2848:31): [True: 8, False: 0]
  ------------------
 2849|      8|            sw32_(context->bstarts + i + 1) : header->cbytes;
 2850|      8|        if (bstart < bstarts_end || next_bstart <= bstart ||
  ------------------
  |  Branch (2850:13): [True: 0, False: 8]
  |  Branch (2850:37): [True: 1, False: 7]
  ------------------
 2851|      7|            next_bstart > header->cbytes) {
  ------------------
  |  Branch (2851:13): [True: 1, False: 6]
  ------------------
 2852|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2853|      2|          return BLOSC2_ERROR_INVALID_HEADER;
 2854|      2|        }
 2855|      6|        context->blocknbytes[i] = 0;   // unknown until block is read from disk
 2856|      6|        context->blockoffsets[i] = 0;  // unknown
 2857|      6|        context->blockcbytes[i] = next_bstart - bstart;
 2858|      6|        if (context->blockcbytes[i] > max_csize) {
  ------------------
  |  Branch (2858:13): [True: 2, False: 4]
  ------------------
 2859|      2|          max_csize = context->blockcbytes[i];
 2860|      2|        }
 2861|      6|      }
 2862|      0|      context->blocksize = max_csize;
 2863|      0|      context->leftover = 0;
 2864|      0|    }
 2865|      9|    else {
 2866|      9|      int32_t max_blocksize = 0;
 2867|      9|      int64_t total_nbytes = 0;
 2868|      9|      int32_t prev_bstart = 0;
 2869|     18|      for (int32_t i = 0; i < context->nblocks; ++i) {
  ------------------
  |  Branch (2869:27): [True: 15, False: 3]
  ------------------
 2870|     15|        int32_t bstart = sw32_(context->bstarts + i);
 2871|     15|        int32_t next_bstart = (i + 1 < context->nblocks) ?
  ------------------
  |  Branch (2871:31): [True: 11, False: 4]
  ------------------
 2872|     11|            sw32_(context->bstarts + i + 1) : header->cbytes;
 2873|     15|        if (bstart < bstarts_end || bstart <= prev_bstart || next_bstart <= bstart ||
  ------------------
  |  Branch (2873:13): [True: 1, False: 14]
  |  Branch (2873:37): [True: 0, False: 14]
  |  Branch (2873:62): [True: 3, False: 11]
  ------------------
 2874|     11|            next_bstart > header->cbytes || bstart > context->srcsize - (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (2874:13): [True: 1, False: 10]
  |  Branch (2874:45): [True: 0, False: 10]
  ------------------
 2875|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2876|      5|          return BLOSC2_ERROR_INVALID_HEADER;
 2877|      5|        }
 2878|     10|        context->blocknbytes[i] = sw32_(context->src + bstart);
 2879|     10|        context->blockcbytes[i] = next_bstart - bstart;
 2880|     10|        if (context->blocknbytes[i] <= 0) {
  ------------------
  |  Branch (2880:13): [True: 0, False: 10]
  ------------------
 2881|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2882|      0|          return BLOSC2_ERROR_INVALID_HEADER;
 2883|      0|        }
 2884|     10|        if (total_nbytes > INT32_MAX) {
  ------------------
  |  Branch (2884:13): [True: 0, False: 10]
  ------------------
 2885|      0|          BLOSC_TRACE_ERROR("Invalid VL-block cumulative size in chunk.");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2886|      0|          return BLOSC2_ERROR_INVALID_HEADER;
 2887|      0|        }
 2888|     10|        context->blockoffsets[i] = (int32_t)total_nbytes;
 2889|     10|        total_nbytes += context->blocknbytes[i];
 2890|     10|        if (total_nbytes > context->sourcesize) {
  ------------------
  |  Branch (2890:13): [True: 1, False: 9]
  ------------------
 2891|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2892|      1|          return BLOSC2_ERROR_INVALID_HEADER;
 2893|      1|        }
 2894|      9|        if (context->blocknbytes[i] > max_blocksize) {
  ------------------
  |  Branch (2894:13): [True: 9, False: 0]
  ------------------
 2895|      9|          max_blocksize = context->blocknbytes[i];
 2896|      9|        }
 2897|      9|        prev_bstart = bstart;
 2898|      9|      }
 2899|      3|      if (total_nbytes != context->sourcesize) {
  ------------------
  |  Branch (2899:11): [True: 3, False: 0]
  ------------------
 2900|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2901|      3|        return BLOSC2_ERROR_INVALID_HEADER;
 2902|      3|      }
 2903|      0|      context->blocksize = max_blocksize;
 2904|      0|      context->leftover = 0;
 2905|      0|    }
 2906|     11|  }
 2907|       |
 2908|  3.13k|  return 0;
 2909|  3.14k|}
blosc2.c:do_job:
 2354|  3.13k|static int do_job(blosc2_context* context) {
 2355|  3.13k|  int32_t ntbytes;
 2356|       |
 2357|       |  /* Set sentinels */
 2358|  3.13k|  context->dref_not_init = 1;
 2359|       |
 2360|       |  /* Check whether we need to restart threads */
 2361|  3.13k|  check_nthreads(context);
 2362|       |
 2363|       |  /* Run the serial version when nthreads is 1 or when the buffers are
 2364|       |     not larger than blocksize */
 2365|  3.13k|  if (context->nthreads == 1 || (context->sourcesize / context->blocksize) <= 1) {
  ------------------
  |  Branch (2365:7): [True: 3.13k, False: 0]
  |  Branch (2365:33): [True: 0, False: 0]
  ------------------
 2366|       |    /* The context for this 'thread' has no been initialized yet */
 2367|  3.13k|    if (context->serial_context == NULL) {
  ------------------
  |  Branch (2367:9): [True: 3.13k, False: 0]
  ------------------
 2368|  3.13k|      context->serial_context = create_thread_context(context, 0);
 2369|  3.13k|    }
 2370|      0|    else if (context->blocksize != context->serial_context->tmp_blocksize) {
  ------------------
  |  Branch (2370:14): [True: 0, False: 0]
  ------------------
 2371|      0|      free_thread_context(context->serial_context);
 2372|      0|      context->serial_context = create_thread_context(context, 0);
 2373|      0|    }
 2374|  3.13k|    BLOSC_ERROR_NULL(context->serial_context, BLOSC2_ERROR_THREAD_CREATE);
  ------------------
  |  |  104|  3.13k|    do {                                            \
  |  |  105|  3.13k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 3.13k]
  |  |  ------------------
  |  |  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.13k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 3.13k]
  |  |  ------------------
  ------------------
 2375|  3.13k|    ntbytes = serial_blosc(context->serial_context);
 2376|  3.13k|  }
 2377|      0|  else {
 2378|      0|    ntbytes = parallel_blosc(context);
 2379|      0|  }
 2380|       |
 2381|  3.13k|  return ntbytes;
 2382|  3.13k|}
blosc2.c:serial_blosc:
 2166|  3.13k|static int serial_blosc(struct thread_context* thread_context) {
 2167|  3.13k|  blosc2_context* context = thread_context->parent_context;
 2168|  3.13k|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 2169|  3.13k|  int32_t j, bsize, leftoverblock;
 2170|  3.13k|  int32_t cbytes;
 2171|  3.13k|  int32_t ntbytes = context->output_bytes;
 2172|  3.13k|  int32_t* bstarts = context->bstarts;
 2173|  3.13k|  uint8_t* tmp = thread_context->tmp;
 2174|  3.13k|  uint8_t* tmp2 = thread_context->tmp2;
 2175|  3.13k|  int dict_training = context->use_dict && (context->dict_cdict == NULL);
  ------------------
  |  Branch (2175:23): [True: 932, False: 2.20k]
  |  Branch (2175:44): [True: 932, False: 0]
  ------------------
 2176|  3.13k|  bool memcpyed = context->header_flags & (uint8_t)BLOSC_MEMCPYED;
 2177|  3.13k|  if (!context->do_compress && context->special_type) {
  ------------------
  |  Branch (2177:7): [True: 3.13k, False: 0]
  |  Branch (2177:32): [True: 24, False: 3.11k]
  ------------------
 2178|       |    // Fake a runlen as if it was a memcpyed chunk
 2179|     24|    memcpyed = true;
 2180|     24|  }
 2181|       |
 2182|   140k|  for (j = 0; j < context->nblocks; j++) {
  ------------------
  |  Branch (2182:15): [True: 140k, False: 159]
  ------------------
 2183|   140k|    if (context->do_compress && !memcpyed && !dict_training) {
  ------------------
  |  Branch (2183:9): [True: 0, False: 140k]
  |  Branch (2183:33): [True: 0, False: 0]
  |  Branch (2183:46): [True: 0, False: 0]
  ------------------
 2184|      0|      _sw32(bstarts + j, ntbytes);
 2185|      0|    }
 2186|   140k|    bsize = vlblocks ? context->blocknbytes[j] : context->blocksize;
  ------------------
  |  Branch (2186:13): [True: 0, False: 140k]
  ------------------
 2187|   140k|    leftoverblock = 0;
 2188|   140k|    if (!vlblocks && (j == context->nblocks - 1) && (context->leftover > 0)) {
  ------------------
  |  Branch (2188:9): [True: 140k, False: 0]
  |  Branch (2188:22): [True: 1.43k, False: 139k]
  |  Branch (2188:53): [True: 189, False: 1.24k]
  ------------------
 2189|    189|      bsize = context->leftover;
 2190|    189|      leftoverblock = 1;
 2191|    189|    }
 2192|   140k|    if (context->do_compress) {
  ------------------
  |  Branch (2192:9): [True: 0, False: 140k]
  ------------------
 2193|      0|      if (memcpyed && !context->prefilter) {
  ------------------
  |  Branch (2193:11): [True: 0, False: 0]
  |  Branch (2193:23): [True: 0, False: 0]
  ------------------
 2194|       |        /* We want to memcpy only */
 2195|      0|        memcpy(context->dest + context->header_overhead + j * context->blocksize,
 2196|      0|               context->src + j * context->blocksize, (unsigned int)bsize);
 2197|      0|        cbytes = (int32_t)bsize;
 2198|      0|      }
 2199|      0|      else {
 2200|       |        /* Regular compression */
 2201|      0|        cbytes = blosc_c(thread_context, bsize, leftoverblock, ntbytes,
 2202|      0|                         context->destsize,
 2203|      0|                         vlblocks ? context->vlblock_sources[j] : context->src,
  ------------------
  |  Branch (2203:26): [True: 0, False: 0]
  ------------------
 2204|      0|                         vlblocks ? 0 : j * context->blocksize,
  ------------------
  |  Branch (2204:26): [True: 0, False: 0]
  ------------------
 2205|      0|                         context->dest + ntbytes, tmp, tmp2);
 2206|      0|        if (cbytes == 0) {
  ------------------
  |  Branch (2206:13): [True: 0, False: 0]
  ------------------
 2207|      0|          ntbytes = 0;              /* incompressible data */
 2208|      0|          break;
 2209|      0|        }
 2210|      0|      }
 2211|      0|    }
 2212|   140k|    else {
 2213|       |      /* Regular decompression */
 2214|       |      // If memcpyed we don't have a bstarts section (because it is not needed)
 2215|   140k|      int32_t src_offset = memcpyed ?
  ------------------
  |  Branch (2215:28): [True: 131k, False: 8.72k]
  ------------------
 2216|   131k|          context->header_overhead + j * context->blocksize : sw32_(bstarts + j);
 2217|   140k|      uint8_t *dest_block = (vlblocks && context->vlblock_dests != NULL) ? context->vlblock_dests[j] : context->dest;
  ------------------
  |  Branch (2217:30): [True: 0, False: 140k]
  |  Branch (2217:42): [True: 0, False: 0]
  ------------------
 2218|   140k|      int32_t dest_offset = (vlblocks && context->vlblock_dests != NULL) ? 0 :
  ------------------
  |  Branch (2218:30): [True: 0, False: 140k]
  |  Branch (2218:42): [True: 0, False: 0]
  ------------------
 2219|   140k|                            (vlblocks ? context->blockoffsets[j] : j * context->blocksize);
  ------------------
  |  Branch (2219:30): [True: 0, False: 140k]
  ------------------
 2220|   140k|      cbytes = blosc_d(thread_context, bsize, leftoverblock, memcpyed,
 2221|   140k|                       context->src, context->srcsize, src_offset, j,
 2222|   140k|                       dest_block, dest_offset, tmp, tmp2);
 2223|   140k|    }
 2224|       |
 2225|   140k|    if (cbytes < 0) {
  ------------------
  |  Branch (2225:9): [True: 2.97k, False: 137k]
  ------------------
 2226|  2.97k|      ntbytes = cbytes;         /* error in blosc_c or blosc_d */
 2227|  2.97k|      break;
 2228|  2.97k|    }
 2229|   137k|    ntbytes += cbytes;
 2230|   137k|  }
 2231|       |
 2232|  3.13k|  return ntbytes;
 2233|  3.13k|}
blosc2.c:set_nans:
 1610|    395|static int32_t set_nans(int32_t typesize, uint8_t* dest, int32_t destsize) {
 1611|    395|  if (destsize % typesize != 0) {
  ------------------
  |  Branch (1611:7): [True: 1, False: 394]
  ------------------
 1612|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1613|      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]
  |  |  ------------------
  ------------------
 1614|      1|  }
 1615|    394|  int32_t nitems = destsize / typesize;
 1616|    394|  if (nitems == 0) {
  ------------------
  |  Branch (1616:7): [True: 0, False: 394]
  ------------------
 1617|      0|    return 0;
 1618|      0|  }
 1619|       |
 1620|    394|  if (typesize == 4) {
  ------------------
  |  Branch (1620:7): [True: 305, False: 89]
  ------------------
 1621|    305|    float* dest_ = (float*)dest;
 1622|    305|    float val = nanf("");
 1623|  2.71k|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1623:21): [True: 2.40k, False: 305]
  ------------------
 1624|  2.40k|      dest_[i] = val;
 1625|  2.40k|    }
 1626|    305|    return nitems;
 1627|    305|  }
 1628|     89|  else if (typesize == 8) {
  ------------------
  |  Branch (1628:12): [True: 85, False: 4]
  ------------------
 1629|     85|    double* dest_ = (double*)dest;
 1630|     85|    double val = nan("");
 1631|    446|    for (int i = 0; i < nitems; i++) {
  ------------------
  |  Branch (1631:21): [True: 361, False: 85]
  ------------------
 1632|    361|      dest_[i] = val;
 1633|    361|    }
 1634|     85|    return nitems;
 1635|     85|  }
 1636|       |
 1637|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1638|      4|  return BLOSC2_ERROR_DATA;
 1639|    394|}
blosc2.c:my_malloc:
  243|  9.46k|static uint8_t* my_malloc(size_t size) {
  244|  9.46k|  void* block = NULL;
  245|  9.46k|  int res = 0;
  246|       |  /* Keep aligned allocations valid under Valgrind and POSIX wrappers. */
  247|  9.46k|  if (size == 0) {
  ------------------
  |  Branch (247:7): [True: 0, False: 9.46k]
  ------------------
  248|      0|    size = 1;
  249|      0|  }
  250|       |
  251|       |/* Do an alignment to 32 bytes because AVX2 is supported */
  252|       |#if defined(_WIN32)
  253|       |  /* A (void *) cast needed for avoiding a warning with MINGW :-/ */
  254|       |  block = (void *)_aligned_malloc(size, 32);
  255|       |#elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600
  256|       |  /* Platform does have an implementation of posix_memalign */
  257|  9.46k|  res = posix_memalign(&block, 32, size);
  258|       |#else
  259|       |  block = malloc(size);
  260|       |#endif  /* _WIN32 */
  261|       |
  262|  9.46k|  if (block == NULL || res != 0) {
  ------------------
  |  Branch (262:7): [True: 0, False: 9.46k]
  |  Branch (262:24): [True: 0, False: 9.46k]
  ------------------
  263|      0|    BLOSC_TRACE_ERROR("Error allocating memory!");
  ------------------
  |  |   93|      0|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      0|    do {                                            \
  |  |  |  |   98|      0|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      0|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      0|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  264|      0|    return NULL;
  265|      0|  }
  266|       |
  267|  9.46k|  return (uint8_t*)block;
  268|  9.46k|}
blosc2.c:blosc_d:
 1717|   140k|    int32_t nblock, uint8_t* dest, int32_t dest_offset, uint8_t* tmp, uint8_t* tmp2) {
 1718|   140k|  blosc2_context* context = thread_context->parent_context;
 1719|   140k|  uint8_t* filters = context->filters;
 1720|   140k|  uint8_t *tmp3 = thread_context->tmp4;
 1721|   140k|  bool vlblocks = (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) != 0;
 1722|   140k|  int32_t compformat = (context->header_flags & (uint8_t)0xe0) >> 5u;
 1723|   140k|  int dont_split = (context->header_flags & 0x10) >> 4;
 1724|   140k|  int32_t chunk_nbytes;
 1725|   140k|  int32_t chunk_cbytes;
 1726|   140k|  int nstreams;
 1727|   140k|  int32_t neblock;
 1728|   140k|  int32_t nbytes;                /* number of decompressed bytes in split */
 1729|   140k|  int32_t cbytes;                /* number of compressed bytes in split */
 1730|       |  // int32_t ctbytes = 0;           /* number of compressed bytes in block */
 1731|   140k|  int32_t ntbytes = 0;           /* number of uncompressed bytes in block */
 1732|   140k|  uint8_t* _dest;
 1733|   140k|  int32_t typesize = context->typesize;
 1734|   140k|  bool instr_codec = context->blosc2_flags & BLOSC2_INSTR_CODEC;
 1735|   140k|  const char* compname;
 1736|   140k|  int rc;
 1737|       |
 1738|   140k|  if (context->block_maskout != NULL && context->block_maskout[nblock]) {
  ------------------
  |  Branch (1738:7): [True: 0, False: 140k]
  |  Branch (1738:41): [True: 0, False: 0]
  ------------------
 1739|       |    // Do not decompress, but act as if we successfully decompressed everything
 1740|      0|    return bsize;
 1741|      0|  }
 1742|       |
 1743|   140k|  rc = blosc2_cbuffer_sizes(src, &chunk_nbytes, &chunk_cbytes, NULL);
 1744|   140k|  if (rc < 0) {
  ------------------
  |  Branch (1744:7): [True: 0, False: 140k]
  ------------------
 1745|      0|    return rc;
 1746|      0|  }
 1747|   140k|  if (context->special_type == BLOSC2_SPECIAL_VALUE) {
  ------------------
  |  Branch (1747:7): [True: 0, False: 140k]
  ------------------
 1748|       |    // We need the actual typesize in this case, but it cannot be encoded in the header, so derive it from cbytes
 1749|      0|    typesize = chunk_cbytes - context->header_overhead;
 1750|      0|  }
 1751|       |
 1752|       |  // In some situations (lazychunks) the context can arrive uninitialized
 1753|       |  // (but BITSHUFFLE needs it for accessing the format of the chunk)
 1754|   140k|  if (context->src == NULL) {
  ------------------
  |  Branch (1754:7): [True: 0, False: 140k]
  ------------------
 1755|      0|    context->src = src;
 1756|      0|  }
 1757|       |
 1758|       |  // Chunks with special values cannot be lazy
 1759|   140k|  bool is_lazy = ((context->header_overhead == BLOSC_EXTENDED_HEADER_LENGTH) &&
  ------------------
  |  Branch (1759:19): [True: 138k, False: 1.89k]
  ------------------
 1760|   138k|          (context->blosc2_flags & 0x08u) && !context->special_type);
  ------------------
  |  Branch (1760:11): [True: 27, False: 138k]
  |  Branch (1760:46): [True: 0, False: 27]
  ------------------
 1761|   140k|  if (is_lazy) {
  ------------------
  |  Branch (1761:7): [True: 0, False: 140k]
  ------------------
 1762|       |    // The chunk is on disk, so just lazily load the block
 1763|      0|    if (context->schunk == NULL) {
  ------------------
  |  Branch (1763:9): [True: 0, False: 0]
  ------------------
 1764|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1765|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 1766|      0|    }
 1767|      0|    if (context->schunk->frame == NULL) {
  ------------------
  |  Branch (1767:9): [True: 0, False: 0]
  ------------------
 1768|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1769|      0|      return BLOSC2_ERROR_INVALID_PARAM;
 1770|      0|    }
 1771|      0|    blosc2_frame_s* frame = (blosc2_frame_s*)context->schunk->frame;
 1772|      0|    char* urlpath = frame->urlpath;
 1773|      0|    size_t bstarts_nbytes;
 1774|      0|    size_t trailer_offset;
 1775|      0|    size_t block_csizes_nbytes;
 1776|      0|    size_t trailer_meta_nbytes;
 1777|      0|    size_t lazy_trailer_end;
 1778|      0|    if (srcsize < 0 || context->nblocks < 0 ||
  ------------------
  |  Branch (1778:9): [True: 0, False: 0]
  |  Branch (1778:24): [True: 0, False: 0]
  ------------------
 1779|      0|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &bstarts_nbytes) ||
  ------------------
  |  Branch (1779:9): [True: 0, False: 0]
  ------------------
 1780|      0|        !checked_add_size((size_t)BLOSC_EXTENDED_HEADER_LENGTH, bstarts_nbytes, &trailer_offset) ||
  ------------------
  |  Branch (1780:9): [True: 0, False: 0]
  ------------------
 1781|      0|        !checked_mul_size((size_t)context->nblocks, sizeof(int32_t), &block_csizes_nbytes) ||
  ------------------
  |  Branch (1781:9): [True: 0, False: 0]
  ------------------
 1782|      0|        !checked_add_size(sizeof(int32_t) + sizeof(int64_t), block_csizes_nbytes, &trailer_meta_nbytes) ||
  ------------------
  |  Branch (1782:9): [True: 0, False: 0]
  ------------------
 1783|      0|        !checked_add_size(trailer_offset, trailer_meta_nbytes, &lazy_trailer_end) ||
  ------------------
  |  Branch (1783:9): [True: 0, False: 0]
  ------------------
 1784|      0|        (size_t)srcsize < lazy_trailer_end) {
  ------------------
  |  Branch (1784:9): [True: 0, False: 0]
  ------------------
 1785|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1786|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1787|      0|    }
 1788|      0|    int32_t nchunk;
 1789|      0|    int64_t chunk_offset;
 1790|       |    // The nchunk and the offset of the current chunk are in the trailer
 1791|      0|    memcpy(&nchunk, src + trailer_offset, sizeof(nchunk));
 1792|      0|    memcpy(&chunk_offset, src + trailer_offset + sizeof(int32_t), sizeof(chunk_offset));
 1793|       |    // Get the csize of the nblock
 1794|      0|    if (nblock < 0 || nblock >= context->nblocks) {
  ------------------
  |  Branch (1794:9): [True: 0, False: 0]
  |  Branch (1794:23): [True: 0, False: 0]
  ------------------
 1795|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1796|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1797|      0|    }
 1798|      0|    int32_t *block_csizes = (int32_t *)(src + trailer_offset + sizeof(int32_t) + sizeof(int64_t));
 1799|      0|    int32_t block_csize = block_csizes[nblock];
 1800|      0|    int32_t max_lazy_block_csize = context->blocksize + context->typesize * (signed)sizeof(int32_t);
 1801|      0|    if (block_csize <= 0 || block_csize > max_lazy_block_csize) {
  ------------------
  |  Branch (1801:9): [True: 0, False: 0]
  |  Branch (1801:29): [True: 0, False: 0]
  ------------------
 1802|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1803|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1804|      0|    }
 1805|      0|    if (vlblocks && block_csize <= (int32_t)sizeof(int32_t)) {
  ------------------
  |  Branch (1805:9): [True: 0, False: 0]
  |  Branch (1805:21): [True: 0, False: 0]
  ------------------
 1806|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1807|      0|      return BLOSC2_ERROR_INVALID_HEADER;
 1808|      0|    }
 1809|       |    // Read the lazy block on disk
 1810|      0|    void* fp = NULL;
 1811|      0|    blosc2_io_cb *io_cb = blosc2_get_io_cb(context->schunk->storage->io->id);
 1812|      0|    if (io_cb == NULL) {
  ------------------
  |  Branch (1812:9): [True: 0, False: 0]
  ------------------
 1813|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1814|      0|      return BLOSC2_ERROR_PLUGIN_IO;
 1815|      0|    }
 1816|       |
 1817|      0|    int64_t io_pos = 0;
 1818|      0|    if (frame->sframe) {
  ------------------
  |  Branch (1818:9): [True: 0, False: 0]
  ------------------
 1819|       |      // The chunk is not in the frame
 1820|      0|      fp = sframe_open_chunk(frame->urlpath, nchunk, "rb", context->schunk->storage->io);
 1821|      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]
  |  |  ------------------
  ------------------
 1822|       |      // The offset of the block is src_offset
 1823|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (1823:11): [True: 0, False: 0]
  ------------------
 1824|      0|        io_cb->close(fp);
 1825|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1826|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1827|      0|      }
 1828|      0|      io_pos = src_offset;
 1829|      0|    }
 1830|      0|    else {
 1831|      0|      fp = io_cb->open(urlpath, "rb", context->schunk->storage->io->params);
 1832|      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]
  |  |  ------------------
  ------------------
 1833|       |      // The offset of the block is src_offset
 1834|      0|      if (src_offset < 0) {
  ------------------
  |  Branch (1834:11): [True: 0, False: 0]
  ------------------
 1835|      0|        io_cb->close(fp);
 1836|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1837|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1838|      0|      }
 1839|      0|      if (chunk_offset < 0) {
  ------------------
  |  Branch (1839:11): [True: 0, False: 0]
  ------------------
 1840|      0|        io_cb->close(fp);
 1841|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1842|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1843|      0|      }
 1844|      0|      if (frame->file_offset > INT64_MAX - chunk_offset) {
  ------------------
  |  Branch (1844:11): [True: 0, False: 0]
  ------------------
 1845|      0|        io_cb->close(fp);
 1846|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1847|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1848|      0|      }
 1849|      0|      io_pos = frame->file_offset + chunk_offset;
 1850|      0|      if (io_pos > INT64_MAX - src_offset) {
  ------------------
  |  Branch (1850:11): [True: 0, False: 0]
  ------------------
 1851|      0|        io_cb->close(fp);
 1852|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1853|      0|        return BLOSC2_ERROR_INVALID_HEADER;
 1854|      0|      }
 1855|      0|      io_pos += src_offset;
 1856|      0|    }
 1857|       |    // We can make use of tmp3 because it will be used after src is not needed anymore
 1858|      0|    int64_t rbytes = io_cb->read((void**)&tmp3, 1, block_csize, io_pos, fp);
 1859|      0|    io_cb->close(fp);
 1860|      0|    if ((int32_t)rbytes != block_csize) {
  ------------------
  |  Branch (1860:9): [True: 0, False: 0]
  ------------------
 1861|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1862|      0|      return BLOSC2_ERROR_READ_BUFFER;
 1863|      0|    }
 1864|      0|    src = tmp3;
 1865|      0|    src_offset = 0;
 1866|      0|    srcsize = block_csize;
 1867|      0|  }
 1868|       |
 1869|       |  // If the chunk is memcpyed, we just have to copy the block to dest and return
 1870|   140k|  if (memcpyed) {
  ------------------
  |  Branch (1870:7): [True: 131k, False: 8.72k]
  ------------------
 1871|   131k|    int bsize_ = leftoverblock ? chunk_nbytes % context->blocksize : bsize;
  ------------------
  |  Branch (1871:18): [True: 10, False: 131k]
  ------------------
 1872|   131k|    if (!context->special_type) {
  ------------------
  |  Branch (1872:9): [True: 290, False: 131k]
  ------------------
 1873|    290|      if (chunk_nbytes + context->header_overhead != chunk_cbytes) {
  ------------------
  |  Branch (1873:11): [True: 0, False: 290]
  ------------------
 1874|      0|        return BLOSC2_ERROR_WRITE_BUFFER;
 1875|      0|      }
 1876|    290|      if (chunk_cbytes < context->header_overhead + (nblock * context->blocksize) + bsize_) {
  ------------------
  |  Branch (1876:11): [True: 0, False: 290]
  ------------------
 1877|       |        /* Not enough input to copy block */
 1878|      0|        return BLOSC2_ERROR_READ_BUFFER;
 1879|      0|      }
 1880|    290|    }
 1881|   131k|    if (!is_lazy) {
  ------------------
  |  Branch (1881:9): [True: 131k, False: 0]
  ------------------
 1882|   131k|      src += context->header_overhead + nblock * context->blocksize;
 1883|   131k|    }
 1884|   131k|    _dest = dest + dest_offset;
 1885|   131k|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (1885:9): [True: 0, False: 131k]
  ------------------
 1886|       |      // We are making use of a postfilter, so use a temp for destination
 1887|      0|      _dest = tmp;
 1888|      0|    }
 1889|   131k|    rc = 0;
 1890|   131k|    switch (context->special_type) {
 1891|      0|      case BLOSC2_SPECIAL_VALUE:
  ------------------
  |  Branch (1891:7): [True: 0, False: 131k]
  ------------------
 1892|       |        // All repeated values
 1893|      0|        rc = set_values(typesize, context->src, _dest, bsize_);
 1894|      0|        if (rc < 0) {
  ------------------
  |  Branch (1894:13): [True: 0, False: 0]
  ------------------
 1895|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1896|      0|          return BLOSC2_ERROR_DATA;
 1897|      0|        }
 1898|      0|        break;
 1899|    395|      case BLOSC2_SPECIAL_NAN:
  ------------------
  |  Branch (1899:7): [True: 395, False: 131k]
  ------------------
 1900|    395|        rc = set_nans(context->typesize, _dest, bsize_);
 1901|    395|        if (rc < 0) {
  ------------------
  |  Branch (1901:13): [True: 5, False: 390]
  ------------------
 1902|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1903|      5|          return BLOSC2_ERROR_DATA;
 1904|      5|        }
 1905|    390|        break;
 1906|    390|      case BLOSC2_SPECIAL_ZERO:
  ------------------
  |  Branch (1906:7): [True: 0, False: 131k]
  ------------------
 1907|      0|        memset(_dest, 0, bsize_);
 1908|      0|        break;
 1909|   131k|      case BLOSC2_SPECIAL_UNINIT:
  ------------------
  |  Branch (1909:7): [True: 131k, False: 685]
  ------------------
 1910|       |        // We do nothing here
 1911|   131k|        break;
 1912|    290|      default:
  ------------------
  |  Branch (1912:7): [True: 290, False: 131k]
  ------------------
 1913|    290|        memcpy(_dest, src, bsize_);
 1914|   131k|    }
 1915|   131k|    if (context->postfilter != NULL) {
  ------------------
  |  Branch (1915:9): [True: 0, False: 131k]
  ------------------
 1916|       |      // Create new postfilter parameters for this block (must be private for each thread)
 1917|      0|      blosc2_postfilter_params postparams;
 1918|      0|      memcpy(&postparams, context->postparams, sizeof(postparams));
 1919|      0|      postparams.input = tmp;
 1920|      0|      postparams.output = dest + dest_offset;
 1921|      0|      postparams.size = bsize;
 1922|      0|      postparams.typesize = typesize;
 1923|      0|      postparams.offset = nblock * context->blocksize;
 1924|      0|      postparams.nchunk = context->schunk != NULL ? context->schunk->current_nchunk : -1;
  ------------------
  |  Branch (1924:27): [True: 0, False: 0]
  ------------------
 1925|      0|      postparams.nblock = nblock;
 1926|      0|      postparams.tid = thread_context->tid;
 1927|      0|      postparams.ttmp = thread_context->tmp;
 1928|      0|      postparams.ttmp_nbytes = thread_context->tmp_nbytes;
 1929|      0|      postparams.ctx = context;
 1930|       |
 1931|       |      // Execute the postfilter (the processed block will be copied to dest)
 1932|      0|      if (context->postfilter(&postparams) != 0) {
  ------------------
  |  Branch (1932:11): [True: 0, False: 0]
  ------------------
 1933|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1934|      0|        return BLOSC2_ERROR_POSTFILTER;
 1935|      0|      }
 1936|      0|    }
 1937|   131k|    thread_context->zfp_cell_nitems = 0;
 1938|       |
 1939|   131k|    return bsize_;
 1940|   131k|  }
 1941|       |
 1942|  8.72k|  if (!is_lazy && (src_offset <= 0 || src_offset >= srcsize)) {
  ------------------
  |  Branch (1942:7): [True: 8.72k, False: 0]
  |  Branch (1942:20): [True: 84, False: 8.64k]
  |  Branch (1942:39): [True: 176, False: 8.46k]
  ------------------
 1943|       |    /* Invalid block src offset encountered */
 1944|    260|    return BLOSC2_ERROR_DATA;
 1945|    260|  }
 1946|       |
 1947|  8.46k|  src += src_offset;
 1948|  8.46k|  if (vlblocks) {
  ------------------
  |  Branch (1948:7): [True: 0, False: 8.46k]
  ------------------
 1949|      0|    if (context->blockcbytes == NULL || nblock >= context->nblocks ||
  ------------------
  |  Branch (1949:9): [True: 0, False: 0]
  |  Branch (1949:41): [True: 0, False: 0]
  ------------------
 1950|      0|        context->blockcbytes[nblock] <= (int32_t)sizeof(int32_t) ||
  ------------------
  |  Branch (1950:9): [True: 0, False: 0]
  ------------------
 1951|      0|        src_offset > srcsize - context->blockcbytes[nblock]) {
  ------------------
  |  Branch (1951:9): [True: 0, False: 0]
  ------------------
 1952|      0|      return BLOSC2_ERROR_DATA;
 1953|      0|    }
 1954|      0|    srcsize = context->blockcbytes[nblock];
 1955|      0|  }
 1956|  8.46k|  else {
 1957|  8.46k|    srcsize -= src_offset;
 1958|  8.46k|  }
 1959|       |
 1960|  8.46k|  int last_filter_index = last_filter(filters, 'd');
 1961|  8.46k|  if (instr_codec) {
  ------------------
  |  Branch (1961:7): [True: 928, False: 7.53k]
  ------------------
 1962|       |    // If instrumented, we don't want to run the filters
 1963|    928|    _dest = dest + dest_offset;
 1964|    928|  }
 1965|  7.53k|  else if (((last_filter_index >= 0) &&
  ------------------
  |  Branch (1965:13): [True: 7.17k, False: 364]
  ------------------
 1966|  7.17k|       (next_filter(filters, BLOSC2_MAX_FILTERS, 'd') != BLOSC_DELTA)) ||
  ------------------
  |  Branch (1966:8): [True: 5.15k, False: 2.01k]
  ------------------
 1967|  5.15k|    context->postfilter != NULL) {
  ------------------
  |  Branch (1967:5): [True: 0, False: 2.38k]
  ------------------
 1968|       |    // We are making use of some filter, so use a temp for destination
 1969|  5.15k|    _dest = tmp;
 1970|  5.15k|  }
 1971|  2.38k|  else {
 1972|       |    // If no filters, or only DELTA in pipeline
 1973|  2.38k|    _dest = dest + dest_offset;
 1974|  2.38k|  }
 1975|       |
 1976|       |  /* The number of compressed data streams for this block */
 1977|  8.46k|  if (vlblocks) {
  ------------------
  |  Branch (1977:7): [True: 0, False: 8.46k]
  ------------------
 1978|      0|    nstreams = 1;
 1979|      0|  }
 1980|  8.46k|  else if (!dont_split && !leftoverblock) {
  ------------------
  |  Branch (1980:12): [True: 2.84k, False: 5.61k]
  |  Branch (1980:27): [True: 2.82k, False: 21]
  ------------------
 1981|  2.82k|    nstreams = context->typesize;
 1982|  2.82k|  }
 1983|  5.63k|  else {
 1984|  5.63k|    nstreams = 1;
 1985|  5.63k|  }
 1986|       |
 1987|  8.46k|  neblock = bsize / nstreams;
 1988|  8.46k|  if (neblock == 0) {
  ------------------
  |  Branch (1988:7): [True: 0, False: 8.46k]
  ------------------
 1989|       |    /* Not enough space to output bytes */
 1990|      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]
  |  |  ------------------
  ------------------
 1991|      0|  }
 1992|  14.5k|  for (int j = 0; j < nstreams; j++) {
  ------------------
  |  Branch (1992:19): [True: 8.75k, False: 5.81k]
  ------------------
 1993|  8.75k|    if (vlblocks) {
  ------------------
  |  Branch (1993:9): [True: 0, False: 8.75k]
  ------------------
 1994|      0|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (1994:11): [True: 0, False: 0]
  ------------------
 1995|       |        /* Not enough input to read compressed bytes */
 1996|      0|        return BLOSC2_ERROR_READ_BUFFER;
 1997|      0|      }
 1998|      0|      neblock = sw32_(src);
 1999|      0|      if (neblock != bsize) {
  ------------------
  |  Branch (1999:11): [True: 0, False: 0]
  ------------------
 2000|      0|        return BLOSC2_ERROR_DATA;
 2001|      0|      }
 2002|      0|      src += sizeof(int32_t);
 2003|      0|      cbytes = srcsize - (int32_t)sizeof(int32_t);
 2004|      0|      srcsize = 0;
 2005|      0|    }
 2006|  8.75k|    else {
 2007|  8.75k|      if (srcsize < (signed)sizeof(int32_t)) {
  ------------------
  |  Branch (2007:11): [True: 1, False: 8.75k]
  ------------------
 2008|       |        /* Not enough input to read compressed size */
 2009|      1|        return BLOSC2_ERROR_READ_BUFFER;
 2010|      1|      }
 2011|  8.75k|      srcsize -= sizeof(int32_t);
 2012|  8.75k|      cbytes = sw32_(src);      /* amount of compressed bytes */
 2013|  8.75k|      if (cbytes > 0) {
  ------------------
  |  Branch (2013:11): [True: 7.45k, False: 1.30k]
  ------------------
 2014|  7.45k|        if (srcsize < cbytes) {
  ------------------
  |  Branch (2014:13): [True: 40, False: 7.41k]
  ------------------
 2015|       |          /* Not enough input to read compressed bytes */
 2016|     40|          return BLOSC2_ERROR_READ_BUFFER;
 2017|     40|        }
 2018|  7.41k|        srcsize -= cbytes;
 2019|  7.41k|      }
 2020|  8.71k|      src += sizeof(int32_t);
 2021|  8.71k|    }
 2022|       |    // ctbytes += (signed)sizeof(int32_t);
 2023|       |
 2024|       |    /* Uncompress */
 2025|  8.71k|    if (!vlblocks && cbytes == 0) {
  ------------------
  |  Branch (2025:9): [True: 8.71k, False: 0]
  |  Branch (2025:22): [True: 1.00k, False: 7.71k]
  ------------------
 2026|       |      // A run of 0's
 2027|  1.00k|      memset(_dest, 0, (unsigned int)neblock);
 2028|  1.00k|      nbytes = neblock;
 2029|  1.00k|    }
 2030|  7.71k|    else if (!vlblocks && cbytes < 0) {
  ------------------
  |  Branch (2030:14): [True: 7.71k, False: 0]
  |  Branch (2030:27): [True: 305, False: 7.41k]
  ------------------
 2031|       |      // A negative number means some encoding depending on the token that comes next
 2032|    305|      uint8_t token;
 2033|       |
 2034|    305|      if (srcsize < (signed)sizeof(uint8_t)) {
  ------------------
  |  Branch (2034:11): [True: 0, False: 305]
  ------------------
 2035|       |        // Not enough input to read token */
 2036|      0|        return BLOSC2_ERROR_READ_BUFFER;
 2037|      0|      }
 2038|    305|      srcsize -= sizeof(uint8_t);
 2039|       |
 2040|    305|      token = src[0];
 2041|    305|      src += 1;
 2042|       |      // ctbytes += 1;
 2043|       |
 2044|    305|      if (token & 0x1) {
  ------------------
  |  Branch (2044:11): [True: 294, False: 11]
  ------------------
 2045|       |        // A run of bytes that are different than 0
 2046|    294|        if (cbytes < -255) {
  ------------------
  |  Branch (2046:13): [True: 9, False: 285]
  ------------------
 2047|       |          // Runs can only encode a byte
 2048|      9|          return BLOSC2_ERROR_RUN_LENGTH;
 2049|      9|        }
 2050|    285|        uint8_t value = -cbytes;
 2051|    285|        memset(_dest, value, (unsigned int)neblock);
 2052|    285|      } else {
 2053|     11|        BLOSC_TRACE_ERROR("Invalid or unsupported compressed stream token value - %d", token);
  ------------------
  |  |   93|     11|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|     11|    do {                                            \
  |  |  |  |   98|     11|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|     11|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 11, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|     11|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2054|     11|        return BLOSC2_ERROR_RUN_LENGTH;
 2055|     11|      }
 2056|    285|      nbytes = neblock;
 2057|    285|      cbytes = 0;  // everything is encoded in the cbytes token
 2058|    285|    }
 2059|  7.41k|    else if (cbytes == neblock) {
  ------------------
  |  Branch (2059:14): [True: 2.47k, False: 4.93k]
  ------------------
 2060|  2.47k|      memcpy(_dest, src, (unsigned int)neblock);
 2061|  2.47k|      nbytes = (int32_t)neblock;
 2062|  2.47k|    }
 2063|  4.93k|    else {
 2064|  4.93k|      if (compformat == BLOSC_BLOSCLZ_FORMAT) {
  ------------------
  |  Branch (2064:11): [True: 396, False: 4.53k]
  ------------------
 2065|    396|        nbytes = blosclz_decompress(src, cbytes, _dest, (int)neblock);
 2066|    396|      }
 2067|  4.53k|      else if (compformat == BLOSC_LZ4_FORMAT) {
  ------------------
  |  Branch (2067:16): [True: 394, False: 4.14k]
  ------------------
 2068|    394|        nbytes = lz4_wrap_decompress((char*)src, (size_t)cbytes,
 2069|    394|                                     (char*)_dest, (size_t)neblock,
 2070|    394|                                     thread_context);
 2071|    394|      }
 2072|  4.14k|  #if defined(HAVE_ZLIB)
 2073|  4.14k|      else if (compformat == BLOSC_ZLIB_FORMAT) {
  ------------------
  |  Branch (2073:16): [True: 395, False: 3.74k]
  ------------------
 2074|    395|        nbytes = zlib_wrap_decompress((char*)src, (size_t)cbytes,
 2075|    395|                                      (char*)_dest, (size_t)neblock);
 2076|    395|      }
 2077|  3.74k|  #endif /*  HAVE_ZLIB */
 2078|  3.74k|  #if defined(HAVE_ZSTD)
 2079|  3.74k|      else if (compformat == BLOSC_ZSTD_FORMAT) {
  ------------------
  |  Branch (2079:16): [True: 2.82k, False: 926]
  ------------------
 2080|  2.82k|        nbytes = zstd_wrap_decompress(thread_context,
 2081|  2.82k|                                      (char*)src, (size_t)cbytes,
 2082|  2.82k|                                      (char*)_dest, (size_t)neblock);
 2083|  2.82k|      }
 2084|    926|  #endif /*  HAVE_ZSTD */
 2085|    926|      else if (compformat == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (2085:16): [True: 923, False: 3]
  ------------------
 2086|    923|        bool getcell = false;
 2087|       |
 2088|    923|#if defined(HAVE_ZFP)
 2089|    923|        if ((context->compcode == BLOSC_CODEC_ZFP_FIXED_RATE) &&
  ------------------
  |  Branch (2089:13): [True: 0, False: 923]
  ------------------
 2090|      0|            (thread_context->zfp_cell_nitems > 0)) {
  ------------------
  |  Branch (2090:13): [True: 0, False: 0]
  ------------------
 2091|      0|          nbytes = zfp_getcell(thread_context, src, cbytes, _dest, neblock);
 2092|      0|          if (nbytes < 0) {
  ------------------
  |  Branch (2092:15): [True: 0, False: 0]
  ------------------
 2093|      0|            return BLOSC2_ERROR_DATA;
 2094|      0|          }
 2095|      0|          if (nbytes == thread_context->zfp_cell_nitems * typesize) {
  ------------------
  |  Branch (2095:15): [True: 0, False: 0]
  ------------------
 2096|      0|            getcell = true;
 2097|      0|          }
 2098|      0|        }
 2099|    923|#endif /* HAVE_ZFP */
 2100|    923|        if (!getcell) {
  ------------------
  |  Branch (2100:13): [True: 923, False: 0]
  ------------------
 2101|    923|          thread_context->zfp_cell_nitems = 0;
 2102|    977|          for (int i = 0; i < g_ncodecs; ++i) {
  ------------------
  |  Branch (2102:27): [True: 971, False: 6]
  ------------------
 2103|    971|            if (g_codecs[i].compcode == context->compcode) {
  ------------------
  |  Branch (2103:17): [True: 917, False: 54]
  ------------------
 2104|    917|              if (g_codecs[i].decoder == NULL) {
  ------------------
  |  Branch (2104:19): [True: 0, False: 917]
  ------------------
 2105|       |                // Dynamically load codec plugin
 2106|      0|                if (fill_codec(&g_codecs[i]) < 0) {
  ------------------
  |  Branch (2106:21): [True: 0, False: 0]
  ------------------
 2107|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2108|      0|                  return BLOSC2_ERROR_CODEC_SUPPORT;
 2109|      0|                }
 2110|      0|              }
 2111|    917|              blosc2_dparams dparams;
 2112|    917|              blosc2_ctx_get_dparams(context, &dparams);
 2113|    917|              nbytes = g_codecs[i].decoder(src,
 2114|    917|                                           cbytes,
 2115|    917|                                           _dest,
 2116|    917|                                           neblock,
 2117|    917|                                           context->compcode_meta,
 2118|    917|                                           &dparams,
 2119|    917|                                           context->src);
 2120|    917|              goto urcodecsuccess;
 2121|    917|            }
 2122|    971|          }
 2123|      6|          BLOSC_TRACE_ERROR("User-defined compressor codec %d not found during decompression", context->compcode);
  ------------------
  |  |   93|      6|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      6|    do {                                            \
  |  |  |  |   98|      6|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      6|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      6|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2124|      6|          return BLOSC2_ERROR_CODEC_SUPPORT;
 2125|    923|        }
 2126|    917|      urcodecsuccess:
 2127|    917|        ;
 2128|    917|      }
 2129|      3|      else {
 2130|      3|        compname = clibcode_to_clibname(compformat);
 2131|      3|        BLOSC_TRACE_ERROR(
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2132|      3|                "Blosc has not been compiled with decompression "
 2133|      3|                "support for '%s' format.  "
 2134|      3|                "Please recompile for adding this support.", compname);
 2135|      3|        return BLOSC2_ERROR_CODEC_SUPPORT;
 2136|      3|      }
 2137|       |
 2138|       |      /* Check that decompressed bytes number is correct */
 2139|  4.92k|      if ((nbytes != neblock) && (thread_context->zfp_cell_nitems == 0)) {
  ------------------
  |  Branch (2139:11): [True: 2.58k, False: 2.33k]
  |  Branch (2139:34): [True: 2.58k, False: 0]
  ------------------
 2140|  2.58k|        return BLOSC2_ERROR_DATA;
 2141|  2.58k|      }
 2142|       |
 2143|  4.92k|    }
 2144|  6.10k|    src += cbytes;
 2145|       |    // ctbytes += cbytes;
 2146|  6.10k|    _dest += nbytes;
 2147|  6.10k|    ntbytes += nbytes;
 2148|  6.10k|  } /* Closes j < nstreams */
 2149|       |
 2150|  5.81k|  if (!instr_codec) {
  ------------------
  |  Branch (2150:7): [True: 5.00k, False: 803]
  ------------------
 2151|  5.00k|    if (last_filter_index >= 0 || context->postfilter != NULL) {
  ------------------
  |  Branch (2151:9): [True: 4.78k, False: 219]
  |  Branch (2151:35): [True: 0, False: 219]
  ------------------
 2152|       |      /* Apply regular filter pipeline */
 2153|  4.78k|      int errcode = pipeline_backward(thread_context, bsize, dest, dest_offset, tmp, tmp2, tmp3,
 2154|  4.78k|                                      last_filter_index, nblock);
 2155|  4.78k|      if (errcode < 0)
  ------------------
  |  Branch (2155:11): [True: 57, False: 4.73k]
  ------------------
 2156|     57|        return errcode;
 2157|  4.78k|    }
 2158|  5.00k|  }
 2159|       |
 2160|       |  /* Return the number of uncompressed bytes */
 2161|  5.75k|  return (int)ntbytes;
 2162|  5.81k|}
blosc2.c:lz4_wrap_decompress:
  501|    394|                               struct thread_context* thread_context) {
  502|    394|  int nbytes;
  503|    394|  blosc2_context* context = thread_context->parent_context;
  504|    394|  if (context->use_dict && context->dict_buffer != NULL && context->dict_size > 0) {
  ------------------
  |  Branch (504:7): [True: 111, False: 283]
  |  Branch (504:28): [True: 111, False: 0]
  |  Branch (504:60): [True: 111, False: 0]
  ------------------
  505|    111|    nbytes = LZ4_decompress_safe_usingDict(input, output,
  506|    111|                                           (int)compressed_length, (int)maxout,
  507|    111|                                           (const char*)context->dict_buffer,
  508|    111|                                           (int)context->dict_size);
  509|    283|  } else {
  510|    283|    nbytes = LZ4_decompress_safe(input, output, (int)compressed_length, (int)maxout);
  511|    283|  }
  512|    394|  if (nbytes != (int)maxout) {
  ------------------
  |  Branch (512:7): [True: 272, False: 122]
  ------------------
  513|    272|    return 0;
  514|    272|  }
  515|    122|  return (int)maxout;
  516|    394|}
blosc2.c:zlib_wrap_decompress:
  540|    395|                                char* output, size_t maxout) {
  541|    395|  int status;
  542|    395|#if defined(HAVE_ZLIB_NG) && ! defined(ZLIB_COMPAT)
  543|    395|  size_t ul = maxout;
  544|    395|  status = zng_uncompress(
  545|    395|      (uint8_t*)output, &ul, (uint8_t*)input, compressed_length);
  546|       |#else
  547|       |  uLongf ul = (uLongf)maxout;
  548|       |  status = uncompress(
  549|       |      (Bytef*)output, &ul, (Bytef*)input, (uLong)compressed_length);
  550|       |#endif
  551|    395|  if (status != Z_OK) {
  ------------------
  |  |  180|    395|#define Z_OK            0
  ------------------
  |  Branch (551:7): [True: 395, False: 0]
  ------------------
  552|    395|    return 0;
  553|    395|  }
  554|      0|  return (int)ul;
  555|    395|}
blosc2.c:zstd_wrap_decompress:
  592|  2.82k|                                char* output, size_t maxout) {
  593|  2.82k|  size_t code;
  594|  2.82k|  blosc2_context* context = thread_context->parent_context;
  595|       |
  596|  2.82k|  if (thread_context->zstd_dctx == NULL) {
  ------------------
  |  Branch (596:7): [True: 1.87k, False: 949]
  ------------------
  597|  1.87k|    thread_context->zstd_dctx = ZSTD_createDCtx();
  598|  1.87k|  }
  599|       |
  600|  2.82k|  if (context->use_dict) {
  ------------------
  |  Branch (600:7): [True: 1.03k, False: 1.79k]
  ------------------
  601|  1.03k|    assert(context->dict_ddict != NULL);
  602|  1.03k|    code = ZSTD_decompress_usingDDict(
  603|  1.03k|            thread_context->zstd_dctx, (void*)output, maxout, (void*)input,
  604|  1.03k|            compressed_length, context->dict_ddict);
  605|  1.79k|  } else {
  606|  1.79k|    code = ZSTD_decompressDCtx(thread_context->zstd_dctx,
  607|  1.79k|        (void*)output, maxout, (void*)input, compressed_length);
  608|  1.79k|  }
  609|  2.82k|  if (ZSTD_isError(code) != ZSTD_error_no_error) {
  ------------------
  |  Branch (609:7): [True: 1.77k, False: 1.04k]
  ------------------
  610|  1.77k|    BLOSC_TRACE_ERROR("Error in ZSTD decompression: '%s'.  Giving up.",
  ------------------
  |  |   93|  1.77k|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|  1.77k|    do {                                            \
  |  |  |  |   98|  1.77k|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|  1.77k|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1.77k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|  1.77k|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  611|  1.77k|                      ZDICT_getErrorName(code));
  612|  1.77k|    return 0;
  613|  1.77k|  }
  614|  1.04k|  return (int)code;
  615|  2.82k|}
blosc2.c:blosc2_initialize_context_from_header:
  860|  3.17k|static int blosc2_initialize_context_from_header(blosc2_context* context, blosc_header* header) {
  861|  3.17k|  context->header_flags = header->flags;
  862|  3.17k|  context->typesize = header->typesize;
  863|  3.17k|  context->sourcesize = header->nbytes;
  864|  3.17k|  context->header_blocksize = header->blocksize;
  865|  3.17k|  context->blocksize = header->blocksize;
  866|  3.17k|  context->blosc2_flags2 = header->blosc2_flags2;
  867|  3.17k|  context->blosc2_flags = header->blosc2_flags;
  868|  3.17k|  context->compcode = header->flags >> 5;
  869|  3.17k|  if (context->compcode == BLOSC_UDCODEC_FORMAT) {
  ------------------
  |  Branch (869:7): [True: 112, False: 3.06k]
  ------------------
  870|    112|    context->compcode = header->udcompcode;
  871|    112|  }
  872|  3.17k|  if (context->blosc2_flags2 & BLOSC2_VL_BLOCKS) {
  ------------------
  |  Branch (872:7): [True: 14, False: 3.15k]
  ------------------
  873|     14|    context->nblocks = header->blocksize;
  874|     14|    context->leftover = 0;
  875|     14|    context->blocksize = 0;
  876|     14|  }
  877|  3.15k|  else {
  878|  3.15k|    blosc2_calculate_blocks(context);
  879|  3.15k|  }
  880|       |
  881|  3.17k|  bool is_lazy = false;
  882|  3.17k|  if ((context->header_flags & BLOSC_DOSHUFFLE) &&
  ------------------
  |  Branch (882:7): [True: 2.04k, False: 1.12k]
  ------------------
  883|  2.04k|      (context->header_flags & BLOSC_DOBITSHUFFLE)) {
  ------------------
  |  Branch (883:7): [True: 1.65k, False: 391]
  ------------------
  884|       |    /* Extended header */
  885|  1.65k|    context->header_overhead = BLOSC_EXTENDED_HEADER_LENGTH;
  886|       |
  887|  1.65k|    memcpy(context->filters, header->filters, BLOSC2_MAX_FILTERS);
  888|  1.65k|    memcpy(context->filters_meta, header->filters_meta, BLOSC2_MAX_FILTERS);
  889|  1.65k|    context->compcode_meta = header->compcode_meta;
  890|       |
  891|  1.65k|    context->filter_flags = filters_to_flags(header->filters);
  892|  1.65k|    context->special_type = (header->blosc2_flags >> 4) & BLOSC2_SPECIAL_MASK;
  893|       |
  894|  1.65k|    is_lazy = (context->blosc2_flags & 0x08u);
  895|  1.65k|  }
  896|  1.51k|  else {
  897|  1.51k|    context->header_overhead = BLOSC_MIN_HEADER_LENGTH;
  898|  1.51k|    context->filter_flags = get_filter_flags(context->header_flags, context->typesize);
  899|  1.51k|    flags_to_filters(context->header_flags, context->filters);
  900|  1.51k|  }
  901|       |
  902|       |  // Some checks for malformed headers
  903|  3.17k|  if (!is_lazy && header->cbytes > context->srcsize) {
  ------------------
  |  Branch (903:7): [True: 3.16k, False: 9]
  |  Branch (903:19): [True: 0, False: 3.16k]
  ------------------
  904|      0|    return BLOSC2_ERROR_INVALID_HEADER;
  905|      0|  }
  906|       |
  907|  3.17k|  return 0;
  908|  3.17k|}
blosc2.c:get_filter_flags:
  702|  1.51k|                                const int32_t typesize) {
  703|  1.51k|  uint8_t flags = 0;
  704|       |
  705|  1.51k|  if ((header_flags & BLOSC_DOSHUFFLE) && (typesize > 1)) {
  ------------------
  |  Branch (705:7): [True: 391, False: 1.12k]
  |  Branch (705:43): [True: 73, False: 318]
  ------------------
  706|     73|    flags |= BLOSC_DOSHUFFLE;
  707|     73|  }
  708|  1.51k|  if (header_flags & BLOSC_DOBITSHUFFLE) {
  ------------------
  |  Branch (708:7): [True: 531, False: 987]
  ------------------
  709|    531|    flags |= BLOSC_DOBITSHUFFLE;
  710|    531|  }
  711|  1.51k|  if (header_flags & BLOSC_DODELTA) {
  ------------------
  |  Branch (711:7): [True: 719, False: 799]
  ------------------
  712|    719|    flags |= BLOSC_DODELTA;
  713|    719|  }
  714|  1.51k|  if (header_flags & BLOSC_MEMCPYED) {
  ------------------
  |  Branch (714:7): [True: 10, False: 1.50k]
  ------------------
  715|     10|    flags |= BLOSC_MEMCPYED;
  716|     10|  }
  717|  1.51k|  return flags;
  718|  1.51k|}
blosc2.c:create_thread_context:
 2269|  3.13k|create_thread_context(blosc2_context* context, int32_t tid) {
 2270|  3.13k|  struct thread_context* thread_context;
 2271|  3.13k|  thread_context = (struct thread_context*)my_malloc(sizeof(struct thread_context));
 2272|  3.13k|  BLOSC_ERROR_NULL(thread_context, NULL);
  ------------------
  |  |  104|  3.13k|    do {                                            \
  |  |  105|  3.13k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 3.13k]
  |  |  ------------------
  |  |  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.13k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 3.13k]
  |  |  ------------------
  ------------------
 2273|  3.13k|  int rc = init_thread_context(thread_context, context, tid);
 2274|  3.13k|  if (rc < 0) {
  ------------------
  |  Branch (2274:7): [True: 0, False: 3.13k]
  ------------------
 2275|      0|    return NULL;
 2276|      0|  }
 2277|  3.13k|  return thread_context;
 2278|  3.13k|}
blosc2.c:init_thread_context:
 2239|  3.13k|{
 2240|  3.13k|  int32_t ebsize;
 2241|       |
 2242|  3.13k|  thread_context->parent_context = context;
 2243|  3.13k|  thread_context->owner_pool = NULL;
 2244|  3.13k|  thread_context->tid = tid;
 2245|       |
 2246|  3.13k|  int32_t blocksize = context != NULL ? context->blocksize : 0;
  ------------------
  |  Branch (2246:23): [True: 3.13k, False: 0]
  ------------------
 2247|  3.13k|  int32_t typesize = context != NULL ? context->typesize : 0;
  ------------------
  |  Branch (2247:22): [True: 3.13k, False: 0]
  ------------------
 2248|  3.13k|  ebsize = blocksize + typesize * (signed)sizeof(int32_t);
 2249|  3.13k|  thread_context->tmp_nbytes = (size_t)4 * ebsize;
 2250|  3.13k|  thread_context->tmp = my_malloc(thread_context->tmp_nbytes);
 2251|  3.13k|  BLOSC_ERROR_NULL(thread_context->tmp, BLOSC2_ERROR_MEMORY_ALLOC);
  ------------------
  |  |  104|  3.13k|    do {                                            \
  |  |  105|  3.13k|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 3.13k]
  |  |  ------------------
  |  |  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.13k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 3.13k]
  |  |  ------------------
  ------------------
 2252|  3.13k|  thread_context->tmp2 = thread_context->tmp + ebsize;
 2253|  3.13k|  thread_context->tmp3 = thread_context->tmp2 + ebsize;
 2254|  3.13k|  thread_context->tmp4 = thread_context->tmp3 + ebsize;
 2255|  3.13k|  thread_context->tmp_blocksize = blocksize;
 2256|  3.13k|  thread_context->zfp_cell_nitems = 0;
 2257|  3.13k|  thread_context->zfp_cell_start = 0;
 2258|  3.13k|  #if defined(HAVE_ZSTD)
 2259|  3.13k|  thread_context->zstd_cctx = NULL;
 2260|  3.13k|  thread_context->zstd_dctx = NULL;
 2261|  3.13k|  #endif
 2262|  3.13k|  thread_context->lz4_cstream = NULL;
 2263|  3.13k|  thread_context->lz4hc_cstream = NULL;
 2264|       |
 2265|  3.13k|  return 0;
 2266|  3.13k|}
blosc2.c:clear_context_decompression_dict:
 2550|  3.17k|static void clear_context_decompression_dict(blosc2_context* context) {
 2551|  3.17k|  context->use_dict = 0;
 2552|  3.17k|  release_context_dict_buffer(context);
 2553|  3.17k|#if defined(HAVE_ZSTD)
 2554|  3.17k|  if (context->dict_ddict != NULL) {
  ------------------
  |  Branch (2554:7): [True: 0, False: 3.17k]
  ------------------
 2555|      0|    ZSTD_freeDDict(context->dict_ddict);
 2556|      0|    context->dict_ddict = NULL;
 2557|      0|  }
 2558|       |#else
 2559|       |  context->dict_ddict = NULL;
 2560|       |#endif
 2561|  3.17k|}
blosc2.c:checked_mul_size:
  152|  3.13k|static inline bool checked_mul_size(size_t a, size_t b, size_t* out) {
  153|  3.13k|  if (a != 0 && b > SIZE_MAX / a) {
  ------------------
  |  Branch (153:7): [True: 3.13k, False: 0]
  |  Branch (153:17): [True: 0, False: 3.13k]
  ------------------
  154|      0|    return false;
  155|      0|  }
  156|  3.13k|  *out = a * b;
  157|       |  return true;
  158|  3.13k|}
blosc2.c:checked_add_size:
  160|  3.14k|static inline bool checked_add_size(size_t a, size_t b, size_t* out) {
  161|  3.14k|  if (a > SIZE_MAX - b) {
  ------------------
  |  Branch (161:7): [True: 0, False: 3.14k]
  ------------------
  162|      0|    return false;
  163|      0|  }
  164|  3.14k|  *out = a + b;
  165|       |  return true;
  166|  3.14k|}
blosc2.c:release_thread_backend:
 5315|  3.19k|static int release_thread_backend(blosc2_context *context) {
 5316|  3.19k|  if (context->thread_backend == BLOSC_BACKEND_CALLBACK && context->threads_started > 0) {
  ------------------
  |  |   34|  6.39k|#define BLOSC_BACKEND_CALLBACK 2
  ------------------
  |  Branch (5316:7): [True: 0, False: 3.19k]
  |  Branch (5316:60): [True: 0, False: 0]
  ------------------
 5317|      0|    for (int32_t t = 0; t < context->threads_started; t++) {
  ------------------
  |  Branch (5317:25): [True: 0, False: 0]
  ------------------
 5318|      0|      destroy_thread_context(context->thread_contexts + t);
 5319|      0|    }
 5320|      0|    my_free(context->thread_contexts);
 5321|      0|    context->thread_contexts = NULL;
 5322|      0|    blosc2_pthread_mutex_destroy(&context->count_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5323|      0|    blosc2_pthread_mutex_destroy(&context->delta_mutex);
  ------------------
  |  |   91|      0|#define blosc2_pthread_mutex_destroy(a) pthread_mutex_destroy((a))
  ------------------
 5324|      0|    blosc2_pthread_cond_destroy(&context->delta_cv);
  ------------------
  |  |   97|      0|#define blosc2_pthread_cond_destroy(a) pthread_cond_destroy((a))
  ------------------
 5325|      0|  }
 5326|       |#if defined(_WIN32)
 5327|       |  else if (context->thread_backend == BLOSC_BACKEND_PER_CONTEXT && context->threads_started > 0) {
 5328|       |    /* Signal all workers to exit. */
 5329|       |    blosc2_pthread_mutex_lock(&context->jobs_mutex);
 5330|       |    context->end_threads = 1;
 5331|       |    blosc2_pthread_cond_broadcast(&context->jobs_ready);
 5332|       |    blosc2_pthread_mutex_unlock(&context->jobs_mutex);
 5333|       |
 5334|       |    for (int32_t t = 0; t < context->threads_started; t++) {
 5335|       |      blosc2_pthread_join(context->threads[t], NULL);
 5336|       |    }
 5337|       |    my_free(context->threads);
 5338|       |    context->threads = NULL;
 5339|       |    blosc2_pthread_cond_destroy(&context->jobs_done);
 5340|       |    blosc2_pthread_cond_destroy(&context->jobs_ready);
 5341|       |    blosc2_pthread_mutex_destroy(&context->jobs_mutex);
 5342|       |    blosc2_pthread_cond_destroy(&context->delta_cv);
 5343|       |    blosc2_pthread_mutex_destroy(&context->delta_mutex);
 5344|       |    blosc2_pthread_mutex_destroy(&context->count_mutex);
 5345|       |  }
 5346|       |#endif  /* _WIN32 */
 5347|  3.19k|  else if (context->thread_backend == BLOSC_BACKEND_SHARED_POOL && context->thread_pool != NULL) {
  ------------------
  |  |   33|  6.39k|#define BLOSC_BACKEND_SHARED_POOL 1
  ------------------
  |  Branch (5347:12): [True: 0, False: 3.19k]
  |  Branch (5347:68): [True: 0, False: 0]
  ------------------
 5348|      0|    struct blosc_shared_pool *pool = context->thread_pool;
 5349|      0|    struct blosc_shared_pool **prev;
 5350|      0|    bool destroy_pool = false;
 5351|       |
 5352|      0|    if (context->pool_epoch != g_destroy_count) {
  ------------------
  |  Branch (5352:9): [True: 0, False: 0]
  ------------------
 5353|       |      /* blosc2_destroy() already freed this pool and tore down pool_registry_mutex.
 5354|       |       * Just clear the dangling pointer; nothing else to do. */
 5355|      0|      context->thread_pool = NULL;
 5356|      0|      context->threads_started = 0;
 5357|      0|      context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|      0|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 5358|      0|      return 0;
 5359|      0|    }
 5360|       |
 5361|      0|    blosc2_pthread_mutex_lock(&pool_registry_mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5362|      0|    pool->context_refs--;
 5363|      0|    if (pool->context_refs == 0) {
  ------------------
  |  Branch (5363:9): [True: 0, False: 0]
  ------------------
 5364|       |      /* Check pool-internal state under the pool's own mutex */
 5365|      0|      blosc2_pthread_mutex_lock(&pool->mutex);
  ------------------
  |  |   92|      0|#define blosc2_pthread_mutex_lock(a) pthread_mutex_lock((a))
  ------------------
 5366|      0|      bool idle = (pool->active_jobs == 0 && pool->job_queue_head == NULL);
  ------------------
  |  Branch (5366:20): [True: 0, False: 0]
  |  Branch (5366:46): [True: 0, False: 0]
  ------------------
 5367|      0|      blosc2_pthread_mutex_unlock(&pool->mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5368|      0|      if (idle) {
  ------------------
  |  Branch (5368:11): [True: 0, False: 0]
  ------------------
 5369|      0|        prev = &shared_pools;
 5370|      0|        while (*prev != NULL && *prev != pool) {
  ------------------
  |  Branch (5370:16): [True: 0, False: 0]
  |  Branch (5370:33): [True: 0, False: 0]
  ------------------
 5371|      0|          prev = &(*prev)->next;
 5372|      0|        }
 5373|      0|        if (*prev == pool) {
  ------------------
  |  Branch (5373:13): [True: 0, False: 0]
  ------------------
 5374|      0|          *prev = pool->next;
 5375|      0|        }
 5376|      0|        destroy_pool = true;
 5377|      0|      }
 5378|      0|    }
 5379|      0|    blosc2_pthread_mutex_unlock(&pool_registry_mutex);
  ------------------
  |  |   93|      0|#define blosc2_pthread_mutex_unlock(a) pthread_mutex_unlock((a))
  ------------------
 5380|      0|    if (destroy_pool) {
  ------------------
  |  Branch (5380:9): [True: 0, False: 0]
  ------------------
 5381|      0|      destroy_shared_pool(pool);
 5382|      0|    }
 5383|      0|    context->thread_pool = NULL;
 5384|      0|  }
 5385|       |
 5386|  3.19k|  context->threads_started = 0;
 5387|  3.19k|  context->thread_backend = BLOSC_BACKEND_SERIAL;
  ------------------
  |  |   32|  3.19k|#define BLOSC_BACKEND_SERIAL 0
  ------------------
 5388|  3.19k|  return 0;
 5389|  3.19k|}
blosc2.c:release_context_dict_buffer:
 2540|  6.36k|static void release_context_dict_buffer(blosc2_context* context) {
 2541|  6.36k|  if (context->dict_buffer_owned && context->dict_buffer != NULL) {
  ------------------
  |  Branch (2541:7): [True: 0, False: 6.36k]
  |  Branch (2541:37): [True: 0, False: 0]
  ------------------
 2542|      0|    free(context->dict_buffer);
 2543|      0|  }
 2544|  6.36k|  context->dict_buffer = NULL;
 2545|       |  context->dict_buffer_owned = false;
 2546|  6.36k|  context->dict_size = 0;
 2547|  6.36k|}

blosclz_decompress:
  685|    396|int blosclz_decompress(const void* input, int length, void* output, int maxout) {
  686|    396|  const uint8_t* ip = (const uint8_t*)input;
  687|    396|  const uint8_t* ip_limit = ip + length;
  688|    396|  uint8_t* op = (uint8_t*)output;
  689|    396|  uint32_t ctrl;
  690|    396|  uint8_t* op_limit = op + maxout;
  691|    396|  if (BLOSCLZ_UNLIKELY(length == 0)) {
  ------------------
  |  |   35|    396|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 0, False: 396]
  |  |  ------------------
  ------------------
  692|      0|    return 0;
  693|      0|  }
  694|    396|  ctrl = (*ip++) & 31U;
  695|       |
  696|   683k|  while (1) {
  ------------------
  |  Branch (696:10): [True: 683k, Folded]
  ------------------
  697|   683k|    if (ctrl >= 32) {
  ------------------
  |  Branch (697:9): [True: 118k, False: 564k]
  ------------------
  698|       |      // match
  699|   118k|      int32_t len = (int32_t)(ctrl >> 5U) - 1 ;
  700|   118k|      int32_t ofs = (int32_t)(ctrl & 31U) << 8U;
  701|   118k|      uint8_t code;
  702|   118k|      const uint8_t* ref = op - ofs;
  703|       |
  704|   118k|      if (len == 7 - 1) {
  ------------------
  |  Branch (704:11): [True: 31.6k, False: 87.3k]
  ------------------
  705|  39.3k|        do {
  706|  39.3k|          if (BLOSCLZ_UNLIKELY(ip + 1 >= ip_limit)) {
  ------------------
  |  |   35|  39.3k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 0, False: 39.3k]
  |  |  ------------------
  ------------------
  707|      0|            return 0;
  708|      0|          }
  709|  39.3k|          code = *ip++;
  710|  39.3k|          len += code;
  711|  39.3k|        } while (code == 255);
  ------------------
  |  Branch (711:18): [True: 7.67k, False: 31.6k]
  ------------------
  712|  31.6k|      }
  713|  87.3k|      else {
  714|  87.3k|        if (BLOSCLZ_UNLIKELY(ip + 1 >= ip_limit)) {
  ------------------
  |  |   35|  87.3k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 1, False: 87.3k]
  |  |  ------------------
  ------------------
  715|      1|          return 0;
  716|      1|        }
  717|  87.3k|      }
  718|   118k|      code = *ip++;
  719|   118k|      len += 3;
  720|   118k|      ref -= code;
  721|       |
  722|       |      /* match from 16-bit distance */
  723|   118k|      if (BLOSCLZ_UNLIKELY(code == 255)) {
  ------------------
  |  |   35|   118k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 8.69k, False: 110k]
  |  |  ------------------
  ------------------
  724|  8.69k|        if (ofs == (31U << 8U)) {
  ------------------
  |  Branch (724:13): [True: 626, False: 8.06k]
  ------------------
  725|    626|          if (ip + 1 >= ip_limit) {
  ------------------
  |  Branch (725:15): [True: 1, False: 625]
  ------------------
  726|      1|            return 0;
  727|      1|          }
  728|    625|          ofs = (*ip++) << 8U;
  729|    625|          ofs += *ip++;
  730|    625|          ref = op - ofs - MAX_DISTANCE;
  ------------------
  |  |   46|    625|#define MAX_DISTANCE 8191
  ------------------
  731|    625|        }
  732|  8.69k|      }
  733|       |
  734|   118k|      if (BLOSCLZ_UNLIKELY(op + len > op_limit)) {
  ------------------
  |  |   35|   118k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 53, False: 118k]
  |  |  ------------------
  ------------------
  735|     53|        return 0;
  736|     53|      }
  737|       |
  738|   118k|      if (BLOSCLZ_UNLIKELY(ref - 1 < (uint8_t*)output)) {
  ------------------
  |  |   35|   118k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 20, False: 118k]
  |  |  ------------------
  ------------------
  739|     20|        return 0;
  740|     20|      }
  741|       |
  742|   118k|      if (BLOSCLZ_UNLIKELY(ip >= ip_limit)) break;
  ------------------
  |  |   35|   118k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 0, False: 118k]
  |  |  ------------------
  ------------------
  743|   118k|      ctrl = *ip++;
  744|       |
  745|   118k|      ref--;
  746|   118k|      if (ref == op - 1) {
  ------------------
  |  Branch (746:11): [True: 16.5k, False: 102k]
  ------------------
  747|       |        /* optimized copy for a run */
  748|  16.5k|        memset(op, *ref, len);
  749|  16.5k|        op += len;
  750|  16.5k|      }
  751|   102k|      else if ((op - ref >= 8) && (op_limit - op >= len + 8)) {
  ------------------
  |  Branch (751:16): [True: 69.0k, False: 33.2k]
  |  Branch (751:35): [True: 68.7k, False: 269]
  ------------------
  752|       |        // copy with an overlap not larger than 8
  753|  68.7k|        wild_copy(op, ref, op + len);
  754|  68.7k|        op += len;
  755|  68.7k|      }
  756|  33.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|  33.5k|          op = copy_match(op, ref, (unsigned) len);
  767|       |#if 0 && defined(__AVX2__)
  768|       |        }
  769|       |#endif
  770|  33.5k|      }
  771|   118k|    }
  772|   564k|    else {
  773|       |      // literal
  774|   564k|      ctrl++;
  775|   564k|      if (BLOSCLZ_UNLIKELY(op + ctrl > op_limit)) {
  ------------------
  |  |   35|   564k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 31, False: 564k]
  |  |  ------------------
  ------------------
  776|     31|        return 0;
  777|     31|      }
  778|   564k|      if (BLOSCLZ_UNLIKELY(ip + ctrl > ip_limit)) {
  ------------------
  |  |   35|   564k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 4, False: 564k]
  |  |  ------------------
  ------------------
  779|      4|        return 0;
  780|      4|      }
  781|       |
  782|   564k|      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|   564k|      if (BLOSCLZ_UNLIKELY(ip >= ip_limit)) break;
  ------------------
  |  |   35|   564k|#define BLOSCLZ_UNLIKELY(c)  (c)
  |  |  ------------------
  |  |  |  Branch (35:30): [True: 286, False: 563k]
  |  |  ------------------
  ------------------
  790|   563k|      ctrl = *ip++;
  791|   563k|    }
  792|   683k|  }
  793|       |
  794|    286|  return (int)(op - (uint8_t*)output);
  795|    396|}
blosclz.c:wild_copy:
  677|  68.7k|static inline void wild_copy(uint8_t *out, const uint8_t* from, uint8_t* end) {
  678|  68.7k|  uint8_t* d = out;
  679|  68.7k|  const uint8_t* s = from;
  680|  68.7k|  uint8_t* const e = end;
  681|       |
  682|   432k|  do { memcpy(d,s,8); d+=8; s+=8; } while (d<e);
  ------------------
  |  Branch (682:44): [True: 363k, False: 68.7k]
  ------------------
  683|  68.7k|}

delta_decoder:
   97|  9.30k|                   int32_t typesize, uint8_t* dest) {
   98|  9.30k|  int32_t i;
   99|       |
  100|  9.30k|  if (offset == 0) {
  ------------------
  |  Branch (100:7): [True: 948, False: 8.35k]
  ------------------
  101|       |    /* Decode delta for the reference block */
  102|    948|    switch (typesize) {
  103|    305|      case 1:
  ------------------
  |  Branch (103:7): [True: 305, False: 643]
  ------------------
  104|  8.42M|        for (i = 1; i < nbytes; i++) {
  ------------------
  |  Branch (104:21): [True: 8.42M, False: 305]
  ------------------
  105|  8.42M|          dest[i] ^= dref[i-1];
  106|  8.42M|        }
  107|    305|        break;
  108|     76|      case 2:
  ------------------
  |  Branch (108:7): [True: 76, False: 872]
  ------------------
  109|  2.79M|        for (i = 1; i < nbytes / 2; i++) {
  ------------------
  |  Branch (109:21): [True: 2.79M, False: 76]
  ------------------
  110|  2.79M|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i-1];
  111|  2.79M|        }
  112|     76|        break;
  113|     67|      case 4:
  ------------------
  |  Branch (113:7): [True: 67, False: 881]
  ------------------
  114|   688k|        for (i = 1; i < nbytes / 4; i++) {
  ------------------
  |  Branch (114:21): [True: 688k, False: 67]
  ------------------
  115|   688k|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i-1];
  116|   688k|        }
  117|     67|        break;
  118|    188|      case 8:
  ------------------
  |  Branch (118:7): [True: 188, False: 760]
  ------------------
  119|   894k|        for (i = 1; i < nbytes / 8; i++) {
  ------------------
  |  Branch (119:21): [True: 893k, False: 188]
  ------------------
  120|   893k|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i-1];
  121|   893k|        }
  122|    188|        break;
  123|    312|      default:
  ------------------
  |  Branch (123:7): [True: 312, False: 636]
  ------------------
  124|    312|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (124:13): [True: 110, False: 202]
  ------------------
  125|    110|          delta_decoder(dref, offset, nbytes, 8, dest);
  126|    202|        } else {
  127|    202|          delta_decoder(dref, offset, nbytes, 1, dest);
  128|    202|        }
  129|    948|    }
  130|  8.35k|  } else {
  131|       |    /* Decode delta for the non-reference blocks */
  132|  8.35k|    switch (typesize) {
  133|  2.82k|      case 1:
  ------------------
  |  Branch (133:7): [True: 2.82k, False: 5.53k]
  ------------------
  134|  1.53M|        for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (134:21): [True: 1.53M, False: 2.82k]
  ------------------
  135|  1.53M|          dest[i] ^= dref[i];
  136|  1.53M|        }
  137|  2.82k|        break;
  138|    745|      case 2:
  ------------------
  |  Branch (138:7): [True: 745, False: 7.61k]
  ------------------
  139|  1.45M|        for (i = 0; i < nbytes / 2; i++) {
  ------------------
  |  Branch (139:21): [True: 1.45M, False: 745]
  ------------------
  140|  1.45M|          ((uint16_t *)dest)[i] ^= ((uint16_t *)dref)[i];
  141|  1.45M|        }
  142|    745|        break;
  143|    764|      case 4:
  ------------------
  |  Branch (143:7): [True: 764, False: 7.59k]
  ------------------
  144|   457k|        for (i = 0; i < nbytes / 4; i++) {
  ------------------
  |  Branch (144:21): [True: 456k, False: 764]
  ------------------
  145|   456k|          ((uint32_t *)dest)[i] ^= ((uint32_t *)dref)[i];
  146|   456k|        }
  147|    764|        break;
  148|  1.42k|      case 8:
  ------------------
  |  Branch (148:7): [True: 1.42k, False: 6.92k]
  ------------------
  149|   189k|        for (i = 0; i < nbytes / 8; i++) {
  ------------------
  |  Branch (149:21): [True: 187k, False: 1.42k]
  ------------------
  150|   187k|          ((uint64_t *)dest)[i] ^= ((uint64_t *)dref)[i];
  151|   187k|        }
  152|  1.42k|        break;
  153|  2.59k|      default:
  ------------------
  |  Branch (153:7): [True: 2.59k, False: 5.76k]
  ------------------
  154|  2.59k|        if ((typesize % 8) == 0) {
  ------------------
  |  Branch (154:13): [True: 553, False: 2.04k]
  ------------------
  155|    553|          delta_decoder(dref, offset, nbytes, 8, dest);
  156|  2.04k|        } else {
  157|  2.04k|          delta_decoder(dref, offset, nbytes, 1, dest);
  158|  2.04k|        }
  159|  8.35k|    }
  160|  8.35k|  }
  161|  9.30k|}

fastcopy:
  504|     90|unsigned char *fastcopy(unsigned char *out, const unsigned char *from, unsigned len) {
  505|     90|  switch (len) {
  506|      2|    case 32:
  ------------------
  |  Branch (506:5): [True: 2, False: 88]
  ------------------
  507|      2|      return copy_32_bytes(out, from);
  508|      0|    case 16:
  ------------------
  |  Branch (508:5): [True: 0, False: 90]
  ------------------
  509|      0|      return copy_16_bytes(out, from);
  510|      7|    case 8:
  ------------------
  |  Branch (510:5): [True: 7, False: 83]
  ------------------
  511|      7|      return copy_8_bytes(out, from);
  512|     81|    default: {
  ------------------
  |  Branch (512:5): [True: 81, False: 9]
  ------------------
  513|     81|    }
  514|     90|  }
  515|     81|  if (len < 8) {
  ------------------
  |  Branch (515:7): [True: 28, False: 53]
  ------------------
  516|     28|    return copy_bytes(out, from, len);
  517|     28|  }
  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|  33.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|  33.5k|  unsigned overlap_dist = (unsigned) (out - from);
  556|  33.5k|  if (overlap_dist > sz) {
  ------------------
  |  Branch (556:7): [True: 90, False: 33.4k]
  ------------------
  557|     90|    return fastcopy(out, from, len);
  558|     90|  }
  559|       |
  560|       |  // Otherwise we need to be more careful so as not to overwrite destination
  561|  33.4k|  switch (overlap_dist) {
  562|      0|    case 32:
  ------------------
  |  Branch (562:5): [True: 0, False: 33.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: 33.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: 33.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: 33.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: 33.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: 33.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: 33.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: 33.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: 33.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|     99|    case 8:
  ------------------
  |  Branch (619:5): [True: 99, False: 33.3k]
  ------------------
  620|  1.58k|      for (; len >= 8; len -= 8) {
  ------------------
  |  Branch (620:14): [True: 1.48k, False: 99]
  ------------------
  621|  1.48k|        out = copy_8_bytes(out, from);
  622|  1.48k|      }
  623|     99|      break;
  624|  7.60k|    case 4:
  ------------------
  |  Branch (624:5): [True: 7.60k, False: 25.8k]
  ------------------
  625|   142k|      for (; len >= 4; len -= 4) {
  ------------------
  |  Branch (625:14): [True: 134k, False: 7.60k]
  ------------------
  626|   134k|        out = copy_4_bytes(out, from);
  627|   134k|      }
  628|  7.60k|      break;
  629|  11.2k|    case 2:
  ------------------
  |  Branch (629:5): [True: 11.2k, False: 22.2k]
  ------------------
  630|   164k|      for (; len >= 2; len -= 2) {
  ------------------
  |  Branch (630:14): [True: 152k, False: 11.2k]
  ------------------
  631|   152k|        out = copy_2_bytes(out, from);
  632|   152k|      }
  633|  11.2k|      break;
  634|  14.4k|    default:
  ------------------
  |  Branch (634:5): [True: 14.4k, False: 19.0k]
  ------------------
  635|   184k|      for (; len > 0; len--) {
  ------------------
  |  Branch (635:14): [True: 169k, False: 14.4k]
  ------------------
  636|   169k|        *out++ = *from++;
  637|   169k|      }
  638|  33.4k|  }
  639|       |
  640|       |  // Copy the leftovers
  641|  56.6k|  for (; len > 0; len--) {
  ------------------
  |  Branch (641:10): [True: 23.1k, False: 33.4k]
  ------------------
  642|  23.1k|    *out++ = *from++;
  643|  23.1k|  }
  644|       |
  645|  33.4k|  return out;
  646|  33.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.48k|static inline unsigned char *copy_16_bytes(unsigned char *out, const unsigned char *from) {
   99|  1.48k|#if defined(__SSE2__)
  100|  1.48k|  __m128i chunk;
  101|  1.48k|  chunk = _mm_loadu_si128((__m128i*)from);
  102|  1.48k|  _mm_storeu_si128((__m128i*)out, chunk);
  103|  1.48k|  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.48k|  return out;
  116|  1.48k|}
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|     28|static inline unsigned char *copy_bytes(unsigned char *out, const unsigned char *from, unsigned len) {
  162|     28|  assert(len < 8);
  163|       |
  164|       |#ifdef BLOSC_STRICT_ALIGN
  165|       |  while (len--) {
  166|       |    *out++ = *from++;
  167|       |  }
  168|       |#else
  169|     28|  switch (len) {
  170|      3|    case 7:
  ------------------
  |  Branch (170:5): [True: 3, False: 25]
  ------------------
  171|      3|      return copy_7_bytes(out, from);
  172|      7|    case 6:
  ------------------
  |  Branch (172:5): [True: 7, False: 21]
  ------------------
  173|      7|      return copy_6_bytes(out, from);
  174|      0|    case 5:
  ------------------
  |  Branch (174:5): [True: 0, False: 28]
  ------------------
  175|      0|      return copy_5_bytes(out, from);
  176|      2|    case 4:
  ------------------
  |  Branch (176:5): [True: 2, False: 26]
  ------------------
  177|      2|      return copy_4_bytes(out, from);
  178|     16|    case 3:
  ------------------
  |  Branch (178:5): [True: 16, False: 12]
  ------------------
  179|     16|      return copy_3_bytes(out, from);
  180|      0|    case 2:
  ------------------
  |  Branch (180:5): [True: 0, False: 28]
  ------------------
  181|      0|      return copy_2_bytes(out, from);
  182|      0|    case 1:
  ------------------
  |  Branch (182:5): [True: 0, False: 28]
  ------------------
  183|      0|      return copy_1_bytes(out, from);
  184|      0|    case 0:
  ------------------
  |  Branch (184:5): [True: 0, False: 28]
  ------------------
  185|      0|      return out;
  186|      0|    default:
  ------------------
  |  Branch (186:5): [True: 0, False: 28]
  ------------------
  187|      0|      assert(0);
  188|     28|  }
  189|      0|#endif /* BLOSC_STRICT_ALIGN */
  190|      0|  return out;
  191|     28|}
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|     19|static inline unsigned char *copy_3_bytes(unsigned char *out, const unsigned char *from) {
   66|     19|  out = copy_1_bytes(out, from);
   67|     19|  return copy_2_bytes(out, from + 1);
   68|     19|}
fastcopy.c:copy_1_bytes:
   60|     19|static inline unsigned char *copy_1_bytes(unsigned char *out, const unsigned char *from) {
   61|     19|  *out++ = *from;
   62|     19|  return out;
   63|     19|}
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.14k|  for (ilen = 0; ilen < len; ilen++) {
  ------------------
  |  Branch (432:18): [True: 1.09k, False: 52]
  ------------------
  433|       |#if defined(__AVX2__)
  434|       |    copy_32_bytes(out, from);
  435|       |#elif defined(__SSE2__)
  436|       |    copy_16_bytes(out, from);
  437|  1.09k|#endif
  438|  1.09k|    out += sz;
  439|  1.09k|    from += sz;
  440|  1.09k|  }
  441|       |
  442|     52|  return out;
  443|     52|}
fastcopy.c:copy_4_bytes:
   48|   134k|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|   134k|  *(uint32_t *) out = *(uint32_t *) from;
   55|   134k|#endif
   56|   134k|  return out + 4;
   57|   134k|}
fastcopy.c:copy_2_bytes:
   37|   152k|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|   152k|  *(uint16_t *) out = *(uint16_t *) from;
   44|   152k|#endif
   45|   152k|  return out + 2;
   46|   152k|}

unshuffle_avx2:
  784|  4.65k|               const uint8_t *_src, uint8_t *_dest) {
  785|  4.65k|  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.65k|  if (blocksize < vectorized_chunk_size) {
  ------------------
  |  Branch (789:7): [True: 4.03k, False: 625]
  ------------------
  790|  4.03k|    unshuffle_generic(bytesoftype, blocksize, _src, _dest);
  791|  4.03k|    return;
  792|  4.03k|  }
  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|    625|  const int32_t vectorizable_bytes = blocksize - (blocksize % vectorized_chunk_size);
  800|       |
  801|    625|  const int32_t vectorizable_elements = vectorizable_bytes / bytesoftype;
  802|    625|  const int32_t total_elements = blocksize / bytesoftype;
  803|       |
  804|       |  /* Optimized unshuffle implementations */
  805|    625|  switch (bytesoftype) {
  806|    155|    case 2:
  ------------------
  |  Branch (806:5): [True: 155, False: 470]
  ------------------
  807|    155|      unshuffle2_avx2(_dest, _src, vectorizable_elements, total_elements);
  808|    155|      break;
  809|    106|    case 4:
  ------------------
  |  Branch (809:5): [True: 106, False: 519]
  ------------------
  810|    106|      unshuffle4_avx2(_dest, _src, vectorizable_elements, total_elements);
  811|    106|      break;
  812|    122|    case 8:
  ------------------
  |  Branch (812:5): [True: 122, False: 503]
  ------------------
  813|    122|      unshuffle8_avx2(_dest, _src, vectorizable_elements, total_elements);
  814|    122|      break;
  815|     40|    case 12:
  ------------------
  |  Branch (815:5): [True: 40, False: 585]
  ------------------
  816|     40|      unshuffle12_avx2(_dest, _src, vectorizable_elements, total_elements);
  817|     40|      break;
  818|     20|    case 16:
  ------------------
  |  Branch (818:5): [True: 20, False: 605]
  ------------------
  819|     20|      unshuffle16_avx2(_dest, _src, vectorizable_elements, total_elements);
  820|     20|      break;
  821|    182|    default:
  ------------------
  |  Branch (821:5): [True: 182, False: 443]
  ------------------
  822|       |      /* For types larger than 16 bytes, use the AVX2 tiled unshuffle. */
  823|    182|      if (bytesoftype > (int32_t)sizeof(__m128i)) {
  ------------------
  |  Branch (823:11): [True: 55, False: 127]
  ------------------
  824|     55|        unshuffle16_tiled_avx2(_dest, _src, vectorizable_elements, total_elements, bytesoftype);
  825|     55|      }
  826|    127|      else {
  827|       |        /* Non-optimized unshuffle */
  828|    127|        unshuffle_generic(bytesoftype, blocksize, _src, _dest);
  829|       |        /* The non-optimized function covers the whole buffer,
  830|       |           so we're done processing here. */
  831|    127|        return;
  832|    127|      }
  833|    625|  }
  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|    498|  if (vectorizable_bytes < blocksize) {
  ------------------
  |  Branch (838:7): [True: 359, False: 139]
  ------------------
  839|    359|    unshuffle_generic_inline(bytesoftype, vectorizable_bytes, blocksize, _src, _dest);
  840|    359|  }
  841|    498|}
shuffle-avx2.c:unshuffle2_avx2:
  338|    155|                const int32_t vectorizable_elements, const int32_t total_elements) {
  339|    155|  static const int32_t bytesoftype = 2;
  340|    155|  int32_t i;
  341|    155|  int j;
  342|    155|  __m256i ymm0[2], ymm1[2];
  343|       |
  344|  6.74k|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (344:15): [True: 6.58k, False: 155]
  ------------------
  345|       |    /* Load 32 elements (64 bytes) into 2 YMM registers. */
  346|  6.58k|    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.58k]
  ------------------
  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.58k]
  ------------------
  352|  13.1k|      ymm0[j] = _mm256_permute4x64_epi64(ymm0[j], 0xd8);
  353|  13.1k|    }
  354|       |    /* Compute the low 64 bytes */
  355|  6.58k|    ymm1[0] = _mm256_unpacklo_epi8(ymm0[0], ymm0[1]);
  356|       |    /* Compute the hi 64 bytes */
  357|  6.58k|    ymm1[1] = _mm256_unpackhi_epi8(ymm0[0], ymm0[1]);
  358|       |    /* Store the result vectors in proper order */
  359|  6.58k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * sizeof(__m256i))), ymm1[0]);
  360|  6.58k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * sizeof(__m256i))), ymm1[1]);
  361|  6.58k|  }
  362|    155|}
shuffle-avx2.c:unshuffle4_avx2:
  367|    106|                const int32_t vectorizable_elements, const int32_t total_elements) {
  368|    106|  static const int32_t bytesoftype = 4;
  369|    106|  int32_t i;
  370|    106|  int j;
  371|    106|  __m256i ymm0[4], ymm1[4];
  372|       |
  373|  1.43k|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (373:15): [True: 1.32k, False: 106]
  ------------------
  374|       |    /* Load 32 elements (128 bytes) into 4 YMM registers. */
  375|  1.32k|    const uint8_t* const src_for_ith_element = src + i;
  376|  6.63k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (376:17): [True: 5.30k, False: 1.32k]
  ------------------
  377|  5.30k|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  378|  5.30k|    }
  379|       |    /* Shuffle bytes */
  380|  3.97k|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (380:17): [True: 2.65k, False: 1.32k]
  ------------------
  381|       |      /* Compute the low 64 bytes */
  382|  2.65k|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  383|       |      /* Compute the hi 64 bytes */
  384|  2.65k|      ymm1[2 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  385|  2.65k|    }
  386|       |    /* Shuffle 2-byte words */
  387|  3.97k|    for (j = 0; j < 2; j++) {
  ------------------
  |  Branch (387:17): [True: 2.65k, False: 1.32k]
  ------------------
  388|       |      /* Compute the low 64 bytes */
  389|  2.65k|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  390|       |      /* Compute the hi 64 bytes */
  391|  2.65k|      ymm0[2 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  392|  2.65k|    }
  393|  1.32k|    ymm1[0] = _mm256_permute2x128_si256(ymm0[0], ymm0[2], 0x20);
  394|  1.32k|    ymm1[1] = _mm256_permute2x128_si256(ymm0[1], ymm0[3], 0x20);
  395|  1.32k|    ymm1[2] = _mm256_permute2x128_si256(ymm0[0], ymm0[2], 0x31);
  396|  1.32k|    ymm1[3] = _mm256_permute2x128_si256(ymm0[1], ymm0[3], 0x31);
  397|       |
  398|       |    /* Store the result vectors in proper order */
  399|  6.63k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (399:17): [True: 5.30k, False: 1.32k]
  ------------------
  400|  5.30k|      _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (j * sizeof(__m256i))), ymm1[j]);
  401|  5.30k|    }
  402|  1.32k|  }
  403|    106|}
shuffle-avx2.c:unshuffle8_avx2:
  408|    122|                const int32_t vectorizable_elements, const int32_t total_elements) {
  409|    122|  static const int32_t bytesoftype = 8;
  410|    122|  int32_t i;
  411|    122|  int j;
  412|    122|  __m256i ymm0[8], ymm1[8];
  413|       |
  414|  3.36k|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (414:15): [True: 3.24k, False: 122]
  ------------------
  415|       |    /* Fetch 32 elements (256 bytes) into 8 YMM registers. */
  416|  3.24k|    const uint8_t* const src_for_ith_element = src + i;
  417|  29.2k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (417:17): [True: 25.9k, False: 3.24k]
  ------------------
  418|  25.9k|      ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (j * total_elements)));
  419|  25.9k|    }
  420|       |    /* Shuffle bytes */
  421|  16.2k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (421:17): [True: 12.9k, False: 3.24k]
  ------------------
  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.2k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (428:17): [True: 12.9k, False: 3.24k]
  ------------------
  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.2k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (434:17): [True: 25.9k, False: 3.24k]
  ------------------
  435|  25.9k|      ymm0[j] = _mm256_permute4x64_epi64(ymm0[j], 0xd8);
  436|  25.9k|    }
  437|       |
  438|       |    /* Shuffle 4-byte dwords */
  439|  16.2k|    for (j = 0; j < 4; j++) {
  ------------------
  |  Branch (439:17): [True: 12.9k, False: 3.24k]
  ------------------
  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.24k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * sizeof(__m256i))), ymm1[0]);
  448|  3.24k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * sizeof(__m256i))), ymm1[2]);
  449|  3.24k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (2 * sizeof(__m256i))), ymm1[1]);
  450|  3.24k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (3 * sizeof(__m256i))), ymm1[3]);
  451|  3.24k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (4 * sizeof(__m256i))), ymm1[4]);
  452|  3.24k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (5 * sizeof(__m256i))), ymm1[6]);
  453|  3.24k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (6 * sizeof(__m256i))), ymm1[5]);
  454|  3.24k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (7 * sizeof(__m256i))), ymm1[7]);
  455|  3.24k|  }
  456|    122|}
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|     20|                 const int32_t vectorizable_elements, const int32_t total_elements) {
  462|     20|  static const int32_t bytesoftype = 16;
  463|     20|  int32_t i;
  464|     20|  int j;
  465|     20|  __m256i ymm0[16], ymm1[16];
  466|       |
  467|  1.20k|  for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (467:15): [True: 1.18k, False: 20]
  ------------------
  468|       |    /* Fetch 32 elements (512 bytes) into 16 YMM registers. */
  469|  1.18k|    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.18k]
  ------------------
  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.51k, False: 1.18k]
  ------------------
  476|       |      /* Compute the low 32 bytes */
  477|  9.51k|      ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  478|       |      /* Compute the hi 32 bytes */
  479|  9.51k|      ymm1[8 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  480|  9.51k|    }
  481|       |    /* Shuffle 2-byte words */
  482|  10.7k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (482:17): [True: 9.51k, False: 1.18k]
  ------------------
  483|       |      /* Compute the low 32 bytes */
  484|  9.51k|      ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  485|       |      /* Compute the hi 32 bytes */
  486|  9.51k|      ymm0[8 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  487|  9.51k|    }
  488|       |    /* Shuffle 4-byte dwords */
  489|  10.7k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (489:17): [True: 9.51k, False: 1.18k]
  ------------------
  490|       |      /* Compute the low 32 bytes */
  491|  9.51k|      ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  492|       |      /* Compute the hi 32 bytes */
  493|  9.51k|      ymm1[8 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  494|  9.51k|    }
  495|       |
  496|       |    /* Shuffle 8-byte qwords */
  497|  10.7k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (497:17): [True: 9.51k, False: 1.18k]
  ------------------
  498|       |      /* Compute the low 32 bytes */
  499|  9.51k|      ymm0[j] = _mm256_unpacklo_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  500|       |      /* Compute the hi 32 bytes */
  501|  9.51k|      ymm0[8 + j] = _mm256_unpackhi_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  502|  9.51k|    }
  503|       |
  504|  10.7k|    for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (504:17): [True: 9.51k, False: 1.18k]
  ------------------
  505|  9.51k|      ymm1[j] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x20);
  506|  9.51k|      ymm1[j + 8] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x31);
  507|  9.51k|    }
  508|       |
  509|       |    /* Store the result vectors in proper order */
  510|  1.18k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (0 * sizeof(__m256i))), ymm1[0]);
  511|  1.18k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (1 * sizeof(__m256i))), ymm1[4]);
  512|  1.18k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (2 * sizeof(__m256i))), ymm1[2]);
  513|  1.18k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (3 * sizeof(__m256i))), ymm1[6]);
  514|  1.18k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (4 * sizeof(__m256i))), ymm1[1]);
  515|  1.18k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (5 * sizeof(__m256i))), ymm1[5]);
  516|  1.18k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (6 * sizeof(__m256i))), ymm1[3]);
  517|  1.18k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (7 * sizeof(__m256i))), ymm1[7]);
  518|  1.18k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (8 * sizeof(__m256i))), ymm1[8]);
  519|  1.18k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (9 * sizeof(__m256i))), ymm1[12]);
  520|  1.18k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (10 * sizeof(__m256i))), ymm1[10]);
  521|  1.18k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (11 * sizeof(__m256i))), ymm1[14]);
  522|  1.18k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (12 * sizeof(__m256i))), ymm1[9]);
  523|  1.18k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (13 * sizeof(__m256i))), ymm1[13]);
  524|  1.18k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (14 * sizeof(__m256i))), ymm1[11]);
  525|  1.18k|    _mm256_storeu_si256((__m256i*)(dest + (i * bytesoftype) + (15 * sizeof(__m256i))), ymm1[15]);
  526|  1.18k|  }
  527|     20|}
shuffle-avx2.c:unshuffle16_tiled_avx2:
  613|     55|                       const int32_t vectorizable_elements, const int32_t total_elements, const int32_t bytesoftype) {
  614|     55|  int32_t i;
  615|     55|  int j;
  616|     55|  __m256i ymm0[16], ymm1[16];
  617|       |
  618|     55|  const lldiv_t vecs_per_el = lldiv(bytesoftype, sizeof(__m128i));
  619|     55|  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|     55|  int32_t offset_into_type;
  624|    271|  for (offset_into_type = 0; offset_into_type < bytesoftype;
  ------------------
  |  Branch (624:30): [True: 216, False: 55]
  ------------------
  625|    216|       offset_into_type += (offset_into_type == 0 && vecs_rem > 0 ? vecs_rem : (int32_t)sizeof(__m128i))) {
  ------------------
  |  Branch (625:29): [True: 55, False: 161]
  |  Branch (625:54): [True: 42, False: 13]
  ------------------
  626|  4.21k|    for (i = 0; i < vectorizable_elements; i += sizeof(__m256i)) {
  ------------------
  |  Branch (626:17): [True: 3.99k, False: 216]
  ------------------
  627|       |      /* Load the first 16 bytes of 32 adjacent elements (512 bytes) into 16 YMM registers */
  628|  3.99k|      const uint8_t* const src_for_ith_element = src + i;
  629|  67.9k|      for (j = 0; j < 16; j++) {
  ------------------
  |  Branch (629:19): [True: 63.9k, False: 3.99k]
  ------------------
  630|  63.9k|        ymm0[j] = _mm256_loadu_si256((__m256i*)(src_for_ith_element + (total_elements * (offset_into_type + j))));
  631|  63.9k|      }
  632|       |
  633|       |      /* Shuffle bytes */
  634|  35.9k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (634:19): [True: 31.9k, False: 3.99k]
  ------------------
  635|       |        /* Compute the low 32 bytes */
  636|  31.9k|        ymm1[j] = _mm256_unpacklo_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  637|       |        /* Compute the hi 32 bytes */
  638|  31.9k|        ymm1[8 + j] = _mm256_unpackhi_epi8(ymm0[j * 2], ymm0[j * 2 + 1]);
  639|  31.9k|      }
  640|       |      /* Shuffle 2-byte words */
  641|  35.9k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (641:19): [True: 31.9k, False: 3.99k]
  ------------------
  642|       |        /* Compute the low 32 bytes */
  643|  31.9k|        ymm0[j] = _mm256_unpacklo_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  644|       |        /* Compute the hi 32 bytes */
  645|  31.9k|        ymm0[8 + j] = _mm256_unpackhi_epi16(ymm1[j * 2], ymm1[j * 2 + 1]);
  646|  31.9k|      }
  647|       |      /* Shuffle 4-byte dwords */
  648|  35.9k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (648:19): [True: 31.9k, False: 3.99k]
  ------------------
  649|       |        /* Compute the low 32 bytes */
  650|  31.9k|        ymm1[j] = _mm256_unpacklo_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  651|       |        /* Compute the hi 32 bytes */
  652|  31.9k|        ymm1[8 + j] = _mm256_unpackhi_epi32(ymm0[j * 2], ymm0[j * 2 + 1]);
  653|  31.9k|      }
  654|       |
  655|       |      /* Shuffle 8-byte qwords */
  656|  35.9k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (656:19): [True: 31.9k, False: 3.99k]
  ------------------
  657|       |        /* Compute the low 32 bytes */
  658|  31.9k|        ymm0[j] = _mm256_unpacklo_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  659|       |        /* Compute the hi 32 bytes */
  660|  31.9k|        ymm0[8 + j] = _mm256_unpackhi_epi64(ymm1[j * 2], ymm1[j * 2 + 1]);
  661|  31.9k|      }
  662|       |
  663|  35.9k|      for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (663:19): [True: 31.9k, False: 3.99k]
  ------------------
  664|  31.9k|        ymm1[j] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x20);
  665|  31.9k|        ymm1[j + 8] = _mm256_permute2x128_si256(ymm0[j], ymm0[j + 8], 0x31);
  666|  31.9k|      }
  667|       |
  668|       |      /* Store the result vectors in proper order */
  669|  3.99k|      const uint8_t* const dest_with_offset = dest + offset_into_type;
  670|  3.99k|      _mm256_storeu2_m128i(
  671|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x01) * bytesoftype),
  672|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x00) * bytesoftype), ymm1[0]);
  673|  3.99k|      _mm256_storeu2_m128i(
  674|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x03) * bytesoftype),
  675|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x02) * bytesoftype), ymm1[4]);
  676|  3.99k|      _mm256_storeu2_m128i(
  677|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x05) * bytesoftype),
  678|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x04) * bytesoftype), ymm1[2]);
  679|  3.99k|      _mm256_storeu2_m128i(
  680|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x07) * bytesoftype),
  681|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x06) * bytesoftype), ymm1[6]);
  682|  3.99k|      _mm256_storeu2_m128i(
  683|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x09) * bytesoftype),
  684|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x08) * bytesoftype), ymm1[1]);
  685|  3.99k|      _mm256_storeu2_m128i(
  686|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x0b) * bytesoftype),
  687|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x0a) * bytesoftype), ymm1[5]);
  688|  3.99k|      _mm256_storeu2_m128i(
  689|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x0d) * bytesoftype),
  690|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x0c) * bytesoftype), ymm1[3]);
  691|  3.99k|      _mm256_storeu2_m128i(
  692|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x0f) * bytesoftype),
  693|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x0e) * bytesoftype), ymm1[7]);
  694|  3.99k|      _mm256_storeu2_m128i(
  695|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x11) * bytesoftype),
  696|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x10) * bytesoftype), ymm1[8]);
  697|  3.99k|      _mm256_storeu2_m128i(
  698|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x13) * bytesoftype),
  699|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x12) * bytesoftype), ymm1[12]);
  700|  3.99k|      _mm256_storeu2_m128i(
  701|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x15) * bytesoftype),
  702|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x14) * bytesoftype), ymm1[10]);
  703|  3.99k|      _mm256_storeu2_m128i(
  704|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x17) * bytesoftype),
  705|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x16) * bytesoftype), ymm1[14]);
  706|  3.99k|      _mm256_storeu2_m128i(
  707|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x19) * bytesoftype),
  708|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x18) * bytesoftype), ymm1[9]);
  709|  3.99k|      _mm256_storeu2_m128i(
  710|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x1b) * bytesoftype),
  711|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x1a) * bytesoftype), ymm1[13]);
  712|  3.99k|      _mm256_storeu2_m128i(
  713|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x1d) * bytesoftype),
  714|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x1c) * bytesoftype), ymm1[11]);
  715|  3.99k|      _mm256_storeu2_m128i(
  716|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x1f) * bytesoftype),
  717|  3.99k|          (__m128i*)(dest_with_offset + (i + 0x1e) * bytesoftype), ymm1[15]);
  718|  3.99k|    }
  719|    216|  }
  720|     55|}

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

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

blosc2_unshuffle:
  436|  4.65k|                 const void* src, void* dest) {
  437|       |  /* Initialize the shuffle implementation if necessary. */
  438|  4.65k|  init_shuffle_implementation();
  439|       |
  440|  4.65k|  if (typesize < 1 || typesize > 256 || blocksize < 0) {
  ------------------
  |  Branch (440:7): [True: 0, False: 4.65k]
  |  Branch (440:23): [True: 0, False: 4.65k]
  |  Branch (440:41): [True: 0, False: 4.65k]
  ------------------
  441|      0|    return BLOSC2_ERROR_INVALID_PARAM;
  442|      0|  }
  443|       |
  444|       |  /* The implementation is initialized.
  445|       |     Dispatch to it's unshuffle routine. */
  446|  4.65k|  (host_implementation.unshuffle)(typesize, blocksize, src, dest);
  447|       |
  448|  4.65k|  return blocksize;
  449|  4.65k|}
bitunshuffle:
  484|  3.05k|                     const uint8_t format_version) {
  485|       |  /* Initialize the shuffle implementation if necessary. */
  486|  3.05k|  init_shuffle_implementation();
  487|  3.05k|  size_t size = blocksize / typesize;
  488|       |
  489|  3.05k|  if (format_version == 2) {
  ------------------
  |  Branch (489:7): [True: 836, False: 2.21k]
  ------------------
  490|       |    /* Starting from version 3, bitshuffle() works differently */
  491|    836|    if ((size % 8) == 0) {
  ------------------
  |  Branch (491:9): [True: 496, False: 340]
  ------------------
  492|       |      /* The number of elems is a multiple of 8 which is supported by
  493|       |         bitshuffle. */
  494|    496|      int ret = (int) (host_implementation.bitunshuffle)
  495|    496|          ((const void *) src, (void *) dest, blocksize / typesize, typesize);
  496|    496|      if (ret < 0) {
  ------------------
  |  Branch (496:11): [True: 0, False: 496]
  ------------------
  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|    496|    }
  502|    340|    else {
  503|    340|      memcpy(dest, src, blocksize);
  504|    340|    }
  505|    836|  }
  506|  2.21k|  else {
  507|       |    /* bitshuffle only supports a number of bytes that is a multiple of 8. */
  508|  2.21k|    size -= size % 8;
  509|  2.21k|    int ret = (int) (host_implementation.bitunshuffle)(src, dest, size, typesize);
  510|  2.21k|    if (ret < 0) {
  ------------------
  |  Branch (510:9): [True: 0, False: 2.21k]
  ------------------
  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.21k|    size_t offset = size * typesize;
  517|  2.21k|    memcpy((uint8_t *) dest + offset, (const uint8_t *) src + offset, blocksize - offset);
  518|  2.21k|  }
  519|       |
  520|  3.05k|  return blocksize;
  521|  3.05k|}
shuffle.c:init_shuffle_implementation:
  391|  7.70k|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.70k|#if defined(__GNUC__) || defined(__clang__)
  401|  7.70k|  if (__builtin_expect(!implementation_initialized, 0)) {
  ------------------
  |  Branch (401:7): [True: 1, False: 7.70k]
  ------------------
  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.70k|}
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:
 2331|      4|                                  int32_t *content_len) {
 2332|      4|  if (schunk == NULL || name == NULL || content == NULL || content_len == NULL) {
  ------------------
  |  Branch (2332:7): [True: 4, False: 0]
  |  Branch (2332:25): [True: 0, False: 0]
  |  Branch (2332:41): [True: 0, False: 0]
  |  Branch (2332:60): [True: 0, False: 0]
  ------------------
 2333|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2334|      4|    return BLOSC2_ERROR_INVALID_PARAM;
 2335|      4|  }
 2336|       |
 2337|      0|  int nmetalayer = blosc2_meta_exists(schunk, name);
 2338|      0|  if (nmetalayer < 0) {
  ------------------
  |  Branch (2338:7): [True: 0, False: 0]
  ------------------
 2339|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2340|      0|    return nmetalayer;
 2341|      0|  }
 2342|      0|  int32_t len = schunk->metalayers[nmetalayer]->content_len;
 2343|      0|  if (len < 0) {
  ------------------
  |  Branch (2343:7): [True: 0, False: 0]
  ------------------
 2344|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2345|      0|    return BLOSC2_ERROR_DATA;
 2346|      0|  }
 2347|      0|  *content_len = len;
 2348|      0|  if (len == 0) {
  ------------------
  |  Branch (2348:7): [True: 0, False: 0]
  ------------------
 2349|      0|    *content = NULL;
 2350|      0|    return nmetalayer;
 2351|      0|  }
 2352|      0|  *content = (uint8_t*)malloc((size_t)len);
 2353|      0|  if (*content == NULL) {
  ------------------
  |  Branch (2353:7): [True: 0, False: 0]
  ------------------
 2354|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2355|      0|    *content_len = 0;
 2356|      0|    return BLOSC2_ERROR_MEMORY_ALLOC;
 2357|      0|  }
 2358|      0|  if (len > 0 && schunk->metalayers[nmetalayer]->content == NULL) {
  ------------------
  |  Branch (2358:7): [True: 0, False: 0]
  |  Branch (2358:18): [True: 0, False: 0]
  ------------------
 2359|      0|    free(*content);
 2360|      0|    *content = NULL;
 2361|      0|    *content_len = 0;
 2362|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2363|      0|    return BLOSC2_ERROR_DATA;
 2364|      0|  }
 2365|      0|  memcpy(*content, schunk->metalayers[nmetalayer]->content, (size_t)len);
 2366|      0|  return nmetalayer;
 2367|      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.19k|void register_codecs(void) {
   19|       |  // May add .free func in future
   20|       |
   21|  3.19k|  blosc2_codec ndlz;
   22|  3.19k|  ndlz.compcode = BLOSC_CODEC_NDLZ;
   23|  3.19k|  ndlz.version = 1;
   24|  3.19k|  ndlz.complib = BLOSC_CODEC_NDLZ;
   25|  3.19k|  ndlz.encoder = &ndlz_compress;
   26|  3.19k|  ndlz.decoder = &ndlz_decompress;
   27|  3.19k|  ndlz.compname = "ndlz";
   28|       |  // ndlz.free = NULL; 
   29|  3.19k|  register_codec_private(&ndlz);
   30|       |
   31|  3.19k|#if defined(HAVE_ZFP)
   32|  3.19k|  blosc2_codec zfp_acc;
   33|  3.19k|  zfp_acc.compcode = BLOSC_CODEC_ZFP_FIXED_ACCURACY;
   34|  3.19k|  zfp_acc.version = 1;
   35|  3.19k|  zfp_acc.complib = BLOSC_CODEC_ZFP_FIXED_ACCURACY;
   36|  3.19k|  zfp_acc.encoder = &zfp_acc_compress;
   37|  3.19k|  zfp_acc.decoder = &zfp_acc_decompress;
   38|       |  // zfp_acc.free = NULL;
   39|  3.19k|  zfp_acc.compname = "zfp_acc";
   40|  3.19k|  register_codec_private(&zfp_acc);
   41|       |
   42|  3.19k|  blosc2_codec zfp_prec;
   43|  3.19k|  zfp_prec.compcode = BLOSC_CODEC_ZFP_FIXED_PRECISION;
   44|  3.19k|  zfp_prec.version = 1;
   45|  3.19k|  zfp_prec.complib = BLOSC_CODEC_ZFP_FIXED_PRECISION;
   46|  3.19k|  zfp_prec.encoder = &zfp_prec_compress;
   47|  3.19k|  zfp_prec.decoder = &zfp_prec_decompress;
   48|       |  // zfp_prec.free = NULL;
   49|  3.19k|  zfp_prec.compname = "zfp_prec";
   50|  3.19k|  register_codec_private(&zfp_prec);
   51|       |
   52|  3.19k|  blosc2_codec zfp_rate;
   53|  3.19k|  zfp_rate.compcode = BLOSC_CODEC_ZFP_FIXED_RATE;
   54|  3.19k|  zfp_rate.version = 1;
   55|  3.19k|  zfp_rate.complib = BLOSC_CODEC_ZFP_FIXED_RATE;
   56|  3.19k|  zfp_rate.encoder = &zfp_rate_compress;
   57|  3.19k|  zfp_rate.decoder = &zfp_rate_decompress;
   58|  3.19k|  zfp_rate.compname = "zfp_rate";
   59|       |  // zfp_rate.free = NULL;
   60|  3.19k|  register_codec_private(&zfp_rate);
   61|  3.19k|#endif
   62|       |
   63|  3.19k|  blosc2_codec openhtj2k;
   64|  3.19k|  openhtj2k.compcode = BLOSC_CODEC_OPENHTJ2K;
   65|  3.19k|  openhtj2k.version = 1;
   66|  3.19k|  openhtj2k.complib = BLOSC_CODEC_OPENHTJ2K;
   67|  3.19k|  openhtj2k.encoder = NULL;
   68|  3.19k|  openhtj2k.decoder = NULL;
   69|       |  // openhtj2k.free = NULL;
   70|  3.19k|  openhtj2k.compname = "openhtj2k";
   71|  3.19k|  register_codec_private(&openhtj2k);
   72|       |
   73|  3.19k|  blosc2_codec grok;
   74|  3.19k|  grok.compcode = BLOSC_CODEC_GROK;
   75|  3.19k|  grok.version = 1;
   76|  3.19k|  grok.complib = BLOSC_CODEC_GROK;
   77|  3.19k|  grok.encoder = NULL;
   78|  3.19k|  grok.decoder = NULL;
   79|       |  // grok.free = NULL;
   80|  3.19k|  grok.compname = "grok";
   81|  3.19k|  register_codec_private(&grok);
   82|       |
   83|  3.19k|  blosc2_codec openzl;
   84|  3.19k|  openzl.compcode = BLOSC_CODEC_OPENZL;
   85|  3.19k|  openzl.version = 1;
   86|  3.19k|  openzl.complib = BLOSC_CODEC_OPENZL;
   87|  3.19k|  openzl.encoder = NULL;
   88|  3.19k|  openzl.decoder = NULL;
   89|       |  // openzl.free = NULL;
   90|  3.19k|  openzl.compname = "openzl";
   91|  3.19k|  register_codec_private(&openzl);
   92|       |
   93|  3.19k|  blosc2_codec j2k;
   94|  3.19k|  j2k.compcode = BLOSC_CODEC_J2K;
   95|  3.19k|  j2k.version = 1;
   96|  3.19k|  j2k.complib = BLOSC_CODEC_J2K;
   97|  3.19k|  j2k.encoder = NULL;
   98|  3.19k|  j2k.decoder = NULL;
   99|       |  // j2k.free = NULL;
  100|  3.19k|  j2k.compname = "j2k";
  101|  3.19k|  register_codec_private(&j2k);
  102|       |
  103|  3.19k|  blosc2_codec htj2k;
  104|  3.19k|  htj2k.compcode = BLOSC_CODEC_HTJ2K;
  105|  3.19k|  htj2k.version = 1;
  106|  3.19k|  htj2k.complib = BLOSC_CODEC_HTJ2K;
  107|  3.19k|  htj2k.encoder = NULL;
  108|  3.19k|  htj2k.decoder = NULL;
  109|       |  // htj2k.free = NULL;
  110|  3.19k|  htj2k.compname = "htj2k";
  111|  3.19k|  register_codec_private(&htj2k);
  112|  3.19k|}

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

ndlz4_decompress:
  514|    681|                     uint8_t meta, blosc2_dparams *dparams) {
  515|    681|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|    681|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  516|    681|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|    681|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  517|    681|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    681|    do {                                            \
  |  |  105|    681|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 681]
  |  |  ------------------
  |  |  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|    681|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 681]
  |  |  ------------------
  ------------------
  518|    681|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    681|    do {                                            \
  |  |  105|    681|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 681]
  |  |  ------------------
  |  |  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|    681|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 681]
  |  |  ------------------
  ------------------
  519|       |
  520|    681|  uint8_t *ip = (uint8_t *) input;
  521|    681|  uint8_t *ip_limit = ip + input_len;
  522|    681|  uint8_t *op = (uint8_t *) output;
  523|    681|  uint8_t ndim;
  524|    681|  int32_t blockshape[2];
  525|    681|  int32_t eshape[2];
  526|    681|  uint8_t *buffercpy;
  527|    681|  uint8_t local_buffer[16];
  528|    681|  uint8_t token;
  529|    681|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < 8)) {
  ------------------
  |  |   30|    681|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 1, False: 680]
  |  |  ------------------
  ------------------
  530|      1|    return 0;
  531|      1|  }
  532|       |
  533|       |  /* we start with literal copy */
  534|    680|  ndim = *ip;
  535|    680|  ip++;
  536|    680|  if (ndim != 2) {
  ------------------
  |  Branch (536:7): [True: 0, False: 680]
  ------------------
  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|    680|  memcpy(&blockshape[0], ip, 4);
  541|    680|  ip += 4;
  542|    680|  memcpy(&blockshape[1], ip, 4);
  543|    680|  ip += 4;
  544|       |
  545|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3204
  546|    680|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (546:7): [True: 0, False: 680]
  |  Branch (546:25): [True: 0, False: 680]
  |  Branch (546:46): [True: 0, False: 680]
  ------------------
  547|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  548|      0|    return BLOSC2_ERROR_FAILURE;
  549|      0|  }
  550|       |
  551|    680|  eshape[0] = ((blockshape[0] + 3) / 4) * 4;
  552|    680|  eshape[1] = ((blockshape[1] + 3) / 4) * 4;
  553|       |
  554|    680|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|    680|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 8, False: 672]
  |  |  ------------------
  ------------------
  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|    672|  memset(op, 0, blockshape[0] * blockshape[1]);
  559|       |
  560|    672|  uint32_t i_stop[2];
  561|  2.01k|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (561:19): [True: 1.34k, False: 672]
  ------------------
  562|  1.34k|    i_stop[i] = eshape[i] / 4;
  563|  1.34k|  }
  564|       |
  565|       |  /* main loop */
  566|    672|  uint32_t ii[2];
  567|    672|  uint32_t padding[2] = {0};
  568|    672|  uint32_t ind = 0;
  569|    672|  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: 672]
  ------------------
  571|  33.5M|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (571:21): [True: 1.34k, False: 33.5M]
  ------------------
  572|  1.34k|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|  1.34k|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 0, False: 1.34k]
  |  |  ------------------
  ------------------
  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.34k|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (576:11): [True: 1.13k, False: 210]
  ------------------
  577|  1.13k|        padding[0] = (blockshape[0] % 4 == 0) ? 4 : blockshape[0] % 4;
  ------------------
  |  Branch (577:22): [True: 42, False: 1.09k]
  ------------------
  578|  1.13k|      } else {
  579|    210|        padding[0] = 4;
  580|    210|      }
  581|  1.34k|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (581:11): [True: 881, False: 466]
  ------------------
  582|    881|        padding[1] = (blockshape[1] % 4 == 0) ? 4 : blockshape[1] % 4;
  ------------------
  |  Branch (582:22): [True: 67, False: 814]
  ------------------
  583|    881|      } else {
  584|    466|        padding[1] = 4;
  585|    466|      }
  586|  1.34k|      token = *ip++;
  587|  1.34k|      if (token == 0) {    // no match
  ------------------
  |  Branch (587:11): [True: 85, False: 1.26k]
  ------------------
  588|     85|        buffercpy = ip;
  589|     85|        ip += padding[0] * padding[1];
  590|  1.26k|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (590:18): [True: 144, False: 1.11k]
  ------------------
  591|    144|        uint16_t offset = *((uint16_t *) ip);
  592|    144|        buffercpy = ip - offset - 1;
  593|    144|        ip += 2;
  594|  1.11k|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (594:18): [True: 51, False: 1.06k]
  ------------------
  595|     51|        buffercpy = cell_aux;
  596|     51|        memset(buffercpy, *ip, 16);
  597|     51|        ip++;
  598|  1.06k|      } else if (token >= 224) { // three rows match
  ------------------
  |  Branch (598:18): [True: 300, False: 767]
  ------------------
  599|    300|        buffercpy = local_buffer;
  600|    300|        uint16_t offset = *((uint16_t *) ip);
  601|    300|        offset += 3;
  602|    300|        ip += 2;
  603|    300|        int i, j, k;
  604|    300|        if ((token >> 3U) == 28) {
  ------------------
  |  Branch (604:13): [True: 76, False: 224]
  ------------------
  605|     76|          i = 1;
  606|     76|          j = 2;
  607|     76|          k = 3;
  608|    224|        } else {
  609|    224|          i = 0;
  610|    224|          if ((token >> 3U) < 30) {
  ------------------
  |  Branch (610:15): [True: 75, False: 149]
  ------------------
  611|     75|            j = 1;
  612|     75|            k = 2;
  613|    149|          } else {
  614|    149|            k = 3;
  615|    149|            if ((token >> 3U) == 30) {
  ------------------
  |  Branch (615:17): [True: 69, False: 80]
  ------------------
  616|     69|              j = 1;
  617|     80|            } else {
  618|     80|              j = 2;
  619|     80|            }
  620|    149|          }
  621|    224|        }
  622|    300|        memcpy(&buffercpy[i * 4], ip - offset, 4);
  623|    300|        memcpy(&buffercpy[j * 4], ip - offset + 4, 4);
  624|    300|        memcpy(&buffercpy[k * 4], ip - offset + 8, 4);
  625|    743|        for (int l = 0; l < 4; l++) {
  ------------------
  |  Branch (625:25): [True: 743, False: 0]
  ------------------
  626|    743|          if ((l != i) && (l != j) && (l != k)) {
  ------------------
  |  Branch (626:15): [True: 519, False: 224]
  |  Branch (626:27): [True: 375, False: 144]
  |  Branch (626:39): [True: 300, False: 75]
  ------------------
  627|    300|            memcpy(&buffercpy[l * 4], ip, 4);
  628|    300|            ip += 4;
  629|    300|            break;
  630|    300|          }
  631|    743|        }
  632|       |
  633|    767|      } else if ((token >= 128) && (token <= 191)) { // rows pair match
  ------------------
  |  Branch (633:18): [True: 511, False: 256]
  |  Branch (633:36): [True: 511, False: 0]
  ------------------
  634|    511|        buffercpy = local_buffer;
  635|    511|        uint16_t offset = *((uint16_t *) ip);
  636|    511|        offset += 3;
  637|    511|        ip += 2;
  638|    511|        int i, j;
  639|    511|        if (token == 128) {
  ------------------
  |  Branch (639:13): [True: 72, False: 439]
  ------------------
  640|     72|          i = 2;
  641|     72|          j = 3;
  642|    439|        } else {
  643|    439|          i = (token - 128) >> 5U;
  644|    439|          j = ((token - 128) >> 3U) - (i << 2U);
  645|    439|        }
  646|    511|        memcpy(&buffercpy[i * 4], ip - offset, 4);
  647|    511|        memcpy(&buffercpy[j * 4], ip - offset + 4, 4);
  648|  2.55k|        for (int k = 0; k < 4; k++) {
  ------------------
  |  Branch (648:25): [True: 2.04k, False: 511]
  ------------------
  649|  2.04k|          if ((k != i) && (k != j)) {
  ------------------
  |  Branch (649:15): [True: 1.53k, False: 511]
  |  Branch (649:27): [True: 1.02k, False: 511]
  ------------------
  650|  1.02k|            memcpy(&buffercpy[k * 4], ip, 4);
  651|  1.02k|            ip += 4;
  652|  1.02k|          }
  653|  2.04k|        }
  654|    511|      } 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.34k|      uint32_t orig = ii[0] * 4 * blockshape[1] + ii[1] * 4;
  686|  6.73k|      for (uint32_t i = 0; i < 4; i++) {
  ------------------
  |  Branch (686:28): [True: 5.38k, False: 1.34k]
  ------------------
  687|  5.38k|        if (i < padding[0]) {
  ------------------
  |  Branch (687:13): [True: 2.45k, False: 2.93k]
  ------------------
  688|  2.45k|          ind = orig + i * blockshape[1];
  689|  2.45k|          memcpy(&op[ind], buffercpy, padding[1]);
  690|  2.45k|        }
  691|  5.38k|        buffercpy += padding[1];
  692|  5.38k|      }
  693|  1.34k|      if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (693:11): [True: 0, False: 1.34k]
  ------------------
  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.34k|    }
  698|  33.5M|  }
  699|    672|  ind += padding[1];
  700|       |
  701|    672|  if ((int32_t)ind != (blockshape[0] * blockshape[1])) {
  ------------------
  |  Branch (701:7): [True: 0, False: 672]
  ------------------
  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|    672|  if (ind > (uint32_t) output_len) {
  ------------------
  |  Branch (705:7): [True: 0, False: 672]
  ------------------
  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|    672|  return (int) ind;
  711|    672|}

ndlz8_decompress:
  431|    233|                     uint8_t meta, blosc2_dparams *dparams) {
  432|    233|  BLOSC_UNUSED_PARAM(meta);
  ------------------
  |  |   28|    233|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  433|    233|  BLOSC_UNUSED_PARAM(dparams);
  ------------------
  |  |   28|    233|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  434|    233|  BLOSC_ERROR_NULL(input, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    233|    do {                                            \
  |  |  105|    233|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 233]
  |  |  ------------------
  |  |  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|    233|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 233]
  |  |  ------------------
  ------------------
  435|    233|  BLOSC_ERROR_NULL(output, BLOSC2_ERROR_NULL_POINTER);
  ------------------
  |  |  104|    233|    do {                                            \
  |  |  105|    233|        if ((pointer) == NULL) {                    \
  |  |  ------------------
  |  |  |  Branch (105:13): [True: 0, False: 233]
  |  |  ------------------
  |  |  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|    233|    } while (0)
  |  |  ------------------
  |  |  |  Branch (109:14): [Folded, False: 233]
  |  |  ------------------
  ------------------
  436|       |
  437|    233|  const int cell_shape = 8;
  438|    233|  const int cell_size = 64;
  439|    233|  uint8_t *ip = (uint8_t *) input;
  440|    233|  uint8_t *ip_limit = ip + input_len;
  441|    233|  uint8_t *op = (uint8_t *) output;
  442|    233|  uint8_t ndim;
  443|    233|  int32_t blockshape[2];
  444|    233|  int32_t eshape[2];
  445|    233|  uint8_t *buffercpy;
  446|    233|  uint8_t token;
  447|    233|  if (NDLZ_UNEXPECT_CONDITIONAL(input_len < 8)) {
  ------------------
  |  |   30|    233|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 1, False: 232]
  |  |  ------------------
  ------------------
  448|      1|    return 0;
  449|      1|  }
  450|       |
  451|       |  /* we start with literal copy */
  452|    232|  ndim = *ip;
  453|    232|  ip++;
  454|    232|  if (ndim != 2) {
  ------------------
  |  Branch (454:7): [True: 0, False: 232]
  ------------------
  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|    232|  memcpy(&blockshape[0], ip, 4);
  459|    232|  ip += 4;
  460|    232|  memcpy(&blockshape[1], ip, 4);
  461|    232|  ip += 4;
  462|       |
  463|       |  // Sanity check.  See https://www.cve.org/CVERecord?id=CVE-2024-3203
  464|    232|  if (output_len < 0 || blockshape[0] < 0 || blockshape[1] < 0) {
  ------------------
  |  Branch (464:7): [True: 0, False: 232]
  |  Branch (464:25): [True: 0, False: 232]
  |  Branch (464:46): [True: 0, False: 232]
  ------------------
  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|    232|  eshape[0] = ((blockshape[0] + 7) / cell_shape) * cell_shape;
  470|    232|  eshape[1] = ((blockshape[1] + 7) / cell_shape) * cell_shape;
  471|       |
  472|    232|  if (NDLZ_UNEXPECT_CONDITIONAL((int64_t)output_len < (int64_t)blockshape[0] * (int64_t)blockshape[1])) {
  ------------------
  |  |   30|    232|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 3, False: 229]
  |  |  ------------------
  ------------------
  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|    229|  memset(op, 0, blockshape[0] * blockshape[1]);
  477|       |
  478|    229|  int32_t i_stop[2];
  479|    687|  for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (479:19): [True: 458, False: 229]
  ------------------
  480|    458|    i_stop[i] = eshape[i] / cell_shape;
  481|    458|  }
  482|       |
  483|       |  /* main loop */
  484|    229|  int32_t ii[2];
  485|    229|  int32_t padding[2] = {0};
  486|    229|  int32_t ind = 0;
  487|    229|  uint8_t *local_buffer = malloc(cell_size);
  488|    229|  uint8_t *cell_aux = malloc(cell_size);
  489|    470|  for (ii[0] = 0; ii[0] < i_stop[0]; ++ii[0]) {
  ------------------
  |  Branch (489:19): [True: 246, False: 224]
  ------------------
  490|    496|    for (ii[1] = 0; ii[1] < i_stop[1]; ++ii[1]) {      // for each cell
  ------------------
  |  Branch (490:21): [True: 255, False: 241]
  ------------------
  491|    255|      if (NDLZ_UNEXPECT_CONDITIONAL(ip > ip_limit)) {
  ------------------
  |  |   30|    255|#define NDLZ_UNEXPECT_CONDITIONAL(c)  (__builtin_expect((c), 0))
  |  |  ------------------
  |  |  |  Branch (30:39): [True: 1, False: 254]
  |  |  ------------------
  ------------------
  492|      1|        free(local_buffer);
  493|      1|        free(cell_aux);
  494|      1|        BLOSC_TRACE_ERROR("Exceeding input length");
  ------------------
  |  |   93|      1|#define BLOSC_TRACE_ERROR(msg, ...) BLOSC_TRACE(error, msg, ##__VA_ARGS__)
  |  |  ------------------
  |  |  |  |   97|      1|    do {                                            \
  |  |  |  |   98|      1|        const char *__e = getenv("BLOSC_TRACE");    \
  |  |  |  |   99|      1|        if (!__e) { break; }                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:13): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  100|      1|        fprintf(stderr, "[%s] - " msg " (%s:%d)\n", #cat, ##__VA_ARGS__, __FILE__, __LINE__); \
  |  |  |  |  101|      0|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (101:13): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  495|      1|        return BLOSC2_ERROR_FAILURE;
  496|      1|      }
  497|    254|      if (ii[0] == i_stop[0] - 1) {
  ------------------
  |  Branch (497:11): [True: 236, False: 18]
  ------------------
  498|    236|        padding[0] = (blockshape[0] % cell_shape == 0) ? cell_shape : blockshape[0] % cell_shape;
  ------------------
  |  Branch (498:22): [True: 10, False: 226]
  ------------------
  499|    236|      } else {
  500|     18|        padding[0] = cell_shape;
  501|     18|      }
  502|    254|      if (ii[1] == i_stop[1] - 1) {
  ------------------
  |  Branch (502:11): [True: 243, False: 11]
  ------------------
  503|    243|        padding[1] = (blockshape[1] % cell_shape == 0) ? cell_shape : blockshape[1] % cell_shape;
  ------------------
  |  Branch (503:22): [True: 9, False: 234]
  ------------------
  504|    243|      } else {
  505|     11|        padding[1] = cell_shape;
  506|     11|      }
  507|    254|      token = *ip++;
  508|    254|      uint8_t match_type = (token >> 3U);
  509|    254|      if (token == 0) {    // no match
  ------------------
  |  Branch (509:11): [True: 70, False: 184]
  ------------------
  510|     70|        buffercpy = ip;
  511|     70|        ip += padding[0] * padding[1];
  512|    184|      } else if (token == (uint8_t) ((1U << 7U) | (1U << 6U))) {  // cell match
  ------------------
  |  Branch (512:18): [True: 73, False: 111]
  ------------------
  513|     73|        uint16_t offset = *((uint16_t *) ip);
  514|     73|        buffercpy = ip - offset - 1;
  515|     73|        ip += 2;
  516|    111|      } else if (token == (uint8_t) (1U << 6U)) { // whole cell of same element
  ------------------
  |  Branch (516:18): [True: 103, False: 8]
  ------------------
  517|    103|        buffercpy = cell_aux;
  518|    103|        memset(buffercpy, *ip, cell_size);
  519|    103|        ip++;
  520|    103|      } else if (match_type == 21) {    // triple match
  ------------------
  |  Branch (520:18): [True: 2, False: 6]
  ------------------
  521|      2|        buffercpy = local_buffer;
  522|      2|        int row = (int) (token & 7);
  523|      2|        if (row + 2 >= cell_shape) {
  ------------------
  |  Branch (523:13): [True: 0, False: 2]
  ------------------
  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|      2|        uint16_t offset = *((uint16_t *) ip);
  530|      2|        ip += 2;
  531|      8|        for (int l = 0; l < 3; l++) {
  ------------------
  |  Branch (531:25): [True: 6, False: 2]
  ------------------
  532|      6|          memcpy(&buffercpy[(row + l) * cell_shape],
  533|      6|                 ip - sizeof(token) - sizeof(offset) - offset + l * cell_shape, cell_shape);
  534|      6|        }
  535|     18|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (535:25): [True: 16, False: 2]
  ------------------
  536|     16|          if ((l < row) || (l > row + 2)) {
  ------------------
  |  Branch (536:15): [True: 2, False: 14]
  |  Branch (536:28): [True: 8, False: 6]
  ------------------
  537|     10|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  538|     10|            ip += cell_shape;
  539|     10|          }
  540|     16|        }
  541|      6|      } else if (match_type == 17) {    // pair match
  ------------------
  |  Branch (541:18): [True: 2, False: 4]
  ------------------
  542|      2|        buffercpy = local_buffer;
  543|      2|        int row = (int) (token & 7);
  544|      2|        if (row + 1 >= cell_shape) {
  ------------------
  |  Branch (544:13): [True: 0, False: 2]
  ------------------
  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|      2|        uint16_t offset = *((uint16_t *) ip);
  551|      2|        ip += 2;
  552|      6|        for (int l = 0; l < 2; l++) {
  ------------------
  |  Branch (552:25): [True: 4, False: 2]
  ------------------
  553|      4|          memcpy(&buffercpy[(row + l) * cell_shape],
  554|      4|                 ip - sizeof(token) - sizeof(offset) - offset + l * cell_shape, cell_shape);
  555|      4|        }
  556|     18|        for (int l = 0; l < cell_shape; l++) {
  ------------------
  |  Branch (556:25): [True: 16, False: 2]
  ------------------
  557|     16|          if ((l < row) || (l > row + 1)) {
  ------------------
  |  Branch (557:15): [True: 8, False: 8]
  |  Branch (557:28): [True: 4, False: 4]
  ------------------
  558|     12|            memcpy(&buffercpy[l * cell_shape], ip, cell_shape);
  559|     12|            ip += cell_shape;
  560|     12|          }
  561|     16|        }
  562|      4|      } else {
  563|      4|        free(local_buffer);
  564|      4|        free(cell_aux);
  565|      4|        BLOSC_TRACE_ERROR("Invalid token: %u at cell [%d, %d]\n", token, ii[0], ii[1]);
  ------------------
  |  |   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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  566|      4|        return BLOSC2_ERROR_FAILURE;
  567|      4|      }
  568|       |
  569|    250|      int32_t orig = ii[0] * cell_shape * blockshape[1] + ii[1] * cell_shape;
  570|  2.25k|      for (int32_t i = 0; i < (int32_t) cell_shape; i++) {
  ------------------
  |  Branch (570:27): [True: 2.00k, False: 250]
  ------------------
  571|  2.00k|        if (i < padding[0]) {
  ------------------
  |  Branch (571:13): [True: 1.23k, False: 770]
  ------------------
  572|  1.23k|          ind = orig + i * blockshape[1];
  573|  1.23k|          memcpy(&op[ind], buffercpy, padding[1]);
  574|  1.23k|        }
  575|  2.00k|        buffercpy += padding[1];
  576|  2.00k|      }
  577|    250|      if (ind > output_len) {
  ------------------
  |  Branch (577:11): [True: 0, False: 250]
  ------------------
  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|    250|    }
  584|    246|  }
  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|  12.1k|bytes16 simd_load(const void* ptr) { return _mm_loadu_si128((const __m128i*)ptr); }
simd_store:
   34|  12.1k|void simd_store(void* ptr, bytes16 x) { _mm_storeu_si128((__m128i*)ptr, x); }
simd_add:
   37|  12.1k|bytes16 simd_add(bytes16 a, bytes16 b) { return _mm_add_epi8(a, b); }
simd_duplane15:
   39|  12.1k|bytes16 simd_duplane15(bytes16 x) { return _mm_shuffle_epi8(x, _mm_set1_epi8(15)); }
simd_prefix_sum:
   42|  12.1k|{
   43|       |  // Sklansky-style sum from https://gist.github.com/rygorous/4212be0cd009584e4184e641ca210528
   44|  12.1k|  x = _mm_add_epi8(x, _mm_slli_epi64(x, 8));
   45|  12.1k|  x = _mm_add_epi8(x, _mm_slli_epi64(x, 16));
   46|  12.1k|  x = _mm_add_epi8(x, _mm_slli_epi64(x, 32));
   47|  12.1k|  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|  12.1k|  return x;
   49|  12.1k|}
simd_get_last:
   51|  1.63k|uint8_t simd_get_last(bytes16 x) { return (_mm_extract_epi16(x, 7) >> 8) & 0xFF; }
bytedelta_backward:
  133|    908|                       blosc2_dparams *dparams, uint8_t id) {
  134|    908|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|    908|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  135|       |
  136|    908|  int typesize = meta;
  137|    908|  if (typesize == 0) {
  ------------------
  |  Branch (137:7): [True: 1, False: 907]
  ------------------
  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|    907|  const int stream_len = length / typesize;
  147|  89.9k|  for (int ich = 0; ich < typesize; ++ich) {
  ------------------
  |  Branch (147:21): [True: 89.0k, False: 907]
  ------------------
  148|  89.0k|    int ip = 0;
  149|  89.0k|    uint8_t _v2 = 0;
  150|       |    // SIMD fetch 16 bytes from each channel, prefix-sum un-delta
  151|  89.0k|#if defined(CPU_HAS_SIMD)
  152|  89.0k|    bytes16 v2 = {0};
  153|  92.0k|    for (; ip < stream_len - 15; ip += 16) {
  ------------------
  |  Branch (153:12): [True: 3.00k, False: 89.0k]
  ------------------
  154|  3.00k|      bytes16 v = simd_load(input);
  155|  3.00k|      input += 16;
  156|       |      // un-delta via prefix sum
  157|  3.00k|      v2 = simd_add(simd_prefix_sum(v), simd_duplane15(v2));
  158|  3.00k|      simd_store(output, v2);
  159|  3.00k|      output += 16;
  160|  3.00k|    }
  161|  89.0k|    if (stream_len > 15) {
  ------------------
  |  Branch (161:9): [True: 1.63k, False: 87.3k]
  ------------------
  162|  1.63k|      _v2 = simd_get_last(v2);
  163|  1.63k|    }
  164|  89.0k|#endif // #if defined(CPU_HAS_SIMD)
  165|       |    // scalar leftover
  166|   104k|    for (; ip < stream_len; ip++) {
  ------------------
  |  Branch (166:12): [True: 15.0k, False: 89.0k]
  ------------------
  167|  15.0k|      uint8_t v = *input + _v2;
  168|  15.0k|      input++;
  169|  15.0k|      *output = v;
  170|  15.0k|      output++;
  171|  15.0k|      _v2 = v;
  172|  15.0k|    }
  173|  89.0k|  }
  174|       |
  175|    907|  return BLOSC2_ERROR_SUCCESS;
  176|    908|}
bytedelta_backward_buggy:
  226|    420|                             uint8_t meta, blosc2_dparams *dparams, uint8_t id) {
  227|    420|  BLOSC_UNUSED_PARAM(id);
  ------------------
  |  |   28|    420|#define BLOSC_UNUSED_PARAM(x) ((void)(x))
  ------------------
  228|       |
  229|    420|  int typesize = meta;
  230|    420|  if (typesize == 0) {
  ------------------
  |  Branch (230:7): [True: 0, False: 420]
  ------------------
  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|    420|  const int stream_len = length / typesize;
  240|  30.0k|  for (int ich = 0; ich < typesize; ++ich) {
  ------------------
  |  Branch (240:21): [True: 29.5k, False: 420]
  ------------------
  241|  29.5k|    int ip = 0;
  242|       |    // SIMD fetch 16 bytes from each channel, prefix-sum un-delta
  243|  29.5k|#if defined(CPU_HAS_SIMD)
  244|  29.5k|    bytes16 v2 = {0};
  245|  38.7k|    for (; ip < stream_len - 15; ip += 16) {
  ------------------
  |  Branch (245:12): [True: 9.16k, False: 29.5k]
  ------------------
  246|  9.16k|      bytes16 v = simd_load(input);
  247|  9.16k|      input += 16;
  248|       |      // un-delta via prefix sum
  249|  9.16k|      v2 = simd_add(simd_prefix_sum(v), simd_duplane15(v2));
  250|  9.16k|      simd_store(output, v2);
  251|  9.16k|      output += 16;
  252|  9.16k|    }
  253|  29.5k|#endif // #if defined(CPU_HAS_SIMD)
  254|       |    // scalar leftover
  255|  29.5k|    uint8_t _v2 = 0;
  256|  43.0k|    for (; ip < stream_len; ip++) {
  ------------------
  |  Branch (256:12): [True: 13.4k, False: 29.5k]
  ------------------
  257|  13.4k|      uint8_t v = *input + _v2;
  258|  13.4k|      input++;
  259|  13.4k|      *output = v;
  260|  13.4k|      output++;
  261|  13.4k|      _v2 = v;
  262|  13.4k|    }
  263|  29.5k|  }
  264|       |
  265|    420|  return BLOSC2_ERROR_SUCCESS;
  266|    420|}

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

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

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.19k|void register_tuners(void) {
   14|       |
   15|  3.19k|  blosc2_tuner btune;
   16|  3.19k|  btune.id = BLOSC_BTUNE;
   17|  3.19k|  btune.name = "btune";
   18|  3.19k|  btune.init = NULL;
   19|  3.19k|  btune.next_cparams = NULL;
   20|  3.19k|  btune.next_blocksize = NULL;
   21|  3.19k|  btune.update = NULL;
   22|  3.19k|  btune.free = NULL;
   23|       |
   24|  3.19k|  register_tuner_private(&btune);
   25|  3.19k|}

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

